private static void OnPieCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue) { PieDonutSeriesViewModule module = (PieDonutSeriesViewModule)d; module.UpdateSeriesView((series) => { SeriesLabelOptions seriesLabelOptions = new SeriesLabelOptions() { Indent = 10, FontSize = 12, Pattern = LabelPattern }; PieSeriesView.SetLabelPosition(seriesLabelOptions, PieLabelPosition.TwoColumns); string toolTipPattern = series.DisplayName == "Total" ? ToolTipPointPatternForPieDoughnutTotal : ToolTipPointPatternForPieDoughnutPerCapita; return(new PieSeriesView() { ShowLabels = true, LegendPointPattern = LegendPointPattern, ToolTipPointPattern = toolTipPattern, LabelOptions = seriesLabelOptions, Title = new SeriesTitle() { Content = series.DisplayName, FontSize = 20 } }); }); module.SetLegendHorizontal(); } }
private static void OnDonutCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue) { PieDonutSeriesViewModule module = (PieDonutSeriesViewModule)d; module.UpdateSeriesView((series) => { SeriesLabelOptions seriesLabelOptions = new SeriesLabelOptions() { Indent = 10, FontSize = 12, Pattern = LabelPattern }; DonutSeriesView.SetLabelPosition(seriesLabelOptions, PieLabelPosition.Outside); ContourAppearance contourAppearance = new ContourAppearance() { Brush = new SolidColorBrush(Colors.Transparent), StrokeStyle = new StrokeStyle() { Thickness = 3, LineJoin = PenLineJoin.Round } }; string toolTipPattern = series.DisplayName == "Total" ? ToolTipPointPatternForPieDoughnutTotal : ToolTipPointPatternForPieDoughnutPerCapita; return(new DonutSeriesView() { HoleRadiusPercent = 30, ContourAppearance = contourAppearance, LegendPointPattern = LegendPointPattern, ToolTipPointPattern = toolTipPattern, ShowLabels = true, LabelOptions = seriesLabelOptions, Title = new SeriesTitle() { Content = series.DisplayName, FontSize = 20 } }); }); module.SetLegendHorizontal(); } }