Class: Daytona::Charts::Chart2D
- Defined in:
- lib/daytona/common/charts.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#x_label ⇒ String, Nil
readonly
The label of the x-axis.
-
#y_label ⇒ String, Nil
readonly
The label of the y-axis.
Attributes inherited from Chart
#elements, #png, #title, #type
Instance Method Summary collapse
-
#initialize(data) ⇒ Chart2D
constructor
A new instance of Chart2D.
-
#to_h ⇒ Hash<Symbol, Object>
Original metadata.
Constructor Details
#initialize(data) ⇒ Chart2D
Returns a new instance of Chart2D.
53 54 55 56 57 |
# File 'lib/daytona/common/charts.rb', line 53 def initialize(data) super @x_label = data.fetch(:x_label, nil) @y_label = data.fetch(:y_label, nil) end |
Instance Attribute Details
#x_label ⇒ String, Nil (readonly)
Returns The label of the x-axis.
47 48 49 |
# File 'lib/daytona/common/charts.rb', line 47 def x_label @x_label end |
#y_label ⇒ String, Nil (readonly)
Returns The label of the y-axis.
50 51 52 |
# File 'lib/daytona/common/charts.rb', line 50 def y_label @y_label end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
Returns original metadata.
60 |
# File 'lib/daytona/common/charts.rb', line 60 def to_h = super.merge(x_label:, y_label:) |