diff --git a/chartfx-chart/src/main/java/de/gsi/chart/renderer/datareduction/DefaultDataReducer.java b/chartfx-chart/src/main/java/de/gsi/chart/renderer/datareduction/DefaultDataReducer.java index d8d975907..748878c7b 100644 --- a/chartfx-chart/src/main/java/de/gsi/chart/renderer/datareduction/DefaultDataReducer.java +++ b/chartfx-chart/src/main/java/de/gsi/chart/renderer/datareduction/DefaultDataReducer.java @@ -2,11 +2,12 @@ import java.security.InvalidParameterException; +import javafx.beans.property.IntegerProperty; +import javafx.beans.property.SimpleIntegerProperty; + import de.gsi.chart.renderer.RendererDataReducer; import de.gsi.dataset.utils.AssertUtils; import de.gsi.dataset.utils.ProcessingProfiler; -import javafx.beans.property.IntegerProperty; -import javafx.beans.property.SimpleIntegerProperty; /** * Default data reduction algorithm implementation for the ErrorDataSet Renderer
@@ -17,7 +18,6 @@ * @author rstein */ public class DefaultDataReducer implements RendererDataReducer { - protected IntegerProperty minPointPixelDistance = new SimpleIntegerProperty(this, "minPixelDistance", 6) { @Override public void set(final int value) { @@ -218,8 +218,8 @@ private int reducePointsInternal(final double[] xValues, final double[] yValues, yValues[count] = yValues[indexMax - 1]; xPointErrorsNeg[count] = xPointErrorsPos[indexMax - 1]; xPointErrorsPos[count] = xPointErrorsNeg[indexMax - 1]; - yPointErrorsNeg[count] = yPointErrorsPos[indexMax - 1]; - yPointErrorsPos[count] = yPointErrorsNeg[indexMax - 1]; + yPointErrorsNeg[count] = yPointErrorsNeg[indexMax - 1]; + yPointErrorsPos[count] = yPointErrorsPos[indexMax - 1]; pointSelected[count] = pointSelected[indexMax - 1]; styles[count] = styles[indexMax - 1]; count++; @@ -480,5 +480,4 @@ private int reducePointsInternal(final double[] xValues, final double[] yValues, public final void setMinPointPixelDistance(final int minPixelDistance) { minPointPixelDistanceProperty().setValue(minPixelDistance); } - } diff --git a/chartfx-chart/src/main/java/de/gsi/chart/renderer/spi/ErrorDataSetRenderer.java b/chartfx-chart/src/main/java/de/gsi/chart/renderer/spi/ErrorDataSetRenderer.java index 22e97a8b9..7a96cfc42 100644 --- a/chartfx-chart/src/main/java/de/gsi/chart/renderer/spi/ErrorDataSetRenderer.java +++ b/chartfx-chart/src/main/java/de/gsi/chart/renderer/spi/ErrorDataSetRenderer.java @@ -1,12 +1,7 @@ package de.gsi.chart.renderer.spi; import java.security.InvalidParameterException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; +import java.util.*; import javafx.collections.ObservableList; import javafx.geometry.Orientation; @@ -493,12 +488,6 @@ protected void drawErrorSurface(final GraphicsContext gc, final CachedDataPoints xValuesSurface[xend - i] = localCachedPoints.xValues[i]; yValuesSurface[xend - i] = localCachedPoints.errorYPos[i]; } - // swap y coordinates at mid-point - if (nDataCount > 4) { - final double yTmp = yValuesSurface[nDataCount - 1]; - yValuesSurface[nDataCount - 1] = yValuesSurface[xend - nDataCount + 1]; - yValuesSurface[xend - nDataCount + 1] = yTmp; - } gc.setFillRule(FillRule.EVEN_ODD); gc.fillPolygon(xValuesSurface, yValuesSurface, nPolygoneEdges); diff --git a/chartfx-samples/src/main/java/de/gsi/chart/samples/ErrorDataSetRendererStylingSample.java b/chartfx-samples/src/main/java/de/gsi/chart/samples/ErrorDataSetRendererStylingSample.java index 7ca02dfc0..332bbc74e 100644 --- a/chartfx-samples/src/main/java/de/gsi/chart/samples/ErrorDataSetRendererStylingSample.java +++ b/chartfx-samples/src/main/java/de/gsi/chart/samples/ErrorDataSetRendererStylingSample.java @@ -360,6 +360,12 @@ private ParameterTab getRendererTab(final XYChart chart, final ErrorDataSetRende assumeSorted.selectedProperty().addListener((ch, old, selected) -> chart.requestLayout()); pane.addToParameterPane("Assume sorted data: ", assumeSorted); + pane.addToParameterPane(" ", null); + final CheckBox cacheParallel = new CheckBox(); + cacheParallel.selectedProperty().bindBidirectional(errorRenderer.parallelImplementationProperty()); + cacheParallel.selectedProperty().addListener((ch, old, selected) -> chart.requestLayout()); + pane.addToParameterPane(" Point cache parallel: ", cacheParallel); + return pane; }