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

JavaFX Chart

时间:2019-07-31 18:33:10      阅读:112      评论:0      收藏:0      [点我收藏+]

标签:charts   geometry   extends   over   javafx   ati   flag   ica   override   


import javafx.application.Application;
import javafx.geometry.NodeOrientation;
import javafx.geometry.Side;
import javafx.scene.Scene;
import javafx.scene.chart.*;
import javafx.scene.control.Label;
import javafx.stage.Stage;


public class LineChartSample extends Application {

@Override
public void start(Stage stage) {
stage.setTitle("people");
final CategoryAxis xAxis = new CategoryAxis();
final NumberAxis yAxis = new NumberAxis();
xAxis.setLabel("Country");
final BarChart<String, Number> chart =
new BarChart<String, Number>(xAxis, yAxis);

chart.setTitle("people");

XYChart.Series series = new XYChart.Series(http://www.amjmh.com);
series.setName("flag");
series.getData().add(new XYChart.Data("China", 14.7));
series.getData().add(new XYChart.Data("America", 2.5));
series.getData().add(new XYChart.Data("India", 14));
XYChart.Data data = new XYChart.Data("Russa", 2);
data.setNode(new Label("2"));
series.getData().add(data);

Scene scene = new Scene(chart, 800, 600);
chart.getData().addAll(series);

stage.setScene(scene);
stage.show();
}


public static void main(String[] args) {
launch(args);
}
}
--------------------- 

JavaFX Chart

标签:charts   geometry   extends   over   javafx   ati   flag   ica   override   

原文地址:https://www.cnblogs.com/liyanyan665/p/11278035.html

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