Exemple #1
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;
        }
        /// <summary>
        /// Generates the datas.
        /// </summary>
        public override void GenerateDatas()
        {
            LinePoints.Clear();
            if (!IsPointsGenerated)
                Parts.Clear();
            if (this.Points != null && this.SeriesContainer != null)
            {
                CalculateMinAndMax();
                ChartPoint oldPoint = new ChartPoint() { XValue = double.MinValue, YValue = double.MinValue };
                IntializePoints();
                for (int i = 0; i < this.Points.Count; i++)
                {
                    ChartPoint point = this.Points[i];
                    ChartPoint step = new ChartPoint();
                    if (!(i == this.Points.Count - 1))
                        step = this.Points[i + 1];
                    if (CheckValuePoint(oldPoint, point))
                    {
                        Point linePoint = NormalizePoint(new Point(point.XValue, point.YValue));
                        LinePoints.Add(linePoint);
                        if (!(i == this.Points.Count - 1))
                        {
                            Point stepPoint = NormalizePoint(new Point(point.XValue, step.YValue));
                            LinePoints.Add(stepPoint);
                        }
                    }
                }
                if (this.RenderingMode == RenderingMode.Default)
                {
                    if (!IsPointsGenerated)
                    {
                        if (!this.UseSinglePart)
                        {
                            for (int i = 0; i < LinePoints.Count - 2; i++)
                            {
                                StepLinePart stepLinePart = new StepLinePart(LinePoints[i], LinePoints[i + 1], LinePoints[i + 2]);
                                SetBindingForStrokeandStrokeThickness(stepLinePart);
                                this.Parts.Add(stepLinePart);
                            }
                        }
                        else
                        {
                            LineSinglePart stepLinePart = new LineSinglePart();
                            stepLinePart.LinePoints = this.LinePoints;
                            SetBindingForStrokeandStrokeThickness(stepLinePart);
                            this.Parts.Add(stepLinePart);
                        }
                        IsPointsGenerated = true;
                    }
                    else
                    {
                        int i = 0;
                        if (!this.UseSinglePart)
                        {
                            foreach (StepLinePart part in this.Parts)
                            {
                                part.StartPoint = LinePoints[i];
                                part.StepPoint = LinePoints[i + 1];
                                part.EndPoint = LinePoints[i + 2];
                                part.Refresh();
                                i++;
                            }
                        }
                        else
                        {
                            foreach (LineSinglePart part in this.Parts)
                            {
                                part.LinePoints = this.LinePoints;
                                part.Refresh();
                                i++;
                            }
                        }
                    }
                }
            }
            else
            {
              Parts.Clear();
            }

            if (this.SeriesContainer != null)
                this.SeriesContainer.Invalidate();
            IsRefreshed = false;
        }
Exemple #3
0
        /// <summary>
        /// Generates the datas.
        /// </summary>
        override public void GenerateDatas()
        {
            LinePoints.Clear();
            if (!IsPointsGenerated)
            {
                Parts.Clear();
            }
            if (this.Points != null && this.SeriesContainer != null)
            {
                CalculateMinAndMax();
                ChartPoint oldPoint = new ChartPoint()
                {
                    XValue = double.MinValue, YValue = double.MinValue
                };
                IntializePoints();
                for (int i = 0; i < this.Points.Count; i++)
                {
                    ChartPoint point = this.Points[i];
                    ChartPoint step  = new ChartPoint();
                    if (!(i == this.Points.Count - 1))
                    {
                        step = this.Points[i + 1];
                    }
                    if (CheckValuePoint(oldPoint, point))
                    {
                        Point linePoint = NormalizePoint(new Point(point.XValue, point.YValue));
                        LinePoints.Add(linePoint);
                        if (!(i == this.Points.Count - 1))
                        {
                            Point stepPoint = NormalizePoint(new Point(point.XValue, step.YValue));
                            LinePoints.Add(stepPoint);
                        }
                    }
                }
                if (this.RenderingMode == RenderingMode.Default)
                {
                    if (!IsPointsGenerated)
                    {
                        if (!this.UseSinglePart)
                        {
                            for (int i = 0; i < LinePoints.Count - 2; i++)
                            {
                                StepLinePart stepLinePart = new StepLinePart(LinePoints[i], LinePoints[i + 1], LinePoints[i + 2]);
                                SetBindingForStrokeandStrokeThickness(stepLinePart);
                                this.Parts.Add(stepLinePart);
                            }
                        }
                        else
                        {
                            LineSinglePart stepLinePart = new LineSinglePart();
                            stepLinePart.LinePoints = this.LinePoints;
                            SetBindingForStrokeandStrokeThickness(stepLinePart);
                            this.Parts.Add(stepLinePart);
                        }
                        IsPointsGenerated = true;
                    }
                    else
                    {
                        int i = 0;
                        if (!this.UseSinglePart)
                        {
                            foreach (StepLinePart part in this.Parts)
                            {
                                part.StartPoint = LinePoints[i];
                                part.StepPoint  = LinePoints[i + 1];
                                part.EndPoint   = LinePoints[i + 2];
                                part.Refresh();
                                i++;
                            }
                        }
                        else
                        {
                            foreach (LineSinglePart part in this.Parts)
                            {
                                part.LinePoints = this.LinePoints;
                                part.Refresh();
                                i++;
                            }
                        }
                    }
                }
            }
            else
            {
                Parts.Clear();
            }

            if (this.SeriesContainer != null)
            {
                this.SeriesContainer.Invalidate();
            }
            IsRefreshed = false;
        }
        /// <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;
        }