diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs index c4c98645c..727c62c39 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PieChart.cs @@ -64,6 +64,7 @@ public PieChart() MouseDown += OnMouseDown; tooltip = new SKDefaultTooltip(); + legend = new SKDefaultLegend(); } /// @@ -200,7 +201,6 @@ protected override void InitializeCore() { if (canvas is null) throw new Exception("canvas not found"); core = new PieChart(this, config => config.UseDefaults(), canvas.CanvasCore); - legend = new SKDefaultLegend(); // Template.FindName("legend", this) as IChartLegend; core.Update(); } diff --git a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs index 8a5f48fb5..79f0696a7 100644 --- a/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs +++ b/src/skiasharp/LiveChartsCore.SkiaSharp.WPF/PolarChart.cs @@ -80,6 +80,7 @@ public PolarChart() MouseUp += OnMouseUp; tooltip = new SKDefaultTooltip(); + legend = new SKDefaultLegend(); } #region dependency properties @@ -294,7 +295,6 @@ protected override void InitializeCore() if (canvas is null) throw new Exception("canvas not found"); core = new PolarChart(this, config => config.UseDefaults(), canvas.CanvasCore); - legend = new SKDefaultLegend(); // Template.FindName("legend", this) as IChartLegend; core.Update(); }