Created
May 23, 2013 18:56
-
-
Save iros/5638523 to your computer and use it in GitHub Desktop.
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 = [1,3,5,10,11,12,50]; | |
var width = 500, | |
height = 100, | |
r = 5; | |
var xScale = d3.scale.linear() | |
.range([5, width-r]) | |
.domain([1,50]); | |
var chart = d3.select("#vis") | |
.append("svg") | |
.attr("width", width) | |
.attr("height", height); | |
var circles = chart.append("g") | |
.classed("circles", true); | |
circles.selectAll("circle") | |
.data(data) | |
.enter() | |
.append("circle") | |
.classed("circle", true) | |
.style("fill", "red") | |
.attr("r", r) | |
.attr("cy", height/2) | |
.attr("cx", function(d) { | |
return xScale(d); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment