Skip to content

Instantly share code, notes, and snippets.

@mjansen401
Created April 28, 2011 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjansen401/945540 to your computer and use it in GitHub Desktop.
Save mjansen401/945540 to your computer and use it in GitHub Desktop.
Google Chart Bar
<% chart = Gchart.bar(
# see http://code.google.com/apis/chart/docs/gallery/bar_charts.html for Google Charts API bar chart info
#
:grouped => 'true',
:bar_colors => "D6A061,331F08",
:bar_width_and_spacing => 'a,5,30', # bar width, spacing width, group spacing width
:size => '700x400',
:title => "Expected vs Actual Velocity",
:bg => 'FFFFFF00', # transparent
:legend => ['Expected', 'Actual'],
:data => [@report.collect_iteration(:expected), @report.collect_iteration(:actual)],
:axis_with_labels => "x,y",
:axis_labels => [@report.collect_dates],
:axis_range => [nil, [0, @report.max_value, 5]]) %>
<%= image_tag(chart) %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment