title: javascript rickshaw bar graph width=NaN
body: <p>I'm trying to draw a rickshaw bar graph with a set of very basic data, for some reason when I create myself the series array (with color: string, data: [{}] and name: string) I get this error:</p>
  
  <p>Error: Invalid value for  attribute width="NaN" </p>
  
  <p>and if I look at the  elements created for each bar of the graph, they indeed have width=NaN:</p>
  
  <pre><code>var json = '@Html.Raw(Json.Encode(Model))';
      var array = $.parseJSON(json);
      var dataArray = [];
  
      var palette = new Rickshaw.Color.Palette({ scheme: 'classic9' });
  
      for (var i = 0; i &lt; array.length; i++) {
          dataArray.push( 
              {
                  color: palette.color(),
                  data: [{x: i, y: array[i].Value}],
                  name: array[i].Key
              });
      }
  
      console.log(dataArray);
  
      var graph = new Rickshaw.Graph({
          element: document.querySelector("#chart"),
          renderer: 'bar',
          width: 420,
          height: 280,
          series: dataArray
      });
  
      graph.render();
  
  &lt;rect x="0" y="208.95816646947355" width="NaN" height="71.04183353052643" transform="matrix(1,0,0,1,0,0)" fill="#2f254a"&gt;&lt;/rect&gt;
  &lt;rect x="0" y="168.32890323029957" width="NaN" height="40.6333259065763" transform="matrix(1,0,0,1,0,0)" fill="#491d37"&gt;&lt;/rect&gt;
  &lt;rect x="0" y="133.60905003661946" width="NaN" height="34.71985319368011" transform="matrix(1,0,0,1,0,0)" fill="#7c2626"&gt;&lt;/rect&gt;
  </code></pre>
  
  <p>thanks.</p>