summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/statistic/index.phtml
diff options
context:
space:
mode:
authorSebastian Wagner2011-10-05 15:27:41 +0200
committerSebastian Wagner2011-10-05 15:27:41 +0200
commitabd3a30d827d26713e03471b95271d1bca33567e (patch)
tree93f2985c333e5f43ac6a3233b949509d727a7456 /application/views/scripts/statistic/index.phtml
parentkleine Korrektur (diff)
downloadpoolctrl-abd3a30d827d26713e03471b95271d1bca33567e.tar.gz
poolctrl-abd3a30d827d26713e03471b95271d1bca33567e.tar.xz
poolctrl-abd3a30d827d26713e03471b95271d1bca33567e.zip
category statistic implemented
Diffstat (limited to 'application/views/scripts/statistic/index.phtml')
-rw-r--r--application/views/scripts/statistic/index.phtml53
1 files changed, 30 insertions, 23 deletions
diff --git a/application/views/scripts/statistic/index.phtml b/application/views/scripts/statistic/index.phtml
index 8f63416..17bcc15 100644
--- a/application/views/scripts/statistic/index.phtml
+++ b/application/views/scripts/statistic/index.phtml
@@ -29,39 +29,21 @@ function setPoolIDtmp() {
function plot() {
poolID = $("#poolselectbox option:selected").val();
-
$.get("/statistic/categorylist/poolID/" + poolID, function(data) {
-// lecture = data.lecture;
-// boot = data.boot;
-// shutdown = data.shutdown;
-// maintenance = data.maintenance;
- refreshPlot(data);
-// $.ajax({
-// type: 'POST',
-// url: "/statistic/dump",
-// data: {data: [[[boot,'Boot'], [shutdown,'Shutdwon'], [maintenance,'Maintenance'], [lecture,'Lecture']]]},
-// success: function(){alert("done");},
-// dataType: "json"
-// });
-
+ if(data == '') {
+ $( "#noEventsDialog" ).dialog('open');
+ $('#plot').empty();
+ } else refreshPlot(data);
}, "json");
}
function refreshPlot(data) {
$('#plot').empty();
-// $.jqplot('plot', [
-// [[boot,'Boot'], [shutdown,'Shutdwon'], [maintenance,'Maintenance'], [lecture,'Lecture']]], {
$.jqplot('plot', data, {
seriesDefaults: {
renderer:$.jqplot.BarRenderer,
- // Show point labels to the right ('e'ast) of each bar.
- // edgeTolerance of -15 allows labels flow outside the grid
- // up to 15 pixels. If they flow out more than that, they
- // will be hidden.
pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
- // Rotate the bar shadow as if bar is lit from top right.
shadowAngle: 135,
- // Here's where we tell the chart it is oriented horizontally.
rendererOptions: {
barDirection: 'horizontal'
}
@@ -83,6 +65,31 @@ $(document).ready(function(){
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>
-<div id="plot" style="height: 400px; width: 700px;"></div>
+<div id="plot"
+ style="height: 400px; width: 700px;"></div>
+
+<!-- no events -->
+<div id="noEventsDialog" style="display: none">
+<p>There are no events in this pool to plot the statistic</p>
+</div>