logo

Ant Design Charts

  • Manual
  • Options
  • Examples
  • Productsantv logo arrow
  • 2.0.0
  • Component Overview
  • Common Configuration Statistical Charts
    • Chart composition
    • Component
      • 标题(Title)
      • Axis
      • Legend
      • Scrollbar
      • Slider
      • Tooltip
      • Label
    • Core
      • Color En
      • View
      • Data
        • overview
        • custom
        • ema
        • fetch
        • filter
        • fold
        • inline
        • join
        • kde
        • log
        • map
        • pick
        • rename
        • slice
        • sort
        • sortBy
      • Scale
        • overview
        • band
        • linear
        • log
        • ordinal
        • point
        • pow
        • quantile
        • quantize
        • sqrt
        • threshold
        • time
      • Transform
        • overview
        • bin
        • binX
        • diffY
        • dodgeX
        • flexX
        • group
        • groupColor
        • groupX
        • groupY
        • jitter
        • jitterX
        • jitterY
        • normalizeY
        • pack
        • sample
        • select
        • selectX
        • selectX
        • sortColor
        • sortX
        • sortY
        • stackEnter
        • stackY
        • symmetryY
      • Coordinate
        • overview
        • fisheye
        • parallel
        • polar
        • radial
        • theta
        • transpose
        • cartesian3D
      • 样式(Style)
      • Animate
        • overview
        • fadeIn
        • fadeOut
        • growInX
        • growInY
        • morphing
        • pathIn
        • scaleInX
        • scaleInY
        • scaleOutX
        • scaleOutY
        • waveIn
        • zoomIn
        • zoomOut
      • 状态(State)
      • Interaction
        • Overview
        • brushAxisHighlight
        • brushHighlight
        • brushXHighlight
        • brushYHighlight
        • brushFilter
        • brushXFilter
        • brushYFilter
        • chartIndex
        • elementHighlight
        • elementHighlightByColor
        • elementHighlightByX
        • elementSelect
        • elementSelectByColor
        • elementSelectByX
        • fisheye
        • legendFilter
        • legendHighlight
        • poptip
        • scrollbarFilter
        • sliderFilter
      • Composition
        • overview
        • facetCircle
        • facetRect
        • repeatMatrix
        • spaceFlex
        • spaceLayer
        • timingKeyframe
      • Theme
        • overview
        • Academy
        • classic
        • classicDark
      • event
    • Specal Plot
      • Area
      • Bar
      • CirclePacking
      • DualAxes
      • Gauge
      • Line
      • Rose
      • Sankey
      • Scatter
      • Sunburst
      • Treemap
      • Venn
      • WordCloud
      • Column
      • Pie
      • BidirectionalBar
      • Box
      • Bullet
      • Funnel
      • Heatmap
      • Histogram
      • Liquid
      • Radar
      • Stock
      • Tiny
      • Violin
      • Waterfall
      • RadialBar
  • Relation Graph Components
    • Overview
    • MindMap
    • Fishbone
    • IndentedTree
    • Dendrogram
    • OrganizationChart
    • FlowGraph
    • FlowDirectionGraph
    • NetworkGraph
    • FAQ

OrganizationChart

Previous
Dendrogram
Next
FlowGraph

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Visually displays the hierarchical structure and departmental relationships within an organization.

import { OrganizationChart } from '@ant-design/graphs';

When to Use

  • To show the hierarchical structure of a company or team, clarifying the relationships between positions and departments.
  • To display the distribution of employees by position and department.
  • For project management, clarifying team members and their responsibilities.
  • For dependency analysis in scenarios like equity penetration and upstream/downstream company relationships.

Examples

API

For general graph properties, refer to: General Graph Properties

OrganizationChart

PropertyDescriptionTypeDefault Value
dataThe datasetData-
labelFieldSpecifies the node label content
- Select a field from the data, and the corresponding field value will be used as the node label
- Dynamically generated: this function will be called with node data as a parameter, and its return value will be used as the node label
string | ((node: NodeData) => string)Node ID
directionSyntactic sugar for setting the arrangement direction of tree nodes. When layout.rankdir is set, it will take precedencevertical | horizontalvertical
layoutDagre layout configurationLayout-

Data

Graph data. If the expand-collapse behavior is enabled, make sure the children field is included in the data.

const graphData = {
nodes: [
{ id: '1', data: { label: 'Node 1' }, children: ['2', '3'] },
{ id: '2', data: { label: 'Node 2' }, children: ['4'] },
{ id: '3', data: { label: 'Node 3' } },
{ id: '4', data: { label: 'Node 4' } },
],
edges: [
{ source: '1', target: '2' },
{ source: '1', target: '3' },
{ source: '2', target: '4' },
],
};

Layout

Dagre Hierarchical Layout. The configuration options are as follows:

For more details, refer to the Dagre Wiki.

PropertyDescriptionTypeDefault Value
rankdirThe direction of node arrangement. Options include TB, BT, LR, or RL, where T = Top, B = Bottom, L = Left, and R = Right.stringTB
alignNode alignment mode. Options include UL, UR, DL, or DR, where U = Up, D = Down, L = Left, and R = Right.stringundefined
nodesepThe horizontal spacing between nodes in the layout, in pixels.number50
edgesepThe horizontal spacing between edges in the layout, in pixels.number10
ranksepThe spacing between levels in the layout, in pixels.number50
marginxThe margin on the left and right sides of the graph, in pixels.number0
marginyThe margin on the top and bottom sides of the graph, in pixels.number0
acyclicerIf set to greedy, uses a greedy heuristic algorithm to find the feedback arc set of the graph. The feedback arc set consists of edges that can be removed to make the graph acyclic.stringundefined
rankerThe algorithm used to assign ranks to nodes in the input graph. Possible values are network-simplex, tight-tree, or longest-path.stringnetwork-simplex
Basic Usage

A simple demonstration.

Node Layout

Set direction to vertical for top-down or horizontal for left-right layout. The default is vertical.

Custom Nodes

Render the chart using custom React nodes. The example uses the built-in OrganizationChartNode, but you can develop your own RC component for specific needs.

Collapse/Expand Child Nodes

Enable the expand/collapse behavior for child nodes by configuring the collapse-expand-react-node behavior. For detailed configuration instructions, refer to CollapseExpandReactNodeOptions.

Preview
Click Preset Icon to Expand/Collapse
Click Custom Icon to Expand/Collapse