How to get rid of highcharts 13 error in angular?

Hi i am working on Angular and i want this feature like switching between sections when clicked between the tabs and displaying charts.

I am getting #13 error and chart is not being displayed here in second tab how to do it when switching between tabs.

Here is the code so far tried:
Stackblitz

Any solution will be helpful.

5 thoughts on “How to get rid of highcharts 13 error in angular?”

  1. It doesn’t work because you’re removing/readding the rendering container for each If. Move the container outside the conditional rendered diff (*ngIf):

    <div> <!-- rendering root -->
      <div>
        <button type="button" (click)="ShowDiv('A');ok()">Show A</button>
        <button type="button" (click)="ShowDiv('B');ok()">Show B</button>
        <button type="button" (click)="ShowDiv('C');ok()">Show C</button>
      </div>
      <div id="container">
        <div *ngIf="currDiv == 'A'"></div>
        <div *ngIf="currDiv == 'B'"></div>
        <div *ngIf="currDiv == 'C'"></div>
      </div>
    </div>
    

    https://stackblitz.com/edit/angular-showdivonclicktoggle-z2mqb2?file=src/app/app.component.html

    Reply

Leave a Comment