I am unable to provide a condition in formatter to display datalabels on stacked grouped column chart only if the datapoint value is greater than zero. I tried to use the formatter function as below. However, the formatter function was not working in any of the JS code that I've used. Even a console.log inside the formatter was not returning an output. Can anyone please suggest me the right way to use formatter function in Outsystems Charts v 3.2.0?
JS Code:
const chartLabels = {
'plotOptions': {
'column': {
'dataLabels': {
'enabled': true,
'formatter': function () {
var point = this.point; var xValue = point.x; var yValue = point.y;
if(yValue != 0) {
return yValue; }
}
},
};
OutSystems.ChartAPI.Chart.SetProviderConfigs($parameters.ChartWidgetId, JSON.stringify(chartLabels));
Hello @Aarathi S
First of all, thank you for reaching out.This is a scenario that was broken with some re-architecture work done (mostly for security reasons), so sorry about the inconvenience. We'll try to review this for the next release.
As a workaround, you can do the following instead:
Replace:
by
OutSystems.ChartAPI.Chart.GetById($parameters.ChartWidgetId).provider.update(chartTooltip, true, true);
Hope it helps to unblock you.
Cheers,GM
This works!!! Thank you so much.