为什么AreaChart不覆盖线下面的所有区域?
这是我的图表的fxml代码(它非常基本):
<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>
我使用@FXML标记在Java控制器中定义轴 .
初始化部分(此方法从public void initialize(URL位置,ResourceBundle资源)调用:
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)");
}
还有一个刷新按钮,用于刷新系列内容(可以有一个或多个系列)并重新绘制图表 . 方法本身返回List <XYChart.Series>,系列包含Double值;然后系列被添加到图表:
this.CWTareaLayerChart.getData().addAll(allSeries);
结果我获得了这样的东西:
或这个:
我在setAutoRanging()和setForceZeroInRange()中尝试了不同的true / false组合,也使用了setLowerBound(),但结果总是类似于图像 - 显示系列的最后几个点,但下面的区域是'n'有色 .
1 回答
你试过设置
threshold
参数吗?API参考:
http://api.highcharts.com/highcharts/plotOptions.series.threshold
例:
http://jsfiddle.net/w5f3Ltcu/