scotthmurray / d3-book

Code examples for “Interactive Data Visualization for the Web”
http://d3book.com
Other
2.4k stars 1.79k forks source link

Chapter 16 parseTime => d3.timeParse() #37

Closed asc2683 closed 5 years ago

asc2683 commented 5 years ago

In Chapter 16, in data transform the following needs to be updated:

From:

dataset[i-3] = {
  date: parseTime(rows[i][0]) // make a new Data obj for each year + month
};

To:

dataset[i-3] = {
  date: d3.timeParse(rows[i][0]) // make a new Data obj for each year + month
};
asc2683 commented 5 years ago

ParseTime is defined in the top.

var parseTime = d3.timeParse("%Y-%m");