Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Plot a Graph with Real Time Data
QtWS25 Last Chance

Plot a Graph with Real Time Data

Scheduled Pinned Locked Moved General and Desktop
15 Posts 8 Posters 49.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Swinetha
    wrote on last edited by
    #1

    hi,

    I want to draw (plot) a graph in Qt creator with the real time data

    Is there any special procedure to draw a graph?

    can any one help me.

    Thanks in advance

    1 Reply Last reply
    0
    • JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      Hi,

      For plotting, you need a 3rd-party library because Qt doesn't have its own plotting functions. Have a look at "Qwt":http://qwt.sourceforge.net/

      Someone else talked about his experiences here: http://technofreak-robotics.blogspot.com.au/2011/07/real-time-graph-plotting-in-gui-with-qt.html

      By the way, "Qt Creator" is the name of the "IDE":http://en.wikipedia.org/wiki/Integrated_development_environment; "Qt" is the name of the software library.

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      1 Reply Last reply
      0
      • S Offline
        S Offline
        Swinetha
        wrote on last edited by
        #3

        thanks for the reply.

        I found that QCustomPlot is also used to plot graphs. what is the difference between these two?

        1 Reply Last reply
        0
        • raven-worxR Offline
          raven-worxR Offline
          raven-worx
          Moderators
          wrote on last edited by
          #4

          QCustomPlot is also a 3rd party solution and not part of the official Qt release.

          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
          If you have a question please use the forum so others can benefit from the solution in the future

          1 Reply Last reply
          0
          • JKSHJ Offline
            JKSHJ Offline
            JKSH
            Moderators
            wrote on last edited by
            #5

            [quote author="Swinetha" date="1372232893"]thanks for the reply.

            I found that QCustomPlot is also used to plot graphs. what is the difference between these two?[/quote]You're welcome. You'll have to ask someone who has used both Qwt and QCustomPlot before though -- I have never used them.

            Try reading their documentation to see what's different.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Swinetha
              wrote on last edited by
              #6

              At first Itried to install qwt in my system.

              1st step
              /usr/local/Qt-5.0.2/bin/qmake qwt.pro
              its work fine.

              2nd step
              make

              but it's giving an error

              bq. cd src/ && ( test -e Makefile || /usr/local/Qt-5.0.2/bin/qmake /usr/local/qwt-6.1.0/src/src.pro -o Makefile ) && gmake -f Makefile
              Project ERROR: Unknown module(s) in QT: opengl
              gmake: *** [sub-src-make_first-ordered] Error 3

              any body know about this error?
              if knows please help me.

              1 Reply Last reply
              0
              • U Offline
                U Offline
                uwer
                wrote on last edited by
                #7

                Yout Qt version had been built without the opengl module. If you want to use an OpenGL plot canvas you need to rebuild Qt with this module - but usually you are not intersted in this feature and you can simply disable this feature for Qwt: edit qwtconfig.pri.

                Uwe

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  Swinetha
                  wrote on last edited by
                  #8

                  hi, thanks for the reply. opengl means?

                  to use this is there any procedure?

                  you said that,

                  bq. you can simply disable this feature for Qwt: edit qwtconfig.pri.

                  How can I disable it? could you explain me please

                  1 Reply Last reply
                  0
                  • JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by
                    #9

                    Try this: http://qwt.sourceforge.net/qwtinstall.html

                    Also: http://en.wikipedia.org/wiki/OpenGL

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      DerManu
                      wrote on last edited by
                      #10

                      QCustomPlot doesn't require installing. The simplest mode of operation is to just include the qcustomplot.h and qcustomplot.cpp file, that's it.

                      Of course, you can also compile a dynamic library from it, if you'd like.
                      Have a look at the "QCustomPlot webpage":http://www.workslikeclockwork.com/index.php/components/qt-plotting-widget/ It offers an introductory tutorial that should get you started quickly.
                      A new website is in progress with much more support material.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        Swinetha
                        wrote on last edited by
                        #11

                        DerManu said that

                        bq. The simplest mode of operation is to just include the qcustomplot.h and qcustomplot.cpp file, that’s it.

                        From where can I add these files?

                        Thanks in advance

                        1 Reply Last reply
                        0
                        • D Offline
                          D Offline
                          DerManu
                          wrote on last edited by
                          #12

                          [quote author="Swinetha" date="1372586436"]DerManu said thatFrom where can I add these files?[/quote]

                          Just download the QCustomPlot.tar.gz package from the download section (at the bottom of the page). In there, you'll find the .h/.cpp files. Copy them to your local project directory, and add them to your project. In QtCreator, right click on the root project icon in the top left sidebar, select "Add Existing Files..." to do that.
                          Then just #include "qcustomplot.h" wherever you need it (e.g. in your mainwindow.h).
                          Have a look at the webpage, it's pretty well explained there. The examples project should also help alot in getting started (that's also in the download package).

                          1 Reply Last reply
                          0
                          • H Offline
                            H Offline
                            harshanaj
                            wrote on last edited by
                            #13

                            Compile Qwt :
                            Create visual studio project and copy only the header files and cpp files to the project and just compile. You can get the Qtw dll and libs.

                            QCustomPlot : does not have that much performance when it comes to adding real time data.
                            graph will lag after adding 100k points and will lag even more when few series are overlapped.

                            i think Qwt is much better choice than QCustomPlot,, but lack documentation is big issue. They have few doxygen generated documents, but they will be of little help.

                            1 Reply Last reply
                            0
                            • mrjjM Offline
                              mrjjM Offline
                              mrjj
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Hi and welcome
                              The mailing list is pretty good source for help combined with the samples.

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                maximo
                                wrote on last edited by
                                #15

                                Although this post is rather old, here's my two cents:

                                http://stackoverflow.com/questions/32419897/drawing-simple-bar-charts-in-qml

                                With QQuickWidget, you basically get a javascript accessible canvas that acts sort of like webkit's canvas (with some exceptions), and the javascript borrows from Chromium, minus the bulk of Chromium. I think it's v8 engine? Anyway, someone figured out how to port the chartjs.org project code over to this on Github. That means you can draw charts in Javascript, which is a whole lot easier than drawing them in other ways.

                                1 Reply Last reply
                                0

                                • Login

                                • Login or register to search.
                                • First post
                                  Last post
                                0
                                • Categories
                                • Recent
                                • Tags
                                • Popular
                                • Users
                                • Groups
                                • Search
                                • Get Qt Extensions
                                • Unsolved