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:

Name Type Description
value number | anychart.core.axes.Linear Value to set.

Returns:

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

Try it:

enabled

Getter for the current element state (enabled or disabled).

Returns:

boolean - The current element state.

Try it:

Setter for the element enabled state.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

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

Try it:

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:

Name Type Default Description
index string | number
Label index.
value null | 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:

Name Type Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null Stroke settings.
thickness number Line thickness.
dashpattern string Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin Line join style.
lineCap anychart.graphics.vector.StrokeLineCap Line cap style.

Returns:

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

Try it:

label

Getter for the price indicator label.

Returns:

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

Params:

Name Type Default Description
index string | number
Label index.
value null | 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:

Name Type Default Description
type string
The event type id.
listener function
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 }.
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

listenOnce

Adds an event listener to an implementing object.

Params:

Name Type Default Description
type string
The event type id.
listener function
Callback method.
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

print

Prints all elements on related stage.

Params:

Name Type Default Description
paperSizeOrOptions anychart.graphics.vector.PaperSize | Object
Paper size or object with options.
landscape boolean
false
Flag of landscape.

Try it:

removeAllListeners

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

Params:

Name Type Description
type string Type of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

Try it:

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:

Name Type Default Description
index string | number
Label index.
value null | 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:

Name Type Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null Stroke settings.
thickness number Line thickness.
dashpattern string Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin Line join style.
lineCap anychart.graphics.vector.StrokeLineCap Line cap style.

Returns:

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

Try it:

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:

Name Type Description
value number | anychart.core.stock.series.Base Index or series instance.

Returns:

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

Try it:

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:

Name Type Description
value anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | null Stroke settings.
thickness number Line thickness.
dashpattern string Controls the pattern of dashes and gaps used to stroke paths.
lineJoin anychart.graphics.vector.StrokeLineJoin Line join style.
lineCap anychart.graphics.vector.StrokeLineCap Line cap style.

Returns:

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

Try it:

unlisten

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

Params:

Name Type Default Description
type string
The event type id.
listener function
Callback method.
useCapture boolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScope Object
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

Try it:

unlistenByKey

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

Params:

Name Type Description
key Object The key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

Try it:

value

Getter for the price indicator value.

Returns:

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

Params:

Name Type Default Description
value string | anychart.enums.PriceIndicatorDataSource | number | Date
"series-start"
Value to set.

Returns:

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

Try it:

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:

Name Type Description
value string Field name.

Returns:

string - Price indicator value field.

Try it:

zIndex

Getter for the current Z-index of the element.

Returns:

number - The current zIndex.

Try it:

Setter for the Z-index of the element.

Params:

Name Type Default Description
value number
0
Value to set.

Returns:

anychart.core.VisualBase - Self instance for method chaining.

Try it: