当我点击pieChart nvd3的图例并获取系列的值(可见或不可见)时,如何调度事件?
答案 0 :(得分:3)
如果你有:
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
};