feat: enhance polar line to simulate radar #21378
Draft
+228
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Fixed 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