Vaadin Chart - How to getting generated color of lines chart

Hi there,
In our application, we use line chart to show customer order, below chart, we have a table to display detail for each line, the table rows should be colorized with corresponding chart line’s color.

When preparing list of ListSeries, I don’t specific the line color (because there are various number of chart line), then I need to get generated color from chart to decorate the table detail.

I tried to get the color from chart’s configuration, but it returns null value

//After calling chart.draw() final List<Series> series = chart.getConfiguration().getSeries(); for(final Series each: series) { if (each instanceof ListSeries) { final ListSeries eachListSeries = (ListSeries) each; final Collection<AbstractPlotOptions> eachListSeriesAbstractPlotOptions = eachListSeries.getConfiguration().getPlotOptions(); for(final AbstractPlotOptions eachPlotOption : eachListSeriesAbstractPlotOptions){ if (eachPlotOption instanceof PlotOptionsLine) { final PlotOptionsLine eachPlotOptionLine = (PlotOptionsLine) eachPlotOption; //Return null in my case eachPlotOptionLine.getColor(); } } } } So, is there any way I can get the color what is generated by Vaadin Chart? Could you please give me any hint?
Thank you for your reading!

I don’t think you can read the colors from Java if you haven’t defined them yourself. I didn’t quite understand what prevents you defining the colors for each series?

Hi Johannes,
In our application, there are various number of lines depend on user’s selections, VaadinChart already defined rather good set of colors. So I think it’d better if I can get and reuse defined colors.

Now, I’m trying to implement way to get random color from SolidColor class, but because it’s random, so sometime colors not well-looking (ex: 4 lines of chart with color: Green, ForestFGreen, Gray, SLATEGRAY)…

In case there is no way to get defined color from VaadinChart, I might define a list of colors exactly same as what Vaadin Chart generates.

If you have any idea, I really appriciate it.

Thank you for your attention