use of com.vaadin.addon.charts.model.style.Theme in project charts by vaadin.
the class ChartOptionsJSONSerializationTest method toJSON_ThemeSetWithRadialGradient_ThemeSerializedWithRadialGradient.
@Test
public void toJSON_ThemeSetWithRadialGradient_ThemeSerializedWithRadialGradient() {
Theme theme = new Theme();
theme.setColors(GradientColor.createRadial(1, 2, 3));
options.setTheme(theme);
String expected = String.format(ThemeWithRadialGradientFormat, 1, 2, 3);
assertEquals(expected, toJSON(options));
}
use of com.vaadin.addon.charts.model.style.Theme in project charts by vaadin.
the class ChartOptionsJSONSerializationTest method toJSON_ThemeSet_ThemeSerialized.
@Test
public void toJSON_ThemeSet_ThemeSerialized() {
Theme theme = new Theme();
options.setTheme(theme);
assertEquals(EmptyThemeJson, toJSON(options));
}
use of com.vaadin.addon.charts.model.style.Theme in project charts by vaadin.
the class ChartOptionsJSONSerializationTest method toJSON_ThemeSetWithColorStops_StopsSerialized.
@Test
public void toJSON_ThemeSetWithColorStops_StopsSerialized() {
Theme theme = new Theme();
GradientColor linear = GradientColor.createLinear(1, 2, 3, 4);
linear.addColorStop(5, SolidColor.BLUE);
theme.setColors(linear);
options.setTheme(theme);
String expected = String.format(ThemeWithLinearGradientAndStopsFormat, 1, 2, 3, 4, 5, SolidColor.BLUE.toString());
assertEquals(expected, toJSON(options));
}
use of com.vaadin.addon.charts.model.style.Theme in project charts by vaadin.
the class ChartOptionsJSONSerializationTest method toJSON_ThemeSetWithLinearGradient_ThemeSerializedWithLinearGradient.
@Test
public void toJSON_ThemeSetWithLinearGradient_ThemeSerializedWithLinearGradient() {
Theme theme = new Theme();
theme.setColors(GradientColor.createLinear(1, 2, 3, 4));
options.setTheme(theme);
String expected = String.format(ThemeWithLinearGradientFormat, 1, 2, 3, 4);
assertEquals(expected, toJSON(options));
}
Aggregations