-
Notifications
You must be signed in to change notification settings - Fork 19.8k
fix: Add SVG decal backgroundColor support #21337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix: Add SVG decal backgroundColor support #21337
Conversation
- Fix decal backgroundColor not working in SVG renderer - Add background rectangle to SVG patterns when backgroundColor is specified - Add comprehensive test cases for verification - Update gitignore to exclude dist folder Fixes issue where decal backgroundColor was ignored in SVG mode while working correctly in Canvas mode.
|
Thanks for your contribution! |
|
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21337@0c09b6b |
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.
The result of bar-chart-decal-test running with canvas and svg are not the same. Is this expected? I believe the canvas result is correct.
Please don't create a directory for related tests. You can put them in a single file called decal-backgroundColor.html.
.gitignore
Outdated
| *.asm | ||
|
|
||
| # Distribution files | ||
| /dist/ |
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.
/dist should be uploaded when a new version release, so please revert this change.
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.
recitfied in 1b15177
| "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.3.4.tgz", | ||
| "integrity": "sha512-jRsuseXBo9pN197KnDwhhaaBzyZr2oIcLHHTt2oDdQrej5Qp57dCCJafWx5ivU8/alEYDpssYqv1MUqcxwQlrA==", | ||
| "dev": true, | ||
| "peer": true, |
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.
Please don't upload the changes of package-lock.json.
there is one serious issue i found |
-fix: removed the nested decal test folder and merged test files into one
|
@Ovilia There is one very interesting thing i found out when i ran the testcase 'test/decal-backgroundColor.html' ... i am attaching the iamges --> The thing is that there is only an issue with bar chart series2 rendering and only when the color is setted to transparent, all other charts are rendering fine |






Brief Information
This pull request is in the type of:
What does this PR do?
Fixes the issue where decal background color was not applied when the rendering mode was set to SVG.
Fixed issues
Details
Before: What was the problem?
When rendering charts in SVG mode, the decal background color was not visible.
This occurred because the existing code only handled the Canvas rendering case and did not include logic for SVG rendering.
After: How does it behave after the fixing?
The decal background color now correctly appears when charts are rendered in SVG mode.
A separate code path was introduced to handle the non-canvas (SVG) case, utilizing the pattern sizes to generate appropriate SVG dimensions for decal rendering.
Two new test files have been added inside:
to validate the fix in SVG rendering scenarios.
Document Info
One of the following should be checked.
Misc
Security Checking
ZRender Changes
Related test cases or examples to use the new APIs
Two new test cases added in
test/decal_bg_svg_testing/.Merging options
Other information
This fix ensures parity between Canvas and SVG rendering modes regarding decal background color rendering.
2025-11-03.16-09-34.mp4