Class: Ambling::Data::XyChart

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

Overview

For an amchart xy (line) chart

Instance Attribute Summary collapse

Attributes inherited from BaseData

#message

Instance Method Summary collapse

Methods inherited from Base

#to_xml

Constructor Details

#initializeXyChart

Returns a new instance of XyChart.



209
210
211
# File 'lib/ambling/data.rb', line 209

def initialize
  @graphs = []
end

Instance Attribute Details

#graphsObject (readonly)

Returns the value of attribute graphs.



207
208
209
# File 'lib/ambling/data.rb', line 207

def graphs
  @graphs
end

Instance Method Details

#build_xml(builder) ⇒ Object



213
214
215
216
217
218
# File 'lib/ambling/data.rb', line 213

def build_xml(builder)
  @message.build_xml(builder) if !@message.nil?
  builder.graphs do |graphs|
    @graphs.each_with_index {|g,i| graphs.graph({:gid => i}) {|graph| g.build_xml(graph)}}
  end
end

#tag_nameObject



220
221
222
# File 'lib/ambling/data.rb', line 220

def tag_name
  "chart"
end