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. |
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 |
---|---|---|
indexOrAxis | number | anychart.core.axes.Linear | Axis index or axis instance to set. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
enabled
Getter for the element state (enabled or disabled).
Returns:
boolean - Element state.Try it:
Setter for the element enabled state.
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - 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.
Detailed description
Falling label is set to the falling value of the price indicator. When falling label is not set,
the price indicator uses anychart.core.axisMarkers.CurrentPriceIndicator#label value.
Sets price indicator label settings by index depending on parameter type:
- null/boolean - disable or enable price indicator label.
- object - sets chart label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | string | number | Label index. | |
settings | 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.
Detailed description
Falling stroke is set to the falling value of the price indicator. When falling stroke is not
set, the price indicator uses anychart.core.axisMarkers.CurrentPriceIndicator#stroke value.
Learn more about stroke settings.
Params:
Name | Type | Description |
---|---|---|
color | 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 | string | anychart.graphics.vector.StrokeLineJoin | Line join style. |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
Setter for falling stroke using an object.
Params:
Name | Type | Description |
---|---|---|
settings | Object | Stroke settings from anychart.graphics.vector.Stroke. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
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.
Detailed description
Sets price indicator label settings by index depending on parameter type:
- null/boolean - disable or enable price indicator label.
- object - sets chart label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | string | number | Label index. | |
settings | null | boolean | Object | true | Label settings. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.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.
Detailed description
Rising label is set to the rising value of the price indicator. When rising label is not set,
the price indicator uses anychart.core.axisMarkers.CurrentPriceIndicator#label value.
Sets price indicator label settings by index depending on parameter type:
- null/boolean - disable or enable price indicator label.
- object - sets chart label settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
index | string | number | Label index. | |
settings | 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.
Detailed description
Rising stroke is set to the rising value of the price indicator.
When rising stroke is not set, the price indicator uses anychart.core.axisMarkers.CurrentPriceIndicator#stroke value.
Learn more about stroke settings.
Params:
Name | Type | Description |
---|---|---|
color | 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 | string | anychart.graphics.vector.StrokeLineJoin | Line join style. |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
Setter for rising stroke using an object.
Params:
Name | Type | Description |
---|---|---|
settings | Object | Stroke settings from anychart.graphics.vector.Stroke. |
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 |
---|---|---|
indexOrSeries | 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 |
---|---|---|
color | 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 | string | anychart.graphics.vector.StrokeLineJoin | Line join style. |
lineCap | string | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
Setter for price indicator stroke settings using an object.
Params:
Name | Type | Description |
---|---|---|
settings | Object | Object with stroke settings from anychart.graphics.vector.Stroke |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it:
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:
Name | Type | Default | Description |
---|---|---|---|
value | anychart.enums.PriceIndicatorDataSource | string | 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
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 |
---|---|---|
fieldName | string | Field name from data. |
Returns:
string - Price indicator value field.Try it:
zIndex
Setter for the Z-index of the element.
Detailed description
The bigger the index - the higher the element position is.
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.axisMarkers.CurrentPriceIndicator - Self instance for method chaining.Try it: