class anychart.scales.LinearColor Improve this Doc
Extends: anychart.scales.ScatterBase
The LinearColor class contains methods for configuring Linear color scale.
Note: To create instance use anychart.scales#linearColor method.
Methods Overview
Specific settings | |
colorToValue() | Converts color to value. Returns number ratio by its color. |
extendDataRange() | Extends the current input domain with the passed values (if such don't exist in the domain). |
finishAutoCalc() | Informs the scale that an auto-range calculation started for the chart in past was ended. |
getType() | Returns scale type. |
inverted() | Inversion state. |
maxTicksCount() | Maximum ticks count. |
maximum() | Scale maximum. |
minimum() | Scale minimum. |
minorTicks() | Minor ticks settings. |
startAutoCalc() | Informs scale that an auto-range calculation started for the chart, so it should reset its data range on the first |
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.
Detailed description
Note: returns correct values only after anychart.scales.Base#finishAutoCalc or chart.draw().
Params:
Name | Type | Description |
---|---|---|
color | string | Color name or hex color representation. |
Returns:
number - Returns value relative passed color.Try it:
colors
Getter for the linear gradient for the linear color scale.
Returns:
Array.<Object> - Linear gradient.Setter for the linear gradient for the linear color scale.
Detailed description
Can be set as single color or gradient as well as array or set of colors or gradients.
Params:
Name | Type | Description |
---|---|---|
var_args | string | anychart.graphics.vector.SolidFill | anychart.graphics.vector.LinearGradientFill | anychart.graphics.vector.RadialGradientFill | Array.<(string|anychart.graphics.vector.SolidFill|anychart.graphics.vector.LinearGradientFill|anychart.graphics.vector.RadialGradientFill)> | Colors set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
extendDataRange
Extends the current input domain with the passed values (if such don't exist in the domain).
Note: Attention! anychart.scales.Base#finishAutoCalc drops all passed values.
Note: Attention! anychart.scales.Base#finishAutoCalc drops all passed values.
Params:
Name | Type | Description |
---|---|---|
var_args | * | Values that are supposed to extend the input domain. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
finishAutoCalc
Informs the scale that an auto-range calculation started for the chart in past was ended.
Params:
Name | Type | Description |
---|---|---|
silently | boolean | If this flag is set, do not dispatch an event if reapplication needed. |
Returns:
boolean - If the calculation changed the scale and it needs to be reapplied.getType
inverted
Getter for the scale inversion.
Returns:
boolean - The inversion state.Setter for scale inversion.
If the scale is inverted, axes and series go upside-down or right-to-left instead of bottom-to-top and left-to-right.
If the scale is inverted, axes and series go upside-down or right-to-left instead of bottom-to-top and left-to-right.
Params:
Name | Type | Default | Description |
---|---|---|---|
enabled | boolean | false | Inverted state to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
maxTicksCount
Getter for the maximum ticks count.
Returns:
number - Maximum ticks count. See listing
var maxTicksCount = scale.maxTicksCount();
Setter for the maximum ticks count.
Detailed description
Use this method only if you set the ticks with the anychart.scales.ScatterTicks#interval method.
It is ignored if the number of ticks is set manually via the method anychart.scales.ScatterTicks#count.
The method does not summarize both major and minor ticks, considering each separately, but the whole range from minimum to maximum.
If the number of ticks is greater than the passed value, the auto-calculation drops the interval from 4 to 6 ticks.
The method does not summarize both major and minor ticks, considering each separately, but the whole range from minimum to maximum.
If the number of ticks is greater than the passed value, the auto-calculation drops the interval from 4 to 6 ticks.
Params:
Name | Type | Default | Description |
---|---|---|---|
count | number | 1000 | Maximum ticks count to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
maximum
Getter for the scale maximum.
Returns:
number - Scale maximum. See listing
var scale = chart.yScale(); var maximum = scale.maximum();
Setter for the scale maximum.
Params:
Name | Type | Default | Description |
---|---|---|---|
maximum | number | null | Maximum value to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
minimum
Getter for the scale minimum.
Returns:
number - Scale minimum. See listing
var scale = chart.yScale(); var minimum = scale.minimum();
Setter for the scale minimum.
Params:
Name | Type | Default | Description |
---|---|---|---|
minimum | number | null | Scale minimum to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
minorTicks
Getter for the set of scale minor ticks in terms of data values.
Returns:
anychart.scales.ScatterTicks - The set minor ticks.Try it:
Setter for the set of scale minor ticks in terms of data values.
Params:
Name | Type | Default | Description |
---|---|---|---|
ticks | Object | Array | false | An array or object of ticks to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
startAutoCalc
Informs scale that an auto-range calculation started for the chart, so it should reset its data range on the first
call of this method if needed.
Returns:
anychart.scales.LinearColor - Self instance for method chaining.ticks
Getter for the set of scale ticks in terms of data values.
Returns:
anychart.scales.ScatterTicks - The set ticks.Try it:
Setter for the set of scale ticks in terms of data values.
Params:
Name | Type | Default | Description |
---|---|---|---|
ticks | Object | Array | false | An array or object of ticks to set. |
Returns:
anychart.scales.LinearColor - Self instance for method chaining.Try it:
valueToColor
Converts value to color. Returns color ratio by its number.
Detailed description
Note: returns correct values only after anychart.scales.Base#finishAutoCalc or chart.draw().
Params:
Name | Type | Description |
---|---|---|
value | number | Value to convert. |
Returns:
string - Returns color in hex representation relative passed value.Try it: