Search in sources :

Example 1 with Theme

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));
}
Also used : Theme(com.vaadin.addon.charts.model.style.Theme) Test(org.junit.Test)

Example 2 with Theme

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));
}
Also used : Theme(com.vaadin.addon.charts.model.style.Theme) Test(org.junit.Test)

Example 3 with Theme

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));
}
Also used : GradientColor(com.vaadin.addon.charts.model.style.GradientColor) Theme(com.vaadin.addon.charts.model.style.Theme) Test(org.junit.Test)

Example 4 with Theme

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));
}
Also used : Theme(com.vaadin.addon.charts.model.style.Theme) Test(org.junit.Test)

Aggregations

Theme (com.vaadin.addon.charts.model.style.Theme)4 Test (org.junit.Test)4 GradientColor (com.vaadin.addon.charts.model.style.GradientColor)1