Clear and re-assign series to fix rendering issues.

Fixes #2136.
This commit is contained in:
Christoph Atteneder 2019-01-10 15:08:23 +01:00
parent d320380e80
commit 190d2d5122
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B

View file

@ -336,6 +336,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
private void updateChartData() { private void updateChartData() {
seriesBuy.getData().clear(); seriesBuy.getData().clear();
seriesSell.getData().clear(); seriesSell.getData().clear();
areaChart.getData().clear();
final Optional<XYChart.Data> buyMinOptional = model.getBuyData().stream() final Optional<XYChart.Data> buyMinOptional = model.getBuyData().stream()
.min(Comparator.comparingDouble(o -> (double) o.getXValue())) .min(Comparator.comparingDouble(o -> (double) o.getXValue()))
@ -369,6 +370,7 @@ public class OfferBookChartView extends ActivatableViewAndModel<VBox, OfferBookC
seriesBuy.getData().addAll(model.getBuyData()); seriesBuy.getData().addAll(model.getBuyData());
//noinspection unchecked //noinspection unchecked
seriesSell.getData().addAll(model.getSellData()); seriesSell.getData().addAll(model.getSellData());
areaChart.getData().addAll(seriesBuy, seriesSell);
} }
private Tuple4<TableView<OfferListItem>, VBox, Button, Label> getOfferTable(OfferPayload.Direction direction) { private Tuple4<TableView<OfferListItem>, VBox, Button, Label> getOfferTable(OfferPayload.Direction direction) {