Class: Ambling::Data::LineColumnChart

Inherits:
BaseData show all
Defined in:
lib/ambling/data.rb

Overview

Line and Column Data have a single series and a number of graphs

Direct Known Subclasses

ColumnChart, LineChart

Instance Attribute Summary collapse

Attributes inherited from BaseData

#message

Instance Method Summary collapse

Methods inherited from Base

#to_xml

Constructor Details

#initializeLineColumnChart

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

#graphsObject (readonly)

Returns the value of attribute graphs.



170
171
172
# File 'lib/ambling/data.rb', line 170

def graphs
  @graphs
end

#seriesObject

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_nameObject



192
193
194
# File 'lib/ambling/data.rb', line 192

def tag_name
  "chart"
end