首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >getOrgChart多行标头和链接

getOrgChart多行标头和链接
EN

Stack Overflow用户
提问于 2018-04-10 05:36:38
回答 1查看 270关注 0票数 1

我最近买了你的gerOrgChart插件,并且一直在为一些事情而挣扎。我使用的是自定义主题1,这个主题对我很有用。然而,在我的情况下,每张卡的名字标签都很长。我不喜欢“.”,但是根据卡片的宽度,整个文本分裂成多行。我还需要添加一个链接到它。但是dataSource没有将html href标记呈现到特定的数据中。

剧本:

代码语言:javascript
复制
getOrgChart.themes.myCustomTheme =
{
    size: [270, 400],
    toolbarHeight: 46,
    textPoints: [
    { x: 30, y: 50, width: 240},
    { x: 30, y: 120, width: 240},
    { x: 30, y: 150, width: 240}
    ],
    textPointsNoImage: [
    { x: 30, y: 50, width: 240},
    { x: 30, y: 120, width: 240},
    { x: 30, y: 150, width: 240}
    ],
    expandCollapseBtnRadius: 20,
    defs: '<filter id="f1" x="0" y="0" width="200%" height="200%"> 
    <feOffset result="offOut" in="SourceAlpha" dx="5" dy="5" /> 
    <feGaussianBlur result="blurOut" in="offOut" stdDeviation="5" /> 
     <feBlend in="SourceGraphic" in2="blurOut" mode="normal" /> 
    </filter>',
    box: '<rect x="0" y="0" height="400" width="270" rx="10" ry="10" 
    class="myCustomTheme-box" filter="url(#f1)"  />',
    text: '<text text-anchor="start" width="[width]" class="get-text 
    get-text-[index]" x="[x]" y="[y]">[text]</text>',
    };

    var name = '<a href=www.google.com> Google </a>;
    data.push({id: current_record_number++ ,parentId: level,
    name: name,
    Stake: ' 10% Stake',
    RevHeading: 'Revenue'
    });

    data = [{id: 1, parentId: null, name: 'xyz', Stake: '-'}];
    var peopleElement = document.getElementById("peoples");
    var orgChart = new getOrgChart(peopleElement, {
    theme: "myCustomTheme",
    enableEdit: false,
    scale: 0.5,
    enableSearch: false,
    linkType: "B",
    color: "neutralgrey",
    enableGridView: true,
    primaryFields: ["name", "Stake", "Date", "RevHeading"],
    dataSource: data
    });
</script>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-10 18:08:22

我们已经修改了创建您自己的主题-1页,以便向您展示如何实现所请求的功能http://www.getorgchart.com/experimental/create-your-own-theme-1.html

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49746053

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档