{"id":7554,"date":"2015-07-26T05:13:23","date_gmt":"2015-07-26T05:13:23","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/nvd3-clear-svg-before-loading-new-chart-open-source-projects-novus-nvd3\/"},"modified":"2015-07-26T05:13:23","modified_gmt":"2015-07-26T05:13:23","slug":"nvd3-clear-svg-before-loading-new-chart-open-source-projects-novus-nvd3","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/07\/26\/nvd3-clear-svg-before-loading-new-chart-open-source-projects-novus-nvd3\/","title":{"rendered":"NVD3, Clear svg before loading new chart-open source projects novus\/nvd3"},"content":{"rendered":"<p>I have several different NVD3 charts that I call upon in the same svg. I use buttons to call functions, each containing a new chart that uses its own data.<\/p>\n<p>Is there a way to clear my single svg without deleting it? I wish to press a button to call my chart, but clear the svg before the new chart is loaded.<\/p>\n<p>It&#8217;s not an issue when using the kind of chart&#8230; calling two multibarhorizontal charts, for example, just updates the shapes, which is fine. The problem is loading two different charts, like a line and a bar.<\/p>\n<p>Thanks in advance<\/p>\n<p><strong>EDIT<\/strong> &#8211; The answers must be something like d<code>3.select(\"svg\").remove()<\/code> but that just deletes the svg. I only want to clear it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have several different NVD3 charts that I call upon in the same svg. I use buttons to call functions, each containing a new chart that uses its own data. Is there a way to clear my single svg without deleting it? I wish to press a button to call my chart, but clear the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7554","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7554","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=7554"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7554\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}