Column Chart - Format datapoint
Question

I'm looking to format the datapoint value in my column chart.

I would like to insert a $ symbol in front of the value but it says that it expects it to be a decimal.

Here's the snippet I was trying to use:

SyntaxEditor Code Snippet

AdvancedFormat_Init(DataPointFormats:,DataSeriesFormats:,XAxisJSON:,YAxisJSON:,HighchartsJSON:"{
        dataLabels: {
            format: '${DataPointList.Current.Value}'
        }
}"
)

Here is a snapshot of the graph:


The values at the top of each column is where I would like to format as either currency or prefix with a $ symbol.

Thanks in advance for any suggestions or guidance!

Jay/Andrew,
Thank you both for the very quick reply and extremely helpful info!

Using your advice I was able to get the $ symbol to appear on the data values.

I tried putting an AdvancedFormat_Init action in the prep but it wouldn't come through.

Instead, I placed the code snippet above into the HighChartsJson section of the chart in Outsytems:


Thank you again for all of your help! JS and JSON are all new to me so I'm still learning a lot but this has opened up a whole new world.

- Jeff W.

I'm going to pass this along to one of my colleagues who's been diving into the Chart control lately. One of us will get back to you ASAP.

2018-11-05 02-29-37
Jay Santos

Thanks for the heads-up Andrew!

Hello Jeff,


Formatting Highcharts inside OutSystems is slightly different, I encourage you to check the videos I did about it - https://www.youtube.com/watch?v=uzNnX7oqhNY&list=PLxALhSwsaivzPV_Am5gDUdRFHXBEXeO3n&index=19

Basically what you need to do is, on your page's Preparation (or OnInitialize on mobile), call the Action AdvancedFormat_Init, inside this action there a parameter called HighchartsJSON where you set the formatting.

However you don't need to use the full highcharts syntax, you'd do something like:

SyntaxEditor Code Snippet

"
plotOptions: 
{
    series: 
    {
        dataLabels: //Insert your datalabel formatting here
    }
    
}"


Jay/Andrew,
Thank you both for the very quick reply and extremely helpful info!

Using your advice I was able to get the $ symbol to appear on the data values.

I tried putting an AdvancedFormat_Init action in the prep but it wouldn't come through.

Instead, I placed the code snippet above into the HighChartsJson section of the chart in Outsytems:


Thank you again for all of your help! JS and JSON are all new to me so I'm still learning a lot but this has opened up a whole new world.

- Jeff W.

Hi Jeff,

How do you put the separator in the amount? I tried to use format currency but it doesn't allow me to put it. Thank you


Regards,

Hentry

Why this not work in my project:(

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