source: orbit/iOS/Orbit/Orbit/CorePlotHeaders/CPTTradingRangePlot.h @ f323fb4

Raw_EEG_Plot
Last change on this file since f323fb4 was a9059a5, checked in by Steve Castellotti <sc@…>, 9 years ago

Arduino:

  • updated to permit custom setting of Throttle, Yaw, and Pitch

Android:

  • Minor tweak to Configuration location

iOS:

  • Property mode set to 100644
File size: 9.3 KB
Line 
1#import "CPTDefinitions.h"
2#import "CPTPlot.h"
3#import <Foundation/Foundation.h>
4
5/// @file
6
7@class CPTLineStyle;
8@class CPTMutableNumericData;
9@class CPTNumericData;
10@class CPTTradingRangePlot;
11@class CPTFill;
12
13/// @ingroup plotBindingsTradingRangePlot
14/// @{
15extern NSString *const CPTTradingRangePlotBindingXValues;
16extern NSString *const CPTTradingRangePlotBindingOpenValues;
17extern NSString *const CPTTradingRangePlotBindingHighValues;
18extern NSString *const CPTTradingRangePlotBindingLowValues;
19extern NSString *const CPTTradingRangePlotBindingCloseValues;
20extern NSString *const CPTTradingRangePlotBindingIncreaseFills;
21extern NSString *const CPTTradingRangePlotBindingDecreaseFills;
22extern NSString *const CPTTradingRangePlotBindingLineStyles;
23extern NSString *const CPTTradingRangePlotBindingIncreaseLineStyles;
24extern NSString *const CPTTradingRangePlotBindingDecreaseLineStyles;
25/// @}
26
27/**
28 *  @brief Enumeration of Quote plot render style types.
29 **/
30typedef enum _CPTTradingRangePlotStyle {
31    CPTTradingRangePlotStyleOHLC,       ///< Open-High-Low-Close (OHLC) plot.
32    CPTTradingRangePlotStyleCandleStick ///< Candlestick plot.
33}
34CPTTradingRangePlotStyle;
35
36/**
37 *  @brief Enumeration of Quote plot data source field types.
38 **/
39typedef enum _CPTTradingRangePlotField {
40    CPTTradingRangePlotFieldX,    ///< X values.
41    CPTTradingRangePlotFieldOpen, ///< Open values.
42    CPTTradingRangePlotFieldHigh, ///< High values.
43    CPTTradingRangePlotFieldLow,  ///< Low values.
44    CPTTradingRangePlotFieldClose ///< Close values.
45}
46CPTTradingRangePlotField;
47
48#pragma mark -
49
50/**
51 *  @brief A trading range plot data source.
52 **/
53@protocol CPTTradingRangePlotDataSource<CPTPlotDataSource>
54@optional
55
56/// @name Bar Fills
57/// @{
58
59/** @brief @optional Gets a range of fills used with a candlestick plot when close >= open for the given plot.
60 *  @param plot The trading range plot.
61 *  @param indexRange The range of the data indexes of interest.
62 *  @return An array of fills.
63 **/
64-(NSArray *)increaseFillsForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange;
65
66/** @brief @optional Gets the fill used with a candlestick plot when close >= open for the given plot.
67 *  This method will not be called if
68 *  @link CPTTradingRangePlotDataSource::increaseFillsForTradingRangePlot:recordIndexRange: -increaseFillsForTradingRangePlot:recordIndexRange: @endlink
69 *  is also implemented in the datasource.
70 *  @param plot The trading range plot.
71 *  @param idx The data index of interest.
72 *  @return The bar fill for the bar with the given index. If the data source returns @nil, the default increase fill is used.
73 *  If the data source returns an NSNull object, no fill is drawn.
74 **/
75-(CPTFill *)increaseFillForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx;
76
77/** @brief @optional Gets a range of fills used with a candlestick plot when close < open for the given plot.
78 *  @param plot The trading range plot.
79 *  @param indexRange The range of the data indexes of interest.
80 *  @param indexRange The range of the data indexes of interest.
81 **/
82-(NSArray *)decreaseFillsForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange;
83
84/** @brief @optional Gets the fill used with a candlestick plot when close < open for the given plot.
85 *  This method will not be called if
86 *  @link CPTTradingRangePlotDataSource::decreaseFillsForTradingRangePlot:recordIndexRange: -decreaseFillsForTradingRangePlot:recordIndexRange: @endlink
87 *  is also implemented in the datasource.
88 *  @param plot The trading range plot.
89 *  @param idx The data index of interest.
90 *  @return The bar fill for the bar with the given index. If the data source returns @nil, the default decrease fill is used.
91 *  If the data source returns an NSNull object, no fill is drawn.
92 **/
93-(CPTFill *)decreaseFillForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx;
94
95/// @}
96
97/// @name Bar Line Styles
98/// @{
99
100/** @brief @optional Gets a range of line styles used to draw candlestick or OHLC symbols for the given trading range plot.
101 *  @param plot The trading range plot.
102 *  @param indexRange The range of the data indexes of interest.
103 *  @return An array of line styles.
104 **/
105-(NSArray *)lineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange;
106
107/** @brief @optional Gets the line style used to draw candlestick or OHLC symbols for the given trading range plot.
108 *  This method will not be called if
109 *  @link CPTTradingRangePlotDataSource::lineStylesForTradingRangePlot:recordIndexRange: -lineStylesForTradingRangePlot:recordIndexRange: @endlink
110 *  is also implemented in the datasource.
111 *  @param plot The trading range plot.
112 *  @param idx The data index of interest.
113 *  @return The line style for the symbol with the given index. If the data source returns @nil, the default line style is used.
114 *  If the data source returns an NSNull object, no line is drawn.
115 **/
116-(CPTLineStyle *)lineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx;
117
118/** @brief @optional Gets a range of line styles used to outline candlestick symbols when close >= open for the given trading range plot.
119 *  @param plot The trading range plot.
120 *  @param indexRange The range of the data indexes of interest.
121 *  @return An array of line styles.
122 **/
123-(NSArray *)increaseLineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange;
124
125/** @brief @optional Gets the line style used to outline candlestick symbols when close >= open for the given trading range plot.
126 *  This method will not be called if
127 *  @link CPTTradingRangePlotDataSource::increaseLineStylesForTradingRangePlot:recordIndexRange: -increaseLineStylesForTradingRangePlot:recordIndexRange: @endlink
128 *  is also implemented in the datasource.
129 *  @param plot The trading range plot.
130 *  @param idx The data index of interest.
131 *  @return The line line style for the symbol with the given index. If the data source returns @nil, the default increase line style is used.
132 *  If the data source returns an NSNull object, no line is drawn.
133 **/
134-(CPTLineStyle *)increaseLineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx;
135
136/** @brief @optional Gets a range of line styles used to outline candlestick symbols when close < open for the given trading range plot.
137 *  @param plot The trading range plot.
138 *  @param indexRange The range of the data indexes of interest.
139 *  @return An array of line styles.
140 **/
141-(NSArray *)decreaseLineStylesForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndexRange:(NSRange)indexRange;
142
143/** @brief @optional Gets the line style used to outline candlestick symbols when close < open for the given trading range plot.
144 *  This method will not be called if
145 *  @link CPTTradingRangePlotDataSource::decreaseLineStylesForTradingRangePlot:recordIndexRange: -decreaseLineStylesForTradingRangePlot:recordIndexRange: @endlink
146 *  is also implemented in the datasource.
147 *  @param plot The trading range plot.
148 *  @param idx The data index of interest.
149 *  @return The line line style for the symbol with the given index. If the data source returns @nil, the default decrease line style is used.
150 *  If the data source returns an NSNull object, no line is drawn.
151 **/
152-(CPTLineStyle *)decreaseLineStyleForTradingRangePlot:(CPTTradingRangePlot *)plot recordIndex:(NSUInteger)idx;
153
154/// @}
155
156@end
157
158#pragma mark -
159
160/**
161 *  @brief Trading range plot delegate.
162 **/
163@protocol CPTTradingRangePlotDelegate<CPTPlotDelegate>
164
165@optional
166
167/// @name Point Selection
168/// @{
169
170/** @brief @optional Informs the delegate that a bar was
171 *  @if MacOnly clicked. @endif
172 *  @if iOSOnly touched. @endif
173 *  @param plot The trading range plot.
174 *  @param idx The index of the
175 *  @if MacOnly clicked bar. @endif
176 *  @if iOSOnly touched bar. @endif
177 **/
178-(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx;
179
180/** @brief @optional Informs the delegate that a bar was
181 *  @if MacOnly clicked. @endif
182 *  @if iOSOnly touched. @endif
183 *  @param plot The trading range plot.
184 *  @param idx The index of the
185 *  @if MacOnly clicked bar. @endif
186 *  @if iOSOnly touched bar. @endif
187 *  @param event The event that triggered the selection.
188 **/
189-(void)tradingRangePlot:(CPTTradingRangePlot *)plot barWasSelectedAtRecordIndex:(NSUInteger)idx withEvent:(CPTNativeEvent *)event;
190
191/// @}
192
193@end
194
195#pragma mark -
196
197@interface CPTTradingRangePlot : CPTPlot {
198    @private
199    CPTLineStyle *lineStyle;
200    CPTLineStyle *increaseLineStyle;
201    CPTLineStyle *decreaseLineStyle;
202    CPTFill *increaseFill;
203    CPTFill *decreaseFill;
204
205    CPTTradingRangePlotStyle plotStyle;
206
207    CGFloat barWidth;
208    CGFloat stickLength;
209    CGFloat barCornerRadius;
210}
211
212/// @name Appearance
213/// @{
214@property (nonatomic, readwrite, assign) CPTTradingRangePlotStyle plotStyle;
215@property (nonatomic, readwrite, assign) CGFloat barWidth;    // In view coordinates
216@property (nonatomic, readwrite, assign) CGFloat stickLength; // In view coordinates
217@property (nonatomic, readwrite, assign) CGFloat barCornerRadius;
218/// @}
219
220/// @name Drawing
221/// @{
222@property (nonatomic, readwrite, copy) CPTLineStyle *lineStyle;
223@property (nonatomic, readwrite, copy) CPTLineStyle *increaseLineStyle;
224@property (nonatomic, readwrite, copy) CPTLineStyle *decreaseLineStyle;
225@property (nonatomic, readwrite, copy) CPTFill *increaseFill;
226@property (nonatomic, readwrite, copy) CPTFill *decreaseFill;
227/// @}
228
229@end
Note: See TracBrowser for help on using the repository browser.