I'm using d3.js to show information about network traffic to great effect. At a certain point in the visualization, a y-axis is being used to show a count of bytes.
I am currently using the d3.svg.axis().ticks() system, which results in nice round numbers like 20000. When converting to kB/MB/etc, however the result is awkward numbers like 19.5, and 9.8. Is there a way to get ticks back on multiples of (2^(10*c)), like 1024, 1048576, etc, instead of multiples of (10^c)?
Other information/thoughts:
You could handle the tick values manually, as documented here: https://github.com/mbostock/d3/wiki/SVG-Axes#wiki-tickValues
var xAxis = d3.svg.axis()
.scale(x)
.tickValues([1, 2, 3, 5, 8, 13, 21]);
And you can use tickFormat for help with formatting, i.e. for fix precision and SI prefixes. https://github.com/mbostock/d3/wiki/Formatting#wiki-d3_format