Skip to content

Instantly share code, notes, and snippets.

@vincentchu
Created September 10, 2010 21:13
Show Gist options
  • Save vincentchu/574390 to your computer and use it in GitHub Desktop.
Save vincentchu/574390 to your computer and use it in GitHub Desktop.
data = 1000.times.inject([]) { |m, k| m << rand }
sparkline = Sparkline.new( data, :height => 100, :width => 500 )
puts sparkline.google_img_url
# => "http://chart.apis.google.com/chart?chxt=r,x,y&chd=t:41.5,34.3,63.4,45.0,50.5,35.7,40.6,54.9,62.0,60.6,53.2,44.9,62.4,61.8,53.5,58.5,60.4,64.6,64.5,49.8,49.3,61.4,46.4,50.8,36.1,46.5,52.8,39.7,44.4,42.3,57.6,45.6,34.1,49.0,64.1,61.4,59.9,34.0,43.9,44.8,40.4,34.0,60.3,36.8,56.1,63.1,52.7,39.6,51.9,39.0&chxs=0,990000,11,0,_|1,990000,1,0,_|2,990000,1,0,_&chm=o,990000,0,50,5&cht=lc&chxl=0:|0.17|1:||2:||&chco=336699&chxp=0,38.9904542844803&chls=1,1,0&chs=500x100"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment