Home Forums Chart Support store charts in external js file

store charts in external js file

Viewing 2 posts - 1 through 2 (of 2 total)
  • #11659

    Is it possible to put all the charts
    var chart = new CanvasJS.Chart(“Chart1”, {…})
    var chart = new CanvasJS.Chart(“Chart2”, {…})
    in en external js file and then use it in multiple pages? I didn’t get it to work though :/

    #11665

    You can store the complete chart as a function in external JS file. Load that JS file and call the function in multiple HTML pages where you like to show chart. Check this example.

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

You must be logged in to reply to this topic.