How would I implement a loading icon for a bar chart running a sql statement

This may help you out: