Class: Trackplot::Components::Pie
- Defined in:
- lib/trackplot/components/pie.rb
Instance Attribute Summary collapse
-
#data_key ⇒ Object
readonly
Returns the value of attribute data_key.
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(data_key, **options) ⇒ Pie
constructor
A new instance of Pie.
- #to_config ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(data_key, **options) ⇒ Pie
Returns a new instance of Pie.
6 7 8 9 |
# File 'lib/trackplot/components/pie.rb', line 6 def initialize(data_key, **) @data_key = data_key super(**) end |
Instance Attribute Details
#data_key ⇒ Object (readonly)
Returns the value of attribute data_key.
4 5 6 |
# File 'lib/trackplot/components/pie.rb', line 4 def data_key @data_key end |
Instance Method Details
#to_config ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/trackplot/components/pie.rb', line 11 def to_config { type: "pie", data_key: data_key, label_key: [:label_key], donut: .fetch(:donut, false), inner_radius: [:inner_radius], pad_angle: [:pad_angle] || 0.02 }.compact end |