Wednesday, 7 August 2013

Adding a X-value line on nvd3

Adding a X-value line on nvd3

I'm using a chart similar to the sample linechart example. I want to
implement an x-value line on the chart, something similar to this flot
examples.
I tried with something like the following, but can't get it to work.
Here's the jsFiddle. Any ideas?
bg.on("mousemove",function(){
m1 = d3.mouse(this);
var line = bg.append("line")
.attr("y1",0)
.attr("y2",height)
.attr("x1", m1[0])
.attr("x2",m1[0]);
});

No comments:

Post a Comment