ChartNumericAxisAttributes

public class ChartNumericAxisAttributes : ChartAxisAttributes

ChartNumericAxis contains properties of axes for ranges of floating point values.

The position and orientation of a numeric axis depends on the chart type. For example:

  • Bar charts display the numeric axis as the X axis.
  • Line, column, and combo charts display the numeric axis as the Y axis.
  • Undocumented

    Declaration

    Swift

    public init(axisId: ChartAxisId? = nil,
                baseline: ChartBaselineAttributes? = nil,
                gridlines: ChartGridlineAttributes? = nil,
                labels: ChartLabelAttributes? = nil,
                titleLabel: ChartLabelAttributes? = nil,
                title: String? = nil,
                isZeroBased: Bool = true,
                allowLooseLabels: Bool = false,
                fudgeAxisRange: Bool = false,
                adjustToNiceValues: Bool = true,
                abbreviatesLabels: Bool = false,
                isMagnitudedDisplayed: Bool = true,
                explicitMin: Double? = nil,
                explicitMax: Double? = nil,
                formatter: NumberFormatter?,
                abbreviatedFormatter: NumberFormatter?)
  • Undocumented

    Declaration

    Swift

    public convenience init()
  • Undocumented

    Declaration

    Swift

    override public func copy(with zone: NSZone? = nil) -> Any
  • Undocumented

    Declaration

    Swift

    override public var description: String { get }
  • Indicates whether the baseline starts at zero or the minimum value in the data set.

    Applicable only to data sets with all positive, or all negative values, otherwise the baseline is always zero.

    Default is true.

    Declaration

    Swift

    @Published
    public var isZeroBased: Bool { get set }
  • Formatter used for the axis gridline labels. Defines the formatting for both extended and abbreviated states set through ChartNumericAxis.abbreviatesLabels.

    Defaults to a localized decimal formatter.

    Declaration

    Swift

    @Published
    public var formatter: NumberFormatter { get set }
  • True if values will be abbreviated. For example, “1,234,567.89” to “1.23k”. Default is true. The ChartNumericAxis.formatter defines the formatting for both extended and abbreviated states.

    Declaration

    Swift

    @Published
    public var abbreviatesLabels: Bool { get set }
  • True if the value’s magnitude is included in abbreviated labels. For example, the “k” in “1.23k”.

    Declaration

    Swift

    @Published
    public var isMagnitudedDisplayed: Bool { get set }
  • Undocumented

    Declaration

    Swift

    @Published
    public var abbreviatedFormatter: NumberFormatter { get set }
  • Allows you to specify the minimum value for the axis, overriding the minimum value applied by the chart. explicitMin and explicitMax override the data min and max range values presented in the ChartNumericAxis. If the data minimum and maximum values are 0 and 100, the ChartNumericAxis will present the range between 0 and 100. By setting explicitMin and explicitMax to -20 and 120, would have the ChartNumericAxis display a new range between -20 and 120.

    Normally explicitMin and explicitMax are used when multiple charts share a context and should have the same axis ranges. Like in a trellis situation.

    Default is nil.

    Declaration

    Swift

    @Published
    public var explicitMin: CGFloat? { get set }
  • Allows you to specify the maximum value for the axis, overriding the maximum value applied by the chart. explicitMin and explicitMax override the data min and max range values presented in the ChartNumericAxis. If the data minimum and maximum values are 0 and 100, the ChartNumericAxis will present the range between 0 and 100. By setting explicitMin and explicitMax to -20 and 120, would have the ChartNumericAxis display a new range between -20 and 120.

    Normally explicitMin and explicitMax are used when multiple charts share a context and should have the same axis ranges. Like in a trellis situation.

    Default is nil.

    Declaration

    Swift

    @Published
    public var explicitMax: CGFloat? { get set }
  • conform to Equatable

    Declaration

    Swift

    static func == (lhs: ChartNumericAxisAttributes, rhs: ChartNumericAxisAttributes) -> Bool