227
Views
6
Comments
Solved
Highcharts is Not Defined
Application Type
Reactive

Hi All i am adding Highcharts directly to one of screen in reactive web app where i got that error "Highcharts are not defined" i want to add script directly without charts in OS.


This is the script that i want to add on screen for rendering Highcharts. Here i am created a event OnInitiaize in that event am add javascript with the script.


Here i am ading javascript onReady Event


Here Is My CSS For Highcharts in OnReady Event.

Here my javascript and css appear in head section.

 

2021-03-18 21-03-15
Benjith Sam
 
MVP
Solution

Hi Apoorv,

I didn't try the mentioned implementation. But based on the error, it clearly states that the Highcharts global object is not yet available during the OnReady JS initialization script got executed (it might be caused bcz of the delay in loading the referenced external JS library). So instead, I would suggest you use the RequireScript client action from Systems Module in the OnInitialize client action of the screen to load the required external JS.

See this demo screen: PieChartDemo

Refer to the attached .oml file


I hope this helps you!


Kind regards,

Benjith Sam

RWALabPieChart.oml
2022-09-12 05-19-11
Apoorv Choubey

Thankyou Benjith Sam It Works ;)

2021-03-18 21-03-15
Benjith Sam
 
MVP

You're welcome, Apoorv,

Glad to help you :)


Kind regards,

Benjith Sam

UserImage.jpg
Severiano Melo

Hi @Benjith Sam,

your solution works and it's exactly the way I've used to solve similar scenarios where we need to add external JS libraries.

The problem is when we have the RequiredScript client action being called the OnInitialize event of a screen, Service Studio displays a warning message like this 

"Performance Warning: 'OnInitialize' contains accesses to the local storage or server, which delays the screen's render. To avoid performance issues, use Aggregates or Data Actions instead.".

I'm wondering if anyone else have the same issue and how can we solve it?

Regards

Thanks

2021-06-02 20-50-04
Márcio Carvalho

I think the best thing is to create a question and reference this question mate. There is no need to wake up a thread from August.

But I think you need to do that on OnReady or OnRender events. I am not sure.

Regards,

Márcio

UserImage.jpg
Severiano Melo

Hi @Marcio, agreed I should have opened a new post and I'll.


Thanks anyway


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