Class: TChart::Bar

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#fromObject (readonly)

Returns the value of attribute from.



9
10
11
# File 'lib/tchart/model/bar.rb', line 9

def from
  @from
end

#styleObject (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

#toObject (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.bar @from, @to, @style
end