Re: Draw text on top of both canvas and plot background?
Brought to you by:
rathmann
|
From: Uwe R. <Uwe...@ti...> - 2019-03-12 08:09:09
|
Hi Elvis,
> Hope that makes it more clear.
That doesn't answer my question, but maybe all you want to do is:
class YourScaleDraw : public QwtScaleDraw
{
....
QwtText label( double value ) const override
{
auto txt = QLocale().toString( value );
const auto ticks = scaleDiv().ticks[ QwtScaleDiv::MajorTick ];
if ( !ticks.empty() && value == ticks.last() )
{
txt += "\nUnit";
}
return txt;
}
};
plot->setAxisScaleDraw( QwtPlot::xTop, new YourScaleDraw() );
Uwe
|