Currently, I am facing an issue with updating my Highcharts chart dynamically based on an observable configuration in an Angular component. I have implemented an observable with ngIf as shown below:
<highcharts-chart
*ngIf="conf | async as options"
[Highcharts]="Highcharts"
[options]="options"
>
</highcharts-chart>
The problem arises when switching between a column chart and a stacked column chart using the conf observable. The stacked values do not display correctly, and unexpected slices appear when transitioning from a stacked column chart to a pie chart.
To provide more context and visualize the issue, I have created StackBlitz demos showcasing the chart configurations that update every 5 seconds:
- Column to stacked column: https://stackblitz.com/edit/angular14-standaone-components-highcharts-8dpdrx?file=src/app/app.component.ts
- Stacked column to pie: https://stackblitz.com/edit/angular14-standaone-components-highcharts-agjsit?file=src/app/app.component.ts
In initial demos, the configurations work correctly, which can be observed in these JSFiddles:
- Pie chart: https://jsfiddle.net/jzs7ubkh/11/
- Stacked column chart: https://jsfiddle.net/6Lf5hsm4/
- Column chart: https://jsfiddle.net/jzs7ubkh/12/
I would appreciate any insights or assistance in resolving why the dynamic updates are not functioning correctly.