Search in sources :

Example 71 with Chart

use of com.vaadin.addon.charts.Chart 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 72 with Chart

use of com.vaadin.addon.charts.Chart 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 73 with Chart

use of com.vaadin.addon.charts.Chart 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 74 with Chart

use of com.vaadin.addon.charts.Chart 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)

Example 75 with Chart

use of com.vaadin.addon.charts.Chart in project charts by vaadin.

the class ChartTypes method chartTypesGaugeSnippet1.

public void chartTypesGaugeSnippet1() {
    Chart chart = new Chart(ChartType.GAUGE);
    chart.setWidth("400px");
    chart.setHeight("400px");
}
Also used : Chart(com.vaadin.addon.charts.Chart)

Aggregations

Chart (com.vaadin.addon.charts.Chart)243 Configuration (com.vaadin.addon.charts.model.Configuration)196 YAxis (com.vaadin.addon.charts.model.YAxis)105 DataSeries (com.vaadin.addon.charts.model.DataSeries)81 ListSeries (com.vaadin.addon.charts.model.ListSeries)76 XAxis (com.vaadin.addon.charts.model.XAxis)71 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)57 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)55 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)50 DataLabels (com.vaadin.addon.charts.model.DataLabels)45 Tooltip (com.vaadin.addon.charts.model.Tooltip)44 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)34 Legend (com.vaadin.addon.charts.model.Legend)29 Marker (com.vaadin.addon.charts.model.Marker)23 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)21 Style (com.vaadin.addon.charts.model.style.Style)20 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)19 Labels (com.vaadin.addon.charts.model.Labels)18 VerticalLayout (com.vaadin.ui.VerticalLayout)18 PlotOptionsSpline (com.vaadin.addon.charts.model.PlotOptionsSpline)16