AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.axisMarkers.CurrentPriceIndicator Improve this Doc

Extends: anychart.core.VisualBase

Stock current price indicator class.

Methods Overview

Specific settings
value()Price indicator value.
valueField()Price indicator value field.
Axes and Scales
axis()Axis settings.
Coloring
fallingStroke()Falling stroke settings.
risingStroke()Rising stroke settings.
stroke()Stroke settings.
Events
listen()Adds an event listener
listenOnce()Adds a single time event listener
removeAllListeners()Removes all listeners
unlisten()Removes the listener
unlistenByKey()Removes the listener by the key
Export
print()Prints all elements.
Interactivity
enabled()Element state (enabled or disabled).
Markers elements
fallingLabel()Falling label settings.
label()Label settings.
risingLabel()Rising label settings.
Series
series()Target series for a price indicator.
Size and Position
zIndex()Z-index of the element.

Methods Description

axis

Getter for the target axis.

Returns:

anychart.core.axes.Linear - Axis instance.
See listing
var priceIndicator = plot.priceIndicator();
var axis = priceIndicator.axis();
Setter for the target axis.

Params:

NameTypeDescription
indexOrAxisnumber | anychart.core.axes.LinearAxis index or axis instance to set.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

enabled

Getter for the element state (enabled or disabled).

Returns:

boolean - Element state.
Setter for the element enabled state.

Params:

NameTypeDefaultDescription
enabledboolean
true
Enabled state to set.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

fallingLabel

Getter for the price indicator falling label.

Returns:

anychart.core.ui.Label - Label instance.
See listing
var priceIndicator = plot.priceIndicator();
var fallingLabel = priceIndicator.fallingLabel();
Setter for the price indicator falling label.

Params:

NameTypeDefaultDescription
indexstring | number
Label index.
settingsnull | boolean | Object
true
Label settings.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

fallingStroke

Getter for the price indicator falling stroke.

Returns:

anychart.graphics.vector.Stroke - Falling stroke settings.
See listing
var priceIndicator = plot.priceIndicator();
var fallingStroke = priceIndicator.fallingStroke();
Setter for the price indicator falling stroke.

Params:

NameTypeDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | nullStroke settings.
thicknessnumberLine thickness.
dashpatternstringControls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoinLine join style.
lineCapstring | anychart.graphics.vector.StrokeLineCapLine cap style.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.
Setter for falling stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

label

Getter for the price indicator label.

Returns:

anychart.core.ui.LabelsFactory - Labels factory instance.
See listing
var priceIndicator = plot.priceIndicator();
var label = priceIndicator.label();
Setter for the price indicator label.

Params:

NameTypeDefaultDescription
indexstring | number
Label index.
settingsnull | boolean | Object
true
Label settings.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
Callback method. Function that looks like:
function(event){
   // event.actualTarget - actual event target
   // event.currentTarget - current event target
   // event.iterator - event iterator
   // event.originalEvent - original event
   // event.point - event point
   // event.pointIndex - event point index
}
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

print

Prints all elements on related stage.

Params:

NameTypeDefaultDescription
paperSizeOrOptionsanychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscapeboolean
false
Flag of landscape.

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

risingLabel

Getter for the price indicator rising label.

Returns:

anychart.core.ui.Label - Label instance.
See listing
var priceIndicator = plot.priceIndicator();
var risingLabel = priceIndicator.risingLabel();
Setter for the price indicator rising label.

Params:

NameTypeDefaultDescription
indexstring | number
Label index.
settingsnull | boolean | Object
true
Label settings.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

risingStroke

Getter for the price indicator rising stroke.

Returns:

anychart.graphics.vector.Stroke - Rising stroke settings.
See listing
var priceIndicator = plot.priceIndicator();
var risingStroke = priceIndicator.risingStroke();
Setter for the price indicator rising stroke.

Params:

NameTypeDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | nullStroke settings.
thicknessnumberLine thickness.
dashpatternstringControls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoinLine join style.
lineCapstring | anychart.graphics.vector.StrokeLineCapLine cap style.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.
Setter for rising stroke using an object.

Params:

NameTypeDescription
settingsObjectStroke settings from anychart.graphics.vector.Stroke.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

series

Getter for the target series.

Returns:

anychart.core.stock.series.Base - Series instance.
See listing
var priceIndicator = plot.priceIndicator();
var series = priceIndicator.series();
Setter for the target series.

Params:

NameTypeDescription
indexOrSeriesnumber | anychart.core.stock.series.BaseIndex or series instance.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

stroke

Getter for the price indicator stroke.

Returns:

anychart.graphics.vector.Stroke - Stroke settings.
See listing
var priceIndicator = plot.priceIndicator();
var stroke = priceIndicator.stroke();
Setter for the price indicator stroke. Learn more about stroke settings.

Params:

NameTypeDescription
coloranychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | nullStroke settings.
thicknessnumberLine thickness.
dashpatternstringControls the pattern of dashes and gaps used to stroke paths.
lineJoinstring | anychart.graphics.vector.StrokeLineJoinLine join style.
lineCapstring | anychart.graphics.vector.StrokeLineCapLine cap style.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.
Setter for price indicator stroke settings using an object.

Params:

NameTypeDescription
settingsObjectObject with stroke settings from anychart.graphics.vector.Stroke

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object):boolean|undefined
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

value

Getter for the price indicator value.

Returns:

anychart.enums.PriceIndicatorDataSource | string | number | Date - Price indicator value.
See listing
var priceIndicator = plot.priceIndicator();
var value = priceIndicator.value();
Setter for the stock price indicator.

Params:

NameTypeDefaultDescription
valueanychart.enums.PriceIndicatorDataSource | string | number | Date
'series-start'
Value to set.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.

valueField

Getter for the price indicator value field.

Returns:

string - Price indicator value field.
See listing
var priceIndicator = plot.priceIndicator();
var valueField = priceIndicator.valueField();
Setter for the price indicator value field.
valueField() method use with anychart.core.axisMarkers.CurrentPriceIndicator#value method. This method sets the field to be used as the value for the price indicator

Params:

NameTypeDescription
fieldNamestringField name from data.

Returns:

string - Price indicator value field.

zIndex

Getter for the Z-index of the element.

Returns:

number - Z-index.
Setter for the Z-index of the element.

Params:

NameTypeDefaultDescription
zIndexnumber
0
Value to set.

Returns:

anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.