Information on this website refers to a deprecated product, and is provided only for historical reference. Please use the Version Switcher above to select an appropriate documentation website for the product you are using.

AmStockChart

Type class

AmStockChart is a main class Stock chart.

Inheritance

AmStockChart does not extend any other symbol.

AmStockChart is not extended by any other symbol.

Properties

animationPlayed
#

Type boolean

Default

Specifies if animation was already played. Animation is only played once, when chart is rendered for the first time. If you want the animation to be repeated, set this property to false.

balloon
#

Type AmBalloon

Default instance of AmBalloon

Balloon object.

categoryAxesSettings
#

Type CategoryAxesSettings

Default

Settings for category axes.

chartCreated
#

Type boolean

Indicates if the chart is created.

chartCursorSettings
#

Type ChartCursorSettings

Default

Chart cursor settings.

chartScrollbarSettings
#

Type ChartScrollbarSettings

Default

Chart scrollbar settings.

colors
#

Type array

Default "#FF6600",
"#FCD202",
"#B0DE09",
"#0D8ECF",
"#2A0CD0",
"#CD0D74",
"#CC0000",
"#00CC00",
"#0000CC",
"#DDDDDD",
"#999999",
"#333333",
"#990000"

Array of colors used by data sets if no color was set explicitly on data set itself.

comparedDataSets
#

Type array

Default

Array of data sets selected for comparing.

dataSets
#

Type array

Default

Array of DataSets.

dataSetSelector
#

Type DataSetSelector

Default

DataSetSelector object. You can add it if you have more than one data set and want users to be able to select/compare them.

endDate
#

Type Date

Default

Current end date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method.

firstDayOfWeek
#

Type number

Default 1

Defines on which day week starts. 0 - Sunday, 1 - Monday...

glueToTheEnd
#

Type boolean

Default false

If set to true the scope of the data view will be set to the end after data update.

legendSettings
#

Type LegendSettings

Default

Legend settings.

mainDataSet
#

Type DataSet

Default

Data set selected as main.

panels
#

Type array

Default

Array of StockPanels (charts).

panelsSettings
#

Type PanelsSettings

Default

Settings for stock panels.

periodSelector
#

Type PeriodSelector

Default

Period selector object. You can add it if you want user's to be able to enter date ranges or zoom chart with predefined period buttons.

scrollbarChart
#

Type AmSerialChart

Default instance of AmSerialChart

Scrollbar's chart object, get only.

startDate
#

Type Date

Default

Current start date of the selected period, get only. To set start/end dates, use stockChart.zoom(startDate, endDate) method.

stockEventsSettings
#

Type StockEventsSettings

Default

Settings for stock events.

valueAxesSettings
#

Type ValueAxesSettings

Default

Settings for value axes.

version
#

Type string

Default

read-only. Indicates current version of a script.

zoomOutOnDataSetChange
#

Type boolean

Default false

Specifies whether the chart should zoom-out when main data set is changed.

Methods

addListener(
  type,
  handler
)

#

Returns Adds event listener to the object.

type - string like 'dataUpdated' (should be listed in 'events' section of this class). handler - function which is called when event happens

addPanel(
  panel
)

#

Returns Adds panel to the stock chart. Requires stockChart.validateNow() method to be called after this action.

panel - [[StockPanel]]

addPanelAt(
  panel,
  index
)

#

Returns Adds panel to the stock chart at a specified index. Requires stockChart.validateNow() method to be called after this action.

panel - [[StockPanel]], index - Number

clear()

#

Returns void

Destroys chart, all timeouts and listeners.

hideStockEvents()

#

Returns Hides event bullets.

removeListener(
  obj,
  type,
  handler
)

#

Returns Removes event listener from the object.

removePanel(
  panel
)

#

Returns Removes panel from the stock chart. Requires stockChart.validateNow() method to be called after this action.

panel - [[StockPanel]]

showStockEvents()

#

Returns Shows event bullets.

validateData()

#

Returns Method which should be called after data was changed.

validateNow()

#

Returns Method which forces the stock chart to rebuild. Should be called after properties are changed.

zoom(
  startDate,
  endDate
)

#

Returns Zooms chart to specified dates.

startDate, endDate - Date objects.

zoomOut()

#

Returns Zooms out the chart.

Events

#clickStockEvent

Param {type:"clickStockEvent", eventObject:eventObject, graph:graph, date:date, chart:AmStockChart}

Dispatched when the user clicks on the Stock event (bullet).

#dataUpdated

Param {type:"dataUpdated", chart:AmStockChart}

Dispatched when the chart was updated with new data.

#init

Param {type:"init", chart:AmStockChart}

Dispatched when the chart is initialized for the first time. In case you want it to fire again after validateNow() method is called, set chart.chartCreated = false.

#panelRemoved

Param {type:"panelRemoved", panel:panel, chart:AmStockChart}

Dispatched when the StockPanel is removed.

#rendered

Param {type:"init", chart:AmStockChart}

Dispatched each when chart is rendered.

#rollOutStockEvent

Param {type:"rollOutStockEvent", eventObject:eventObject, graph:graph, date:date, chart:AmStockChart}

Dispatched when the user rolls-out of the Stock event (bullet).

#rollOverStockEvent

Param {type:"rollOverStockEvent", eventObject:eventObject, graph:graph, date:date, chart:AmStockChart}

Dispatched when the user rolls-over the Stock event (bullet).

#zoomed

Param {type:"zoomed", startDate:startDate, endDate:endDate, period:period, chart:AmStockChart}

Dispatched when the chart is zoomed (even for the first time, when chart is initialized).

Adapters

AmStockChart does not have any adapters.