Adobe Flex 3 Data Visualization Developer Guide
In addition to the ChartEvent and ChartItemEvent classes, there is also the LegendMouseEvent. This class defines
events that are broadcast when the user clicks on legend items or mouses over them.
About chart events
Chart events are triggered when the user clicks or double-clicks the mouse button while the mouse pointer is over a
chart control, but not over a chart item in that chart control. These events are dispatched only if the hit data set is
Chart events are of type ChartEvent. Because ChartEvent events are part of the charts package, and not part of the
events package, you must import the appropriate classes in the package to use a ChartEvent event.
The following example logs a ChartEvent when you click or double-click the chart control, but only if you are not
over a chart item or within it’s range, as determined by its
mouseSensitivity property.
<?xml version="1.0"?>
<!-- charts/BasicChartEvent.mxml -->
<mx:Application xmlns:mx="">
import mx.collections.ArrayCollection;
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"January", Profit:2000, Expenses:1500, Amount:450},
{Month:"February", Profit:1000, Expenses:200, Amount:600},
{Month:"March", Profit:1500, Expenses:500, Amount:300},
{Month:"April", Profit:500, Expenses:300, Amount:500},
{Month:"May", Profit:1000, Expenses:450, Amount:250},
{Month:"June", Profit:2000, Expenses:500, Amount:700}
private function chartEventHandler(event:ChartEvent):void {
The ChartEvent will only be dispatched if the mouse is _not_ over a
chart item or if it is outside of the range defined by the
mouseSensitivity property.
ta1.text += "Event of type " + event.type + " was triggered.\n";
Panel {
<mx:Panel title="Chart click events">
<mx:PlotChart id="myChart"
Broadcast when the closest data point under the mouse pointer changes.
Broadcast when the user moves the mouse pointer over a new data point.
Chart data event type Description

Get ADOBE® FLEX® 3: ADVANCED DATA VISUALIZATION DEVELOPER GUIDE now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.