Solved. ( Sorry, bad arithmetic calculating elapsed time - it should have been working all along )

The cpuplot source was used pretty much as is, simply replacing the timer event handler with my own code that I called when I received the updated time-stamped data sample:

Qt Code:
  1. // Update X-axis time series labels for the amount of time that has passed since last update
  2. double elapsedTimeIntervalSeconds = (structDataSample.timeStampMs - m_structDataSampleLast.timeStampMs) / 1000.0;
  3. m_structDataSampleLast = structDataSample;
  4. qDebug() << "Dbg: elapsedTimeIntervalSeconds = " << elapsedTimeIntervalSeconds << endl;
  5. for ( int j = 0; j < HISTORY_BUFFER_LENGTH; j++ )
  6. {
  7. timeDataSeries[j] = timeDataSeries[j] + elapsedTimeIntervalSeconds;
  8. }
To copy to clipboard, switch view to plain text mode