Class: Rust::Plots::Axis

Inherits:
Renderable show all
Defined in:
lib/rust/plots/core.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.



159
160
161
162
163
164
165
# File 'lib/rust/plots/core.rb', line 159

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

Instance Method Details

#_renderObject



191
192
193
194
195
196
197
198
# File 'lib/rust/plots/core.rb', line 191

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

#at(values) ⇒ Object



167
168
169
170
171
# File 'lib/rust/plots/core.rb', line 167

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

#horizontal_labelsObject



179
180
181
182
183
# File 'lib/rust/plots/core.rb', line 179

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

#labels(value) ⇒ Object



185
186
187
188
189
# File 'lib/rust/plots/core.rb', line 185

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

#vertical_labelsObject



173
174
175
176
177
# File 'lib/rust/plots/core.rb', line 173

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