Created
January 31, 2014 02:53
-
-
Save m-mizutani/8725848 to your computer and use it in GitHub Desktop.
This file contains 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
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js"></script> | |
</head> | |
<body> | |
<div id="chart" style='overflow:auto; width:960px; height:480px; background: #eee;'></div> | |
</body> | |
<script type="text/javascript"> | |
var svg = d3.select('#chart').append('svg') | |
.attr('width', 300) | |
.attr('height', 400); | |
var dat = [10, 20, 30]; | |
var line = svg.append('g').selectAll('p') | |
.data(dat) | |
.enter() | |
.append('line') | |
.attr('x1', 0) | |
.attr('y1', function(d,i) { return d}) | |
.attr('x2', 100) | |
.attr('y2', function(d,i) { return d}) | |
.attr('stroke', '#111'); | |
</script> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment