score:0

Try throwing a .nice() at the end.

yScale = d3.scale.linear()
    .range([mainHeight, 0])
    .domain(d3.extent([0, d3.max(data, function (d) {
        return (d.total)+1000;
    })]))
    .nice();

This will try to make the axis end on nice round numbers. You can read more here: https://github.com/d3/d3-3.x-api-reference/blob/master/Quantitative-Scales.md#linear_nice

Hope this helps.


Related Query