---
title: "init(x:yStart:yEnd:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/rulemark/init(x:ystart:yend:)-8iusl"
---

# init(x:yStart:yEnd:)

Creates a vertical rule mark with a fixed x position and y interval encoding.

## Declaration

```swift
nonisolated init<Y>(x: CGFloat? = nil, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where Y : Plottable
```

## Parameters

- `x`: The x position. If x is nil, the rule will be centered horizontally by default.
- `yStart`: The value plotted with y start.
- `yEnd`: The value plotted with y end.

## Discussion

Discussion Use this initializer to create a vertical rule at y positions from yStart to yEnd for a single x position: Chart(data) {     RuleMark(         yStart: .value("Start Date", $0.startDate),         yEnd: .value("End Date", $0.endDate)     ) }

See RuleMark for the setup of the structure containing the startDate, endDate, and source properties.
