Reputation: 23
The following scatterplot example has origin at (2, 4) truncating the graph
even though range specifies zero.
.range([0, width]); .range([height, 0]);
http://bl.ocks.org/mbostock/3887118
Question ----> How to make origin start at (0,0) regardless of data
similar to the following example:
http://bl.ocks.org/hunzy/11110940
also with the same range
.range([0, width]); .range([height, 0]);
Upvotes: 2
Views: 1570
Reputation: 8623
y.domain([0, d3.max(data, function (d) {
return d.y;
})])
.nice();
x.domain([0, d3.max(data, function (d) {
return d.x;
})])
.nice();
Upvotes: 4