Class: TChart::GridLine

Inherits:
Object
  • Object
show all
Defined in:
lib/tchart/model/grid_line.rb

Overview

A horizontal or vertical line on the chart that spans the entire width or height of the chart and serves as a reading aid. The x and y axes, and the top and and right frame of the chart are also grid lines. Responsible for generating TikZ code to render the grid line.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from, to) ⇒ GridLine

Returns a new instance of GridLine.



15
16
17
18
# File 'lib/tchart/model/grid_line.rb', line 15

def initialize(from, to)
  @from = from
  @to = to
end

Instance Attribute Details

#fromObject (readonly)

Returns the value of attribute from.



12
13
14
# File 'lib/tchart/model/grid_line.rb', line 12

def from
  @from
end

#toObject (readonly)

Returns the value of attribute to.



13
14
15
# File 'lib/tchart/model/grid_line.rb', line 13

def to
  @to
end

Instance Method Details

#render(tex) ⇒ Object



20
21
22
# File 'lib/tchart/model/grid_line.rb', line 20

def render(tex)
  tex.gridline @from, @to, "gridline"
end