I have some graphs made with chart.js that i would like for the user to be able to print with a button.
I still haven’t been able to get a simple print of the entire page to work.
“windows.print()” does not work as expected.
However, i would ultimately want to be ale to have control of what is printed on the page. In my site you can press between 5 different buttons to display 5 different graphs, only 1 graphs displayed at a time. However, when printing i would like all the graphs to be printed at the same time, without ALL other elements on the page. Only the 5 graphs.
Is this possible? If not, i still want to know how to get “windows.print()” or something similiar to work.
(btw, if i need to include/import/whatever things, then tell me how to do so, where i put the line of code that does the importing)
Hello, you do not have direct access to the window object in Velo. If you need to use window.print you will want to look into custom elements . I suggest following the tutorial first to make sure you understand and then moving on the more complex implementations. You can also read through the MDN documentation on web components to learn more.
just to be super clear. This is what my app looked like in blazor. The top two panels are the same page, but with a different view (the buttons under the graph). There are 5 graphs the user can view. However, only one is visible at a time. When the user clicks the “print” button to the bottom left. Then the print page appears as expected. But if you look in the print page, all elements except for the graph is gone. And all the graphs are being printed in a row (notice, 3 pages).
Hello, I just realized that you double posted about this issue. I am closing the comments on this one. Please refrain from double posting in the future. Thank you!