506
Views
4
Comments
YAxis Format - Outsystems Charts
Discussion
I have a ColumnChart from the "Charts" espace and on the Y Axis the values are appearing with a "k" if the value as at least 4 digits. For example, 1000 becomes 1k, 2000 becomes 2k, 40000 becomes 40k. How can I remove the "k" and show just the value?

Thanks
2023-12-12 08-53-15
Cristiano Marques
 
MVP
Hello Bruno,

There are two ways of doing it, but first let me know something, are you building your own JSON or using data points?

Either way I'll leave you the two ways I know for removing the "k" from highcharts.

Highcharts.setOptions({
    lang: {
        numericSymbols: null //otherwise by default ['k', 'M', 'G', 'T', 'P', 'E']
    }
});

Other would be changing the Y axis formatter:

yAxis: {
    labels: {
        formatter: function () {
            return this.value;
        }
    }

Best regards,

UserImage.jpg
Bruno Nabiça
Im using Data Points. Where should I put that?

Thanks
2023-12-12 08-53-15
Cristiano Marques
 
MVP
Using the AdvancedFormat Property of the Highchart you can use something like:

AdvancedFormat_Init(YAxisJSON:JSON) 
Where the JSON would be a variable text with the yAxis format I had above. That should work : )

Don't have time to test it atm, but I'll try to test it later today. (I usually build highcharts out of my own JSON)
2023-10-06 09-22-20
Tiago Bernardo
Champion
Quick information, after some tests:
In the action AdvancedFormat_Init(), for the parametes "HighchartsJSON" and "YAxisJSON" don't include "Highcharts.setOptions({" and "yAxis: {", respectively, neither the corresponding terminating brackets and other characters.
So it should be:
1) For HighchartsJSON:
    lang: {
        numericSymbols: null //otherwise by default ['k', 'M', 'G', 'T', 'P', 'E']
    }
 
2) For YAxisJSON:
    labels: {
        formatter: function () {
            return this.value;
        }
    }
Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.