Topic: How to set up custom tooltip templates for Charts using Angular2 TypeScript

Łukasz Salamon pro asked 5 years ago


I want to set custom formating for values shown in tooltip for base line chart.

I've tried to change options object that is passed to BaseChartDirective but that doesn't seem to have any effect. That's what I've tried:

chartOptions: any = {
  responsive: true,
  tooltipTemplate: "<%if (label){%><%=label %>: <%}%><%= value + ' %' %>",
  multiTooltipTemplate: "<%= value + ' %' %>",

Any help would be appreciated.

Edyta Dabrowska free answered 5 years ago

Hi, we are using chart.js library and there you can find everything needed about tooltips. And add what is necessary exactly like you did, in 'chartOptions'.

Please insert min. 20 characters.


Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.



Specification of the issue

  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No