@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