use of com.vaadin.flow.component.charts.model.DataLabelsFunnel 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);
}
use of com.vaadin.flow.component.charts.model.DataLabelsFunnel in project flow-components by vaadin.
the class DynamicChangingChart method getFunnelConfiguration.
private Configuration getFunnelConfiguration() {
DataSeries dataSeries = new DataSeries("Unique users");
dataSeries.add(new DataSeriesItem("Website visits", 15654));
dataSeries.add(new DataSeriesItem("Downloads", 4064));
dataSeries.add(new DataSeriesItem("Requested price list", 1987));
dataSeries.add(new DataSeriesItem("Invoice sent", 976));
dataSeries.add(new DataSeriesItem("Finalized", 846));
Configuration configuration = new Configuration();
configuration.setTitle("Sales funnel");
configuration.getLegend().setEnabled(false);
PlotOptionsFunnel options = new PlotOptionsFunnel();
options.setReversed(false);
options.setNeckWidth("30%");
options.setNeckHeight("30%");
options.setWidth("70%");
DataLabelsFunnel dataLabels = new DataLabelsFunnel();
dataLabels.setFormat("<b>{point.name}</b> ({point.y:,.0f})");
options.setDataLabels(dataLabels);
dataSeries.setPlotOptions(options);
configuration.addSeries(dataSeries);
return configuration;
}
use of com.vaadin.flow.component.charts.model.DataLabelsFunnel in project flow-components by vaadin.
the class FunnelChart method initDemo.
@Override
public void initDemo() {
DataSeries dataSeries = new DataSeries("Unique users");
dataSeries.add(new DataSeriesItem("Website visits", 15654));
dataSeries.add(new DataSeriesItem("Downloads", 4064));
dataSeries.add(new DataSeriesItem("Requested price list", 1987));
dataSeries.add(new DataSeriesItem("Invoice sent", 976));
dataSeries.add(new DataSeriesItem("Finalized", 846));
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
conf.setTitle("Sales funnel");
conf.getLegend().setEnabled(false);
PlotOptionsFunnel options = new PlotOptionsFunnel();
options.setReversed(false);
options.setNeckWidth("30%");
options.setNeckHeight("30%");
options.setWidth("70%");
DataLabelsFunnel dataLabels = new DataLabelsFunnel();
dataLabels.setFormat("<b>{point.name}</b> ({point.y:,.0f})");
options.setDataLabels(dataLabels);
dataSeries.setPlotOptions(options);
conf.addSeries(dataSeries);
add(chart);
}
Aggregations