With the new version of Outsystems Charts we've noticed that the HighchartsJSON input was removed, and replaced with for example the SetHighcartsChartConfigs client action, which doesn't exactly work for all cases, and doesn't have enough documentation online on how to use (if it wasn't for a few forum posts, I wouldn't even know that you could use this to pass the JSON's attribute's names on the PropertyPathList).
In my last case scenario, I was trying to use the following HighchartsJSON to add the total value of Y on top of each bar (in BarChart), which should be something quite common and simple to do. The last JSON I tried in order to do this was the following:
"plotOptions: { series: { dataLabels: { enabled:true, format:'{y}' } }}"
But the following doesn't work in SetHighchartsChartConfigs (and other various combinations as well):
I suggest the HighchartsJSON input be reinstated, so that everyone can keep using the JSONs they find online for the HighchartsAPI, since there's little to no documentation about SetHighcartsChartConfigs.
This could be done for example in a new Addon for the Graph for example, which all it does is receive a JSON input.
Thank You
Hello @Miguel Tavares
As mentioned in the announcement posted when the new version of Charts was launched, all the JSONFormat parameters were removed from the new version for security reasons, to improve the low code experience (allowing adding functionalities based on feedback from customers) and also because today we use HighCharts and the previous versions was to tight to a provider which is not a good practice. However, the new version offers two alternatives to those parameters where you can still manipulate the JSON in a more secure way by using our Extensibility client actions you mentioned (and well :) ).You can also continue to use the previous version but we don't advise that.
For your particular case, you're in a similar scenario as described in this past post since you're using the API provided by OutSystems Charts through the client action SetHighchartsChartConfigs but as mentioned in the client action's description, this API doesn't support callback functions for security reasons (you're defining {y} in your scenario which will be caught on this).
However, through extensibility and by exploring the HighChart APIs we can still make it work by calling the update method as you did on your functions but applying it to the Chart instance, being something like:
OutSystems.ChartAPI.Chart.GetById($parameters.ChartWidgetId).provider.update(chartEvent, true, true); //where $parameters.ChartWidgetId is the Chart block identifier
About the available documentation, there are some useful resources you could use:
And just to be clear, we will not reinstate HighchartsJSON since this was already a huge mistake in the past and the paradigm shifted.
Hope it helps!
Cheers,GM
Hi, thanks for the reply, and the documentation shown, that helps.
Apologies, I wasn't aware about any security issues on HighchartsJSON as the linked announcement didn't say anything about that. If that's the main reason for this update, then that's understandable...
For the second point, I would argue that what was done doesn't exactly improve the "low code experience", since now we have to write Javascript code, for things that we could have easily done in 2 seconds with JSONs that are everywhere in the internet. Maybe some Graph Addons could be built to perform the Javascript you mentioned?
I could also add that if security is the main issue, I would then suggest instead of keep incrementing on a third party provider like HighCharts, we could start to invest on proper built-in outsystems charts, like e.g. Mendix does (even if it has less extensibility). That would be awesome and maybe truly low-code.
Either way, this was just my opinion/suggestion as the announcement referred that you were opened to suggestions. Although I understand if it's not the direction you're going for.
I wish you and Outsystems all the best. Thanks for the awesome work you do.
Kind Regards,Miguel