0
0
mirror of https://github.com/fralx/LimeReport.git synced 2025-11-25 00:18:06 +03:00

Refactor axis data. Remove duplicate paint code

This commit is contained in:
Emil Sawicki
2022-01-18 10:56:05 +01:00
parent 95a11bdc14
commit dfa378970f
11 changed files with 295 additions and 92 deletions

37
limereport/lraxisdata.h Normal file
View File

@@ -0,0 +1,37 @@
#ifndef AXISDATA_H
#define AXISDATA_H
#include <QtGlobal>
namespace LimeReport {
class AxisData
{
public:
AxisData();
AxisData(qreal minValue, qreal maxValue);
int segmentCount() const;
qreal rangeMin() const;
qreal rangeMax() const;
qreal minValue() const;
qreal maxValue() const;
qreal step() const;
qreal delta() const;
private:
void calculateValuesAboveMax(qreal minValue, qreal maxValue, int segments);
qreal calculateNiceNum(qreal range, bool round);
qreal m_rangeMin;
qreal m_rangeMax;
qreal m_minValue;
qreal m_maxValue;
qreal m_step;
qreal m_delta;
int m_segmentCount;
};
};
#endif // AXISDATA_H