【发布时间】:2017-12-27 16:23:30
【问题描述】:
我一直在制作一个现金温度计,可以显示每个月的进度。我在使用 SVG 文本包装时遇到问题,可以使用一些帮助。动画和其他一切都设置好了,我只是无法让文本正确换行。对此的任何帮助将不胜感激。下面是我的代码的 JS 小提琴链接。您会注意到文本被剪掉并且无法正确显示。
https://jsfiddle.net/corcorancr/4pto1wm5/1/
//-- Draw Goal line
if (this.currentProgress >= this.currentGoal) {
this.drawTick(maxTemp, "Goal of " + this.currentGoal + " Reached! " + this.currentProgress + " receieved!", "Black", 0, width, tubeWidth, tubeBorderColor, scale, svg);
} else {
this.drawTick(maxTemp + 3, "Goal: " + this.currentGoal, "black", 0, width, tubeWidth, "Black", scale, svg);
this.drawTick(percentageOfGoal, "Current: " + this.currentProgress, this.getMercuryColor(t), 0, width, tubeWidth, tubeBorderColor, scale, svg);
}
【问题讨论】:
标签: javascript jquery css svg