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

# init(x:yStart:yEnd:)

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

## Declaration

```swift
nonisolated init<X, Y>(x: PlottableValue<X>, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where X : Plottable, Y : Plottable
```

## Parameters

- `x`: The value plotted with x.
- `yStart`: The value plotted with y start.
- `yEnd`: The value plotted with y end.

## Discussion

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

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