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 type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.0.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?2.0.0"></script> | |
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?2.0.0"></script> | |
<style type="text/css"> | |
body { | |
font: 10px sans-serif; |
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
// | |
// Chart example | |
// | |
// - Shows multiple lines in one chart | |
// - User can see scale showing the values and the timeframe | |
// - Each line has separate color | |
// - Show legend of groups with colors | |
// - Support transitions to: | |
// - Change data shown | |
// - Change the items shown (keep colors for old ones) |
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
var data = [3,7,9,1,4,6,8,2,5], | |
w = 700, | |
h = 300, | |
max_val = d3.max(data); | |
// Scales | |
x = d3.scale.linear() | |
.domain([0, data.length - 1]) | |
.range([0, w]); | |
y = d3.scale.linear() |
NewerOlder