Please refer below link
Hope this will help you with your requirement.
If you are not looking for an answer for specific chart library, you can use Plotly.
Check on the docs : https://docs.mendix.com/howto/front-end/charts-plotly-images-rest/
This implementation will convert your chart as an image and you can pass those image object to the document template for rendering it in PDF.
I hope this might help you.