PDA

View Full Version : Clickable PlotSeriesItem?


FlashBulb
05-23-2008, 08:25 PM
How can I get some information back when I click a PlotSeriesItem on my chart?

drkstr
05-23-2008, 11:54 PM
You can listen for an itemClick event on your PlotChart. ChartItemEvent.hitData.item is the data object for point that was clicked.

Best Regards,
~Aaron

FlashBulb
05-26-2008, 03:37 PM
I'm still getting the hang of Flex, can you tell me what's wrong here?

My chart's name is plotChart.

plotChart.addEventListener(ChartEvent.ITEM_CLICK, plotItemClicked);

private function plotItemClicked(e:ChartEvent):void{
trace("Data: " + e.hitData.item);
}

I get two errors:

1119: Access of possibly undefined property hitData through a reference with static type mx.charts.events:ChartEvent.

1119: Access of possibly undefined property ITEM_CLICK through a reference with static type Class.

drkstr
06-02-2008, 10:49 PM
Sorry for the late reply. I've been on vacation.

I believe you are supposed to use ChartItemEvent and not ChartEvent.


Best Regards,
~Aaron

FlashBulb
06-03-2008, 02:06 PM
Whoops, yeah, my bad. :rolleyes: Thanks again.