score:10

Accepted answer

The chart uses data in the following format

[{ date: '...', close: '...'},
 { date: '...', close: '...'}]

So, you need to parse your array:

// fix your data parser
var parseDate = d3.time.format("%Y-%m-%d").parse;

var arrData = [
  ["2012-10-02",200],
  ["2012-10-09", 300], 
  ["2012-10-12", 150]];

// create a new array that follows the format
var data = arrData.map(function(d) {
    return {
      date: parseDate(d[0]),
      close: d[1]
    };
});

Here's the working version: http://jsfiddle.net/jaimem/T546B/

pd: depending on the data you might have to modify your y scale's domain.


Related Query

More Query from same tag