<?xml version="1.0"?> <!-- charts/DataPointAlert.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"> <mx:Script> <!--[CDATA[ import mx.controls.Alert; import mx.charts.events.ChartItemEvent; import mx.collections.ArrayCollection; [Bindable] public var dataSet:ArrayCollection=new ArrayCollection([{Month: "Jan", Expenses: 1500}, {Month: "Feb", Expenses: 200}, {Month: "Mar", Expenses: 500}]); public function myHandler(e:ChartItemEvent):void { Alert.show("Chart data was clicked"); } ]]--> </mx:Script> <mx:Panel title="Clickable Column Chart"> <mx:ColumnChart id="myChart" itemClick="myHandler(event)" dataProvider="{dataSet}"> <mx:horizontalAxis> <mx:CategoryAxis dataProvider="{dataSet}" categoryField="Month"/> </mx:horizontalAxis> <mx:series> <mx:ColumnSeries yField="Expenses" displayName="Expenses"/> </mx:series> </mx:ColumnChart> <mx:Legend dataProvider="{myChart}"/> </mx:Panel> </mx:Application>