Contents

chartXScale(domain:range:type:)

Configures the x scale for charts.

Declaration

nonisolated func chartXScale<Domain, Range>(domain: Domain, range: Range, type: ScaleType? = nil) -> some View where Domain : ScaleDomain, Range : PositionScaleRange

Parameters

  • domain:

    The possible data values along the x axis in the chart. You can define the domain with a ClosedRange for number or Date values (e.g., 0 ... 500), and with an array for categorical values (e.g., ["A", "B", "C"])

  • range:

    The range of x positions that correspond to the scale domain. By default the range is determined by the dimension of the plot area. You can use range: .plotDimension(startPadding:, endPadding:) to add padding to the scale range.

  • type:

    The scale type.

See Also

Axis scales