class
Opal::UI::Sparkline
- Opal::UI::Sparkline
- Opal::UI::Element
- Reference
- Object
Overview
Unicode block sparkline generator for visualizing numeric trends.
Defined in:
opal/ui/components/sparkline.crConstant Summary
-
BLOCKS =
[' ', '▂', '▃', '▄', '▅', '▆', '▇', '█']
Constructors
Class Method Summary
-
.render_to_string(data : Array(Float64), color : Color | Symbol | String = Color.none) : String
Convenience helper returning sparkline as a string
Instance Method Summary
- #color : Color
- #data : Array(Float64)
- #max : Float64 | Nil
- #min : 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(data : Array(Float64), color : Color | Symbol | String = :cyan, title : String | Nil = nil, min : Float64 | Nil = nil, max : Float64 | Nil = nil)
#
Class Method Detail
def self.render_to_string(data : Array(Float64), color : Color | Symbol | String = Color.none) : String
#
Convenience helper returning sparkline as a string