AWFLegendItemView
Objective-C
@interface AWFLegendItemView : UIView
Swift
class AWFLegendItemView : UIView
An AWFLegendItemView
object provides the base view class used for rendering data-specific legends based on a AWFLegendStyle
.
-
The legend item’s key.
Declaration
Objective-C
@property (nonatomic, copy) NSString *_Nonnull key;
Swift
var key: String { get set }
-
The legend configuration associated with the view.
Declaration
Objective-C
@property (nonatomic, strong, readonly) AWFLegendConfig *_Nonnull config;
Swift
var config: AWFLegendConfig { get }
-
The style used when rendering the legend.
Declaration
Objective-C
@property (nonatomic, strong) AWFLegendStyle *_Nonnull style;
Swift
var style: AWFLegendStyle { get set }
-
The renderer that renders the legend image.
Declaration
Objective-C
@property (nonatomic, strong, readonly) NSObject<AWFLegendRenderer> *_Nonnull legend;
Swift
var legend: AWFLegendRenderer { get }
-
A Boolean value indicating whether the legend should be rendered using Metric values when applicable.
Declaration
Objective-C
@property (nonatomic, getter=isMetric) BOOL metric;
Swift
var isMetric: Bool { get set }
-
Initializes and returns a newly allocated item view with the specified legend configuration.
Declaration
Objective-C
- (nonnull instancetype)initWithLegendConfig:(nonnull AWFLegendConfig *)config frame:(CGRect)frame;
Swift
init(legendConfig config: AWFLegendConfig, frame: CGRect)
Parameters
config
The legend configuration.
frame
The initial frame rectangle for the view, measured in points. The view’s final height will be calculated automatically based on the width and style configuration.
Return Value
An initialized item view object.
-
Initializes and returns a newly allocated item view with the specified legend configuration and style.
Declaration
Objective-C
- (nonnull instancetype)initWithLegendConfig:(nonnull AWFLegendConfig *)config style:(nullable AWFLegendStyle *)style frame:(CGRect)frame;
Swift
init(legendConfig config: AWFLegendConfig, style: AWFLegendStyle?, frame: CGRect)
Parameters
config
The legend configuration.
style
The style to use when rendering.
frame
The initial frame rectangle for the view. measured in points. The view’s final height will be calculated automatically based on the width and style configuration.
Return Value
An initialized item view object.
-
When the legend renderer is an instance of
AWFPointLegend
, this method redraws the legend by only including items in the legend that are associated with the specified keys.Declaration
Objective-C
- (void)updateByFilteringItemKeys:(nonnull NSArray<NSString *> *)keys;
Swift
func update(byFilteringItemKeys keys: [String])
Parameters
keys
The array of keys to include.