Class: LineChart
- Inherits:
-
ObjectView::Div
- Object
- Hash
- ObjectView::Element
- ObjectView::Div
- LineChart
- Includes:
- ObjectView
- Defined in:
- lib/object_view/line_chart.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Attributes inherited from ObjectView::Element
#acceptable_children, #children, #single_line, #tag
Instance Method Summary collapse
-
#initialize(label) ⇒ LineChart
constructor
A new instance of LineChart.
Methods included from ObjectView
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
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/object_view/line_chart.rb', line 4 def data @data end |