---
title: "init(centered:stroke:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/axisgridline/init(centered:stroke:)"
---

# init(centered:stroke:)

Creates an axis grid line with the given properties.

## Declaration

```swift
nonisolated init(centered: Bool? = nil, stroke: StrokeStyle? = nil)
```

## Parameters

- `centered`: Whether to center the grid line between two axis values.
- `stroke`: The stroke style of the grid line.
