1
votes

i'm using highcharts api, is there an easy way to format the yAxis like below?

Here is an example: JsFiddle

On the yAxis I'd like to keep the symbol "k", "M", etc on the yAxis, but I must have a dot "." as the thousands separator, instead of the ","

I tried to use this function (where localeTab is a string like EN-en, IT-it, etc etc:

toLocaleString(localeTab)

it puts the "." as the thousands separator, but it deletes the "k", "M", etc symbols (like 1.500.000).

I think I can do it by myself in javascript using the formatter function, but it would be a bit tricky :)

Do you know any useful properties?

Thank you so much!

1

1 Answers

7
votes

You can easily set the thousand/decimal separators using Highcharts.setOptions:

 Highcharts.setOptions({
        lang: {
                decimalPoint: ',',
                thousandsSep: '.'
        }
    }); 

Updated Fiddle