AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.standalones.axisMarkers.Range Improve this Doc

Extends: anychart.core.axisMarkers.Range

The Range class contains methods for configuring standalones range markers.

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.
parentBounds()Parent bounds for the range marker.
to()Ending range marker value.
zIndex()Z-index of the element.
Miscellaneous
container()Container for the range marker.
draw()Drawing of the range marker.

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.

container

Getter for the range marker container.

Returns:

anychart.graphics.vector.Layer | anychart.graphics.vector.Stage - The range marker container.
Setter for the range marker container.

Params:

NameTypeDescription
elementanychart.graphics.vector.Layer | anychart.graphics.vector.Stage | string | ElementThe value to set.

Returns:

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

draw

Drawing of the range marker.

Returns:

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

Params:

NameTypeDescription
imageSettingsanychart.graphics.vector.FillObject with settings.

Returns:

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

parentBounds

Getter for bounds.

Returns:

anychart.math.Rect - The range marker bounds.
Setter for bounds using single value.

Params:

NameTypeDescription
boundsanychart.math.Rect | Object | nullBounds to set

Returns:

anychart.standalones.axisMarkers.Range - Self instance for method chaining.
Setter for bounds using several values.

Params:

NameTypeDescription
leftnumberLeft space
topnumberTop space
widthnumberWidth line marker
heightnumberHeight line marker

Returns:

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