Results 1 to 5 of 5

Thread: QwtPlotHistogram

  1. #1
    Join Date
    Jun 2010
    Posts
    2
    Thanked 2 Times in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11

    Default QwtPlotHistogram

    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.

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,318
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotHistogram

    Download Qwt 6.x and check the tvplot example.

    Uwe

  3. #3
    Join Date
    Dec 2010
    Posts
    12
    Thanks
    1
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: QwtPlotHistogram

    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

  4. #4
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,318
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QwtPlotHistogram

    Overload QwtPlotHistogram ::drawColumn(),

    Uwe

  5. #5
    Join Date
    Dec 2010
    Posts
    33
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QwtPlotHistogram

    Could you please elaborate a little more on exactly what is to be done ?
    I wrote
    Qt Code:
    1. class Histogram: public QwtPlotHistogram
    2. {
    3. public:
    4. Histogram(const QString &, const QColor &);
    5. void setColor(const QColor &);
    6. void setValues(uint numValues, const double *);
    7. void drawColumn(QPainter *painter,const QwtColumnRect &rect,const QwtIntervalSample &samples);
    8. };
    To copy to clipboard, switch view to plain text mode 
    and wrote this function
    Qt Code:
    1. void Histogram::drawColumn(QPainter *painter,const QwtColumnRect &rect,const QwtIntervalSample &sample)
    2. {
    3. drawColumn(painter,rect,samples);
    4. QString s="My Text";
    5. painter->drawText(50,100,s);
    6. }
    To copy to clipboard, switch view to plain text mode 

    but no text appeared..

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.