Currently, I am facing a situation where I am showcasing charts on the client side using the Javascript library called Raphael. When users click on download, I want to be able to generate the same chart in PDF format and present it to them. However, the challenge arises because I am utilizing JFreeChart to create charts on the server side, resulting in visual discrepancies between the two libraries. What would be the best solution to address this issue?
Please note that the use of the chart must be free for commercial purposes.