##// END OF EJS Templates
Log domains update when axis base changes. LogAxis fix for labelFormat
Marek Rosa -
r2293:f2379b79baf8
parent child
Show More
@@ -466,7 +466,18 QStringList ChartAxis::createLogValueLabels(qreal min, qreal max, qreal base, in
466 QByteArray array = format.toLatin1();
466 QByteArray array = format.toLatin1();
467 for (int i = firstTick; i < ticks + firstTick; i++) {
467 for (int i = firstTick; i < ticks + firstTick; i++) {
468 qreal value = qPow(base, i);
468 qreal value = qPow(base, i);
469 labels << QString().sprintf(array, value);
469 if (format.contains("d")
470 || format.contains("i")
471 || format.contains("c"))
472 labels << QString().sprintf(array, (qint64)value);
473 else if (format.contains("u")
474 || format.contains("o")
475 || format.contains("x", Qt::CaseInsensitive))
476 labels << QString().sprintf(array, (quint64)value);
477 else if (format.contains("f", Qt::CaseInsensitive)
478 || format.contains("e", Qt::CaseInsensitive)
479 || format.contains("g", Qt::CaseInsensitive))
480 labels << QString().sprintf(array, value);
470 }
481 }
471 }
482 }
472
483
@@ -186,11 +186,15 bool LogXLogYDomain::detachAxis(QAbstractAxis* axis)
186 void LogXLogYDomain::handleVerticalAxisBaseChanged(qreal baseY)
186 void LogXLogYDomain::handleVerticalAxisBaseChanged(qreal baseY)
187 {
187 {
188 m_logBaseY = baseY;
188 m_logBaseY = baseY;
189 m_logMinY = log10(m_minY) / log10(m_logBaseY);
190 m_logMaxY = log10(m_maxY) / log10(m_logBaseY);
189 }
191 }
190
192
191 void LogXLogYDomain::handleHorizontalAxisBaseChanged(qreal baseX)
193 void LogXLogYDomain::handleHorizontalAxisBaseChanged(qreal baseX)
192 {
194 {
193 m_logBaseX = baseX;
195 m_logBaseX = baseX;
196 m_logMinX = log10(m_minX) / log10(m_logBaseX);
197 m_logMaxX = log10(m_maxX) / log10(m_logBaseX);
194 }
198 }
195
199
196 // operators
200 // operators
@@ -180,6 +180,8 bool LogXYDomain::detachAxis(QAbstractAxis* axis)
180 void LogXYDomain::handleHorizontalAxisBaseChanged(qreal baseX)
180 void LogXYDomain::handleHorizontalAxisBaseChanged(qreal baseX)
181 {
181 {
182 m_logBaseX = baseX;
182 m_logBaseX = baseX;
183 m_logMinX = log10(m_minX) / log10(m_logBaseX);
184 m_logMaxX = log10(m_maxX) / log10(m_logBaseX);
183 }
185 }
184
186
185 // operators
187 // operators
@@ -179,6 +179,8 bool XLogYDomain::detachAxis(QAbstractAxis* axis)
179 void XLogYDomain::handleVerticalAxisBaseChanged(qreal baseY)
179 void XLogYDomain::handleVerticalAxisBaseChanged(qreal baseY)
180 {
180 {
181 m_logBaseY = baseY;
181 m_logBaseY = baseY;
182 m_logMinY = log10(m_minY) / log10(m_logBaseY);
183 m_logMaxY = log10(m_maxY) / log10(m_logBaseY);
182 }
184 }
183
185
184 // operators
186 // operators
General Comments 0
You need to be logged in to leave comments. Login now