Clickable Chart


i have pie chart, , want clickable, use click event

click="onclick(event)"

the problem not give me access hitdata

for example if want toop tip function, can following

private function formatdatatip(hitdata:hitdata):string
{
// here have access hit data
}

using datatipfunction="formatdatatip"

how can access hit data when user click'

thanks

kasem

here example hitdata click on pie chart:

<mx:piechart dataprovider="{piedata}" itemclick="chart_click(event)">
<mx:series>
<mx:pieseries field="orders" namefield="flavor" labelposition="callout"/>
</mx:series>
</mx:piechart>

import mx.collections.arraycollection;
[bindable]
public var piedata:arraycollection = new arraycollection([
{flavor: "apple", orders: 100},
{flavor: "banana", orders: 200},
{flavor: "lemon", orders: 300} ]);
import mx.charts.events.chartitemevent;
import mx.charts.hitdata;
public function chart_click(evt:chartitemevent):void {
trace(evt.hitdata.item.flavor);
trace(evt.hitdata.item.orders);
}

vygo


More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Thread: PKI Client 5.00 install (for eToken Pro)

ATmega2560-Arduino Pin Mapping

Crossfader Arduino Tutorial