Home › forums › Using CanvasJS › Show ToolTip only when over or close to datapoint
This topic contains 5 replies, has 3 voices, and was last updated by Vishwas R 2 months, 1 week ago.
In the fiddle below, if the mouse is over a datapoint then the tooltip is shown.
Now move the ouse out of the canvas and then bring it anywhere inside the canvas area, the tooltip is still seen even if mouse is not over any datapoint.
Can this behaviour be changed to having the tooltip be shown only if its over or very close to the datapoint
The toolTip will be shown for a dataPoint when you hover on it and continue to move the mouse inside the plotArea (the toolTip content changes according to the dataPoints).
Once you hover on a dataPoint and then move out of plotArea and again getting the mouse on plotArea will not show toolTip, unless you move closer to or hover on particular dataPoint.
Priyanka M S
if you set toolTip shared property to true, then the tooltip will be shown whenever the mouse is in the plotarea
shared toolTip is recommended for multi-series charts and not for a single series chart.
In case of the shared tooltip, as it is shared among multiple dataPoints, the toolTip is designed to be shown based on nearest x-values irrespective of y-values and chart-type, whenever you mouseover plotArea.
Priyanka M S
so in the fiddle given initially, if the last 3 datapoints have values for y as null, then if you hover over the last datapoint the tooltip is shown for it, and after that on hovering anywhere on the right side of the chart, the tooltip is preserved.
Is there any way to not show the tooltip in those cases.
To put it simply, can the tooltip be shown only when the mouse is over the datapoint?
can the tooltip be shown only when the mouse is over the datapoint?
Tooltip will be shown only when mouse is hovered or near to the dataPoint, when shared property is not set / set to false (defaults to false). But if shared property is set to true, toolTip is shown when you mouse hover the plotArea i.e. the region where dataPoints are rendered.
In the JSFiddle that you have shared, it seems to be working as briefed above.
You must be logged in to reply to this topic.