I add some text at the top of bars (the value of each bar). It\'s working but the problem is I want to remove this text each time I update the chart. In fact, text stays aft
I have found only one solution, which is to clear every parentNode of each Data when you receive an update. You'll reconstruct the whole series then. As follow, it works but I didn't check the performance. On my environment it's pretty fast :
ObservableList> allSeries = yourBarChart.getData();
if (updateReceived) {
for (XYChart.Series series : allSeries) {
for (XYChart.Data data : series.getData()) {
Node node = data.getNode();
Parent parent = node.parentProperty().get();
if (parent != null && parent instanceof Group) {
Group group = (Group) parent;
group.getChildren().clear();
}
}
}
allSeries.clear();
}