# `ExRatatui.Widgets.BarGroup`
[🔗](https://github.com/mcass19/ex_ratatui/blob/v0.8.2/lib/ex_ratatui/widgets/bar_group.ex#L1)

A labelled cluster of `ExRatatui.Widgets.Bar` rendered together inside a
`ExRatatui.Widgets.BarChart`.

Use groups when you need to show several related bars side by side
with a shared caption — comparing the same metrics across categories,
for example. Set `BarChart.groups` to `[%BarGroup{}, ...]` instead of
the flat `:data` list; the chart will draw each group as a cluster
separated by `BarChart.group_gap` cells.

## Fields

  * `:label` - optional caption rendered under the cluster; `nil`
    omits it
  * `:bars` - list of `%ExRatatui.Widgets.Bar{}` belonging to the
    group (required; may be empty)

## Examples

    iex> alias ExRatatui.Widgets.{Bar, BarGroup}
    iex> %BarGroup{label: "Q1", bars: [%Bar{label: "A", value: 5}]}
    %ExRatatui.Widgets.BarGroup{
      label: "Q1",
      bars: [%ExRatatui.Widgets.Bar{label: "A", value: 5, style: nil, text_value: nil}]
    }

# `t`

```elixir
@type t() :: %ExRatatui.Widgets.BarGroup{
  bars: [ExRatatui.Widgets.Bar.t()],
  label: String.t() | nil
}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
