JavaScript API Reference

Overview

AnyChart Stock JavaScript Library is created to make AnyChart Stock charts embedding easier and provide a lot of interactivity options that make AnyChart Stock Component suitable for Rich Internet Applications (RIA) development

Constructor

AnyChartStock instance constructor

Name Description
AnyChartStockCreates new AnyChartStock instance.

to top

Static properties

AnyChartStock static properties

Name Description
enableFirefoxPrintPreviewFixEnables Firefox print preview fix in all charts.
heightDefault chart height in pixels ("px" postfix, e.g. "300px") or container width percent ("%" postfix, e.g. "80%").
messagesHolds the table with default auxiliary chart texts.
needConfigDefines whether the access to full chart configuration object model is required.
platformStores information about end users OS, browser and Flash Player version.
preloaderSWFFileDefault path to Preloader.swf file for all charts on the page.
resizingDefault resizing settings for all charts.
swfFileDefault path to AnyChartStock.swf file for all charts on the page.
widthDefault chart width in pixels ("px" postfix, e.g. "300px") or container width percent ("%" postfix, e.g. "80%").

to top

Properties

AnyChartStock instance properties

Name Description
bgColorFlash movie background color.
enableFirefoxPrintPreviewFixEnables Firefox print preview fix.
enablePreloaderTurns component messages about configuration and data loading on or off.
flashObjectLink to a created Flash DOM object, that is used to show charts.
heightChart height in pixels ("px" postfix, e.g. "300px") or container height percent ("%" postfix, e.g. "80%").
jsonFileSets chart JSON configuration file path.
messagesHolds the table with auxiliary chart texts.
needConfigDefines whether the access to full chart configuration object model is required.
objectModelGets chart configuration as an Object.
preloaderSWFFilePath to Preloader.swf file.
resizingChart resizing settings.
swfFilePath to AnyChartStock swf file.
targetLink to a chart container DOM object.
visibleSets chart visibility.
widthChart width in pixels ("px" postfix, e.g. "300px") or container width percent ("%" postfix, e.g. "80%").
wModeSets the Window Mode property of the Flash movie for transparency, layering, and positioning in the browser.
xmlFileSets chart XML configuration file path.

to top

Methods

AnyChartStock instance methods

