> ## Content Index
> Fetch the complete content index at: https://oyang.cc/llms.txt
> Use this file to discover other available public pages before exploring further.

# 实现Highcharts 图表双击事件
- URL: https://oyang.cc/shi-xian-highcharts-tu-biao-shuang-ji-shi-jian/
- Published: 2020-04-12T04:52:19.000Z
- Updated: 2020-04-12T04:52:21.000Z
- Author: 轶语林
- Tags: highcharts

Highcharts 默认并没有提供图表双击事件接口，这里用很简单的方法实现，代码如下

```
var clickDetected = false;
$("#container").highcharts({
    chart: {
        events: {
            click: function(e) {
                if (clickDetected) {
                    console.log("Double click");
                    console.log(e);
                } else {
                    clickDetected = true;
                    setTimeout(function() {
                        clickDetected = false;
                    }, 500);
                }
            }
        }
    }
});

```