Q:

Highstock chart doesn't show after it has been cleared

I am trying to make a simple page where there will be a Highstock chart on page-load and two buttons, one for removing the graph and another for reloading it. However, once the first button has been clicked to clear the container of the chart inside, subsequent clicks on the 2nd button doesn't reload the chart. How can I reload it? The fiddle is at http://jsfiddle.net/Cupidvogel/DCkmN/

A:

You're losing your chart options array when you clear it for some reason. You can just create it in the function itself like this.
Or better yet move it into it's own function so you can reuse it like this.

