<!--
{
  "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/Chart3D/init(_:id:content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts",
      "Charts"
    ],
    "preciseIdentifier" : "s:6Charts7Chart3DV_2id7contentACy7SwiftUI7ForEachVyqd__qd_0_qd_1_GGqd___s7KeyPathCy7ElementQyd__qd_0_Gqd_1_ANctcAIRszSkRd__SHRd_0_AA0B8DContentRd_1_r1_lufc"
  },
  "title" : "init(_:id:content:)"
}
-->

# init(_:id:content:)

Creates a 3D chart composed of a series of marks.

```
nonisolated init<Data, ID, C>(_ data: Data, id: KeyPath<Data.Element, ID>, @Chart3DContentBuilder content: @escaping (Data.Element) -> C) where Content == ForEach<Data, ID, C>, Data : RandomAccessCollection, ID : Hashable, C : Chart3DContent
```

## Parameters

`data`

A collection of data.

`id`

A key path that represents a property of each data element
that can act as a unique identifier for that element. Ensure that
this property conforms to the
<doc://com.apple.documentation/documentation/Swift/Hashable>
protocol.

`content`

The mark that the chart should draw for each element
in the data collection.

## Discussion

This initializer wraps the data that you provide as input in an
implicit <doc://com.apple.documentation/documentation/SwiftUI/ForEach>
structure. If you need to represent more than one series in your chart,
use [`init(content:)`](/documentation/Charts/Chart3D/init(content:)) instead.

---

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)