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. Can I draw this type of chart using Qt charts ?
Forum Updated to NodeBB v4.3 + New Features

Can I draw this type of chart using Qt charts ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 672 Views 3 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.
  • C Offline
    C Offline
    cpper
    wrote on 29 Mar 2019, 19:11 last edited by cpper
    #1

    This is a screenshot of the battery stats from my phone:
    0_1553886372756_Screenshot_2019-03-29-21-04-58.png

    Can I do something similar using Qt Charts ? The closest thing seems to be QHorizontalStackedBarSeries, but it doesn't seem to do the job.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Kent-Dorfman
      wrote on 30 Mar 2019, 22:56 last edited by
      #2

      Doubtful, but the implementation of such a chart would be trivial. You are wanting a 1-dimensional chart, where the second dimension is expressed as a color change. As near as I can tell, the Qt Charts are all 2-dimensional, or rotate around a center point.

      K 1 Reply Last reply 30 Mar 2019, 23:01
      0
      • K Kent-Dorfman
        30 Mar 2019, 22:56

        Doubtful, but the implementation of such a chart would be trivial. You are wanting a 1-dimensional chart, where the second dimension is expressed as a color change. As near as I can tell, the Qt Charts are all 2-dimensional, or rotate around a center point.

        K Offline
        K Offline
        kshegunov
        Moderators
        wrote on 30 Mar 2019, 23:01 last edited by
        #3

        @Kent-Dorfman said in Can I draw this type of chart using Qt charts ?:

        Doubtful, but the implementation of such a chart would be trivial.

        Nothing is trivial with QtCharts, and I don't kid around.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        0
        • K Offline
          K Offline
          Kent-Dorfman
          wrote on 30 Mar 2019, 23:25 last edited by
          #4

          @kshegunov said in Can I draw this type of chart using Qt charts ?:

          Nothing is trivial with QtCharts, and I don't kid around.

          I was suggesting that it's probably NOT doable in Qt Charts, but that the custom widget to achive the desired result is kind of trivial.

          K 1 Reply Last reply 30 Mar 2019, 23:30
          1
          • K Kent-Dorfman
            30 Mar 2019, 23:25

            @kshegunov said in Can I draw this type of chart using Qt charts ?:

            Nothing is trivial with QtCharts, and I don't kid around.

            I was suggesting that it's probably NOT doable in Qt Charts, but that the custom widget to achive the desired result is kind of trivial.

            K Offline
            K Offline
            kshegunov
            Moderators
            wrote on 30 Mar 2019, 23:30 last edited by
            #5

            Ah, okay then, my bad. Possible alternatives are QCustomPlot or Qwt if the licenses can be satisfied.

            Read and abide by the Qt Code of Conduct

            1 Reply Last reply
            1
            • C Offline
              C Offline
              cpper
              wrote on 31 Mar 2019, 09:47 last edited by
              #6

              I ended up using QPainter's fillRect() on a QPixmap ... does the job.
              Thanks guys :)

              1 Reply Last reply
              3

              1/6

              29 Mar 2019, 19:11

              • Login

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