init(xStart:xEnd:y:)
Creates an area mark that plots values with a horizontal interval.
Declaration
nonisolated init<X, Y>(xStart: PlottableValue<X>, xEnd: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : PlottableParameters
- xStart:
The starting horizontal position for the mark.
- xEnd:
The ending horizontal position for the mark.
- y:
The vertical position for the mark.
Discussion
Use this initializer to create a range area chart with horizontal intervals. For example you can create a region that encompasses all the temperatures over the course of a day, across a number of days:
Chart(data) { day in
AreaMark(
xStart: .value("Minimum Temperature", minimumTemperature),
xEnd: .value("Maximum Temperature", day.maximumTemperature),
y: .value("Date", day.date)
)
}[Image]
If you want to plot values that have a vertical interval, use init(x:yStart:yEnd:) instead.