Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. How to draw histogram?
QtWS25 Last Chance

How to draw histogram?

Scheduled Pinned Locked Moved Solved 3rd Party Software
12 Posts 7 Posters 20.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.
  • M Offline
    M Offline
    mario5046
    wrote on 23 Dec 2011, 17:27 last edited by A Former User
    #1

    Anyone, please help me to draw histogram

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on 14 Oct 2017, 07:03 last edited by A Former User
      #11

      Here's an example how to draw a histogram (bar chart), provided you already have the data
      http://doc.qt.io/qt-5/qtcharts-barchart-example.html

      More charts examples: http://doc.qt.io/qt-5/qtcharts-examples.html

      1 Reply Last reply
      0
      • A Offline
        A Offline
        andre
        wrote on 23 Dec 2011, 17:34 last edited by
        #2

        Qt Creator is an IDE, just like visual studio or eclipse or netbeans. It is not relevant for your problem.

        But, if you have a QImage, how hard is it to loop over it's pixels to create a histogram? What is your problem with that?

        1 Reply Last reply
        1
        • M Offline
          M Offline
          mario5046
          wrote on 23 Dec 2011, 20:47 last edited by
          #3

          I don't know how to use Qwt in Qt. I get few errors.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            goetz
            wrote on 23 Dec 2011, 23:30 last edited by
            #4

            It has a width, it has a height - you should be able to construct two nested loops over it. It has a pixel method that takes x and y. What else do you need?

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mario5046
              wrote on 24 Dec 2011, 08:58 last edited by
              #5

              .

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on 24 Dec 2011, 10:52 last edited by
                #6

                Did you have a look to the documentation by any means?
                At the top of this page anybody can enter the documentation.

                There is an access method for "pixels":http://developer.qt.nokia.com/doc/qt-4.8/qimage.html#pixel
                These methods are returning QRbg. Details you may find under "QColor":http://developer.qt.nokia.com/doc/qt-4.8/qcolor.html

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • M Offline
                  M Offline
                  mario5046
                  wrote on 24 Dec 2011, 13:05 last edited by
                  #7

                  Please give me some examples

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    koahnig
                    wrote on 24 Dec 2011, 13:33 last edited by
                    #8

                    Qt does not have directly the possibility to draw histograms. There is "QWT":http://qwt.sourceforge.net/ using Qt for drawing graphs. This library supports also drawing a histogram. Unfortunately, I am not aware of a ready to use example.

                    Vote the answer(s) that helped you to solve your issue(s)

                    1 Reply Last reply
                    0
                    • G Offline
                      G Offline
                      goetz
                      wrote on 24 Dec 2011, 13:51 last edited by
                      #9

                      [quote author="mario5046" date="1324731901"]OK, but I don't know how to draw histogram. Can you give me any example?[/quote]

                      You would have to ask the lazyweb for that or buy a nice text book on image processing. As koahnig already stated, Qt does not have any builtin means for that.

                      But if you don't know how an image histogram is made, what are you going to do with it?

                      http://www.catb.org/~esr/faqs/smart-questions.html

                      1 Reply Last reply
                      0
                      • Q Offline
                        Q Offline
                        qxoz
                        wrote on 28 Dec 2011, 07:09 last edited by
                        #10

                        May be this can be helpful:
                        "NightChart":http://qt-apps.org/content/show.php/NightCharts(Draw+Charts)?content=132560

                        1 Reply Last reply
                        0
                        • ? Offline
                          ? Offline
                          A Former User
                          wrote on 14 Oct 2017, 07:03 last edited by A Former User
                          #11

                          Here's an example how to draw a histogram (bar chart), provided you already have the data
                          http://doc.qt.io/qt-5/qtcharts-barchart-example.html

                          More charts examples: http://doc.qt.io/qt-5/qtcharts-examples.html

                          1 Reply Last reply
                          0
                          • J Offline
                            J Offline
                            JulienMaille
                            wrote on 12 Nov 2017, 12:43 last edited by
                            #12
                            This post is deleted!
                            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