
Originally Posted by
fantom
Could you give me an example how it has to look like with the text?
When the text is available from the sample you can overload QwtPlotHistogram::drawColumn:
virtual void YourHistogram
::drawColumn( QPainter *painter,
const QwtColumnRect &rect, const QwtIntervalSample &sample ) const
{
QwtPlotHistogram::drawColumn( painter, rect, sample );
// now draw your text
...
}
virtual void YourHistogram::drawColumn( QPainter *painter,
const QwtColumnRect &rect, const QwtIntervalSample &sample ) const
{
QwtPlotHistogram::drawColumn( painter, rect, sample );
// now draw your text
...
}
To copy to clipboard, switch view to plain text mode
Otherwise overload QwtPlotHistogram::drawColumns:
virtual void YourHistogram
::drawColumns( QPainter *painter,
int from, int to ) const
{
QwtPlotHistogram::drawColumns( painter, xMap, yMap, from, to );
for ( int i = from; i <= to; i++ )
{
const QwtIntervalSample sample = d_series->sample( i );
const QwtColumnRect rect = columnRect( sample, xMap, yMap );
// now draw your text
}
}
virtual void YourHistogram::drawColumns( QPainter *painter,
const QwtScaleMap &xMap, const QwtScaleMap &yMap,
int from, int to ) const
{
QwtPlotHistogram::drawColumns( painter, xMap, yMap, from, to );
for ( int i = from; i <= to; i++ )
{
const QwtIntervalSample sample = d_series->sample( i );
const QwtColumnRect rect = columnRect( sample, xMap, yMap );
// now draw your text
}
}
To copy to clipboard, switch view to plain text mode
Uwe
Bookmarks