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