score:0

it's because ngafterviewinit is called after change detection is completed and the view has already been build. when you click on same label you execute new change detection cycle.

you can try to add this line of code after new chart(), where cd is changedetectorref injected in constructor.

settimeout(() => {

        this.cd.markforcheck();

    });

which will mark this component as a dirty for change detection.


Related Query

More Query from same tag