title: ScatterChart in NVD3 – Reading the data from csv file
body: <p>I am trying to read in data from csv file and want to visualise this data with a scatterChart in NVD3.</p>
  
  <p>I would have linked to a JSfiddle or something similar but I don't know how to include a csv file in these online JavaScript IDEs. Is that possible?</p>
  
  <p>The csv file has the following format:</p>
  
  <pre><code>   country,y,x
     Algeria,91.8,15.7
     Bahrain,98.2,49.3
     Jordan,99.1,55.0
     Kuwait,98.6,57.4
     Lebanon,98.7,58.6
  </code></pre>
  
  <p>My best guess for the code to read the csv file with is:</p>
  
  <pre><code>var scatterdata = [ 
    {
      key    : "Group1",
      values : []//{x:"",y:""}
    }
  ];
  
  d3.csv("literacyScatterCountrynames.csv", function (error, csv) {
    if (error) return console.log("there was an error loading the csv: " + error);
    console.log("there are " + csv.length + " elements in my csv set");
  
  scatterdata[0].values["x"] = csv.map(function(d){return [+d["x"] ]; });
  scatterdata[0].values["y"] = csv.map(function(d){return [+d["y"] ]; });
  </code></pre>
  
  <p>I see my data in the DOM and it looks about right but the chart is not shown and instead it says 'No Data Available.' in bold letters where the chart should be.</p>
  
  <p>Neither here at StockOverflow, nor in the NVD3 documentation on Github, nor in the helpful website on NVD3 charts by cmaurer on GitHub could I find more information on how to do this.</p>