class
Opal::UI::BarChart
- Opal::UI::BarChart
- Opal::UI::Element
- Reference
- Object
Overview
Renders horizontal bar charts with labels, percentage scaling, and values.
Defined in:
opal/ui/components/barchart.crConstructors
Instance Method Summary
- #add(label : String, value : Float64, color : Color | Symbol | String = :cyan, formatted_value : String | Nil = nil) : Nil
- #bar_char : Char
- #items : Array(BarItem)
- #max_value : Float64 | Nil
- #preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
- #render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
- #title : String | Nil
Instance methods inherited from class Opal::UI::Element
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
preferred_size,
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
render
Constructor Detail
def self.new(items : Array(BarItem) = [] of BarItem, title : String | Nil = nil, bar_char : Char = '█', max_value : Float64 | Nil = nil)
#
Instance Method Detail
def add(label : String, value : Float64, color : Color | Symbol | String = :cyan, formatted_value : String | Nil = nil) : Nil
#