module Charts::Renderer::SvgRenderer

Attributes

svg[R]

Public Instance Methods

circle(cx, cy, radius, style = {}) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 22
def circle(cx, cy, radius, style = {})
  svg.circle style.merge(cx: cx, cy: cy, r: radius)
end
line(x1, y1, x2, y2, style = {}) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 18
def line(x1, y1, x2, y2, style = {})
  svg.line style.merge(x1: x1, y1: y1, x2: x2, y2: y2)
end
path(d, style = {}) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 30
def path(d, style = {})
  svg.path style.merge(d: d)
end
pre_draw() click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 6
def pre_draw
  @svg = SVG.new width: chart.width, height: chart.height
end
print() click to toggle source
rect(x, y, width, height, style = {}) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 26
def rect(x, y, width, height, style = {})
  svg.rect style.merge(x: x, y: y, width: width, height: height)
end
save(filename) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 14
def save(filename)
  svg.save filename
end
text(text, x, y, style = {}) click to toggle source
# File lib/charts/renderer/svg_renderer.rb, line 34
def text(text, x, y, style = {})
  svg.text text, font_style.merge(style).merge(x: x, y: y)
end