Open kknd4eva opened 3 years ago
From this issue: https://github.com/chartjs/Chart.js/issues/5560
It explains that the animation may not work when fired immediately, and content not yet having a size. In this case, probably because of the loader-icon of this theme. You should be able to get an animation if you delay creating the chart, until you know it has been given a size. You can try adding a timeout like this:
setTimeout(() => {
var myChart2 = new Chart(
document.getElementById('line-chart-orders'),
config2
);
], 1000);
Maybe there's a clever way to do it without an explicit timeout.
I love this template by the way, but for some reason I can't get any of my added charts to animated as they should when the page loads. An example of one of my pages is below. I would expect line-chart-orders to animate on page load using the javascript provided. But the chart is static. It doesn't matter what animation options I try to use, this happens for any chart and chart type (I've experimented with a few). Is there something disabled globally in this dashboard package for some reason?