Why does form collapse when specify LowerBound in

2019-06-13 20:34发布

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 version 2.2.51-b13

thank you

here is code:

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 javafx-2
1条回答
走好不送
2楼-- · 2019-06-13 20:54

This problem is bug in the Java 1.7.
I confirmed able to solve the latest version.
James_D, Thank you for advice.

ea release
JDK 8u20 2014/04/17

查看更多
登录 后发表回答