0

I am currently building an Ionic mobile prototype with mock JSON data, hardcoded in the code. I am using angular charts to build my charts.

Looking at the Doughnut chart example, you can see label/data when hovering over it. How do I add a percent sign after the value?

I looked at this question but the Chart.js source code has changed quite a bit since then.

Community
  • 1
  • 1
Marco Lau
  • 107
  • 1
  • 9

1 Answers1

0

By simply inserting chart option in your html markup and specifying template for your tooltip will work for you.

<canvas id="doughnut" class="chart chart-doughnut"
  chart-data="data" chart-labels="labels"
        chart-options="{tooltipTemplate: '<%=label%>:<%=value%>%'}">
</canvas>

Here is the working CodePen for same.

J-D
  • 1,575
  • 1
  • 11
  • 22