i have chart like this
I need to fill 3 area between dashed line. for example : fill area between 2 red dashed line, 2 blue dashed line and 2 green dashed line.
I try do it like this:
function fillArea(){
var d = {};
var x = [];
var y1 = [];
var y0 = [];
for(var i = 0; i < chartJson.length; i++){
x.push(chartJson[i].run_date);
y0.push(chartJson[i].diviationMinus);
y1.push(chartJson[i].diviationPlus);
}
d.x = x;
d.y1 = y1;
d.y0 = y0;
var area = d3.svg.area()
.x(function(d) {return x(d.x); })
.y0(function(d) { return y(d.y0); })
.y1(function(d) { return y(d.y1); });
}
fillArea();
but nothing happen. Here is jsfiddle https://jsfiddle.net/1xnc6y58/