javafx.scene.chart.StackedAreaChart Java Examples

The following examples show how to use javafx.scene.chart.StackedAreaChart. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StackedAreaChartBuilderService.java    From AsciidocFX with Apache License 2.0 5 votes vote down vote up
@Override
protected XYChart<String, Number> createXYChart() {
    final CategoryAxis xAxis = new CategoryAxis();
    final NumberAxis yAxis = new NumberAxis();
    final XYChart<String, Number> chart = new StackedAreaChart<String, Number>(xAxis, yAxis);
    chart.getStyleClass().add("chart-extension");
    return chart;
}
 
Example #2
Source File: StackedAreaChartSample.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public StackedAreaChartSample() {
    NumberAxis xAxis = NumberAxisBuilder.create()
                       .label("X Values")
                       .lowerBound(1.0d)
                       .upperBound(9.0d)
                       .tickUnit(2.0d).build();
                 
    NumberAxis yAxis = NumberAxisBuilder.create()
                       .label("Y Values")
                       .lowerBound(0.0d)
                       .upperBound(30.0d)
                       .tickUnit(2.0d).build();
            
    ObservableList<StackedAreaChart.Series> areaChartData = FXCollections.observableArrayList(
            new StackedAreaChart.Series("Series 1",FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,4),
                new StackedAreaChart.Data(2,5),
                new StackedAreaChart.Data(4,4),
                new StackedAreaChart.Data(6,2),
                new StackedAreaChart.Data(8,6),
                new StackedAreaChart.Data(10,8)
            )),
            new StackedAreaChart.Series("Series 2", FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,8),
                new StackedAreaChart.Data(2,2),
                new StackedAreaChart.Data(4,9),
                new StackedAreaChart.Data(6,7),
                new StackedAreaChart.Data(8,5),
                new StackedAreaChart.Data(10,7)
            )),
            new StackedAreaChart.Series("Series 3", FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,2),
                new StackedAreaChart.Data(2,5),
                new StackedAreaChart.Data(4,8),
                new StackedAreaChart.Data(6,6),
                new StackedAreaChart.Data(8,9),
                new StackedAreaChart.Data(10,7)
            ))
    );
    StackedAreaChart chart = new StackedAreaChart(xAxis, yAxis, areaChartData);
    getChildren().add(chart);
}
 
Example #3
Source File: StackedAreaChartSample.java    From marathonv5 with Apache License 2.0 4 votes vote down vote up
public StackedAreaChartSample() {
    NumberAxis xAxis = NumberAxisBuilder.create()
                       .label("X Values")
                       .lowerBound(1.0d)
                       .upperBound(9.0d)
                       .tickUnit(2.0d).build();
                 
    NumberAxis yAxis = NumberAxisBuilder.create()
                       .label("Y Values")
                       .lowerBound(0.0d)
                       .upperBound(30.0d)
                       .tickUnit(2.0d).build();
            
    ObservableList<StackedAreaChart.Series> areaChartData = FXCollections.observableArrayList(
            new StackedAreaChart.Series("Series 1",FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,4),
                new StackedAreaChart.Data(2,5),
                new StackedAreaChart.Data(4,4),
                new StackedAreaChart.Data(6,2),
                new StackedAreaChart.Data(8,6),
                new StackedAreaChart.Data(10,8)
            )),
            new StackedAreaChart.Series("Series 2", FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,8),
                new StackedAreaChart.Data(2,2),
                new StackedAreaChart.Data(4,9),
                new StackedAreaChart.Data(6,7),
                new StackedAreaChart.Data(8,5),
                new StackedAreaChart.Data(10,7)
            )),
            new StackedAreaChart.Series("Series 3", FXCollections.observableArrayList(
                new StackedAreaChart.Data(0,2),
                new StackedAreaChart.Data(2,5),
                new StackedAreaChart.Data(4,8),
                new StackedAreaChart.Data(6,6),
                new StackedAreaChart.Data(8,9),
                new StackedAreaChart.Data(10,7)
            ))
    );
    StackedAreaChart chart = new StackedAreaChart(xAxis, yAxis, areaChartData);
    getChildren().add(chart);
}