Search code examples
javascriptraphaelgraphael

Some Raphael tags are not appearing on Linechart Mouseover


As can be seen, the 2nd,10th & 13th labels (tags in Raphael language) do not appear on mouseover of their respective graph points (at least not in the viewable area). The problem gets worse (ie more missing tags) when you add more points. Anyone know what the issue might be?

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;

jsfiddle


Solution

  • Issue is due to hover column widths computed correctly, codefix is described in bug report below:

    Linechart Column Width Bug