From 0b1b71e227f7785a00a41e1dfd383ab72ae5dd62 Mon Sep 17 00:00:00 2001 From: Felix Kirchner Date: Sun, 13 Jul 2025 00:37:16 +0200 Subject: [PATCH] Updated Y-Axis and removed values under y = 0 --- lib/presentation/views/graph_view.dart | 11 +++++++---- pubspec.yaml | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/presentation/views/graph_view.dart b/lib/presentation/views/graph_view.dart index a6e6042..21f37d8 100644 --- a/lib/presentation/views/graph_view.dart +++ b/lib/presentation/views/graph_view.dart @@ -40,7 +40,10 @@ class _GraphViewState extends State { interval: 1, decimalPlaces: 0, ), - primaryYAxis: const NumericAxis(), + primaryYAxis: const NumericAxis( + interval: 1, + decimalPlaces: 0, + ), series: getCumulativeScores(), ), ) @@ -82,7 +85,7 @@ class _GraphViewState extends State { } } - const double jitterStep = 0.05; + const double jitterStep = 0.03; /// Create a list of LineSeries for each player /// Each series contains data points for each round @@ -91,8 +94,8 @@ class _GraphViewState extends State { cumulativeScores[i].length + 1, (j) => ( j, - j == 0 - ? 0 // 0 Points at at the start of the game + j == 0 || cumulativeScores[i][j - 1] == 0 + ? 0 // 0 Points at at the start of the game OR value is 0 (dont subtract jitter step) // Adds a small jitter to the cumulative scores to prevent overlapping data points in the graph. // The jitter is centered around zero by subtracting playerCount ~/ 2 from the player index i. diff --git a/pubspec.yaml b/pubspec.yaml index 1440d14..c793316 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: cabo_counter description: "Mobile app for the card game Cabo" publish_to: 'none' -version: 0.4.3+481 +version: 0.4.3+483 environment: sdk: ^3.5.4