Vaadin Charts: Different tooltips for each series

Hi,

I’m trying to use different tooltip for each of my series, but I can’t figure how to do it.

The obvious way to me is to configure the PlotOptions of the series, something like:

SeriesTooltip tooltip = new SeriesTooltip()
tooltip.setPointFormat("...")

PlotOptionsErrorBar po = new PlotOptionsErrorBar()
po.setTooltip(tooltip)

DataSeries ds = new DataSeries()
ds.setPlotOptions(po)

But that is ineffective, it looks like the series always use the tooltip configured at the chart configuration level.

I found a couple of posts that suggest creating a custom DataSeriesItem class and then customizing the tooltip formatter function accordingly (https://vaadin.com/forum/thread/17462135/different-tooltips-for-different-series-or-points) but that’s super cumbersome especially if you have a lot of series that all need different tooltips. The formatter JS code will become quite hairy.

Am I missing something? What is the “right” way to have per-series tooltips?

Thanks,

Nico