SetAxisScale() and setAxisScaleDraw()
Hi, I made plot X axis with my own time labels (Qwt 5.0.0):
Code:
{
public:
TimeScaleDraw
(const QTime &base
): baseTime(base)
{
}
virtual QwtText label
(double v
) const {
if(b_time_list.size()>0)
{
if(v<b_time_list.size() && v>0)
{
msg1=b_time_list[v];
}
}
return msg1;
}
private:
};
In print to paper slot I see X axis with labels:
Code:
double xn11=0, xk11=1200;
qwtPlot
->setAxisScale
(QwtPlot::xBottom, xn11, xk11
);
//x
qwtPlot->replot();
painter.setViewport(xp-40, yp+hp, wp, hp*3);
qwtPlot->print(&painter,rect,filter);
But than I add setAxisScaleDraw() I see X axis without time labels:
Code:
qwtPlot
->setAxisScale
(QwtPlot::xBottom, xn11, xk11
);
//xqwtPlot
->setAxisScaleDraw
(QwtPlot::xBottom,
new TimeScaleDraw
(QTime::fromString("00:00:00",
"hh,mm,ss")));
qwtPlot->replot();
painter.setViewport(xp-40, yp+hp, wp, hp*3);
qwtPlot->print(&painter,rect,filter);
How can I print X axis with time labels?
Re: SetAxisScale() and setAxisScaleDraw()
Are you sure you want to use Qwt 5.0.0 - this version is from 2007 ?
Uwe