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);
}
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);
}
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);
}
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);
}
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);
}
Aggregations