Hi,
I'm confused with the index value of Drawing and Tracking.
In function drawchart:
//-----------------------------------
// After determining the extra points, we can obtain the data
int startIndex = (int)floor(viewer->getValueAtViewPort("x", viewer->getViewPortLeft()));
int endIndex = (int)ceil(viewer->getValueAtViewPort("x", viewer->getViewPortLeft() + viewer->getViewPortWidth()));
// Add the extra points (adjust the extra points if there are insufficient data)
extraPoints = min(extraPoints, startIndex);
startIndex -= extraPoints;
int duration = endIndex - startIndex + 1;
TRACE("start index = %d , end index = %d for plot arean", startIndex,endIndex);
//--------------------------------------
the debug information is :
start index = 143 , end index = 221 for plot area
that means there are 79 data point to draw
But in the tracking function trackFinance, I add a debugger code:
//---------------------------------------
TRACE("index X =%d, and value =%fn", xIndex,value);
//-----------------------------------------
Then I found that index=0 at the left of chart, and index = 48 at the right of chart.
Why the max index !=(79-1) ? What's the index value in dataset at this moment?
How to get the index value of dataset when tracking a chart?
Thanks
Regards
James |