init(xStart:xEnd:yStart:yEnd:)
Creates a bar mark with fixed x interval that plots values with its y interval.
Declaration
nonisolated init<Y>(xStart: CGFloat? = nil, xEnd: CGFloat? = nil, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where Y : PlottableParameters
- xStart:
The x start position. If
xStartisnilthen the rectangle will start at the leading edge of the plotting area. - xEnd:
The x end position. If
xStartisnilthen 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
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)
)
}[Image]