A Bar chart importing data from an HTML table
|
Monday |
Tuesday |
Wednesday |
Thursday |
Friday |
Saturday |
Sunday |
Richard |
432.11 |
486.56 |
378.12 |
446.18 |
199.55 |
268.65 |
411.12 |
This goes in the documents header:
<script src="RGraph.common.core.js"></script>
<script src="RGraph.common.table.js"></script>
<script src="RGraph.bar.js"></script>
<script src="RGraph.dynamic.js"></script>
<script src="RGraph.tooltips.js"></script>
Put this where you want the chart to show up:
<div>
<canvas id="cvs" width="750" height="300">[No canvas support]</canvas>
</div>
<table id="mytable" border="1" style="margin-left: auto; margin-right: auto">
<tr>
<td></td>
<td>monday</td>
<td>tuesday</td>
<td>wednesday</td>
<td>thursday</td>
<td>friday</td>
<td>saturday</td>
<td>sunday</td>
</tr>
<tr>
<td>richard</td>
<td>432.11</td>
<td>486.56</td>
<td>378.12</td>
<td>446.18</td>
<td>199.55</td>
<td>268.65</td>
<td>411.12</td>
</tr>
</table>
This is the code that generates the chart - it should be placed AFTER the canvas tag(s):