Generate PieChart 3D+ Struts

Posted on 2005-04-12
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

    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

    >> 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 :-)


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Suggested Solutions

    Title # Comments Views Activity
    When Does RestAdapter establishes HttpConnection 5 176
    Stuck in Bootstrap WysiHtml Editor 3 32
    Lamba in java 8 9 219
    getting param value 7 48
    After several days of searching and hunting for limited documentation, I wanted to share this guide to hopefully save someone the hassle of trying to figure this out on their own. I have tested this on Xendesktop 7.1 and PS 4.5 running simultaneous…
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now