score:8

Accepted answer

you can just use the method adddata(), example:

bar.adddata([40, 60], "google");

working example - http://jsbin.com/kalilayohu/1/

score:4

this is the code

var canvas = document.getelementbyid('mychart');
var mybarchart = chart.bar(canvas,{
data:{
labels: ["january", "february", "march", "april", "may", "june", "july"],
datasets: [
    {
        label: "my first dataset", 
        data: [65, 59, 80, 81, 56, 55, 40],
        backgroundcolor: [
            'rgba(255, 99, 132, 0.2)',
            'rgba(54, 162, 235, 0.2)',
            'rgba(255, 206, 86, 0.2)',
            'rgba(75, 192, 192, 0.2)',
            'rgba(153, 102, 255, 0.2)',
            'rgba(255, 159, 64, 0.2)'
        ],
        bordercolor: [
            'rgba(255,99,132,1)',
            'rgba(54, 162, 235, 1)',
            'rgba(255, 206, 86, 1)',
            'rgba(75, 192, 192, 1)',
            'rgba(153, 102, 255, 1)',
            'rgba(255, 159, 64, 1)'
        ],


           borderwidth: 1
        }
    ]
},
    options:{
    scales: {
    yaxes:[{
        stacked:true,
        gridlines: {
        display:true,
        color:"rgba(255,99,132,0.2)"
        }
    }],
    xaxes:[{
            gridlines: {
            display:false
         }
       }]
    }
  }
 });

you can update doing this:

mybarchart.data.datasets[0].data[4] = 50;//this update the value of may
mybarchart.update();

Related Query

More Query from same tag