init(x:y:)
Creates a point mark that plots values to x and y.
Declaration
nonisolated init<X, Y>(x: PlottableValue<X>, y: PlottableValue<Y>) where X : Plottable, Y : PlottableParameters
- x:
The value plotted with x.
- y:
The value plotted with y.
Discussion
Use this initializer to plot one property with x and another property with y:
Chart(data) {
PointMark(
x: .value("Wing Length", $0.wingLength),
y: .value("Wing Length", $0.wingWidth)
)
}[Image]
For more background, see the first example used in PointMark which shows the structure that contains the wingLength and wingHeight properties.