Class: TChart::Separator
- Inherits:
-
Object
- Object
- TChart::Separator
- Defined in:
- lib/tchart/model/separator.rb
Overview
The input data file specifies settings, data lines, and separators. A separator renders as a horizontal grid line and serves to separate the charted items into sections. Responsible for building the grid line element.
Instance Attribute Summary collapse
-
#date_ranges ⇒ Object
readonly
This is part of the charted item interface.
Instance Method Summary collapse
-
#build(layout, y) ⇒ Object
> [ GridLine ].
-
#initialize ⇒ Separator
constructor
A new instance of Separator.
Constructor Details
#initialize ⇒ Separator
Returns a new instance of Separator.
17 18 19 |
# File 'lib/tchart/model/separator.rb', line 17 def initialize @date_ranges = [] end |
Instance Attribute Details
#date_ranges ⇒ Object (readonly)
This is part of the charted item interface. Separators have no date ranges so this array will always be empty.
15 16 17 |
# File 'lib/tchart/model/separator.rb', line 15 def date_ranges @date_ranges end |
Instance Method Details
#build(layout, y) ⇒ Object
> [ GridLine ]
21 22 23 24 25 |
# File 'lib/tchart/model/separator.rb', line 21 def build(layout, y) # => [ GridLine ] from = xy(0, y) to = xy(layout.x_axis_length, y) [ GridLine.new(from, to) ] end |