Chartjs-Charts.js renders axes, but not the dataset

0👍

I would create the image on the onComplete event, than everything should be visible, atleast this works in browsers.

from the documentation: "…The animation configuration provides callbacks which are useful for synchronizing an external draw to the chart animation….", but works surely for your image creating process. link to documentation

...
options: {
  animation:{
        duration: 0, // "no" animation 
        onComplete: () => { 
            ...
            // create image
            ... 
        }
    }
}
...

Ofcourse: in this case your function plotData would have to be async or pass a callback function for when the event onComplete fires.

Leave a comment