【发布时间】:2017-05-12 22:11:41
【问题描述】:
我的图表基于示例:
https://bl.ocks.org/kerryrodden/7090426
我想调整面包屑多边形大小以增加宽度。这是我从原始版本中更改的内容-
entering.append("svg:polygon")
.attr("points", breadcrumbPoints)
.attr("width",500)
.style("fill", function(d) { return colors[d.name]; });
entering.append("svg:text")
.attr("x", (b.w + b.t) / 2)
.attr("y", b.h / 2)
.attr("dy", "0.35em")
.attr("text-anchor", "middle")
.text(function(d) { return d.name; });
我还附上了截图。 PS:我添加了一个宽度属性,但没有成功。请帮忙。 I have attached the image showing the need for increasing the width of the breadcrumb
【问题讨论】:
-
我认为这不是您需要的多边形的宽度。看看这个:stackoverflow.com/questions/8515524/…
-
@mkaran 对不起,我对 d3js 很陌生,所以我需要一个 javascript 代码来增加多边形的宽度,以便数字数据适合它,目前超出限制,如您在我附上的图片。
标签: javascript d3.js