문제

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);
    }

}
도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top