Gist 6285771
✓ Published0🌍 Public
11wheel
Last edited Aug 20, 2013
Created on Aug 20, 2013
This simple line chart tracks the daily closing price of AAPL stock from January 2012 to May 2012, with a data file storing date–price pairs. It uses D3’s SVG rendering, applying conventional margins, a time scale for the x-axis, a linear scale for the y-axis, and axis components. The line is drawn with d3.svg.line, while domains are computed with d3.extent. The chart demonstrates loading and parsing TSV data with d3.tsv and formatting dates with d3.time.format, offering a clean, compact example of D3’s core data-join and scales.
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