use of com.vaadin.flow.component.charts.model.style.SolidColor 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.style.SolidColor 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);
}
use of com.vaadin.flow.component.charts.model.style.SolidColor in project flow-components by vaadin.
the class ConfigurationJSONSerializationTest method configurationJSONSerialization_setOptionsWithInactiveState_inactiveStatesSerialized.
@Test
public void configurationJSONSerialization_setOptionsWithInactiveState_inactiveStatesSerialized() {
Configuration conf = new Configuration();
PlotOptionsPie options = new PlotOptionsPie();
States states = options.getStates();
Inactive inactive = states.getInactive();
inactive.setOpacity(1.0);
inactive.setBorderColor(new SolidColor("#000000"));
inactive.setColor(new SolidColor("#808080"));
inactive.setAnimation(false);
conf.setPlotOptions(options);
assertEquals("{\"chart\":{\"styledMode\":false},\"plotOptions\":{\"pie\":{\"states\":{\"inactive\":{\"animation\":false,\"borderColor\":\"#000000\",\"color\":\"#808080\",\"opacity\":1.0}}}},\"series\":[],\"exporting\":{\"enabled\":false}}", toJSON(conf));
}
use of com.vaadin.flow.component.charts.model.style.SolidColor in project flow-components by vaadin.
the class LumoDarkTheme method setAxisDefaults.
protected void setAxisDefaults(AxisStyle style) {
style.setGridLineColor(GRID_COLOR);
style.setLineColor(GRID_COLOR);
style.setLineWidth(0);
style.setTickWidth(0);
style.setTickColor(new SolidColor(192, 208, 224));
style.setAlternateGridColor(new SolidColor(255, 255, 255, 0.0));
style.getTitle().setColor(TEXT_COLOR);
style.getTitle().setFontWeight(FontWeight.BOLD);
style.getSubtitle().setColor(SUBTITLE_COLOR);
style.getSubtitle().setFontSize("14px");
style.getSubtitle().setFontWeight(FontWeight.NORMAL);
style.getLabels().setFontWeight(FontWeight.NORMAL);
style.getLabels().setColor(LABEL_COLOR);
style.getLabels().setFontSize("14px");
}
use of com.vaadin.flow.component.charts.model.style.SolidColor in project komunumo-server by komunumo.
the class AnalyticsBoard method populateCharts.
private void populateCharts(@NotNull final Year year) {
// Top row widgets
final var registrations = databaseService.countAttendeesByYear(year, NoShows.INCLUDE);
final var events = databaseService.countEventsByYear(year);
final var noShows = databaseService.countAttendeesByYear(year, NoShows.ONLY);
numberOfRegistrations.setText(FormatterUtil.formatNumber(registrations));
numberOfEvents.setText(FormatterUtil.formatNumber(events));
noShowRate.setText(FormatterUtil.formatNumber(registrations == 0 ? 0 : noShows * 100L / registrations) + "%");
final var locationColorMap = databaseService.getAllLocationColors();
// First chart
final var configuration = monthlyVisitors.getConfiguration();
databaseService.calculateMonthlyVisitorsByYear(year).stream().map(data -> {
final var series = new ListSeries(data.location(), data.january(), data.february(), data.march(), data.april(), data.may(), data.june(), data.july(), data.august(), data.september(), data.october(), data.november(), data.december());
final var colorCode = locationColorMap.get(data.location());
if (colorCode != null) {
final var options = new PlotOptionsColumn();
options.setColor(new SolidColor(colorCode));
series.setPlotOptions(options);
}
return series;
}).forEach(configuration::addSeries);
final var x = new XAxis();
x.setCrosshair(new Crosshair());
x.setCategories("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
configuration.addxAxis(x);
final var y = new YAxis();
y.setMin(0);
y.setTitle("");
configuration.addyAxis(y);
final var tooltip = new Tooltip();
tooltip.setShared(true);
configuration.setTooltip(tooltip);
}
Aggregations