Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.11.2
-
None
Description
When I create a horizontal bar chart with long category labels, the labels along the Y axis are not clipped and stretch beyond the chart area, as shown on the right side of the following image.
The following fix resolved the issue:
--- a/qt-everywhere-src-5.11.2/qtcharts/src/charts/axis/verticalaxis.cpp +++ b/qt-everywhere-src-5.11.2/qtcharts/src/charts/axis/verticalaxis.cpp @@ -105,7 +105,7 @@ void VerticalAxis::updateGeometry() //title QRectF titleBoundingRect; QString titleText = axis()->titleText(); - qreal availableSpace = axisRect.height() - labelPadding(); + qreal availableSpace = axisRect.width() - labelPadding(); if (!titleText.isEmpty() && titleItem()->isVisible()) { availableSpace -= titlePadding() * 2.0; qreal minimumLabelWidth = ChartPresenter::textBoundingRect(axis()->labelsFont(),
The test program is attached.
I'm using qt-5.11.2, but I believe this bug may affect at least qt-5.12.1 because its verticalaxis.cpp also uses axisRect.height() to compute availableSpace.