/
motion_chart.html.erb
33 lines (33 loc) · 1.25 KB
/
motion_chart.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<h2>GoogleVisualr - Motion Chart</h2>
<div class='append-bottom'>
<hr>
<h3>Overview</h3>
<p>
A dynamic chart to explore several indicators over time. The chart is rendered within the browser using Flash.
</p>
<p>
Please refer to <%= link_to "Google's documentation", "http://code.google.com/apis/chart/interactive/docs/gallery/motionchart.html" %> for details on <em>Data Format</em> and <em>Configuration Options</em>. However, <em>Methods</em> and <em>Events</em> are not implemented.
</p>
</div>
<div class='append-bottom'>
<hr>
<h3>Example</h3>
<div id='chart'></div>
<%= raw @chart.to_js('chart') %>
</div>
<div class='append-bottom'>
<hr>
<h3>Code</h3>
<div>
<p>
In your controller, create the data_table object, set new columns, add row values, then instantiate the chart with configuration options.
</p>
<script src="https://gist.github.com/1057962.js?file=controller.rb"></script>
</div>
<div>
<p>
In your view, use the <em>to_js</em> method to generate <%= link_to "JavaScript", "http://code.google.com/apis/chart/interactive/docs/gallery/motionchart.html#Example" %>, during rendering of the view.
</p>
<script src="https://gist.github.com/1057962.js?file=view.html.erb"></script>
</div>
</div>