Search in sources :

Example 11 with PlotOptionsSeries

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;
}
Also used : Configuration(com.vaadin.flow.component.charts.model.Configuration) ListSeries(com.vaadin.flow.component.charts.model.ListSeries) Tooltip(com.vaadin.flow.component.charts.model.Tooltip) PlotOptionsSeries(com.vaadin.flow.component.charts.model.PlotOptionsSeries) XAxis(com.vaadin.flow.component.charts.model.XAxis) YAxis(com.vaadin.flow.component.charts.model.YAxis)

Aggregations

PlotOptionsSeries (com.vaadin.flow.component.charts.model.PlotOptionsSeries)11 Configuration (com.vaadin.flow.component.charts.model.Configuration)9 YAxis (com.vaadin.flow.component.charts.model.YAxis)9 ListSeries (com.vaadin.flow.component.charts.model.ListSeries)7 Chart (com.vaadin.flow.component.charts.Chart)6 XAxis (com.vaadin.flow.component.charts.model.XAxis)6 Tooltip (com.vaadin.flow.component.charts.model.Tooltip)5 Labels (com.vaadin.flow.component.charts.model.Labels)3 AxisTitle (com.vaadin.flow.component.charts.model.AxisTitle)2 DataSeries (com.vaadin.flow.component.charts.model.DataSeries)2 DataSeriesItem (com.vaadin.flow.component.charts.model.DataSeriesItem)2 Legend (com.vaadin.flow.component.charts.model.Legend)2 Pane (com.vaadin.flow.component.charts.model.Pane)2 PlotLine (com.vaadin.flow.component.charts.model.PlotLine)2 PlotOptionsArea (com.vaadin.flow.component.charts.model.PlotOptionsArea)2 PlotOptionsColumn (com.vaadin.flow.component.charts.model.PlotOptionsColumn)2 PlotOptionsLine (com.vaadin.flow.component.charts.model.PlotOptionsLine)2 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 StockPrices (com.vaadin.flow.component.charts.examples.timeline.util.StockPrices)1 AbstractSeries (com.vaadin.flow.component.charts.model.AbstractSeries)1