use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartConfiguration method plotOptionsSnippet1.
public void plotOptionsSnippet1(Configuration conf) {
Chart chart = new Chart();
Configuration configuration = chart.getConfiguration();
PlotOptionsColumn plotOptions = new PlotOptionsColumn();
plotOptions.setStacking(Stacking.NORMAL);
configuration.setPlotOptions(plotOptions);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesPieDonutSnippet1.
public void chartTypesPieDonutSnippet1() {
PlotOptionsPie options = new PlotOptionsPie();
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
options.setInnerSize("60%");
conf.setPlotOptions(options);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesGaugeAxisSnippet1.
public void chartTypesGaugeAxisSnippet1() {
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
YAxis yaxis = new YAxis();
yaxis.setTitle("km/h");
// The limits are mandatory
yaxis.setMin(0);
yaxis.setMax(100);
// Other configuration
yaxis.getLabels().setStep(1);
yaxis.setTickInterval(10);
yaxis.setTickLength(10);
yaxis.setTickWidth(1);
yaxis.setMinorTickInterval("1");
yaxis.setMinorTickLength(5);
yaxis.setMinorTickWidth(1);
yaxis.setPlotBands(new PlotBand[] { new PlotBand(0, 60, SolidColor.GREEN), new PlotBand(60, 80, SolidColor.YELLOW), new PlotBand(80, 100, SolidColor.RED) });
// Disable grid
yaxis.setGridLineWidth(0);
conf.addyAxis(yaxis);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesWaterfall.
public void chartTypesWaterfall() {
Chart chart = new Chart(ChartType.WATERFALL);
chart.setWidth("500px");
chart.setHeight("350px");
// Modify the default configuration a bit
Configuration conf = chart.getConfiguration();
conf.setTitle("Changes in Reindeer Population in 2011");
conf.getLegend().setEnabled(false);
// Configure X axis
XAxis xaxis = new XAxis();
xaxis.setCategories("Start", "Predators", "Slaughter", "Reproduction", "End");
conf.addxAxis(xaxis);
// Configure Y axis
YAxis yaxis = new YAxis();
yaxis.setTitle("Population (thousands)");
conf.addyAxis(yaxis);
}
use of com.vaadin.addon.charts.model.Configuration in project charts by vaadin.
the class ChartTypes method chartTypesBoxplotPlotoptionsSnippet1.
public void chartTypesBoxplotPlotoptionsSnippet1() {
Chart chart = new Chart(ChartType.BOXPLOT);
Configuration conf = chart.getConfiguration();
// Set median line color and thickness
PlotOptionsBoxplot plotOptions = new PlotOptionsBoxplot();
plotOptions.setMedianColor(SolidColor.BLUE);
plotOptions.setMedianWidth(3);
conf.setPlotOptions(plotOptions);
}
Aggregations