Ejemplo n.º 1
0
        /// <summary>
        /// Generates the datas.
        /// </summary>
        public override void GenerateDatas()
        {
            LowPoints.Clear();
            HighPoints.Clear();
            if (!IsPointsGenerated)
                Parts.Clear();
            if (Points != null && SeriesContainer != null)
            {
                CalculateMinAndMax();
                ChartPoint oldPoint = new ChartPoint { XValue = double.MinValue, YValue = double.MinValue };
                IntializePoints();
                int index = 0;
                foreach (ChartPoint point in Points)
                {
                    if (CheckValuePoint(oldPoint,point))
                    {
                        Point highPoint = NormalizePoint(new Point(point.XValue, point.YValue));
                        Point lowPoint = NormalizePoint(new Point(lowPoints[index].XValue, lowPoints[index].YValue));
                        HighPoints.Add(highPoint);
                        LowPoints.Add(lowPoint);
                        oldPoint = point;
                    }
                    index++;
                }
                if (RenderingMode == RenderingMode.Default)
                {
                    if (!IsPointsGenerated)
                    {
                        for (int i = 0; i < HighPoints.Count; i++)
                        {
                            LinePart linePart = new LinePart(HighPoints[i], LowPoints[i]);
                            SetBindingForStrokeandStrokeThickness(linePart);
                            Parts.Add(linePart);
                        }
                        IsPointsGenerated = true;
                    }
                    else
                    {
                        int i = 0;
                        foreach (LinePart part in Parts)
                        {
                            part.X1 = HighPoints[i].X;
                            part.Y1 = HighPoints[i].Y;
                            part.X2 = LowPoints[i].X;
                            part.Y2 = LowPoints[i].Y;
                            part.Refresh();
                            i++;
                        }
                    }

                }
            }
            else
            {
              Parts.Clear();
            }
            if (this.SeriesContainer != null)
                this.SeriesContainer.Invalidate();
            IsRefreshed = false;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Generates the datas.
        /// </summary>
        public override void GenerateDatas()
        {
            if (Points != null && SeriesContainer != null)
            {
                LinePoints = new PointCollection();
                if (!IsPointsGenerated)
                    Parts.Clear();
                CalculateMinAndMax();
                ChartPoint oldPoint = new ChartPoint { XValue = double.MinValue, YValue = double.MinValue };
                IntializePoints();
                foreach (ChartPoint point in Points)
                {
                    if (CheckValuePoint(oldPoint,point))
                    {
                        Point linePoint = NormalizePoint(new Point(point.XValue, point.YValue));
                        LinePoints.Add(linePoint);
                        oldPoint = point;
                    }
                }
                if (RenderingMode == RenderingMode.Default)
                {
                    if (!IsPointsGenerated)
                    {
                        if (!UseSinglePart)
                        {
                            for (int i = 0; i < LinePoints.Count - 1; i++)
                            {
                                if (CheckValue(LinePoints[i].X) && CheckValue(LinePoints[i].Y) && CheckValue(LinePoints[i + 1].X) && CheckValue(LinePoints[i + 1].Y))
                                {
                                    LinePart linePart = new LinePart(LinePoints[i], LinePoints[i + 1]);
                                    SetBindingForStrokeandStrokeThickness(linePart);
                                    Parts.Add(linePart);
                                }
                            }
                        }
                        else
                        {
                            LineSinglePart singlePart = new LineSinglePart(LinePoints);
                            SetBindingForStrokeandStrokeThickness(singlePart);
                            Parts.Add(singlePart);
                        }
                        IsPointsGenerated = true;
                    }
                    else
                    {
                        int i=0;
                        if (!UseSinglePart)
                        {
                            foreach (LinePart part in Parts)
                            {
                                if (CheckValue(LinePoints[i].X) && CheckValue(LinePoints[i].Y) && CheckValue(LinePoints[i + 1].X) && CheckValue(LinePoints[i + 1].Y))
                                {
                                    part.X1 = LinePoints[i].X;
                                    part.Y1 = LinePoints[i].Y;
                                    part.X2 = LinePoints[i + 1].X;
                                    part.Y2 = LinePoints[i + 1].Y;
                                    part.Refresh();
                                }
                                i++;
                            }
                        }
                        else
                        {
                            foreach (LineSinglePart part in Parts)
                            {
                                part.LinePoints = LinePoints;
                                part.Refresh();
                                i++;
                            }
                        }
                    }
                }
            }

            if (this.SeriesContainer != null)
                this.SeriesContainer.Invalidate();
            IsRefreshed = false;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Generates the datas.
 /// </summary>
 override public void GenerateDatas()
 {
     LowPoints.Clear();
     HighPoints.Clear();
     if (!IsPointsGenerated)
     {
         Parts.Clear();
     }
     if (Points != null && SeriesContainer != null)
     {
         CalculateMinAndMax();
         ChartPoint oldPoint = new ChartPoint {
             XValue = double.MinValue, YValue = double.MinValue
         };
         IntializePoints();
         int index = 0;
         foreach (ChartPoint point in Points)
         {
             if (CheckValuePoint(oldPoint, point))
             {
                 Point highPoint = NormalizePoint(new Point(point.XValue, point.YValue));
                 Point lowPoint  = NormalizePoint(new Point(lowPoints[index].XValue, lowPoints[index].YValue));
                 HighPoints.Add(highPoint);
                 LowPoints.Add(lowPoint);
                 oldPoint = point;
             }
             index++;
         }
         if (RenderingMode == RenderingMode.Default)
         {
             if (!IsPointsGenerated)
             {
                 for (int i = 0; i < HighPoints.Count; i++)
                 {
                     LinePart linePart = new LinePart(HighPoints[i], LowPoints[i]);
                     SetBindingForStrokeandStrokeThickness(linePart);
                     Parts.Add(linePart);
                 }
                 IsPointsGenerated = true;
             }
             else
             {
                 int i = 0;
                 foreach (LinePart part in Parts)
                 {
                     part.X1 = HighPoints[i].X;
                     part.Y1 = HighPoints[i].Y;
                     part.X2 = LowPoints[i].X;
                     part.Y2 = LowPoints[i].Y;
                     part.Refresh();
                     i++;
                 }
             }
         }
     }
     else
     {
         Parts.Clear();
     }
     if (this.SeriesContainer != null)
     {
         this.SeriesContainer.Invalidate();
     }
     IsRefreshed = false;
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Generates the datas.
        /// </summary>
        override public void GenerateDatas()
        {
            if (Points != null && SeriesContainer != null)
            {
                LinePoints = new PointCollection();
                if (!IsPointsGenerated)
                {
                    Parts.Clear();
                }
                CalculateMinAndMax();
                ChartPoint oldPoint = new ChartPoint {
                    XValue = double.MinValue, YValue = double.MinValue
                };
                IntializePoints();
                foreach (ChartPoint point in Points)
                {
                    if (CheckValuePoint(oldPoint, point))
                    {
                        Point linePoint = NormalizePoint(new Point(point.XValue, point.YValue));
                        LinePoints.Add(linePoint);
                        oldPoint = point;
                    }
                }
                if (RenderingMode == RenderingMode.Default)
                {
                    if (!IsPointsGenerated)
                    {
                        if (!UseSinglePart)
                        {
                            for (int i = 0; i < LinePoints.Count - 1; i++)
                            {
                                if (CheckValue(LinePoints[i].X) && CheckValue(LinePoints[i].Y) && CheckValue(LinePoints[i + 1].X) && CheckValue(LinePoints[i + 1].Y))
                                {
                                    LinePart linePart = new LinePart(LinePoints[i], LinePoints[i + 1]);
                                    SetBindingForStrokeandStrokeThickness(linePart);
                                    Parts.Add(linePart);
                                }
                            }
                        }
                        else
                        {
                            LineSinglePart singlePart = new LineSinglePart(LinePoints);
                            SetBindingForStrokeandStrokeThickness(singlePart);
                            Parts.Add(singlePart);
                        }
                        IsPointsGenerated = true;
                    }
                    else
                    {
                        int i = 0;
                        if (!UseSinglePart)
                        {
                            foreach (LinePart part in Parts)
                            {
                                if (CheckValue(LinePoints[i].X) && CheckValue(LinePoints[i].Y) && CheckValue(LinePoints[i + 1].X) && CheckValue(LinePoints[i + 1].Y))
                                {
                                    part.X1 = LinePoints[i].X;
                                    part.Y1 = LinePoints[i].Y;
                                    part.X2 = LinePoints[i + 1].X;
                                    part.Y2 = LinePoints[i + 1].Y;
                                    part.Refresh();
                                }
                                i++;
                            }
                        }
                        else
                        {
                            foreach (LineSinglePart part in Parts)
                            {
                                part.LinePoints = LinePoints;
                                part.Refresh();
                                i++;
                            }
                        }
                    }
                }
            }

            if (this.SeriesContainer != null)
            {
                this.SeriesContainer.Invalidate();
            }
            IsRefreshed = false;
        }