fix: refresh chart axes and tooltips on hide toggle

This commit is contained in:
Kyle 🐆 2025-10-19 10:38:15 -04:00 committed by Kyle Santiago
parent a8bb094605
commit 28b662d5e1
4 changed files with 19 additions and 0 deletions

View file

@ -128,4 +128,15 @@ public class BalanceChart extends LineChart<Number, Number> {
NumberAxis yaxis = (NumberAxis)getYAxis(); NumberAxis yaxis = (NumberAxis)getYAxis();
yaxis.setTickLabelFormatter(new CoinAxisFormatter(yaxis, format, unit)); yaxis.setTickLabelFormatter(new CoinAxisFormatter(yaxis, format, unit));
} }
public void refreshAxisLabels() {
NumberAxis yaxis = (NumberAxis)getYAxis();
// Force the axis to redraw by invalidating the upper and lower bounds
yaxis.setAutoRanging(false);
double lower = yaxis.getLowerBound();
double upper = yaxis.getUpperBound();
yaxis.setLowerBound(lower);
yaxis.setUpperBound(upper);
yaxis.setAutoRanging(true);
}
} }

View file

@ -144,4 +144,10 @@ public class UtxosChart extends BarChart<String, Number> {
yaxis.setUpperBound(upper); yaxis.setUpperBound(upper);
yaxis.setAutoRanging(true); yaxis.setAutoRanging(true);
} }
public void refreshTooltips() {
for(XYChart.Data<String, Number> data : utxoSeries.getData()) {
installTooltip(data);
}
}
} }

View file

@ -198,6 +198,7 @@ public class TransactionsController extends WalletFormController implements Init
@Subscribe @Subscribe
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) { public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
transactionsTable.refresh(); transactionsTable.refresh();
balanceChart.refreshAxisLabels();
balance.refresh(); balance.refresh();
mempoolBalance.refresh(); mempoolBalance.refresh();
fiatBalance.refresh(); fiatBalance.refresh();

View file

@ -279,6 +279,7 @@ public class UtxosController extends WalletFormController implements Initializab
utxosTable.refresh(); utxosTable.refresh();
utxosChart.update(getWalletForm().getWalletUtxosEntry()); utxosChart.update(getWalletForm().getWalletUtxosEntry());
utxosChart.refreshAxisLabels(); utxosChart.refreshAxisLabels();
utxosChart.refreshTooltips();
balance.refresh(); balance.refresh();
mempoolBalance.refresh(); mempoolBalance.refresh();
updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit()); updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit());