开发者

Getting Java- and Javascript-generated charts to look similar

开发者 https://www.devze.com 2023-03-10 07:55 出处:网络
I\'m havi开发者_如何学JAVAng the following scenario: I\'m displaying charts in the client side using the Javascript chart library Raphael. On clicking download I need to generate the same chart into p

I'm havi开发者_如何学JAVAng the following scenario: I'm displaying charts in the client side using the Javascript chart library Raphael. On clicking download I need to generate the same chart into pdf and display it to the user. I'm using JFreeChart to create charts on the server side. The problem is that since I'm using two different chart libraries, both look different. What is the solution for this?

The chart should be free for commercial use.


4 options here :

  1. Use Google Chart. http://code.google.com/apis/chart/

  2. JQuery Chart. http://www.1stwebdesigner.com/css/top-jquery-chart-libraries-interactive-charts/

  3. Create Applet, use your JFreeChart and put it on the applet. Then provide the data from javascript to the applet. (If you really insist to make a very similar UI)

  4. On the servlet convert your chart to image, and store it in session. Later on, in your JSP, get the image from the session. check this link for the details. But this one won't exactly the same as option no 3.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号