This is a nice addition to our chart, but we know that Roshan specifically asked for the tooltip to appear near his cursor. We also take Calvin's advice about making things a bit more engaging and easier to use.
We can enable lines to span the length of the grid and intersect with the cursor. This will make it more obvious where the user's cursor is on the grid. We can also use tooltipLocation
to move our tooltip around respective to the cursor. We return to the chart we just created and make a few changes. We set the following options within the cursor
object:
We start by changing
tooltipLocation
tose
:cursor: { show: true, tooltipLocation:'se',
Next, we add the
followMouse
option and set it totrue
to allow the tooltip to follow the cursor:followMouse: true,
We enable both the vertical and horizontal cursor lines by setting
showVerticalLine
andshowHorizontalLine
totrue
:showVerticalLine: true...