Highcharts: tooltip Click instead of hover

2019-01-28 12:47发布

Is there a setting for highcharts tooltips where you can set it to display on click versus hover?

I have seen a lot of people discussing the tooltip staying on click but then there is still the hover present. Is there a way to disable the hover and use only click?

标签: highcharts
2条回答
萌系小妹纸
2楼-- · 2019-01-28 12:59

There is not a setting for that in Highcharts currently.

There is a feature request for this functionality here: http://highcharts.uservoice.com/forums/55896-general/suggestions/2607304-allow-the-tooltip-to-appear-when-a-point-is-clicke

Feel free to add your votes and comments.

UPDATE:

I have started using the jquery UI dialog for this purpose. I disable the tooltip in Highcharts, and add a click event to the point in the plotOptions.

In that click function I call an external function, sending it the point object, and build my tooltip within the dialog.

You could also use Highslide for this purpose, and keep it all in the family.

Working example:

查看更多
够拽才男人
3楼-- · 2019-01-28 13:23

Adding for those who has problems like me with useHTML: true and wants to display tooltip only on click and not on hover and wants to have only one tooltip on screen.

Here is a fiddle.

查看更多
登录 后发表回答