---
title: "chartXScale(range:type:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/view/chartxscale(range:type:)"
---

# chartXScale(range:type:)

Configures the x scale for charts.

## Declaration

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

```

## Parameters

- `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

- [chartXScale(domain:range:type:)](swiftui/view/chartxscale(domain:range:type:).md)
- [chartXScale(domain:type:)](swiftui/view/chartxscale(domain:type:).md)
- [chartXScale(type:)](swiftui/view/chartxscale(type:).md)
- [chartYScale(domain:range:type:)](swiftui/view/chartyscale(domain:range:type:).md)
- [chartYScale(domain:type:)](swiftui/view/chartyscale(domain:type:).md)
- [chartYScale(range:type:)](swiftui/view/chartyscale(range:type:).md)
- [chartYScale(type:)](swiftui/view/chartyscale(type:).md)
- [chartZScale(domain:range:type:)](swiftui/view/chartzscale(domain:range:type:).md)
- [chartZScale(domain:type:)](swiftui/view/chartzscale(domain:type:).md)
- [chartZScale(range:type:)](swiftui/view/chartzscale(range:type:).md)
