Class: RatatuiRuby::Widgets::BarChart::Bar

Inherits:
Object
  • Object
show all
Includes:
CoerceableWidget
Defined in:
lib/ratatui_ruby/widgets/bar_chart/bar.rb

Overview

A bar in a grouped bar chart.

Examples

BarChart::Bar.new(value: 10, style: Style.new(fg: :red), label: "A")

Instance Method Summary collapse

Methods included from CoerceableWidget

included

Constructor Details

#initialize(value:, label: nil, style: nil, value_style: nil, text_value: nil) ⇒ Bar

:attr_reader: text_value The text to display as the value (optional String, Text::Span, or Text::Line for rich styling).



39
40
41
42
43
44
45
46
47
# File 'lib/ratatui_ruby/widgets/bar_chart/bar.rb', line 39

def initialize(value:, label: nil, style: nil, value_style: nil, text_value: nil)
  super(
    value: Integer(value),
    label:,
    style:,
    value_style:,
    text_value:
  )
end