Home forums Using CanvasJS CanvasJS is not defined

This topic contains 1 reply, has 2 voices, and was last updated by  Sanjoy 1 week, 2 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15525

    pearls
    Member

    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="http://canvasjs.com/assets/script/canvasjs.min.js"></script>

    in my component.ts file i have added:

    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

    #15571

    Sanjoy
    Moderator

    @pearls

    Please take a look at this sample project for Angular2.


    Sanjoy Debnath
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.