protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is PieSeries) { var points = new PointCollection(); var pointCount = 0; var partsCollection = new PartsCollection(); if (series is PieSeries) { var pieSeries = series as PieSeries; points = pieSeries.PiePoints; pointCount = pieSeries.PiePoints.Count; partsCollection = pieSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement renderElement = partsCollection[i].CreatePart(); if (renderElement != null && !PartsCanvas.Children.Contains(renderElement)) { PartsCanvas.Children.Add(renderElement); } } } } }
private void DrawFilledPath(SeriesBase series, System.Drawing.Pen pen,System.Drawing.Brush brush) { var path = new System.Drawing.Drawing2D.GraphicsPath(); if (series is AreaSeries) { path.StartFigure(); AreaSeries areaSeries = series as AreaSeries; var points = areaSeries.AreaPoints; var pointCount = areaSeries.AreaPoints.Count; for (int i = 0; i < pointCount - 1; i++) { System.Drawing.PointF startPoint = points[i].AsDrawingPointF(); System.Drawing.PointF endPoint = points[i + 1].AsDrawingPointF(); path.AddLine(startPoint, endPoint); } path.CloseAllFigures(); switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.FillPath(brush, path); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: WritableBitmapGraphics.FillPath(brush, path); break; default: break; } } }
protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is LineSeries || series is HiLoSeries) { PartsCollection partsCollection = new PartsCollection(); if (series is LineSeries) { LineSeries lineSeries = series as LineSeries; partsCollection = lineSeries.Parts; } else if (series is HiLoSeries) { HiLoSeries lineSeries = series as HiLoSeries; partsCollection = lineSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement element = partsCollection[i].CreatePart(); if (element != null) { PartsCanvas.Children.Add(element); } } } } }
override protected void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is PieSeries) { var points = new PointCollection(); var pointCount = 0; var partsCollection = new PartsCollection(); if (series is PieSeries) { var pieSeries = series as PieSeries; points = pieSeries.PiePoints; pointCount = pieSeries.PiePoints.Count; partsCollection = pieSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement renderElement = partsCollection[i].CreatePart(); if (renderElement != null && !PartsCanvas.Children.Contains(renderElement)) { PartsCanvas.Children.Add(renderElement); } } } else { if (series is PieSeries) { for (int i = 0; i < pointCount; i++) { switch (RenderingMode) { case RenderingMode.GDIRendering: //GDIGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: //this.WritableBitmap.Lock(); //WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); // this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
private static void OnPointsChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args) { SeriesBase series = sender as SeriesBase; if (series != null) { series.PointsChanged(args); } }
override protected void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is ColumnSeries) { var points = new PointCollection(); var pointCount = 0; var rects = new List <Rect>(); ColumnSeries columnSeries = series as ColumnSeries; points = columnSeries.ColumnPoints; pointCount = columnSeries.ColumnPoints.Count; rects = columnSeries.Rects; System.Drawing.Brush fill = columnSeries.Fill.AsDrawingBrush(); System.Drawing.Pen fillPen = new System.Drawing.Pen(fill); if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < columnSeries.Parts.Count; i++) { System.Windows.Shapes.Rectangle element = (columnSeries.Parts[i] as ColumnPart).CreatePart() as System.Windows.Shapes.Rectangle; if (element != null && !PartsCanvas.Children.Contains(element)) { PartsCanvas.Children.Add(element); } } } else { for (int i = 0; i < rects.Count; i++) { Rect rect = rects[i]; switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawRectangle(pen, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); GDIGraphics.FillRectangle(fill, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawRectangle(pen, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); WritableBitmapGraphics.FillRectangle(fill, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); this.WritableBitmap.Unlock(); break; default: break; } } this.Collection.InvalidateBitmap(); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is PieSeries) { var points = new PointCollection(); var pointCount = 0; var partsCollection = new PartsCollection(); if (series is PieSeries) { var pieSeries = series as PieSeries; points = pieSeries.PiePoints; pointCount = pieSeries.PiePoints.Count; partsCollection = pieSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement renderElement = partsCollection[i].CreatePart(); if (renderElement != null && !PartsCanvas.Children.Contains(renderElement)) PartsCanvas.Children.Add(renderElement); } } else { if (series is PieSeries) { for (int i = 0; i < pointCount; i++) { switch (RenderingMode) { case RenderingMode.GDIRendering: //GDIGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: //this.WritableBitmap.Lock(); //WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); // this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is SplineSeries) { SplineSeries splineSeries = series as SplineSeries; PartsCanvas.Children.Clear(); for (int i = 0; i < splineSeries.Parts.Count; i++) { PartsCanvas.Children.Add(splineSeries.Parts[i].CreatePart()); } } }
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is AreaSeries) { AreaSeries areaSeries = series as AreaSeries; PartsCanvas.Children.Clear(); foreach (SeriesPartBase part in areaSeries.Parts) { PartsCanvas.Children.Add(part.CreatePart()); } } }
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()); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is ColumnSeries) { var points = new PointCollection(); var pointCount = 0; var rects = new List<Rect>(); ColumnSeries columnSeries = series as ColumnSeries; points = columnSeries.ColumnPoints; pointCount = columnSeries.ColumnPoints.Count; rects = columnSeries.Rects; System.Drawing.Brush fill = columnSeries.Fill.AsDrawingBrush(); System.Drawing.Pen fillPen = new System.Drawing.Pen(fill); if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < columnSeries.Parts.Count; i++) { System.Windows.Shapes.Rectangle element = (columnSeries.Parts[i] as ColumnPart).CreatePart() as System.Windows.Shapes.Rectangle; if (element != null && !PartsCanvas.Children.Contains(element)) PartsCanvas.Children.Add(element); } } else { for (int i = 0; i < rects.Count; i++) { Rect rect=rects[i]; switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawRectangle(pen, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); GDIGraphics.FillRectangle(fill, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawRectangle(pen, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); WritableBitmapGraphics.FillRectangle(fill, (float)rect.X, (float)rect.Y, (float)rect.Width, (float)rect.Height); this.WritableBitmap.Unlock(); break; default: break; } } this.Collection.InvalidateBitmap(); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is AreaSeries) { AreaSeries areaSeries = series as AreaSeries; var brush = (this.Series as AreaSeries).Fill.AsDrawingBrush(); var points = areaSeries.AreaPoints; var pointCount = areaSeries.AreaPoints.Count; if (RenderingMode == RenderingMode.Default) { PartsCanvas.Children.Clear(); for (int i = 0; i < areaSeries.Parts.Count; i++) { var element = areaSeries.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: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); this.WritableBitmap.AddDirtyRect(new Int32Rect(0, 0, WritableBitmap.PixelWidth, WritableBitmap.PixelHeight)); this.WritableBitmap.Unlock(); break; default: break; } } DrawFilledPath(areaSeries, pen, brush); } this.Collection.InvalidateBitmap(); } }
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is HiLoOpenCloseSeries) { PartsCollection partsCollection = new PartsCollection(); partsCollection = (series as HiLoOpenCloseSeries).Parts; if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { PartsCanvas.Children.Add(partsCollection[i].CreatePart()); } } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is SplineSeries) { SplineSeries splineSeries = series as SplineSeries; var points = splineSeries.SplinePoints; var pointCount = splineSeries.SplinePoints.Count; if (RenderingMode == RenderingMode.Default) { PartsCanvas.Children.Clear(); for (int i = 0; i < splineSeries.Parts.Count; i++) { var element = splineSeries.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.DrawBezier(pen, points[i].AsDrawingPointF(), splineSeries.FirstControlPoints[i].AsDrawingPointF(), splineSeries.SecondControlPoints[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawBezier(pen, points[i].AsDrawingPointF(), splineSeries.FirstControlPoints[i].AsDrawingPointF(), splineSeries.SecondControlPoints[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); this.WritableBitmap.AddDirtyRect(new Int32Rect(0, 0, WritableBitmap.PixelWidth, WritableBitmap.PixelHeight)); this.WritableBitmap.Unlock(); break; default: break; } } this.Collection.InvalidateBitmap(); } } }
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(); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is AreaSeries) { AreaSeries areaSeries = series as AreaSeries; var brush = (this.Series as AreaSeries).Fill.AsDrawingBrush(); var points = areaSeries.AreaPoints; var pointCount = areaSeries.AreaPoints.Count; if (RenderingMode == RenderingMode.Default) { PartsCanvas.Children.Clear(); for (int i = 0; i < areaSeries.Parts.Count; i++) { var element = areaSeries.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: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); this.WritableBitmap.AddDirtyRect(new Int32Rect(0, 0, WritableBitmap.PixelWidth, WritableBitmap.PixelHeight)); this.WritableBitmap.Unlock(); break; default: break; } } DrawFilledPath(areaSeries, pen, brush); } this.Collection.InvalidateBitmap(); } }
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is ColumnSeries) { ColumnSeries columnSeries = series as ColumnSeries; if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < columnSeries.Parts.Count; i++) { var columnPart = columnSeries.Parts[i] as ColumnPart; if (columnPart != null) { Rectangle element = columnPart.CreatePart() as Rectangle; PartsCanvas.Children.Add(element); } } } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is SplineSeries) { SplineSeries splineSeries = series as SplineSeries; var points = splineSeries.SplinePoints; var pointCount = splineSeries.SplinePoints.Count; if (RenderingMode == RenderingMode.Default) { PartsCanvas.Children.Clear(); for (int i = 0; i < splineSeries.Parts.Count; i++) { var element = splineSeries.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.DrawBezier(pen, points[i].AsDrawingPointF(), splineSeries.FirstControlPoints[i].AsDrawingPointF(), splineSeries.SecondControlPoints[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawBezier(pen, points[i].AsDrawingPointF(), splineSeries.FirstControlPoints[i].AsDrawingPointF(), splineSeries.SecondControlPoints[i].AsDrawingPointF(), points[i + 1].AsDrawingPointF()); this.WritableBitmap.AddDirtyRect(new Int32Rect(0, 0, WritableBitmap.PixelWidth, WritableBitmap.PixelHeight)); this.WritableBitmap.Unlock(); break; default: break; } } this.Collection.InvalidateBitmap(); } } }
protected override 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(); } } }
private void DrawFilledPath(SeriesBase series, System.Drawing.Pen pen, System.Drawing.Brush brush) { var path = new System.Drawing.Drawing2D.GraphicsPath(); if (series is AreaSeries) { path.StartFigure(); AreaSeries areaSeries = series as AreaSeries; var points = areaSeries.AreaPoints; var pointCount = areaSeries.AreaPoints.Count; for (int i = 0; i < pointCount - 1; i++) { System.Drawing.PointF startPoint = points[i].AsDrawingPointF(); System.Drawing.PointF endPoint = points[i + 1].AsDrawingPointF(); path.AddLine(startPoint, endPoint); } path.CloseAllFigures(); switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.FillPath(brush, path); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: WritableBitmapGraphics.FillPath(brush, path); break; default: break; } } }
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is ScatterSeries || series is BubbleSeries) { var points = new PointCollection(); var pointCount = 0; float size = 0; PartsCollection partsCollection = new PartsCollection(); if (series is ScatterSeries) { ScatterSeries scatterSeries = series as ScatterSeries; points = scatterSeries.ScatterPoints; pointCount = scatterSeries.ScatterPoints.Count; size = (float)scatterSeries.ScatterSize; partsCollection = scatterSeries.Parts; } else if (series is BubbleSeries) { BubbleSeries scatterSeries = series as BubbleSeries; points = scatterSeries.BubblePoints; pointCount = scatterSeries.BubblePoints.Count; partsCollection = scatterSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { Ellipse element = (Ellipse)partsCollection[i].CreatePart(); Canvas.SetLeft(element, points[i].X - (element.Width / 2)); Canvas.SetTop(element, points[i].Y - (element.Height / 2)); PartsCanvas.Children.Add(element); } } } }
protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is PieSeries) { var points = new PointCollection(); var pointCount = 0; var partsCollection = new PartsCollection(); if (series is PieSeries) { var pieSeries = series as PieSeries; points = pieSeries.PiePoints; pointCount = pieSeries.PiePoints.Count; partsCollection = pieSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement renderElement = partsCollection[i].CreatePart(); if (renderElement != null && !PartsCanvas.Children.Contains(renderElement)) PartsCanvas.Children.Add(renderElement); } } } }
override protected void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is ScatterSeries || series is BubbleSeries) { var points = new PointCollection(); var sizes = new List <double>(); var pointCount = 0; float size = 0; var brush = new SolidColorBrush(Colors.Blue).AsDrawingBrush(); PartsCollection partsCollection = new PartsCollection(); if (series is ScatterSeries) { ScatterSeries scatterSeries = series as ScatterSeries; points = scatterSeries.ScatterPoints; pointCount = scatterSeries.ScatterPoints.Count; size = (float)scatterSeries.ScatterSize; brush = (this.Series as ScatterSeries).Fill.AsDrawingBrush(); partsCollection = scatterSeries.Parts; } else if (series is BubbleSeries) { BubbleSeries scatterSeries = series as BubbleSeries; points = scatterSeries.BubblePoints; pointCount = scatterSeries.BubblePoints.Count; //size = (float)scatterSeries.; sizes = scatterSeries.SizeValues; brush = (this.Series as FillSeriesBase).Fill.AsDrawingBrush(); partsCollection = scatterSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { Ellipse element = (Ellipse)partsCollection[i].CreatePart(); if (element != null && !PartsCanvas.Children.Contains(element)) { PartsCanvas.Children.Add(element); } } } else { for (int i = 0; i < pointCount; i++) { if (series is ScatterSeries) { switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); GDIGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); WritableBitmapGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); this.WritableBitmap.Unlock(); break; default: break; } } else { size = (int)sizes[i]; switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); GDIGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); WritableBitmapGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is HiLoOpenCloseSeries) { var points = new PointCollection(); var lowPoints = new PointCollection(); var openPoints = new PointCollection(); var closePoints = new PointCollection(); var openOffPoints = new PointCollection(); var closeOffPoints = new PointCollection(); var pointCount = 0; PartsCollection partsCollection = new PartsCollection(); if (series is HiLoOpenCloseSeries) { HiLoOpenCloseSeries lineSeries = series as HiLoOpenCloseSeries; points = lineSeries.HighPoints; lowPoints = lineSeries.LowPoints; openPoints = lineSeries.OpenPoints; closePoints = lineSeries.ClosePoints; openOffPoints = lineSeries.OpenOffPoints; closeOffPoints = lineSeries.CloseOffPoints; pointCount = lineSeries.HighPoints.Count; partsCollection = lineSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { var element = partsCollection[i].CreatePart(); if (element != null && !PartsCanvas.Children.Contains(element)) PartsCanvas.Children.Add(element); } } else { if (series is HiLoOpenCloseSeries) { for (int i = 0; i < pointCount; i++) { switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawLine(pen, points[i].AsDrawingPointF(), lowPoints[i].AsDrawingPointF()); GDIGraphics.DrawLine(pen, openOffPoints[i].AsDrawingPointF(), openPoints[i].AsDrawingPointF()); GDIGraphics.DrawLine(pen, closeOffPoints[i].AsDrawingPointF(), closePoints[i].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), lowPoints[i].AsDrawingPointF()); WritableBitmapGraphics.DrawLine(pen, openOffPoints[i].AsDrawingPointF(), openPoints[i].AsDrawingPointF()); WritableBitmapGraphics.DrawLine(pen, closeOffPoints[i].AsDrawingPointF(), closePoints[i].AsDrawingPointF()); this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
protected override void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is ScatterSeries || series is BubbleSeries) { var points = new PointCollection(); var sizes=new List<double>(); var pointCount = 0; float size = 0; var brush=new SolidColorBrush(Colors.Blue).AsDrawingBrush(); PartsCollection partsCollection = new PartsCollection(); if(series is ScatterSeries) { ScatterSeries scatterSeries = series as ScatterSeries; points = scatterSeries.ScatterPoints; pointCount = scatterSeries.ScatterPoints.Count; size = (float)scatterSeries.ScatterSize; brush = (this.Series as ScatterSeries).Fill.AsDrawingBrush(); partsCollection = scatterSeries.Parts; } else if (series is BubbleSeries) { BubbleSeries scatterSeries = series as BubbleSeries; points = scatterSeries.BubblePoints; pointCount = scatterSeries.BubblePoints.Count; //size = (float)scatterSeries.; sizes=scatterSeries.SizeValues; brush = (this.Series as FillSeriesBase).Fill.AsDrawingBrush(); partsCollection = scatterSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { Ellipse element = (Ellipse)partsCollection[i].CreatePart(); if (element != null && !PartsCanvas.Children.Contains(element)) PartsCanvas.Children.Add(element); } } else { for (int i = 0; i < pointCount; i++) { if (series is ScatterSeries) { switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); GDIGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); WritableBitmapGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); this.WritableBitmap.Unlock(); break; default: break; } } else { size=(int)sizes[i]; switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); GDIGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawEllipse(pen, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); WritableBitmapGraphics.FillEllipse(brush, points[i].AsDrawingPointF().X - size / 2, points[i].AsDrawingPointF().Y - size / 2, size, size); this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
protected virtual void DrawPath(SeriesBase series, System.Drawing.Pen pen)
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected virtual void DrawPath(SeriesBase series, Brush brush, double strokeThickness) #endif { }
protected override void DrawPath(SeriesBase series, Brush brush, double strokeThickness) { if (series is LineSeries || series is HiLoSeries) { PartsCollection partsCollection = new PartsCollection(); if (series is LineSeries) { LineSeries lineSeries = series as LineSeries; partsCollection = lineSeries.Parts; } else if (series is HiLoSeries) { HiLoSeries lineSeries = series as HiLoSeries; partsCollection = lineSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { UIElement element = partsCollection[i].CreatePart(); if (element != null) PartsCanvas.Children.Add(element); } } } }
override protected void DrawPath(SeriesBase series, System.Drawing.Pen pen) { if (series is HiLoOpenCloseSeries) { var points = new PointCollection(); var lowPoints = new PointCollection(); var openPoints = new PointCollection(); var closePoints = new PointCollection(); var openOffPoints = new PointCollection(); var closeOffPoints = new PointCollection(); var pointCount = 0; PartsCollection partsCollection = new PartsCollection(); if (series is HiLoOpenCloseSeries) { HiLoOpenCloseSeries lineSeries = series as HiLoOpenCloseSeries; points = lineSeries.HighPoints; lowPoints = lineSeries.LowPoints; openPoints = lineSeries.OpenPoints; closePoints = lineSeries.ClosePoints; openOffPoints = lineSeries.OpenOffPoints; closeOffPoints = lineSeries.CloseOffPoints; pointCount = lineSeries.HighPoints.Count; partsCollection = lineSeries.Parts; } if (RenderingMode == RenderingMode.Default) { for (int i = 0; i < partsCollection.Count; i++) { var element = partsCollection[i].CreatePart(); if (element != null && !PartsCanvas.Children.Contains(element)) { PartsCanvas.Children.Add(element); } } } else { if (series is HiLoOpenCloseSeries) { for (int i = 0; i < pointCount; i++) { switch (RenderingMode) { case RenderingMode.GDIRendering: GDIGraphics.DrawLine(pen, points[i].AsDrawingPointF(), lowPoints[i].AsDrawingPointF()); GDIGraphics.DrawLine(pen, openOffPoints[i].AsDrawingPointF(), openPoints[i].AsDrawingPointF()); GDIGraphics.DrawLine(pen, closeOffPoints[i].AsDrawingPointF(), closePoints[i].AsDrawingPointF()); break; case RenderingMode.Default: break; case RenderingMode.WritableBitmap: this.WritableBitmap.Lock(); WritableBitmapGraphics.DrawLine(pen, points[i].AsDrawingPointF(), lowPoints[i].AsDrawingPointF()); WritableBitmapGraphics.DrawLine(pen, openOffPoints[i].AsDrawingPointF(), openPoints[i].AsDrawingPointF()); WritableBitmapGraphics.DrawLine(pen, closeOffPoints[i].AsDrawingPointF(), closePoints[i].AsDrawingPointF()); this.WritableBitmap.Unlock(); break; default: break; } } } this.Collection.InvalidateBitmap(); } } }
/// <summary> /// Draws the path. /// </summary> /// <param name="series">The series.</param> /// <param name="brush">The brush.</param> /// <param name="strokeThickness">The stroke thickness.</param> protected virtual void DrawPath(SeriesBase series, Brush brush,double strokeThickness) #endif { }