Hi,
I'm having trouble understanding how to update my boundingRect() yMin and yMax values when the plot is zoomed using the QwtPlotZoomer. Ideally I'd like the YAxis to be autoscaled to the Zoom window.

My understanding is that I need to somehow update my boundingRect() in my overloaded QwtDataSeries object but I have not found a solution.
My YAxis values are always autoscaled to the min/max values of the entire data series as that's what is passed into the constructor

Qt Code:
  1. MyDataSeries::MyDataSeries(struct MyData_struct *myData, qint64 startTime, double maxY, double minY)
  2. {
  3. _myData = myData;
  4. _startTime = startTime;
  5. _maxY = maxY;
  6. _minY = minY;
  7. }
  8.  
  9. size_t SacDataSeries::size() const
  10. {
  11. return _myData->npts;
  12. }
  13.  
  14. QPointF SacDataSeries::sample( size_t i ) const
  15. {
  16. return QPointF( _startTime + (i * _myData->delta*1000), _myData->data[i] );
  17. }
  18.  
  19. QRectF SacDataSeries::boundingRect() const
  20. {
  21. return QRect( 0.0, _minY , size() * (_myData->delta*1000), _maxY - (_minY) );
  22. }
To copy to clipboard, switch view to plain text mode