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.
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.
HYIP Daily Blog - A must read for all HYIP investors. All HYIP news on the net.
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.
HYIP Daily Blog - A must read for all HYIP investors. All HYIP news on the net.
Something like this:
Qt Code:
{ public: { m_text = text; } { painter->drawText( canvasRect, Qt::AlignCenter, m_text ); } private: QString m_text; };To copy to clipboard, switch view to plain text mode
Attach this item to your plot like a curve and the draw method will be part of the plot image composition.
Uwe
Bookmarks