Search in sources :

Example 51 with DataLabels

use of com.vaadin.addon.charts.model.DataLabels in project charts by vaadin.

the class LabelsJSONSerializationTest method toJSON_allowOverlapIsSet_labelsSerializedWithAllowOverlap.

@Test
public void toJSON_allowOverlapIsSet_labelsSerializedWithAllowOverlap() throws IOException {
    DataLabels labels = new DataLabels(true);
    labels.setAllowOverlap(true);
    ObjectMapper om = ChartSerialization.createObjectMapper();
    String json = toJSON(labels);
    DataLabels fromJson = om.readValue(json, DataLabels.class);
    assertEquals(true, fromJson.getAllowOverlap());
}
Also used : DataLabels(com.vaadin.addon.charts.model.DataLabels) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper) Test(org.junit.Test)

Aggregations

DataLabels (com.vaadin.addon.charts.model.DataLabels)51 Chart (com.vaadin.addon.charts.Chart)45 Configuration (com.vaadin.addon.charts.model.Configuration)41 YAxis (com.vaadin.addon.charts.model.YAxis)30 DataSeries (com.vaadin.addon.charts.model.DataSeries)22 SolidColor (com.vaadin.addon.charts.model.style.SolidColor)19 AxisTitle (com.vaadin.addon.charts.model.AxisTitle)18 DataSeriesItem (com.vaadin.addon.charts.model.DataSeriesItem)17 ListSeries (com.vaadin.addon.charts.model.ListSeries)17 XAxis (com.vaadin.addon.charts.model.XAxis)16 Tooltip (com.vaadin.addon.charts.model.Tooltip)13 PlotOptionsPie (com.vaadin.addon.charts.model.PlotOptionsPie)12 PlotOptionsColumn (com.vaadin.addon.charts.model.PlotOptionsColumn)11 Style (com.vaadin.addon.charts.model.style.Style)11 Legend (com.vaadin.addon.charts.model.Legend)9 PlotOptionsLine (com.vaadin.addon.charts.model.PlotOptionsLine)9 Labels (com.vaadin.addon.charts.model.Labels)6 Series (com.vaadin.addon.charts.model.Series)6 GradientColor (com.vaadin.addon.charts.model.style.GradientColor)6 DrilldownCallback (com.vaadin.addon.charts.DrilldownCallback)4