chartLegend(position:alignment:spacing:content:)
Configures the legend for charts.
Declaration
nonisolated func chartLegend<Content>(position: AnnotationPosition = .automatic, alignment: Alignment? = nil, spacing: CGFloat? = nil, @ViewBuilder content: () -> Content) -> some View where Content : View
Parameters
- position:
Configures the position of the legend.
- alignment:
Alignment of the legend within the space available to it. Use
nilfor default alignment. - spacing:
Distance between the legend and the chart. Use
nilfor the default spacing. - content:
The content of the legend.