##// END OF EJS Templates
category range handling fix
sauimone -
r1573:be2bb9da91cd
parent child
Show More
@@ -197,7 +197,7 void QCategoriesAxisPrivate::setMinCategory(const QString& minCategory)
197 return;
197 return;
198 }
198 }
199
199
200 int maxIndex = m_max;
200 int maxIndex = qFloor(m_max);
201 if (minIndex > maxIndex) {
201 if (minIndex > maxIndex) {
202 maxIndex = m_categories.count()-1;
202 maxIndex = m_categories.count()-1;
203 }
203 }
@@ -211,10 +211,12 void QCategoriesAxisPrivate::setMaxCategory(const QString& maxCategory)
211 if (maxIndex == -1) {
211 if (maxIndex == -1) {
212 return;
212 return;
213 }
213 }
214 if (maxIndex < m_min) {
214
215 m_min = 0;
215 int minIndex = qCeil(m_min);
216 if (maxIndex < minIndex) {
217 minIndex = 0;
216 }
218 }
217 setRange(m_min - 0.5, maxIndex + 0.5);
219 setRange(minIndex - 0.5, maxIndex + 0.5);
218 }
220 }
219
221
220 void QCategoriesAxisPrivate::setRangeCategory(const QString& minCategory, const QString& maxCategory)
222 void QCategoriesAxisPrivate::setRangeCategory(const QString& minCategory, const QString& maxCategory)
General Comments 0
You need to be logged in to leave comments. Login now