Search in sources :

Example 1 with Inactive

use of com.vaadin.flow.component.charts.model.Inactive in project flow-components by vaadin.

the class ConfigurationJSONSerializationTest method configurationJSONSerialization_setOptionsWithInactiveState_inactiveStatesSerialized.

@Test
public void configurationJSONSerialization_setOptionsWithInactiveState_inactiveStatesSerialized() {
    Configuration conf = new Configuration();
    PlotOptionsPie options = new PlotOptionsPie();
    States states = options.getStates();
    Inactive inactive = states.getInactive();
    inactive.setOpacity(1.0);
    inactive.setBorderColor(new SolidColor("#000000"));
    inactive.setColor(new SolidColor("#808080"));
    inactive.setAnimation(false);
    conf.setPlotOptions(options);
    assertEquals("{\"chart\":{\"styledMode\":false},\"plotOptions\":{\"pie\":{\"states\":{\"inactive\":{\"animation\":false,\"borderColor\":\"#000000\",\"color\":\"#808080\",\"opacity\":1.0}}}},\"series\":[],\"exporting\":{\"enabled\":false}}", toJSON(conf));
}
Also used : States(com.vaadin.flow.component.charts.model.States) PlotOptionsPie(com.vaadin.flow.component.charts.model.PlotOptionsPie) Configuration(com.vaadin.flow.component.charts.model.Configuration) Inactive(com.vaadin.flow.component.charts.model.Inactive) SolidColor(com.vaadin.flow.component.charts.model.style.SolidColor) Test(org.junit.Test)

Aggregations

Configuration (com.vaadin.flow.component.charts.model.Configuration)1 Inactive (com.vaadin.flow.component.charts.model.Inactive)1 PlotOptionsPie (com.vaadin.flow.component.charts.model.PlotOptionsPie)1 States (com.vaadin.flow.component.charts.model.States)1 SolidColor (com.vaadin.flow.component.charts.model.style.SolidColor)1 Test (org.junit.Test)1