I used this code to get the points in the visible x range of the chart (I do not need the check on the y axis):
However, I end up getting couple more points added to the end (128 instead of 122 points). So, I guess it has something to do with the ViewportWidth. Can you tell me what exactly is ViewportWidth? I thought I had this issue because of the legend, but I get unwanted points even when legend is not shown. How to be certain what width to take to get the visible width of the chart? By visible area of the chart I mean the area that contain values that are greater than 0 on both x and y axes, meaning only the first quadrant of the Cartesian system. If the chart title and labels on the chart interval values (eg. 0, 50, 100) are also included in the ViewportWidth, then how to subtract them from the ViewportWidth?
private bool CheckIfDataPointIsInTheAvaialableXRange(IChartView view, CategoricalDataPoint cdp)
{
RadRect viewport = new RadRect(-view.PlotOriginX, -view.PlotOriginY, view.ViewportWidth, view.ViewportHeight);
return (cdp.LayoutSlot.X >= viewport.X) && (cdp.LayoutSlot.X <= (viewport.X + viewport.Width));
}