Class: RatatuiRuby::Widgets::Axis
- Inherits:
-
Object
- Object
- RatatuiRuby::Widgets::Axis
- Includes:
- CoerceableWidget
- Defined in:
- lib/ratatui_ruby/widgets/chart.rb
Overview
Defines an Axis for a Chart
- title
-
String
- bounds
-
Array<Float> [min, max]
- labels
-
Array<String>
- style
-
Style
- labels_alignment
-
Symbol (
:left,:center,:right)
Instance Method Summary collapse
-
#initialize(title: "", bounds: [0.0, 10.0], labels: [], style: nil, labels_alignment: nil) ⇒ Axis
constructor
Creates a new Axis.
Methods included from CoerceableWidget
Constructor Details
#initialize(title: "", bounds: [0.0, 10.0], labels: [], style: nil, labels_alignment: nil) ⇒ Axis
Creates a new Axis.
- title
-
String.
- bounds
-
Array [min, max].
- labels
-
Array of Strings.
- style
-
Style.
- labels_alignment
-
Symbol (:left, :center, :right).
46 47 48 49 50 51 52 53 54 |
# File 'lib/ratatui_ruby/widgets/chart.rb', line 46 def initialize(title: "", bounds: [0.0, 10.0], labels: [], style: nil, labels_alignment: nil) super( title:, bounds: [Float(bounds[0]), Float(bounds[1])], labels:, style:, labels_alignment: ) end |