var data = [
{x: 100, y: 100}, {x: 150, y: 150}, {x: 200, y: 100},
{x: 250, y: 150}, {x: 300, y: 100}, {x: 350, y: 150}
];
var data = [
{x: 100, y1: 100, y0: 150}, {x: 150, y1: 150, y0: 200}, {x: 200, y1: 100, y0: 150},
{x: 250, y1: 150, y0: 200}, {x: 300, y1: 100, y0: 150}, {x: 350, y1: 150, y0: 200}
];
var area = d3.area()
.x(function (d) {return d.x;})
.y0(function (d) {return d.y0;})
.y1(function(d){return d.y1;});
原文:http://www.cnblogs.com/yaoyinglong/p/5904486.html