(Based on

The trick is to use svg:foreignObject (as stated by @thatOneGuy in the comments), then you can place any HTML inside the axis label. The function at html below gets passed data[i].name, where one can place arbitrary HTML.

var height = 500;

var xAxis = d3.svg.axis()
  .tickSize(0).tickPadding(0).tickFormat(function(d) {return '';});

var tx = -5;
var ty = 2;
var tw = 50;
var th = 10;

  .attr("class", "x axis")
  .attr("transform", "translate(0," + height + ")")
  .attr("x", tx)
  .attr("y", ty)
  .attr("class", "my-x-axis-label")
  .html(function(schema) {return schema;});

CSS: {
  font: 10px sans-serif;

More Query from same tag