mirror of
https://github.com/sparrowwallet/sparrow.git
synced 2025-11-05 11:56:37 +00:00
fix: refresh chart axes and tooltips on hide toggle
This commit is contained in:
parent
a8bb094605
commit
28b662d5e1
4 changed files with 19 additions and 0 deletions
|
|
@ -128,4 +128,15 @@ public class BalanceChart extends LineChart<Number, Number> {
|
|||
NumberAxis yaxis = (NumberAxis)getYAxis();
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,4 +144,10 @@ public class UtxosChart extends BarChart<String, Number> {
|
|||
yaxis.setUpperBound(upper);
|
||||
yaxis.setAutoRanging(true);
|
||||
}
|
||||
|
||||
public void refreshTooltips() {
|
||||
for(XYChart.Data<String, Number> data : utxoSeries.getData()) {
|
||||
installTooltip(data);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,6 +198,7 @@ public class TransactionsController extends WalletFormController implements Init
|
|||
@Subscribe
|
||||
public void hideAmountsStatusChanged(HideAmountsStatusEvent event) {
|
||||
transactionsTable.refresh();
|
||||
balanceChart.refreshAxisLabels();
|
||||
balance.refresh();
|
||||
mempoolBalance.refresh();
|
||||
fiatBalance.refresh();
|
||||
|
|
|
|||
|
|
@ -279,6 +279,7 @@ public class UtxosController extends WalletFormController implements Initializab
|
|||
utxosTable.refresh();
|
||||
utxosChart.update(getWalletForm().getWalletUtxosEntry());
|
||||
utxosChart.refreshAxisLabels();
|
||||
utxosChart.refreshTooltips();
|
||||
balance.refresh();
|
||||
mempoolBalance.refresh();
|
||||
updateButtons(Config.get().getUnitFormat(), Config.get().getBitcoinUnit());
|
||||
|
|
|
|||
Loading…
Reference in a new issue