diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-04-19 13:14:46 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-04-24 15:03:05 +0000 |
commit | 17011993257c0e5624ecf9d1836b28ffa68482cf (patch) | |
tree | 8c896a93fe2c9a4e06a3095cd53c9f9d92850757 | |
parent | cc4e79d6200b0495a5c4d1a7faa773906b1ac99e (diff) |
Calculate the available space for the title based on the height
Since the VerticalAxis will rotate 90 degrees then it needs to check for
the available height for the title and not the width. Otherwise it will
end up eliding the title unnecessarily.
Change-Id: I9dd651fdac9111277eb6137f4d9dabcf77330cab
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/charts/axis/verticalaxis.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/charts/axis/verticalaxis.cpp b/src/charts/axis/verticalaxis.cpp index d59d92b9..de33a388 100644 --- a/src/charts/axis/verticalaxis.cpp +++ b/src/charts/axis/verticalaxis.cpp @@ -105,7 +105,7 @@ void VerticalAxis::updateGeometry() //title QRectF titleBoundingRect; QString titleText = axis()->titleText(); - qreal availableSpace = axisRect.width() - labelPadding(); + qreal availableSpace = axisRect.height() - labelPadding(); if (!titleText.isEmpty() && titleItem()->isVisible()) { availableSpace -= titlePadding() * 2.0; qreal minimumLabelWidth = ChartPresenter::textBoundingRect(axis()->labelsFont(), |