Yet another "Charting in Qt" question



  • I know this is asked millions of times...

    I need to draw charts like this one for my AI project:

    !http://s3.picofile.com/file/7620577311/46089_378569132238921_67326311_n.jpg(sample)!

    After doing a research, I found Qwt, KDAB's charting lib, Digia's commercial charting tools and Qtiplot. I'm in the early stage of decide which one to use.

    Criteria:

    • Such a library/tool should be free (as in beer).
    • Sound and complete (I'm supposing you know what I'm talking about)
    • Support plotting data from XML schema or a SQL database (Qt SQL support integration is a plus point)
    • It should be fancy enough! Colors, CSS styles, and other fancy things..
    • I would like to export my plots to SVG or PDF or EPS to put them in final report, which is supposed to be written in llncs style
    • Easy to use

    I would like to hear your personal experience with these libraries. Screenshots of tools seems to be a little tricky! They're all pretty nice.



  • Some other features:

    • I might add notes, draw circles, zoom on some parts to emphasis something


  • I have used Qwt multiple times. It is a great library and is free (as in beer). Zoom is already in it with zoom box implementation.

    Although, creating your own plotter might be the way to go if your looking for specific graphics and sql implementation...depending on how fluent your Qt skills are.



  • [quote author="dvez43" date="1358191149"]I have used Qwt multiple times. It is a great library and is free (as in beer). Zoom is already in it with zoom box implementation.
    [/quote]
    I'm going to test Qwt and KDAB. Others seem to be non-free.
    [quote author="dvez43" date="1358191149"]
    Although, creating your own plotter might be the way to go if your looking for specific graphics and sql implementation...depending on how fluent your Qt skills are.
    [/quote]
    Ah... That is very time-consuming, and needs a solid experience. I don't think that I will need something very special like so.



  • When trying Qwt start with Qwt 6.1 ( release candidates are available, supporting Qt4 + Qt5 ):

    • Candlestick charts - like in the screenshot above - are one of its new features.
    • Another new feature you want to have is the scale engine for date/time values
    • the blue circles ( whatever they mean ) can be displayed with a shape item - when they are related to plot coordinates

    But in the end Qwt is a framework like QGraphicsView - you can customize it to display almost everything by overloading with your own code.

    Qwt is by far the most powerful and flexible plot/chart package for Qt - complex enough for a documentation explaining how all classes play together. Unfortunately all what exists is a doxygen documentation of the API.

    So the best way to start with Qwt is to have a look at the examples. The first example to look at is simpleplot, showing how to display a line chart with a few lines only.



  • After more research, and some tests, i found that Qwt is great. though that was not attracting at a very first glance, (in comparison with similar tools) It's somehow hidden! May be it needs more examples, tutorials and a better introduction page.

    It's pretty enough for my needs. I'm gonna try it. After doing my project, I will post some screenshots here.

    Thanks



  • Any idea if Qwt is suited for linecharts that need to be redreshed @30 fps?



  • Yes, I have done a realtime line graph (multiple lines with multiple markers) with Qwt using the Qwt timer objects for the replot(), refreshing at 100 mS plotting times.



  • I have tried with KDChart (2 lines with 512 points, no marker) but it's far from realtime.
    Mind sharing online examples/tutorials?



  • I didn't really use any online examples to write the code.

    Basically I subclassed a QwtPlot and used the built in timer Qwt has (using its event callback) to set the data on the plot, and use the replot() function to update the data on the graph.

    I had 3 vectors, with 20 mS data plotting analog data from a usb device. I actually showed 30 seconds worth of data on the graph as well. If I remember correctly, Qwt has an oscilloscope example that comes with the Qwt install package, I believe that's where I got the timer code from.

    All the other stuff is just populating the data arrays and setting the data to the Qwt plot lines when the timer fires. The styling abilities of the plot is quite nice too.

    Goodluck!



  • QWTplot obligates to opensource your code , if you compile it with your application ... please correct me if i am wrong ..



  • For the record: this statement is very wrong.

    The license of Qwt is the LGPL with some extra rules allowing statically linkage without having to show application code.

    Uwe


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.