From de15cb1ff2ef1da58e35379a4c17fd3f05baeff0 Mon Sep 17 00:00:00 2001 From: leo Date: Tue, 24 Sep 2024 11:02:49 +0800 Subject: [PATCH] ux: use column series instead of line series because change between samples is not linear --- src/Models/Statistics.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Models/Statistics.cs b/src/Models/Statistics.cs index 0d2c439c..39daa4c2 100644 --- a/src/Models/Statistics.cs +++ b/src/Models/Statistics.cs @@ -67,7 +67,7 @@ namespace SourceGit.Models } else { - XAxes.Add(new DateTimeAxis(TimeSpan.FromDays(365), v => $"{v:yyyy/MM}") { TextSize = 10 }); + XAxes.Add(new DateTimeAxis(TimeSpan.FromDays(30), v => $"{v:yyyy/MM}") { TextSize = 10 }); } } @@ -99,14 +99,12 @@ namespace SourceGit.Models samples.Add(new DateTimePoint(kv.Key, kv.Value)); Series.Add( - new LineSeries() + new ColumnSeries() { Values = samples, - Stroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 1 }, - Fill = new SolidColorPaint(SKColors.SkyBlue.WithAlpha(90)), - GeometrySize = 8, - GeometryStroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 2 }, - LineSmoothness = 0, + Stroke = null, + Fill = new SolidColorPaint(SKColors.Green), + Padding = 1, } );