Repository navigation
Expand file tree
/
Copy pathFinancialGraph2D.cpp
More file actions
89 lines (78 loc) · 2.13 KB
/
Copy pathFinancialGraph2D.cpp
File metadata and controls
89 lines (78 loc) · 2.13 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "wplot/FinancialGraph2D.h"
namespace WPlot {
FinancialGraph2D::FinancialGraph2D() :
CartesianGraph2D()
{}
/**
* Set data that must be plotted.
*
* @param[in] data Data.
*/
void FinancialGraph2D::setData(const Data &data) {
m_data = data;
}
/**
* Append an OHLC value.
*
* @param[in] ohlc OHLC point.
*/
void FinancialGraph2D::appendOHLC(const OHLCPoint &ohlc) {
m_data.append(ohlc);
}
/**
* Append an OHLC value.
*
* @param[in] x Coordinate in which data must be shown.
* @param[in] ohlc OHLC value.
*/
void FinancialGraph2D::appendOHLC(const double &x, const OHLC &ohlc) {
m_data.append(OHLCPoint(x, ohlc));
}
/**
* Append an OHLC value.
*
* @param[in] x Coordinate in which data must be shown.
* @param[in] open Open value.
* @param[in] high High value.
* @param[in] low Low value.
* @param[in] close Close value.
*/
void FinancialGraph2D::appendOHLC(const double &x, const double &open, const double &high, const double &low, const double &close) {
m_data.append(OHLCPoint(x, OHLC(open, high, low, close)));
}
/**
* Insert an OHLC data in specified data position.
*
* @param[in] index Position index.
* @param[in] ohlc OHLD data.
*/
void FinancialGraph2D::insertOHLC(const int &index, const OHLCPoint &ohlc) {
m_data.insert(index, ohlc);
}
/**
* Insert an OHLC data in specified data position.
*
* @param[in] index Position index.
* @param[in] x Coordinate in which data must be shown.
* @param[in] ohlc OHLC value.
*/
void FinancialGraph2D::insertOHLC(const int &index, const double &x, const OHLC &ohlc) {
m_data.insert(index, OHLCPoint(x, ohlc));
}
/**
* Insert an OHLC data in specified data position.
*
* @param[in] index Position index.
* @param[in] x Coordinate in which data must be shown.
* @param[in] open Open value.
* @param[in] high High value.
* @param[in] low Low value.
* @param[in] close Close value.
*/
void FinancialGraph2D::insertOHLC(const int &index, const double &x, const double &open, const double &high, const double &low, const double &close) {
m_data.insert(index, OHLCPoint(x, OHLC(open, high, low, close)));
}
void FinancialGraph2D::clear() {
m_data.clear();
}
} // namespace WPlot