Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
AnalyticsWidgetGenderStarts.xaml.cs
1using LiveChartsCore;
2using LiveChartsCore.SkiaSharpView;
3using LiveChartsCore.SkiaSharpView.Painting;
4using SkiaSharp;
6
8{
12 public partial class AnalyticsWidgetGenderStarts : AnalyticsWidgetBase
13 {
15
16 public AnalyticsWidgetGenderStarts(AnalyticsModuleGenderStarts analyticsModule) : base(analyticsModule)
17 {
18 InitializeComponent();
19 }
20
21 public override string Icon { get; } = "\uE7C1";
22 public override double NormalAnalyticsWidgetWidth => ANALYTICS_WIDGET_WIDTH_NORMAL;
23
24 public override void Refresh()
25 {
26 OnPropertyChanged(nameof(GenderStartsSeries));
27 base.Refresh();
28 }
29
30 public ISeries[] GenderStartsSeries => _analyticsModule == null ? null : new ISeries[]
31 {
32 new PieSeries<double>
33 {
34 Values = new []{ _analyticsModule.MaleStartsPercentage },
35 Name = $"{Core.Properties.EnumsCore.Genders_Male} ({_analyticsModule.MaleStartsCount})",
36 Fill = COLORPAINT_MALE,
37 DataLabelsPaint = new SolidColorPaint(SKColors.Black),
38 DataLabelsSize = 20,
39 DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
40 DataLabelsFormatter = point => point.Coordinate.PrimaryValue == 0 ? "" : point.Coordinate.PrimaryValue.ToString("N1") + "%",
41 Pushout = 3,
42 HoverPushout = 10
43 },
44 new PieSeries<double>
45 {
46 Values = new[] { _analyticsModule.FemaleStartsPercentage },
47 Name = $"{Core.Properties.EnumsCore.Genders_Female} ({_analyticsModule.FemaleStartsCount})",
48 Fill = COLORPAINT_FEMALE,
49 DataLabelsPaint = new SolidColorPaint(SKColors.Black),
50 DataLabelsSize = 20,
51 DataLabelsPosition = LiveChartsCore.Measure.PolarLabelsPosition.Middle,
52 DataLabelsFormatter = point => point.Coordinate.PrimaryValue == 0 ? "" : point.Coordinate.PrimaryValue.ToString("N1") + "%",
53 HoverPushout = 10
54 }
55 };
56 }
57}
Analytics module to calculate the gender deviation for the starts.
IAnalyticsModule AnalyticsModule
Analytics module used by this user control.
AnalyticsWidgetBase(IAnalyticsModule analyticsModule)
Constructor of the AnalyticsWidgetBase
override double NormalAnalyticsWidgetWidth
Normal Width for the analytics widget (this is the default width regardless if the control is maximiz...
override void Refresh()
Refresh the data displayed in the user control.