常用的看明白了,还有几个地方不太明白。
zoom函数: area path circle
.on("zoom", function(){
that.svg_obj.select(".x.axis").call(xAxis); var _lines = that.lines;
for(var i=0; i<_lines.length; i++){
that.svg_obj.select(".g"+i+" path.line")
.attr("d", lineFunction(_lines[i].dataset))
;
that.svg_obj.select(".g"+i+" path.area")
.attr("d", areaFunction(_lines[i].dataset))
;
that.svg_obj.selectAll(".g"+i+" circle").attr("d", function(){
that.svg_obj.selectAll(".g"+i+" circle").attr('cx', function(d,i){
return xScale(i);
})
.attr('cy', function(d){
return yScale(d);
})
;
});
} });