Created
September 2, 2012 07:47
-
-
Save mages/3595663 to your computer and use it in GitHub Desktop.
Motion Chart Example
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
1 <html> | |
2 <head> | |
3 <script type="text/javascript" | |
4 src="http://www.google.com/jsapi"> | |
5 </script> | |
6 <script type="text/javascript"> | |
7 google.load('visualization', '1', | |
8 {'packages':['motionchart']}); | |
9 google.setOnLoadCallback(drawChart); | |
10 function drawChart() { | |
11 var data=new google.visualization.DataTable(); | |
12 data.addColumn('string', 'Fruit'); | |
13 data.addColumn('date', 'Date'); | |
14 data.addColumn('number', 'Sales'); | |
15 data.addColumn('number', 'Expenses'); | |
16 data.addColumn('string', 'Location'); | |
17 data.addRows([ | |
18 ['Apples',new Date(1988,0,1),1000,300,'East'], | |
19 ['Oranges',new Date(1988,0,1),1150,200,'West'], | |
20 ['Bananas',new Date(1988,0,1),300,250,'West'], | |
21 ['Apples',new Date(1989,6,1),1200,400,'East'], | |
22 ['Oranges',new Date(1989,6,1),750,150,'West'], | |
23 ['Bananas',new Date(1989,6,1),788,617,'West'] | |
24 ]); | |
25 var chart=new google.visualization.MotionChart( | |
26 document.getElementById('chart_div')); | |
27 chart.draw(data, {width: 600, height:300}); | |
28 } | |
29 </script> | |
30 </head> | |
31 <body> | |
32 <div id="chart_div" | |
33 style="width:600px; height:300px;"> | |
34 </div> | |
35 </body> | |
36 </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment