Chartjs-Can't display chart.js after fadeOut the pageloader

1👍

Move the chart initialization into the fadeIn call back

$('#canvas').delay(500).fadeIn(function() {
    window.myRadar = ...

If you need to fadeIn the chart as well, first show the canvas element with opacity 0 (or visibility hidden), initialize the chart and then fade it in.

If the canvas element (or sometimes the parent, when responsive is set) has no size when new Chart is called the height and width is taken as 0 and the chart is not visibly drawn.


Fiddle – http://jsfiddle.net/1jd9bmgo/

Leave a comment