summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/statistics/category.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/scripts/statistics/category.phtml')
-rwxr-xr-xapplication/views/scripts/statistics/category.phtml95
1 files changed, 3 insertions, 92 deletions
diff --git a/application/views/scripts/statistics/category.phtml b/application/views/scripts/statistics/category.phtml
index db17b63..2f8ed37 100755
--- a/application/views/scripts/statistics/category.phtml
+++ b/application/views/scripts/statistics/category.phtml
@@ -11,98 +11,9 @@
<option value="all">All Pools</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() {
- poolID = $("#poolselectbox option:selected").val();
- $.get("/statistics/categoryplot/poolID/" + poolID, function(data) {
- if(data.dataBar == '' && poolID != 'default') {
- $( "#noEventsDialog" ).dialog('open');
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else if (poolID == 'default') {
- $('#plotBar').empty();
- $('#plotPie').empty();
- } else refreshPlot(data.dataBar, data.dataPie, data.color);
- }, "json");
-}
-
-function refreshPlot(dataBar, dataPie, color) {
- $('#plotBar').empty();
- $.jqplot('plotBar', dataBar, {
- seriesDefaults: {
- renderer:$.jqplot.BarRenderer,
- pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- shadowAngle: 135,
- rendererOptions: {
- barDirection: 'horizontal',
- varyBarColor : true
- }
- },
- axes: {
- yaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
- }
- },
- seriesColors: color,
- highlighter: { show: false }
- });
- $('#plotPie').empty();
- $.jqplot('plotPie', dataPie,
- {
- 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,
- varyBarColor : true
- }
- },
- seriesColors: color
- });
-}
-
-$(document).ready(function(){
-
- //fetch poollist from pbs database
- $.get("/event/getpoollist/", function(getpoollistresult){
- $("#poolselectbox").append(getpoollistresult);
- poolIDtmp = $("#poolselectbox option:selected").val();
- fetchPoolEvents();
- });
-});
-
-$(function() {
- $( "#noEventsDialog" ).dialog({
- autoOpen: false,
- width: 600,
- modal: true,
- title: "No Events",
- buttons: {
- "OK": function() {
- $(this).dialog("close");
- }
- },
- open: function () {
- $(".ui-dialog-titlebar-close").hide();
- //$(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
- }
- });
- });
-
-</script>
+<!-- Add CategoryPlot -->
+<script
+ type="text/javascript" src="/media/js/categoryPlot.js"></script>
<div>
<div id="plotBar" class="spalte"