-
Notifications
You must be signed in to change notification settings - Fork 19.7k
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
Save as image background for connected charts #10099
Save as image background for connected charts #10099
Comments
Hi! We've received your issue and please be patient to get responded. 🎉 In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer. Have a nice day! 🍵 |
@MINDoSOFT Sorry I could not get it. The transparent between the two charts is expected since there's no chart and thus no background there. |
I have the same issue. @Ovilia Even though it's expected it doesn't make much sense from a user's perspective. |
@Meldanen In this case, you can set the |
Hello there, @Ovilia I have tried your suggested approach by setting the background color of the parent div but still when saving the image the background for the space between the charts is transparent. You can see the jsfiddle here. Here is how it looks in the browser And here is how it looks after save as image (the black background is the transparent part) Thank you for your time. |
I see. So what do you think if we use CSS background color to render first, and then the chart background? |
For my use case, I believe only the chart background should be used. There is no need to use the css background color. Best regards, Sergios. |
Chart background makes sense for me as well |
But there are two chart instances, and thus two possible |
Hi @Ovilia , only in the case where the charts have different background colors, I think the container css background color should be used. |
I think this breaks the consistency of expectation. For example, if the user has set CSS background, he may confuse why in some cases it is used and some not. |
toolbox.feature.saveAsImage.connectedBackgroundColor can be used to set the background color. Fix #10099
I had a second thought and found CSS background may not be accurate, because the container may have a transparent background while the ancestors may have a background color. |
toolbox.feature.saveAsImage.connectedBackgroundColor can be used to set the background color. Fix #10099
* 'master' of https://github.com/apache/incubator-echarts: fix: last axis label duplicated, fix #10304 feat: support backgroundColor for connected charts in toolbox toolbox.feature.saveAsImage.connectedBackgroundColor can be used to set the background color. Fix #10099 fix: set default position to be bottom test: add test case for b3a2548 #10202 feat: support tooltip for toolbox #10202 test: update test example feat: add toolbox text style support
Version
4.2.1-rc.2
Reproduction link
https://jsfiddle.net/z9hj8xqd/3/
Steps to reproduce
Notice that the 2 charts are connected.
Click the save as image toolbox button.
See the transparent background between the charts in the exported png image.
What is expected?
When "save as image" is clicked for connected charts, the exported image should contain the background color for every part of the image.
What is actually happening?
Where there are no charts (e.g. other DOM elements), the background of the image is transparent.
I ran into this bug, because I have connected charts on my page and they have DOM elements in between them.
The text was updated successfully, but these errors were encountered: