---
title: "init(content:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/chart/init(content:)"
---

# init(content:)

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

## Declaration

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

## Parameters

- `content`: A chart content builder that returns the marks that the chart should draw.

## Discussion

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 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:) or init(_:id:content:) initializer instead, either of which wraps the content in an implicit ForEach.

## See Also

### Creating a chart

- [init(_:content:)](charts/chart/init(_:content:).md)
- [init(_:id:content:)](charts/chart/init(_:id:content:).md)
