Search in sources :

Example 1 with ColorAxis

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);
}
Also used : TreeSeries(com.vaadin.flow.component.charts.model.TreeSeries) PlotOptionsTreemap(com.vaadin.flow.component.charts.model.PlotOptionsTreemap) ColorAxis(com.vaadin.flow.component.charts.model.ColorAxis) SolidColor(com.vaadin.flow.component.charts.model.style.SolidColor) Chart(com.vaadin.flow.component.charts.Chart)

Aggregations

Chart (com.vaadin.flow.component.charts.Chart)1 ColorAxis (com.vaadin.flow.component.charts.model.ColorAxis)1 PlotOptionsTreemap (com.vaadin.flow.component.charts.model.PlotOptionsTreemap)1 TreeSeries (com.vaadin.flow.component.charts.model.TreeSeries)1 SolidColor (com.vaadin.flow.component.charts.model.style.SolidColor)1