title: Node js, NVD3.js cannot read property baseval of undefined
body: <p>For the following data,</p>
  
  <pre><code>historicalBarChart = [ 
    {
      key: "Cumulative Return",
      values: [
        { 
          "label" : "A" ,
          "value" : 29.765957771107
        } , 
        { 
          "label" : "B" , 
          "value" : 0
        } , 
        { 
          "label" : "C" , 
          "value" : 32.807804682612
        } , 
        { 
          "label" : "D" , 
          "value" : 196.45946739256
        } , 
        { 
          "label" : "E" ,
          "value" : 0.19434030906893
        } , 
        { 
          "label" : "F" , 
          "value" : 98.079782601442
        } , 
        { 
          "label" : "G" , 
          "value" : 13.925743130903
        } , 
        { 
          "label" : "H" , 
          "value" : 5.1387322875705
        }
      ]
    }
  ];
  </code></pre>
  
  <p>I am going to generate Bar chart using NVD3.js with Node js server.</p>
  
  <p>My Nodejs code to generate svg :
  ** NVD3svgnode.js **</p>
  
  <pre><code>var http = require('http'),
      url = require('url'),
      jsdom = require('jsdom'),
      child_proc = require('child_process'),
      w = 400,
      h = 400,          
      scripts = ["file://"+__dirname+"/d3.min.js",
                 "file://"+__dirname+"/d3.layout.min.js",
                  "file://"+__dirname+"/nv.d3.min.js",
                 "file://"+__dirname+"/bar.js"],
  
      htmlStub = '&lt;!DOCTYPE html&gt;&lt;div id="bar" style="width:'+w+'px;height:'+h+'px;"&gt;&lt;svg xmlns="http://www.w3.org/2000/svg" version="1.1"&gt;&lt;/svg&gt;&lt;/div&gt;';
  
      http.createServer(function (req, res) {
             res.writeHead(200, {'Content-Type': 'image/svg+xml'});
             jsdom.env({features:{QuerySelector:true}, html:htmlStub, scripts:scripts,   done:function(errors, window) {
                  var chart1= window.bar();
  
         d3.select('#bar svg')
           .datum(historicalBarChart)
           .transition().duration(500)
           .call(chart1);
            }});
  }).listen(8888);
  </code></pre>
  
  <p>My NVD3 code to generate bar is:
  <strong>bar.js</strong></p>
  
  <pre><code>function bar(){
  var chart = nv.models.discreteBarChart()
        .x(function(d) { return d.label })
        .y(function(d) { return d.value })
        .staggerLabels(true)
        .tooltips(false)
        .showValues(true);
  return chart;
  }
  </code></pre>
  
  <p>While executing the node js NVD3svgnode.js, i am getting the following exception</p>
  
  <pre><code>    file:///Users/administrator/Downloads/nodejs/d3.js:5347
          var t = g.transform.baseVal.consolidate();
                             ^
  **strong text**TypeError: Cannot read property 'baseVal' of undefined
      at d3.transform (file:///Users/administrator/Downloads/nodejs/d3.js:5347:28)
      at Object.d3.transform (file:///Users/administrator/Downloads/nodejs/d3.js:5350:7)
      at d3_interpolateTransform (file:///Users/administrator/Downloads/nodejs/d3.js:5394:35)
      at Object.&lt;anonymous&gt; (file:///Users/administrator/Downloads/nodejs/d3.js:7697:32)
      at d3_Map.&lt;anonymous&gt; (file:///Users/administrator/Downloads/nodejs/d3.js:7858:31)
      at d3_Map.d3_class.forEach (file:///Users/administrator/Downloads/nodejs/d3.js:271:13)
      at start (file:///Users/administrator/Downloads/nodejs/d3.js:7857:28)
      at Object.callback (file:///Users/administrator/Downloads/nodejs/d3.js:7851:38)
      at d3_timer_mark (file:///Users/administrator/Downloads/nodejs/d3.js:2075:80)
      at d3_timer_step [as _onTimeout] (file:///Users/administrator/Downloads/nodejs/d3.js:2048:15)
  </code></pre>
  
  <p>Any help with this issue would be great.</p>