chartjs-plugin-deferred icon indicating copy to clipboard operation
chartjs-plugin-deferred copied to clipboard

If ChartJS animation is disabled, this plugin crashes my web app

Open kalnode opened this issue 11 months ago • 0 comments

My web app (Nuxt) crashes when using this plugin (v2.0.0) and disabling ChartJS (v4.4.7) animations.

FAILS (A) - my nuxt web app crashes with a 500 error:

(ChartJS instance)

options: {
    // ...
    plugins: {
        deferred: {
            xOffset: 150,
            yOffset: '50%',
            delay: 500
        }
    },
    // ...
    animation: false, // Animations are disabled via this ChartJS option
    // ...
}

WORKS (B) - The app works like normal if not disabled animation

options: {
    // ...
    plugins: {
        deferred: {
            xOffset: 150,
            yOffset: '50%',
            delay: 500
        }
    },
    // ...
}

WORKS (C) - The app works like normal if I exclude this plugin and disable animations

options: {
    // ...
    animation: false, // ChartJS option that toggles animations
    // ...
}

Maybe I'm overlooking something but it seems like this plugin doesn't first detect whether ChartJS animations are disabled, before running more logic (case A).

kalnode avatar Jan 17 '25 16:01 kalnode