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
The chart is blank on printed page in Chromium (Ctrl+P) #873
Comments
That's because due performance optimizations we're creating several canvases for panes/price axis/time axis. If you want to get an image of chart, please use
Doesn't it mean that this is a bug in Chromium? 🤔 |
Yeah it could be a bug in Chromium. Is there a chance to fix the printing? It would be easier for us if the printing work out of the box. |
@dtanp-rft Do you have any idea what it could be? I mean, it seems that Chrome just ignores canvas elements on the page (or at least some "specific" canvases)? I think you can start with filing a report to Chromium team so they will be aware of the issue and probably they might have any workaround which we can use in the library. |
@timocov Really sorry for late response. I was on road trip last week :) I have tried to debug in lightweight chart to see why some bit of canvas is able to print, while other parts are failed. Unfortunately, I don't think I understand enough of the code as the process of painting looks very similar ... I was thinking that it must be a quirk on Chrome engine as well that causes the issue. However, other Canvas Chart e.g. ChartJS can print correctly .... |
If someone wants to investigate this and create an issue in chromium - you're more than welcomed to do it (or find a workaround for the library). |
I believe the reason is that when being printed the page is briefly switched to the And in this mode the The workaround could be not changing the canvas size in the fancy-canvas if the |
Thanks @subzey! It seems that the first fix should be done in https://github.com/tradingview/fancy-canvas/ package. @Nipheris fyi |
That PR merge is still pending as of Sept '22 😬 Would be great to be able to print charts properly, this bug affects also affects chart PDF rendering when using Puppeteersharp/Chromium. |
Lightweight Charts Version: 3.7.0
Steps/code to reproduce:
Actual behavior:
None of the chart is printed. It's blank canvas.
Expected behavior:
It should be printed
Note:
The text was updated successfully, but these errors were encountered: