Class: LineChart

Inherits:
ObjectView::Div show all
Includes:
ObjectView
Defined in:
lib/object_view/line_chart.rb

Direct Known Subclasses

PieChart

Instance Attribute Summary collapse

Attributes inherited from ObjectView::Element

#acceptable_children, #children, #single_line, #tag

Instance Method Summary collapse

Methods included from ObjectView

#source, #source=

Methods inherited from ObjectView::Element

#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=

Constructor Details

#initialize(label) ⇒ LineChart

Returns a new instance of LineChart.



6
7
8
9
10
11
12
13
14
# File 'lib/object_view/line_chart.rb', line 6

def initialize(label)
  super()
  @data = ChartData.new(:line)
  @data.label = label
  @data.chart_type = :line
  self.id = @data.id
  add "Loading Chart..."
  self.style = "border: 1px solid black; width: 300px; height: 120px"
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/object_view/line_chart.rb', line 4

def data
  @data
end