title: Download d3 charts on click in sapui5
body: <p>I have created a venn diagram using d3 in Sapui5. 
  Note: I have created circles inside  tag and inside  tag i have used  tag for styling the circle. </p>
  
  <p>Now i have a Button when i click on the button the svg can be downloded and can be viewed. 
                             <a href="https://i.stack.imgur.com/F5Cgb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/F5Cgb.png" alt="SVG Image"></a></p>
  
  <p>The styles are not shown. </p>
  
  <p>I am doing like this onclick </p>
  
  <pre><code>    d3.select("#save").on("click", function(){
    var html = d3.select("svg")
          .attr("version", 1.1)
          .attr("xmlns", "http://www.w3.org/2000/svg")
          .node().parentNode.innerHTML;
  
    console.log(html);
    //var imgsrc = 'data:image/svg+xml;base64,'+ btoa(html);
    //var img = '&lt;img src="'+imgsrc+'"&gt;'; 
    //d3.select("#svgdataurl").html(img);
  
  });
  </code></pre>
  
  <p>could any one help me out to solve this problem.</p>