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.
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:
Supported Events
Here is the complete list of supported events, made out as hyperlinks to the corresponding articles in JavaScript API Reference:
Name | Description |
---|---|
onAnnotationDeselect | This event is dispatched when an annotation looses focus. |
onAnnotationDrawingFinish | This event is dispatched when an annotation drawing initiated by startDrawingAnnotation() finishes. |
onAnnotationDrawingStart | This event is dispatched when startDrawingAnnotation() methods is used and drawing has successfully started. |
onAnnotationEditingFinish | This event is dispatched when a user has finished editing an annotation. |
onAnnotationEditingStart | This event is dispatched when a user has started editing an annotation. |
onAnnotationRemove | This event is dispatched when an annotation is removed using "Delete" key on a Windows system or "Fn + Backspace" on Mac. |
onAnnotationSelect | This event is dispatched when an annotation is selected. |
onChartCreate | This event is dispatched when the AnyChart Stock SWF file is loaded. |
onChartDataLoad | This event is dispatched when AnyChart Stock CSV data is loaded. |
onChartDraw | This event is dispatched when the AnyChart Stock is drawn. |
onChartMouseDown | This event is dispatched when the mouse button is pressed on the chart plotting area. |
onChartMouseMove | This event is dispatched when the mouse is moving over the chart plotting area. |
onChartMouseOut | This event is dispatched when the mouse leaves the chart plotting area. |
onChartMouseOver | This event is dispatched when the chart plotting area is hovered by the mouse. |
onChartMouseUp | This event is dispatched when the mouse button is released. |
onContextMenuCustomItemClick | This event is dispatched when the user clicks on the custom context menu item. |
onEventMarkerClick | This event is dispatched when the user clicks an event marker. |
onEventMarkerDeselect | This event is dispatched when an event marker is deselected. |
onEventMarkerDoubleClick | This event is dispatched when the user double clicks an event marker. |
onEventMarkerMouseOut | This event is dispatched when the mouse leaves an event marker. |
onEventMarkerMouseOver | This event is dispatched when an event marker is hovered by the mouse. |
onEventMarkerSelect | This event is dispatched when an event marker is selected. |
onGotData | This event is dispatched when chart settings are set and data is found. |
onMergedEventMarkerClick | This event is dispatched when the user clicks an event marker group. |
onMergedEventMarkerDeselect | This event is dispatched when a merged event marker group is deselected. |
onMergedEventMarkerDoubleClick | This event is dispatched when the user double clicks a merged event marker group. |
onMergedEventMarkerMouseOut | This event is dispatched when the mouse leaves a merged event marker group. |
onMergedEventMarkerMouseOver | This event is dispatched when the user hovers a merged event marker group. |
onMergedEventMarkerSelect | This event is dispatched when a merged event marker group is selected. |
onNoData | This event is dispatched when a chart settings are set and no data is found. |
onSelectedRangeChange | This event is dispatched when the selected range of the chart is changed. |