chart tooltip templating - documentation of available template variables

Hi Support!

i have a hard time figuring out what template variables are available in tooltips for charts at what point. 
So far i found in the docu:
  • point.x
  • point.template
  • point.y
  • series.name
Can you put an overview of available template variables somewhere in the docu? Thanks

Maybe you could also change a little how the template resolution renders things:
e.g.
When i put "${chart.title}"as value of the "format" property, it renders the title, so there must be an object "chart" that holds the property "chart.title". 
But for "${chart}", it just prints "${chart}". 

If you'd change this so that "${chart}" returns a stringified version of all props on "chart", then i could look at them and figure things out by myself without needing much docu. 
Then the inline docu could simply just say: "There are these objects providing properties for templating: chart, series, point, ..."

You could even consider making it so that "${}" renders a comma separated list of all the available objects. 


Maybe you could also introduce a Typescript interface that describes the props on the tooltip, so we don't always have to use type "Object" for it. 
Then you could add some jsdoc style docu about props and their useage to the type so IDEs can show this info directly when coding. 



Best regards and happy move into 2021

1 Reply 1 reply marked as answer

DG Durga Gopalakrishnan Syncfusion Team December 23, 2020 03:13 PM UTC

Hi Benjamin,

As of now, we don't have support to display all chart properties in tooltip. Since tooltip function is to display hovered point x and y values, we have an option to display x, y by specifying it as ${x}, ${y} in string content of template. Other than this, you can use format property of tooltip to display series name, x, y and mapping values by specifying ${series.name}, ${point.x}, ${point.y} and ${point.tooltip}. Please check with below links to know more about tooltip.

UG Links:

Online Demo : 

Please revert us if you have any concerns.

Regards,
Durga G


Marked as answer
Loader.
Up arrow icon