When to Use
Use graph charts when you need to:- Visualize social networks and relationships between people
- Display organizational structures and dependencies
- Show network topology and system architectures
- Illustrate knowledge graphs and entity relationships
- Represent flow and connectivity in complex systems
Basic Configuration
A graph chart requires nodes and edges (or links) data. The chart supports multiple layout algorithms including force-directed, circular, and custom positioning.Complete Example
Here’s a full example demonstrating a social network graph with force-directed layout:Key Options
Layout
The layout algorithm for positioning nodes. From GraphSeries.ts:158
'none': No automatic layout, use fixed positions'force': Force-directed layout with physics simulation'circular': Circular layout arranging nodes in a circle
Force Layout Configuration
Configuration for force-directed layout. From GraphSeries.ts:218-230
Node Configuration
Array of node data items. From GraphSeries.ts:84-112
Edge Configuration
Array of edge/link data items. From GraphSeries.ts:118-133
Interaction
Whether nodes can be dragged. From GraphSeries.ts:178
Whether to enable zoom and pan. From GraphSeries.ts:472
Symbol size scale ratio during zoom. From GraphSeries.ts:176, 479
Categories
Node categories for grouping and styling. From GraphSeries.ts:135-140, 166Each category can have its own style settings that apply to all nodes in that category.
Auto Curveness
Automatic curveness for multiple edges between same nodes. From GraphSeries.ts:235When there are multiple edges connecting the same pair of nodes, this automatically adjusts their curveness to prevent overlap.
Coordinate Systems
Graph charts can be placed on various coordinate systems:- Cartesian (
xAxisIndex,yAxisIndex): Position on x/y axes - Polar (
polarIndex): Circular coordinate system - Geo (
geoIndex): Geographic map - Single Axis (
singleAxisIndex): Single axis coordinate - View (default): Standalone view with box layout
Layout Types
Force-Directed Layout
Physics-based layout where nodes repel each other and edges act as springs. Best for organic, natural-looking networks.Circular Layout
Arranges all nodes in a circle. Good for showing cyclical relationships or when all nodes have equal importance.Fixed Layout
Uses predefined x, y positions for each node. Useful when you have specific positioning requirements.Best Practices
- Use categories to group related nodes with consistent styling
- Enable
roamfor large graphs to allow exploration - Set appropriate
repulsionandedgeLengthvalues to prevent node overlap - Use
emphasis.focus: 'adjacency'to highlight connected nodes on hover - Consider using
autoCurvenessfor graphs with multiple edges between nodes - For better performance with large graphs, disable
layoutAnimation