Black Lives Matter. Please consider donating to Black Girls Code today.
Learn how to use COVID-19 data in open source Dash apps. Register for the Sept 23rd webinar with IQT!

I want to show loading symbol while loading the graph

Hi,

I am using scater3d graphs, I want to call the callback functions after graph get loaded.Is there any callback functions available with plotly.js.
And i want to plot X-Axis tick values start from Zero( I mean by default X-Axis ticks displaying right to left i.e. 10-0, I want to display X-Axis values as 0-10). Can you please give me the suggestion, How to plot X-Axis ticks.

All Plotly methods return a promise. If you prefer working the plotting methods also fire up a plotly_afterplot event when done.

So the easiest way to check if Plotly is done rendering would be something like:

var isPlotlyDone = false;
Plotly.plot(graphDiv, data, layout, config).then(function() { 
   isPlotlyDone = true;
});

To add post-plot handler:

function plotPlotHandler() {
   /*  your post plot handler here */
}

// option 1
Plotly.plot(graphDiv, data, layout, config).then(postPlotHandler);

// option 2
graphDiv.on('plotly_afterplot', postPlotHandler);

Isn’t the promise resolved when plotting is completely done? So, how exactly is to show a progress bar?

Something like this can be done …

// *display* loader
Plotly.plot(graphDiv, data, layout, config).then(function() { 
// *hide* loader
});

Yes, something like a spinner, but not a true progress bar.