You can do it with some basic HTML/CSS manipulation. Simply hide the container element of the PieChart and show your message. When there is data available again, hide the message and show the chart element. I'm not entirely sure if you can remove the chart element and re-add it later. But hiding with display:none
or visibility:hidden
should work just fine.
In the worst case, you can remove the chart from the page (don't forget to call .remove()
on the chart) and add it back in when you have data again.
Another option is to display another HTML element (with the message?) absolutely positioned over the chart, so that the chart is hidden beneath.