Home forums Using CanvasJS Update chart from user input

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

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

    sherrylking
    Member

    I want a stacked bar chart that shows preset values that the user can update.

    I have it set up where the first data value updates, but I can’t get the other two and the total to update.

    //get input values
    function graphMe(){
    var static = document.getElementById("inputa").value;
    myChart.data.datasets[0].data[0] = static;
      
      document.getElementById("inputb").value;
    myChart.data.datasets[0].data[1] = static;
      
      document.getElementById("inputc").value;
    myChart.data.datasets[0].data[2] = static;
      
      
    myChart.update();
      }

    If codepen below not working, please use link: codepen.io/sherrylking/pen/EXNbPW

    #15373

    Bivek Singh
    Moderator

    @sherrylking,

    You might have posted it here by mistake. However, you can achieve same using canvasJS. Please take a look at this jsFiddle.

    —-
    Bivek Singh,
    Team CanvasJS

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

You must be logged in to reply to this topic.