Get the data point collection based on region
10 Jul 20261 minute to read
CartesianSeries provides the following methods to get a collection of data under a particular region.
-
GetDataPoints(Rect rectangle)- Gets the collection of data that falls inside the given rectangle region. -
GetDataPoints(double startX, double endX, double startY, double endY)- Gets the collection of data from the given axis visible range.
NOTE
Prerequisite: Ensure that the required NuGet package is installed, the necessary namespaces are imported, and the SfCartesianChart control is properly configured in your application. For detailed setup and configuration instructions, refer to the Getting Started guide.
// Gets the collection of data that falls inside the given rectangle region.
List<object> dataPoints = Series.GetDataPoints(rectangle);
// Gets the collection of data from the given axis visible range.
List<object> dataPoints = Series.GetDataPoints(startX, endX, startY, endY);NOTE
You can get the visible plotting region of the series in the chart using the SeriesBounds property at runtime.