All examples By author By category About

ritchieking

Line chart, with comments

Howdy, and welcome to this block! Its purpose is to help you learn to make a line chart using D3. The curve above shows the life expectancy for the entire world over time. The data come from the World Bank.

The code itself is ripped almost entirely from Mike Bostock's Line Chart block. But the data is different (just to mix things up a bit) and the code itself is heavily commented with explanations of what it's actually doing. I hope that it helps. You can also find a clean version here.

I also hope to do a series of these, so stay tuned!