summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Wagner2011-11-16 16:28:47 +0100
committerSebastian Wagner2011-11-16 16:28:47 +0100
commit26a1aab152ee0bc1c68553199543550b270af86a (patch)
tree2d9f6eb84d8447c1b9c6d7d24906e11baac354e9
parentsome js outsourced (diff)
downloadpoolctrl-26a1aab152ee0bc1c68553199543550b270af86a.tar.gz
poolctrl-26a1aab152ee0bc1c68553199543550b270af86a.tar.xz
poolctrl-26a1aab152ee0bc1c68553199543550b270af86a.zip
new js files
-rw-r--r--public/media/js/categoryPlot.js88
-rw-r--r--public/media/js/runningPlot.js86
-rw-r--r--public/media/js/successPlot.js86
-rw-r--r--public/media/js/typePlot.js86
4 files changed, 346 insertions, 0 deletions
diff --git a/public/media/js/categoryPlot.js b/public/media/js/categoryPlot.js
new file mode 100644
index 0000000..e633b9e
--- /dev/null
+++ b/public/media/js/categoryPlot.js
@@ -0,0 +1,88 @@
+//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");
+ }
+ });
+ }); \ No newline at end of file
diff --git a/public/media/js/runningPlot.js b/public/media/js/runningPlot.js
new file mode 100644
index 0000000..ff8a8f5
--- /dev/null
+++ b/public/media/js/runningPlot.js
@@ -0,0 +1,86 @@
+//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/runningplot/poolID/" + poolID, function(data) {
+ if(data.dataBar == '0,Event over,0,Event not over' && poolID != 'default') {
+ $('#plotBar').empty();
+ $('#plotPie').empty();
+ $( "#noEventsDialog" ).dialog('open');
+ } else if (poolID == 'default') {
+ $('#plotBar').empty();
+ $('#plotPie').empty();
+ } else refreshPlot(data.dataBar, data.dataPie);
+ }, "json");
+}
+
+function refreshPlot(dataBar, dataPie) {
+ $('#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
+ }
+ }
+ });
+ $('#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,
+ lineLabels: true,
+ varyBarColor : true
+ }
+ }
+ });
+ }
+
+$(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");
+ }
+ });
+ }); \ No newline at end of file
diff --git a/public/media/js/successPlot.js b/public/media/js/successPlot.js
new file mode 100644
index 0000000..f2c0d7e
--- /dev/null
+++ b/public/media/js/successPlot.js
@@ -0,0 +1,86 @@
+//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/successplot/poolID/" + poolID, function(data) {
+ if(data.dataBar == '0,Successful,0,Failed' && poolID != 'default') {
+ $( "#noEventsDialog" ).dialog('open');
+ $('#plotBar').empty();
+ $('#plotPieS').empty();
+ } else if (poolID == 'default') {
+ $('#plotBar').empty();
+ $('#plotPieS').empty();
+ } else refreshPlot(data.dataBar, data.dataPieS, data.dataPieT);
+ }, "json");
+}
+
+function refreshPlot(dataBar, dataPieS, dataPieT) {
+ $('#plotBar').empty();
+ $.jqplot('plotBar', dataBar, {
+ seriesDefaults: {
+ //renderer: $.jqplot.PieRenderer,
+ renderer:$.jqplot.BarRenderer,
+ pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
+ shadowAngle: 135,
+ rendererOptions: {
+ barDirection: 'horizontal',
+ varyBarColor : true
+ }
+ },
+ axes: {
+ yaxis: {
+ renderer: $.jqplot.CategoryAxisRenderer
+ }
+ }
+ });
+ $('#plotPieS').empty();
+ $.jqplot('plotPieS', dataPieS,
+ {
+ 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
+ }
+ }
+ });
+ }
+
+$(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");
+ }
+ });
+ }); \ No newline at end of file
diff --git a/public/media/js/typePlot.js b/public/media/js/typePlot.js
new file mode 100644
index 0000000..09f12ad
--- /dev/null
+++ b/public/media/js/typePlot.js
@@ -0,0 +1,86 @@
+//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/typeplot/poolID/" + poolID, function(data) {
+ if(data.dataBar == '0,other,0,repeat,0,immediate' && poolID != 'default') {
+ $('#plotBar').empty();
+ $('#plotPie').empty();
+ $( "#noEventsDialog" ).dialog('open');
+ } else if (poolID == 'default') {
+ $('#plotBar').empty();
+ $('#plotPie').empty();
+ } else refreshPlot(data.dataBar, data.dataPie);
+ }, "json");
+}
+
+function refreshPlot(dataBar, dataPie) {
+ $('#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
+ }
+ }
+ });
+ $('#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,
+ lineLabels: true,
+ varyBarColor : true
+ }
+ }
+ });
+ }
+
+$(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");
+ }
+ });
+ }); \ No newline at end of file