Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. what are easies way to show x,y plot using qt ?
Forum Updated to NodeBB v4.3 + New Features

what are easies way to show x,y plot using qt ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
19 Posts 5 Posters 1.8k Views 2 Watching
  • 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.
  • Q Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    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 ?

    jsulmJ 1 Reply Last reply
    0
    • S Offline
      S Offline
      Shao62
      wrote on last edited by
      #2

      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.

      <a href="https://apkocean.io/">Apkocean</a>

      1 Reply Last reply
      0
      • Q Qt embedded developer

        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 ?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #3

        @Qt-embedded-developer https://doc.qt.io/qt-6/qtcharts-index.html

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Q Offline
          Q Offline
          Qt embedded developer
          wrote on last edited by Qt embedded developer
          #4

          @jsulm @Shao62

          Can you guide me what is better when lots of data point to show and every 20 ms I have to reflect on graph

          1 Reply Last reply
          0
          • jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            What is exactly the problem?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            Q 1 Reply Last reply
            0
            • jsulmJ jsulm

              What is exactly the problem?

              Q Offline
              Q Offline
              Qt embedded developer
              wrote on last edited by
              #6

              @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...

              jsulmJ Pl45m4P 2 Replies Last reply
              0
              • Q Qt embedded developer

                @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...

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @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

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                Q 1 Reply Last reply
                1
                • jsulmJ jsulm

                  @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

                  Q Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by
                  #8

                  @jsulm Can you tell me using qt chart if i want to show image at sent lowest x,y point how i can achieve this what property allow me to do this ?

                  JonBJ 1 Reply Last reply
                  0
                  • Q Qt embedded developer

                    @jsulm Can you tell me using qt chart if i want to show image at sent lowest x,y point how i can achieve this what property allow me to do this ?

                    JonBJ Offline
                    JonBJ Offline
                    JonB
                    wrote on last edited by
                    #9

                    @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).

                    Q 1 Reply Last reply
                    0
                    • JonBJ JonB

                      @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).

                      Q Offline
                      Q Offline
                      Qt embedded developer
                      wrote on last edited by
                      #10

                      @JonB Then what is solution because as per my requirement i need to show diamond shape and inside that circle to show lowest point?

                      JonBJ 1 Reply Last reply
                      0
                      • Q Qt embedded developer

                        @JonB Then what is solution because as per my requirement i need to show diamond shape and inside that circle to show lowest point?

                        JonBJ Offline
                        JonBJ Offline
                        JonB
                        wrote on last edited by
                        #11

                        @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 a QGraphicsView, and so presumably backed by a QGraphicsScene for the chart. You can put (your own) things on a QGraphicsScene. 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?

                        Q 1 Reply Last reply
                        1
                        • JonBJ JonB

                          @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 a QGraphicsView, and so presumably backed by a QGraphicsScene for the chart. You can put (your own) things on a QGraphicsScene. 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?

                          Q Offline
                          Q Offline
                          Qt embedded developer
                          wrote on last edited by
                          #12

                          @JonB 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.

                          1 Reply Last reply
                          0
                          • JonBJ Offline
                            JonBJ Offline
                            JonB
                            wrote on last edited by
                            #13

                            I have no idea what that means. And I don't really think it will affect the situation. If you know what the desired coordinates are you could try adding an item to the graphics scene and see what comes out.

                            1 Reply Last reply
                            1
                            • Q Qt embedded developer

                              @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...

                              Pl45m4P Offline
                              Pl45m4P Offline
                              Pl45m4
                              wrote on last edited by
                              #14

                              @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?!


                              If debugging is the process of removing software bugs, then programming must be the process of putting them in.

                              ~E. W. Dijkstra

                              Q 2 Replies Last reply
                              2
                              • Pl45m4P Pl45m4

                                @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?!

                                Q Offline
                                Q Offline
                                Qt embedded developer
                                wrote on last edited by
                                #15

                                @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 .

                                1 Reply Last reply
                                0
                                • Pl45m4P Pl45m4

                                  @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?!

                                  Q Offline
                                  Q Offline
                                  Qt embedded developer
                                  wrote on last edited by Qt embedded developer
                                  #16

                                  @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?!

                                  6a3536ad-c2fb-48d1-89b7-99dc6162f53a-image.png

                                  @JonB and @Pl45m4 i want graph like above image.

                                  JonBJ 1 Reply Last reply
                                  0
                                  • Q Qt embedded developer

                                    @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?!

                                    6a3536ad-c2fb-48d1-89b7-99dc6162f53a-image.png

                                    @JonB and @Pl45m4 i want graph like above image.

                                    JonBJ Offline
                                    JonBJ Offline
                                    JonB
                                    wrote on last edited by
                                    #17

                                    @Qt-embedded-developer
                                    Have a look at the callout example: https://doc.qt.io/qt-5/qtcharts-callout-example.html

                                    See 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

                                    1 Reply Last reply
                                    1
                                    • Q Offline
                                      Q Offline
                                      Qt embedded developer
                                      wrote on last edited by
                                      #18

                                      Hi Do we have any alternative to implement this type of graph except QT Chart and QCustomPlot ?

                                      JonBJ 1 Reply Last reply
                                      0
                                      • Q Qt embedded developer

                                        Hi Do we have any alternative to implement this type of graph except QT Chart and QCustomPlot ?

                                        JonBJ Offline
                                        JonBJ Offline
                                        JonB
                                        wrote on last edited by JonB
                                        #19

                                        @Qt-embedded-developer
                                        Google for Qt plotting or Qt chart or Qt 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.

                                        1 Reply Last reply
                                        1

                                        • Login

                                        • Login or register to search.
                                        • First post
                                          Last post
                                        0
                                        • Categories
                                        • Recent
                                        • Tags
                                        • Popular
                                        • Users
                                        • Groups
                                        • Search
                                        • Get Qt Extensions
                                        • Unsolved