Using Frappe Charts in Print Format


I’d like to use Frappe Charts (Frappe Charts: Simple and Modern SVG Charts) in my print format.

For a trial-and-error approach, I copied the script from 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

1 Like

I have the same problem and tried to solve the same way. Also unsuccessfully in this attempt.

Maybe this link will help you.

I am almost getting it, I put it for the Chart to load after the DOM loads and at least now it appears, but I want to find a way to disable the animation because it is apparently what causes the lines to be below.

document.addEventListener('DOMContentLoaded', function(){ 
    // your code goes here
}, false);


I don’t think this can work as Charts are loaded with Client Side.