JavaFX Tutorial 16 - LineChart Java GUI

Published: 01 January 1970
on channel: Code Amir
1,523
7

JavaFX Tutorial 16 - LineChart Java GUI
Code Source :
@Override
public void start(Stage primaryStage) {
BorderPane bp = new BorderPane();
CategoryAxis x = new CategoryAxis();
x.setLabel("Code Amir");

NumberAxis y = new NumberAxis(0,100,5);
y.setLabel("Ratio");

LineChart lc = new LineChart(x,y);
lc.setTitle("Consumption Ratio Chocolate In USA/World");

XYChart.Series java = new XYChart.Series();
java.setName("Years");
java.getData().add(new XYChart.Data("2010",40));
java.getData().add(new XYChart.Data("2019",30));
java.getData().add(new XYChart.Data("2020",65));

lc.getData().add(java);
bp.setCenter(lc);
Scene sc = new Scene(bp,800,600);
primaryStage.setScene(sc);
primaryStage.setTitle("Tutorial JavaFX");
primaryStage.show();
}
The JavaFX LineChart can draw line charts inside your JavaFX applications. The JavaFX LineChart component is represented by the class javafx.scene.chart.LineChart .


On this page of the site you can watch the video online JavaFX Tutorial 16 - LineChart Java GUI with a duration of hours minute second in good quality, which was uploaded by the user Code Amir 01 January 1970, share the link with friends and acquaintances, this video has already been watched 1,523 times on youtube and it was liked by 7 viewers. Enjoy your viewing!