How to draw histogram?
-
wrote on 23 Dec 2011, 17:27 last edited by A Former User
Anyone, please help me to draw histogram
-
wrote on 14 Oct 2017, 07:03 last edited by A Former User
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.htmlMore charts examples: http://doc.qt.io/qt-5/qtcharts-examples.html
-
wrote on 23 Dec 2011, 17:34 last edited by
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?
-
wrote on 23 Dec 2011, 20:47 last edited by
I don't know how to use Qwt in Qt. I get few errors.
-
wrote on 23 Dec 2011, 23:30 last edited by
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?
-
wrote on 24 Dec 2011, 08:58 last edited by
.
-
wrote on 24 Dec 2011, 10:52 last edited by
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 -
wrote on 24 Dec 2011, 13:05 last edited by
Please give me some examples
-
wrote on 24 Dec 2011, 13:33 last edited by
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.
-
wrote on 24 Dec 2011, 13:51 last edited by
[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?
-
wrote on 28 Dec 2011, 07:09 last edited by
May be this can be helpful:
"NightChart":http://qt-apps.org/content/show.php/NightCharts(Draw+Charts)?content=132560 -
wrote on 14 Oct 2017, 07:03 last edited by A Former User
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.htmlMore charts examples: http://doc.qt.io/qt-5/qtcharts-examples.html
-
wrote on 12 Nov 2017, 12:43 last edited byThis post is deleted!