Top
You are looking at an outdated 7.7.0 version of this document. Switch to the 8.0.1 version to see the up to date information.

class anychart.core.map.scale.LinearColor Improve this Doc

Extends: anychart.scales.ScatterBase

Define Linear color scale.
Note: To create instance use method anychart.scales#linearColor.

Methods Overview

Specific settings
colorToValue()Converts color to value. Returns number ratio by its color.
minorTicks()Minor ticks settings.
ticks()Ticks settings.
valueToColor()Converts value to color. Returns color ratio by its number.
Coloring
colors()Linear gradient settings.

Methods Description

colorToValue

Converts color to value. Returns number ratio by its color.

Params:

Name Type Description
value string Color name or hex color representation.

Returns:

number - Returns value relative passed color.

Try it:

colors

Gets the current linear gradient for the linear color scale.

Returns:

Array.<Object> - The current linear gradient.
Sets linear gradient for the linear color scale.

Params:

Name Type Default Description
value Array.<string>
['#fff', '#ffd54f', '#ef6c00']
, Colors set.

Returns:

anychart.core.map.scale.LinearColor - Self instance for method chaining.

Try it:

minorTicks

Gets the current set of scale minor ticks in terms of data values.

Returns:

anychart.scales.ScatterTicks - The current set ticks.

Try it:

Sets a set of scale minor ticks in terms of data values.

Params:

Name Type Default Description
value Object | Array
false
An array or object of ticks to set.

Returns:

anychart.core.map.scale.LinearColor - Self instance for method chaining.

ticks

Gets the current set of scale ticks in terms of data values.

Returns:

anychart.scales.ScatterTicks - The current set ticks.

Try it:

Sets a set of scale ticks in terms of data values.

Params:

Name Type Default Description
value Object | Array
false
An array or object of ticks to set.

Returns:

anychart.core.map.scale.LinearColor - Self instance for method chaining.

valueToColor

Converts value to color. Returns color ratio by its number.

Params:

Name Type Description
value number Value to convert.

Returns:

string - Returns color in hex representation relative passed value.

Try it: