Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/svg/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Svg 焦点+;通过刷涂d3散点图的上下文_Svg_D3.js - Fatal编程技术网

Svg 焦点+;通过刷涂d3散点图的上下文

Svg 焦点+;通过刷涂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

如何通过刷牙使圆点响应图表的变化?我尝试使用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", 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)

完成演示。

非常感谢快速解决方案。非常感谢快速解决方案。