scotthmurray / d3-book

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

time-based axes code? #42

Closed new-machines closed 4 years ago

new-machines commented 4 years ago

Working through the section on time-based axes, but the sample files (08 and 09) draw 31 sets of x and y axes (without any data points) instead of one set with 31 data points.

Archive.zip

new-machines commented 4 years ago

I see an earlier issue that duplicates this one, but it isn't clear from that string what the fix was?

https://github.com/alignedleft/d3-book/issues/38#issue-405280682

scotthmurray commented 4 years ago

@new-machines I can't speak to what happened over in #38, but I have a guess.

What version of D3 are you using? The book and all examples are written to work with 4.5.0, which is what's included in this repo. If you're using a different version, you should check the change history to see what's different from 4.5.0 to the other version.

Here is what I see when I run those two examples, as in the repo:

Screen Shot 2019-11-16 at 10 07 00 AM Screen Shot 2019-11-16 at 10 07 12 AM

And here is what I see when I run the two files you provided, but changing the JS reference to point to D3 4.5.0.

Screen Shot 2019-11-16 at 10 09 03 AM Screen Shot 2019-11-16 at 10 09 07 AM
new-machines commented 4 years ago

Thank you so much for looking at that. I was def using the right version of d3. Managed to get things working though by starting from scratch with a different directory structure. BTW, the book is great!

scotthmurray commented 4 years ago

Oh good, glad to hear it. Thanks!