@@ -49,6 +49,11 QVector<qreal> ChartLogValueAxisX::calculateLayout() const | |||
|
49 | 49 | qreal ceilEdge = qCeil(leftEdge); |
|
50 | 50 | int tickCount = qAbs(qCeil(logMax) - qCeil(logMin)); |
|
51 | 51 | |
|
52 | // If the high edge sits exactly on the tick value, add a tick | |
|
53 | qreal highValue = logMin < logMax ? logMax : logMin; | |
|
54 | if (qFuzzyCompare(highValue, qreal(qCeil(highValue)))) | |
|
55 | tickCount++; | |
|
56 | ||
|
52 | 57 | points.resize(tickCount); |
|
53 | 58 | const QRectF &gridRect = gridGeometry(); |
|
54 | 59 | const qreal deltaX = gridRect.width() / qAbs(logMax - logMin); |
@@ -90,6 +95,12 QSizeF ChartLogValueAxisX::sizeHint(Qt::SizeHint which, const QSizeF &constraint | |||
|
90 | 95 | qreal logMax = std::log10(m_axis->max()) / std::log10(m_axis->base()); |
|
91 | 96 | qreal logMin = std::log10(m_axis->min()) / std::log10(m_axis->base()); |
|
92 | 97 | int tickCount = qAbs(qCeil(logMax) - qCeil(logMin)); |
|
98 | ||
|
99 | // If the high edge sits exactly on the tick value, add a tick | |
|
100 | qreal highValue = logMin < logMax ? logMax : logMin; | |
|
101 | if (qFuzzyCompare(highValue, qreal(qCeil(highValue)))) | |
|
102 | tickCount++; | |
|
103 | ||
|
93 | 104 | if (m_axis->max() > m_axis->min() && tickCount > 0) |
|
94 | 105 | ticksList = createLogValueLabels(m_axis->min(), m_axis->max(), m_axis->base(), tickCount, m_axis->labelFormat()); |
|
95 | 106 | else |
@@ -48,6 +48,11 QVector<qreal> ChartLogValueAxisY::calculateLayout() const | |||
|
48 | 48 | qreal ceilEdge = qCeil(leftEdge); |
|
49 | 49 | int tickCount = qAbs(qCeil(logMax) - qCeil(logMin)); |
|
50 | 50 | |
|
51 | // If the high edge sits exactly on the tick value, add a tick | |
|
52 | qreal highValue = logMin < logMax ? logMax : logMin; | |
|
53 | if (qFuzzyCompare(highValue, qreal(qCeil(highValue)))) | |
|
54 | tickCount++; | |
|
55 | ||
|
51 | 56 | points.resize(tickCount); |
|
52 | 57 | const QRectF &gridRect = gridGeometry(); |
|
53 | 58 | const qreal deltaY = gridRect.height() / qAbs(logMax - logMin); |
@@ -90,6 +95,12 QSizeF ChartLogValueAxisY::sizeHint(Qt::SizeHint which, const QSizeF &constraint | |||
|
90 | 95 | qreal logMax = std::log10(m_axis->max()) / std::log10(m_axis->base()); |
|
91 | 96 | qreal logMin = std::log10(m_axis->min()) / std::log10(m_axis->base()); |
|
92 | 97 | int tickCount = qAbs(qCeil(logMax) - qCeil(logMin)); |
|
98 | ||
|
99 | // If the high edge sits exactly on the tick value, add a tick | |
|
100 | qreal highValue = logMin < logMax ? logMax : logMin; | |
|
101 | if (qFuzzyCompare(highValue, qreal(qCeil(highValue)))) | |
|
102 | tickCount++; | |
|
103 | ||
|
93 | 104 | if (m_axis->max() > m_axis->min() && tickCount > 0) |
|
94 | 105 | ticksList = createLogValueLabels(m_axis->min(), m_axis->max(), m_axis->base(), tickCount, m_axis->labelFormat()); |
|
95 | 106 | else |
General Comments 0
You need to be logged in to leave comments.
Login now