Events Handling

Overview

The AnyChart Stock component supports over 30 different types of events for for all occasions. These events can be obtained from the component and then handled with the AnyChartStock class, an object of which is bound to the Flash Player when embedding a chart in a page.

to top

Event Handling Technique

For each event, the AnyChartStock class has a special property, which is also a link to the event handler function. Event handlers can be set inline or by setting the handler function name to the corresponding property.

Here is a sample demonstrating declaring onChartDraw event handler inline:

A sample demonstrating the use of a stand-alone function as the onChartDraw event handler:

Follow the links below to familiarize yourself with a custom sample that uses an event handler:

Online HTML/JavaScript Sample

to top

Supported Events

Here is the complete list of supported events, made out as hyperlinks to the corresponding articles in JavaScript API Reference:

Name Description
onAnnotationDeselectThis event is dispatched when an annotation looses focus.
onAnnotationDrawingFinishThis event is dispatched when an annotation drawing initiated by startDrawingAnnotation() finishes.
onAnnotationDrawingStartThis event is dispatched when startDrawingAnnotation() methods is used and drawing has successfully started.
onAnnotationEditingFinishThis event is dispatched when a user has finished editing an annotation.
onAnnotationEditingStartThis event is dispatched when a user has started editing an annotation.
onAnnotationRemoveThis event is dispatched when an annotation is removed using "Delete" key on a Windows system or "Fn + Backspace" on Mac.
onAnnotationSelectThis event is dispatched when an annotation is selected.
onChartCreateThis event is dispatched when the AnyChart Stock SWF file is loaded.
onChartDataLoadThis event is dispatched when AnyChart Stock CSV data is loaded.
onChartDrawThis event is dispatched when the AnyChart Stock is drawn.
onChartMouseDownThis event is dispatched when the mouse button is pressed on the chart plotting area.
onChartMouseMoveThis event is dispatched when the mouse is moving over the chart plotting area.
onChartMouseOutThis event is dispatched when the mouse leaves the chart plotting area.
onChartMouseOverThis event is dispatched when the chart plotting area is hovered by the mouse.
onChartMouseUpThis event is dispatched when the mouse button is released.
onContextMenuCustomItemClickThis event is dispatched when the user clicks on the custom context menu item.
onEventMarkerClickThis event is dispatched when the user clicks an event marker.
onEventMarkerDeselectThis event is dispatched when an event marker is deselected.
onEventMarkerDoubleClickThis event is dispatched when the user double clicks an event marker.
onEventMarkerMouseOutThis event is dispatched when the mouse leaves an event marker.
onEventMarkerMouseOverThis event is dispatched when an event marker is hovered by the mouse.
onEventMarkerSelectThis event is dispatched when an event marker is selected.
onGotDataThis event is dispatched when chart settings are set and data is found.
onMergedEventMarkerClickThis event is dispatched when the user clicks an event marker group.
onMergedEventMarkerDeselectThis event is dispatched when a merged event marker group is deselected.
onMergedEventMarkerDoubleClickThis event is dispatched when the user double clicks a merged event marker group.
onMergedEventMarkerMouseOutThis event is dispatched when the mouse leaves a merged event marker group.
onMergedEventMarkerMouseOverThis event is dispatched when the user hovers a merged event marker group.
onMergedEventMarkerSelectThis event is dispatched when a merged event marker group is selected.
onNoDataThis event is dispatched when a chart settings are set and no data is found.
onSelectedRangeChangeThis event is dispatched when the selected range of the chart is changed.

to top