Class: TChart::Bar
- Inherits:
-
Object
- Object
- TChart::Bar
- Defined in:
- lib/tchart/model/bar.rb
Overview
A bar that represents a date range on the chart. Responsible for generating TikZ code to render the bar.
Instance Attribute Summary collapse
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#style ⇒ Object
readonly
TikZ style, must be defined in encompasing TeX document.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(from, to, style) ⇒ Bar
constructor
A new instance of Bar.
- #render(tex) ⇒ Object
Constructor Details
#initialize(from, to, style) ⇒ Bar
Returns a new instance of Bar.
13 14 15 16 17 |
# File 'lib/tchart/model/bar.rb', line 13 def initialize(from, to, style) @from = from @to = to @style = style end |
Instance Attribute Details
#from ⇒ Object (readonly)
Returns the value of attribute from.
9 10 11 |
# File 'lib/tchart/model/bar.rb', line 9 def from @from end |
#style ⇒ Object (readonly)
TikZ style, must be defined in encompasing TeX document.
11 12 13 |
# File 'lib/tchart/model/bar.rb', line 11 def style @style end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
10 11 12 |
# File 'lib/tchart/model/bar.rb', line 10 def to @to end |
Instance Method Details
#render(tex) ⇒ Object
19 20 21 |
# File 'lib/tchart/model/bar.rb', line 19 def render(tex) tex. @from, @to, @style end |