Contents

chartYAxisStyle(content:)

Configures the y axis content of charts.

Declaration

nonisolated func chartYAxisStyle<Content>(@ViewBuilder content: @escaping (ChartAxisContent) -> Content) -> some View where Content : View

Parameters

  • content:

    A closure that returns the content of the axis.

Discussion

Use this modifier to configure the size or aspect ratio of the plot area of charts.

For example:

Chart(data: data) {
    BarMark(x: .value("Category", $0.category))
}
.chartYAxisStyle { axis in
    axis.opacity(0.5)
}

See Also

Axes