Skip to content

Instantly share code, notes, and snippets.

@frankieroberto
Created May 19, 2010 20:55
Show Gist options
  • Save frankieroberto/406826 to your computer and use it in GitHub Desktop.
Save frankieroberto/406826 to your computer and use it in GitHub Desktop.
def chart_path(data_values, h_value, options = {})
colour = options[:colour] || "000000"
height = options[:height] || "100"
width = options[:width] || "228"
background_colour = options[:background_colour] || "FFFFFF"
background_opacity = options[:background_opacity] || "00"
google_chart_path = "http://chart.apis.google.com/chart?chs=" + width + "x" + height + "&cht=ls"
google_chart_path += "&chd=t:" + data_values.to_s + "&chds=0," + h_value.to_s + "&chxt=y,x&chxl=0:||" + "" + "|1:|" + "" + "|" + "" + "&chco=" + colour + "&chf=bg,s," + background_colour + background_opacity
return google_chart_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment