diff options
author | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2014-10-23 07:46:21 +0300 |
---|---|---|
committer | Titta Heikkala <titta.heikkala@theqtcompany.com> | 2014-10-23 09:15:27 +0300 |
commit | d650724753554d586d07ee15d8140acc1c603f29 (patch) | |
tree | 83bb799627034fc7cc11f417bbf60a62bcabd422 | |
parent | 5490e1de47f4b96f6634a074dfd3369f0311ffce (diff) |
Fix bar category axis labels
The labels are now created only for the categories within the current
range.
Change-Id: I1f1b5c9245254b18c87f810986e29d73a1a7a72e
Task-number: QTRD-3016
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@theqtcompany.com>
-rw-r--r-- | src/charts/axis/barcategoryaxis/chartbarcategoryaxisx.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/charts/axis/barcategoryaxis/chartbarcategoryaxisx.cpp b/src/charts/axis/barcategoryaxis/chartbarcategoryaxisx.cpp index c911ebb9..3a8c1b64 100644 --- a/src/charts/axis/barcategoryaxis/chartbarcategoryaxisx.cpp +++ b/src/charts/axis/barcategoryaxis/chartbarcategoryaxisx.cpp @@ -72,7 +72,7 @@ QStringList ChartBarCategoryAxisX::createCategoryLabels(const QVector<qreal>& la for (int i = 0; i < layout.count() - 1; ++i) { qreal x = qFloor((((layout[i] + layout[i + 1]) / 2 - gridRect.left()) * d + min() + 0.5)); - if ((x < m_categoriesAxis->categories().count()) && (x >= 0)) { + if (x < max() && (x >= 0)) { result << m_categoriesAxis->categories().at(x); } else { // No label for x coordinate |