[solved] xy data plot in QML
-
Hello,
Still a newb, but...I need a QML widget that draws xy plots (not a bar graph) with a vector of data (from C++ that may arrive anytime.. so also need a
way to notify the widget about new data arrival).I notice qt3d project and all its awesome fanciness.
But I do not see even a simple xy plot/graph widget I can use in QML.
I know about QWT, but I would rather avoid using it: I asked question how to integrate with QML but got very short,cryptic incomplete response that did not help at all).
I saw a discussion about creating a chart widget but it seems stalled (IIRC, waiting for scenegraph changes).
If there is 3d graphics, why is there no 2d? Should I even consider using qt3d for drawing xy plots?
If anyone have a complete functional example in QML that I could learn from, then of course that would be excellent.
Thank you.
-
If you can paint (using QPainter) then it's easy to integrate to QML.
I don't know QWT, but if they paint, you can easily integrate that into QML.
There is no 2d graphics, because it's already there (QPainter).
-
Thanks for the replies....
To geronik I would say:
Google charts is NOT an answer. It was not even the question.To me, the lack of a graph widget is a big glaring hole in QML functionality, especially when you see all the very cool widgets that do exist.
If as minimoog77 suggests it is easy, then why isn't there even ONE that is part of the standard qt set of cool widgets?
-
I sad that integration with code that already uses QPainter is easy, not that plotting graph is easy to do. :)
I don't have experience with QWT, but you could use or look their code how they are painting xy graph. Inherit QDeclarativeItem, do your own painting, and that's it.
Qt was and is providing more or less standard widgets, it's not plotting library.
-
Check QML Canvas: http://qt.gitorious.org/qt-labs/qmlcanvas
-
To get another idea you could look at this "example":http://www.developer.nokia.com/Community/Wiki/CS001627_-_Creating_a_custom_QML_element_with_Qt of drawing a line and expand on the concept.