Class: Rust::Plots::Axis
- Inherits:
-
Renderable
- Object
- Renderable
- Rust::Plots::Axis
- Defined in:
- lib/rust/plots/core.rb
Overview
Represents an axis for a plot.
Constant Summary collapse
- BELOW =
1
- LEFT =
2
- ABOVE =
3
- RIGHT =
4
Instance Method Summary collapse
- #_render ⇒ Object
- #at(values) ⇒ Object
- #horizontal_labels ⇒ Object
-
#initialize(side) ⇒ Axis
constructor
Creates a new axis at the given
side
(constants BELOW, LEFT, ABOVE, and RIGHT are available). - #labels(value) ⇒ Object
- #vertical_labels ⇒ Object
Methods inherited from Renderable
Constructor Details
#initialize(side) ⇒ Axis
Creates a new axis at the given side
(constants BELOW, LEFT, ABOVE, and RIGHT are available).
224 225 226 227 228 229 230 |
# File 'lib/rust/plots/core.rb', line 224 def initialize(side) super() self['side'] = side self.at(nil) self.labels(true) end |
Instance Method Details
#_render ⇒ Object
256 257 258 259 260 261 262 263 |
# File 'lib/rust/plots/core.rb', line 256 def _render() function = Rust::Function.new("axis") function. = @options function.call return self end |
#at(values) ⇒ Object
232 233 234 235 236 |
# File 'lib/rust/plots/core.rb', line 232 def at(values) self['at'] = values return self end |
#horizontal_labels ⇒ Object
244 245 246 247 248 |
# File 'lib/rust/plots/core.rb', line 244 def horizontal_labels self['las'] = 1 return self end |
#labels(value) ⇒ Object
250 251 252 253 254 |
# File 'lib/rust/plots/core.rb', line 250 def labels(value) self['labels'] = value return self end |
#vertical_labels ⇒ Object
238 239 240 241 242 |
# File 'lib/rust/plots/core.rb', line 238 def vertical_labels self['las'] = 2 return self end |