diff --git a/BTCPayServer/Components/StoreWalletBalance/Default.cshtml b/BTCPayServer/Components/StoreWalletBalance/Default.cshtml
index 70cf19e4b..83e9f7f5c 100644
--- a/BTCPayServer/Components/StoreWalletBalance/Default.cshtml
+++ b/BTCPayServer/Components/StoreWalletBalance/Default.cshtml
@@ -64,13 +64,14 @@
const id = `StoreWalletBalance-${storeId}`;
const baseUrl = @Safe.Json(Url.Action("WalletHistogram", "UIWallets", new { walletId = Model.WalletId, type = WalletHistogramType.Week }));
+ const valueTransform = value => rate
+ ? DashboardUtils.displayDefaultCurrency(value, rate, defaultCurrency, divisibility).toString()
+ : value
const chartOpts = {
fullWidth: true,
showArea: true,
axisY: {
- labelInterpolationFnc: value => rate
- ? DashboardUtils.displayDefaultCurrency(value, rate, defaultCurrency, divisibility).toString()
- : value
+ labelInterpolationFnc: valueTransform
}
};
@@ -80,16 +81,22 @@
document.querySelectorAll(`#${id} .currency`).forEach(c => c.innerText = currency)
document.querySelectorAll(`#${id} [data-balance]`).forEach(c => {
const value = Number.parseFloat(c.dataset.balance);
- c.innerText = rate
- ? DashboardUtils.displayDefaultCurrency(value, rate, currency, divisibility)
- : value
+ c.innerText = valueTransform(value)
});
if (!series) return;
const min = Math.min(...series);
const max = Math.max(...series);
const low = Math.max(min - ((max - min) / 5), 0);
- const renderOpts = Object.assign({}, chartOpts, { low });
+ const tooltip = Chartist.plugins.tooltip2({
+ template: '{{value}}',
+ offset: {
+ x: 0,
+ y: -16
+ },
+ valueTransformFunction: valueTransform
+ })
+ const renderOpts = Object.assign({}, chartOpts, { low, plugins: [tooltip] });
const chart = new Chartist.Line(`#${id} .ct-chart`, {
labels,
series: [series]
diff --git a/BTCPayServer/Views/UIStores/Dashboard.cshtml b/BTCPayServer/Views/UIStores/Dashboard.cshtml
index 94d555d75..fb466458f 100644
--- a/BTCPayServer/Views/UIStores/Dashboard.cshtml
+++ b/BTCPayServer/Views/UIStores/Dashboard.cshtml
@@ -24,7 +24,9 @@
{
/* include chart library inline so that it instantly renders */
+
+