Class: Daytona::Charts::BoxAndWhiskerData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ BoxAndWhiskerData

Returns a new instance of BoxAndWhiskerData.

Parameters:

  • data (Hash<Symbol, Object>)


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_quartileFloat (readonly)

Returns The first quartile of the box and whisker.

Returns:

  • (Float)

    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

#labelString (readonly)

Returns The label of the box and whisker.

Returns:

  • (String)

    The label of the box and whisker



222
223
224
# File 'lib/daytona/common/charts.rb', line 222

def label
  @label
end

#maxFloat (readonly)

Returns The maximum value of the box and whisker.

Returns:

  • (Float)

    The maximum value of the box and whisker



237
238
239
# File 'lib/daytona/common/charts.rb', line 237

def max
  @max
end

#medianFloat (readonly)

Returns The median of the box and whisker.

Returns:

  • (Float)

    The median of the box and whisker



231
232
233
# File 'lib/daytona/common/charts.rb', line 231

def median
  @median
end

#minFloat (readonly)

Returns The minimum value of the box and whisker.

Returns:

  • (Float)

    The minimum value of the box and whisker



225
226
227
# File 'lib/daytona/common/charts.rb', line 225

def min
  @min
end

#outliersArray<Float> (readonly)

Returns The outliers of the box and whisker.

Returns:

  • (Array<Float>)

    The outliers of the box and whisker



240
241
242
# File 'lib/daytona/common/charts.rb', line 240

def outliers
  @outliers
end

#third_quartileFloat (readonly)

Returns The third quartile of the box and whisker.

Returns:

  • (Float)

    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_hHash<Symbol, Object>

Returns:

  • (Hash<Symbol, Object>)


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

def to_h = { label:, min:, first_quartile:, median:, third_quartile:, max:, outliers: }