Class: Ambling::Data::LineColumnChart
- Defined in:
- lib/ambling/data.rb
Overview
Line and Column Data have a single series and a number of graphs
Direct Known Subclasses
Instance Attribute Summary collapse
-
#graphs ⇒ Object
readonly
Returns the value of attribute graphs.
-
#series ⇒ Object
Returns the value of attribute series.
Attributes inherited from BaseData
Instance Method Summary collapse
- #build_xml(builder) ⇒ Object
-
#initialize ⇒ LineColumnChart
constructor
A new instance of LineColumnChart.
- #tag_name ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ LineColumnChart
Returns a new instance of LineColumnChart.
172 173 174 |
# File 'lib/ambling/data.rb', line 172 def initialize @series, @graphs = Series.new, [] end |
Instance Attribute Details
#graphs ⇒ Object (readonly)
Returns the value of attribute graphs.
170 171 172 |
# File 'lib/ambling/data.rb', line 170 def graphs @graphs end |
#series ⇒ Object
Returns the value of attribute series.
170 171 172 |
# File 'lib/ambling/data.rb', line 170 def series @series end |
Instance Method Details
#build_xml(builder) ⇒ Object
184 185 186 187 188 189 190 |
# File 'lib/ambling/data.rb', line 184 def build_xml(builder) @message.build_xml(builder) if !@message.nil? builder.series {|series| @series.build_xml(series)} builder.graphs do |graphs| @graphs.each_with_index {|g,i| graphs.graph({:gid => i+1}.merge(g.attributes)) {|graph| g.build_xml(graph)}} end end |
#tag_name ⇒ Object
192 193 194 |
# File 'lib/ambling/data.rb', line 192 def tag_name "chart" end |