eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Events--> load method not called on adding a point in gantt highcharts

hi

On gantt highchart i am adding points by using a modal, to every added point i am giving same colors to all the points that satisfy a given condition. This works fine when we use GET API call but when i add point using modal then newly added point does not the color even if criteria is satisfied.

On debugging i found that events--> load method under chartoptions is not called on POST call...please suggest?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Events--> load method not called on adding a point in gantt highcharts

Hi eraka.
It seems to me, that your problem is not related to the Highcharts library and since it's strictly a Highcharts support forum, we don't help with other problems not related to our product's functionality. Can you please recreate the demo that I could work with? Then I will have a chance to tell you if this problem is related to Highcharts and help to resolve your issue.

chart.events.load is an event which fires when the chart is finished loading. You can read more about it here: https://api.highcharts.com/highcharts/chart.events.load
And also here is a nice article written by my colleague about events in Highcharts: https://www.highcharts.com/blog/tutoria ... ts-events/

Regards!
Hubert Kozik
Highcharts Developer
eraka
Posts: 123
Joined: Thu Apr 28, 2022 6:55 am

Re: Events--> load method not called on adding a point in gantt highcharts

i have read official docs under events, i am able to launch render method and also redraw explicitly but they are running under infinite loop.

for me adding chartRef.redraw() is not working directly so i added redraw:() {} and render: (){} in events . The issue is that when a point is added it is not calling load() which is obious since page is not loaded. but chartRef.redraw() also not working.

Please note i am directly calling chartRef.redraw() without defining it under events ....please suggest how i can leverage render and redraw?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Events--> load method not called on adding a point in gantt highcharts

eraka,

If you fire chart.redraw() function inside render events it will cause the infinite loop, because redraw is calling the render-event, not load-event, which is fired only when chart has finished loading.

As I said, I am not sure what you want to achieve so it is hard for me to help you without taking a look at your code. Maybe, you should create another function and fire it before chart.redraw()? I really don't know, it's just my thoughts. It would be good, if you recreate the issue in the online editor and send me a link to the demo that I could work on, without this it is hard to help you.

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Gantt”