Selection in ASP.NET Core Chart Component

18 Nov 20181 minute to read

Chart provides selection support for the series and its data points on mouse click.

NOTE

When Mouse is clicked on the data points, the corresponding series legend will also be selected.

There are different types of selection mode for selecting the data. They are,

  • None
  • Point
  • Series
  • Cluster
  • DragXY
  • DragX
  • DragY

Point

You can select a point, by setting selectionMode to point.

Series

You can select a series, by setting selectionMode to series.

Cluster

You can select the points that corresponds to the same index in all the series, by setting selectionMode to cluster.

Rectangular selection

DragXY, DragX and DragY

To fetch the collection of data under a particular region, you have to set selectionMode as DragXY.

  • DragXY - Allows us to select data with respect to horizontal and vertical axis.
  • DragX - Allows us to select data with respect to horizontal axis.
  • DragY - Allows us to select data with respect to vertical axis.

The selected data are returned as an array collection in the dragComplete event.

Selection type

You can select multiple points or series, by enabling the isMultiSelect property.

Selection on load

You can select a point or series programmatically on a chart using selectedDataIndexes property.

Selection through on legend

You can able to select a point or series through on legend using toggleVisibility property. Also, use enableHighlight property for highlighting the series through legend.

Customization for selection

You can apply custom style to selected points or series with selectionStyle property.