Class: Rust::Plots::Axis

Inherits:
Renderable show all
Defined in:
lib/rust-plots.rb

Constant Summary collapse

BELOW =
1
LEFT =
2
ABOVE =
3
RIGHT =
4

Instance Method Summary collapse

Methods inherited from Renderable

#[]=

Constructor Details

#initialize(side) ⇒ Axis

Returns a new instance of Axis.



327
328
329
330
331
332
333
# File 'lib/rust-plots.rb', line 327

def initialize(side)
    super()
    
    self['side'] = side
    self.at(nil)
    self.labels(true)
end

Instance Method Details

#_renderObject



359
360
361
362
363
364
365
366
# File 'lib/rust-plots.rb', line 359

def _render()
    function = Rust::Function.new("axis")
    function.options = @options
    
    function.call
    
    return self
end

#at(values) ⇒ Object



335
336
337
338
339
# File 'lib/rust-plots.rb', line 335

def at(values)
    self['at'] = values
    
    return self
end

#horizontal_labelsObject



347
348
349
350
351
# File 'lib/rust-plots.rb', line 347

def horizontal_labels
    self['las'] = 1
    
    return self
end

#labels(value) ⇒ Object



353
354
355
356
357
# File 'lib/rust-plots.rb', line 353

def labels(value)
    self['labels'] = value
    
    return self
end

#vertical_labelsObject



341
342
343
344
345
# File 'lib/rust-plots.rb', line 341

def vertical_labels
    self['las'] = 2
    
    return self
end