This is not the solution i was aiming for but it worked :
I solved my scale problem at the same time as my format problem using this method :
(original post in french) : http://www.developpez.net/forums/d10...-axe-absisses/
overight the QwtText label function :
{
virtual QwtText label
(double v
) const {
return t.toString("dd/MM/yyyy");
}
}
class TimeScaleDraw: public QwtScaleDraw
{
virtual QwtText label(double v) const
{
QDateTime t = QDateTime::fromTime_t((int)v); //cf fromTime_t
return t.toString("dd/MM/yyyy");
}
}
To copy to clipboard, switch view to plain text mode
and then
myPlot
->setAxisScaleDraw
(QwtPlot::xBottom,
new TimeScaleDraw
());
myPlot
->setAxisScale
(QwtPlot::xBottom, min, max
);
myPlot->setAxisScaleDraw(QwtPlot::xBottom, new TimeScaleDraw());
myPlot->setAxisScale(QwtPlot::xBottom, min, max);
To copy to clipboard, switch view to plain text mode
where min and max are values in second since epoch.
Thanks for your time
Stank
Bookmarks