Results 1 to 6 of 6

Thread: real time graph plot

  1. #1
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default real time graph plot

    hi Every body I want to plot real time 2D graph
    example some value in y-axis and some value in Y-axis
    How to do this
    please help
    Every help shall be appreciated

  2. #2
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: real time graph plot

    Ok I managed to download the QWT library and build it
    can someone provide simple example just ...a simple plot that indicate that my I am able to plot ....
    please someone might have done this..

  3. #3
    Join Date
    Jan 2011
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: real time graph plot

    There are several examples with Qwt. For your needs, check cpuplot and oscilloscope.

  4. #4
    Join Date
    May 2011
    Posts
    39
    Thanks
    15
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: real time graph plot

    I tried the examples but they are not helping me
    can u suggest any one of the classes that I can start with

  5. #5
    Join Date
    Jan 2011
    Posts
    14
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: real time graph plot

    Why these examples do not help you ?
    cpuplot is very simple, try to modify it for your needs,
    it's just 4 curves updated with a timer.

  6. #6
    Join Date
    Apr 2011
    Location
    India
    Posts
    7
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: real time graph plot

    Hi..All you need to do is re-implement widgets paintevent() with your real time data. Mostly you may need to use drawLine() function of QPainter.
    sample logic:
    Qt Code:
    1. QList<QPair<double,double> > realData; //initialize with ur data
    2. void paintEvent(QPaintEvent *)
    3. {
    4. QPainter painter(this);
    5. painter.setPen(QPen(QColor(200,100,0)));
    6. for(int i=0; i<realData.count()-1; i++)
    7. {
    8. painter.drawLine(QPointF(realData.at(i).first,realData.at(i).second),QPointF(realData.at(i+1).first,realData.at(i+1).second));
    9. }
    10. }
    To copy to clipboard, switch view to plain text mode 

    You can check the sample codes and qt documentation for custom painting.

Similar Threads

  1. Replies: 1
    Last Post: 27th April 2011, 10:35
  2. Plot a graph without Qwt
    By abghosh in forum Qwt
    Replies: 2
    Last Post: 17th August 2010, 10:33
  3. QFileSystemWatcher with a Qwt Real-time plot
    By gen_mass in forum Qt Programming
    Replies: 1
    Last Post: 25th June 2010, 21:28
  4. Best way in Qt to plot curve per real-time reading?
    By Sheng in forum Qt Programming
    Replies: 1
    Last Post: 10th February 2009, 22:33
  5. How to plot a graph in Qt ?
    By vinod in forum Qt Programming
    Replies: 2
    Last Post: 27th April 2006, 13:44

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.