Exemplo n.º 1
0
 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();
     }
 }
Exemplo n.º 2
0
 private static void OnNestedDonutCheckedChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     if ((bool)e.NewValue)
     {
         PieDonutSeriesViewModule module = (PieDonutSeriesViewModule)d;
         module.UpdateSeriesView((series) => {
             return(new NestedDonutSeriesView()
             {
                 HoleRadiusPercent = 30,
                 LegendPointPattern = LegendPointPattern,
                 ToolTipPointPattern = ToolTipPointPatternForNested,
             });
         });
         module.pieChart.Series[0].ActualView.ShowLabels = false;
         module.pieChart.Series[1].ActualView.ShowLabels = false;
         module.SetLegendPositionForNestedDoughnut();
     }
 }
Exemplo n.º 3
0
 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();
     }
 }