jeudi 4 mars 2021

Checkbox to hide columns in Google Charts

I have a chart I am working on HERE that I am trying to use checkboxes to selectively show data columns. I've used this code:

$('#series').find(':checkbox').change(function () {
    var cols = [0];
    $('#series').find(':checkbox:checked').each(function () {
        console.log(this);
        cols.push(parseInt($(this).attr('value')));
    });
    view.setColumns(cols);
    dashboard.draw(view, {strictFirstColumnType: true})

});

But its not working in the previously linked fiddle and I can't figure out what I'm doing wrong. I'm sure its probably something silly I've missed. Any help would be greatly appreciated!




Aucun commentaire:

Enregistrer un commentaire