【发布时间】:2015-04-10 13:40:24
【问题描述】:
我正在制作一个组织结构图,并注意到我们的赞助人的标题被省略了。
有没有办法将 CSS 或文件更改为换行?
我正在使用“Eve”主题。如果您对 GetOrgChart 不熟悉,这里是相关代码:
$("#people").getOrgChart({
theme: "eve",
primaryColumns: ["Name", "Title"],
imageColumn: "Image",
linkType: "M",
editable: false,
dataSource: s
});
.
eve: {
size: [500, 220],
toolbarHeight: 46,
textPoints: [{
x: 5, //Name Text
y: 200,
width: 490
}, {
x: 150, //Title Text
y: 40,
width: 350
}, {
x: 210,
y: 65,
width: 290
}, {
x: 210,
y: 90,
width: 290
}, {
x: 210,
y: 115,
width: 290
}, {
x: 210,
y: 140,
width: 290
}],
textPointsNoImage: [{
x: 10,
y: 200,
width: 490
}, {
x: 10,
y: 40,
width: 490
}, {
x: 10,
y: 65,
width: 490
}, {
x: 10,
y: 90,
width: 490
}, {
x: 10,
y: 115,
width: 490
}, {
x: 10,
y: 140,
width: 490
}],
box: '<path class="get-box" d="M0 0 L500 0 L500 220 L0 220 Z"/>',
text: '<text width="[width]" class="get-text get-text-[index]" x="[x]" y="[y]"}">[text]</text>',
image: '<image xlink:href="[href]" x="10" y="-20" height="170" preserveAspectRatio="xMidYMid slice" width="130"/>'
我还将 CSS 缩小为标题文本的此属性:
.get-org-chart .get-oc-c .get-text {
fill:#fff;
font-size:20px;
}
我试过 width 和 word-wrap: break-word,但没有帮助。
任何建议都会很棒,谢谢。
【问题讨论】:
-
那么是全文实际存在还是图表在输出前进行了剪辑?
-
我不确定。 JS 很长,而且变量名没有命名为有用的东西,所以试图弄清楚这一点被证明是一个挑战..
-
用控制台检查 DOM 中的元素会告诉你。
标签: javascript jquery html css orgchart