title: Uncaught TypeError: Cannot read property 'textContent' of null error
body: <p>I am trying to use dc.js to implement the crossfilter and d3. I am almost successful. When I run my code in JSFiddle, it works perfectly ok! But when i try to implement the exact code on the local system, it gives me <strong>Uncaught TypeError: Cannot read property 'textContent' of null</strong> error.</p>
  
  <p>My code is</p>
  
  <p><strong>trial1.js</strong>
  <div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var yearChart = dc.barChart('#year-chart');
  
  //the data
  var data = [
  {date: "2015-10-01", type: "car", quantity: 3}];
  
  var dispatch = crossfilter(data);
  
  var parseDate = d3.time.format("%Y-%m-%d").parse;
  data.forEach(function (d) {
      d.date = parseDate(d.date);
      d.quantity = +d.quantity;
      d.Year = d.date.getFullYear();
  });
  
  var dateDim = dispatch.dimension(function (d) {
      return d.date;
  });
  var productions = dateDim.group().reduceSum(function (d) {
      return d.quantity;
  });
  var minDate = dateDim.bottom(1)[0].date;
  var maxDate = dateDim.top(1)[0].date;
  
  yearChart.width(2000).height(200)
      .dimension(dateDim)
      .group(productions)
      .x(d3.time.scale().domain([minDate, maxDate]))
      .brushOn(false)
   .centerBar(true)
      .yAxisLabel("Productions per day")
   .xUnits(function(){return 10;});
  
  yearChart.render();</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;html&gt;
   &lt;head&gt;
   &lt;meta charset="utf-8"&gt;
    &lt;script src="https:////cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js" charset="utf-8"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="https://dc-js.github.io/dc.js/js/d3.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="https://dc-js.github.io/dc.js/js/crossfilter.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="https://dc-js.github.io/dc.js/js/dc.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="https://dc-js.github.io/dc.js/js/colorbrewer.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src = "trial1.js"&gt;&lt;/script&gt;
   &lt;/head&gt;
   &lt;body&gt;
   &lt;div id="year-chart"&gt;&lt;/div&gt;
   &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>the line of code in <strong><em>d3.js</em></strong> that gives the error is <strong><em>this.node().textContent;</em></strong></p>