init(x:yStart:yEnd:)
Creates a vertical rule mark with an x encoding and y interval encoding.
Declaration
nonisolated init<X, Y>(x: PlottableValue<X>, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where X : Plottable, Y : PlottableParameters
- x:
The value plotted with x.
- yStart:
The value plotted with y start.
- yEnd:
The value plotted with y end.
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)
)
}[Image]
See RuleMark for the setup of the structure that contains the startDate, endDate, and source properties.