0

ハイチャートのプロットオプションから関数を呼び出したいのですが、このように試しましたが、スローエラーが発生しました

plotOptions: {
                series: {
                    events: {
                        legendItemClick: function(event) {
                        //iam trying to call a function here
                        sampletest(testArr);

                        }
                    }
                }
            }

これは可能ですか..plotOptionsから別の関数を呼び出す方法.

私が取得しているエラーは

TypeError: d は未定義です

4

2 に答える 2

0

はい、plotoptions イベントから任意の関数を呼び出すことができます。ハイチャートはそれを可能にします。その関数の範囲を確認するだけです

于 2013-05-09T13:21:33.310 に答える
0

例を見てくださいhttp://jsfiddle.net/gF8Cf/3/

    $(function () {
    $('#container').highcharts({
        plotOptions: {
            series: {
                cursor: 'pointer',
                events: {
                    click: function(event) {
                       custom();
                    }
                }
            }
        },

        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]        
        }]
    });

    function custom(){
        alert('aaaa');
    }
});
于 2013-05-10T13:06:24.690 に答える