title: Highchart loading csv with 2 values
body: <p>I’m having a litte problem with Highcharts probably because I’m a total noob with Javascript.</p>
  
  <p>With Highcharts I want a chart that shows date on the x-axis and the value on the y-axis. I’m using a CSV file (<code>results.csv</code>) that looks like this:</p>
  
  <pre><code>821,2013-11-12
  1623,2013-11-13
  </code></pre>
  
  <p>… and so on.</p>
  
  <p>I used the Highchart documentation on preprocessing CSV data, and the example on the website.
  I made a website with 4 different charts and 4 CSV files, but all those files were made by myself using the same layout as the example on highchart. Now I want to use other CSV files.</p>
  
  <p>My code looks like this:</p>
  
  <pre><code>$.get('./results.csv', function(data) {
      // Split the lines
      var lines = data.split('\n');
      $.each(lines, function(lineNo, line) {
          var items = line.split(',');
  
          // header line containes categories
          if (lineNo == 0) {
              $.each(items, function(itemNo, item) {
                  if (itemNo &gt; 0) options.xAxis.categories.push(item);
              });
          }
  
          // the rest of the lines contain data with their name in the first position
          else {
              var series = {
                data: []
              };
              $.each(items, function(itemNo, item) {
                  if (itemNo == 0) {
                      series.name = item;
                  } else {
                      series.data.push(parseFloat(item));
                  }
              });
  
              options.series.push(series);
  
          }
  
      });
  
      var chart4 = new Highcharts.Chart(options);
  });
  </code></pre>
  
  <p><a href="http://jsfiddle.net/yELdd/" rel="nofollow">JsFiddle</a></p>
  
  <p>I’m stuck.</p>