create d3.js axes without numbering create d3.js axes without numbering javascript javascript

create d3.js axes without numbering


The simplest way to hide tick labels is via CSS:

.axis text { display: none; }

Alternatively, you could use the empty string as the tick format:

axis.tickFormat("");

Or, you could use post-selection to remove the text elements after creating the axis:

selection.call(axis).selectAll("text").remove();

Of course, I prefer CSS as it's the most declarative. Example here: