Merge pull request #2237 from ripcurlx/fix-chart-rendering

Clear and re-assign series to fix rendering issues.
This commit is contained in:
Manfred Karrer 2019-01-10 23:48:40 +01:00 committed by GitHub
commit 1a77ee669c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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