use of com.vaadin.flow.component.charts.model.PlotOptionsSeries in project flow-components by vaadin.
the class SVGGeneratorTest method createAreaChartConfiguration.
private Configuration createAreaChartConfiguration() {
Configuration configuration = new Configuration();
configuration.setTitle("First Chart for Flow");
configuration.getChart().setType(ChartType.AREA);
Tooltip tooltip = configuration.getTooltip();
tooltip.setEnabled(true);
tooltip.setShared(true);
PlotOptionsSeries options = new PlotOptionsSeries();
options.setPointStart(0);
options.setPointIntervalUnit(IntervalUnit.DAY);
configuration.setPlotOptions(options);
configuration.addSeries(new ListSeries("Tokyo", 20, 12, 34, 23, 65, 8, 4, 7, 76, 19, 20, 8));
configuration.addSeries(new ListSeries("Miami", 34, 29, 23, 65, 8, 4, 7, 7, 59, 8, 9, 19));
XAxis x = new XAxis();
x.setType(AxisType.DATETIME);
x.getLabels().setFormat("{value:%a}");
configuration.addxAxis(x);
YAxis y = new YAxis();
y.setMin(0);
y.setTitle("Rainfall (mm)");
configuration.addyAxis(y);
return configuration;
}
Aggregations