You must be logged in to post your query.
Home › Forums › Chart Support › CanvasJS is not defined
Tagged: configuration, installing, running
I am using CanvasJS in my angular 2 app but i am having some trouble loading my page with charts.
I have added to my index.html page: <script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
<script src="https://cdn.canvasjs.com/canvasjs.min.js"></script>
in my component.ts file i have added:
declare var CanvasJS: any; var chart = new CanvasJS.Chart("chartContainer", {.....});
declare var CanvasJS: any;
var chart = new CanvasJS.Chart("chartContainer", {.....});
but when i run this i get several errors in my console: Error: Error in :0:0 caused by: CanvasJS is not defined
Error: Error in :0:0 caused by: CanvasJS is not defined
@pearls
Creating the chart within ngOnInit() should render the chart in Angular 2. Please take a look at this sample project for integrating CanvasJS Chart with Angular 2.
— Sanjoy Debnath Team CanvasJS
You must be logged in to reply to this topic. Login/Register