The class Telerik.Charting.DataPoint
doesn't implement IComparable
- that is, the data point doesn't know how to compare itself to another data point (do you want to compare x values? y values?). You could loop through all data points, and keep track of the max value (x or y) and the corresponding datapoint:
DataPoint maxPoint = null;
double maxValue = double.MinValue;
foreach (DataPoint point in chartDataPointCollection)
{
if (point.X > maxValue)
{
maxValue = point.X; // or point.Y, or whatever criteria you want to use.
maxPoint = point;
}
}
if (maxPoint != null)
{
// do stuff with the max point
}