class GerbilCharts::SVGDC::SVGPolyline
SVGPolyLine¶ ↑
A polyline, like the polygon class
Send this a series of lineto messages
Constants
- POLYLINE_RESOLUTION
Attributes
operstring[R]
Public Class Methods
new()
click to toggle source
# File lib/gerbilcharts/svgdc/svg_polyline.rb, line 16 def initialize @operstring = "" @last_svg = "" end
Public Instance Methods
lineto(x,y)
click to toggle source
# File lib/gerbilcharts/svgdc/svg_polyline.rb, line 21 def lineto(x,y) s = "#{POLYLINE_RESOLUTION%x},#{POLYLINE_RESOLUTION%y} " @operstring.concat(s) unless @last_svg == s @last_svg=s end
render(xfrag)
click to toggle source
# File lib/gerbilcharts/svgdc/svg_polyline.rb, line 27 def render(xfrag) h= {:points => @operstring } xfrag.polyline( h.merge(render_attributes)) end