diff --git a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/02Session.xaml.cs b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/02Session.xaml.cs
index c5323c2a97250c4e6826cb4b4572880c8b50061e..e05d3cfa94a0910d7566fe951ed8bc45e996c2e7 100644
--- a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/02Session.xaml.cs
+++ b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/02Session.xaml.cs
@@ -107,7 +107,7 @@ namespace InnoLabProjektDektopApp
{
timer.Stop();
string jsonpath = ((ProcessMonitor)sender).lastSessionInfoFilePath;
- NavigateTo(new SessionStatistics(jsonpath));
+ NavigationService.Navigate(new SessionStatistics(jsonpath));
MessageBox.Show("All sessions completed!", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
}
@@ -325,11 +325,6 @@ namespace InnoLabProjektDektopApp
StageText.Text = ProcessMonitor.tmpStage.ToString();
}
- public void NavigateTo(Object page)
- {
- this.NavigationService.Navigate(page);
- }
-
private void Button_Click_2(object sender, RoutedEventArgs e)
{
this.NavigationService.Navigate(new Distractions());
diff --git a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml
index 53372509559e15fed620f16cb9e318274a10e010..d904c0fef42705cf6765586200a81ce3c5923bc9 100644
--- a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml
+++ b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml
@@ -7,20 +7,46 @@
xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
mc:Ignorable="d"
- Height="550" Width="900"
- Title="SessionStatistics">
+ Title="SessionStatistics"
+ Background="{StaticResource BACKGROUND_PRIMARY_BRUSH}">
<Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
- <Canvas Name="chartCanvas" Margin="50" Grid.Column="0" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+ <Canvas Grid.Row="0" Grid.ColumnSpan="2" Background="{StaticResource HIGHLIGHT_PRIMARY_BRUSH}">
+ <TextBlock Margin="135,40" Text="End of your focus session"
+ FontSize="42" FontWeight="Bold" HorizontalAlignment="Left"/>
+ </Canvas>
+
+ <Canvas Name="chartCanvas" Margin="150" Grid.Row="1" Grid.Column="0"
+ HorizontalAlignment="Left" VerticalAlignment="Top">
+ <Rectangle x:Name="chartBackground" Width="480" Height="150" Fill="#333436" RadiusX="10" RadiusY="10" Margin="-15,-25" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+ <TextBlock Text="Your session overview" FontSize="32" FontWeight="Bold"
+ HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,-25"/>
+ </Canvas>
- <Grid Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Top" Width="350" Height="350">
- <Image Source="{Binding CenterImageSource}" Width="200" Height="200" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- <lvc:PieChart Series="{Binding Series}" />
+ <Grid Grid.Row="1" Grid.Column="1" Margin="100" HorizontalAlignment="Right"
+ VerticalAlignment="Top" Width="350" Height="350">
+
+ <Image Source="{Binding CenterImageSource}" Width="200" Height="200"
+ HorizontalAlignment="Center" VerticalAlignment="Center"/>
+ <lvc:PieChart Series="{Binding Series}" Width="350" Height="350"/>
+
</Grid>
+
+ <Border Grid.Row="1" Grid.Column="0" Margin="135,0,0,40" Style="{StaticResource RoundedButtonBorder}"
+ MouseDown="Button_Click" HorizontalAlignment="Left" VerticalAlignment="Bottom">
+ <TextBlock Text="End" Style="{StaticResource ButtonTextStyle}" />
+ </Border>
+
+
</Grid>
</Page>
diff --git a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml.cs b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml.cs
index 2150ccc530eddc722c4f78fca572e03467663910..75ddeb4aeedfb67d4de4f8b8adf66c1cf4906f63 100644
--- a/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml.cs
+++ b/InnoLabProjektDektopApp/InnoLabProjektDektopApp/Screens/Regulaer/SessionStatistics.xaml.cs
@@ -53,6 +53,11 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
UpdateSeriesValues();
}
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ NavigationService.Navigate(new Overview());
+ }
+
private void DrawChart(string json_file_path)
{
// Example JSON data
@@ -71,6 +76,10 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
}
final_stage = sessionData.FinalDistractionStage;
+ // Calculate the height of the rectangle
+ int rectangleHeight = 190 + (int)(1.5 * bar_height * (sessionData.CycleStartTimes.Count-1));
+ chartBackground.Height = rectangleHeight;
+
// Draw bars for each cycle
foreach (var cycle in sessionData.CycleStartTimes)
{
@@ -99,7 +108,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
TextBlock cycleText = new()
{
Text = $"Cycle {cycle.Key}",
- Foreground = Brushes.Black,
+ Foreground = Brushes.White,
FontSize = 15,
FontWeight = FontWeight.FromOpenTypeWeight(500)
};
@@ -181,7 +190,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
Y1 = offset - 5,
X2 = 0,
Y2 = 1.5 * 20 * (sessionData.CycleStartTimes.Count) + offset - 5,
- Stroke = Brushes.Black,
+ Stroke = Brushes.White,
StrokeThickness = 2
};
Canvas.SetTop(yAxis, 0);
@@ -214,12 +223,12 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
{
// Create legend items
var legendItems = new List<(string Text, Brush Color)>
- {
- ("Productive Work", Brushes.Green),
- ("Distraction", Brushes.Red),
- ("Break", Brushes.Blue),
- ("Pause", Brushes.LightBlue)
- };
+ {
+ ("Productive Work", Brushes.Green),
+ ("Distraction", Brushes.Red),
+ ("Break", Brushes.Blue),
+ ("Pause", Brushes.LightBlue)
+ };
// Draw legend
for (int i = 0; i < legendItems.Count; i++)
@@ -241,7 +250,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
TextBlock legendText = new()
{
Text = legendItem.Text,
- Foreground = Brushes.Black,
+ Foreground = Brushes.White,
FontSize = 20
};
legendText.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
@@ -271,33 +280,33 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
Series =
[
new PieSeries<double> {
- Name = $"Distractions:",
- Values = distractedTime.TotalSeconds > 1 ? [distractedTime.TotalMinutes] : new List<double>(),
- MaxRadialColumnWidth = 50,
- Fill = new SolidColorPaint(SKColors.Red),
- ToolTipLabelFormatter = value => $"{distractedTimeFormatted} minutes"
- },
- new PieSeries<double> {
- Name = $"Breaks:",
- Values = breakTime.TotalSeconds > 1 ? [breakTime.TotalMinutes] : new List<double>(),
- MaxRadialColumnWidth = 50,
- Fill = new SolidColorPaint(SKColors.Blue),
- ToolTipLabelFormatter = value => $"{breakTimeFormatted} minutes"
- },
- new PieSeries<double> {
- Name = $"Manually paused:",
- Values = pausedTime.TotalSeconds > 1 ? [pausedTime.TotalMinutes] : new List<double>(),
- MaxRadialColumnWidth = 50,
- Fill = new SolidColorPaint(SKColors.LightBlue),
- ToolTipLabelFormatter = value => $"{pausedTimeFormatted} minutes"
- },
- new PieSeries<double> {
- Name = $"Productive:",
- Values = productiveTime.TotalSeconds > 1 ? [productiveTime.TotalMinutes] : new List<double>(),
- MaxRadialColumnWidth = 50,
- Fill = new SolidColorPaint(SKColors.Green),
- ToolTipLabelFormatter = value => $"{productiveTimeFormatted} minutes"
- }
+ Name = $"Distractions:",
+ Values = distractedTime.TotalSeconds > 1 ? [distractedTime.TotalMinutes] : new List<double>(),
+ MaxRadialColumnWidth = 50,
+ Fill = new SolidColorPaint(SKColors.Red),
+ ToolTipLabelFormatter = value => $"{distractedTimeFormatted} minutes"
+ },
+ new PieSeries<double> {
+ Name = $"Breaks:",
+ Values = breakTime.TotalSeconds > 1 ? [breakTime.TotalMinutes] : new List<double>(),
+ MaxRadialColumnWidth = 50,
+ Fill = new SolidColorPaint(SKColors.Blue),
+ ToolTipLabelFormatter = value => $"{breakTimeFormatted} minutes"
+ },
+ new PieSeries<double> {
+ Name = $"Manually paused:",
+ Values = pausedTime.TotalSeconds > 1 ? [pausedTime.TotalMinutes] : new List<double>(),
+ MaxRadialColumnWidth = 50,
+ Fill = new SolidColorPaint(SKColors.LightBlue),
+ ToolTipLabelFormatter = value => $"{pausedTimeFormatted} minutes"
+ },
+ new PieSeries<double> {
+ Name = $"Productive:",
+ Values = productiveTime.TotalSeconds > 1 ? [productiveTime.TotalMinutes] : new List<double>(),
+ MaxRadialColumnWidth = 50,
+ Fill = new SolidColorPaint(SKColors.Green),
+ ToolTipLabelFormatter = value => $"{productiveTimeFormatted} minutes"
+ }
];
CenterImageSource = new BitmapImage(new Uri($"pack://application:,,,/Assets/MascottAnimation/Up/{final_stage}/frame0.png"));