init(xStart:xEnd:y:)
Creates a horizontal rule mark that plots values on its x interval and on y.
Declaration
nonisolated init<X, Y>(xStart: PlottableValue<X>, xEnd: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : PlottableParameters
- xStart:
The value plotted with x start.
- xEnd:
The value plotted with x end.
- y:
The value plotted with y.
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)
)
}[Image]
See the second code example in RuleMark for the setup of the structure that contains the startDate, endDate, and source properties.