ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  clickable multiple pie chart
Posted by minh on May-03-2013 04:03
Hello,
   I am workingh with pie chart and i wonder if i could have clickable pie chart on Java. Please give me some advice if you happen to know the answer.

Thanks!!

Minh

  Re: clickable multiple pie chart
Posted by Peter Kwan on May-04-2013 01:53
Hi minh,

ChartDirector for JSP/Java includes sample code for both desktop applications (in Java SWING) and web applications (in JSP). The SWING sample code are all clickable. When you click on it, it will pop up a message box displaying the item that you have picked. For the JSP sample code, when the mouse is over the slice, it will pop up a box displaying more information about the slice. You can make it clickable by providing a URL in the getHTMLImageMap method. For example, in the "Simple Pie Chart" sample code, instead of using

String imageMap1 = c.getHTMLImageMap("", "", "title='{label}: US${value}K ({percent}%)'");

you may use:

String imageMap1 = c.getHTMLImageMap("aaa.jsp", "", "title='{label}: US${value}K ({percent}%)'");

In this case, when the user clicks on a slice in the pie chart, it will jump to the URL "aaa.jsp". The slice acts like a link. There will be query parameters included so that the script "aaa.jsp" can know which slice has been clicked.

There is also a complete example in the "Clickable Charts" section of the ChartDirector for JSP/Java documentation:

http://www.advsofteng.com/doc/cdjava.htm#simpleclickable.htm

Hope this can help.

Regards
Peter Kwan