forked from core-plot/core-plot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPTGraph.h
More file actions
150 lines (124 loc) · 4.16 KB
/
CPTGraph.h
File metadata and controls
150 lines (124 loc) · 4.16 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
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
// Abstract class
#import "CPTBorderedLayer.h"
#import "CPTDefinitions.h"
/// @file
@class CPTAxisSet;
@class CPTGraphHostingView;
@class CPTLegend;
@class CPTPlot;
@class CPTPlotAreaFrame;
@class CPTPlotSpace;
@class CPTTheme;
@class CPTTextStyle;
@class CPTLayerAnnotation;
/// @name Graph
/// @{
/** @brief Notification sent by various objects to tell the graph it should redraw itself.
* @ingroup notification
**/
extern NSString *const CPTGraphNeedsRedrawNotification;
/** @brief Notification sent by a graph after adding a new plot space.
* @ingroup notification
*
* The notification <code>userInfo</code> dictionary will include the new plot space under the
* CPTGraphPlotSpaceNotificationKey key.
**/
extern NSString *const CPTGraphDidAddPlotSpaceNotification;
/** @brief Notification sent by a graph after removing a plot space.
* @ingroup notification
*
* The notification <code>userInfo</code> dictionary will include the removed plot space under the
* CPTGraphPlotSpaceNotificationKey key.
**/
extern NSString *const CPTGraphDidRemovePlotSpaceNotification;
/** @brief The <code>userInfo</code> dictionary key used by the CPTGraphDidAddPlotSpaceNotification
* and CPTGraphDidRemovePlotSpaceNotification notifications for the plot space.
* @ingroup notification
**/
extern NSString *const CPTGraphPlotSpaceNotificationKey;
/// @}
/**
* @brief Enumeration of graph layers.
**/
typedef NS_ENUM (NSInteger, CPTGraphLayerType) {
CPTGraphLayerTypeMinorGridLines, ///< Minor grid lines.
CPTGraphLayerTypeMajorGridLines, ///< Major grid lines.
CPTGraphLayerTypeAxisLines, ///< Axis lines.
CPTGraphLayerTypePlots, ///< Plots.
CPTGraphLayerTypeAxisLabels, ///< Axis labels.
CPTGraphLayerTypeAxisTitles ///< Axis titles.
};
#pragma mark -
@interface CPTGraph : CPTBorderedLayer
/// @name Hosting View
/// @{
@property (nonatomic, readwrite, cpt_weak_property) cpt_weak CPTGraphHostingView *hostingView;
/// @}
/// @name Title
/// @{
@property (nonatomic, readwrite, copy) NSString *title;
@property (nonatomic, readwrite, copy) NSAttributedString *attributedTitle;
@property (nonatomic, readwrite, copy) CPTTextStyle *titleTextStyle;
@property (nonatomic, readwrite, assign) CGPoint titleDisplacement;
@property (nonatomic, readwrite, assign) CPTRectAnchor titlePlotAreaFrameAnchor;
/// @}
/// @name Layers
/// @{
@property (nonatomic, readwrite, strong) CPTAxisSet *axisSet;
@property (nonatomic, readwrite, strong) CPTPlotAreaFrame *plotAreaFrame;
@property (nonatomic, readonly) CPTPlotSpace *defaultPlotSpace;
@property (nonatomic, readwrite, strong) NSArray *topDownLayerOrder;
/// @}
/// @name Legend
/// @{
@property (nonatomic, readwrite, strong) CPTLegend *legend;
@property (nonatomic, readwrite, assign) CPTRectAnchor legendAnchor;
@property (nonatomic, readwrite, assign) CGPoint legendDisplacement;
/// @}
/// @name Data Source
/// @{
-(void)reloadData;
-(void)reloadDataIfNeeded;
/// @}
/// @name Retrieving Plots
/// @{
-(NSArray *)allPlots;
-(CPTPlot *)plotAtIndex:(NSUInteger)idx;
-(CPTPlot *)plotWithIdentifier:(id<NSCopying>)identifier;
/// @}
/// @name Adding and Removing Plots
/// @{
-(void)addPlot:(CPTPlot *)plot;
-(void)addPlot:(CPTPlot *)plot toPlotSpace:(CPTPlotSpace *)space;
-(void)removePlot:(CPTPlot *)plot;
-(void)removePlotWithIdentifier:(id<NSCopying>)identifier;
-(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx;
-(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx intoPlotSpace:(CPTPlotSpace *)space;
/// @}
/// @name Retrieving Plot Spaces
/// @{
-(NSArray *)allPlotSpaces;
-(CPTPlotSpace *)plotSpaceAtIndex:(NSUInteger)idx;
-(CPTPlotSpace *)plotSpaceWithIdentifier:(id<NSCopying>)identifier;
/// @}
/// @name Adding and Removing Plot Spaces
/// @{
-(void)addPlotSpace:(CPTPlotSpace *)space;
-(void)removePlotSpace:(CPTPlotSpace *)plotSpace;
/// @}
/// @name Themes
/// @{
-(void)applyTheme:(CPTTheme *)theme;
/// @}
@end
#pragma mark -
/** @category CPTGraph(AbstractFactoryMethods)
* @brief CPTGraph abstract methods—must be overridden by subclasses
**/
@interface CPTGraph(AbstractFactoryMethods)
/// @name Factory Methods
/// @{
-(CPTPlotSpace *)newPlotSpace;
-(CPTAxisSet *)newAxisSet;
/// @}
@end