Selection in ASP.NET MVC 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.
We have different type 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’s 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 able to 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.