Charts: decimal separator

Charts: decimal separator

  
Maybe I'm overlooking some setting, but it seems that the platform always adds a "Highcharts.setOptions({
    lang: {
        decimalPoint: '.',
        thousandsSep: ',', 
    }
});" into the page when using charts. Is there a way to set it to the reverse (i.e. decimal = ",", thousands = ".")?
Not shure this will help but have you tried changing the site properties values? For DecimalSeparator and GroupSeparator?
Cipriano,

Thanks, I didn't know there were site-properties. However, I need to support multiple locales, so I need to change them on the fly.

Kilian, I have this question too.

I know it's an old post but do you have the answer?

If not, I will open a new post on the forum.

Hello Miguel,


If you want to change the decimal separator and the thousands separator only on the charts you can use javascript to do that:

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

Here is a module with an example where you can hover it, and check it out.

This will change the separators to all charts in the page.


Hope it helps,

Miguel Amado

Miguel Amado wrote:

Hello Miguel,


If you want to change the decimal separator and the thousands separator only on the charts you can use javascript to do that:

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

Here is a module with an example where you can hover it, and check it out.

This will change the separators to all charts in the page.


Hope it helps,

Miguel Amado

Hi Miguel,


Your answer was just perfect!! The example is just what I needed.

I didn't know that there was a "Run JavaScript" action. I had that code but did not know where to use it.

Yesterday I found another answer for this problem. The datapoint variable has a tooltip attribute. In there, with 

the "FormatCurrency" action, you can assign something like this:

FormatCurrency(Datapoint.Tooltip,"",2,",",".") 

Although this option works, it only aplies to that series while your is for every chart on the page.


Thanks for the help,

Miguel Prego.


Miguel Amado wrote:

Hello Miguel,


If you want to change the decimal separator and the thousands separator only on the charts you can use javascript to do that:

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

Here is a module with an example where you can hover it, and check it out.

This will change the separators to all charts in the page.


Hope it helps,

Miguel Amado


I Miguel,

It is works perfectly. It's possible to put inside of HighchartsJSON?


Regards, Paulo Torres

Paulo Torres wrote:

Miguel Amado wrote:

Hello Miguel,


If you want to change the decimal separator and the thousands separator only on the charts you can use javascript to do that:

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

Here is a module with an example where you can hover it, and check it out.

This will change the separators to all charts in the page.


Hope it helps,

Miguel Amado


I Miguel,

It is works perfectly. It's possible to put inside of HighchartsJSON?


Regards, Paulo Torres

Hello Paulo,


Yes it is. You can use the Highcarts formatter attribute to determine how your tooltip is going to look.

Then you have the Highcharts numberFormat provided function to format the result. Using the AdvancedFormat_Init action in Outsystems you can determine the Highcart Json like so:

SyntaxEditor Code Snippet

 tooltip: {
        formatter: function () {
            return '' + this.x  + ' = ' + Highcharts.numberFormat(this.y, 2, ',', '.');
        }
    },


Attached is the same module with a new menu tab with this implementation.


Hope it helps,

Miguel Amado

Miguel Amado wrote:

Paulo Torres wrote:

Miguel Amado wrote:

Hello Miguel,


If you want to change the decimal separator and the thousands separator only on the charts you can use javascript to do that:

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

Here is a module with an example where you can hover it, and check it out.

This will change the separators to all charts in the page.


Hope it helps,

Miguel Amado


I Miguel,

It is works perfectly. It's possible to put inside of HighchartsJSON?


Regards, Paulo Torres

Hello Paulo,


Yes it is. You can use the Highcarts formatter attribute to determine how your tooltip is going to look.

Then you have the Highcharts numberFormat provided function to format the result. Using the AdvancedFormat_Init action in Outsystems you can determine the Highcart Json like so:

SyntaxEditor Code Snippet

 tooltip: {
        formatter: function () {
            return '' + this.x  + ' = ' + Highcharts.numberFormat(this.y, 2, ',', '.');
        }
    },


Attached is the same module with a new menu tab with this implementation.


Hope it helps,

Miguel Amado

Hi Miguel,

Thanks for your quick answer with example :)

I have a difficult in to customize tooltip: https://www.outsystems.com/forums/discussion/34598/highcharts-tooltip-not-works/

Can you help me?


Regards, Paulo Torres