public CartesianChartCore(ICartesianChartView <TDrawingContext> view, Canvas <TDrawingContext> canvas) { this.canvas = canvas; chartView = view; updateThrottler = new ActionThrottler(TimeSpan.FromSeconds(300)); updateThrottler.Unlocked += UpdateThrottlerUnlocked; }
public CartesianChart( ICartesianChartView <TDrawingContext> view, Action <LiveChartsSettings> defaultPlatformConfig, Canvas <TDrawingContext> canvas) : base(canvas, defaultPlatformConfig) { chartView = view; }
/// <summary> /// Initializes a new instance of the <see cref="SKCartesianChart"/> class. /// </summary> /// <param name="view">The view.</param> public SKCartesianChart(ICartesianChartView <SkiaSharpDrawingContext> view) : this() { XAxes = view.XAxes; YAxes = view.YAxes; Series = view.Series; Sections = view.Sections; DrawMarginFrame = view.DrawMarginFrame; }
public CartesianChart( ICartesianChartView <TDrawingContext> view, Action <LiveChartsSettings> defaultPlatformConfig, MotionCanvas <TDrawingContext> canvas) : base(canvas, defaultPlatformConfig) { chartView = view; view.PointStates.Chart = this; foreach (var item in view.PointStates.GetStates()) { if (item.Fill != null) { item.Fill.ZIndex += 1000000; canvas.AddDrawableTask(item.Fill); } if (item.Stroke != null) { item.Stroke.ZIndex += 1000000; canvas.AddDrawableTask(item.Stroke); } } }
void IChartLegend <SkiaDrawingContext> .Draw(ICartesianChartView <SkiaDrawingContext> view) { var series = view.Series; var legendOrientation = view.LegendOrientation; var legendPosition = view.LegendPosition; Series = series; switch (legendPosition) { case LegendPosition.None: Visibility = Visibility.Collapsed; break; case LegendPosition.Top: Visibility = Visibility.Visible; if (legendOrientation == LegendOrientation.Auto) { Orientation = Orientation.Horizontal; } Dock = Dock.Top; break; case LegendPosition.Left: Visibility = Visibility.Visible; if (legendOrientation == LegendOrientation.Auto) { Orientation = Orientation.Vertical; } Dock = Dock.Left; break; case LegendPosition.Right: Visibility = Visibility.Visible; if (legendOrientation == LegendOrientation.Auto) { Orientation = Orientation.Vertical; } Dock = Dock.Right; break; case LegendPosition.Bottom: Visibility = Visibility.Visible; if (legendOrientation == LegendOrientation.Auto) { Orientation = Orientation.Horizontal; } Dock = Dock.Bottom; break; default: break; } if (legendOrientation != LegendOrientation.Auto) { Orientation = legendOrientation == LegendOrientation.Horizontal ? Orientation.Horizontal : Orientation.Vertical; } var wpfChart = (CartesianChart)view; FontFamily = wpfChart.LegendFontFamily ?? new FontFamily("Trebuchet MS"); TextColor = wpfChart.LegendTextColor ?? new SolidColorBrush(Color.FromRgb(35, 35, 35)); FontSize = wpfChart.LegendFontSize ?? 13; FontWeight = wpfChart.LegendFontWeight ?? FontWeights.Normal; FontStyle = wpfChart.LegendFontStyle ?? FontStyles.Normal; FontStretch = wpfChart.LegendFontStretch ?? FontStretches.Normal; UpdateLayout(); }