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. How to plot a graph in Qt without using QWT
Forum Update on Monday, May 27th 2025

How to plot a graph in Qt without using QWT

Scheduled Pinned Locked Moved General and Desktop
12 Posts 5 Posters 29.5k 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
    shoyeb
    wrote on last edited by
    #1

    Hi,

    i want to draw an X-Y plot using Qt libraries..
    can anyone tell me how can i acheive this...

    i know that it can be done using QWT, but want to do it in Qt..
    please help me..

    thanx in advance...

    There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      lgeyer
      wrote on last edited by
      #2

      Create your own widget by subclassing QWidget and reimplementing painEvent().

      I strongly recommend that you take a look at the "examples":http://developer.qt.nokia.com/doc/qt-4.8/widgets-analogclock.html or a "book":http://www.qtrac.eu/marksummerfield.html first.

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

        thanks lukas...

        now when i draw my XY plot, then its gonna have x-axis and y-axis...

        now when it want to plot apoint in the graph, then the point is not coming exactly on the graph, its due the fact that they are being drawn on the scale coordinates so what can i do to make it work properly..

        There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

        1 Reply Last reply
        0
        • L Offline
          L Offline
          lgeyer
          wrote on last edited by
          #4

          Did you transform the painter in any way? Are you using widget local coordinates? Have you considered any border you have drawn?

          C++ GUI Programming with Qt 4 (First Edition), which is available for free at the link found in my previous post, has a chapter about custom widgets using the example of a plot widget, which supports zooming and scaling.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            shoyeb
            wrote on last edited by
            #5

            @lukas thank u..

            i will try that and get back to u..

            There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              David_Gil
              wrote on last edited by
              #6

              Hi!

              I also want to plot graphs, but I don't want to make a new program because there are already good ones and I don't have the level to make something better.

              The approach I will probably take is using "SciDAVis":http://scidavis.sourceforge.net/, which is written in Qt and has a plugin interface.

              I let you know this in case it's useful, but I suppose you want to write your own.

              Regards

              1 Reply Last reply
              0
              • S Offline
                S Offline
                shoyeb
                wrote on last edited by
                #7

                @ david_gil thanx..

                There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

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

                  @david_gil

                  i downloaded the link u gave and i was reading the installation instructions, and it is saying that before installing it i must hve python installed on my machine...

                  and i am not havin python installed, also i dont want to install it...

                  i wanna do it without using python...
                  how can i do this...

                  There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.

                  1 Reply Last reply
                  0
                  • D Offline
                    D Offline
                    David_Gil
                    wrote on last edited by
                    #9

                    Hi,

                    Sorry, I thought it was a good idea, but I've seen that SciDAVis plugin capabilities can be found only in the bleeding edge version (0.3.0). Here you can see "that version's classes":http://scidavis.sourceforge.net/contributing/API/unstable/classes.html.

                    Regards

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

                      Hi!

                      Perhaps you still find it interesting: http://www.workslikeclockwork.com/index.php/components/qt-plotting-widget/

                      It isn't QWT and seems very customizable.

                      Take care

                      1 Reply Last reply
                      0
                      • W Offline
                        W Offline
                        Wilk
                        wrote on last edited by
                        #11

                        Hello.
                        Do you have any reasons for not to use Qwt?

                        1 Reply Last reply
                        0
                        • A Offline
                          A Offline
                          andre
                          wrote on last edited by
                          #12

                          Mosaic also "has some plotting components":http://www.mosaicsoftware.net/products/qt/ you might be interested in.

                          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