25 InitializeComponent();
28 public override string Icon =>
"\uE916";
32 OnPropertyChanged(nameof(CompetitionTimesPerAgeSeries));
33 OnPropertyChanged(nameof(XAxes));
34 OnPropertyChanged(nameof(YAxes));
38 private List<SwimmingStyles> _availableSwimmingStyles;
50 get => _selectedSwimmingStyle;
51 set { _selectedSwimmingStyle = value; OnPropertyChanged(); OnPropertyChanged(nameof(CompetitionTimesPerAgeSeries)); }
54 private Genders _selectedGender;
60 get => _selectedGender;
61 set { _selectedGender = value; OnPropertyChanged(); OnPropertyChanged(nameof(CompetitionTimesPerAgeSeries)); }
64 public ISeries[] CompetitionTimesPerAgeSeries
70 List<ISeries> seriesList =
new List<ISeries>();
76 Values = competitionTimeModels,
77 Mapping = (model, index) =>
79 return new Coordinate(model.Age, model.Time.TotalMilliseconds);
81 YToolTipLabelFormatter = point =>
83 string tooltipString = $
"{Properties.Resources.AgeString}: {point.Model.Age}{Environment.NewLine}{Properties.Resources.TimeString}: {point.Model.Time.ToString(@"mm\:ss\.ff
")}";
84 if(point.Model.IsTimeFromRudolphTable)
86 tooltipString += $
"{Environment.NewLine}{Properties.Resources.ParsedFromRudolphTableString}";
88 if (point.Model.IsOpenAgeTimeFromRudolphTable)
90 tooltipString += $
"{Environment.NewLine}{Properties.Resources.OpenAgeTimeFromRudolphTableString}";
92 if (point.Model.IsTimeInterpolatedFromRudolphTable)
94 tooltipString += $
"{Environment.NewLine}{Properties.Resources.InterpolatedFromRudolphTableString}";
104 .OnPointMeasured(point =>
107 if (point.Visual is
null)
return;
109 SolidColorBrush displayColor;
110 if (point.Model.IsOpenAgeTimeFromRudolphTable)
112 displayColor = Application.Current.Resources[
"BrushOpenAgeTimeFromRudolphTable"] as SolidColorBrush;
113 point.Visual.Fill =
new SolidColorPaint(SKColor.Parse(displayColor.Color.ToString()));
115 else if (point.Model.IsTimeFromRudolphTable)
117 displayColor = Application.Current.Resources[
"BrushTimeFromRudolphTable"] as SolidColorBrush;
118 point.Visual.Fill =
new SolidColorPaint(SKColor.Parse(displayColor.Color.ToString()));
120 else if(point.Model.IsTimeInterpolatedFromRudolphTable)
122 displayColor = Application.Current.Resources[
"BrushTimeInterpolatedFromRudolphTable"] as SolidColorBrush;
123 point.Visual.Fill =
new SolidColorPaint(SKColor.Parse(displayColor.Color.ToString()));
126 seriesList.Add(series);
127 return seriesList.ToArray();
131 public Axis[] XAxes =>
136 Name = Properties.Resources.AgeString,
138 NameTextSize = ANALYTICS_WIDGET_AXIS_TEXTSIZE_DEFAULT,
140 TextSize = ANALYTICS_WIDGET_AXIS_TEXTSIZE_DEFAULT,
145 public Axis[] YAxes =>
151 NameTextSize = ANALYTICS_WIDGET_AXIS_TEXTSIZE_DEFAULT,
152 SeparatorsPaint = COLORPAINT_SEPARATORS,
154 TextSize = ANALYTICS_WIDGET_AXIS_TEXTSIZE_DEFAULT,
158 return TimeSpan.FromMilliseconds(value).ToString(
@"mm\:ss\.ff");