11

Hello fellow programmers .. Im struggling adding a $ prefix to Amcharts Has anyone had any experience adding currency format to AmCharts graphs? So far I have tried many variations around the following with no success...

chart.numberFormatter = {
numberFormatter = numberPrefix="$";
};
leo
  • 356
  • 4
  • 14

2 Answers2

15

To add a prefix to value axis:

valueAxis.unit = "$";
valueAxis.unitPosition = "left";

In case you need this in a balloon, add it to balloonText:

graph.balloonText = "$[[value]]";
Guruprasad J Rao
  • 29,410
  • 14
  • 101
  • 200
zeroin
  • 5,863
  • 6
  • 31
  • 42
6

For AmCharts v4 you can add a dollar sign using this:

chart.numberFormatter.numberFormat = '$#,###';

https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/

Zoe
  • 27,060
  • 21
  • 118
  • 148
chelsea
  • 61
  • 1
  • 1