diff --git a/src/main/java/com/sparrowwallet/sparrow/control/BalanceChart.java b/src/main/java/com/sparrowwallet/sparrow/control/BalanceChart.java index eb6f8020..aa9fe0fb 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/BalanceChart.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/BalanceChart.java @@ -82,9 +82,9 @@ public class BalanceChart extends LineChart { for(int i = 0; i < balanceSeries.getData().size(); i++) { XYChart.Data data = balanceSeries.getData().get(i); - Node symbol = lookup(".chart-line-symbol.data" + i); - if(symbol != null) { - if(transactionEntry.getBlockTransaction().getDate() != null && data.getXValue().equals(transactionEntry.getBlockTransaction().getDate().getTime()) && data.getExtraValue() != null) { + if(transactionEntry.getBlockTransaction().getDate() != null && data.getXValue().equals(transactionEntry.getBlockTransaction().getDate().getTime()) && data.getExtraValue() != null) { + Node symbol = lookup(".chart-line-symbol.data" + i); + if(symbol != null) { symbol.getStyleClass().add("selected"); selectedEntry = transactionEntry; } diff --git a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java index 7f3f9dfb..cd8a779a 100644 --- a/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java +++ b/src/main/java/com/sparrowwallet/sparrow/control/UtxosChart.java @@ -86,11 +86,10 @@ public class UtxosChart extends BarChart { for(int i = 0; i < utxoSeries.getData().size(); i++) { XYChart.Data data = utxoSeries.getData().get(i); - Node bar = lookup(".data" + i); - if(bar != null) { - if(data.getExtraValue() != null && entries.contains((Entry)data.getExtraValue())) { - bar.getStyleClass().add("selected"); - } else if(data.getExtraValue() == null && entries.size() == totalUtxos) { + + if((data.getExtraValue() != null && entries.contains((Entry)data.getExtraValue())) || (data.getExtraValue() == null && entries.size() == totalUtxos)) { + Node bar = lookup(".data" + i); + if(bar != null) { bar.getStyleClass().add("selected"); } }