Search in sources :

Example 81 with Configuration

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);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsColumn(com.vaadin.addon.charts.model.PlotOptionsColumn) Chart(com.vaadin.addon.charts.Chart)

Example 82 with Configuration

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);
}
Also used : PlotOptionsPie(com.vaadin.addon.charts.model.PlotOptionsPie) Configuration(com.vaadin.addon.charts.model.Configuration) Chart(com.vaadin.addon.charts.Chart)

Example 83 with Configuration

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);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotBand(com.vaadin.addon.charts.model.PlotBand) Chart(com.vaadin.addon.charts.Chart) YAxis(com.vaadin.addon.charts.model.YAxis)

Example 84 with Configuration

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);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) Chart(com.vaadin.addon.charts.Chart) XAxis(com.vaadin.addon.charts.model.XAxis) YAxis(com.vaadin.addon.charts.model.YAxis)

Example 85 with Configuration

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);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) PlotOptionsBoxplot(com.vaadin.addon.charts.model.PlotOptionsBoxplot) Chart(com.vaadin.addon.charts.Chart)

Aggregations

Configuration (com.vaadin.addon.charts.model.Configuration)257 Chart (com.vaadin.addon.charts.Chart)196 YAxis (com.vaadin.addon.charts.model.YAxis)100 DataSeries (com.vaadin.addon.charts.model.DataSeries)72 ListSeries (com.vaadin.addon.charts.model.ListSeries)70 XAxis (com.vaadin.addon.charts.model.XAxis)65 Test (org.junit.Test)58 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)56 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)54 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)51 Tooltip (com.vaadin.addon.charts.model.Tooltip)42 DataLabels (com.vaadin.addon.charts.model.DataLabels)41 Legend (com.vaadin.addon.charts.model.Legend)30 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)30 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)27 Elements (org.jsoup.select.Elements)27 Marker (com.vaadin.addon.charts.model.Marker)22 DesignContext (com.vaadin.ui.declarative.DesignContext)22 Element (org.jsoup.nodes.Element)22 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)20