The diagram (chart) view for table data

The script generates a diagram (chart) view of the data in a table.
The values in the table must be non-negative (more than or equal to 0). They can be either integer or decimal.

Usage: insert an element (link, button etc.) with a mouseevent (onclick, onkeyup etc.) that equals "showDiagram(event)" into the table row with the title of data.
The values from the next row will be considered labels of the diagram.
The values from the row after this will be considered values of the diagram.

Bind the 2 script files on the bottom of your document this way:
<script language="JavaScript" src="tableDiagram.js"></script>
<script language="JavaScript" src="dragElement.js"></script>

Edit the diagram stylesheet if you like. Bind the stylesheet into the <HEAD> - area:
<link type="text/css" rel="stylesheet" href="tableDiagram.css" >

Click on the label "Show diagram" to see the diagram view.

Example 1
Integer data I   Show diagram
JanuaryFebruaryMarchAprilMai JunyJulyAugust
125151861351245085168

Example 2
Integer data II   Show diagram
JanuaryFebruaryMarchAprilMai JuniJulyAugustSeptemberOctober
56482054495610525449

Example 3
Decimal data I    
JanuaryFebruaryMarchAprilMai JunyJulyAugust
125.515.7186.8135.0124.750.585.9168.0

Example 4
Decimal data II   Show diagram
JanuaryFebruaryMarchAprilMai JuniJulyAugustSeptemberOctoberNovemberDecember
2.567.483.205.548.491.642.107.525.474.911.254.31


Download the source

Change log:
version 1.2: the diagram flips to left or to top to have always the optimal view.