gpt4 book ai didi

javascript - 单击 pieChart nvd3 的图例时调度事件

转载 作者:行者123 更新时间:2023-11-29 10:43:59 25 4
gpt4 key购买 nike

当我点击 pieChart nvd3 的图例并获取系列的值(可见或不可见)时,如何调度事件?

最佳答案

如果你有:

var chart = nv.models.pieChart() 

这是捕获事件的方式:

chart.dispatch.on ('stateChange', function (e) {myFunction (e)}); 

之后:

function myFunction (e) {
var series = e.disabled;
//series is array with "true" or "false" value, this values
//depending if the serie[i] is showing

//more code here for processing
};

关于javascript - 单击 pieChart nvd3 的图例时调度事件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23053653/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com