Using Frappe Charts in Print Format

Hi,

I’d like to use Frappe Charts (https://frappe.io/charts) in my print format.

For a trial-and-error approach, I copied the script from https://discuss.erpnext.com/t/load-a-javascript-in-print/16518. which worked fine when viewing the print in full-page mode. The regular preview and the PDF does not work.

I run Frappe Framework: v13.14.0 (version-13) in development mode.

Is there any guide to run custom javascript for print formats? Is storing the “resulting” HTML from a custom script into a DocType field the only way to run Javascript in the PDF preview?

Best regards
Simon