Class: ApexCharts::Series::CartesianSeries
- Inherits:
-
Object
- Object
- ApexCharts::Series::CartesianSeries
- Includes:
- Utils::Copy
- Defined in:
- lib/apex_charts/series/cartesian_series.rb
Instance Attribute Summary collapse
-
#sanitized ⇒ Object
readonly
Returns the value of attribute sanitized.
Instance Method Summary collapse
-
#initialize(data) ⇒ CartesianSeries
constructor
A new instance of CartesianSeries.
- #sample ⇒ Object
Methods included from Utils::Copy
Constructor Details
#initialize(data) ⇒ CartesianSeries
Returns a new instance of CartesianSeries.
11 12 13 |
# File 'lib/apex_charts/series/cartesian_series.rb', line 11 def initialize(data) @sanitized = {series: build_series(deep_copy(data))} end |
Instance Attribute Details
#sanitized ⇒ Object (readonly)
Returns the value of attribute sanitized.
9 10 11 |
# File 'lib/apex_charts/series/cartesian_series.rb', line 9 def sanitized @sanitized end |
Instance Method Details
#sample ⇒ Object
15 16 17 18 19 20 |
# File 'lib/apex_charts/series/cartesian_series.rb', line 15 def sample return if empty? first_data = sanitized[:series][0][:data][0] first_data.is_a?(Hash) ? first_data[:x] : first_data end |