码迷,mamicode.com
首页 > 编程语言 > 详细

JavaFx开发的图表实例

时间:2015-11-18 19:35:10      阅读:253      评论:0      收藏:0      [点我收藏+]

标签:

1.import javafx.application.Application;
2.import javafx.collections.FXCollections;
3.import javafx.collections.ObservableList;
4.import javafx.scene.Scene;
5.import javafx.stage.Stage;
6.import javafx.scene.chart.*;
7.import javafx.scene.Group;
8.  
9.public class PieChartSample extends Application {
10.  
11.    @Override public void start(Stage stage) {
12.        Scene scene = new Scene(new Group());
13.        stage.setTitle("Imported Fruits");
14.        stage.setWidth(500);
15.        stage.setHeight(500);
16.  
17.        ObservableList<PieChart.Data> pieChartData =
18.                FXCollections.observableArrayList(
19.                new PieChart.Data("Grapefruit", 13),
20.                new PieChart.Data("Oranges", 25),
21.                new PieChart.Data("Plums", 10),
22.                new PieChart.Data("Pears", 22),
23.                new PieChart.Data("Apples", 30));
24.        final PieChart chart = new PieChart(pieChartData);
25.        chart.setTitle("水果");
26........

技术分享

JavaFx开发的图表实例

标签:

原文地址:http://www.cnblogs.com/shouce/p/4975475.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!