Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QStackedBarSeries to show count on top of Bar



  • 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?



  • 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 ?


Log in to reply