我想让堆叠条形图的每个部分(在我的例子中是水平的)都可以单击到特定的超链接(基本上是“向下钻取”)。我认为 g.bar.js 中没有这个功能,但是有人这样做过或者可以为我指出正确的方向吗?在点图上也很有用。
最佳答案
好吧,发布这个问题似乎激励了我去弄清楚......
使用提供的演示条形图,我向 fin 函数添加了一行:
fin = function () {
this.flag = r.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
/* add this for linked bars */
this.attr({href: "http://myurl.com/"+this.bar.x+"/"+this.bar.y+"/"+this.bar.value});
},
关于raphael - 带有可点击条形的 g.raphael 条形图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5006215/