-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Charts don't resize appropriately for print view #1275
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
Comments
Ha. I'm surprised that any plotly graphs are displayed properly when printed. I'd recommend exporting your plotly graphs as images either using the snapshot mode bar button or |
Actually, (if I understand correctly) this has nothing to do with the fluid layout logic.
|
So plotly charts are not really printable? This is a major issue. And no, an image won't solve this, an image is nothing that should be considered when you have svg. Also a printable image would have to be 300dpi+ in resolution. What you seen on screen is not what is to be seen on paper. |
It should work fine once you set |
I was able to solve this with the following:
|
I had a look at the code for relayout and it seems to depend on the chart and its elements if it is synchronous or asynchronous. And this trick supposedly only works with synchronous calls. But I'll validate that and report the results. |
Has there been any progress on this issue? I am running into a similar problem when attempting to print @craigdrayton your solution looks promising. Could you clarify what exactly |
Here's a Codepen demonstrating the solution proposed in #1275 (comment) . It works well on Chromium. @etpinard I think we should handle this automatically when |
One challenge would be to test that solution in an automated fashion. For example, we would have to make sure we resize the figures back to their original sizes when closing the print dialog. |
Is there any progress on this feature? |
This issue has been tagged with A community PR for this feature would certainly be welcome, but our experience is deeper features like this are difficult to complete without the Plotly maintainers leading the effort. Sponsorship range: $10k-$15k What Sponsorship includes:
Please include the link to this issue when contacting us to discuss. |
Whether this actually works is heavily dependant on the browser and in some cases the screen size. Support in Plotly is not completely there and there are also various bugs in browsers, e.g.: plotly/plotly.js#1275 https://bugs.chromium.org/p/chromium/issues/detail?id=697233
Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson |
Currently, if you have a fluid chart and resize the browser window, the chart will be resized correctly to fit in the new available width. That is working fine. However, the same does not happen when you try to print that chart.
The easiest way to reproduce the issue is looking at the official response fluid chart example: https://plot.ly/javascript/responsive-fluid-layout/
If you try to print the page, you'll notice that the chart is cut off. The window.resize() function is actually called but, for some reason, it looks like the chart still reflects the width of the normal browser window rather than the width of the print view:
http://codepen.io/anon/pen/vyoBrW
Could you please check this issue?
The text was updated successfully, but these errors were encountered: