Contents

chartPlotStyle(content:)

Configures the plot area of charts.

Declaration

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

Parameters

  • content:

    A closure that returns the content of the plot area.

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))
}
.chartPlotStyle { content in
    content.frame(width: 100, height: 100)
}

See Also

Styles