fix charts hanging around in memory after they have been removed

Fixes a memory leak that I recently uncovered by adding a function to call when a Chart is removed from the DOM.