Example usage for javafx.scene.chart AreaChart AreaChart

List of usage examples for javafx.scene.chart AreaChart AreaChart

Introduction

In this page you can find the example usage for javafx.scene.chart AreaChart AreaChart.

Prototype

public AreaChart(@NamedArg("xAxis") Axis<X> xAxis, @NamedArg("yAxis") Axis<Y> yAxis,
        @NamedArg("data") ObservableList<Series<X, Y>> data) 

Source Link

Document

Construct a new Area Chart with the given axis and data

Usage

From source file:Main.java

@Override
public void start(Stage primaryStage) {
    CategoryAxis xAxis = new CategoryAxis();
    NumberAxis yAxis = new NumberAxis();
    AreaChart areaChart = new AreaChart(xAxis, yAxis, getChartData());

    areaChart.setTitle("speculations");
    primaryStage.setTitle("AreaChart example");

    StackPane root = new StackPane();
    root.getChildren().add(areaChart);//from w  ww .  jav a2 s. c  o  m
    primaryStage.setScene(new Scene(root, 400, 250));
    primaryStage.show();
}