"Label your axis"
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
@@ -56,6 +56,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
[AutoNotify] private ObservableCollection<double> _yValues;
[AutoNotify] private ObservableCollection<double> _xValues;
[AutoNotify] private double? _xMinimum;
+ [AutoNotify] private List<string> _yLabels;
+ [AutoNotify] private List<string> _xLabels;
private TimeSpan _sampleTime;
private TimeSpan _sampleLimit;
@@ -140,6 +142,34 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
YValues.Add((double) balance.ToDecimal(MoneyUnit.BTC));
XValues.Add((double) timestamp.ToUnixTimeMilliseconds());
}
+
+ if (YValues.Any())
+ {
+ var maxY = YValues.Max();
+ YLabels = new List<string> {"0", (maxY / 2).ToString("F2"), maxY.ToString("F2")};
+ }
+ else
+ {
+ YLabels = null;
+ }
+
+ if (XValues.Any())
+ {
+ var minX = XValues.Min();
+ var maxX = XValues.Max();
+ var halfX = minX + ((maxX - minX) / 2);
+
+ XLabels = new List<string>
+ {
+ DateTimeOffset.FromUnixTimeMilliseconds((long) minX).DateTime.ToString("M"),
+ DateTimeOffset.FromUnixTimeMilliseconds((long) halfX).DateTime.ToString("M"),
+ DateTimeOffset.FromUnixTimeMilliseconds((long) maxX).DateTime.ToString("M"),
+ };
+ }
+ else
+ {
+ XLabels = null;
+ }
}
public ICommand DayCommand { get; }

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChartTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChartTileView.axaml
</Style>
<!-- LineChart YAxis Labels -->
<Style Selector="c|LineChart.yAxisLabels">
+ <Setter Property="YAxisLabelForeground" Value="{DynamicResource TextForegroundColor}" />
<Setter Property="YAxisLabelAngle" Value="0" />
<Setter Property="YAxisLabelOffset" Value="-10,0" />
<Setter Property="YAxisLabelAlignment" Value="Right" />
SmoothCurve="True"
XAxisMinimum="{Binding XMinimum}"
XAxisValues="{Binding XValues}"
- YAxisValues="{Binding YValues}">
+ XAxisLabels="{Binding XLabels}"
+ YAxisValues="{Binding YValues}"
+ YAxisLabels="{Binding YLabels}">
<c:LineChart.AreaFill>
<LinearGradientBrush StartPoint="50%,0%" EndPoint="50%,100%" Opacity="0.2">
<LinearGradientBrush.GradientStops>

"Label your axis"