Learn how to a build a cloud-first strategyRegister Now


Generate PieChart 3D+ Struts

Posted on 2005-04-12
Medium Priority
Last Modified: 2010-04-01
      I am using JFree chart for generating piechart.I am using the method "ChartFactory.createPiechart3D". This is written in a utility class which returns me the buffered image object. Using a servlet, i call the method in the utility class and get the buffered image output in the servlet.
    Now, my servlet contains the buffered image output.
    All i have to do is transfer this image to a jsp inorder to display the piechart to the user.
 ( I have to include the servlet in my jsp)
   I 'll be very thankful to the person whomever is helping me out in this context.
Question by:ramsharma23
LVL 92

Accepted Solution

objects earned 1000 total points
ID: 13769806
Your servlet needs to encode the image as a byte stream (eg. a jpeg stream) and return that in the response stream

ImageIO.write(image, "jpeg", response.getOutputStream());
LVL 35

Assisted Solution

TimYates earned 1000 total points
ID: 13770391
>> All i have to do is transfer this image to a jsp inorder to display the piechart to the user.

Just use an IMG tag:

<IMG SRC="/YourServlet"/>

and the line objects gave you, and you're done :-)


Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
LinkedIn blogging is great for networking, building up an audience, and expanding your influence as well. However, if you want to achieve these results, you need to work really hard to make your post worth liking and sharing. Here are 4 tips that ca…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question