Hello. I apologize for my English.
I have installed the library QWT 6.0.0 with Patch Multi Axes Support.
I displayed on the graph two curves, with two axes Y.
I connect an object of class Zoomer for each curve (as in Example Bode from Qwt).
{
public:
{
Qt::RightButton, Qt::ControlModifier);
Qt::RightButton);
}
};
class Zoomer: public QwtPlotZoomer
{
public:
Zoomer(int xAxis, int yAxis, QwtPlotCanvas *canvas):
QwtPlotZoomer(xAxis, yAxis, canvas)
{
setTrackerMode(QwtPicker::AlwaysOff);
setRubberBand(QwtPicker::NoRubberBand);
setMousePattern(QwtEventPattern::MouseSelect2,
Qt::RightButton, Qt::ControlModifier);
setMousePattern(QwtEventPattern::MouseSelect3,
Qt::RightButton);
}
};
To copy to clipboard, switch view to plain text mode
curv1->setAxes(xb,yl);
myPlot->enableAxis(yl);
curv1->attach(myPlot);
curv2->setAxes(xb2,yl2);
myPlot->enableAxis(yl2);
curv2->attach(myPlot);
int xb = QwtPlot::xBottom;
int yl = QwtPlot::yLeft;
curv1->setAxes(xb,yl);
myPlot->enableAxis(yl);
curv1->attach(myPlot);
int xb2 = QwtPlot::xBottom;
int yl2 = QwtPlot::yLeft+1;
curv2->setAxes(xb2,yl2);
myPlot->enableAxis(yl2);
curv2->attach(myPlot);
To copy to clipboard, switch view to plain text mode
d_zoomer[0] = new Zoomer( xb, yl,
myPlot->canvas());
d_zoomer
[0]->setRubberBand
(QwtPicker::RectRubberBand);
d_zoomer
[0]->setTrackerPen
(QColor(Qt
::white));
d_zoomer1[0] = new Zoomer( xb2, yl2,
myPlot->canvas());
d_zoomer[0] = new Zoomer( xb, yl,
myPlot->canvas());
d_zoomer[0]->setRubberBand(QwtPicker::RectRubberBand);
d_zoomer[0]->setTrackerPen(QColor(Qt::white));
d_zoomer1[0] = new Zoomer( xb2, yl2,
myPlot->canvas());
To copy to clipboard, switch view to plain text mode
But when I want to zoom chart, for example, as shown in the attached picture, chart scale is not between 0 and 1 on the axis X, and from 0 to 0.12.
qwt2.jpg
qwt3.jpg
What am I doing wrong?
Bookmarks