You have to provide data in a form which is amenable to the stack layout
for the function to work as expected:
by default the following attributes are required on each value: * x - the x-position of the value. * y - the y-thickness of the value. * y0 - the minimum y-position of the value (baseline).
So you need to transform your data a bit more:
var data = [];
d3.csv.parseRows(text).forEach(function(row, idx) {
row.forEach(function(value, layer) {
if (typeof data[layer] === 'undefined') data[layer] = [];
data[layer].push({ x : idx, y : +value });
});
});
Working demo: http://plnkr.co/edit/P8Q4UGNpdUMw1V824vlK?p=preview