d3.js - starting and ending tick
d3.js, javascript
Solution
One way to do this is to extend the domain of a scale to be "nice", i.e. to include "round" values that will show up on the axis. You can do this by calling `.nice()` after setting the domain:
y = d3.scale.linear().range([height, 0]).domain(...).nice();
The alternative would be to specify the ticks explicitly, which is much more painful in general.
Problem
I am building an area graph in d3.js. For my y axis, I want to use a linear scale that extends from the minimal value to the maximal value of the data represented in the graph. Using ``` y = d3.scale.linear().range([height, 0]), yAxis = d3.svg.axis().scale(y).orient("left") ``` d3 shows ticks only for multiples of 10000. I would like also to see ticks for the starting and the ending value. Is this possible? How?