Class: TChart::Chart
- Inherits:
-
Object
- Object
- TChart::Chart
- Defined in:
- lib/tchart/model/chart.rb
Overview
The plots of zero or more date ranges. Includes bars representing the date ranges, x and y axes lines, gridlines, and labels. Has overall responsibility for generating all of the TikZ code to render the chart.
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Labels, gridlines and bars that make up the chart.
Instance Method Summary collapse
-
#initialize(elements) ⇒ Chart
constructor
A new instance of Chart.
-
#render ⇒ Object
> String.
Constructor Details
#initialize(elements) ⇒ Chart
Returns a new instance of Chart.
12 13 14 |
# File 'lib/tchart/model/chart.rb', line 12 def initialize(elements) @elements = elements end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Labels, gridlines and bars that make up the chart.
10 11 12 |
# File 'lib/tchart/model/chart.rb', line 10 def elements @elements end |
Instance Method Details
#render ⇒ Object
> String
16 17 18 19 20 21 22 |
# File 'lib/tchart/model/chart.rb', line 16 def render # => String tex = TeXBuilder.new tex.begin_chart @elements.each { |element| element.render(tex) } tex.end_chart tex.to_s end |