AnyChart
API Reference
Still have questions?
Contact support
Top

class anychart.core.ChoroplethPoint Improve this Doc

Extends: anychart.core.SeriesPoint

Point representing choropleth points that belongs to map.

Methods Overview

Specific settings
getIndex()Getter for the point index in chart or series.
Charts
getChart()Getter for the chart which current point belongs to.
Data
exists()Checks if the point with the given index exists in a dataset.
get()Fetches a field value from point data row by its name.
getStackValue()Returns stack value of the point.
getStackZero()Returns stack zero of the point.
getStat()Getter for the statistics value by key.
set()Sets the field of the point data row to the specified value.
Point Elements
hovered()Hover point state.
selected()Select point state.
Series
getSeries()Getter for series which current point belongs to.
Size and Position
crs()Feature crs
getFeatureBounds()Getter for the point bounds.
middleX()X center of the point label
middleY()Y center of the point label
scaleFactor()Scaling of the point.
translate()Moves point.
translation()Point translation
Miscellaneous
getFeatureProp()Getter for the point properties.

Methods Description

crs

Returns the point crs (coordinate system).

Returns:

string - The current point crs.
Changes crs (coordinate system) of the point.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
crsstringString crs representation (map projection).

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

exists

Checks if the point with the given index exists in a dataset.

Returns:

boolean - Whether point exists in dataset or not.

get

Fetches a field value from point data row by its name.

Params:

NameTypeDescription
fieldstringField in data row.

Returns:

* - Field value.

getChart

Getter for the chart which current point belongs to.

Returns:

anychart.core.SeparateChart - The current chart.

getFeatureBounds

Getter for the point bounds.
Note: Works only after anychart.charts.Map#draw is called.

Returns:

anychart.math.Rect - Choropleth point bounds.

getFeatureProp

Getter for the point properties.
Note: Works only after anychart.charts.Map#draw is called.

Returns:

Object - Point properties.

getIndex

Getter for the point index in chart or series.

Returns:

number - Index of point.

getSeries

Getter for series which current point belongs to.

Returns:

anychart.core.SeriesBase - Series.

getStackValue

Returns stack value of the point. Note: Works only after chart.draw() is called.

Returns:

number - The current stack value of the point.

getStackZero

Returns stack zero of the point. Note: Works only after chart.draw() is called.

Returns:

number - The current stack zero of the point

getStat

Getter for the statistics value by key.

Params:

NameTypeDescription
keyanychart.enums.Statistics | stringKey.

Returns:

* - Statistics value.

hovered

Getter for the hover point state.

Returns:

boolean - Hover state.
Setter for the hover point state.

Params:

NameTypeDefaultDescription
enabledboolean
false
Hover state to set.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

middleX

Getter for the X center of the point label.

Returns:

number - Middle X value in ratio relative point bounds.
Setter for the X center of the point label.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
xCoordnumberValue of the middle X coordinate.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

middleY

Getter for the Y center of the point label.

Returns:

number - Middle Y value in ratio relative point bounds.
Setter for the Y center of the point label.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
yCoordnumberValue of the middle Y coordinate.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

scaleFactor

Getter for the scale of the point.

Returns:

number - Scale of the point.
Scales point.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
scaleFactornumberScale value.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

selected

Getter for the select series point state.

Returns:

boolean - Select point state.
See listing
var point = series.getPoint(1);
var selectState = point.selected();
Setter for the select series point state.

Params:

NameTypeDefaultDescription
enabledboolean
false
Select state to set.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

set

Sets the field of the point data row to the specified value.

Params:

NameTypeDescription
fieldstringField.
value*Value to set.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

translate

Moves point.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
dxnumberOffset x coordinate.
dynumberOffset y coordinate.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.

translation

Getter for the point translation.

Returns:

Array.<number> - Point translation.
See listing
var point = series.getPoint(12);
var currentTranslation = point.translation();
Setter for the point translation.
Note: Works only after anychart.charts.Map#draw is called.

Params:

NameTypeDescription
dxnumberOffset x coordinate.
dynumberOffset y coordinate.

Returns:

anychart.core.ChoroplethPoint - Self instance for method chaining.