Articles in this section
Category / Section

How to Display Values in Tooltip for JavaScript Column Chart?

2 mins read

This article explains how to display additional values in the tooltip for a JavaScript column chart.

Solution

In the tooltipRender, replace the ${point.tooltip} placeholder with the value of tooltipMappingName1 (additional data). This modification allows to include extra information alongside the existing tooltip mapping name.

Code-snippet:

The following example shows how to display additional values in tooltip for javascript column chart.

var data = [{ x: 'GBR', y: 27, tooltipMappingName: 'Great Britain', tooltipMappingName1: 'Gold', }];
var chart = new ej.charts.Chart({
tooltip: { enable: true, format: "<b>${point.x} : ${point.y} (${point.tooltip})(${point.tooltip})</b>" },
series: [
   {
     tooltipMappingName: 'tooltipMappingName',
     dataSource: data,
   },
 ],
tooltipRender(args)  {
           args.text = args.text.replace('${point.tooltip}',                  args.series.dataSource[args.point.index].tooltipMappingName1);
},
});

The following screenshot illustrates the output of the above code snippet

image.png

View Sample in Stackblitz

Conclusion
I hope you enjoyed learning how to display values in tooltip for JavaScript Column Chart.

You can refer to our JavaScript Column Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

You can also explore our JavaScript Column Chart Example to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page.
If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied