1
我在D3中有一个简单的圆转换,我有大约23个不同的圆圈,名称独特,他们从A点移动到B点。我使用“circle name”作为键。数据()。D3转换在Chrome中行为奇怪
一切工作正常在Internet Explorer中,但是当我在Chrome中尝试它时,气泡映射不正确。例如,气泡1在转换过程中变成气泡3的颜色和“r”。最后的位置是正确的,气泡结束了它们应该在的位置,但它们都在两点之间混合(填充和“r”)。下面
代码:
g.selectAll("circle").data(effedate, function (d) { return d.BubbleName; }).enter().append("circle")
.attr("cx", function (d) { return x_scale(d.PercentageComplete * 100) })
.attr("cy", function (d) { return y_scale(d.GPoS * 100) })
.attr("r", function (d) { return r_scale(d.MSVMMboe) })
.attr("stroke", "black")
.attr("stroke-width", 1)
.attr("opacity", 0.6)
.attr("fill", function (d) {
if (d.FairWay == "A") {
return "steelblue";
}
else if (d.FairWay == "B") {
return "yellow";
}
else if (d.FairWay == "C") {
return "lightgreen";
}
else {
return "lightblue";
}
});
g.selectAll('circle')
.data(effedate).exit().remove();
//transition
g.selectAll("circle").data(effedate2, function (d) { return d.BubbleName; }).transition().duration(3000)
.attr("cx", function (d) { return x_scale(d.PercentageComplete * 100) })
.attr("cy", function (d) { return y_scale(d.GPoS * 100) })
.attr("r", function (d) { return r_scale(d.MSVMMboe) })
.attr("stroke", "black")
.attr("stroke-width", 1)
.attr("opacity", 0.6)
.attr("fill", function (d) {
if (d.FairWay == "A") {
return "steelblue";
}
else if (d.FairWay == "B") {
return "yellow";
}
else if (d.FairWay == "C") {
return "lightgreen";
}
else {
return "lightblue";
}
});
有没有人遇到问题与谷歌浏览器的转变?