0
在下面的d3線圖example中,我想填充線的顏色等同於線顏色和50%的透明度。d3填充在內插線下
除了增加面積的CSS
.area {
fill: blue;
opacity: 0.5
}
加入以下function updateGraph(data)
svg.append("path")
.data([data])
.attr("class", "area")
.attr("d", area);
和
var area = d3.svg.area()
.x(function(d) { return x(d.year); })
.y0(height)
.y1(function(d) { return y(d.value); });
什麼是需要填充的區域,以適應下內插線和填充顏色等同於線顏色?