summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/statistic/category.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/scripts/statistic/category.phtml')
-rw-r--r--application/views/scripts/statistic/category.phtml56
1 files changed, 39 insertions, 17 deletions
diff --git a/application/views/scripts/statistic/category.phtml b/application/views/scripts/statistic/category.phtml
index 44fb749..55143d0 100644
--- a/application/views/scripts/statistic/category.phtml
+++ b/application/views/scripts/statistic/category.phtml
@@ -1,8 +1,12 @@
<h1>Statistic - Category</h1>
-
+
<link
rel="stylesheet" type="text/css"
href="/media/css/jquery.jqplot.min.css" />
+<link
+ rel="stylesheet" type="text/css"
+ href="/media/css/style.css" />
+
<select id="poolselectbox" name="PoolSelectbox"
onclick="setPoolIDtmp();" onChange="fetchPoolEvents();">
@@ -24,22 +28,22 @@ function setPoolIDtmp() {
function plot() {
poolID = $("#poolselectbox option:selected").val();
$.get("/statistic/categorylist/poolID/" + poolID, function(data) {
- $.get("/statistic/colorlist/poolID/" + poolID, function(color) {
- if(data == '') {
+ if(data.dataBar == '') {
$( "#noEventsDialog" ).dialog('open');
$('#plot').empty();
- } else refreshPlot(data);
+ } else refreshPlot(data.dataBar, data.dataPie, data.color);
}, "json");
- }, "json");
}
-function refreshPlot(data, color) {
- $('#plot').empty();
- $.jqplot('plot', data, {
+//[[[4,"Lecture"],[36,"Maintenance"],[9,"Boot"],[21,"Shutdown"]]]
+
+function refreshPlot(dataBar, dataPie, color) {
+ $('#plotBar').empty();
+ $.jqplot('plotBar', dataBar, {
seriesDefaults: {
//renderer: $.jqplot.PieRenderer,
- renderer: $.jqplot.BarRenderer,
- pointLabels: { show: true, edgeTolerance: -15 },
+ renderer:$.jqplot.BarRenderer,
+ pointLabels: { show: true, location: 'e', edgeTolerance: -15 },
shadowAngle: 135,
rendererOptions: {
//showDataLabels: true,
@@ -50,14 +54,29 @@ function refreshPlot(data, color) {
axes: {
yaxis: {
renderer: $.jqplot.CategoryAxisRenderer
- },
- xaxis: {
- renderer: $.jqplot.CategoryAxisRenderer
}
},
- seriesColors: [ "green", "blue", "red", "yellow" ], //color,
+ seriesColors: color,
highlighter: { show: false }
});
+ $('#plotPie').empty();
+ //var data = [['Commuting', 7], ['Orientation', 9]];
+ $.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
+ }
+ },
+ seriesColors: color
+ //legend: { show:true, location: 'e' }
+ });
}
$(document).ready(function(){
@@ -90,10 +109,13 @@ $(function() {
</script>
-<div id="plot"
- style="height: 400px; width: 700px;"></div>
+<div class="clear"></div>
+<div id="plotBar" class="left"
+ style="height: 250px; width: 350px;"></div>
+<div id="plotPie" class="right"
+ style="height: 250px; width: 350px;"></div>
<!-- no events -->
<div id="noEventsDialog" style="display: none">
<p>There are no events in this pool to plot a statistic</p>
-</div> \ No newline at end of file
+</div>