Quote Originally Posted by Uwe View Post
Using the characteristics of the data is the job of the application code - QwtPlotCurve doesn't know about them.

I recommend to derive from QwtSeriesData<QPointF> ( or one of its derived classed ), where you return only points from the current zoom interval: check the pure virtual methods.

To know the current scale interval do:

Qt Code:
  1. connect( plot->axisWidget( QwtPlot::xBottom ), SIGNAL( scaleDivChanged() ), this, updateCurrentZoom() );
To copy to clipboard, switch view to plain text mode 

and something like this:

Qt Code:
  1. void YourWhatever::updateCurrentZoom()
  2. {
  3. const QwtScaleDiv scaleDiv = plot->axisScaleDiv( QwtPlot::xBottom );
  4. updateCurrentZoom( scaleDiv->interval() );
  5. }
To copy to clipboard, switch view to plain text mode 

Uwe
Hi
I am interested in doing exactly the same optimization on a zoom. My data is also time domain so for a rectangle x, x + n all I really need to do is return samples x, x+1, x+2, ... x + n.

I understand the concept but not the example code given. I currently have a derived AnalogPlotData class based on QwtSeriesData<QPointF> which stores my plot data. Where however to I add the connect() to get notified of the plot scale change and to what class do I add the updateCurrentZoom() function to limit the from/to parameters to drawSeries(). I tried searching the Qwt sources for references to updateCurrentZoom() but found none (Qwt 6.0.1).

Do I need to derive a version of QwtPlotAbstractSeriesItem as well?

Addituonal guided prods in the right direction much appreciated.

David