Search in sources :

Example 71 with Configuration

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

the class SVGGeneratorTest method generateSVGFromAnEmptyConfiguration.

@Test
public void generateSVGFromAnEmptyConfiguration() throws IOException, InterruptedException {
    Configuration configuration = new Configuration();
    String svg = svgGenerator.generate(configuration);
    Path emptyConfigChart = Paths.get("src", "test", "resources", "empty.svg");
    String emptyChartContent = readUtf8File(emptyConfigChart);
    assertEquals(replaceIds(emptyChartContent), replaceIds(svg));
}
Also used : Path(java.nio.file.Path) Configuration(com.vaadin.flow.component.charts.model.Configuration) Test(org.junit.Test)

Example 72 with Configuration

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

the class ConfigurationTest method configurationSetSeriesWithArraysAsListTest.

@Test(expected = Test.None.class)
public void configurationSetSeriesWithArraysAsListTest() {
    Configuration conf = new Configuration();
    conf.setSeries(Arrays.asList(new ListSeries()));
    conf.addSeries(new ListSeries());
    assertEquals(conf.getSeries().size(), 2);
}
Also used : Configuration(com.vaadin.flow.component.charts.model.Configuration) ListSeries(com.vaadin.flow.component.charts.model.ListSeries) Test(org.junit.Test)

Aggregations

Configuration (com.vaadin.flow.component.charts.model.Configuration)72 Chart (com.vaadin.flow.component.charts.Chart)48 DataSeries (com.vaadin.flow.component.charts.model.DataSeries)32 YAxis (com.vaadin.flow.component.charts.model.YAxis)32 XAxis (com.vaadin.flow.component.charts.model.XAxis)25 ListSeries (com.vaadin.flow.component.charts.model.ListSeries)24 DataSeriesItem (com.vaadin.flow.component.charts.model.DataSeriesItem)20 Tooltip (com.vaadin.flow.component.charts.model.Tooltip)19 Test (org.junit.Test)16 DataLabels (com.vaadin.flow.component.charts.model.DataLabels)12 PlotOptionsColumn (com.vaadin.flow.component.charts.model.PlotOptionsColumn)10 Path (java.nio.file.Path)10 PlotOptionsSeries (com.vaadin.flow.component.charts.model.PlotOptionsSeries)9 AxisTitle (com.vaadin.flow.component.charts.model.AxisTitle)8 Legend (com.vaadin.flow.component.charts.model.Legend)8 Labels (com.vaadin.flow.component.charts.model.Labels)7 StockPrices (com.vaadin.flow.component.charts.examples.timeline.util.StockPrices)6 RangeSelector (com.vaadin.flow.component.charts.model.RangeSelector)5 SeriesTooltip (com.vaadin.flow.component.charts.model.SeriesTooltip)5 Pane (com.vaadin.flow.component.charts.model.Pane)4