Class: Daytona::Charts::PieData

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ PieData

Returns a new instance of PieData.

Parameters:

  • data (Hash<Symbol, Object>)


194
195
196
197
198
199
# File 'lib/daytona/common/charts.rb', line 194

def initialize(data)
  @label = data.fetch(:label)
  @angle = data.fetch(:angle)
  @radius = data.fetch(:radius)
  @autopct = data.fetch(:autopct)
end

Instance Attribute Details

#angleFloat (readonly)

Returns The angle of the pie slice.

Returns:

  • (Float)

    The angle of the pie slice



185
186
187
# File 'lib/daytona/common/charts.rb', line 185

def angle
  @angle
end

#autopctFloat (readonly)

Returns The autopct value of the pie slice.

Returns:

  • (Float)

    The autopct value of the pie slice



191
192
193
# File 'lib/daytona/common/charts.rb', line 191

def autopct
  @autopct
end

#labelString (readonly)

Returns The label of the pie slice.

Returns:

  • (String)

    The label of the pie slice



182
183
184
# File 'lib/daytona/common/charts.rb', line 182

def label
  @label
end

#radiusFloat (readonly)

Returns The radius of the pie slice.

Returns:

  • (Float)

    The radius of the pie slice



188
189
190
# File 'lib/daytona/common/charts.rb', line 188

def radius
  @radius
end

Instance Method Details

#to_hHash<Symbol, Object>

Returns:

  • (Hash<Symbol, Object>)


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

def to_h = { label:, angle:, radius:, autopct: }