I am trying to have to two labels in the middle of the QwtPlot.
ie: plot
|--------------------------------------|
| |
| top center label |
| |
| label 2 |
| |
|--------------------------------------|
How can I do that? Thanks.
Printable View
I am trying to have to two labels in the middle of the QwtPlot.
ie: plot
|--------------------------------------|
| |
| top center label |
| |
| label 2 |
| |
|--------------------------------------|
How can I do that? Thanks.
Implement a new type of plot item ( derive from QwtPlotItem ). In YourItem::draw use QPainter ::drawText centered to the canvasRect.
Uwe
I am a bit confused. When do I call this new myItem::draw method or how do I call this method, like override a new drawCanvas method for myQwtPlot? Thanks.
Something like this:
Code:
{ public: { m_text = text; } { painter->drawText( canvasRect, Qt::AlignCenter, m_text ); } private: QString m_text; };
Attach this item to your plot like a curve and the draw method will be part of the plot image composition.
Uwe