Fixes various traffic graph issues
Signed-off-by: Roman Schmerold (BNoiZe) <bnoize@froxlor.org>
This commit is contained in:
@@ -786,3 +786,8 @@ table thead th.sorting {
|
|||||||
background-position: 10px center;
|
background-position: 10px center;
|
||||||
padding-left: 25px;
|
padding-left: 25px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chartdiv {
|
||||||
|
height: 500px;
|
||||||
|
margin: 30px 60px;
|
||||||
|
}
|
||||||
@@ -12,7 +12,7 @@ $(document).ready(function(){
|
|||||||
var i = 1;
|
var i = 1;
|
||||||
var links = [];
|
var links = [];
|
||||||
$('#datalegend').remove();
|
$('#datalegend').remove();
|
||||||
$('#datatable tr').reverse().each(function() {
|
$('#datatable tr').each(function() {
|
||||||
var row = $(this);
|
var row = $(this);
|
||||||
var day = $(row).children().first().text();
|
var day = $(row).children().first().text();
|
||||||
var ftpd = $(row).children().first().next().text();
|
var ftpd = $(row).children().first().next().text();
|
||||||
@@ -24,7 +24,7 @@ $(document).ready(function(){
|
|||||||
}
|
}
|
||||||
ftp.push([i, parseFloat(ftpd) / 1024]);
|
ftp.push([i, parseFloat(ftpd) / 1024]);
|
||||||
http.push([i, parseFloat(httpd) / 1024]);
|
http.push([i, parseFloat(httpd) / 1024]);
|
||||||
mail.push([i, parseFloat(maild)] / 1024);
|
mail.push([i, parseFloat(maild) / 1024]);
|
||||||
aticks.push([i, day]);
|
aticks.push([i, day]);
|
||||||
if (ftpd > max)
|
if (ftpd > max)
|
||||||
{
|
{
|
||||||
@@ -112,8 +112,8 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
$("#chartdiv").bind("plothover", function (event, pos, item) {
|
$("#chartdiv").bind("plothover", function (event, pos, item) {
|
||||||
if (item) {
|
if (item) {
|
||||||
var x = item.datapoint[0].toFixed(2),
|
var x = item.datapoint[0].toFixed(3),
|
||||||
y = item.datapoint[1].toFixed(2);
|
y = item.datapoint[1].toFixed(3);
|
||||||
|
|
||||||
$("#tooltip").html(item.series.label + ": " + y + " GiB")
|
$("#tooltip").html(item.series.label + ": " + y + " GiB")
|
||||||
.css({top: item.pageY+5, left: item.pageX+5})
|
.css({top: item.pageY+5, left: item.pageX+5})
|
||||||
|
|||||||
5
templates/Sparkle/assets/css/main.css
vendored
5
templates/Sparkle/assets/css/main.css
vendored
@@ -1003,6 +1003,11 @@ label.nobr {
|
|||||||
white-space:nowrap;
|
white-space:nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#chartdiv {
|
||||||
|
height: 500px;
|
||||||
|
margin: 15px 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* CANVAS STUFF */
|
/* CANVAS STUFF */
|
||||||
.canvasitems {
|
.canvasitems {
|
||||||
position:relative;
|
position:relative;
|
||||||
|
|||||||
6
templates/Sparkle/assets/js/traffic.js
vendored
6
templates/Sparkle/assets/js/traffic.js
vendored
@@ -12,7 +12,7 @@ $(document).ready(function(){
|
|||||||
var i = 1;
|
var i = 1;
|
||||||
var links = [];
|
var links = [];
|
||||||
$('#datalegend').remove();
|
$('#datalegend').remove();
|
||||||
$('#datatable tr').reverse().each(function() {
|
$('#datatable tr').each(function() {
|
||||||
var row = $(this);
|
var row = $(this);
|
||||||
var day = $(row).children().first().text();
|
var day = $(row).children().first().text();
|
||||||
var ftpd = $(row).children().first().next().text();
|
var ftpd = $(row).children().first().next().text();
|
||||||
@@ -112,8 +112,8 @@ $(document).ready(function(){
|
|||||||
|
|
||||||
$("#chartdiv").bind("plothover", function (event, pos, item) {
|
$("#chartdiv").bind("plothover", function (event, pos, item) {
|
||||||
if (item) {
|
if (item) {
|
||||||
var x = item.datapoint[0].toFixed(2),
|
var x = item.datapoint[0].toFixed(3),
|
||||||
y = item.datapoint[1].toFixed(2);
|
y = item.datapoint[1].toFixed(3);
|
||||||
|
|
||||||
$("#tooltip").html(item.series.label + ": " + y + " GiB")
|
$("#tooltip").html(item.series.label + ": " + y + " GiB")
|
||||||
.css({top: item.pageY+5, left: item.pageX+5})
|
.css({top: item.pageY+5, left: item.pageX+5})
|
||||||
|
|||||||
@@ -38,6 +38,6 @@ $header
|
|||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<div id="chartdiv" style="height:300px;width:100%"></div>
|
<div id="chartdiv" style="width:100%"></div>
|
||||||
</article>
|
</article>
|
||||||
$footer
|
$footer
|
||||||
|
|||||||
@@ -41,6 +41,6 @@ $header
|
|||||||
</form>
|
</form>
|
||||||
</section>
|
</section>
|
||||||
<br />
|
<br />
|
||||||
<div id="chartdiv" style="height:300px;width:100%"></div>
|
<div id="chartdiv" style="width:100%"></div>
|
||||||
</article>
|
</article>
|
||||||
$footer
|
$footer
|
||||||
|
|||||||
Reference in New Issue
Block a user