Home Forums Chart Support Using CanvasJS with Angular 2 Reply To: Using CanvasJS with Angular 2



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.

Column chart in AngularJS 2

Priyanka M S
Team CanvasJS