52
Views
5
Comments
Solved
Highcharts stockChart function not applicable in Outsystems?

I am trying to build a dashboard that includes a few datetime line graphs in which the user should be able to choose the datagrouping (day/week/month/quarter etc.)

https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/plotoptions/series-datagrouping-approximation

After a number of attempts, I understood that the regular "Charts/ColumnChart" cannot display this graph, even when overridden with the HighchartsJSON (image 1).

After that, I tried solving the issue using a JavaScript with hard-coded data - which worked perfectly (image 2)

The issue started when i tried to insert the data from outside the Java using input parameters. I do not understand how to insert the array into the JavaScript properly. The other input parameters you see in the image are inserted properly, and when I look at the page's "Inspect", I can see the array of data is passed through successfully.

Is there a glaring issue I am missing? or something I am not understanding about how the JavaScript works in Outsystems?

2022-08-03 04-32-50
Ravi Punjwani
Solution

Hi @Noam Shimoni 

You can try out this shiny brand new forge component for stock highcharts.

https://www.outsystems.com/forge/component-overview/14109/stock-highcharts


2021-09-06 15-09-53
Dorine Boudry
 
MVP

Hi @Noam Shimoni ,

can you share an oml with the working chart with hardcoded values, and the data already retrieved (aggregate ? api ?) that you would like to use the chart for.

It is always a bit of a trial and error hassle with conversion to json, and appends and string manipulations, it's easier to help if you provide the actual example.

Dorine

2022-08-03 04-32-50
Ravi Punjwani

In your highcharts javascript, use the variable reference myChartData, and define the same data in your screen in a variable myChartData. Same data which worked correctly, not the one coming dynamically from your database. See if that works or not.

In most cases, javascript execution variable is assigning a variable which is initialized after actually using that variable. Meaning you might be calling and using highcharts function before getting the data in place. So it might be a matter of sequence of execution of your javascript.

It would be easier to fix if you can share your OML file.

2022-08-03 04-32-50
Ravi Punjwani

Hi @Noam Shimoni 

Were you able to resolve your query successfully?

2022-08-03 04-32-50
Ravi Punjwani
Solution

Hi @Noam Shimoni 

You can try out this shiny brand new forge component for stock highcharts.

https://www.outsystems.com/forge/component-overview/14109/stock-highcharts


UserImage.jpg
Noam Shimoni

Thanks all for your responses!

We ended up getting help from Paulo who created this nifty solution for us:

https://www.outsystems.com/forge/component-overview/14109/stock-highcharts 

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