2

I'm trying to print numbers with commas (showing 9,000 instand of just 9000), this is the way I'm setting the format format: '{point.name}: {point.y}'

I cant find a way to get {point.y} into a function that will return the wanted result, I tried this way format: '{point.name}: '+ numberWithCommas(point.y) but then of course point is not defined I'm not sure how to handle it, any direction how can I make it work ?

thanks

Danny
  • 793
  • 1
  • 9
  • 20

1 Answers1

6

You need to do two things:

  • set separator:

    Highcharts.setOptions({
      lang: {
        decimalPoint: '.',
        thousandsSep: ','
      }
    });
    
  • set point format, to use that separator:

    format: '{point.name}: {point.y:,.0f}'
    

More about formatting string in Highcharts can be found in the DOCs ;)

And live demo.

Paweł Fus
  • 44,795
  • 3
  • 61
  • 77