apache/echarts · error
The polyline edgeShape can only be used in orthogonal layout
Error message
The polyline edgeShape can only be used in orthogonal layout
What it means
DEV-only guard in TreeView edge rendering: the 'polyline' edgeShape (right-angled orthogonal connectors) is only supported when the tree layout is 'orthogonal'. Using polyline with layout 'radial' or 'none' is rejected in dev. Stripped in production.
Source
Thrown at src/chart/tree/TreeView.ts:543
shape: {
parentPoint: [targetLayout.x, targetLayout.y],
childPoints: [[targetLayout.x, targetLayout.y]],
orient: orient,
forkPosition: edgeForkPosition
}
});
}
graphic.updateProps(edge as Path, {
shape: {
parentPoint: [targetLayout.x, targetLayout.y],
childPoints: childPoints
}
}, seriesModel);
}
}
else {
if (__DEV__) {
throw new Error('The polyline edgeShape can only be used in orthogonal layout');
}
}
}
// show all edge when edgeShape is 'curve', filter node `isExpand` is false when edgeShape is 'polyline'
if (edge && !(edgeShape === 'polyline' && !node.isExpand)) {
edge.useStyle(zrUtil.defaults({
strokeNoScale: true, fill: null
}, lineStyle));
setStatesStylesFromModel(edge, itemModel, 'lineStyle');
setDefaultStateProxy(edge);
group.add(edge);
}
}
function removeNodeEdge(View on GitHub (pinned to 30076aedcd)
Solutions
- Use edgeShape:'polyline' only with layout:'orthogonal'
- For radial or other layouts, use edgeShape:'curve'
Example fix
// before
{ type: 'tree', layout: 'radial', edgeShape: 'polyline', data: [...] }
// after
{ type: 'tree', layout: 'orthogonal', edgeShape: 'polyline', data: [...] }
// or
{ type: 'tree', layout: 'radial', edgeShape: 'curve', data: [...] } Defensive patterns
Strategy: validation
Validate before calling
(option.series || []).forEach((s: any) => {
if (s.type === 'tree' && s.edgeShape === 'polyline' && s.layout && s.layout !== 'orthogonal') {
console.error('[tree] polyline edgeShape requires layout:orthogonal');
}
}); Prevention
- Match edgeShape to the tree layout
- Default to edgeShape:'curve' for radial trees
- Audit tree config when switching layouts
When it happens
Trigger: tree series with edgeShape:'polyline' combined with a layout other than 'orthogonal' (e.g. 'radial').
Common situations: Switching a tree from orthogonal to radial but leaving edgeShape:'polyline'; copying a tree config across layouts.
Related errors
- key must not be "{}"
- Heatmap must use with visualMap
- Heatmap on cartesian must have two category axes
- Heatmap on cartesian must have two axes with boundaryGap tru
- Line not support coordinateSystem besides cartesian and pola
AI-assisted analysis of apache/echarts@30076aedcd (2026-08-12).
Data as JSON: /api/errors/8e4e4c264f1313c1.
Report an issue: GitHub.