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 ?

Can I draw this type of chart using Qt charts ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 665 Views
  • 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.
  • cpperC Offline
    cpperC Offline
    cpper
    wrote on 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
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on 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.

      kshegunovK 1 Reply Last reply
      0
      • Kent-DorfmanK Kent-Dorfman

        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.

        kshegunovK Offline
        kshegunovK Offline
        kshegunov
        Moderators
        wrote on 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
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on 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.

          kshegunovK 1 Reply Last reply
          1
          • Kent-DorfmanK Kent-Dorfman

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

            kshegunovK Offline
            kshegunovK Offline
            kshegunov
            Moderators
            wrote on 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
            • cpperC Offline
              cpperC Offline
              cpper
              wrote on last edited by
              #6

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

              1 Reply Last reply
              3

              • Login

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