当我试图获取我的拉斐尔图表标签时,我收到了这个错误:
bar[i * (multi || 1) + j] 未定义 http://localhost:8080/en/plugins/SocialConversationPlugin/js/g.bar-min.js 149 号线
该行:
L = paper.g.text(bars[i * (multi || 1) + j].x, isBottom ? y + height - barvgutter / 2 : bars[i * (multi || 1) + j].y - 10, label).insertBefore(covers[i * (multi || 1) + j]);
我的代码:
$$("#activityTab td.month").each(function (s) {
labels.push(s.innerHTML);
});
var r = Raphael("holder",1000,260),
data2 = [ligne1, ligne2, ligne3],
fin = function () {
this.flag = r.g.popup(this.bar.x, this.bar.y, this.bar.value || "0").insertBefore(this);
},
fout = function () {
this.flag.animate({opacity: 0}, 300, function () {this.remove();});
};
r.g.txtattr.font = "12px 'Fontin Sans', Fontin-Sans, sans-serif";
r.g.text(562, 250, "Multiple Series Stacked Chart");
r.g.barchart(150, 10, 700, 220, data2, {stacked:false, type: "soft"})
.hover(fin, fout)
.label(labels);
图表已绘制,但我只是将第一个标签的第一个字母绘制到我的图表上。