Robin Gruschke
Posts: 1
Joined: Tue Feb 16, 2021 12:59 pm

TreeGrid Crashes - when data changes

Hello,

I am using Highcharts Gantt + Highcharts Angular. The initial draw works just fine - but once i change the chartOptions i get various issues (depending on the data that I pass in).

i made a small stackblitz too showcase the issue:
https://stackblitz.com/edit/highcharts- ... mponent.ts

Is there any way to avoid this issue?
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: TreeGrid Crashes - when data changes

Hi,
Welcome to our forum and thanks for contacting us with your question!

I tried to use this solution to update: https://stackblitz.com/edit/highcharts- ... -to-update
When I change chart options they reload and the chart is redrawn but doesn't look good.

With drop-down lists this behavior is typical, it would be easiest to delete the whole series and add a new one.
You could write callback and create references to chart and using this referencing with chart methods Chart#destroy and Chart#addSeries.

Live demo:
https://stackblitz.com/edit/highcharts- ... mponent.ts

API References:
https://github.com/highcharts/highchart ... setoptions
https://api.highcharts.com/class-refere ... rt#destroy
https://api.highcharts.com/class-refere ... #addSeries

Let me know how are you going with this.
Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Gantt”