class Opal::UI::BarChart

Overview

Renders horizontal bar charts with labels, percentage scaling, and values.

Defined in:

opal/ui/components/barchart.cr

Constructors

Instance Method Summary

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) #

[View source]

Instance Method Detail

def add(label : String, value : Float64, color : Color | Symbol | String = :cyan, formatted_value : String | Nil = nil) : Nil #

[View source]
def bar_char : Char #

[View source]
def items : Array(BarItem) #

[View source]
def max_value : Float64 | Nil #

[View source]
def preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32) #

[View source]
def render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil #

[View source]
def title : String | Nil #

[View source]