chartScrollableAxes(_:)
Configures the scrollable behavior of charts in this view.
Declaration
nonisolated func chartScrollableAxes(_ axes: Axis.Set) -> some View
Parameters
- axes:
The set of axes to enable scrolling.
Discussion
Use this method to make a chart scrollable. Below is an example that makes a chart scrollable along the horizontal axis.
Chart(data) {
BarMark(
x: .value("x", $0.x),
y: .value("y", $0.y)
)
}
.chartScrollableAxes(.horizontal)