use of com.vaadin.addon.charts.Chart in project charts by vaadin.
the class ChartTypes method chartTypesGaugeConfigurationSnippet1.
public void chartTypesGaugeConfigurationSnippet1() {
Chart chart = new Chart();
Configuration conf = chart.getConfiguration();
conf.setTitle("Speedometer");
conf.getPane().setStartAngle(-135);
conf.getPane().setEndAngle(135);
}
use of com.vaadin.addon.charts.Chart in project charts by vaadin.
the class ChartTypes method chartTypesSolidGaugePlotoptionsSnippet1.
public void chartTypesSolidGaugePlotoptionsSnippet1() {
Chart chart = new Chart(ChartType.SOLIDGAUGE);
Configuration conf = chart.getConfiguration();
PlotOptionsSolidgauge options = new PlotOptionsSolidgauge();
// Move the value display box at the center a bit higher
DataLabels dataLabels = new DataLabels();
dataLabels.setY(-20);
options.setDataLabels(dataLabels);
conf.setPlotOptions(options);
}
use of com.vaadin.addon.charts.Chart in project charts by vaadin.
the class ChartTypes method chartTypesOhlcSnippet1.
public void chartTypesOhlcSnippet1() {
Chart chart = new Chart(ChartType.OHLC);
chart.setTimeline(true);
Configuration configuration = chart.getConfiguration();
configuration.getTitle().setText("AAPL Stock Price");
DataSeries dataSeries = new DataSeries();
Collection<OhlcData> dataBank = null;
for (OhlcData data : dataBank) {
OhlcItem item = new OhlcItem();
item.setX(data.getDate());
item.setLow(data.getLow());
item.setHigh(data.getHigh());
item.setClose(data.getClose());
item.setOpen(data.getOpen());
dataSeries.add(item);
}
configuration.setSeries(dataSeries);
chart.drawChart(configuration);
}
use of com.vaadin.addon.charts.Chart in project charts by vaadin.
the class ConfigurationTest method getPlotOptions_getAfterChartCreation_EmptyCollectionReturned.
@Test
public void getPlotOptions_getAfterChartCreation_EmptyCollectionReturned() {
Chart chart = new Chart();
Collection<AbstractPlotOptions> result = chart.getConfiguration().getPlotOptions();
assertEquals(0, result.size());
}
use of com.vaadin.addon.charts.Chart in project charts by vaadin.
the class ConfigurationTest method getPlotOptionsForType_noPlotOptionFound_ReturnNull.
@Test
public void getPlotOptionsForType_noPlotOptionFound_ReturnNull() {
Chart chart = new Chart();
AbstractPlotOptions result = chart.getConfiguration().getPlotOptions(ChartType.LINE);
assertNull(result);
}
Aggregations