-
Notifications
You must be signed in to change notification settings - Fork 9
/
axis_pair.cpp
52 lines (39 loc) · 1 KB
/
axis_pair.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "axis_pair.h"
AxisPair::AxisPair(NumberAxis num, TimeAxis time): numberAxis(num), timeAxis(time) {
}
float AxisPair::getTimeX(QDateTime time) const {
return timeAxis.timeToCoord(time);
}
float AxisPair::getPriceY(float price) const {
return numberAxis.numToCoord(price);
}
float AxisPair::getWidth() const {
return timeAxis.getMaxCoord();
}
float AxisPair::getHeight() const {
return numberAxis.getMaxCoord();
}
QDateTime AxisPair::getMinTime() const {
return timeAxis.getMinTime();
}
QDateTime AxisPair::getMaxTime() const {
return timeAxis.getMaxTime();
}
float AxisPair::getMinPrice() const {
return numberAxis.getMinNum();
}
float AxisPair::getMaxPrice() const {
return numberAxis.getMaxNum();
}
float AxisPair::getMinTimeX() const {
return getTimeX(getMinTime());
}
float AxisPair::getMaxTimeX() const {
return getTimeX(getMaxTime());
}
float AxisPair::getMinPriceY() const {
return getPriceY(getMinPrice());
}
float AxisPair::getMaxPriceY() const {
return getPriceY(getMaxPrice());
}