PDA

View Full Version : Qwt zoomer does not accept new plot



kota
11th April 2008, 14:02
Hello Qt community,

I'm quite new to Qt and its my first post here. I have a problem with the zoomer. I tried some solutions posted here but non is working. Im using Qt3 and qwt500
My Problem:
I'm plotting different curves on a qwt-chart. When not using the zoomer, the change between a graph with an x axis range 0...1 and some other graph with an x axis range from 20..200 is accomplished fine. When I use the zoomer in one of the plotted curves, plotting the next graph does not adopt its apropriate x axis scale any more, but uses the last one.
I tried the setZoomBase() before a replot but also after a replot. I even delete the zoomer before a new replot, and create it after the replot. It's not working.

The code fragment:

// delete zoomer
if(NULL != canvasZoomer)
{
delete canvasZoomer;
}

// all curves calculated , do replot
qwtPlotChartVisu->replot();

// create zoomer
canvasZoomer = new QwtPlotZoomer( QwtPlot::xBottom, QwtPlot::yLeft, qwtChartVisu->canvas() );
canvasZoomer->setSelectionFlags( QwtPicker::DragSelection );
canvasZoomer->setTrackerMode(QwtPicker::AlwaysOff);
canvasZoomer->setZoomBase();

Thank you and kind regards!

Uwe
14th April 2008, 07:49
As soon as you zoom in, you are assigning specific scales, turning autoscaling off. You have to re-enable autoscaling, before you display the next graph.

Uwe

fatecasino
21st December 2010, 15:48
how do you "re-enable autoscaling" ? which is the proper function to do that and where should i call it from?

FelixB
21st December 2010, 15:51
RTFM (http://qwt.sourceforge.net/class_qwt_plot.html)

hint: search for "autoscale"