mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
add chart to short increase of disk space over time
This commit is contained in:
parent
2d721e542e
commit
7f94f38ed2
|
@ -90,6 +90,48 @@ if(in_array($type, array('docspermonth'))) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
|
} elseif(in_array($type, array('sizepermonth'))) {
|
||||||
|
?>
|
||||||
|
var data = [
|
||||||
|
<?php
|
||||||
|
if($data) {
|
||||||
|
foreach($data as $i=>$rec) {
|
||||||
|
$key = mktime(12, 0, 0, substr($rec['key'], 5, 2), 1, substr($rec['key'], 0, 4)) * 1000;
|
||||||
|
echo '["'.$rec['key'].'",'.$rec['total'].'],'."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
];
|
||||||
|
$.plot("#chart", [data], {
|
||||||
|
xaxis: {
|
||||||
|
mode: "categories",
|
||||||
|
tickLength: 0,
|
||||||
|
},
|
||||||
|
series: {
|
||||||
|
bars: {
|
||||||
|
show: true,
|
||||||
|
align: "center",
|
||||||
|
barWidth: 0.8,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
grid: {
|
||||||
|
hoverable: true,
|
||||||
|
clickable: true
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#chart").bind("plothover", function (event, pos, item) {
|
||||||
|
if(item) {
|
||||||
|
var x = item.datapoint[0];//.toFixed(2),
|
||||||
|
y = item.datapoint[1];//.toFixed(2);
|
||||||
|
$("#tooltip").html(item.series.xaxis.ticks[x].label + ": " + formatFileSize(y, false, 2))
|
||||||
|
.css({top: pos.pageY-35, left: pos.pageX+5})
|
||||||
|
.fadeIn(200);
|
||||||
|
} else {
|
||||||
|
$("#tooltip").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
<?php
|
||||||
} elseif(in_array($type, array('docsaccumulated'))) {
|
} elseif(in_array($type, array('docsaccumulated'))) {
|
||||||
?>
|
?>
|
||||||
var data = [
|
var data = [
|
||||||
|
@ -208,7 +250,7 @@ $(document).ready( function() {
|
||||||
$this->columnStart(3);
|
$this->columnStart(3);
|
||||||
$this->contentHeading(getMLText("chart_selection"));
|
$this->contentHeading(getMLText("chart_selection"));
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
foreach(array('docsperuser', 'foldersperuser', 'sizeperuser', 'docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) {
|
foreach(array('docsperuser', 'foldersperuser', 'sizeperuser', 'sizepermonth','docspermimetype', 'docspercategory', 'docsperstatus', 'docspermonth', 'docsaccumulated') as $atype) {
|
||||||
echo "<div><a href=\"?type=".$atype."\">".getMLText('chart_'.$atype.'_title')."</a></div>\n";
|
echo "<div><a href=\"?type=".$atype."\">".getMLText('chart_'.$atype.'_title')."</a></div>\n";
|
||||||
}
|
}
|
||||||
$this->contentContainerEnd();
|
$this->contentContainerEnd();
|
||||||
|
@ -265,6 +307,7 @@ $(document).ready( function() {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'sizeperuser':
|
case 'sizeperuser':
|
||||||
|
case 'sizepermonth':
|
||||||
foreach($data as $item) {
|
foreach($data as $item) {
|
||||||
echo "<tr><td>".htmlspecialchars($item['key'])."</td><td>".SeedDMS_Core_File::format_filesize((int) $item['total'])."</td></tr>";
|
echo "<tr><td>".htmlspecialchars($item['key'])."</td><td>".SeedDMS_Core_File::format_filesize((int) $item['total'])."</td></tr>";
|
||||||
$total += $item['total'];
|
$total += $item['total'];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user