-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPlotAreaDescription.h
156 lines (121 loc) · 4.18 KB
/
PlotAreaDescription.h
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
//
// PlotAreaDescription.h
// AAPLot
//
// Created by admin on 3/28/11.
// Copyright 2011 Crystalnix. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "CorePlot-CocoaTouch.h"
#import "MultiresDateFormatter.h"
typedef enum _VianDateResolution {
VianDateResolutionDay = 0,
VianDateResolutionWeek,
VianDateResolutionMonth,
VianDateResolutionThreeMonths,
VianDateResolutionSixMonths,
VianDateResolutionYear,
VianDateResolutionTwoYears
} VianDateResolution;
typedef enum _VianPlotType {
VianPlotTypeScatter = 0,
VianPlotTypeTradingRange,
VianPlotTypeBar
} VianPlotType;
typedef enum _VianFillType {
VianFillTypeNone = 0,
VianFillTypeGradient,
VianFillTypeStripes
} VianFillType;
@class CPColor;
@interface VianEnums : NSObject {
}
+(NSArray*)dateResolutionStrings;
+(NSArray*)plotTypeStrings;
+(NSArray*)fillTypeStrings;
@end
@interface VianXAxis : NSObject {
@private
BOOL isDateAxis;
// BOOL showGridLines;
// BOOL showLabels;
VianDateResolution dateResolution;
NSDate *startDate;
NSDate *endDate;
NSDecimalNumber *start;
NSDecimalNumber *end;
NSArray *values;
NSArray *dates;
}
@property(nonatomic,assign) BOOL isDateAxis;
//@property(nonatomic,assign) BOOL showGridLines;
//@property(nonatomic,assign) BOOL showLabels;
@property(nonatomic,assign) VianDateResolution dateResolution;
@property(nonatomic,retain) NSDate *startDate;
@property(nonatomic,retain) NSDate *endDate;
@property(nonatomic,retain) NSDecimalNumber *start;
@property(nonatomic,retain) NSDecimalNumber *end;
@property(nonatomic,retain) NSArray *values;
@property(nonatomic,retain) NSArray *dates;
-(id)initWithDictionary:(NSDictionary*)dict;
-(NSDictionary*)dictionaryRepresentation;
@end
@interface VianPlot: NSObject {
@private
NSString *identifier;
// BOOL showYGridLines;
// BOOL showYLabels;
BOOL inMainPlotSpace;
VianPlotType plotType;
VianFillType fillType;
CPColor *lineColor;
NSDecimalNumber *low;
NSDecimalNumber *high;
NSArray *values;
VianXAxis *xAxis;
}
@property(nonatomic,retain) NSString *identifier;
//@property(nonatomic,assign) BOOL showYGridLines;
//@property(nonatomic,assign) BOOL showYLabels;
@property(nonatomic,assign) BOOL inMainPlotSpace;
@property(nonatomic,assign) VianPlotType plotType;
@property(nonatomic,assign) VianFillType fillType;
@property(nonatomic,retain) CPColor* lineColor;
@property(nonatomic,retain) NSDecimalNumber *low;
@property(nonatomic,retain) NSDecimalNumber *high;
@property(nonatomic,retain) NSArray *values;
@property(nonatomic,retain) VianXAxis *xAxis;
-(id)initWithDictionary:(NSDictionary*)dict;
-(NSDictionary*)dictionaryRepresentation;
@end
@interface VianPlotAreaDescription : NSObject <CPPlotDataSource, MultiresDateFromIndexConverter> {
@private
NSArray *plots;
BOOL hasSecondaryPlotSpace;
NSDecimalNumber *secondaryPlotSpaceHeightPercent;
// following properties are computable and do not appear in a dictionary representation
NSDecimalNumber *mainPlotSpaceLow;
NSDecimalNumber *mainPlotSpaceHigh;
NSDecimalNumber *secondaryPlotSpaceLow;
NSDecimalNumber *secondaryPlotSpaceHigh;
NSDecimalNumber *xAxisLow;
NSDecimalNumber *xAxisHigh;
NSDate *lowDate;
NSDate *highDate;
}
@property(nonatomic,retain) NSArray *plots;
@property(nonatomic,assign) BOOL hasSecondaryPlotSpace;
@property(nonatomic,retain) NSDecimalNumber *secondaryPlotSpaceHeightPercent;
@property(nonatomic,readonly,retain) NSDecimalNumber *mainPlotSpaceLow;
@property(nonatomic,readonly,retain) NSDecimalNumber *mainPlotSpaceHigh;
@property(nonatomic,readonly,retain) NSDecimalNumber *secondaryPlotSpaceLow;
@property(nonatomic,readonly,retain) NSDecimalNumber *secondaryPlotSpaceHigh;
@property(nonatomic,readonly,retain) NSDecimalNumber *xAxisLow;
@property(nonatomic,readonly,retain) NSDecimalNumber *xAxisHigh;
@property(nonatomic,readonly,retain) NSDate *lowDate;
@property(nonatomic,readonly,retain) NSDate *highDate;
-(id)initWithDictionary:(NSDictionary*)dict;
-(NSDictionary*)dictionaryRepresentation;
-(VianPlot*)plotWithIdentifier:(NSString*)identifier;
-(BOOL)hasDateXAxis;
@end