我可以使用 gRaphael 显示折线图,但工具提示有问题。仅针对某些列而不是所有列显示工具提示。不知道是不是数据太多的问题,但是207列应该不会太差。 Canvas 尺寸为 900x300。以下是示例代码......任何帮助将不胜感激!
谢谢
var r = Raphael('lgraph');
//Some code here to prep dates, x, prep ccp, ctr, searchp arrays
var linec = r.linechart(10,10,900,300,x,[ccp,ctr,searchp],
{ nostroke: false,
axis: "0 0 1 1",
symbol: "circle",
axisxlabels: dates,
axisxtype: " ",
smooth: true })
linec.hoverColumn(function () {
this.popups = r.set();
for (var i = 0, ii = this.y.length; i < ii; i++) {
this.popups.push(r.popup(this.x, this.y[i], this.values[i]).insertBefore(this));
}
}, function () {
this.popups && this.popups.remove();
});
linec.symbols.attr({ r: 3 });
最佳答案
只需将 g.line-min.js 中的 ak.sort()
替换为 ak.sort(function(a,b) {return a-b} );
或 g.line.js 中的 Xs.sort();
(第 185 行),使用 Xs.sort(function(a,b) {return a-b}) ;
在这里找到解决方案https://github.com/DmitryBaranovskiy/g.raphael/issues/19#issuecomment-3766164
关于graphael - Raphael 上的悬停列和工具提示显示有问题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9747703/