ExRatatui.Widgets.Bar (ExRatatui v0.8.2)

Copy Markdown View Source

A single bar within a ExRatatui.Widgets.BarChart.

Fields

  • :label - plain string shown next to the bar (required)
  • :value - non-negative integer the bar length is scaled against (required)
  • :style - optional %ExRatatui.Style{} overriding the chart's shared bar_style
  • :text_value - optional string replacing the rendered numeric value (e.g. "80%" or "$42k"); when nil, value is rendered as-is

Examples

iex> %ExRatatui.Widgets.Bar{label: "Elixir", value: 80}
%ExRatatui.Widgets.Bar{
  label: "Elixir",
  value: 80,
  style: nil,
  text_value: nil
}

Summary

Types

t()

@type t() :: %ExRatatui.Widgets.Bar{
  label: String.t(),
  style: ExRatatui.Style.t() | nil,
  text_value: String.t() | nil,
  value: non_neg_integer()
}