File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Pie Charts inJSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Pie Charts inJSP" Watch "Pie Charts inJSP" New topic

Pie Charts inJSP

shruti lodha

Joined: Nov 21, 2007
Posts: 2
Hi Friends,

I need to make a Pie Chart in JSP without using any 3rd party softwares.
Can someone please help me out?
Also can sumone please suggest where can i find sample codes for the same.
Thanks in advance!
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

JSPs usually generate HTML, so you will have to make do with what HTML can do. That would either be embedded SVG (which severely limits your audience, as SVG is not widely supported by current browsers) or an embedded image.

Libraries like JFreeChart and the cewolf JSP tag library based on it (links can be found here) make it very easy to do this. Why don't you want to use those libraries? You'd just be duplicating work already done.
shruti lodha

Joined: Nov 21, 2007
Posts: 2
But for using JFreeChart i will have to add external libraries to my code .Right?
I am not very sure if that is a possiblility.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410


There is nothing built into JSP for generating pie charts so, as Ulf mentioned, you'll either need to write a lot of code that can generate images yourself or use third party libraries.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: Pie Charts inJSP
It's not a secret anymore!