0

チャートが初期化された後にハイチャート イベントを変更するにはどうすればよいですか?

<div id='report'></div>

var chart = $('#container').highcharts({
        chart: {
        },

        xAxis: {
        },

        plotOptions: {
            series: {
                point: {
                    events: {
                        mouseOver: function() {
                            $reporting.html('inner x: '+ this.x +', y: '+ this.y);
                        }
                    }
                },
                events: {
                    mouseOut: function() {                        
                        $reporting.empty();
                    }
                }
            }
        },

        tooltip: {
            enabled: false
        },

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

chart.options.plotOptions.series.point.events.mouseOver = function() {
$('#report').html('outer x: ' + this.x + ', y: ' + this.y);
}

上記のように mouseOver イベントをオーバーライドしたいのですが、影響がないようです。誰でも助けていただければ幸いです。

4

1 に答える 1

2

リアルタイムでの plotOptions の更新はサポートされていません。jsFiddle .

その方法で 1 シリーズのオプションを更新できます。

chart.series[0].update({
  point: {
    events: {
      mouseOver: function() {
        $('#report').html('outer x: ' + this.x + ', y: ' + this.y);
      }
    }
  } 
});
于 2013-11-07T12:58:22.760 に答える