79
Views
6
Comments
Solved
How to set decimal separator [Highcharts /AdvcancedFormat]


I really dont know how to proceed with that. It shows correctly on Tooltip, but i dunno how I can do the same on Advanced Format. JS Functions appears to doesnt work on OS, since I have tried the same on JS Fiddle and it works there (as picture above).




2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Turta,

I'm not able to reproduce the issue which you are facing. Make sure that the Chart's ShowDataPointValue property is set to True value as highlighted below.

and also note that I'm using OutSystemsCharts Version 2.2.0


If this doesn't help, can you share a sample oml with your implementation?


Kind regards,

Benjith Sam

2022-07-29 12-19-23
Yogesh S

Hi @Turta Beltrotta
Can you try using this , I think it might work 

formatter: function () {  

    return [].concat(this.points ? this.points.map(function (point) {                       

    return point.series.name + ': ' + Highcharts.numberFormat(point.y,1,',',',');  

 }) : []   );   }


Thanks me Later !!!
Yogesh S

2022-01-16 01-44-45
Turta Beltrotta

Hello Yogesh! Thanks for the message! 

Unfortunately it's still not working. Now it complain about 'Unexpected String'. Here's the entire code as you sent me:

AdvancedFormat_Init(DataPointFormats: , DataSeriesFormats: , XAxisJSON: , YAxisJSON: , HighchartsJSON: "


    plotOptions: {

        series: {

            dataLabels: {

                enabled: true, // enable DataLabels

                format: ' {point.name}:' + '{y}',

            }

            formatter: function() {

                return [].concat(this.points ? this.points.map(function(point) {

                    return point.series.name + ': ' + Highcharts.numberFormat(point.y, 1, ',', ',');

                }) : []);

            }

        },

    }

    "

)


How to proceed? 

2021-03-18 21-03-15
Benjith Sam
 
MVP

Hi Turta,

For your use case, try the below AdvancedFormat:

AdvancedFormat_Init(DataPointFormats: , DataSeriesFormats: , XAxisJSON: , YAxisJSON: , HighchartsJSON: "
    tooltip: { 
        formatter: undefined,
        pointFormat:'{point.y:.2f}%'
    },

    plotOptions: {
       
        series: {
            dataLabels: {
                enabled: true,
                formatter: function () {
                    return this.key + ':' + parseFloat(this.y.toFixed(2)).toLocaleString() + '%';
                }
            },
        },
    },
    "
)

See this demo: DonutChartTask

Refer to the attached oml

I hope this helps you!


Kind regards,

Benjith Sam

NeoLab_DonutChartTask.oml
2022-01-16 01-44-45
Turta Beltrotta

Hello, Benjith! Thanks for your help. Indeed your code works, but mine isn't acting the same. 

With your code my graphic doesn't display the values, look below: 

But that's because it hasn't the 'format' property, which I wrote again:

How could I call that formatter function inside / to return at the format property? 

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Turta,

I'm not able to reproduce the issue which you are facing. Make sure that the Chart's ShowDataPointValue property is set to True value as highlighted below.

and also note that I'm using OutSystemsCharts Version 2.2.0


If this doesn't help, can you share a sample oml with your implementation?


Kind regards,

Benjith Sam

2022-07-24 08-50-37
Gokula Kannan P

Hi @Turta Beltrotta 

I hope the following steps will help you resolve the issue. Look at the images and replace the code with your JS functions. could you provide OML so can understand the issue exactly.



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.