Skip to main content
100%

Simple line graph in d3.js

✓ Published0🌍 Public
Dd3noob
Last edited Nov 30, 2019
Created on Dec 30, 2012

This example shows a simple line graph plotting stock closing prices over time, with date values on the x-axis and price on the y-axis. The visualization uses D3.js version 3.5.17, employing `d3.time.scale` for the date range, `d3.scale.linear` for the value axis, and `d3.svg.line` to generate the path. Data is loaded from a local CSV file via `d3.csv`, with the axes created through `d3.svg.axis`. The SVG rendering includes styled axis lines and a steelblue line, providing a minimal teaching example for D3 chart construction.

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.

mit Licensed

Similar vizzes