<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "visionOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/RectangleMark/init(x:y:z:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts",
      "Charts"
    ],
    "preciseIdentifier" : "s:6Charts13RectangleMarkV1x1y1zAcA14PlottableValueVyxG_AHyq_GAHyq0_GtcAA0D0RzAaLR_AaLR0_r1_lufc"
  },
  "title" : "init(x:y:z:)"
}
-->

# init(x:y:z:)

Creates a rectangle mark for a 3D chart.

```
nonisolated init(x: PlottableValue<some Plottable>, y: PlottableValue<some Plottable>, z: PlottableValue<some Plottable>)
```

## Parameters

`x`

The x value.

`y`

The y value.

`z`

The z value.

## Discussion> Important: A 3D RectangleMark requires one parameter to be a single numeric value and the other two parameters to be numeric ranges.

For example, the following `Chart3D` shows a rectangle mark that extends along the x-axis and y-axis.

```swift
Chart3D {
    RectangleMark(
        x: .value("x", -0.5..<0.5),
        y: .value("y", -0.5..<0.5),
        z: .value("z", 0)
    )
}
```

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)