Class: RCharts::GraphHelper::Graph::Composition
- Inherits:
-
Object
- Object
- RCharts::GraphHelper::Graph::Composition
- Defined in:
- app/helpers/rcharts/graph_helper/graph/composition.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#axes ⇒ Object
readonly
Returns the value of attribute axes.
Instance Method Summary collapse
-
#initialize(graphable = {}, axis_options = {}) ⇒ Composition
constructor
A new instance of Composition.
- #values ⇒ Object
Constructor Details
#initialize(graphable = {}, axis_options = {}) ⇒ Composition
Returns a new instance of Composition.
12 13 14 15 |
# File 'app/helpers/rcharts/graph_helper/graph/composition.rb', line 12 def initialize(graphable = {}, = {}) @data = graphable @axes = Axes.new(graphable, ) end |
Instance Attribute Details
#axes ⇒ Object (readonly)
Returns the value of attribute axes.
7 8 9 |
# File 'app/helpers/rcharts/graph_helper/graph/composition.rb', line 7 def axes @axes end |
Instance Method Details
#values ⇒ Object
17 18 19 20 21 22 23 |
# File 'app/helpers/rcharts/graph_helper/graph/composition.rb', line 17 def values @values ||= case data.values.first in Hash then data in Array then data.transform_values { it.index_with.with_index { |_, index| index } } else data.transform_values { { nil => it } } end end |