【问题标题】:Add labels on bar chart Raphael在条形图 Raphael 上添加标签
【发布时间】:2011-12-18 18:57:05
【问题描述】:

我想为条形图中的每个条添加一个标签,以便为每个条生成动态链接。 attr(href: "http://site.com/label"。当我调用 label() 方法时,调试器告诉我实习方法不存在。

这是我为条形图添加标签的呼吁:

paper.barchart(x, y, sizeX, sizeY, date, attr).hover(fin, fout).attr({opacity: .5}).label(["positive", "negative", "neutre", ""], date);

这是萤火虫的错误

    l.labelise is not a function
label(y=["positive", "negative", "neutre", ""], Z=[41, 33, 26, 100])g.bar-min.js (line 7)
chartBar(paper=a { customAttributes={...}, ca={...}, width=900, more...}, x=550, y=680, sizeX=100, sizeY=150, date=[41, 33, 26, 100])slider.js (line 267)
textSlider()slider.js (line 337)
f(b=Document details.html, f=[function()])jquery-1.7.min.js (line 2)
f(b=Document details.html, c=[function()])jquery-1.7.min.js (line 2)
f(a=undefined)jquery-1.7.min.js (line 2)
f()jquery-1.7.min.js (line 2)
[Break On This Error] (function(){var f=Math.min,a=Math.max;...){return new d(this,h,l,j,g,i,k)}})();
g.bar-min.js (line 7)

这似乎是库中的错误。知道任何人为每个栏生成动态链接的方法吗?

稍后编辑:http://jsfiddle.net/devth/rKjEj/2/

谢谢!

【问题讨论】:

    标签: javascript raphael labels


    【解决方案1】:

    我找到的解决方案如下:

    paper.barchart(/*parameters*/).each(function (){
              this.attr({ href: "your/address" }); 
    })
    

    L.E.:http://jsfiddle.net/urmelinho/rKjEj/22/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-05-09
      • 2018-08-14
      • 1970-01-01
      • 2016-07-06
      • 2020-06-21
      相关资源
      最近更新 更多