I am using Qt Framework (C++) to create a bar chart of percentages. How to make make the Y-axis that shows percentages always remain at 100% even if none of the values are near 100%?
In this picture, the maximum percentage is only 80 and so the Y-axis shows only until 80.
How to make the chart show a scale of 100 in the Y-axis all the time?
Okay, I was setting the range as (100,100) instead of (0,100). The correct code is:
axisY->setRange(0,100);I also added
axisY->applyNiceNumbers();andagamAxisY->setTickCount(10);so that the graph is beautifully incremented by 10 percentage points from 0-100.Hope this helps someone out there.