I have a Vaadin Charts Flow 6 line chart and would like to define some of the VaadinIcons as Marker Symbols.
How can i achieve this?
MarkerSymbol is an interface that is implemented as
- MarkerSymbolEnum for providing predefined markers such as eg. circle, square, diamond etc.
- MarkerSymbolUrl for providing the URL to an image that shall be used as a marker
AtomicInteger xValue = new AtomicInteger(0);
List<Double> yValues = new Random( ).doubles(10, -10, 10).boxed( ).collect(Collectors.toList( ));
List<DataSeriesItem> items = yValues.stream( )
.map(yValue -> new DataSeriesItem(xValue.getAndIncrement( ), yValue))
.collect(Collectors.toList( ));
/* Instead of MarkerSymbolEnum or MarkerSymbolUrl, retrieve a VaadinIcon*/
items.forEach(item -> item.getMarker( ).setSymbol(MarkerSymbolEnum.DIAMOND));
items.forEach(item -> item.getMarker( ).setSymbol(new MarkerSymbolUrl("foo/bar.png")));
// new Icon(VaadinIcon.CHEVRON_UP);
DataSeries series = new DataSeries("example");
series.setData(items);
Chart chart = new Chart(ChartType.LINE);
chart.getConfiguration( ).addSeries(series);
I didn't see an opportunity to retrieve the URL of a VaadinIcon or directly setting it.