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

# init(xStart:xEnd:y:height:)

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

## Declaration

```swift
nonisolated init<X, Y>(xStart: PlottableValue<X>, xEnd: PlottableValue<X>, y: PlottableValue<Y>, height: MarkDimension = .automatic) 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.
- `height`: The bar height. If height is nil, the default bar size will be applied.

## Discussion

Discussion Use this initializer to show horizontal intervals for one or more categories: Chart(data) {    BarMark(        xStart: .value("Start Time", $0.start),        xEnd: .value("End Time", $0.end),        y: .value("Job", $0.job)    ) }

## See Also

### Creating a bar mark

- [init(x:yStart:yEnd:width:)](charts/barmark/init(x:ystart:yend:width:).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(xStart:xEnd:yStart:yEnd:)](charts/barmark/init(xstart:xend:ystart:yend:)-7541n.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)
