可以看出,第 2、第 10 和第 13 个标签(Raphael 语言中的标签)不会出现在其各自图形点的鼠标悬停上(至少不在可视区域中)。当您添加更多点时,问题会变得更糟(即缺少更多标签)。有谁知道可能是什么问题?
var r = Raphael("holder"),
txtattr = {
font: "12px sans-serif"
};
r.text(65, 25, "Basis Points").attr(txtattr);
lines = r.linechart(100, 40, 600, 260, [
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
], [
[12, 32, 23, 15, 17, 27, 22, 12, 32, 23, 15, 17, 27]
],
{
nostroke: false,
axis: "0 0 1 1",
symbol: "circle",
smooth: true
}).hoverColumn(function ()
{
this.tags = r.set();
for (var i = 0, ii = this.y.length; i < ii; i++)
{
this.tags.push(
r.tag(this.x, this.y[i], this.values[i], 160, 10).insertBefore(this)
.attr([
{
fill: "#fff"
},
{
fill: this.symbols[i].attr("fill")
}]));
}
}, function ()
{
this.tags && this.tags.remove();
});
lines.symbols.attr(
{
r: 3
});
r.width = 650;