This chart demostrates how to destory and then re-create a chart made with webCharts using the chart.destroy() method and the associated .on("destroy") callback. Made with Webcharts.
xxxxxxxxxx
<html lang="en">
<title>Webcharts - chart.destroy() demo</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" href="https://cdn.rawgit.com/RhoInc/Webcharts/master/css/webcharts.css">
<script src="https://d3js.org/d3.v3.min.js"></script>
<script src='https://cdn.jsdelivr.net/gh/rhoinc/webcharts/build/webcharts.js'></script>
</head>
<body style="padding:1em;">
</body>
<script src="destroyDemo.js" defer></script>
</html>
Modified http://d3js.org/d3.v3.min.js to a secure url
Updated missing url https://cdn.rawgit.com/RhoInc/Webcharts/master/build/webcharts.js to https://cdn.jsdelivr.net/gh/rhoinc/webcharts/build/webcharts.js
https://d3js.org/d3.v3.min.js
https://cdn.rawgit.com/RhoInc/Webcharts/master/build/webcharts.js