-
Notifications
You must be signed in to change notification settings - Fork 19.8k
Comments
feat: enhance polar line to simulate radar#21378
feat: enhance polar line to simulate radar #21378Justin-ZS wants to merge 3 commits intoapache:master from
Conversation
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.
Please DO NOT commit the files in dist, i18n, and ssr/client/dist folders in a non-release pull request. These folders are for release use only.
Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the PR: awaiting doc label.
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21378@b4ed481
b9fc0c5 to
6d55dbf
Compare
@Ovilia
Ovilia
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution.
Would it be better to implement this as a new custom series in echarts-custom-series and only add splitLine.shape in this PR? Using a line series to simulate a radar chart seems like a workaround. Also, since the line series is a commonly used chart type, we should be cautious about both the additional logic and the impact on bundle size.
It looks like you may need to remove shape: 'polygon' in the test case above and test the default value.
Justin-ZS
commented
Dec 2, 2025
Thanks for your contribution.
Would it be better to implement this as a new custom series in echarts-custom-series and only add
Image It looks like you may need to remove `shape: 'polygon'` in the test case above and test the default value.splitLine.shapein this PR? Using a line series to simulate a radar chart seems like a workaround. Also, since the line series is a commonly used chart type, we should be cautious about both the additional logic and the impact on bundle size.
Re: custom series — The goal here is to extend and reuse polar line capabilities,not as a workaround. For single-metric + single-dimension (a common use case), the radar chart doesn't work well.
Re: line series changes — Agreed on being cautious. That's why only two options are added (connectEnds + splitLine.shape), both strictly scoped to polar coordinate system.
Re: bundle size — The actual delta is ~150 lines across 5 files. the size changing is minimal.
Re: default value test — Fixed
Uh oh!
There was an error while loading. Please reload this page.
Brief Information
This pull request is in the type of:
What does this PR do?
Enhances polar coordinate system to enable line series to simulate radar chart functionality with single category + single metric use cases.
截屏2025年11月28日 09 12 19Fixed issues
N/A
Details
Before: What was the problem?
The traditional radar chart in ECharts has several limitations:
Limited Data Structure Support: The original radar chart only works well with multiple metrics + single category structure. When dealing with single metric + single category data (which is common), it becomes difficult to use effectively.
Implementation Inconsistencies: The radar chart was implemented as a standalone component with its own logic, separate from the polar coordinate system. This resulted in:
Industry Standard Mismatch: Most other charting libraries implement radar charts as an extension of polar line charts, which provides better flexibility and feature consistency. ECharts lacked the necessary features to support this approach.
After: How does it behave after the fixing?
This PR enhances the polar coordinate system with two new features that enable line series to simulate radar chart behavior:
1. Added
connectEndsoption to line series2. Added
splitLine.shapeoption to radius axis'arc'(default, original behavior) or'polygon''polygon'with category angle axis, creates polygon-shaped grid lines by connecting angle tick pointsBenefits:
Document Info
One of the following should be checked.
Documentation needed:
connectEndsoption for line series in polar coordinate systemsplitLine.shapeoption for radius axisMisc
Security Checking
Note: This PR only uses standard canvas drawing APIs for rendering geometry (polygons, lines). No security-sensitive Web APIs are involved.
ZRender Changes
Related test cases or examples to use the new APIs
Basic usage example:
Merging options
Other information