Posibility of Extending Document Template with Charts

0
I am currently using Document templates to customize PDF files that users can download while using the system. However, I need to add functionality of also displaying various graphs in the PDF like column chart, line charts, pie charts etc. But the document templates are limited to few widgets and can't seem to find a way to add charts to the template. Is there a possibility to add graphs to a document template?.   Additional note: I also tried printing the page which contains the graphs as a alternative, however the graphs either don't appear or isn't responsive to the page being printed.   Thank you
asked
2 answers
2

I don't think charts are supported in Document Templates, you could generate an Image of the chart using the Plotly API, and somehow get that into the Document Template but I think that would be quite tricky.  

 

In my opinion it would be best to move away from the Document Templates module and upgrade to the PDF Document module

Thought this may seem like a big undertaking, I feel it will serve you better and save time in the long term. 

 

answered
0

I agree with Matthew. If for some reason, for instance you are running on premise, and can’t use the PDF Document Generation module from Mendix, another option is the JFreeCharts module. I have used it to generate charts in the background (no need to show on a page) and then append them to a document template as a picture. I have customized the module a bit so it can also handle 2 chart types (bar + line) in one picture.

answered