use of com.vaadin.flow.component.charts.model.Level in project flow-components by vaadin.
the class Organization method createPlotOptions.
private PlotOptionsOrganization createPlotOptions() {
PlotOptionsOrganization plotOptions = new PlotOptionsOrganization();
plotOptions.setColorByPoint(false);
plotOptions.setColor(new SolidColor("#007ad0"));
DataLabels dataLabels = new DataLabels();
dataLabels.setColor(SolidColor.BLACK);
plotOptions.setDataLabels(dataLabels);
plotOptions.setBorderColor(SolidColor.WHITE);
Level level0 = new Level();
level0.setLevel(0);
level0.setColor(new SolidColor("#99AED3"));
Level level1 = new Level();
level1.setLevel(1);
level1.setColor(new SolidColor("#CCE6C3"));
Level level2 = new Level();
level2.setLevel(2);
level2.setColor(new SolidColor("#E1F39D"));
Level level3 = new Level();
level3.setLevel(3);
level3.setColor(new SolidColor("#CCE6C3"));
Level level4 = new Level();
level4.setLevel(4);
level4.setColor(new SolidColor("#CABEDC"));
Level level5 = new Level();
level5.setLevel(5);
level5.setColor(new SolidColor("#CABDD4"));
plotOptions.addLevel(level0);
plotOptions.addLevel(level1);
plotOptions.addLevel(level2);
plotOptions.addLevel(level3);
plotOptions.addLevel(level4);
return plotOptions;
}
use of com.vaadin.flow.component.charts.model.Level in project flow-components by vaadin.
the class Treemap method initDemo.
@Override
public void initDemo() {
Chart chart = new Chart(ChartType.TREEMAP);
Configuration conf = chart.getConfiguration();
conf.getTooltip().setEnabled(true);
PlotOptionsTreemap plotOptions = new PlotOptionsTreemap();
plotOptions.setLayoutAlgorithm(TreeMapLayoutAlgorithm.STRIPES);
plotOptions.setAlternateStartingDirection(true);
Level level1 = new Level();
level1.setLevel(1);
level1.setLayoutAlgorithm(TreeMapLayoutAlgorithm.SLICEANDDICE);
DataLabels dataLabels = new DataLabels();
dataLabels.setEnabled(true);
dataLabels.setAlign(HorizontalAlign.LEFT);
dataLabels.setVerticalAlign(VerticalAlign.TOP);
level1.setDataLabels(dataLabels);
plotOptions.setLevels(level1);
TreeSeries series = createSeries();
series.setPlotOptions(plotOptions);
chart.getConfiguration().addSeries(series);
chart.getConfiguration().setTitle("Fruit consumption");
add(chart);
}
Aggregations