Chartjs-JQuery – destroy and rebuild chart with original options

0πŸ‘

It’s so simple
you should define a variable for your default options
and in a function you can set all default options to chart:

defaultOptions = {} // your default options here

function resetOptions(chart) {
    chart.options = defaultOptions;
    chart.update();
}

Leave a comment