Top

class anychart.scales.Logarithmic Improve this Doc

Extends: anychart.scales.Linear

Define Logarithmic scale.
Note: To create instance use anychart.scales#log method.

Methods Overview

Specific settings
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.
inverseTransform()Returns tick by its position ratio.
inverted()Inversion state.
logBase()Log base value.
maximum()Scale maximum.
maximumGap()Maximum gap settings.
minimum()Scale minimum.
minimumGap()Minimum gap settings.
minorTicks()Minor ticks settings.
softMaximum()Soft maximum settings.
softMinimum()Soft minimum settings.
startAutoCalc()Informs scale that an auto range calculation started for the chart, so it should reset its data range on the first
stickToZero()Stick to zero.
ticks()Ticks settings.
transform()Returns tick position ratio by its name.
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.
Miscellaneous
stackMode()Getter for stacked mode.

Methods Description

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.

Params:

Name Type Description
var_args * Values that are supposed to extend the input domain.

Returns:

anychart.scales.ScatterBase - 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.

inverseTransform

Returns tick by its position ratio. Note: returns correct values only after anychart.scales.Base#finishAutoCalc or chart.draw().

Params:

Name Type Description
ratio number Value to transform in input scope.

Returns:

* - Value transformed to output scope [0, 1].

Try it:

inverted

Getter for scale inversion.

Returns:

boolean - Current 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.

Params:

Name Type Default Description
value boolean
false
Value to set.

Returns:

anychart.scales.Base - Self instance for method chaining.

Try it:

listen

Adds an event listener to an implementing object.

Params:

Name Type 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 Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

listenOnce

Adds an event listener to an implementing object.

Params:

Name Type Description
type string The event type id.
listener function Callback method.
useCapture boolean Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

Try it:

logBase

Getter for Log base value.

Returns:

number - Current Log base.
Setter for Log base value.
Note: Affects tick values auto calculation.

Params:

Name Type Default Description
value number
10
Log base to set. Takes any number greater than 1.

Returns:

anychart.scales.Logarithmic - Self instance for method chaining.

Try it:

maximum

Getter for the current scale maximum.

Returns:

number - Current scale maximum.
Setter for scale maximum.

Params:

Name Type Default Description
value number
null
Value to set.

Returns:

anychart.scales.ScatterBase - Self instance for method chaining.

Try it:

maximumGap

Getter for the current scale maximum gap.

Returns:

number - The current scale maximum gap.

Try it:

Setter for the scale maximum gap.

Params:

Name Type Default Description
value number
0.1
Value from 0 to 1.

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

minimum

Getter for the current scale minimum.

Returns:

number - Current scale minimum.
Setter for scale minimum.

Params:

Name Type Default Description
value number
null
Value to set.

Returns:

anychart.scales.ScatterBase - Self instance for method chaining.

Try it:

minimumGap

Getter for the current scale minimum gap.

Returns:

number - The current scale minimum gap.

Try it:

Setter for the scale minimum gap.

Params:

Name Type Default Description
value number
0.1
Value from 0 to 1.

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

minorTicks

Getter for set of scale minor ticks in terms of data values.

Returns:

anychart.scales.ScatterTicks - Current ticks.

Try it:

Setter for set of scale minor ticks in terms of data values.

Params:

Name Type Description
value Object | Array An array of ticks to set.

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

removeAllListeners

Removes all listeners from an object. You can also optionally remove listeners of some particular type.

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:

softMaximum

Getter for the current soft maximum.

Returns:

number - Current soft maximum.

Try it:

Setter for soft maximum.

Params:

Name Type Default Description
value number
null
Value to set

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

softMinimum

Getter for the current soft minimum.

Returns:

number - Current soft minimum.

Try it:

Setter for soft minimum.

Params:

Name Type Default Description
value number
null
Value to set

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

stackMode

Getter for stacked mode.

Returns:

anychart.enums.ScaleStackMode - Current stack mode.

Try it:

Setter for stacked mode.

Params:

Name Type Default Description
value anychart.enums.ScaleStackMode | string
"none"
Value to set.

Returns:

anychart.scales.Linear - 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.Base - Chaining.

stickToZero

Getter for stick to zero.

Returns:

boolean - Current state stick to zero.

Try it:

Setter for stick to zero. Flag to stick to zero value on auto calc if gaps lead to zero crossing.

Params:

Name Type Default Description
value boolean
true
Value to set.

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

ticks

Getter for set of scale ticks in terms of data values.

Returns:

anychart.scales.ScatterTicks - Current ticks.

Try it:

Setter for set of scale ticks in terms of data values.

Params:

Name Type Description
value Object | Array An array of ticks to set.

Returns:

anychart.scales.Linear - Self instance for method chaining.

Try it:

transform

Returns tick position ratio by its name. Note: returns correct values only after anychart.scales.Base#finishAutoCalc or chart.draw().

Params:

Name Type Description
value * Value to transform in input scope.

Returns:

number - Value transformed to scope [0, 1].

Try it:

unlisten

Removes a listener added using listen() or listenOnce() methods.

Params:

Name Type Description
type string The event type id.
listener function Callback method.
useCapture boolean Whether to fire in capture phase (defaults to false).
listenerScope Object Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

Try it:

unlistenByKey

Removes an event listener which was added with listen() by the key returned by listen() or listenOnce().

Params:

Name Type Description
key Object The key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

Try it: