Charts Widget doesn't work to several graphic types

Dears,

Oriented by OS Support, I'am changing several graphs of my application that was using the HighChartsInclude forge component, to the native OS Charts. Simply changing the component and moving the script. But several graphics don't work well (running on highcarts site JSFiddle they work correctly). Is there someone with this problem? Can this be a OS widget bug?

My plataform is Version 10.0.1021.0 and Service Studio 10.0.1013.0

Best regards,

Roberto

Hi Roberto,

If you were previously creating your charts in Javascript without invoking any actions, this might be causing issues. Some charts are setup out-of-the-box and just need to have their actions invoked, but others need to be configured with the AdvancedFormat inputs.

Are you seeing any errors in your browser console? Can you share some examples of the charts that aren't working right now?

Hi Afonso,

Thanks by your attention. Attached there is an application example that shows my problem. There is 2 menu options. The first menu submit the json script showed in the screen  to a OS native charts using the AdvancedFormat_Ini function. The second menu submited the same json script using the HIghChartsInclude forge component.

You'll see that in the first menu, even with the 'showInLegend: true', the graphic's legend don't appears. And in the second menu using forge components, the legend appears correctly.

Best regards,

Roberto

Solution

Hi Roberto,

I'm still not exactly sure on what causes this, but it's related to the way the data is loaded onto the Chart Widget. I noticed you're using an empty DataList as an input and then feeding the data in the AdvancedFormat input. I tried initializing the List with a placeholder and the legend appeared.

You should try feeding the data using the OutSystems input instead of relying on the AdvancedFormat JSON. I'm guessing what's happening in the background is that both you and the Widget are trying to initialize the component with sets of data using different configurations - I even removed the showLegend property from the AdvancedFormat and it still appears, pointing that the OutSystems input already adds this by default.

I also removed the JS files being appended in the OutSystems version page - OutSystems loads its own custom version of Highcharts, loading another one on top of that can cause issues.

Solution

Hi Afonso,

Great! Really, writing a point in the DataPoint list, even a 'ghost' point, the legend appears. But I would like to register may opinion about this matter, because I noticed others differents behaviors in some graphics when submitted using the OS native charts. My main workplace to test and taste the JSON graphic is the JSFiddle of Highcharts site. There I can take the graphic demos, transform, observe, adjust, and bring to my OS application. The script tested in JSFiddle, runs exactly equal in the Highcharts forge component. But the same doesn't happens when submitted by OS native charts.Then, the effort raise, adjusts are needing, and the productivity to implement the application lower. I stopped my effort to change my highcharts components by OS native, and I am beginning the work to migrate to a OS V.11, because I am in the version 10. Then this effort to move this graph was transfered to a migration version effort.

Thank you very much by your attention,

Roberto

No problem Roberto.

I agree - it's not going to be straightforward because data and configurations that were set in JSON apparently have different behaviours if used in the AdvancedFormat vs the DataPoint List input.

I also want to leave a note: be wary of testing directly with JSFiddle, since the OutSystems version of the library is 6.1.4, if I'm not mistaken - the latest Highcharts is 8.0.0 and I do not know if OutSystems is backporting any fixes. I don't think this is the cause of the issues you found, but they can come up.

Thanks Afonso! I will be wary with the JSFiddle. But how I'm not a programmer, and I use the OS too for this reason, the old routine, using JSFiddle with HighchartInclude forge was very pragmatic for me. Well, I will find looking forward a substitute procediment for this. Or wait by an OS oficial tool, considering the importance of graphics to any type of application. Otherwise, you take great advantage in whole OS Plataform, but when you need of a more sophisticated graph, you must become again the old and tradicional programmer.

Best regards,

Roberto