I have a following bar chart which is disabled onInit
<div style="display: block" *ngIf="showBar">
<canvas baseChart height="75"
[data]="barChartData"
[labels]="barChartLabels"
[chartType]="'bar'"
(chartHover)="chartHovered($event)"
(chartClick)="chartClicked($event)"></canvas>
</div>
bar-graph.component.ts file:
export class BarGraphComponent implements OnInit {
showBar: boolean;
ngOnInit() {
this.showBar = false;
}
I want to enable this chart in the app.components.ts file using a switch statement (changing depending on what's passed from a previous chart). However in the app component.ts file, if I do this.showBar = true (using emitters) it still doesn't work. Any guidance will be appreciated.