Class: Daytona::Charts::BoxAndWhiskerChart
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#elements ⇒ Array<Daytona::Charts::BoxAndWhiskerData>
readonly
The box and whiskers of the chart.
Attributes inherited from Chart2D
Attributes inherited from Chart
Instance Method Summary collapse
-
#initialize(data) ⇒ BoxAndWhiskerChart
constructor
A new instance of BoxAndWhiskerChart.
- #to_h ⇒ Hash<Symbol, Object>
Constructor Details
#initialize(data) ⇒ BoxAndWhiskerChart
Returns a new instance of BoxAndWhiskerChart.
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
#elements ⇒ Array<Daytona::Charts::BoxAndWhiskerData> (readonly)
Returns The box and whiskers of the chart.
259 260 261 |
# File 'lib/daytona/common/charts.rb', line 259 def elements @elements end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
269 |
# File 'lib/daytona/common/charts.rb', line 269 def to_h = super.merge(elements: elements.map(&:to_h)) |