AWFLegendConfig
Objective-C
@interface AWFLegendConfig : NSObject <NSCopying>
Swift
class AWFLegendConfig : NSObject, NSCopying
An AWFLegendConfig object provides the configuration options used to define a legend.
-
The identifier key for the configuration.
Declaration
Objective-C
@property (nonatomic, copy, nullable) NSString *key;Swift
var key: String? { get set } -
The legend type.
Declaration
Objective-C
@property (nonatomic) AWFLegendType type;Swift
var type: AWFLegendType { get set } -
The measurement type for the data represented by the legend.
Declaration
Objective-C
@property (nonatomic) int measurement;Swift
var measurement: Int32 { get set } -
The units represented by the legend.
Declaration
Objective-C
@property (nonatomic, readonly) int units;Swift
var units: Int32 { get } -
For bar type legends, an array of color stops defining the colors and values for the bar legend.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray *colorStops;Swift
var colorStops: [Any]? { get set } -
For point type legends, an array of point items to include in the legend.
Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<AWFPointLegendItem *> *pointItems;Swift
var pointItems: [AWFPointLegendItem]? { get set } -
For point type legends, an array of point item keys that define the order in which the point items are rendered. If this value is
nil, then the items will be rendered in the order provided bypointItems.Declaration
Objective-C
@property (nonatomic, strong, nullable) NSArray<NSString *> *pointOrder;Swift
var pointOrder: [String]? { get set } -
The data interval (for bar type legends only).
Declaration
Objective-C
@property (nonatomic) CGFloat interval;Swift
var interval: CGFloat { get set } -
Initializes and returns a newly allocated legend configuration object with the specified JSON dictionary.
Declaration
Objective-C
- (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)data;Swift
init(dictionary data: [AnyHashable : Any])Parameters
dataThe JSON dictionary of options to use.
Return Value
An initialized configuration object.
-
Initializes and returns a newly allocated legend configuration object with the specified grouped style.
Declaration
Objective-C
- (nonnull instancetype)initWithGroupedStyle: (nonnull AWFGroupedStyle *)groupedStyle;Swift
init(groupedStyle: AWFGroupedStyle)Parameters
groupedStyleThe grouped style to use.
Return Value
An initialized configuration object.
-
For point type legends, returns the point legend items associated with the specified keys.
Declaration
Objective-C
- (nonnull NSArray<AWFPointLegendItem *> *)pointItemsForKeys: (nonnull NSArray<NSString *> *)keys;Swift
func pointItems(forKeys keys: [String]) -> [AWFPointLegendItem]Parameters
keysThe array of point item keys to return items for.
Return Value
The point items associated with the keys, if any.
View on GitHub
AWFLegendConfig Class Reference