summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/statistic/running.phtml
blob: 019b7fcdfdae10ef7516e709fa68464fc2bdbe76 (plain) (blame)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<h1>Statistic - Running</h1>

<link
	rel="stylesheet" type="text/css"
	href="/media/css/jquery.jqplot.min.css" />

<select id="poolselectbox" name="PoolSelectbox"
	onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
	<option value="default">Please choose a Pool</option>
</select>

<script>

//fetch all poolevents of the selected #poolselectbox value
function fetchPoolEvents() {
  poolID = $("#poolselectbox option:selected").val();
  plot();
}

function setPoolIDtmp() {
    poolIDtmp = $("#poolselectbox option:selected").val();
  }

function plot() {
	$('#plot').empty();
	  var data = [['Commuting', 7], ['Orientation', 9]];
	  $.jqplot('plot', [data],
	              {
	                seriesDefaults: {
	                  // Make this a pie chart.
	                  renderer: jQuery.jqplot.PieRenderer,
	                  rendererOptions: {
	                    // Put data labels on the pie slices.
	                    // By default, labels show the percentage of the slice.
	                    showDataLabels: true,
	                    lineLabels: true
	                  }
	                }
	                //legend: { show:true, location: 'e' }
	              });
}

$(document).ready(function(){

	 //fetch poollist from pbs database
	  $.get("/event/getpoollist/", function(getpoollistresult){
	    $("#poolselectbox").append(getpoollistresult);
	    poolIDtmp = $("#poolselectbox option:selected").val();
	    fetchPoolEvents();
	    });
});

</script>

<div id="plot"
	style="height: 300px; width: 300px;"></div>