2011-02-15 31 views
4

私は、スタックされた棒グラフ(私の場合は水平)の各セグメントを特定のハイパーリンク(基本的に "ドリルダウン")にクリック可能にしたいと考えています。私はこの機能がg.bar.jsにあるとは思わないが、誰かがこれをやっているか、正しい方向に向けることができるのだろうか?ドットチャートにも役立つでしょう。g.raphael棒グラフ(クリック可能な棒グラフ)

答えて

4

さて、質問を投稿すると、提供デモ棒グラフを使用して...

をそれを把握するために私をやる気しているようだ、私はフィン関数に行を追加しました:

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}); 
    }, 
+1

これは動作します。いい物。 –

-1

上の提案されたthis.attrは私のためには機能しませんでしたが、これはでした:

fin = function() { 
    this.flag = r.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this); 

    /* add click event to bar */ 
    this.click(function(){ 
     location.href = "http://myurl.com"; 
    }); 
},