# Methods

This section describes the methods that can be used in code to manipulate the Series object.

## clearSelection()

Unselects all the selected points of the series. The points are displayed in an initial style.

To learn about point selection, refer to the Selection Handling section.

Show Example:

In this example, click the pie series to select it. Then, click it once again to unselect it. This action is performed using the clearSelection() method.

## deselectPoint(point)

Deselects the specified point. The point is displayed in an initial style.

Parameters:
point:

Point

The point to be deselected.

To learn about point selection, refer to the Selection Handling section.

Show Example:

In this example, if you click the pie series, only points with the value equal to 1 billion or more will be selected. The second click on the series unselects all previously selected points using the deselectPoint(point) method.

## getAllPoints()

Returns an array of all points in the series.

Return Value:

Array

The points from the series point collection.

Show Example:

In this example, click a point on the chart to display the maximum point value in the pie series. The series' getAllPoints() method is used to calculate the maximum value from all the points.

## getColor()

Gets the color of a particular series.

Return Value:

String

The color of a series.

## getPointByArg(pointArg)

Gets a point from the series point collection based on the specified argument.

Parameters:
pointArg:

Number

|

String

|

Date

The argument of the point to be found.

Return Value:

Object

The point that is found by the specified argument.

If a point with the specified argument is not found, the function returns null.

Show Example:

In this example, choose one of the continents using the radio buttons. Here, the getPointsByArg(pointArg) method is used to select a pie slice according to the argument, which is the chosen continent.

## getPointByPos(positionIndex)

Gets a point from the series point collection based on the specified point position.

Parameters:
positionIndex:

Number

The index of the point to be found within the series point collection.

Return Value:

Object

The point that is found by the specified position index.

Points in the series point collection are arranged as they go along the argument axis from left to right. Note that the series are numbered from zero in the series collection.

Show Example:

In this example, choose one of the point indexes using the radio buttons. Here, the getPointByPos(positionIndex) method is used to select a pie slice with the chosen index.

## getPointsByArg(pointArg)

Gets points from the series point collection based on the specified argument.

Parameters:
pointArg:

Number

|

String

|

Date

The argument of the point(s) to be found.

Return Value:

Array

The points that are found by the specified argument.

If a point with the specified argument is not found, the function returns empty array.

## getVisiblePoints()

Returns visible series points.

Return Value:

Array

Currently displayed series points.

## select()

Selects the series. The series is displayed in a 'selected' style.

To learn about series selection, refer to the Selection Handling section.

Show Example:

In the example below, click the pie series to select it. Then, click it once again to unselect it. The selection is performed using the select() method.

## selectPoint(point)

Selects the specified point. The point is displayed in a 'selected' style.

Parameters:
point:

Point

The point to be selected.

For information on point selection, refer to the Selection Handling section.

Show Example:

In this example, if you click the pie series, only points with the value equal to 1 billion or more will be selected using the selectPoint(point) method. The second click on the series deselects all previously selected points.