title: 2dimple.js/d3.js auto size chart when window size changes
body: <p>I have the following code that draws a chart using dimple.js: <a href="http://jsbin.com/zacus/17/" rel="nofollow noreferrer">http://jsbin.com/zacus/17/</a>
  When the browser window is resized (or the jsbin pane is resized) i want the chart to also resize to fit it's table cell parent.  As you can see from the example this does not happen.
  I have attempted writing an event handler to change the width of the chart or to redraw the chart when it's , but to no avail.  </p>
  
  <pre><code>window.onresize= function redraw(){
    chart1.setBounds(70, 30, pTd.offsetWidth-150, 300);
    myLegend1.left = chart1.width + 100;
  }
  </code></pre>
  
  <p>Any suggestions on how to accomplish this?</p>
  
  <p>EDIT:  Experimenting a bit led me to the following code which seems to solve my problem. Is this the best way to accomplish this?</p>
  
  <pre><code>chart1.svg.attr("width", "100%")
    .attr("height", "100%")
    .attr("viewBox", "0 0 600 400");
  </code></pre>