Skip to main content
100%

Simple line graph in d3.js

✓ Published0🌍 Public
Aadamfknapp
Last edited Nov 14, 2017
Created on Nov 14, 2017

This simple line graph plots stock closing prices over time from a CSV dataset with date and value columns. The visualization uses d3.v3 with an SVG canvas, a time-scaled x-axis, and a linear y-axis, rendering the data as a single steelblue path. The code demonstrates core D3 concepts including `d3.time.format` for date parsing, `d3.time.scale` and `d3.scale.linear` for coordinate ranges, and `d3.svg.line` to generate the line geometry from the parsed data points.

AI-generated description

This is a simple line graph designed to allow investigation of aspects of using d3.js and is used as a teaching aid.

It is the baseline example graph used in the D3 Tips and Tricks book.

Edit: June 2014

I am going through a process of updating the code resources for the book and the latest (but not particularly different) example of this graph is here.

forked from <a href='http://bl.ocks.org/d3noob/'>d3noob</a>'s block: <a href='http://bl.ocks.org/d3noob/4414436'>Simple line graph in d3.js</a>

mit Licensed

Similar vizzes