Home › forums › Feature Requests & Feedback › Tooltip customFormatter
This topic contains 2 replies, has 2 voices, and was last updated by dbouyssie 11 months, 2 weeks ago.
If I understood the documentation correctly (https://canvasjs.com/docs/charts/chart-options/tooltip/content-formatter/), the object passed to the contentFormatter function returns all chart series.
It would be nice if this object could also contain the index of series involved in the mouse hover event.
Otherwise it’s pretty hard to display a tooltip containing only the dataPoint coming from this specific series.
I know I can also use the content parameter but it is less flexible.
For instance I would like to format numbers using the exponential format (https://www.w3schools.com/jsref/jsref_toexponential.asp)
So I would need to execute a JS function to achieve this.
Thank you for the suggestion. We will discuss this among the team and give it a thought. For now, you can use e.entries.dataSeries._index if you are not using shared tooltip.
Thank you very much for your quick reply.
Under my version of CanvasJS (1.9.6) the field “_index” is undefined.
However I do have a value at “e.entries.dataSeries.index”.
Thank you for the tip!
You must be logged in to reply to this topic.