Home forums Using CanvasJS Using CanvasJS with Angular 2 Reply To: Using CanvasJS with Angular 2

#21248

Priyanka M S
Member

@brianali,

Creating the chart within ngOnInit() should work fine. Also, if your div-id is chartContainer, the same ID has to be passed as container-id to CanvasJS as const chart = new CanvasJS.Chart("chartContainer", {.
Please take a look at this sample project on using CanvasJS charts with AngularJS-2.

__
Priyanka M S
Team CanvasJS