67
Views
2
Comments
Solved
[OutSystems Charts]  Assign global colors in charts
outsystems-charts
Reactive icon
Forge asset by OutSystems
Application Type
Mobile, Reactive

Hello everyone! 

I was implementing an old version of outsystems charts (1.3.7), then upgraded to the latest (2.2.0), but I can no longer assign colors globally in two of the four charts. Could you help me understand how to do it for the other cases? 

I attach an OML where the same implementation is done, but as I mentioned it doesn't work on all chart types.


Saludos! 

Jorge Orellana



ChartDemo.oml
2021-11-19 14-11-59
William Sandoval
Solution

Hi Jorge,


In the latest changes of Outsystems Charts you have to put in the colors by series and not by the HighChartsJSON, you must add the colors to your logic structure.


Regards,

William

2019-12-16 14-44-15
Rúben Santos

Hi Jorge,

Good question, I did some testing on this and was unable to understand exactly why this is happing, it seems to be overriding the global colours with the ones set on the DataPoint.Color and since nothing is specified the Highcharts sets it for you or it's something I'm not seeing.

What I would suggest is to ignore the SourceDataPointList and use the AdvanceFormat.HighchartsJSON for everything. For this just create a empty local var of the data type DataPoint List, set it on the SourceDataPointList, then for the column chart example set the AdvanceFormat.HighchartsJSON string as:

"colors: ['#42E8B4', '#2FCBF1', '#FD6C98'], series: [{name: 'Series 1', data: [1, 2]}]"

Note, this will force you to build at least the series string before delivering it to the extension.

Saludos,

Rúben

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