what are easies way to show x,y plot using qt ?
-
i want possible ways to draw x,y plot for showing loss on y axis and x axis 2 frequency. so when value come at that time continuous line based graph.
i also have to show the image at lowest loss with applied frequency.
So how to achieve this what are the technical concepts and ways qt provide for qml based cmake project ?
i have to quickly identify and propose the solution for same so i can start work on this.
what is the approach for it ?
-
To create an x,y plot showing loss on the y-axis and frequency on the x-axis in a QML-based CMake project, you can use the Qt Charts module for dynamic line plotting, and integrate QImage or QQuickImageProvider to display the image corresponding to the lowest loss value. To achieve this, you will need to set up QML for the UI and backend C++ for handling data updates and image retrieval.
-
-
What is exactly the problem?
-
@jsulm actually in past we have used qcustomplot library for plotting this type of requirement. but it need commercial license though we have qt commercial license. but now as you have suggested the qt chart. So i want to know what is difference between them when we use it ? which is more better when lots of data need to reflect more frequently and also image for lowest point need to be get shown?
This the main thing i want to know...
-
@Qt-embedded-developer said in what are easies way to show x,y plot using qt ?:
qcustomplot
Never used it, so can't compare to QtCharts
-
@Qt-embedded-developer
You want to show an image (other than background) at some place on a Qt chart? I don't think that is possible (or there is no method for it, don't know if you can fudge it, not sure you can get the location of a plotted point). -
@Qt-embedded-developer
I would guess use a plotting package which supports that, unless someone else tells you how to do it for Qt Charts. Qt Charts is not the most powerful/flexible of plotting packages, so deciding you want some feature and then finding it does not support that is not the best approach. If QCustomPlot supported this kind of thing easily then maybe that is the more suitable package.Having said the above.
QChartView
is aQGraphicsView
, and so presumably backed by aQGraphicsScene
for the chart. You can put (your own) things on aQGraphicsScene
. The problem I think is identifying where you put your thing. Is it to be next to some particular point? Is it just supposed to be anywhere? -
@Qt-embedded-developer said in what are easies way to show x,y plot using qt ?:
it need commercial license though we have qt commercial license.
QCustomPlot is not official Qt.
What part of QCustomPlot have you used in the past to achieve what you are trying to do now?@Qt-embedded-developer said in what are easies way to show x,y plot using qt ?:
Can you guide me what is better when lots of data point to show and every 20 ms I have to reflect on graph
As always: think about what data points you really need to show. A real-time plot with 100.000 or even 10.000 data points makes no sense since the human eye can't keep on tracking these all at once.
@Qt-embedded-developer said in what are easies way to show x,y plot using qt ?:
it is wherever the low point come at runtime. So at run time this image move because for different value this loss value may decrease.
I don't know either what this means. Show image where?! Or just take the lowest point value from your data plot/graph and show your image elsewhere?!
-
@Pl45m4 said in what are easies way to show x,y plot using qt ?:
QCustomPlot is not official Qt.
What part of QCustomPlot have you used in the past to achieve what you are trying to do now?i have used it to show live data of sensor .
-
@Pl45m4 said in what are easies way to show x,y plot using qt ?:
I don't know either what this means. Show image where?! Or just take the lowest point value from your data plot/graph and show your image elsewhere?!
-
@Qt-embedded-developer
Have a look at the callout example: https://doc.qt.io/qt-5/qtcharts-callout-example.htmlSee also https://forum.qt.io/topic/91261/how-to-implement-displaying-information-about-points-in-qcharts and https://stackoverflow.com/questions/41281693/qt-charts-how-to-display-a-specific-point-value-on-x-and-y-axis
-
Hi Do we have any alternative to implement this type of graph except QT Chart and QCustomPlot ?
-
@Qt-embedded-developer
Google forQt plotting
orQt chart
orQt graph
or whatever else you can think of. E.g. JKQTPlotter - A Qt Plotting Library (LGPL licence instead of QCustomPlot's GPL). Or https://forum.qt.io/topic/89727/best-charting-library-to-work-with-qt/5 claims "Qwt is a best" (also LGPL).Or write one yourself using
QGraphicsScene
/QGraphicsView
.If you have already written for QCustomPlot and it works and does what you want, since you already pay some money for Qt commercial licence maybe the simplest/cost-effective is to pay them for a commercial licence too. Up to you how much time that is worth to completely re-implement.
Or since I have given you links for seemingly doing what you want with callouts on Qt Charts use that.