[Chartjs]-Blank PNG image using Chart JS . toBase64Image() function

1๐Ÿ‘

I know that itโ€™s been awhile since you have asked the question, but in the Chart.js v2 you have to use onComplete method within the animation option.

animation: {
    duration: 1500,
    onComplete: function (animation) { 
        this.toBase64Image();
}

-1๐Ÿ‘

you have to call save64Img(myChart.toBase64Image()) over an additional callback.
You can add this callback to the options

lineOptions = {
    onAnimationComplete: function () {
       save64Img(myChart.toBase64Image());
    }
}

Leave a comment