我通过在同一个 svg container.how中提供多个坐标(x,y)和一个矩形,使用路径概念绘制 V形符号在该矩形中添加雪佛龙为单一形状?
var lineFunction = d3.svg.line()
.x(function(d) { return d.x; })
.y(function(d) { return d.y; })
.interpolate("linear");
//The custom shape
var customshape = svgContainer.append("path")
.attr("d", lineFunction(lineData))
.attr("stroke", color)
.attr("stroke-width", 2)
.style("fill", color)
.style("opacity",0.6);
//rectangle
var rectBox = svgContainer.append("rect")
.attr("x",x_init)
.attr("y",y_init)
.attr("width",wid)
.attr("height",hi)
.attr("stroke-width",1)
.attr("stroke","none")
.attr("fill",rec_color)
.style("opacity",0.9);