Class: Daytona::Charts::BoxAndWhiskerChart

Inherits:
Chart2D show all
Defined in:
lib/daytona/common/charts.rb

Instance Attribute Summary collapse

Attributes inherited from Chart2D

#x_label, #y_label

Attributes inherited from Chart

#png, #title, #type

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BoxAndWhiskerChart

Returns a new instance of BoxAndWhiskerChart.

Parameters:

  • data (Hash<Symbol, Object>)


262
263
264
265
266
# File 'lib/daytona/common/charts.rb', line 262

def initialize(data)
  super
  @type = ChartType::BOX_AND_WHISKER
  @elements = data.fetch(:elements, []).map { |e| BoxAndWhiskerData.new(e) }
end

Instance Attribute Details

#elementsArray<Daytona::Charts::BoxAndWhiskerData> (readonly)

Returns The box and whiskers of the chart.

Returns:



259
260
261
# File 'lib/daytona/common/charts.rb', line 259

def elements
  @elements
end

Instance Method Details

#to_hHash<Symbol, Object>

Returns:

  • (Hash<Symbol, Object>)


269
# File 'lib/daytona/common/charts.rb', line 269

def to_h = super.merge(elements: elements.map(&:to_h))