PDA

View Full Version : Pie Chart - Series onClick(), get a particular propert of ValueProvider



knil123rich
15 Dec 2011, 11:15 AM
Hi,
I having a Pie Chart displayed and its ValueProvider looks like this,

public interface DataPropertyAccess extends PropertyAccess<Data> {
ValueProvider<Data, Double> data1();


ValueProvider<Data, String> name();

@Path("name")
ModelKeyProvider<Data> nameKey();
}
The Label shown on the pie is "name". But on click I want to capture the data1() property of value provider.
How doI do this?

Regards.

BrendanC
21 Dec 2011, 1:55 PM
The Pie Renderer Chart example shows how to do this using the SeriesSelectionEvent. http://sencha.com/examples-dev/#ExamplePlace:pierendererchart

knil123rich
27 Dec 2011, 1:17 PM
Hi,
Thanks for your response. I took at look at the example in the link, but my problem is as follows:
Eg: Label displayed on the pie slice is say, person's Age, but on click I want to capture the person's Name or some other attribute of person.

Thanks & Regards.

BrendanC
10 Jan 2012, 12:00 PM
Using the Pie renderer example you would use the series item index from the event and get the name from the store.


series.addSeriesSelectionHandler(new SeriesSelectionHandler() {
@Override
public void onSeriesSelection(SeriesSelectionEvent event) {
Info.display("Click", dataAccess.name().getValue(store.get(event.getIndex())));
}
});