use live data on the send graph.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Send/SendViewModel.cs
using System;
-using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
-using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Windows.Input;
@@ -15,7 +13,7 @@ using ReactiveUI;
using WalletWasabi.Blockchain.Analysis.Clustering;
using WalletWasabi.Blockchain.Analysis.FeesEstimation;
using WalletWasabi.Fluent.ViewModels.NavBar;
-using WalletWasabi.Gui;
+using WalletWasabi.Gui.Converters;
using WalletWasabi.Userfacing;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
@@ -37,8 +35,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
[AutoNotify] private ObservableCollection<string> _priorLabels;
[AutoNotify] private ObservableCollection<string> _labels;
[AutoNotify] private bool _isPayJoin;
- [AutoNotify] private int[] _xAxisValues;
- [AutoNotify] private int[] _yAxisValues;
+ [AutoNotify] private double[] _xAxisValues;
+ [AutoNotify] private double[] _yAxisValues;
[AutoNotify] private string[] _xAxisLabels;
private string? _payJoinEndPoint;
@@ -182,9 +180,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Send
private void UpdateFeeEstimates(AllFeeEstimate feeEstimate)
{
- XAxisValues = feeEstimate.Estimations.Select(x => x.Key * 10).ToArray();
- XAxisLabels = XAxisValues.Select(x => x.ToString()).ToArray();
- YAxisValues = feeEstimate.Estimations.Select(x => x.Value).ToArray();
+ var estimates = feeEstimate.Estimations.Reverse();
+
+ XAxisValues = estimates.Select(x => (double)x.Key).ToArray();
+ XAxisLabels = estimates.Select(x=>x.Key).Select(x => FeeTargetTimeConverter.Convert(x, "m", "h", "h", "d", "d")).ToArray();
+ YAxisValues = estimates.Select(x => (double)x.Value).ToArray();
}
public ICommand PasteCommand { get; }

MODIFY
WalletWasabi.Gui/Converters/FeeTargetTimeConverter.cs
WalletWasabi.Gui/Converters/FeeTargetTimeConverter.cs
@@ -9,23 +9,21 @@ namespace WalletWasabi.Gui.Converters
{
public class FeeTargetTimeConverter : IValueConverter
{
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is int feeTarget)
+ public static string Convert(int feeTarget, string minutesLabel, string hourLabel, string hoursLabel, string dayLabel, string daysLabel)
{
if (feeTarget is >= Constants.TwentyMinutesConfirmationTarget and <= 6) // minutes
{
- return $"{feeTarget}0 minutes";
+ return $"{feeTarget}0{minutesLabel}";
}
else if (feeTarget is >= 7 and <= Constants.OneDayConfirmationTarget) // hours
{
var hours = feeTarget / 6; // 6 blocks per hour
- return $"{hours} {IfPlural(hours, "hour", "hours")}";
+ return $"{hours}{IfPlural(hours, hourLabel, hoursLabel)}";
}
else if (feeTarget is >= (Constants.OneDayConfirmationTarget + 1) and < Constants.SevenDaysConfirmationTarget) // days
{
var days = feeTarget / Constants.OneDayConfirmationTarget;
- return $"{days} {IfPlural(days, "day", "days")}";
+ return $"{days}{IfPlural(days, dayLabel, daysLabel)}";
}
else if (feeTarget == Constants.SevenDaysConfirmationTarget)
{
@@ -36,6 +34,13 @@ namespace WalletWasabi.Gui.Converters
return "Invalid";
}
}
+
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (value is int feeTarget)
+ {
+ return FeeTargetTimeConverter.Convert(feeTarget, " minutes", " hour", " hours", " day", " days");
+ }
else
{
throw new TypeArgumentException(value, typeof(SmartCoinStatus), nameof(value));

use live data on the send graph.