javascript - d3.scale.linear() not working -
i using d3.scale.linear() scale input domain output range. looked @ documentation
http://alignedleft.com/tutorials/d3/scales
and have far
//here declaring domain , range passing max, min parameters var rscale = d3.scale.linear() .domain('min', 'max') .range('10', '250');
i pre calculating max , min , storing them in variables , passing variables parameters domain , range
then passing rscale parameter attribute circle .attr('r',rscale)
cant seem figure out doing wrong
here fiddle
1) pass in domain , range scale, use array:
var rscale = d3.scale.linear() .domain([min, max]) .range([10, 250]);
2) use scale:
.attr("r", function(d) { return rscale(d.consumption_gj_);})
Comments
Post a Comment