Home › forums › Using CanvasJS › How to know if chart finished loading/rendering completely
I’m trying to fire an event when the chart finishes rendering completely. The problem is when I have huge data, the chart takes a while to load but the toDataURL method captures the partially loaded chart and not the fully loaded one.
This is how I’m converting the chart to an image:
var canvas = $("#chartContainer .canvasjs-chart-canvas").get(0)
var dataURL = canvas.toDataURL("image/png",1)
I would like to see if there is a way to know if chart has finished loading so that I can run above two lines after that.
Sorry, as of now we don’t have any event that is triggered after the chart is rendered. However, since CanvasJS renders millions of data in few milliseconds you can workaround by calling the required function with a delay of 2 seconds along with animationDuration of chart using the setTimeout method.
You must be logged in to reply to this topic.