Hello I have a problem with a visualforce page renderedAs pdf, I need to display chart with apexchart but it's impossible to run javascript in a visualforce renderedAs pdf. My question is, is there any solution for doing that? I was thinking to calling another visualforce page (from the one renderedAs pdf) not rendered As pdf and run javascript there, then generate the data:image/png;base64 and returning this url from the second visualforce page (the one not renderedAs pdf) to apex controller. I don't know if this can be done. I hope someone can help me. THANKS!
Ultimately you need browser to run the JavaScript chart libraries. You'll have hard time with it.
You could generate the image earlier (user clicking something on VF page, your JS running, grabbing contents of element or however the chart is done, calling toDataUrl, saving as file/attachment somewhere) and then the pdf page can just reference the file.
There are charting solutions on the web that return an image similar to https://developers.google.com/chart/image but it's ancient and well... you'd need to learn new API and be OK with sending your data to some 3rd party to get the image back. Probably a lot of them will be paid too.