Why doesn't AreaChart cover all the area below the line?
Here's the fxml code for my chart (it's really basic):
<AreaChart fx:id="CWTareaLayerChart" prefHeight="547.0" prefWidth="682.0" GridPane.rowIndex="1">
<xAxis>
<NumberAxis side="BOTTOM" fx:id="xAxisCWT" />
</xAxis>
<yAxis>
<NumberAxis fx:id="yAxisCWT" side="LEFT" />
</yAxis>
</AreaChart>
I define the axis in Java Controller with @FXML tag.
The initialization part (this method is called from public void initialize(URL location, ResourceBundle resources) :
private void initializeLayerChart() {
xAxisCWT.setForceZeroInRange(false);
yAxisCWT.setForceZeroInRange(true);
xAxisCWT.setAutoRanging(true);
yAxisCWT.setAutoRanging(true);
yAxisCWT.setLowerBound(-5.0);
xAxisCWT.setLabel("W (%)");
yAxisCWT.setLabel("avg C (pF)");
}
There's also a Refresh button which refreshes the content of series (there can be one or more series) and re-draws the chart. The method itselfs returns List < XYChart.Series > and series contain Double values; then the series are added to chart:
this.CWTareaLayerChart.getData().addAll(allSeries);
As the result I obtain something like this:
or this:
I've tried different combinations of true/false in setAutoRanging() and setForceZeroInRange(), also played with setLowerBound(), but the result is always something like on the images - the last points of series are shown but the area below isn't colored.