---
title: "init(xStart:xEnd:yStart:yEnd:)"
framework: charts
role: symbol
role_heading: Initializer
path: "charts/barmark/init(xstart:xend:ystart:yend:)-7541n"
---

# init(xStart:xEnd:yStart:yEnd:)

Creates a bar mark with fixed x interval that plots values with its y interval.

## Declaration

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

## Parameters

- `xStart`: The x start position. If xStart is nil then the rectangle will start at the leading edge of the plotting area.
- `xEnd`: The x end position. If xStart is nil then the rectangle will end at the trailing edge of the plotting area.
- `yStart`: The value plotted to y start.
- `yEnd`: The value plotted to y end.

## Discussion

Discussion Use this initializer to show vertical intervals for one category: Chart(data) {    BarMark(        yStart: .value("Start Time", $0.start),        yEnd: .value("End Time", $0.end)    ) }

## See Also

### Creating a bar mark

- [init(x:yStart:yEnd:width:)](charts/barmark/init(x:ystart:yend:width:).md)
- [init(xStart:xEnd:y:height:)](charts/barmark/init(xstart:xend:y:height:).md)
- [init(x:y:width:height:stacking:)](charts/barmark/init(x:y:width:height:stacking:).md)
- [init(xStart:xEnd:yStart:yEnd:)](charts/barmark/init(xstart:xend:ystart:yend:)-98wo9.md)
- [init(x:y:width:height:stacking:)](charts/barmark/init(x:y:width:height:stacking:).md)
- [init(x:yStart:yEnd:width:stacking:)](charts/barmark/init(x:ystart:yend:width:stacking:).md)
- [init(xStart:xEnd:y:height:stacking:)](charts/barmark/init(xstart:xend:y:height:stacking:).md)
