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
<div id='chart'></div> | |
<%= @chart.render('chart') %> |
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
<div id='chart'></div> | |
<%= @chart.render('chart') %> |
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
<div id='chart'></div> | |
<%= @chart.render('chart') %> |
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
# http://code.google.com/apis/visualization/documentation/gallery/linechart.html#Example | |
def line_chart | |
@chart = GoogleVisualr::LineChart.new | |
@chart.add_column('string', 'Year') | |
@chart.add_column('number', 'Sales') | |
@chart.add_column('number', 'Expenses') | |
@chart.add_rows(4) | |
@chart.set_value(0, 0, '2004') | |
@chart.set_value(0, 1, 1000) |
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
# http://code.google.com/apis/visualization/documentation/gallery/piechart.html#Example | |
def pie_chart | |
@chart = GoogleVisualr::PieChart.new | |
@chart.add_column('string', 'Task') | |
@chart.add_column('number', 'Hours per Day') | |
@chart.add_rows(5) | |
@chart.set_value(0, 0, 'Work' ) | |
@chart.set_value(0, 1, 11 ) | |
@chart.set_value(1, 0, 'Eat' ) |
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
# http://code.google.com/apis/visualization/documentation/gallery/table.html#Example | |
def table | |
@chart = GoogleVisualr::Table.new | |
@chart.add_column('string' , 'Name') | |
@chart.add_column('number' , 'Salary') | |
@chart.add_column('boolean' , 'Full Time Employee') | |
@chart.add_rows(4) | |
@chart.set_cell(0, 0, 'Mike' ) | |
@chart.set_cell(0, 1, 10000, '$10,000') |
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
# http://code.google.com/apis/visualization/documentation/gallery/image_spark_line.html#Example | |
def image_spark_line | |
@chart = GoogleVisualr::ImageSparkLine.new | |
@chart.add_column("number", "Revenue" ) | |
@chart.add_column("number", "Licenses") | |
@chart.add_rows(10) | |
@chart.set_value(0,0,435) |
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
# http://code.google.com/apis/visualization/documentation/gallery/gauge.html#Example | |
def gauge | |
@chart = GoogleVisualr::Gauge.new | |
@chart.add_column('string' , 'Label') | |
@chart.add_column('number' , 'Value') | |
@chart.add_rows(3) | |
@chart.set_value(0, 0, 'Memory' ) | |
@chart.set_value(0, 1, 80) | |
@chart.set_value(1, 0, 'CPU' ) |
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
# http://code.google.com/apis/visualization/documentation/gallery/orgchart.html#Example | |
def org_chart | |
@chart = GoogleVisualr::OrgChart.new | |
@chart.add_column('string', 'Name' ) | |
@chart.add_column('string', 'Manager') | |
@chart.add_column('string', 'ToolTip') | |
@chart.add_rows( [ | |
[ {:v => 'Mike', :f => 'Mike<div style="color:red; font-style:italic">President</div>' }, '' , 'The President' ], | |
[ {:v => 'Jim' , :f => 'Jim<div style="color:red; font-style:italic">Vice President<div>'}, 'Mike', 'VP' ], |
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
<!-- Specify the size of the Container element explicitly! --> | |
<div id='chart' style='width: 700px; height: 240px;'></div> | |
<%= @chart.render('chart') %> |
OlderNewer