Show multiple tooltips in Google Charts

2019-07-17 16:15发布

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

2条回答
手持菜刀,她持情操
2楼-- · 2019-07-17 16:21

You need to add Configuration options focusTarget: 'category'

查看更多
来,给爷笑一个
3楼-- · 2019-07-17 16:33

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.

查看更多
登录 后发表回答