Unable to render bar graph or pie chart on a callback

You could try to reduce your code and create a minimal example, you can find more information concerning this here:

This usually helps a lot and most of the time, the problem can be resolved.