Home Forums Chart Support Update chart from user input

Update chart from user input

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

    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

    https://codepen.io/sherrylking/pen/EXNbPW

    #15373

    @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.