Gist 5865021
✓ Published0🌍 Public
11wheel
Last edited Oct 14, 2012
Created on Jun 26, 2013
This example shows the closing price of Apple (AAPL) stock over several months in 2011 and 2012 as a simple SVG line chart. The time-series data is loaded from a TSV file using `d3.tsv`, with dates parsed through `d3.time.format`. The chart uses a `d3.time.scale` for the x-axis, a linear `d3.scale.linear` for the y-axis, and `d3.extent` to compute the domains. Axes are rendered with `d3.svg.axis`, and the line itself is drawn using `d3.svg.line` with steelblue strokes on a white background.
AI-generated descriptionThis simple line chart is constructed from a TSV file storing the closing value of AAPL stock over the last few years. The chart employs conventional margins and a number of D3 features:
- d3.tsv - load and parse data
- d3.time.format - parse dates
- d3.time.scale - x-position encoding
- d3.scale.linear - y-position encoding
- d3.extent - compute domains
- d3.svg.axis - display axes
- d3.svg.line - display line shape