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.



258
259
260
261
262
263
264
# File 'lib/rust-plots.rb', line 258

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

Instance Method Details

#_renderObject



290
291
292
293
294
295
296
297
# File 'lib/rust-plots.rb', line 290

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

#at(values) ⇒ Object



266
267
268
269
270
# File 'lib/rust-plots.rb', line 266

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

#horizontal_labelsObject



278
279
280
281
282
# File 'lib/rust-plots.rb', line 278

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

#labels(value) ⇒ Object



284
285
286
287
288
# File 'lib/rust-plots.rb', line 284

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

#vertical_labelsObject



272
273
274
275
276
# File 'lib/rust-plots.rb', line 272

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