---
title: "init(xStart:xEnd:y:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/rulemark/init(xstart:xend:y:)-27yvc"
---

# init(xStart:xEnd:y:)

Creates a horizontal rule mark that plots values on its x interval and on y.

## Declaration

```swift
nonisolated init<X, Y>(xStart: PlottableValue<X>, xEnd: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : Plottable
```

## Parameters

- `xStart`: The value plotted with x start.
- `xEnd`: The value plotted with x end.
- `y`: The value plotted with y.

## Discussion

Discussion Use this initializer to create a horizontal rule at x positions from xStart to xEnd to a y position: Chart(data) {     RuleMark(         xStart: .value("Start Date", $0.startDate),         xEnd: .value("End Date", $0.endDate),         y: .value("Pollen Source", $0.source)     ) }

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