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

http://jsfiddle.net/sghoush1/vn7mf/19/

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

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -