Search in sources :

Example 81 with DataSeriesItem

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

the class GettingStarted method bindAnotherDataSnippet1.

public void bindAnotherDataSnippet1() {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    DataSeries boys = new DataSeries("Boys");
    ChartsData data = new ChartsData();
    for (ShoeSizeInfo shoeSizeInfo : data.getBoysData()) {
        // Shoe size on the X-axis, age on the Y-axis
        boys.add(new DataSeriesItem(shoeSizeInfo.getSize(), shoeSizeInfo.getAgeMonths() / 12.0f));
    }
    conf.addSeries(boys);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) DataSeries(com.vaadin.addon.charts.model.DataSeries) Chart(com.vaadin.addon.charts.Chart) DataSeriesItem(com.vaadin.addon.charts.model.DataSeriesItem)

Example 82 with DataSeriesItem

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

the class GettingStarted method addingSomeDataSnippet2.

public void addingSomeDataSnippet2() {
    Chart chart = new Chart();
    Configuration conf = chart.getConfiguration();
    ChartsData data = new ChartsData();
    DataSeries girls = new DataSeries("Girls");
    for (ShoeSizeInfo shoeSizeInfo : data.getGirlsData()) {
        // Shoe size on the X-axis, age on the Y-axis
        girls.add(new DataSeriesItem(shoeSizeInfo.getSize(), shoeSizeInfo.getAgeMonths() / 12.0f));
    }
    conf.addSeries(girls);
}
Also used : Configuration(com.vaadin.addon.charts.model.Configuration) DataSeries(com.vaadin.addon.charts.model.DataSeries) Chart(com.vaadin.addon.charts.Chart) DataSeriesItem(com.vaadin.addon.charts.model.DataSeriesItem)

Example 83 with DataSeriesItem

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

the class ChartData method genericDataSeriesSnippet1.

public void genericDataSeriesSnippet1(Configuration conf) {
    DataSeries series = new DataSeries();
    series.setName("Total Reindeer Population");
    series.add(new DataSeriesItem(1959, 181091));
    series.add(new DataSeriesItem(1960, 201485));
    series.add(new DataSeriesItem(1961, 188105));
    series.add(new DataSeriesItem(1962, 177206));
    // Modify the color of one point
    series.get(2).getMarker().setFillColor(SolidColor.RED);
    conf.addSeries(series);
}
Also used : DataSeries(com.vaadin.addon.charts.model.DataSeries) DataSeriesItem(com.vaadin.addon.charts.model.DataSeriesItem)

Example 84 with DataSeriesItem

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

the class ChartData method rangeDataSnippet1.

public void rangeDataSnippet1(Configuration conf) {
    RangeSeries series = new RangeSeries("Temperature Extremes");
    // Give low-high values in constructor
    series.add(new DataSeriesItem(0, -51.5, 10.9));
    series.add(new DataSeriesItem(1, -49.0, 11.8));
    // Set low-high values with setters
    DataSeriesItem point = new DataSeriesItem();
    point.setX(2);
    point.setLow(-44.3);
    point.setHigh(17.5);
    series.add(point);
}
Also used : RangeSeries(com.vaadin.addon.charts.model.RangeSeries) DataSeriesItem(com.vaadin.addon.charts.model.DataSeriesItem)

Example 85 with DataSeriesItem

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

the class ChartData method synchronousDrilldown.

public void synchronousDrilldown() {
    DataSeries series = new DataSeries();
    DataSeriesItem mainItem = new DataSeriesItem("MSIE", 55.11);
    DataSeries drillDownSeries = new DataSeries("MSIE versions");
    drillDownSeries.setId("MSIE");
    drillDownSeries.add(new DataSeriesItem("MSIE 6.0", 10.85));
    drillDownSeries.add(new DataSeriesItem("MSIE 7.0", 7.35));
    drillDownSeries.add(new DataSeriesItem("MSIE 8.0", 33.06));
    drillDownSeries.add(new DataSeriesItem("MSIE 9.0", 2.81));
    series.addItemWithDrilldown(mainItem, drillDownSeries);
}
Also used : DataSeries(com.vaadin.addon.charts.model.DataSeries) DataSeriesItem(com.vaadin.addon.charts.model.DataSeriesItem)

Aggregations

DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)88 DataSeries (com.vaadin.addon.charts.model.DataSeries)81 Chart (com.vaadin.addon.charts.Chart)57 Configuration (com.vaadin.addon.charts.model.Configuration)51 YAxis (com.vaadin.addon.charts.model.YAxis)27 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)19 DataLabels (com.vaadin.addon.charts.model.DataLabels)17 XAxis (com.vaadin.addon.charts.model.XAxis)17 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)12 Random (java.util.Random)12 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)11 Test (org.junit.Test)11 Tooltip (com.vaadin.addon.charts.model.Tooltip)10 Marker (com.vaadin.addon.charts.model.Marker)9 PlotOptionsSpline (com.vaadin.addon.charts.model.PlotOptionsSpline)8 PlotLine (com.vaadin.addon.charts.model.PlotLine)7 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)7 StockPrices (com.vaadin.addon.charts.examples.timeline.util.StockPrices)6 ListSeries (com.vaadin.addon.charts.model.ListSeries)6 Style (com.vaadin.addon.charts.model.style.Style)6