Created
November 9, 2008 06:08
-
-
Save vangberg/23208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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