I few curiosities from the RealTimePlot.m of the CorePlotGallery sample real time plot setup:
// Plot space
CPTXYPlotSpace * plotSpace = (CPTXYPlotSpace *)graph.defaultPlotSpace;
plotSpace.xRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@(kMaxDataPoints - 2)];
plotSpace.yRange = [CPTPlotRange plotRangeWithLocation:@0.0 length:@1.0];
plotSpace.allowsUserInteraction = YES;
It notes a range of points - kMaxDataPoints, initially 52, which appears to be the visible range of plot points from the initial window/view size.
The delegate newData method trims the earliest point to be added, to maintain this queue but my question is how was this value (52) derived?
Is it possible to calc at run-time this visible range even when the user pinches / zooms?
Wouldn't it better to trim the point(s) afterwards - after adding, when the quantity is known of points added, from the range beginning?