init(x:yStart:yEnd:)
Creates an area mark that plots values with a vertical interval.
Declaration
nonisolated init<X, Y>(x: PlottableValue<X>, yStart: PlottableValue<Y>, yEnd: PlottableValue<Y>) where X : Plottable, Y : PlottableParameters
- x:
The horizontal position for the mark.
- yStart:
The starting vertical position for the mark.
- yEnd:
The ending vertical position for the mark.
Discussion
Use this initializer to create a range area chart with vertical 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(
x: .value("Date", day.date),
yStart: .value("Minimum Temperature", minimumTemperature),
yEnd: .value("Maximum Temperature", day.maximumTemperature)
)
}[Image]
If you want to plot values that have a horiztonal interval, use init(xStart:xEnd:y:) instead.