# `PhiaUi.Components.WaterfallChart`
[🔗](https://github.com/charlenopires/PhiaUI/blob/v0.1.17/lib/phia_ui/components/data/waterfall_chart.ex#L1)

Waterfall chart — cumulative positive/negative bars — pure SVG, zero JS.

Each bar floats at the cumulative total of previous bars. Positive steps
use `positive_color`, negative steps use `negative_color`. An optional
final bar rendered in `total_color` shows the aggregate sum.

## Examples

    <.waterfall_chart data={[
      %{label: "Revenue",   value: 500},
      %{label: "COGS",      value: -200},
      %{label: "Gross",     value: 0, total: true},
      %{label: "OpEx",      value: -120},
      %{label: "EBIT",      value: 0, total: true}
    ]} />

# `waterfall_chart`

## Attributes

* `data` (`:list`) (required) - List of `%{label, value}`. Optional `:total` boolean marks a bar that
  resets to the running sum (shown in `total_color`).

* `positive_color` (`:string`) - Color for gains. Defaults to `"oklch(0.70 0.18 145)"`.
* `negative_color` (`:string`) - Color for losses. Defaults to `"oklch(0.60 0.25 0)"`.
* `total_color` (`:string`) - Color for total bars. Defaults to `"oklch(0.60 0.20 240)"`.
* `show_grid` (`:boolean`) - Defaults to `true`.
* `show_labels` (`:boolean`) - Defaults to `true`.
* `animate` (`:boolean`) - Defaults to `true`.
* `animation_duration` (`:integer`) - Defaults to `600`.
* `theme` (`:map`) - Chart theme overrides. Defaults to `%{}`.
* `id` (`:string`) - Unique ID for the chart (auto-generated if not provided). Defaults to `nil`.
* `title` (`:string`) - Chart title rendered above the visualization. Defaults to `nil`.
* `description` (`:string`) - Chart description for context (rendered below title). Defaults to `nil`.
* `class` (`:string`) - Defaults to `nil`.
* Global attributes are accepted.

---

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