Reputation: 520
I have a dygraph where if you mouse over it, it shows the values of the series at the top of the chart. Sometimes, the line series overlaps with the "tooltip". In FLOT, I used to specify an offset which was used by FLOT to restrict the line to lower threshold so that tooltip area was clear and did not overlap with the actual graph.
Is there a similar way to achieve this using Dygraphs?
Upvotes: 4
Views: 1812
Reputation: 520
I figured out a good way to do this:
Dygraph supports "valueRange" option for y axis. I found the max value in my series and then set the valueRange to [null, maxYValue*1.2]. This produces a 20% margin from the top allowing tooltip free and clear room to display data without intersecting with the chart lines.
Upvotes: 2
Reputation: 16903
You could try legend: "follow"
, or perhaps use a <div>
outside the chart as in this example. I don't know of a simple way to achieve the exact effect you're asking for, though.
Upvotes: 2