PieChart in JavaFX
PieChart in JavaFX:
________________________________________________
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.chart.PieChart;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
public class JavaFXPieChart extends Application {
@Override
public void start(Stage stage) {
PieChart pChart = new PieChart();
PieChart.Data s1 = new PieChart.Data("Java", 183);
PieChart.Data s2 = new PieChart.Data("C/C++", 110);
PieChart.Data s3 = new PieChart.Data("Ruby", 95);
pChart.getData().addAll(s1, s2, s3);
VBox vBox = new VBox(pChart);
Scene scene = new Scene(vBox, 250, 250);
stage.setTitle("JavaFX PieChart");
stage.setScene(scene);
stage.show();
}
public static void main(String[] args) {
Application.launch(args);
}
}
_____________________________________________
Dark Hers
YouTube
https://instagram.com/darkhers
https://www.facebook.com/darkhers
TikTok
https://www.tiktok.com/@darkhers
https://www.pinterest.co.uk/darkhers
Comments
Post a Comment