user2010955
user2010955

Reputation: 4011

highcharts axis format decimal point

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!

Upvotes: 1

Views: 1580

Answers (1)

carla
carla

Reputation: 2117

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

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

Updated Fiddle

Upvotes: 7

Related Questions