【发布时间】:2014-07-27 22:01:04
【问题描述】:
我正在制作一个 SVG,它的文本沿着圆形线路径。
文本在 Firefox 和 Chrome 中看起来不错,但在 IE11 中看起来不正确。有时只出现文本路径上的第一个字母。
这里是the fiddle。
d3.select("#svg")
.append("path")
.attr("id", "path1")
.attr("d", "M 0,-1 C 0.5523, -1 1, -0.5523 1,0 C 1, 0.5523 0.5523, 1 0,1 C -0.5523, 1 -1, 0.5523 -1,0 C -1, -0.5523 -0.5523, -1 0,-1")
.attr("transform", "scale(50, 50) translate(5,5)");
d3.select("#svg")
.append("text")
.append("textPath")
.attr("xlink:href", "#path1")
.style("font-size", "10px")
.text("hello radial world")
.attr("fill", "blue")
【问题讨论】:
-
您确定浏览器模式和文档模式设置为IE 8+?
-
我不确定。是通过设置doctype来完成的吗?
-
查看此讨论:stackoverflow.com/questions/17871124/…,确保您至少设置了 IE 9,因为 IE8 不支持 SVG。
-
CSS 文件使用
-webkit-规则。 -
这个example是我见过的最接近的东西。
标签: javascript html css svg d3.js