I have data points from 5000 to 91200
y.domain(d3.extent(function(d) { return d.y; }));
It gives me the correct ouput [5000, 91200]
but while displaying it changes to 10000.
Does anyone know how I can resolve this issue?
I have data points from 5000 to 91200
y.domain(d3.extent(function(d) { return d.y; }));
It gives me the correct ouput [5000, 91200]
but while displaying it changes to 10000.
Does anyone know how I can resolve this issue?
Share Improve this question edited Sep 27, 2015 at 0:46 Martin Liversage 107k23 gold badges215 silver badges262 bronze badges asked May 26, 2014 at 13:44 Afzal LakdawalaAfzal Lakdawala 1873 silver badges10 bronze badges 1- What do you mean by "while displaying it's changed to 10000"? Do you mean the tick mark labels? When your domain is irregular, the labels will not always include the exact minimum and maximum of the domain. – AmeliaBR Commented May 26, 2014 at 14:21
1 Answer
Reset to default 4d3 uses the 'min' and 'max' functions to show only the lowest and highest numbers in your data
var max = d3.max(d3.values(data));
var min = d3.min(d3.values(data));
y.domain([min, max]);
The extent function actually does both of these functions automagically
y.domain(d3.extent(data, function(d) { return d; }));
If you show your code on jsfiddle I'll be able to narrow down your issue
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745152801a4613939.html
评论列表(0条)