Class: ApexCharts::BubbleSeries
- Inherits:
-
Object
- Object
- ApexCharts::BubbleSeries
- Includes:
- Utils::Copy
- Defined in:
- lib/apexcharts/series/bubble.rb
Instance Attribute Summary collapse
-
#sanitized ⇒ Object
readonly
Returns the value of attribute sanitized.
Instance Method Summary collapse
-
#initialize(data) ⇒ BubbleSeries
constructor
A new instance of BubbleSeries.
- #sample ⇒ Object
Methods included from Utils::Copy
Constructor Details
#initialize(data) ⇒ BubbleSeries
Returns a new instance of BubbleSeries.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/apexcharts/series/bubble.rb', line 9 def initialize(data) data = deep_copy(data) sanitized = case data when Array if array_of_threes?(data) [{data: data}] else data end when Hash if data_value = data[:data] [data] if array_of_threes?(data_value) end end @sanitized = {series: sanitized} end |
Instance Attribute Details
#sanitized ⇒ Object (readonly)
Returns the value of attribute sanitized.
7 8 9 |
# File 'lib/apexcharts/series/bubble.rb', line 7 def sanitized @sanitized end |
Instance Method Details
#sample ⇒ Object
30 31 32 33 34 |
# File 'lib/apexcharts/series/bubble.rb', line 30 def sample return if empty? sanitized[:series][0][:data][0] end |