Search in sources :

Example 76 with ListSeries

use of com.vaadin.addon.charts.model.ListSeries in project charts by vaadin.

the class StepLines method getChart.

@Override
protected Component getChart() {
    Chart chart = new Chart();
    Configuration configuration = chart.getConfiguration();
    configuration.setTitle("Step lines");
    configuration.getxAxis().setCategories("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    ListSeries ls = new ListSeries();
    ls.setName("Right");
    ls.setData(1, 2, 3, 4, null, 6, 7, null, 9);
    PlotOptionsLine options = new PlotOptionsLine();
    options.setStep(StepType.RIGHT);
    ls.setPlotOptions(options);
    configuration.addSeries(ls);
    ls = new ListSeries();
    ls.setName("Center");
    ls.setData(5, 6, 7, 8, null, 10, 11, null, 13);
    options = new PlotOptionsLine();
    options.setStep(StepType.CENTER);
    ls.setPlotOptions(options);
    configuration.addSeries(ls);
    ls = new ListSeries();
    ls.setName("Left");
    ls.setData(9, 10, 11, 12, null, 14, 15, null, 17);
    options = new PlotOptionsLine();
    options.setStep(StepType.LEFT);
    ls.setPlotOptions(options);
    configuration.addSeries(ls);
    chart.drawChart(configuration);
    return chart;
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) ListSeries(com.vaadin.addon.charts.model.ListSeries) PlotOptionsLine(com.vaadin.addon.charts.model.PlotOptionsLine) Chart(com.vaadin.addon.charts.Chart)

Example 77 with ListSeries

use of com.vaadin.addon.charts.model.ListSeries in project charts by vaadin.

the class ChartTypes method chartTypesSolidGaugeDataSnippet2.

public void chartTypesSolidGaugeDataSnippet2() {
    VerticalLayout layout = new VerticalLayout();
    final ListSeries series = new ListSeries("Pressure MPa", 80);
    final TextField tf = new TextField("Enter a new value");
    layout.addComponent(tf);
    Button update = new Button("Update", new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            Integer newValue = new Integer(tf.getValue());
            series.updatePoint(0, newValue);
        }
    });
    layout.addComponent(update);
}
Also used : ListSeries(com.vaadin.addon.charts.model.ListSeries) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.ui.VerticalLayout) TextField(com.vaadin.ui.TextField)

Example 78 with ListSeries

use of com.vaadin.addon.charts.model.ListSeries in project charts by vaadin.

the class ChartTypes method chartTypesSolidGaugeDataSnippet1.

public void chartTypesSolidGaugeDataSnippet1() {
    Chart chart = new Chart(ChartType.SOLIDGAUGE);
    Configuration conf = chart.getConfiguration();
    ListSeries series = new ListSeries("Pressure MPa", 80);
    conf.addSeries(series);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) ListSeries(com.vaadin.addon.charts.model.ListSeries) Chart(com.vaadin.addon.charts.Chart)

Example 79 with ListSeries

use of com.vaadin.addon.charts.model.ListSeries in project charts by vaadin.

the class ChartTypes method chartTypesGaugeDataSnippet1.

public void chartTypesGaugeDataSnippet1() {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    ListSeries series = new ListSeries("Speed", 80);
    conf.addSeries(series);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) ListSeries(com.vaadin.addon.charts.model.ListSeries) Chart(com.vaadin.addon.charts.Chart)

Example 80 with ListSeries

use of com.vaadin.addon.charts.model.ListSeries in project charts by vaadin.

the class ChartTypes method chartTypeSpiderWebSnippet1.

public void chartTypeSpiderWebSnippet1() {
    Chart chart = new Chart(ChartType.LINE);
    // Modify the default configuration a bit
    Configuration conf = chart.getConfiguration();
    conf.getChart().setPolar(true);
    // Create the range series
    // Source: http://ilmatieteenlaitos.fi/lampotilaennatyksia
    ListSeries series = new ListSeries("Temperature Extremes", 10.9, 11.8, 17.5, 25.5, 31.0, 33.8, 37.2, 33.8, 28.8, 19.4, 14.1, 10.8);
    conf.addSeries(series);
    // Set the category labels on the X axis correspondingly
    XAxis xaxis = new XAxis();
    xaxis.setCategories("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
    xaxis.setTickmarkPlacement(TickmarkPlacement.ON);
    xaxis.setLineWidth(0);
    conf.addxAxis(xaxis);
    // Configure the Y axis
    YAxis yaxis = new YAxis();
    // Webby look
    yaxis.setGridLineInterpolation("polygon");
    yaxis.setMin(0);
    yaxis.setTickInterval(10);
    yaxis.getLabels().setStep(1);
    conf.addyAxis(yaxis);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) ListSeries(com.vaadin.addon.charts.model.ListSeries) Chart(com.vaadin.addon.charts.Chart) XAxis(com.vaadin.addon.charts.model.XAxis) YAxis(com.vaadin.addon.charts.model.YAxis)

Aggregations

ListSeries (com.vaadin.addon.charts.model.ListSeries)88 Chart (com.vaadin.addon.charts.Chart)76 Configuration (com.vaadin.addon.charts.model.Configuration)70 YAxis (com.vaadin.addon.charts.model.YAxis)46 XAxis (com.vaadin.addon.charts.model.XAxis)35 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)31 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)25 Tooltip (com.vaadin.addon.charts.model.Tooltip)24 Legend (com.vaadin.addon.charts.model.Legend)18 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)18 DataLabels (com.vaadin.addon.charts.model.DataLabels)17 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)16 Title (com.vaadin.addon.charts.model.Title)15 Labels (com.vaadin.addon.charts.model.Labels)11 PlotOptionsArea (com.vaadin.addon.charts.model.PlotOptionsArea)11 Marker (com.vaadin.addon.charts.model.Marker)10 VerticalLayout (com.vaadin.ui.VerticalLayout)9 Hover (com.vaadin.addon.charts.model.Hover)8 States (com.vaadin.addon.charts.model.States)8 GradientColor (com.vaadin.addon.charts.model.style.GradientColor)8