Name Description
addAnnotationAdds new annotation to the chart.
This function can be called only onChartDraw event has been fired, if you call addAnnotation prior to that - no annotation is added.
addEventMarkerAdds new event marker to the specified group.
addEventMarkerGroupAdds new event marker group.
appendDataAppends data to the chart.
applyConfigChangesCommits changes made to the objectModel.
applyEventMarkersChangesCommits changes made to eventMarkers element of the objectModel.
applySettingsChangesCommits changes made to settings element of the objectModel.
clearEventsRemoves all event listeners.
commitDataChangesCommits data appends and data points erasure made by appendData(), removeDataRow() and removeDataRange() method calls.
commitEventMarkersChangesCommits all changes made to event markers by addEventMarker(), removeEventMarker(), addEventMarkerGroup(), removeEventMarkerGroup() method calls.
deselectAnnotationDeselects the annotation, that is currently selected.
disableInteractivityDisables chart interactivity.
disposeRemoves all HTML DOM and JavaScript references to the chart.
enableInteractivityEnables chart interactivity, if it is disabled by disableInteractivity() method.
exportAsInteractivePDFExports the chart as an Interactive PDF document.
exportAsJPGExports the chart as a JPG image.
exportAsPDFExports the chart as PDF document.
exportAsPNGExports the chart as PNG image
getAnnotationAsJSONReturns annotation as an object. Object type is: annotation.
getAnnotationAsXMLReturns annotation as XML. XML is formatted as <annotation> node.
getAnnotationListAsJSONReturns an array with objects of annotation type, which contains all annotations in all charts.
getAnnotationListAsXMLReturns an XML string with all annotations. XML of annotations is formatted as <annotation_list> node.
getChartByIdReturns link to a chart object in the objectModel.
getCurrentDataGroupingIntervalGets current data grouping information.
getCurrentYAxisInfoRetrieves info about current Y axis scale maximum, minimum and interval.
getDataSetCSVGets dataset values as CSV with custom columns order and timestamp format.
getEventMarkerByIdReturns the link to event marker object.
getEventMarkersGroupByIdReturns the link to event marker group object.
getFirstDateGets the first date of all used by visible series data sources.
getFirstVisibleDateGets the first visible date.
getInteractivePDFBase64EncodedGets base64 encoded Interactive PDF document with embedded chart.
getJPGImageBase64EncodedGets a chart screenshot as the base64 encoded JPG image.
getLastDateGets the last date from all mapped and used by visible series data sources.
getLastVisibleDateGets the last visible date.
getPDFBase64EncodedGets a chart screenshot as a base64 encoded PDF document.
getPNGImageBase64EncodedGets a chart screenshot as a base64 encoded PNG image.
getSelectedAnnotationIdReturns id of the selected annotation.
getSeriesByIdGets series object from the object model by its id.
getSeriesCloseValueGets info about "close" field of the series.
getSeriesCustomValueGets information about custom field of the series.
getSeriesHighValueGets info about "high" field of the series.
getSeriesLowValueGets info about "low" field of the series.
getSeriesOpenValueGets info about "open" field of the series.
getSeriesPercentValueChangeGets info about a percent change of "value" (or "close" field, if "value" field is not specified) series field values.
getSeriesValueGets info about "value" (or "close" field, if "value" field is not specified) series field.
getSeriesValueChangeGets info about a change of "value" (or "close" field, if "value" field is not specified) series field values.
getTechIndicatorByIdGets the link to technical indicator object by its id.
getTechnicalIndicatorValueGets info about technical indicator value.
hideHides chart Flash movie.
hideEventMarkerHides event marker.
hideEventMarkerGroupHides event markers group.
hideOverlayMessageHides chart overlay message, shown by showOverlayMessage() method. Also can hide noDataText message set in AnyChartStock.messages or in instance messages property.
hideWaitingStateHides chart "waiting" state, initiated by showWaitingState() method.
printChartShows chart printing dialog.
removeAllAnnotationsRemoves all annotations from all charts.
removeAnnotationRemoves an annotation from the chart.
removeDataRangeRemoves data range from a data set by the range of dates.
removeDataRowRemoves data row from a data set by its date.
removeEventMarkerRemoves event marker.
removeEventMarkerGroupRemoves event marker group by its id.
removeFlashObjectRemoves AnyChart Stock Flash Object from HTML DOM.
resetEventMarkerSelectionResets event marker selection in a specified chart.
scrollToScrolls the chart to a given date.
selectAnnotationSelects an annotation with the given id.
selectEventMarkerSelects an event marker by its id and its group id.
selectRangeSelects a dates range.
setAnnotationListSets new annotation list to the chart, replacing all that are on the charts at the moment. Can be called only after onChartDraw event is fired.
setConfigUpdates chart configuration.
setEventMarkersUpdates chart event markers.
setJSONFileSets chart JSON configuration file path.
setSettingsUpdates chart visual settings.
setSizeSets chart size.
setXMLFileSets chart XML configuration file path.
showShows chart movie, if it is hidden using hide() method.
showEventMarkerShows event marker.
showEventMarkerGroupShows event markers group.
showOverlayMessageDisplays "Waiting..." or any other message over the chart.
showWaitingStateDisplays "Waiting..." or any other message over the chart.
startDrawingAnnotationStarts drawing annotation of a given type.
stopDrawingAnnotationEnds drawing mode started by startDrawingAnnotation() method.
updateAnnotationUpdates the settings of the annotation with the given id.
updateEventMarkerUpdates event marker visual settings.
updatePrintForFirefoxUpdates Firefox print preview to current chart state.
writeAdds the chart to HTML DOM as a child of the specified container.
zoomToZooms the chart to a custom range.

to top

Events

AnyChartStock instance events

Name Description
onAnnotationDeselectThis event is dispatched when an annotation looses focus.
onAnnotationDrawingFinishThis event is dispatched when an annotation drawing initiated by startDrawingAnnotation() finishes.
onAnnotationDrawingProgressThis event is fired repeatedly when annotation drawing started with startAnnotationDrawing() call progresses. Mouse coordinates, passed to event handler may become NaN, when the cursor leaves plot area.
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.
onAnnotationEditingProgressThis event is fired repeatedly when annotation editing progresses.
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