use of com.vaadin.addon.charts.model.DataSeries in project charts by vaadin.
the class DataSeriesItemJSONSerializationTest method toJSON_xAndyAreSet_ItemSerializedWithXYAndNull.
@Test
public void toJSON_xAndyAreSet_ItemSerializedWithXYAndNull() {
DataSeriesItem item = new DataSeriesItem();
item.setX(2);
item.setY(3);
DataSeries series = new DataSeries();
series.add(item);
String expected = "{\"data\":[[2,3]]}";
assertEquals(expected, toJSON(series));
}
use of com.vaadin.addon.charts.model.DataSeries in project charts by vaadin.
the class DataSeriesItemJSONSerializationTest method toJSON_xIsSet_ItemSerializedWithXAndNulls.
@Test
public void toJSON_xIsSet_ItemSerializedWithXAndNulls() {
DataSeriesItem item = new DataSeriesItem();
item.setX(2);
DataSeries series = new DataSeries();
series.add(item);
String expected = "{\"data\":[[2,null,null]]}";
assertEquals(expected, toJSON(series));
}
use of com.vaadin.addon.charts.model.DataSeries in project charts by vaadin.
the class DataSeriesItemJSONSerializationTest method toJSON_yIsSet_ItemSerializedWithY.
@Test
public void toJSON_yIsSet_ItemSerializedWithY() {
DataSeriesItem item = new DataSeriesItem();
item.setY(2);
DataSeries series = new DataSeries();
series.add(item);
String expected = "{\"data\":[2]}";
assertEquals(expected, toJSON(series));
}
use of com.vaadin.addon.charts.model.DataSeries in project charts by vaadin.
the class DataSeriesItemJSONSerializationTest method toJSON_PlotOptionsPyramidIsSet_SeriesSerializedWithType.
@Test
public void toJSON_PlotOptionsPyramidIsSet_SeriesSerializedWithType() {
DataSeries series = new DataSeries();
series.setPlotOptions(new PlotOptionsPyramid());
String expected = "{\"data\":[],\"type\":\"pyramid\"}";
assertEquals(expected, toJSON(series));
}
use of com.vaadin.addon.charts.model.DataSeries in project charts by vaadin.
the class DataSeriesItemJSONSerializationTest method toJSON_lowAndHighSet_ItemSerializedAsArrayWithLowAndHigh.
@Test
public void toJSON_lowAndHighSet_ItemSerializedAsArrayWithLowAndHigh() {
DataSeriesItem item = new DataSeriesItem();
item.setLow(2);
item.setHigh(3);
DataSeries series = new DataSeries();
series.add(item);
String expected = "{\"data\":[[2,3]]}";
assertEquals(expected, toJSON(series));
}
Aggregations