score:1

Accepted answer

Use the unload() method to get rid of data by it's ID.

var data1=[['data1', 35, 205, 150, 100, 100, 200], ['data2', 130, 120, 130, 190, 100, 40]];

var chart = c3.generate({
    data: {
        columns: [
            ['data1', 30, 200, 100, 400, 150, 250],
            ['data2', 130, 100, 140, 200, 150, 50]
        ],
        type: 'bar',
        labels:true
    },
    type: 'bar',

    bar: {
        width: {
            ratio: 0.5 // this makes bar width 50% of length between ticks
        }
    },
    axis: {
     rotated: true
    }
});


setTimeout(function () {
    chart.unload({
        ids: ['data2']
    });
}, 1000);

Updated fiddle


Related Query