AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.scales.Geo Improve this Doc

Extends: anychart.core.Base

The Geo class contains methods for configuring Geo scale in the Map.

Methods Overview

Specific settings
getType()Returns scale type.
maxTicksCount()Maximum ticks count.
maximumX()Scale maximum X settings.
maximumY()Scale maximum Y settings.
minimumX()Scale minimum X settings.
minimumY()Scale minimum Y settings.
precision()Precision settings.
xMinorTicks()X ticks settings.
xTicks()X ticks settings.
yMinorTicks()Y minor ticks settings.
yTicks()Y ticks 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
Size and Position
gap()Gap settings.
Miscellaneous
extendDataRange()Extends the current input domain with the passed values (if such don't exist in the domain).

Methods Description

extendDataRange

Extends the current input domain with the passed values (if such don't exist in the domain).

Params:

NameTypeDescription
xnumberX value that is supposed to extend the input domain.
ynumberY value that is supposed to extend the input domain.
var_args*Values that are supposed to extend the input domain.

Returns:

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

gap

Getter for the gap settings.

Returns:

number - Gap value.
See listing
var scale = chart.scale();
var gap = scale.gap();
Setter for the gap settings.

Params:

NameTypeDefaultDescription
gapnumber
0
Gap value to set.

Returns:

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

getType

Returns scale type.

Returns:

string - Scale type.

listen

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
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
}
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

listenOnce

Adds an event listener to an implementing object.

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object)
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

Object - Unique key for the listener.

maxTicksCount

Getter for maximum ticks count.

Returns:

number - Maximum ticks count.
See listing
var maxTicksCount = mapScale.maxTicksCount();
Setter for maximum ticks count.
Use the maxTicksCount() method for interval-mode ticks calculation.
If the number of ticks is greater than set in maxTicksCount(), the scale calculates from 4 to 6 ticks.

Params:

NameTypeDescription
countnumberCount to set.

Returns:

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

maximumX

Getter for the maximum X.

Returns:

number - Scale maximum X.
See listing
var mapScale = australiaMap.scale();
var maximum = mapScale.maximumX();
Setter for the maximum X.

Params:

NameTypeDescription
maximumXnumberMaximum X to set.

Returns:

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

maximumY

Getter for the maximum Y.

Returns:

number - Scale maximum.
See listing
var scale = chart.scale();
var maximum = scale.maximumY();
Setter for the maximum Y.

Params:

NameTypeDescription
maximumYnumberMaximum Y to set.

Returns:

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

minimumX

Getter for the minimum X.

Returns:

number - Scale minimum X.
See listing
var scale = chart.scale();
var minimum = scale.minimumX();
Setter for the minimum X.

Params:

NameTypeDescription
minimumXnumberMinimum X to set.

Returns:

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

minimumY

Getter for the minimum Y.

Returns:

number - Scale minimum Y.
See listing
var mapScale = australiaMap.scale();
var minimum = mapScale.minimumY();
Setter for the minimum Y.

Params:

NameTypeDescription
minimumYnumberMinimum Y to set.

Returns:

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

precision

Getter for the precision.

Returns:

Array.<number> - Precision.
Setter for the precision using one value.

Params:

NameTypeDescription
precisionArray.<number>Value to set.

Returns:

anychart.scales.Geo - Self instance for method chaining.
Setter for the precision using several values.

Params:

NameTypeDescription
xPrecisionnumberPrecision by x.
yPrecisionnumberPrecision by y.

Returns:

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

removeAllListeners

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

Params:

NameTypeDescription
typestringType of event to remove, default is to remove all types.

Returns:

number - Number of listeners removed.

unlisten

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

Params:

NameTypeDefaultDescription
typestring
The event type id.
listenerfunction(e:Object):boolean|undefined
Callback method.
useCaptureboolean
false
Whether to fire in capture phase. Learn more about capturing https://javascript.info/bubbling-and-capturing
listenerScopeObject
Object in whose scope to call the listener.

Returns:

boolean - Whether any listener was removed.

unlistenByKey

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

Params:

NameTypeDescription
keyObjectThe key returned by listen() or listenOnce().

Returns:

boolean - Whether any listener was removed.

xMinorTicks

Getter for the set of scale x minor ticks.

Returns:

anychart.scales.GeoTicks - Ticks instance.
Setter for the set of scale x minor ticks.

Params:

NameTypeDescription
settingsObject | ArrayAn array or object of ticks to set.

Returns:

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

xTicks

Getter for the set of scale x ticks.

Returns:

anychart.scales.GeoTicks - Ticks instance.
Setter for the set of scale x ticks.

Params:

NameTypeDescription
settingsObject | ArrayAn array or object of ticks to set.

Returns:

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

yMinorTicks

Getter for the set of scale y minor ticks.

Returns:

anychart.scales.GeoTicks - Ticks instance.
Setter for the set of scale y minor ticks.

Params:

NameTypeDescription
settingsObject | ArrayAn array or object of ticks to set.

Returns:

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

yTicks

Getter for the set of scale y ticks.

Returns:

anychart.scales.GeoTicks - Ticks instance.
Setter for the set of scale y ticks.

Params:

NameTypeDescription
settingsObject | ArrayAn array or object of ticks to set.

Returns:

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