Class: Charts::Renderer
- Inherits:
-
Object
show all
- Defined in:
- lib/charts/renderer/renderer.rb
Defined Under Namespace
Modules: RvgRenderer, SvgRenderer
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(chart) ⇒ Renderer
Returns a new instance of Renderer.
Instance Attribute Details
#chart ⇒ Object
Returns the value of attribute chart.
2
3
4
|
# File 'lib/charts/renderer/renderer.rb', line 2
def chart
@chart
end
|
Instance Method Details
#font_size ⇒ Object
37
38
39
|
# File 'lib/charts/renderer/renderer.rb', line 37
def font_size
16
end
|
#font_style ⇒ Object
30
31
32
33
34
35
|
# File 'lib/charts/renderer/renderer.rb', line 30
def font_style
{
font_family: 'arial',
font_size: font_size
}
end
|
#grid_line_style ⇒ Object
23
24
25
26
27
28
|
# File 'lib/charts/renderer/renderer.rb', line 23
def grid_line_style
{
stroke: '#BBBBBB',
stroke_width: 1
}
end
|
#post_draw ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/charts/renderer/renderer.rb', line 14
def post_draw
filename = chart.options[:filename]
if filename
save filename
else
print
end
end
|