I have a div that includes a pie chart illustrating the distribution of a specific statistic across different cities. It seems a bit unnecessary at times.
My goal is to display this pie chart only when the Location option is selected from my drop-down menu. However, upon initially hiding and then showing it again, the pie chart overflows its container.
You can check out the code on this jsfiddle
$("#pie").hide(); // this line will be removed in second example
Interestingly, there are no issues if I first display the chart, hide it, and then show it again.
Here's another version on second fiddle
This situation is quite frustrating, and I'm at a loss for how to resolve it.