Home forums Using CanvasJS Create a chart everytime press the button

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by  Shashi Ranjan 4 months, 3 weeks ago.

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

    Hi everyone!
    I have a input field for JSON link and a button to create chart. Everytime I press the button, it will create a chart. When I change the JSON link and press the button again, it delete my old chart and create a new chart but I want it to create one more chart on the same page. How can I do that? Can you help me. Thank you very much!

    #24086

    @murcie96,

    You can achieve the above requirement by creating a new div dynamically every time you pass a new JSON API link and render the chart using the provided JSON data source as shown in this JSFiddle.

    Please use the following JSON data sources with the above example:
    https://api.myjson.com/bins/espz0
    https://api.myjson.com/bins/vguws
    https://api.myjson.com/bins/166nss

    ____
    Shashi Ranjan
    Team CanvasJS

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

You must be logged in to reply to this topic.