Class: RubyTUI::Widgets::Dataset

Inherits:
Data
  • Object
show all
Defined in:
lib/rubytui/widgets/chart.rb

Overview

Dataset represents a series of data points for the Chart widget.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: "", data: [], style: Style::DEFAULT) ⇒ Dataset

Returns a new instance of Dataset.

Parameters:

  • name (String) (defaults to: "") —

    dataset name; not rendered, as Chart draws no legend (default: "")

  • data (Array<Array(Numeric, Numeric)>) (defaults to: []) —

    [x, y] points, joined by lines in the given order (default: [])

  • style (Style) (defaults to: Style::DEFAULT) —

    line style (default: Style::DEFAULT)



12
13
14
# File 'lib/rubytui/widgets/chart.rb', line 12

def initialize(name: "", data: [], style: Style::DEFAULT)
  super
end

Instance Attribute Details

#data ⇒ Object (readonly)

Returns the value of attribute data

Returns:

  • (Object) —

    the current value of data



6
7
8
# File 'lib/rubytui/widgets/chart.rb', line 6

def data
  @data
end

#name ⇒ Object (readonly)

Returns the value of attribute name

Returns:

  • (Object) —

    the current value of name



6
7
8
# File 'lib/rubytui/widgets/chart.rb', line 6

def name
  @name
end

#style ⇒ Object (readonly)

Returns the value of attribute style

Returns:

  • (Object) —

    the current value of style



6
7
8
# File 'lib/rubytui/widgets/chart.rb', line 6

def style
  @style
end