-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Chart resizing weirdly in certain formats (xaringan and quarto presentation) #632
Comments
I cannot reproduce this can you share what browsers you use and whether you still encounter the issue without |
i'm seeing the issue on chrome and it does seem like the issue is not present when using normal rmarkdown Attached video of what it looks like when using xaringan I did think it was maybe a xaringan or xaringanExtra issue but was told changes would likely need to be dealt with on echarts side |
I'm sorry but I genuinely cannot reproduce this, resizing the browser works perfectly fine on my end. The code to resize echarts4r is perfectly standard echarts4r/inst/htmlwidgets/echarts4r.js Line 227 in 57b6410
Can you make sure you are on the latest github version of echarts4r? |
Hi John, thanks for looking into it! Works fine in normal rmd docs as well on my end so the issue seems to be something specific to xaringan. I've solved it using JavaScript that calls resize with original height / width when browser refrehsed.
|
When using echarts4r charts in a xaringan or quarto presentation, it seems like initial charts look fine but as soon as i resize the browser, some charts are scaled weirdly.
In the reprex at the end, the line + area chart on page 1 breaks when user resizes browser while the scatter plot on page 2 dynamically resizes properly when browser is resized.
For example, if browser is fully maximized and changed to half size then changed again to fully maximized, chart on page 1 breaks like the second image.
The sizing for page 1 can be fixed when the page is refreshed but breaks again as soon as browser is refreshed.
Is there any way the size can be fixed without full refresh of browser?
I've done some dodgy work around where I insert some javascript that refreshes page when browser is resized but this has become pretty annoying as my file is large and takes ages to reload.
Chart looks fine on first load

Breaks when browser size changed

Reprex below
The text was updated successfully, but these errors were encountered: