Home forums Using CanvasJS Canvajs in Angular: ERROR ReferenceError: setButtonState is not defined

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22386

    ago

    I pretty new in CanavasJS. I try use the example of the home page: https://canvasjs.com/angular-charts/ in Angular created with ng. But I get always this error at calling chart.render():

    AppComponent.html:2 ERROR ReferenceError: setButtonState is not defined
    at n._updateOptions (canvasjs.min.js:5)
    at n._initialize (canvasjs.min.js:5)
    at n.render (canvasjs.min.js:5)
    at n.render (canvasjs.min.js:8)
    at MyGraphComponent.push../src/app/my-graph/my-graph.component.ts.MyGraphComponent.ngOnInit (my-graph.component.ts:35)
    at checkAndUpdateDirectiveInline (core.js:9035)
    at checkAndUpdateNodeInline (core.js:10299)
    at checkAndUpdateNode (core.js:10261)
    at debugCheckAndUpdateNode (core.js:10894)

    #22392

    @ago,

    Can you kindly create and share an jsfiddle representing the issue you are facing or share a sample project over google-drive or onedrive, so that we can look into your code, understand it better and help you out?

    __
    Priyanka M S
    Team CanvasJS

    #27634

    I found out that this error occurs when you do an NPM install of canvas js and try to reference it from the “node_modules” folder. Download canvasjs.min.js to your assets folder and reference it from there. This will resolve the issue. Took me a while to figure this one out.

    Jason

    #27643

    Jason,

    Glad that you have figured it out :)

    —-
    Manoj Mohan
    Team CanvasJS

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

You must be logged in to reply to this topic.