use of com.vaadin.flow.component.charts.model.PlotOptionsPyramid in project flow-components by vaadin.
the class Pyramid method initDemo.
@Override
public void initDemo() {
Chart chart = new Chart(ChartType.PYRAMID);
Configuration configuration = chart.getConfiguration();
configuration.setTitle("Sales pyramid");
configuration.getLegend().setEnabled(false);
PlotOptionsPyramid plotOptionsSeries = new PlotOptionsPyramid();
DataLabelsFunnel dataLabels = plotOptionsSeries.getDataLabels();
dataLabels.setEnabled(true);
dataLabels.setSoftConnector(true);
dataLabels.setFormat("<b>{point.name}</b> ({point.y:,.0f})");
plotOptionsSeries.setCenter("40%", "50%");
plotOptionsSeries.setWidth("60%");
configuration.setPlotOptions(plotOptionsSeries);
DataSeries series = new DataSeries("Unique users");
series.add(new DataSeriesItem("Website visits", 15654));
series.add(new DataSeriesItem("Downloads", 4064));
series.add(new DataSeriesItem("Requested price list", 1987));
series.add(new DataSeriesItem("Invoice sent", 976));
series.add(new DataSeriesItem("Finalized", 846));
configuration.addSeries(series);
add(chart);
}
Aggregations