Skip to content
Snippets Groups Projects
Commit 9673d890 authored by Philipp Müller's avatar Philipp Müller
Browse files

added correct styles for the statistics screen

- added END button to statistics screen
parent b8a9d76a
No related branches found
No related tags found
1 merge request!52added correct styles for the statistics screen
...@@ -107,7 +107,7 @@ namespace InnoLabProjektDektopApp ...@@ -107,7 +107,7 @@ namespace InnoLabProjektDektopApp
{ {
timer.Stop(); timer.Stop();
string jsonpath = ((ProcessMonitor)sender).lastSessionInfoFilePath; string jsonpath = ((ProcessMonitor)sender).lastSessionInfoFilePath;
NavigateTo(new SessionStatistics(jsonpath)); NavigationService.Navigate(new SessionStatistics(jsonpath));
MessageBox.Show("All sessions completed!", "Info", MessageBoxButton.OK, MessageBoxImage.Information); MessageBox.Show("All sessions completed!", "Info", MessageBoxButton.OK, MessageBoxImage.Information);
} }
...@@ -325,11 +325,6 @@ namespace InnoLabProjektDektopApp ...@@ -325,11 +325,6 @@ namespace InnoLabProjektDektopApp
StageText.Text = ProcessMonitor.tmpStage.ToString(); StageText.Text = ProcessMonitor.tmpStage.ToString();
} }
public void NavigateTo(Object page)
{
this.NavigationService.Navigate(page);
}
private void Button_Click_2(object sender, RoutedEventArgs e) private void Button_Click_2(object sender, RoutedEventArgs e)
{ {
this.NavigationService.Navigate(new Distractions()); this.NavigationService.Navigate(new Distractions());
... ...
......
...@@ -7,20 +7,46 @@ ...@@ -7,20 +7,46 @@
xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates" xmlns:header="clr-namespace:InnoLabProjektDektopApp.Screens.Templates"
xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF" xmlns:lvc="clr-namespace:LiveChartsCore.SkiaSharpView.WPF;assembly=LiveChartsCore.SkiaSharpView.WPF"
mc:Ignorable="d" mc:Ignorable="d"
Height="550" Width="900" Title="SessionStatistics"
Title="SessionStatistics"> Background="{StaticResource BACKGROUND_PRIMARY_BRUSH}">
<Grid> <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
<ColumnDefinition Width="*" /> <ColumnDefinition Width="*" />
</Grid.ColumnDefinitions> </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.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 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>
<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> </Grid>
</Page> </Page>
...@@ -53,6 +53,11 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer ...@@ -53,6 +53,11 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
UpdateSeriesValues(); UpdateSeriesValues();
} }
private void Button_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Overview());
}
private void DrawChart(string json_file_path) private void DrawChart(string json_file_path)
{ {
// Example JSON data // Example JSON data
...@@ -71,6 +76,10 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer ...@@ -71,6 +76,10 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
} }
final_stage = sessionData.FinalDistractionStage; 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 // Draw bars for each cycle
foreach (var cycle in sessionData.CycleStartTimes) foreach (var cycle in sessionData.CycleStartTimes)
{ {
...@@ -99,7 +108,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer ...@@ -99,7 +108,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
TextBlock cycleText = new() TextBlock cycleText = new()
{ {
Text = $"Cycle {cycle.Key}", Text = $"Cycle {cycle.Key}",
Foreground = Brushes.Black, Foreground = Brushes.White,
FontSize = 15, FontSize = 15,
FontWeight = FontWeight.FromOpenTypeWeight(500) FontWeight = FontWeight.FromOpenTypeWeight(500)
}; };
...@@ -181,7 +190,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer ...@@ -181,7 +190,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
Y1 = offset - 5, Y1 = offset - 5,
X2 = 0, X2 = 0,
Y2 = 1.5 * 20 * (sessionData.CycleStartTimes.Count) + offset - 5, Y2 = 1.5 * 20 * (sessionData.CycleStartTimes.Count) + offset - 5,
Stroke = Brushes.Black, Stroke = Brushes.White,
StrokeThickness = 2 StrokeThickness = 2
}; };
Canvas.SetTop(yAxis, 0); Canvas.SetTop(yAxis, 0);
...@@ -241,7 +250,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer ...@@ -241,7 +250,7 @@ namespace InnoLabProjektDektopApp.Screens.Regulaer
TextBlock legendText = new() TextBlock legendText = new()
{ {
Text = legendItem.Text, Text = legendItem.Text,
Foreground = Brushes.Black, Foreground = Brushes.White,
FontSize = 20 FontSize = 20
}; };
legendText.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); legendText.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity));
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment