AWFLegendStyle

Objective-C

@interface AWFLegendStyle : NSObject <NSCopying>

Swift

class AWFLegendStyle : NSObject, NSCopying

An AWFLegendStyle object provides the style specifications to be used for a data legend on a map.

  • The title of the legend.

    Declaration

    Objective-C

    @property (nonatomic, copy) NSString *_Nonnull name;

    Swift

    var name: String { get set }
  • An array of layer types associated with this style.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray<AWFMapLayer> *layerTypes;

    Swift

    var layerTypes: [AWFMapLayer]? { get set }
  • The text style used for value labels.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) AWFTextStyleSpec *labelStyle
  • The value label offset relative to the bar or point item.

    Declaration

    Objective-C

    @property (nonatomic) UIOffset labelOffset;

    Swift

    var labelOffset: Int32 { get set }
  • The spacing between items, measured in points.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat interitemSpacing;

    Swift

    var interitemSpacing: Double { get set }
  • The margin insets to apply around the legend content.

    Declaration

    Objective-C

    @property (nonatomic) UIEdgeInsets contentEdgeInsets;

    Swift

    var contentEdgeInsets: Int32 { get set }
  • A Boolean value indicating whether the layout should be adjusted to fit the target width.

    Declaration

    Objective-C

    @property (nonatomic) BOOL adjustsLayoutToFitWidth;

    Swift

    var adjustsLayoutToFitWidth: Bool { get set }
  • A Boolean value indicating whether the legend should be centered within the target size when rendering.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldCenter;

    Swift

    var shouldCenter: Bool { get set }

Bar Legend Styling

  • The data value interval for which to draw cells between color stops.

    To define different cell intervals for different value ranges, use cellIntervalRanges.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat cellInterval;

    Swift

    var cellInterval: Double { get set }
  • An array of interval ranges that define the cell interval to use for different value ranges of a bar legend. If this value is defined, then cellInterval will be ignored.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray *cellIntervalRanges;

    Swift

    var cellIntervalRanges: [Any]? { get set }
  • The size for color cells.

    Declaration

    Objective-C

    @property (nonatomic) CGSize cellSize;

    Swift

    var cellSize: CGSize { get set }
  • The data value interval for which to display value labels.

    To define different label intervals for different value ranges, use labelIntervalRanges.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat labelInterval;

    Swift

    var labelInterval: Double { get set }
  • An array of interval ranges that define the label interval to use for different value ranges of a bar legend. If this value is defined, then labelInterval will be ignored.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray *labelIntervalRanges;

    Swift

    var labelIntervalRanges: [Any]? { get set }
  • A Boolean value that indicates whether the label interval is based on an incremental value instead of cell value. The default is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL isLabelIntervalByCounter;

    Swift

    var isLabelIntervalByCounter: Bool { get set }
  • The custom labels to display based on cell values.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSDictionary<NSNumber *, NSString *> *labels;

    Swift

    var labels: [NSNumber : String]? { get set }
  • The position of value labels relative to the color bar.

    Declaration

    Objective-C

    @property (nonatomic) AWFLabelPosition labelPosition;

    Swift

    var labelPosition: AWFLabelPosition { get set }
  • A Boolean value indicating whether labels should be generated automatically based on cell values. The default value is YES.

    Declaration

    Objective-C

    @property (nonatomic) BOOL automaticallyGenerateLabels;

    Swift

    var automaticallyGenerateLabels: Bool { get set }

Point Legend Styling

  • The total number of columns for point items.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger totalColumns;

    Swift

    var totalColumns: UInt { get set }
  • The amount of spacing between rows of point items, measured in points.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat lineSpacing;

    Swift

    var lineSpacing: Double { get set }
  • A Boolean value indicating whether each column should be adjusted to have equal widths even when all items exist on a single row. The default value is NO.

    Declaration

    Objective-C

    @property (nonatomic) BOOL shouldUseEqualSpacingForSingleRow;

    Swift

    var shouldUseEqualSpacingForSingleRow: Bool { get set }
  • The point type style to render.

    Declaration

    Objective-C

    @property (nonatomic) AWFPointType pointType;

    Swift

    var pointType: AWFPointType { get set }
  • The size of each point in the legend.

    Declaration

    Objective-C

    @property (nonatomic) CGSize pointSize;

    Swift

    var pointSize: CGSize { get set }
  • The stroke width applied to the points.

    Declaration

    Objective-C

    @property (nonatomic) CGFloat pointStrokeWidth;

    Swift

    var pointStrokeWidth: Double { get set }
  • The stoke color applied to the points.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIColor *pointStrokeColor;
  • If items is a dictionary of array elements, specifies the order in which each item group is rendered.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray<NSString *> *displayOrderForItemGroups;

    Swift

    var displayOrderForItemGroups: [String]? { get set }
  • Specifies the order in which the items are rendered.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSArray<NSString *> *displayOrderForItems;

    Swift

    var displayOrderForItems: [String]? { get set }
  • Initializes and returns a newly allocated legend style object configured from the specified dictionary.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithDictionary:(nonnull NSDictionary *)dict;

    Swift

    init(dictionary dict: [AnyHashable : Any])

    Parameters

    dict

    The dictionary containing the style configuration.

    Return Value

    An initialized style object.

  • Returns the cell interval to use for the specified value.

    The value returned may vary depending on whether cellIntervalRanges has been defined.

    Declaration

    Objective-C

    - (CGFloat)cellIntervalForValue:(CGFloat)value;

    Swift

    func cellInterval(forValue value: Double) -> Double

    Parameters

    value

    The value to return the cell interval for.

    Return Value

    The cell interval to use for the value.

  • Returns the label interval to use for the specified value.

    The value returned may vary depending on whether labelIntervalRanges has been defined.

    Declaration

    Objective-C

    - (CGFloat)labelIntervalForValue:(CGFloat)value;

    Swift

    func labelInterval(forValue value: Double) -> Double

    Parameters

    value

    The value to return the label interval for.

    Return Value

    The label interval to use for the value.