File: table_to_chart.html

package info (click to toggle)
jsxgraph 1.3.5+dfsg1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 26,044 kB
  • sloc: xml: 5,869; java: 1,072; python: 747; php: 192; makefile: 146; sh: 47
file content (37 lines) | stat: -rw-r--r-- 1,553 bytes parent folder | download | duplicates (2)
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
34
35
36
37
<html>
<head>
   <title>JSXGraph example: Line charts out of data given in a table</title>
   <link rel="stylesheet" type="text/css" href="../distrib/jsxgraph.css" />
   <script type="text/javascript" src="/javascript/prototype/prototype.js"></script>
   <script type="text/javascript" src="../src/loadjsxgraph.js"></script>
</head>
<body>
<h2>Line charts out of data given in a table</h2>
<table id="data">
<tr><td>Things</td><td>August 2008</td><td>September 2008</td><td>October 2008</td><td>November 2008</td></tr>
<tr><td>Food</td><td>280</td><td>190</td><td>210</td><td>310</td></tr>
<tr><td>Gas</td><td>150</td><td>130</td><td>165</td><td>190</td></tr>
<tr><td>Cell</td><td>60</td><td>90</td><td>76</td><td>82</td></tr>
<tr><td>Hobbies</td><td>320</td><td>340</td><td>165</td><td>280</td></tr>
<tr><td>Other things</td><td>200</td><td>170</td><td>215</td><td>179</td></tr>
</table>
<div id="debug" style="display:block;"></div>
<div style="width:800px">
  <div id="jxgbox" class="jxgbox" style="width:600px; height:450px; float:left"></div>
</div>
   <script type="text/javascript">
   /* <![CDATA[ */

        b = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-0.5, 350, 5, -30], axis: true, grid: false});

		c = b.create('chart', ['data'], { chartStyle: 'bar',
							     dynamic: true, withLabel: true,
							     degree: 2, dir: 'vertical',
							     face: 'X', size: 4,
							     strokeWidth: 2, withLabel: true,
							     strokeColor: ['#abf', '#e12', '#3d21a3', '#020310', '#020abc']});

  /* ]]> */
  </script>
</body>
</html>