title: Uncaught TypeError: Cannot read property 'createElementNS' of undefined
body: <p>I am using nvd3 to draw a line chart and when i pass the div to <code>nvd3</code> to draw a chart its give me this error</p>
  
  <blockquote>
    <p>Uncaught TypeError: Cannot read property 'createElementNS' of
    undefined</p>
  </blockquote>
  
  <p>Here is code:</p>
  
  <pre><code> var chartDiv = 'line-chart'+ counter++;
     tmpl = $($('#charts-panel-template').clone().html());
                  tmpl.find('.feature-line-chart').attr('id', chartDiv);
   var  div=tmpl.find('.feature-line-chart#'+chartDiv);
             chartsPanel.append(tmpl);
      nv.addGraph(function() {
      var chart;
      var width = 1024, height = 500;
      chart = nv.models.lineChart()
              // .color(sparkChart.colors)
              .width(width).height(height);
      //modify the x.axes
          chart.x(function(d,i) { 
                return d.x;
          });
  
      //giving chart margin
      chart.margin({right: 40});
  
      $(div).empty();
      //create chart
  
      var svg = d3.select(div).append('svg')
           .datum(data)
           .transition()
           .duration(500)
           .call(chart)
           .attr('width', width)
           .attr('height', height);
  </code></pre>
  
  <p>my questions,</p>
  
  <ul>
  <li>where i am doing wrong</li>
  <li>is anything i am missing</li>
  </ul>