summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2015-05-19 13:22:51 (GMT)
committerAlbert Astals Cid <aacid@kde.org>2015-05-19 13:22:51 (GMT)
commit7c589d017053d90a235346034754c1ae234b58f5 (patch)
tree09e8388e16c1d12a73ea29f85614e9454852d343
parent4162048589abae0a7b42e316f9f8bf80c81ddc33 (diff)
Compile in Mac?
-rw-r--r--src/xychartcore.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/xychartcore.cpp b/src/xychartcore.cpp
index aa6ef52..ffebfcc 100644
--- a/src/xychartcore.cpp
+++ b/src/xychartcore.cpp
@@ -21,6 +21,7 @@
#include <QPainter>
#include <QAbstractTableModel>
#include <assert.h>
+#include <cmath>
const qreal divisors[] = { 1, 2, 5};
const int ndivisors = sizeof(divisors) / sizeof(divisors[0]);
@@ -283,7 +284,7 @@ QList<qreal> XYChartCore::generateAxisLabels(const qreal minValue, const qreal m
// Distance between labels with preferred number of labels
qreal div = abs(maxValue - minValue) / m_axisLabelCountGoal;
// Find power of 10 to scale preferred increments to
- qreal scale = std::pow(10, floor(log10(div)));
+ qreal scale = std::pow(10, floor(std::log10(div)));
// Find closest increment that has at maximum div distance between labels
qreal increment = divisors[0] * scale;