本文介绍了在javaFX AreaChart中指定LowerBound时,为什么表单会折叠?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想指定LowerBound变量(0> x),但是AreaChart变得奇怪.请告诉我这个解决方案.
I want to specify that LowerBound variables(0>x) but the AreaChart become strange.Please tell me this solution.
对不起..我没有声望点.如果我在上传时获得了声望点,那就这样做.
sorry.. i don't have reputation points.If I got reputations points for uploading do that.
JavaFX 2.2.51-b13版
JavaFX version 2.2.51-b13
谢谢
这是代码:
public class chartApp extends Application{
@Override
public void start(Stage stage){
final NumberAxis xAxis = new NumberAxis();
final NumberAxis yAxis = new NumberAxis();
final AreaChart<Number, Number> areaChart = new AreaChart<Number, Number>(xAxis,yAxis);
XYChart.Series series = new XYChart.Series();
final Integer[] yData = {500,501,502,503,500,502,499,498};
yAxis.setAutoRanging(false);
yAxis.setUpperBound(520.d);
yAxis.setLowerBound(480.d);
for (int i = 0; i < yData.length; i++) {
series.getData().add(new XYChart.Data(i, yData[i]));
}
Scene scene = new Scene(areaChart, 800, 600);
areaChart.getData().add(series);
stage.setScene(scene);
stage.show();
System.out.println(com.sun.javafx.runtime.VersionInfo.getRuntimeVersion());
}
public static void main(String[] args){
launch(args);
}
}
推荐答案
此问题是Java 1.7中的错误.
我确认能够解决最新版本.
James_D,谢谢您的建议.
This problem is bug in the Java 1.7.
I confirmed able to solve the latest version.
James_D, Thank you for advice.
每个版本
JDK 8u20 2014/04/17
ea release
JDK 8u20 2014/04/17
这篇关于在javaFX AreaChart中指定LowerBound时,为什么表单会折叠?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!