AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.axisMarkers.Range Improve this Doc

Extends: anychart.core.VisualBase

Range marker.

Methods Overview

Axes and Scales
axis()Axis settings.
scale()Scale settings.
scaleRangeMode()Scale range mode.
Coloring
fill()Fill settings.
Interactivity
enabled()Element state (enabled or disabled).
Size and Position
from()Starting range marker value.
isHorizontal()Whether a range marker has horizontal layout.
layout()Layout settings.
to()Ending range marker value.
zIndex()Z-index of the element.

Methods Description

axis

Getter for the range marker axis.

Returns:

anychart.core.axes.Linear - The range marker axis.
Setter for the range marker axis.

Params:

NameTypeDefaultDescription
axisanychart.core.axes.Linear
null
Axis instance to set.

Returns:

anychart.core.axisMarkers.Line - 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.Range - Self instance for method chaining.
Example.
if (!element.enabled())
   element.enabled(true);

fill

Getter for the range marker fill.

Returns:

anychart.graphics.vector.Fill - Range marker settings.
See listing
var rangeMarkerSettings = chart.rangeMarker();
var fill = rangeMarkerSettings.fill();
Setter for fill settings using an array, an object or a string. Learn more about coloring.

Params:

NameTypeDefaultDescription
coloranychart.graphics.vector.Fill | Array.<(anychart.graphics.vector.GradientKey|string)>
{color: '#c1c1c1', opacity: 0.4}
Color as an object, an array or a string.

Returns:

anychart.core.axisMarkers.Range - Self instance for method chaining.
Fill color with opacity. Fill as a string or an object.

Params:

NameTypeDefaultDescription
colorstring
'#c1c1c1'
Color as a string.
opacitynumber
0.4
Color opacity.

Returns:

anychart.core.axisMarkers.Range - Self instance for method chaining.
Linear gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Gradient keys.
anglenumberGradient angle.
modeboolean | anychart.graphics.vector.Rect | ObjectGradient mode.
opacitynumberGradient opacity.

Returns:

anychart.core.axisMarkers.Range - Self instance for method chaining.
Radial gradient fill. Learn more about coloring.

Params:

NameTypeDescription
keysArray.<(anychart.graphics.vector.GradientKey|string)>Color-stop gradient keys.
cxnumberX ratio of center radial gradient.
cynumberY ratio of center radial gradient.
modeanychart.graphics.math.RectIf defined then userSpaceOnUse mode, else objectBoundingBox.
opacitynumberOpacity of the gradient.
fxnumberX ratio of focal point.
fynumberY ratio of focal point.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

from

Getter for the starting range marker value.

Returns:

number - The starting range marker value.
See listing
var rangeMarkerSettings = chart.rangeMarker();
var startingValue = rangeMarkerSettings.from();
Setter for the starting range marker value.

Params:

NameTypeDefaultDescription
fromValuenumber
0
'From' value to set.

Returns:

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

isHorizontal

Whether a range marker has horizontal layout. Layout is define by anychart.core.axisMarkers.Range#layout method.

Returns:

boolean - Returns true if the range marker's layout is horizontal.

layout

Getter for the range marker layout.

Returns:

anychart.enums.Layout | string - The range marker layout.
Setter for the range marker layout.

Params:

NameTypeDefaultDescription
layoutanychart.enums.Layout | string
'horizontal'
Range marker layout.

Returns:

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

scale

Getter for the range marker scale.

Returns:

anychart.scales.Base - The range marker scale.
Setter for the range marker scale.

Params:

NameTypeDefaultDescription
settingsanychart.scales.Base | Object | anychart.enums.ScaleTypes | string
anychart.scales.Linear
Scale settings to set.

Returns:

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

scaleRangeMode

Getter for the scale range mode.

Returns:

string - Scale range mode.
See listing
var rangeMarker = chart.rangeMarker();
var scaleRangeMode = rangeMarker.scaleRangeMode();
Setter for the scale range mode.
Whether to consider the range marker value in the scale calculation or not. The 'consider' mode consideres the marker value in the scale.

Params:

NameTypeDefaultDescription
modestring | anychart.enums.ScaleRangeMode
'none'
Mode to set.

Returns:

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

to

Getter for the ending range marker value.

Returns:

number - The ending range marker value.
See listing
var rangeMarkerSettings = chart.rangeMarker();
var endingValue = rangeMarkerSettings.to();
Setter for the ending range marker value.

Params:

NameTypeDefaultDescription
toValuenumber
0
'To' value to set.

Returns:

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

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.Range - Self instance for method chaining.