Chart.js Hide empty Chart and keep previous data if no data? .net MVC

đź‘Ť:-1

I don’t know chart.js, but by it’s name I’ll assume it’s a plugin to draw graphs.

Probably, it’ll require that you feed them with data, or at least, with an endpoint where read the data, so it can draw a graph that represent these data.

Now… if you have a data collection, or an endpoint where check for data, won’t be easy to check these data and redirect your code execution than try to do that from within a plugin?

If the collection of data is empty or you don’t get data from the endpoint just end the execution or return it to the last call (which you could have stored previously if necessary)

Leave a comment