ux: use column series instead of line series because change between samples is not linear

This commit is contained in:
leo 2024-09-24 11:02:49 +08:00
parent 1dd1e41b7b
commit de15cb1ff2
No known key found for this signature in database

View file

@ -67,7 +67,7 @@ namespace SourceGit.Models
} }
else 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)); samples.Add(new DateTimePoint(kv.Key, kv.Value));
Series.Add( Series.Add(
new LineSeries<DateTimePoint>() new ColumnSeries<DateTimePoint>()
{ {
Values = samples, Values = samples,
Stroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 1 }, Stroke = null,
Fill = new SolidColorPaint(SKColors.SkyBlue.WithAlpha(90)), Fill = new SolidColorPaint(SKColors.Green),
GeometrySize = 8, Padding = 1,
GeometryStroke = new SolidColorPaint(SKColors.Green) { StrokeThickness = 2 },
LineSmoothness = 0,
} }
); );