GroupedBarChart

public struct GroupedBarChart<ChartData> : View where ChartData : GroupedBarChartData

View for creating a grouped bar chart.

Uses GroupedBarChartData data model.

Declaration

GroupedBarChart(chartData: data, groupSpacing: 25)

View Modifiers

The order of the view modifiers is some what important as the modifiers are various types for stacks that wrap around the previous views.

.touchOverlay(chartData: data)
.averageLine(chartData: data,
strokeStyle: StrokeStyle(lineWidth: 3,dash: [5,10]))
.yAxisPOI(chartData: data,
          markerName: "50",
          markerValue: 50,
          lineColour: Color.blue,
          strokeStyle: StrokeStyle(lineWidth: 3, dash: [5,10]))
.xAxisGrid(chartData: data)
.yAxisGrid(chartData: data)
.xAxisLabels(chartData: data)
.yAxisLabels(chartData: data)
.infoBox(chartData: data)
.floatingInfoBox(chartData: data)
.headerBox(chartData: data)
.legends(chartData: data)
  • Initialises a grouped bar chart view.

    Declaration

    Swift

    public init(
        chartData: ChartData,
        groupSpacing: CGFloat
    )

    Parameters

    chartData

    Must be GroupedBarChartData model.

    groupSpacing

    Spacing between groups of bars.

  • Declaration

    Swift

    public var body: some View { get }