0
我試圖創建彈出窗口(提示)動態生成的圈子中RaphaelJS用下面的代碼段創建一個JavaScript圖表的一部分:如何添加彈出窗口動態生成的JavaScript圈
var p1, p2, bar_width;
p1 = 0;
p2 = 0 + 1;
bar_width = c.chart_rect.width/(c.chart_data[p1][p2].length - 1) - c.series.set_gap;
var qlc = [[]];
var qlp = [[]];
// Loop through series.
for (var i = 1; i < c.chart_data[d].length; i++) {
qlc[i] = [];
qlp[i] = [];
// Loop through data points.
for (var s = 1; s < c.chart_data[d][0].length; s++) {
qlc[i][s] = paper.circle
(
c.chart_rect.x + ((p2-1) * (bar_width + c.series.set_gap)) + c.series.set_gap/2 + ((s-1) * bar_width/(c.chart_data[d][0].length - 2)),
c.chart_rect.y + c.chart_rect.height - ((c.chart_data[d][i][s] - min) * (c.chart_rect.height/(max - min))),
3
).attr({fill: "#000000", 'stroke-width': 1});
qlp[i][s] = paper.popup(186, 215, "Hi I m a Circle...:)").attr({font: "9px sans-serif"}).hide();
qlc[i][s].mouseover(function(){
qlp[i][s].show();
}).mouseout(function(){
qlp[i][s].hide();
});
}
}
然而該代碼在qlp[i][s].show;
和qlp[i][s].hide;
行上給我一個Uncaught TypeError: Cannot read property '8' of undefined
錯誤。
有人知道我要去哪裏錯或我該怎麼做?