PDA

View Full Version : QwtPlotHistogram



yers
20th December 2010, 17:25
I am currently working on a qt plotting program and was in the process of creating a histogram plot class from scratch when I came upon people mentioning the existence of a QwtPlotHistogram class. I have researched this and I cannot seem to find any documentation on how to implement it. Any help or a quick example would be greatly appreciated.

Uwe
21st December 2010, 06:00
Download Qwt 6.x and check the tvplot example.

Uwe

mohini
23rd December 2010, 09:56
hey,
Any one knows how to set some text on each histogram bar ?
I have used QwtPlotHistogram to plot my histogram.
I want diffetent labels on each bars of histogram

Uwe
24th December 2010, 11:17
Overload QwtPlotHistogram ::drawColumn(),

Uwe

penny
5th January 2011, 07:23
Could you please elaborate a little more on exactly what is to be done ?
I wrote

class Histogram: public QwtPlotHistogram
{
public:
Histogram(const QString &, const QColor &);
void setColor(const QColor &);
void setValues(uint numValues, const double *);
void drawColumn(QPainter *painter,const QwtColumnRect &rect,const QwtIntervalSample &samples);
};
and wrote this function

void Histogram::drawColumn(QPainter *painter,const QwtColumnRect &rect,const QwtIntervalSample &sample)
{
drawColumn(painter,rect,samples);
QString s="My Text";
painter->drawText(50,100,s);
}

but no text appeared..