Skip to content
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

[Bug] echarts容器图表全屏显示时,主题为什么自动变成了黑色 #20088

Closed
zxy-github136 opened this issue Jun 27, 2024 · 6 comments

Comments

@zxy-github136
Copy link

Version

5.5.1

Link to Minimal Reproduction

https://echarts.apache.org/examples/zh/editor.html?c=multiple-y-axis

Steps to Reproduce

1.打开链接,
2.F12打开谷歌浏览器控制台,
3.输入document.querySelector('#chart-container').requestFullscreen()
4.会发现echarts主题变为了黑色

Current Behavior

想做全屏展示,但是全屏之后,图表主题变成黑色了

Expected Behavior

全屏之后,图表主题不变

Environment

- OS: Win10
- Browser: Chrome 126.0.6478.127
- Framework: Vue@3 或 echarts官网

Any additional comments?

在一个加班的夜晚的前夕

@echarts-bot echarts-bot bot added the pending We are not sure about whether this is a bug/new feature. label Jun 27, 2024
Copy link

echarts-bot bot commented Jun 27, 2024

@zxy-github136 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Bug] Why does the theme automatically turn black when the echarts container chart is displayed in full screen

@zxy-github136
Copy link
Author

yes ok

@helgasoft
Copy link

helgasoft commented Jun 27, 2024

document.querySelector('#chart-container') returns null in my browser...
Try setting fullscreen background in CSS:

#chart-container:fullscreen { background-color: yellow;}
#chart-container:-webkit-full-screen {  background-color: yellow; /*  width: 100vw;  height: 100vh;*/}
#chart-container:-moz-full-screen { background-color: yellow; }
#chart-container:-ms-fullscreen { background-color: yellow; }

@zxy-github136
Copy link
Author

Operation process step.zip

@plainheart
Copy link
Member

得给 container 元素设置个背景颜色,示例页面没有设置默认背景颜色,会继承浏览器默认的背景色。当只有 container 元素全屏时,没有可以继承的背景色,于是就出现了所谓的“黑色”背景。

#chart-container {
  background-color: #fff;
}

@plainheart plainheart added support not-a-bug and removed bug pending We are not sure about whether this is a bug/new feature. labels Jun 28, 2024
@zxy-github136
Copy link
Author

是的,you are right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants