Example of stacked area charts --based off of this gist -- addressing this SO question.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: gpl-3.0 | |
redirect: https://beta.observablehq.com/@mbostock/d3-difference-chart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
license: mit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://d3js.org/d3.v2.min.js"></script> | |
</head> | |
<body></body> | |
</html> | |
<script type="text/javascript"> | |
var svg = d3.select("body").append("svg") |
An interactive multi-line chart.
Note, I borrowed a bit of code from Duopixel's excellent code sample here.
Built with blockbuilder.org
- the
D3
chart currently displayed on metacat UI - issue: the line and area shapes interpolate across missing data
- features:
- mini 'brush' chart shows the context of the data in focus in the main chart
- x-axis zooming and panning is limited to the range of available data
- y-axis resizes automatically to match the maximum y-value of the data in focus
- buttons zoom focus to an interval equal to one year (if sufficient data), one month, or the range of the data
- text at top changes to indicate the range of data in focus