<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Charts",
  "identifier" : "/documentation/Charts/Chart/init(content:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Swift Charts"
    ],
    "preciseIdentifier" : "s:6Charts5ChartV7contentACyxGxyXE_tcfc"
  },
  "title" : "init(content:)"
}
-->

# init(content:)

Creates a chart composed of any number of data series and individual marks.

```
nonisolated init(@ContentBuilder content: () -> Content)
```

## Parameters

`content`

A chart content builder that returns the marks that the
chart should draw.

## Discussion

This initializer draws the marks that you specify in the `content`
input. You can provide individual marks, or marks produced by one or
more <doc://com.apple.documentation/documentation/SwiftUI/ForEach>
constructs, or any combination of these. As a convenience when you
have exactly one `ForEach` in your chart’s content, you can use either
the [`init(_:content:)`](/documentation/Charts/Chart/init(_:content:)) or [`init(_:id:content:)`](/documentation/Charts/Chart/init(_:id:content:)) initializer instead,
either of which wraps the content in an implicit `ForEach`.

---

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)