score:1

So, this is what I ended up doing that worked, with the help of Lars' guidance:

var yAxisTicks = records;
yAxisTicks[yAxisTicks.length - 1] = d3.max(records) + 1000;
var yAxis = d3.svg.axis()
  .tickValues(yAxisTicks)
  .scale(y)
  .orient("left")
  .tickSize(0)
  .tickFormat(function(d, i){
    var rounded = (Math.round((d/10000) * 10) / 10).toFixed(1);
    return i == 0 || i == 4 ? rounded + "M": "";
  });

Ultimately, I passed an array with all the y axis values to .tickValues, then used .tickFormat to only show the first and last (as the first ended up displaying in the middle, as that's where the first data point displays)


Related Query

More Query from same tag