gslender / ofcgwt

Automatically exported from code.google.com/p/ofcgwt
0 stars 0 forks source link

How to get the name of Slice clicked on PieChart? #47

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Grant,

     First of all, Thanks for coming up with ofcgwt. Its great. 

I am making use ofcgwt PieChart for my system.
The piechart gets built dynamically from a hashmap of name-value pairs 
(Integer value, String text). When I click on a Slice, the piechart should 
drill down to another piechart. Its different from Events demo that all 
the slices get built with dynamic values. How can I find out the name of 
the Slice that I clicked?  The addOnClickListener doesnt have a param like 
(Sender widget). 

      while(it.hasNext()) {
            sliceName = (String) it.next();             
            sliceValue = (String) map.get(sliceName);      

            slice = new Slice(new Integer(sliceValue),sliceName);

            slice.addOnClickListener(chart, new IOnClickListener(){
            public void handleOnClickEvent() {
                Window.alert("You clicked slice named = " + 
HOW_TO_DO_THIS);
            // draw new pie chart layer based on the slice 
clicked
                }
            });
      }

I am using ofcgwt-release-1.2 and gwt-windows-1.5.3

Thanks,
Jes

Original issue reported on code.google.com by kolukat...@gmail.com on 4 Jun 2009 at 1:54

GoogleCodeExporter commented 9 years ago
Use version 2.x of OFCGWT

Original comment by gslen...@gmail.com on 11 Jun 2009 at 9:02

GoogleCodeExporter commented 9 years ago
I am working on pie chart and I am also facing this issue. I am using 
ofcgwt-2.0.1 beta.zip. Is this resolved ?

Original comment by rohit.sa...@gmail.com on 6 Jan 2012 at 4:28