【问题标题】:How can I add click event to my Raphael pie chart?如何将点击事件添加到我的 Raphael 饼图?
【发布时间】:2011-08-26 04:59:53
【问题描述】:

如何将点击事件添加到我的Raphael 饼图?

var r = Raphael("holder-1",340, 185); 
pie = r.g.piechart(150,85, 75, values , {legend: labels, legendpos: "east"});

我得到了答案:

pie.click(function () {     });

我可以将值传递给onclick event? Here can I pass values and labels to onclick` 函数吗?

【问题讨论】:

    标签: charts dom-events raphael graphael


    【解决方案1】:

    根据node attribute 的文档,您应该能够像使用它的任何 DOM 元素一样附加事件:

    pie.node.onclick = function () { /* Something */ };
    

    【讨论】:

    • 我们可以将值传递给 onclick 事件吗?
    猜你喜欢
    • 1970-01-01
    • 2013-04-10
    • 2012-04-03
    • 1970-01-01
    • 2013-06-13
    • 1970-01-01
    • 2013-02-11
    • 2022-01-06
    相关资源
    最近更新 更多