use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesWaterfallPlotoptions.
public void chartTypesWaterfallPlotoptions() {
// Define the colors
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
final Color balanceColor = SolidColor.BLACK;
final Color positiveColor = SolidColor.BLUE;
final Color negativeColor = SolidColor.RED;
// Configure the colors
PlotOptionsWaterfall options = new PlotOptionsWaterfall();
options.setUpColor(positiveColor);
options.setColor(negativeColor);
// Configure the labels
DataLabels labels = new DataLabels(true);
labels.setVerticalAlign(VerticalAlign.TOP);
labels.setY(-20);
labels.setFormatter("Math.floor(this.y/1000) + 'k'");
Style style = new Style();
style.setColor(SolidColor.BLACK);
style.setFontWeight(FontWeight.BOLD);
labels.setStyle(style);
options.setDataLabels(labels);
options.setPointPadding(0);
conf.setPlotOptions(options);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesPieSnippet1.
public void chartTypesPieSnippet1() {
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
PlotOptionsPie options = new PlotOptionsPie();
// Non-0 results in a donut
options.setInnerSize("0");
// Default
options.setSize("75%");
// Default
options.setCenter("50%", "50%");
conf.setPlotOptions(options);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesBoxplotSnippet1.
public void chartTypesBoxplotSnippet1() {
Chart chart = new Chart(ChartType.BOXPLOT);
chart.setWidth("400px");
chart.setHeight("300px");
// Modify the default configuration a bit
Configuration conf = chart.getConfiguration();
conf.setTitle("Orienteering Split Times");
conf.getLegend().setEnabled(false);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class GettingStarted method configuringTheColors.
public void configuringTheColors() {
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
DataSeries girls = new DataSeries("Girls");
DataSeries boys = new DataSeries("Boys");
PlotOptionsLine girlsOpts = new PlotOptionsLine();
girlsOpts.setColor(SolidColor.HOTPINK);
girls.setPlotOptions(girlsOpts);
PlotOptionsLine boysOpts = new PlotOptionsLine();
boysOpts.setColor(SolidColor.BLUE);
boys.setPlotOptions(boysOpts);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class GettingStarted method addColumnsSnippet1.
public void addColumnsSnippet1(List<WeatherInfo> weatherInfo) {
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
ListDataProvider<WeatherInfo> dataProvider = new ListDataProvider<>(weatherInfo);
DataProviderSeries<WeatherInfo> humidity = new DataProviderSeries<>(dataProvider);
humidity.setName("Humidity");
humidity.setX(WeatherInfo::getInstant);
humidity.setY(WeatherInfo::getMeanHumidity);
humidity.setPlotOptions(new PlotOptionsColumn());
conf.addSeries(humidity);
}
Aggregations