Drill Down feature for pie chart in Java
Hi,
I have a JSP where the graph displayed should have 慏rill Down?functionality i.e. when clicked on any sector of Pie chart it should come up with other graph giving more details.
I need the code or how to proceed to get drill down feature.
If anyone has idea about 慸rill down?or any sites which can help me please reply.
Thanks in advance.
Praveen.
> If anyone has idea about 慸rill down?or any sites
> which can help me please reply.
>
If you are willing to deploy a JApplet then you can implement this using JFreeChart (www.jfree.org) . It does not come with this feature 'out of the box' but it should not be too difficult to implement.
> I have to display the graph on JSP. I cannot use
> JFree Chart tool.
That is a good thing because using JFreeChart it is not as easy as I thought . I see no methods for converting a mouse click to a data index (or item).
Correction: It is easy! One just adds a ChartMouseListener to the ChartPanel and the value is available in the Entity property of the ChartMouseEvent .
Message was edited by:
sabre150
You have to generate the image and the surrounding HTML using two seperate transactions; typically a JSP delivers the HTML and a servlet, invoked by the SRC URL of an image tag, provides an image.
Your HTML contains a form, and the image is displayed using a <Input type="image" .. Clicking on that submits the forn, providing X and Y coordinates as parameters to a servlet which can calculate which pie-slice has been clicked. You can't use a client-side image map because there are no suitable sensitive shapes available.