class anychart.standalones.ColorRange Improve this Doc
Extends: anychart.core.ui.ColorRange
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. |
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). |
Size and Position | |
align() | Align setting. |
colorLineSize() | Color line size. |
getRemainingBounds() | Returns remaining parent bounds to use elsewhere. |
isHorizontal() | Whether an axis is horizontal. |
length() | Length setting. |
orientation() | Axis orientation. |
padding() | Padding settings. |
parentBounds() | Parent bounds settings. |
width() | Axis width. |
zIndex() | Z-index of the element. |
Miscellaneous | |
container() | Getter for the color range container. |
draw() | Draw color range. |
Methods Description
align
Params:
Name | Type | Default | Description |
---|---|---|---|
value | anychart.enums.Align | string | "center" | Color range align. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
colorLineSize
Returns:
number - The color line size.var size = colorRange.colorLineSize
Params:
Name | Type | Default | Description |
---|---|---|---|
value | number | 10 | Value to set |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
container
Params:
Name | Type | Description |
---|---|---|
value | string | Element | The value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
draw
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
drawFirstLabel
Returns:
boolean - Drawing flag.var currentAxis = chart.yAxis(); var flag = currentAxis.drawFirstLabel();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
drawLastLabel
Returns:
boolean - Drawing flag.var currentAxis = chart.yAxis(); var flag = currentAxis.drawLastLabel();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
enabled
Returns:
boolean - The current element state.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.if (!element.enabled()) element.enabled(true);
Try it:
getRemainingBounds
Returns:
anychart.math.Rect - Parent bounds without the space used by the title.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 |
---|---|---|---|
value | Object | boolean | null | true | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.length
Returns:
number | string - Color line length.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
value | string | number | "70%" | Color line length. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
listen
Note Notice that if the existing listener is one-off (added using listenOnce), it will cease to be such after calling the listen() method.
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
If the event handler being added already exists, listenOnce will do nothing.
Note In particular, if the handler is already registered using listen(), listenOnce() will not make it one-off. Similarly, if a one-off listener already exists, listenOnce will not change it (it wil remain one-off).
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:
marker
Returns:
anychart.core.ui.MarkersFactory.Marker - Color range marker.Try it:
Params:
Name | Type | Description |
---|---|---|
value | anychart.core.ui.MarkersFactory.Marker | Object | Marker or marker settings. |
Returns:
anychart.standalones.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 |
---|---|---|---|
value | Object | boolean | null | false | Value to set. |
Returns:
anychart.standalones.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 |
---|---|---|---|
value | Object | boolean | null | false | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.orientation
Returns:
anychart.enums.Orientation - Axis orientation.var currentAxis = chart.yAxis(); var axisOrientation = currentAxis.orientation();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | string | anychart.enums.Orientation | "top" | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
overlapMode
Params:
Name | Type | Default | Description |
---|---|---|---|
value | anychart.enums.LabelsOverlapMode | string | "noOverlap" | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
padding
Returns:
anychart.core.ui.table.Padding - Padding settings object.Try it:
Params:
Name | Type | Description |
---|---|---|
value | null | Array.<(number|string)> | Object | Value to set. |
Returns:
anychart.standalones.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.standalones.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:
parentBounds
Returns:
anychart.math.Rect - Parent bounds.Try it:
Params:
Name | Type | Description |
---|---|---|
value | anychart.math.Rect | Object | null | Value to set |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
Params:
Name | Type | Description |
---|---|---|
left | number | Left space. |
top | number | Top space. |
width | number | A width for a color range. |
height | number | A height for a color range. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
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
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:
scale
Returns:
anychart.scales.Base - Axis scale.var currentAxis = chart.yAxis(); var axisScale = currentAxis.scale();
Params:
Name | Type | Description |
---|---|---|
value | anychart.scales.Base | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
staggerLines
Returns:
number - Stagger line settings.var currentAxis = chart.yAxis(); var lines = currentAxis.staggerLines();
Note: pass null to enable autocalculation.
Params:
Name | Type | Default | Description |
---|---|---|---|
value | number | null | Count of stagger lines. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
staggerMaxLines
Returns:
number - Stagger line settings.var currentAxis = chart.yAxis(); var maxLines = currentAxis.staggerMaxLines();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | 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.standalones.ColorRange - Self instance for method chaining.Try it:
staggerMode
Returns:
boolean - Stagger mode state.var currentAxis = chart.yAxis(); var flag = currentAxis.staggerMode();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | boolean | true | On/off stagger mode. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
stroke
Returns:
anychart.graphics.vector.Stroke - Axis stroke settings.var currentAxis = chart.yAxis(); var axisStroke = currentAxis.stroke();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | 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 | anychart.graphics.vector.StrokeLineJoin | Line join style. | |
lineCap | anychart.graphics.vector.StrokeLineCap | Line cap style. |
Returns:
anychart.standalones.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 |
---|---|---|---|
value | Object | boolean | null | true | Value to set. |
Returns:
anychart.standalones.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 |
---|---|---|---|
value | null | boolean | Object | string | false | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.unlisten
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
Params:
Name | Type | Description |
---|---|---|
key | Object | The key returned by listen() or listenOnce(). |
Returns:
boolean - Whether any listener was removed.Try it:
width
Returns:
number | string | null - Axis width.var currentYAxis = chart.yAxis(); var axisWidth = currentYAxis.width();
Params:
Name | Type | Default | Description |
---|---|---|---|
value | number | string | null | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it:
zIndex
Returns:
number - The current zIndex.Try it:
Params:
Name | Type | Default | Description |
---|---|---|---|
value | number | 0 | Value to set. |
Returns:
anychart.standalones.ColorRange - Self instance for method chaining.Try it: