use of com.vaadin.flow.component.charts.model.ColorAxis in project flow-components by vaadin.
the class TreemapWithColorAxis method initDemo.
@Override
public void initDemo() {
Chart chart = new Chart(ChartType.TREEMAP);
ColorAxis colorAxis = new ColorAxis();
colorAxis.setMinColor(new SolidColor("#FFFFFF"));
colorAxis.setMaxColor(new SolidColor("#7BB5EF"));
chart.getConfiguration().addColorAxis(colorAxis);
PlotOptionsTreemap plotOptions = new PlotOptionsTreemap();
plotOptions.setLayoutAlgorithm(TreeMapLayoutAlgorithm.SQUARIFIED);
TreeSeries series = createSeries();
series.setPlotOptions(plotOptions);
chart.getConfiguration().addSeries(series);
chart.getConfiguration().setTitle("Vaadin Charts Treemap");
add(chart);
}
Aggregations