Example for StackOverflow question Map custom value field to x value when using a stacked layout.

// This works:
var st = d3.layout.stack()
                  .values(function (d) { return d.values; })
                  .y(function (v, i) { return v.yInit; })
                  .out(function (d, y0, y) { d.x = d.xInit; d.y0 = y0; d.y = y; });
// But this does not:
var st = d3.layout.stack()
                  .values(function (d) { return d.values; })
                  .y(function (v, i) { return v.yInit; })
                  .x(function (v, i) { return v.xInit; });