Class: Daytona::Charts::BoxAndWhiskerData
- Inherits:
-
Object
- Object
- Daytona::Charts::BoxAndWhiskerData
- Defined in:
- lib/daytona/common/charts.rb
Instance Attribute Summary collapse
-
#first_quartile ⇒ Float
readonly
The first quartile of the box and whisker.
-
#label ⇒ String
readonly
The label of the box and whisker.
-
#max ⇒ Float
readonly
The maximum value of the box and whisker.
-
#median ⇒ Float
readonly
The median of the box and whisker.
-
#min ⇒ Float
readonly
The minimum value of the box and whisker.
-
#outliers ⇒ Array<Float>
readonly
The outliers of the box and whisker.
-
#third_quartile ⇒ Float
readonly
The third quartile of the box and whisker.
Instance Method Summary collapse
-
#initialize(data) ⇒ BoxAndWhiskerData
constructor
A new instance of BoxAndWhiskerData.
- #to_h ⇒ Hash<Symbol, Object>
Constructor Details
#initialize(data) ⇒ BoxAndWhiskerData
Returns a new instance of BoxAndWhiskerData.
243 244 245 246 247 248 249 250 251 |
# File 'lib/daytona/common/charts.rb', line 243 def initialize(data) @label = data.fetch(:label) @min = data.fetch(:min) @first_quartile = data.fetch(:first_quartile) @median = data.fetch(:median) @third_quartile = data.fetch(:third_quartile) @max = data.fetch(:max) @outliers = data.fetch(:outliers, []) end |
Instance Attribute Details
#first_quartile ⇒ Float (readonly)
Returns The first quartile of the box and whisker.
228 229 230 |
# File 'lib/daytona/common/charts.rb', line 228 def first_quartile @first_quartile end |
#label ⇒ String (readonly)
Returns The label of the box and whisker.
222 223 224 |
# File 'lib/daytona/common/charts.rb', line 222 def label @label end |
#max ⇒ Float (readonly)
Returns The maximum value of the box and whisker.
237 238 239 |
# File 'lib/daytona/common/charts.rb', line 237 def max @max end |
#median ⇒ Float (readonly)
Returns The median of the box and whisker.
231 232 233 |
# File 'lib/daytona/common/charts.rb', line 231 def median @median end |
#min ⇒ Float (readonly)
Returns The minimum value of the box and whisker.
225 226 227 |
# File 'lib/daytona/common/charts.rb', line 225 def min @min end |
#outliers ⇒ Array<Float> (readonly)
Returns The outliers of the box and whisker.
240 241 242 |
# File 'lib/daytona/common/charts.rb', line 240 def outliers @outliers end |
#third_quartile ⇒ Float (readonly)
Returns The third quartile of the box and whisker.
234 235 236 |
# File 'lib/daytona/common/charts.rb', line 234 def third_quartile @third_quartile end |
Instance Method Details
#to_h ⇒ Hash<Symbol, Object>
254 |
# File 'lib/daytona/common/charts.rb', line 254 def to_h = { label:, min:, first_quartile:, median:, third_quartile:, max:, outliers: } |