class GerbilCharts::SVGDC::SVGLine
SVGLine
¶ ↑
A simple svg line that honors the rendering attributes
See tests for examples
Attributes
x1[R]
x2[R]
y1[R]
y2[R]
Public Class Methods
new(x1,y1,x2,y2)
click to toggle source
Calls superclass method
# File lib/gerbilcharts/svgdc/svg_line.rb, line 12 def initialize(x1,y1,x2,y2) super() @x1,@y1,@x2,@y2=x1,y1,x2,y2 end
Public Instance Methods
render(xfrag)
click to toggle source
# File lib/gerbilcharts/svgdc/svg_line.rb, line 17 def render(xfrag) fmt="%.2f" h= { :x1 => fmt%@x1, :y1 => fmt%@y1, :x2 => fmt%@x2, :y2 => fmt%@y2 } xfrag.line( h.merge(render_attributes)) end