Svg 焦点+;通过刷涂d3散点图的上下文
如何通过刷牙使圆点响应图表的变化?我尝试使用transfsorm属性,但效果不好。这是我的名片。下面是CoffescriptSvg 焦点+;通过刷涂d3散点图的上下文,svg,d3.js,Svg,D3.js,如何通过刷牙使圆点响应图表的变化?我尝试使用transfsorm属性,但效果不好。这是我的名片。下面是Coffescript # draw dots dots = focus.selectAll(".dot") .data(bubbleData) .enter().append("circle") .attr("class", "dot") .attr("r", (d) -> 2*Math.abs(d.surprise)) .attr("cx", xMa
# draw dots
dots = focus.selectAll(".dot")
.data(bubbleData)
.enter().append("circle")
.attr("class", "dot")
.attr("r", (d) -> 2*Math.abs(d.surprise))
.attr("cx", xMap)
.attr("cy", yMap)
.style("fill", (d) -> color(d.surprise))
brushed = ->
xScale.domain (if brush.empty() then xScale2.domain() else brush.extent())
focus.select("._x._axis").call xAxis
focus.select(".line1").attr("d", line1(data))
focus.select(".line2").attr("d", line2(data))
focus.selectAll(".dot").attr "transform", (d, i) ->
"translate(" + xScale(d.date) + "," + yLeftScale(d.price) + ")"
与线条一样,您需要在画笔上重新绘制圆:
focus.selectAll(".dot")
.attr("cx", xMap)
.attr("cy", yMap)
完成演示。与线条一样,您需要在画笔上重新绘制圆圈:
focus.selectAll(".dot")
.attr("cx", xMap)
.attr("cy", yMap)
完成演示。非常感谢快速解决方案。非常感谢快速解决方案。