LabelParameters

public struct LabelParameters

Represents the properties of a grid’s line labels. Labels can only be placed near serifs.

  • The sequnce of the text labels to draw.

    Declaration

    Swift

    public var sequence: AnySequence<String>
  • The font of labels.

    Declaration

    Swift

    public var font: Font
  • The font size of labels.

    Declaration

    Swift

    public var fontSize: Float
  • The color of labels.

    Declaration

    Swift

    public var fontColor: Color
  • The nubmber of major lines per one label. Must be positive.

    Declaration

    Swift

    public var frequency: Int
  • Normally labels are placed in such a way that a major line goes through the center of a label, and the bounding box of a label touches the bound of the grid, but you can specify an offset.

    Declaration

    Swift

    public var offset: Vector
  • Normally the sequence of labels is drawn from left to right (bottom to top). Setting this property to true causes the sequence to be drawn from right to left (top to bottom).

    Declaration

    Swift

    public var reversed: Bool
  • Creates a new label parameter set.

    Declaration

    Swift

    public init<S : Sequence>(sequence: S,
                              font: Font = .helvetica,
                              fontSize: Float = 5,
                              fontColor: Color = Color(gray: 0.5)!,
                              frequency: Int = 5,
                              offset: Vector = .zero,
                              reversed: Bool = false) where S.Element == String

    Parameters

    sequence

    The sequnce of the text labels to draw.

    font

    The font of labels. Default is Helvetica.

    fontSize

    The font size of labels. Default value is 5.

    fontColor

    The color of labels. Default is 50% gray.

    frequency

    The nubmber of major lines per one label. Default value is 5. Must be positive.

    offset

    The offset of the label. Default value is .zero.

    reversed

    The order in which to draw the labels. Default is false.

  • Returns a Boolean value indicating whether two values are equal.

    Equality is the inverse of inequality. For any values a and b, a == b implies that a != b is false.

    Complexity

    O(N), where N is the number of elements of a shorter label sequence.

    Declaration

    Swift

    public static func == (lhs: Grid.LabelParameters, rhs: Grid.LabelParameters) -> Bool

    Parameters

    lhs

    A value to compare.

    rhs

    Another value to compare.