CSC/ECE 517 Spring 2015 E1522 Visualization: Difference between revisions
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
===='''Usage'''==== | ===='''Usage'''==== | ||
====Installing==== | =====Installing===== | ||
---- | |||
<pre>gem install googlecharts | <pre>gem install googlecharts | ||
</pre> | </pre> | ||
====Example in Ruby on Rails==== | =====Example in Ruby on Rails===== | ||
'''Controller''': <pre>@line_chart = Gchart.line(:data => [ | ---- | ||
'''Controller''': <pre>@line_chart = Gchart.line(:data => [1, 2, 3, 4, 5])</pre> | |||
'''View''': <pre> <%= image_tag(@line_chart) %></pre> | '''View''': <pre> <%= image_tag(@line_chart) %></pre> | ||
====Basic Usages==== | =====Basic Usages===== | ||
---- | |||
<pre> | <pre> | ||
require ‘gchart’ | require ‘gchart’ | ||
Line 33: | Line 39: | ||
:data => [1, 2, 3, 4, 5]) | :data => [1, 2, 3, 4, 5]) | ||
</pre> | </pre> | ||
====Detail Usages==== | =====Detail Usages===== | ||
---- | |||
==Visualization in Expertiza== | ==Visualization in Expertiza== |
Revision as of 02:21, 1 April 2015
Expertiza - Visualization
Project Description
In this project, the data in Expertiza would be presented in a more convenient and instinct way.
Purpose
Overview of Approach
There are quite a few gems available to visualize data in Ruby on Rails, like Goolgecharts (http://googlecharts.rubyforge.org/) and GoogleVisualr (http://googlecharts.rubyforge.org/). These gems makes use of Google Visualization API and wrap it to let users write ruby codes to present nice charts in their web pages instead of using Javascript.
GoogleVisualr
GoogleVisualr <ref>http://googlevisualr.herokuapp.com/</ref> is a
GoogleCharts
Googlecharts is a ruby gem implements a wrapper for Google Chart API. It is fully tested using RSpec.
Usage
Installing
gem install googlecharts
Example in Ruby on Rails
Controller:
@line_chart = Gchart.line(:data => [1, 2, 3, 4, 5])
View:
<%= image_tag(@line_chart) %>
Basic Usages
require ‘gchart’
Gchart.line(:size => ‘200*200’, :title => “title”, :bg => ‘efefef’, :legend => :data => [1, 2, 3, 4, 5])