How to detect double clicks or long clicks on points in Highcharts charts?

前端 未结 2 1189
温柔的废话
温柔的废话 2021-01-23 01:08

Highcharts offers the opportunity to detect clicks on chart points, but is it possible to detect other events, such as the double click or mousedown event?

Thanks in adv

2条回答
  •  青春惊慌失措
    2021-01-23 01:56

    It's possible, but in a different way. In Highcharts you can add event to each element using element.on. For example:

        chart.series[0].data[0].graphic.on('dblclick', function() {
           //callback here
        });
    

    And simple jsFiddle for you. Good thing is that you can add to all elements, and make sure work in all browsers.

提交回复
热议问题