How to close the tooltip programatically in highchart?

I have a chart with scatter series. I had added a event listener for the chart so that on clicking outside of the tooltip, the tooltip will close. But it is not working it seems.

I am using highchart version 4.2.3.

http://jsfiddle.net/buc3pemq/

Highcharts.chart('container', {

    chart: { events: {
                click: function(event) {
                  var $this = this;
                  _.each(this.series[0].points, function(p){ $this.tooltip.refresh(p)});
                }
              }
},
    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
                                 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    tooltip: {
        shared: true
    },

    series: [
       {
        data: [216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5],
        type: 'scatter'
    }]
});

As I mentioned in my comment you should be able to use tooltip.hide() for hiding tooltip in your chart.

  chart: {
    events: {
      click: function(event) {
        var $this = this;
        this.tooltip.hide();
      }
    }
  },

Live example of hiding tooltip with above method: http://jsfiddle.net/buc3pemq/1/

链接地址: http://www.djcxy.com/p/88740.html

上一篇: 用鼠标点击鼠标以显示高图

下一篇: 如何在高图中以编程方式关闭工具提示?