我正在使用d3来建立散点图,其中我已经使用剪辑路径给我的图表中的缩放功能。但只有当我在Mozilla浏览器中打开页面时,剪辑路径的高度和宽度才保持不变。 这对铬浏览器来说工作得很好。即使我减少或增加剪辑路径的大小,它采用默认的宽度和高度为Mozilla浏览器。另外,当我改变矩形圈它将剪辑路径作为矩形。这个问题只适用于Mozilla浏览器。我的代码:是不是剪裁路径可以调整大小为mozilla浏览器
that.svgContainer = d3.select("#chart")
.append('svg')
.attr("width",that.w)
.attr("height",that.height)
.attr("id","svgcontainer")
.attr("class","svgcontainer");
that.group = that.svgContainer.append("g")
.attr("transform","translate("+(that.margin_left)+","+(that.margin_top)+")")
.attr("id","main");
clip = that.group.append("svg:clipPath")
.attr("id", "clip")
.append("svg:rect")
.attr("width",(that.w-that.margin_left-that.margin_right))
.attr("height", that.height-that.margin_top-that.margin_bottom);
chartBody = that.group.append("g")
.attr("clip-path", "url(#clip)");
所以请建议我一些替代方案。
的问题是clipPath宽度和高度保持不变的,它是不会改变的Firefox。所以散点图中的气泡由于气候变化的高度和宽度而变小。即使我增加clipPath的高度,它仍然保持不变,它不会改变。 – devanshi28 2014-10-11 08:05:35
我理解您的担忧,但在这个开发阶段,我们无法将代码发布到任何测试服务器。但是,是的,如果你能告诉我firefox是否真的有clippath没有得到任何自定义宽度/高度这样的问题。 – devanshi28 2014-10-11 08:26:14