protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness)
 {
     if (series is StepLineSeries)
     {
         StepLineSeries stepLineSeries = series as StepLineSeries;
         PartsCanvas.Children.Clear();
         foreach (SeriesPartBase t in stepLineSeries.Parts)
         {
             PartsCanvas.Children.Add(t.CreatePart());
         }
     }
 }
        override protected void DrawPath(SeriesBase series, System.Drawing.Pen pen)
        {
            if (series is StepLineSeries)
            {
                StepLineSeries stepLineSeries = series as StepLineSeries;
                var            points         = stepLineSeries.LinePoints;
                var            pointCount     = stepLineSeries.LinePoints.Count;
                if (RenderingMode == RenderingMode.Default)
                {
                    PartsCanvas.Children.Clear();
                    for (int i = 0; i < stepLineSeries.Parts.Count; i++)
                    {
                        var element = stepLineSeries.Parts[i].CreatePart();
                        if (element != null && !PartsCanvas.Children.Contains(element))
                        {
                            PartsCanvas.Children.Add(element);
                        }
                    }
                }
                else
                {
                    for (int i = 0; i < pointCount - 1; i++)
                    {
                        switch (RenderingMode)
                        {
                        case RenderingMode.GDIRendering:
                            GDIGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF());
                            break;

                        case RenderingMode.Default:
                            break;

                        case RenderingMode.WritableBitmap:
                            WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF());
                            break;

                        default:
                            break;
                        }
                    }
                    this.Collection.InvalidateBitmap();
                }
            }
        }
Esempio n. 3
0
        private SeriesCollection load5(ObservableCollection<Model> tmpCollection)
        {
            ObservableCollection<Model> Collection;
            SeriesCollection LineSeries;

            LineSeries = new SeriesCollection();
            Collection = new ObservableCollection<Model>();
            //readClimateAnomaly(Collection);
            Collection = tmpCollection;
            StepLineSeries Series1 = new StepLineSeries();
            Series1.XPath = "XData";
            Series1.YPath = "YValue";
            Series1.PointsSource = Collection;

            LineSeries.Add(Series1);
            return LineSeries;
        }