Methods

Methods used to control the series.

clearHover()

Switches the series from the hover state back to normal.

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.

View Demo

Show Example:
jQuery

In this example, click a series to select it. Then, click it once again to deselect it. The deselection 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:
jQuery

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


                                    

                                    

getAllPoints()

Gets all points in the series.

Return Value:

Array<Point>

All points in the series.

NOTE

A series point is a data object's visual representation. It can be selected, hovered over, or hidden. You can access the data object that the series point represents using the point's data field.

If data aggregation is enabled, a single series point can represent more than one data object. In this case, you can access the data objects using the point's aggregationInfo.data field.

Show Example:
jQuery

In this example, the maximum point value in the clicked series is displayed. 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.

Show Example:
jQuery

In this example, you can get a series' color by clicking it. The color will be displayed at the bottom of the chart.


                                    

                                    

getPointByPos(positionIndex)

Gets a series point with the specified index.

Parameters:
positionIndex:

Number

A zero-based index. Series points are indexed according to their drawing order.

Return Value:

Point

A series point found by the index.

Show Example:
jQuery

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


                                    

                                    

getPointsByArg(pointArg)

Gets a series point with the specified argument value.

Parameters:
pointArg:

Number

|

String

|

Date

An argument value.

Return Value:

Array<Point>

Series points that correspond to the argument value, or an empty array if none was found.

getVisiblePoints()

Gets visible series points.

Return Value:

Array<Point>

Visible series points.

Use this method to get series points in the widget's viewport which can change during zooming and scrolling.

NOTE
This method does not change the behavior if you hide the series.

hide()

Hides a series at runtime.

See Also

hover()

Switches the series into the hover state, the same as when a user places the mouse pointer on it.

isHovered()

Provides information about the hover state of a series.

Return Value:

Boolean

Hover state of a series.

When a series is hovered over, this method returns true. Otherwise, the returned value is false.

To learn more about point and series hover operation, refer to the Hover Handling topic.

Show Example:
jQuery

Hover over a series on the chart and information about the maximum point value of this series will appear under the chart. When the series that has been hovered over is hovered out, this information disappears. This behavior is achieved using the isHovered() method of the hovered series.


                                    

                                    

isSelected()

Provides information about the selection state of a series.

Return Value:

Boolean

Selection state of a series.

When a series is selected, this method returns true. Otherwise, the returned value is false.

You can select a series using its select() method. To learn more about point and series selection, refer to the Selection Handling topic.

View Demo

Show Example:
jQuery

Click a series on the chart to select this series. Information about the maximum point value of the selected series will appear under the chart. Click this series again and the information will disappear. This behavior is achieved using the isSelected() method of the clicked series.


                                    

                                    

isVisible()

Provides information about the visibility state of a series.

Return Value:

Boolean

Visibility state of a series.

When a series is visible, this method returns true. Otherwise, the returned value is false.

You can make a series visible using its show() method, or hide a series using its hide() method.

select()

Selects the series.

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

View Demo

Show Example:
jQuery

In the example below, click a series to select it. Then, click it once again to deselect 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:
jQuery

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


                                    

                                    

show()

Makes a particular series visible.