All docs
V24.2
24.2
24.1
23.2
23.1
22.2
22.1
21.2
21.1
20.2
20.1
19.2
The page you are viewing does not exist in version 19.2.
19.1
The page you are viewing does not exist in version 19.1.
18.2
The page you are viewing does not exist in version 18.2.
18.1
The page you are viewing does not exist in version 18.1.
17.2
The page you are viewing does not exist in version 17.2.

JavaScript/jQuery Chart - Access a Series Using the API

The Chart exposes the following methods for accessing a series. All of them return one or several objects whose fields and methods are described in the Series section of the API reference.

  • getAllSeries()
    Gets all series of the Chart.

    JavaScript
    • var seriesCollection = $("#chartContainer").dxChart("getAllSeries");
  • getSeriesByName(seriesName)
    Gets a series by its name.

    JavaScript
    • var series = $("#chartContainer").dxChart("getSeriesByName", "Series 1");
  • getSeriesByPos(seriesIndex)
    Gets a series by its index in the series array. The index is zero-based.

    JavaScript
    • var series = $("#chartContainer").dxChart("getSeriesByPos", 0);

Apart from the API methods, you can access a series in the event handlers. For example, the onSeriesClick event handler gets the clicked series in the argument.

JavaScript
  • $(function() {
  • $("#chartContainer").dxChart({
  • // ...
  • onSeriesClick: function (e) {
  • var series = e.target;
  • // ...
  • }
  • });
  • });

Once you get the series, you can access its child points. For further information, refer to the Access a Series Point Using the API topic.

See Also