class

Opal::UI::Sparkline

Inherits Opal::UI::Element < Opal::UI::Themable < Reference < Object

Unicode block sparkline generator for visualizing numeric trends.

Constants

BLOCKS = [' ', '▂', '▃', '▄', '▅', '▆', '▇', '█']

Constructors

new(data : Array(Float64), color : Color | Symbol | String = :cyan, title : String | Nil = nil, min : Float64 | Nil = nil, max : Float64 | Nil = nil)
Source

Class methods

render_to_string(data : Array(Float64), color : Color | Symbol | String = Color.none) : String

Convenience helper returning sparkline as a string

Source

Instance methods

color
Source
data
Source
preferred_print_size(available_w : Int32) : Tuple(Int32, Int32)

Preferred size in print mode

Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
title
Source