diff --git a/Foundation/Statistics.cs b/Foundation/Statistics.cs index 00e28f8..ce49296 100644 --- a/Foundation/Statistics.cs +++ b/Foundation/Statistics.cs @@ -3,10 +3,10 @@ using System.IO; using System.Linq; using System.Text.Json; -using DynamicData; -using DynamicData.Kernel; using iTimeSlot.Models; +namespace iTimeSlot.Foundation; + public interface IStatistics { DailyStat ReadTodayData(); @@ -164,4 +164,4 @@ public List ReadWeekData() return existed.ToList(); } -} +} \ No newline at end of file diff --git a/Shared/Vars.cs b/Shared/Vars.cs index ea9e2d9..5ceb102 100644 --- a/Shared/Vars.cs +++ b/Shared/Vars.cs @@ -3,6 +3,7 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using iTimeSlot.Foundation; using iTimeSlot.Models; diff --git a/ViewModels/MainWindowViewModel.cs b/ViewModels/MainWindowViewModel.cs index e1fd46f..06ded66 100644 --- a/ViewModels/MainWindowViewModel.cs +++ b/ViewModels/MainWindowViewModel.cs @@ -37,7 +37,7 @@ public MainWindowViewModel() var data = Global.StatReporter.ReadTodayData(); TotalWorkMinutes = data.TotalWorkMinutes; TotalBreakMinutes = data.TotalBreakMinutes; - CompletedWorkTimers = data.WorkCount; + CompletedWorkCount = data.WorkCount; var weekData = Global.StatReporter.ReadWeekData(); int displayNum = 3; @@ -60,7 +60,20 @@ public MainWindowViewModel() { new Axis { - Labels = dates.Select(x => DateTime.Parse(x).ToString("dd MMM")).ToArray() + Labels = dates.Select(x => DateTime.Parse(x).ToString("dd MMM")).ToArray(), + /* + Labels = new string[] { "17 Jun", "18 Jun", "19 Jun" }, + LabelsRotation = 0, + SeparatorsPaint = new SolidColorPaint(new SKColor(200, 200, 200)), + SeparatorsAtCenter = false, + TicksPaint = new SolidColorPaint(new SKColor(35, 35, 35)), + TicksAtCenter = true, + //By default the axis tries to optimize the number of + // labels to fit the available space, + // when you need to force the axis to show all the labels then you must: + ForceStepToMin = true, + MinStep = 1, + */ } }; @@ -152,11 +165,11 @@ public int TotalBreakMinutes set { this.SetProperty(ref _totalBreakMinutes, value); } } - private int _completedWorkTimers; - public int CompletedWorkTimers + private int _completedWorkCount; + public int CompletedWorkCount { - get { return _completedWorkTimers; } - set { this.SetProperty(ref _completedWorkTimers, value); } + get { return _completedWorkCount; } + set { this.SetProperty(ref _completedWorkCount, value); } } private bool _isTimeSlotComboBoxEnabled = true; @@ -219,40 +232,8 @@ public string LabelStatus } - public ISeries[] StatSeries { get; set; } = - { - // new ColumnSeries - // { - // Name = "Total work minutes", - // Values = new double[] { 61, 113, 12 } - // }, - // new ColumnSeries - // { - // Name = "Total break minutes", - // Values = new double[] { 2, 15, 5 } - // } - }; - - public Axis[] StatXAxes { get; set; } = - { - new Axis - { - Labels = new string[] { "17 Jun", "18 Jun", "19 Jun" }, - LabelsRotation = 0, - - SeparatorsPaint = new SolidColorPaint(new SKColor(200, 200, 200)), - // SeparatorsPaint = new SolidColorPaint(SKColors.LightCoral), - SeparatorsAtCenter = false, - TicksPaint = new SolidColorPaint(new SKColor(35, 35, 35)), - // TicksPaint = new SolidColorPaint(SKColors.LightGreen), - //TicksAtCenter = true, - // By default the axis tries to optimize the number of - // labels to fit the available space, - // when you need to force the axis to show all the labels then you must: - // ForceStepToMin = true, - MinStep = 1, - } - }; + public ISeries[] StatSeries { get; set; } + public Axis[] StatXAxes { get; set; } public void DeleteTimeSpan(TimeSlot toDel) @@ -473,7 +454,7 @@ await Dispatcher.UIThread.Invoke(async () => var data = Global.StatReporter.ReadTodayData(); TotalWorkMinutes = data.TotalWorkMinutes; TotalBreakMinutes = data.TotalBreakMinutes; - CompletedWorkTimers = data.WorkCount; + CompletedWorkCount = data.WorkCount; if (PlaySound) { diff --git a/Views/WorkspaceTab.axaml b/Views/WorkspaceTab.axaml index 2bfd8fa..8770222 100644 --- a/Views/WorkspaceTab.axaml +++ b/Views/WorkspaceTab.axaml @@ -134,7 +134,7 @@ Height="10" /> - +