Show multiple tooltips in Google Charts

2019-07-17 15:45发布

问题:

I'm using the combo chart from Google Charts (https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart) in my web application. I have set the tooltips to show on select by specifying the option

tooltip: { trigger: 'selection' }

when initializing the chart. However, I can't find any way to allow the user to select two points at once. Once the user selects a second point, the tooltip on the previous point closes.

Does anyone know how to enable multi-select for the tooltips?

Thanks,

Paul

回答1:

You can use options (at least for line chart)

        selectionMode: 'multiple',
        tooltip: { trigger: 'selection' },
        aggregationTarget: 'series',

so user can select multiple data points. But as I can see only one tooltip is opened with collected data.

Using

        selectionMode: 'multiple',
        tooltip: { trigger: 'selection' },
        aggregationTarget: 'none',

you get multiple tooltips opened.



回答2:

You need to add Configuration options focusTarget: 'category'