graphael - Raphael 上的悬停列和工具提示显示有问题吗?

标签 graphael linegraph

我可以使用 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/

相关文章:

特定属性的jquery动画

arrays - 在vb.net中将base64解码为图像

python - 在 Pandas 折线图中绘制多列

javascript - 使用 Chart.Js 绘制最高(绿色)和最低(红色)坐标图

r - ggplot中跨组的连续线

javascript - 如何设置 g.raphael js 饼图方向或起点?

javascript - gRaphael 弹出位置

javascript - gRaphael linechart 绘制超出轴的值

javascript - 我如何将 id 分配给 svg 元素? (给raphaeljs吧)

JavaFX:如何在 XY 线图的 Y 轴上正确实现 `getValueForDisplay()`?