use of com.vaadin.addon.charts.model.ColorAxis in project charts by vaadin.
the class TreemapWithColorAxis method getChart.
@Override
protected Component getChart() {
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");
return chart;
}
Aggregations