Friday, 27 September 2013

domain / padding in d3.js linear scales

domain / padding in d3.js linear scales

Folks-
I've been trying to set the d3.scale.linear.domain x axis value manually,
using Mike Bostock's simple bar chart:
http://bl.ocks.org/mbostock/raw/2368837/
var x = d3.scale.linear()
.domain([-100, 200]) //this line added
.range([0, width])
I would expect this to yield a an x axis with values -100 to 200. Instead
it yields -30 to 10, as before, and the chart doesn't change. Any ideas?
Thanks,
RL

No comments:

Post a Comment