source: orbit/iOS/Orbit/Orbit/CorePlotHeaders/CPTLegend.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: 4.1 KB
Line 
1#import "CPTBorderedLayer.h"
2#import <Foundation/Foundation.h>
3
4/// @file
5
6@class CPTLegend;
7@class CPTPlot;
8@class CPTTextStyle;
9
10/// @name Legend
11/// @{
12
13/** @brief Notification sent by plots to tell the legend it should redraw itself.
14 *  @ingroup notification
15 **/
16extern NSString *const CPTLegendNeedsRedrawForPlotNotification;
17
18/** @brief Notification sent by plots to tell the legend it should update its layout and redraw itself.
19 *  @ingroup notification
20 **/
21extern NSString *const CPTLegendNeedsLayoutForPlotNotification;
22
23/** @brief Notification sent by plots to tell the legend it should reload all legend entries.
24 *  @ingroup notification
25 **/
26extern NSString *const CPTLegendNeedsReloadEntriesForPlotNotification;
27
28/// @}
29
30/**
31 *  @brief Axis labeling delegate.
32 **/
33@protocol CPTLegendDelegate<NSObject>
34
35/// @name Drawing
36/// @{
37
38/** @brief @required This method gives the delegate a chance to draw custom swatches for each legend entry.
39 *
40 *  The "swatch" is the graphical part of the legend entry, usually accompanied by a text title
41 *  that will be drawn by the legend. Returning @NO will cause the legend to not draw the default
42 *  legend graphics. It is then the delegate&rsquo;s responsiblity to do this.
43 *  @param legend The legend.
44 *  @param idx The zero-based index of the legend entry for the given plot.
45 *  @param plot The plot.
46 *  @param rect The bounding rectangle to use when drawing the swatch.
47 *  @param context The graphics context to draw into.
48 *  @return @YES if the legend should draw the default swatch or @NO if the delegate handled the drawing.
49 **/
50-(BOOL)legend:(CPTLegend *)legend shouldDrawSwatchAtIndex:(NSUInteger)idx forPlot:(CPTPlot *)plot inRect:(CGRect)rect inContext:(CGContextRef)context;
51
52/// @}
53
54@end
55
56#pragma mark -
57
58@interface CPTLegend : CPTBorderedLayer {
59    @private
60    NSMutableArray *plots;
61    NSMutableArray *legendEntries;
62    BOOL layoutChanged;
63    CPTTextStyle *textStyle;
64    CGSize swatchSize;
65    CPTLineStyle *swatchBorderLineStyle;
66    CGFloat swatchCornerRadius;
67    CPTFill *swatchFill;
68    NSUInteger numberOfRows;
69    NSUInteger numberOfColumns;
70    BOOL equalRows;
71    BOOL equalColumns;
72    NSArray *rowHeights;
73    NSArray *rowHeightsThatFit;
74    NSArray *columnWidths;
75    NSArray *columnWidthsThatFit;
76    CGFloat columnMargin;
77    CGFloat rowMargin;
78    CGFloat titleOffset;
79}
80
81/// @name Formatting
82/// @{
83@property (nonatomic, readwrite, copy) CPTTextStyle *textStyle;
84@property (nonatomic, readwrite, assign) CGSize swatchSize;
85@property (nonatomic, readwrite, copy) CPTLineStyle *swatchBorderLineStyle;
86@property (nonatomic, readwrite, assign) CGFloat swatchCornerRadius;
87@property (nonatomic, readwrite, copy) CPTFill *swatchFill;
88/// @}
89
90/// @name Layout
91/// @{
92@property (nonatomic, readonly, assign) BOOL layoutChanged;
93@property (nonatomic, readwrite, assign) NSUInteger numberOfRows;
94@property (nonatomic, readwrite, assign) NSUInteger numberOfColumns;
95@property (nonatomic, readwrite, assign) BOOL equalRows;
96@property (nonatomic, readwrite, assign) BOOL equalColumns;
97@property (nonatomic, readwrite, copy) NSArray *rowHeights;
98@property (nonatomic, readonly, retain) NSArray *rowHeightsThatFit;
99@property (nonatomic, readwrite, copy) NSArray *columnWidths;
100@property (nonatomic, readonly, retain) NSArray *columnWidthsThatFit;
101@property (nonatomic, readwrite, assign) CGFloat columnMargin;
102@property (nonatomic, readwrite, assign) CGFloat rowMargin;
103@property (nonatomic, readwrite, assign) CGFloat titleOffset;
104/// @}
105
106/// @name Factory Methods
107/// @{
108+(id)legendWithPlots:(NSArray *)newPlots;
109+(id)legendWithGraph:(CPTGraph *)graph;
110/// @}
111
112/// @name Initialization
113/// @{
114-(id)initWithPlots:(NSArray *)newPlots;
115-(id)initWithGraph:(CPTGraph *)graph;
116/// @}
117
118/// @name Plots
119/// @{
120-(NSArray *)allPlots;
121-(CPTPlot *)plotAtIndex:(NSUInteger)idx;
122-(CPTPlot *)plotWithIdentifier:(id<NSCopying>)identifier;
123
124-(void)addPlot:(CPTPlot *)plot;
125-(void)insertPlot:(CPTPlot *)plot atIndex:(NSUInteger)idx;
126-(void)removePlot:(CPTPlot *)plot;
127-(void)removePlotWithIdentifier:(id<NSCopying>)identifier;
128/// @}
129
130/// @name Layout
131/// @{
132-(void)setLayoutChanged;
133/// @}
134
135@end
Note: See TracBrowser for help on using the repository browser.