Skip to content

Instantly share code, notes, and snippets.

@vangberg
Created November 9, 2008 06:08
Show Gist options
  • Save vangberg/23208 to your computer and use it in GitHub Desktop.
Save vangberg/23208 to your computer and use it in GitHub Desktop.
# Grass.new takes two arguments: 1. a dataset consisting of an array of arrays:
#
# [["Label", 10], ["Second label", 78]]
#
# the second argument is optional, and should be a hash of desired options:
#
# :width - specify a CSS width, e.g. '100px' or '70%'
# :height - specify a CSS height, e.g. '200px' or '60%'
# :color - color of the bars, e.g. '#224488'
# :text_color - color of label when placed inside a bar, e.g. '#DDDDDD'
# :switch - when a bar is less than this, the label will be printed above the bar
# :class - class name of containing <div>
Grass.new([["Apples", 10],["Oranges", 40],["Bananas", 32],["Pears", 88],["Other", 67]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment