Git Product home page Git Product logo

extjs4-orgchart's Introduction

OrgChart

OrgChart 是基于 ExtJS4 实现的组织机构图。它不仅可以用来绘制组织机构图, 也可以扩展实现各种树型结构图。

演示效果

它会根据传入的数据自动展开相应状态,使用时只需要指定 width heightroot 属性即可:

Ext.create('Ext.orgchart.OrgChart', {
    width: width,
    height: height,
    root: {
        nameText: '网页流量',
        valueText: '',
        expanded: true,
        children: [
            {
                nameText: '浏览器市场份额',
                expanded: true,
                children: [
                    {
                        nameText: 'Chrome',
                        valueText: '40.35%'
                    },
                    {
                        nameText: 'IE 8.0',
                        valueText: '14.01%'
                    },
                    {
                        nameText: 'IE 9.0',
                        valueText: '7.05%'
                    },
                    {
                        nameText: 'QQ',
                        valueText: '5.94%'
                    },
                    {
                        nameText: '其他',
                        valueText: '32.66%'
                    }
                ]
            },
            {
                nameText: '屏幕分辨率',
                children: [
                    {
                        nameText: '360x640',
                        valueText: '23.03%'
                    },
                    {
                        nameText: '1920x1080',
                        valueText: '11.93%'
                    },
                    {
                        nameText: '1366x768',
                        valueText: '7.09%'
                    }
                ]
            }
        ]
    }
});

也可以根据需要自定义,创建自己的 settings 实例即可:

Ext.create('Ext.orgchart.OrgChart', {
    ...
    settings: Ext.create('Ext.orgchart.Settings', {
        horizontalSpace: 5,
        verticalSpace: 50,
        nodeHeight: 40,
        nodeWidth: 150,
        nodeBorderRadius: 20,
        expanderType: 'circle',
        nodeBackgroundColor: '#ff662a',
        connectorColor: '#e7e7e7',
        connectorWidth: 2,
        connectorMargin: 0,
        nodeBorderColor: '#e7e7e7',
        nodeBorderWidth: 2
    })
});

extjs4-orgchart's People

Contributors

ssbunny avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.