Created
July 30, 2010 02:47
-
-
Save X4/499786 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| # Create a new AnnotatedTimeLine chart | |
| @chart = GoogleVisualr::AnnotatedTimeLine.new | |
| # Add Column Headers | |
| @chart.add_column('date' , 'Created at') | |
| @chart.add_column('number', 'Open') | |
| @chart.add_column('number', 'Close') | |
| @chart.add_column('number', 'High' ) | |
| @chart.add_column('number', 'Low' ) | |
| @chart.add_column('number', 'Volume') | |
| # Add Rows and Values | |
| @chart.add_rows( [ | |
| [ Date.parse('2010-02-15'), 30000, 123, '23', 40645, '44'], | |
| [ Date.parse('2009-02-15'), 30000, 123, '3', 40645, '44'], | |
| [ Date.parse('2009-08-15'), 30000, 123, '34', 40645, '22'], | |
| [ Date.parse('2009-06-15'), 30000, 123, '342', 40645, '22'], | |
| [ Date.parse('2008-02-15'), 30000, 123, '24', 40645, '22'] | |
| ] ) | |
| options = { :displayAnnotations => true} | |
| options.each_pair do | key, value | | |
| @chart.send "#{key}=", value | |
| end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment