Search in sources :

Example 1 with ColorAxis

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

Aggregations

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