class anychart.core.ui.ColorRange Improve this Doc
Extends: anychart.core.axes.Linear
Color range.
Methods Overview
Specific settings | |
drawFirstLabel() | Drawing of the first label. |
drawLastLabel() | Drawing of the last label. |
labels() | Labels settings. |
marker() | Marker settings. |
minorLabels() | Minor labels settings. |
minorTicks() | Minor ticks settings. |
overlapMode() | Overlap mode for labels. |
scale() | Scale settings. |
staggerLines() | Stagger lines. |
staggerMaxLines() | Maximum stagger lines. |
staggerMode() | Stagger mode state. |
ticks() | Ticks settings. |
title() | Title settings. |
Coloring | |
stroke() | Stroke settings. |
Interactivity | |
enabled() | Element state (enabled or disabled). |
Size and Position | |
align() | Align setting. |
colorLineSize() | Color line size. |
getPixelBounds() | Returns pixel bounds of the axis. |
getRemainingBounds() | Returns remaining parent bounds to use elsewhere. |
isHorizontal() | Whether an axis is horizontal. |
length() | Length setting. |
orientation() | Axis orientation. |
padding() | Padding settings. |
width() | Axis width. |
zIndex() | Z-index of the element. |
Methods Description
align
Returns:
anychart.enums.Align | string - Color range align.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
align | anychart.enums.Align | string | 'center' | Color range align. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
colorLineSize
Params:
Name | Type | Default | Description |
---|---|---|---|
size | number | 10 | Color line size to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chainingTry it:
drawFirstLabel
Returns:
boolean - Drawing flag.var yAxis = chart.yAxis(); var flag = yAxis.drawFirstLabel();
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
drawLastLabel
Returns:
boolean - Drawing flag.var yAxis = chart.yAxis(); var flag = yAxis.drawLastLabel();
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
enabled
Returns:
boolean - Element state.Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | Enabled state to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.if (!element.enabled()) element.enabled(true);
Try it:
getPixelBounds
getRemainingBounds
Returns:
anychart.math.Rect - Parent bounds without the space used by the axis.Try it:
isHorizontal
Returns:
boolean - Returns true if the axis is horizontal.Try it:
labels
- null/boolean - disable or enable axis labels.
- object - sets axis labels settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | true | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.length
Returns:
number | string - Color line length.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
length | string | number | '70%' | Color line length. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
marker
Returns:
anychart.core.ui.MarkersFactory.Marker - Color range marker.Try it:
Params:
Name | Type | Description |
---|---|---|
settings | anychart.core.ui.MarkersFactory.Marker | Object | Marker or marker settings. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
minorLabels
- null/boolean - disable or enable axis minor labels.
- object - sets axis minor labels settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | false | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.minorTicks
- null/boolean - disable or enable axis minor ticks.
- object - sets axis minor ticks settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | false | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.orientation
Returns:
anychart.enums.Orientation | string - Axis orientation.var yAxis = chart.yAxis(); var axisOrientation = yAxis.orientation();
Params:
Name | Type | Default | Description |
---|---|---|---|
orientation | anychart.enums.Orientation | string | 'top' | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
overlapMode
Returns:
anychart.enums.LabelsOverlapMode | string - Overlap mode.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
mode | anychart.enums.LabelsOverlapMode | string | 'noOverlap' | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
padding
Returns:
anychart.core.ui.table.Padding - Padding settings object.Try it:
Params:
Name | Type | Description |
---|---|---|
padding | null | Array.<(number|string)> | Object | Padding to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.// all paddings 15px colorRange.padding(15); // all paddings 15px colorRange.padding('15px'); // top and bottom 5px ,right and left 15px colorRange.padding(anychart.utils.padding(5,15));
Try it:
Params:
Name | Type | Description |
---|---|---|
value1 | string | number | Top or top-bottom space. |
value2 | string | number | Right or right-left space. |
value3 | string | number | Bottom space. |
value4 | string | number | Left space. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.// 1) top and bottom 10px, left and right 15px colorRange.cellPadding(10, '15px'); // 2) top 10px, left and right 15px, bottom 5px colorRange.cellPadding(10, '15px', 5); // 3) top 10px, right 15px, bottom 5px, left 12px colorRange.cellPadding(10, '15px', '5px', 12);
Try it:
scale
Returns:
anychart.scales.Base - Axis scale.var axis = chart.yAxis(); var axisScale = axis.scale();
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | anychart.scales.Base | Object | anychart.enums.ScaleTypes | string | anychart.scales.Linear | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
staggerLines
Returns:
number - Stagger line settings.var yAxis = chart.yAxis(); var lines = yAxis.staggerLines();
Note: pass null to enable autocalculation.
Params:
Name | Type | Default | Description |
---|---|---|---|
count | number | null | Count of stagger lines. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
staggerMaxLines
Returns:
number - Stagger line settings.var yAxis = chart.yAxis(); var maxLines = yAxis.staggerMaxLines();
Params:
Name | Type | Default | Description |
---|---|---|---|
count | number | null | 2 | Limits the number of lines to be used when drawing labels. If we need less - we use less, but never - more. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
staggerMode
Returns:
boolean - Stagger mode state.var yAxis = chart.yAxis(); var flag = yAxis.staggerMode();
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | true | On/off stagger mode. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
stroke
Returns:
anychart.graphics.vector.Stroke - Axis stroke settings.var yAxis = chart.yAxis(); var axisStroke = yAxis.stroke();
Params:
Name | Type | Default | Description |
---|---|---|---|
color | anychart.graphics.vector.Stroke | anychart.graphics.vector.ColoredFill | string | function | null | '#CECECE' | Stroke settings. |
thickness | number | 1 | 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.ui.ColorRange - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
settings | Object | Object with stroke settings from anychart.graphics.vector.Stroke |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
ticks
- null/boolean - disable or enable axis ticks.
- object - sets axis ticks settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | Object | boolean | null | true | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.title
- null/boolean - disable or enable axis title.
- string - sets axis title text value.
- object - sets axis title settings.
Params:
Name | Type | Default | Description |
---|---|---|---|
settings | null | boolean | Object | string | false | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.width
Returns:
number | string | null - Axis width.var yAxis = chart.yAxis(); var axisWidth = yAxis.width();
Params:
Name | Type | Default | Description |
---|---|---|---|
width | number | string | null | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it:
zIndex
Params:
Name | Type | Default | Description |
---|---|---|---|
zIndex | number | 0 | Value to set. |
Returns:
anychart.core.ui.ColorRange - Self instance for method chaining.Try it: