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. QStackedBarSeries to show count on top of Bar
Qt 6.11 is out! See what's new in the release blog

QStackedBarSeries to show count on top of Bar

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 423 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.
  • N Offline
    N Offline
    npatil15
    wrote on last edited by npatil15
    #1

    Hello

    I'm using QStackedBarSeries to display multiple bars using QChartView.
    But want to display a count of a bar on the top of the bar.

    Example:
    class QAbstractBarSeries // has below methods which use to set label position:
    
    enum LabelsPosition {
            LabelsCenter = 0,
            LabelsInsideEnd,
            LabelsInsideBase,
            LabelsOutsideEnd
        };
    
    void setLabelsPosition(QAbstractBarSeries::LabelsPosition position);
    

    Tried above method to set position and it works but the option LabelsOutsideEnd is not working for me (which I think it helps to set label over the bar). I don't understand why it's not working?

    Please check the enums on qabstractbarseries

    For below attachment, I have tried option LabelsInsideEnd
    bars.PNG

    Or is there any option to set labels over (outside top) the bars?

    1 Reply Last reply
    0
    • N Offline
      N Offline
      npatil15
      wrote on last edited by npatil15
      #2

      Ahh, I got it.

      It is because the color of label is white and the outside color of the bar is also white and that hiding it on the chart. I found this by changing the theme of the chart.

      Now the question is can I change the color of that lable count ?

      1 Reply Last reply
      0

      • Login

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