Skip to content

Commit 3e657c8

Browse files
committed
Add null at the starttime so the graph doesn't auto scale
1 parent 867485f commit 3e657c8

File tree

2 files changed

+23
-20
lines changed

2 files changed

+23
-20
lines changed

web/data.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ function getWho($reason)
8686
$startTS = $row['whentimes'] - $period;
8787
}
8888

89+
$dataPoints1[] = array('x' => doubleval($startTS), 'y' => null);
90+
$dataPoints2[] = array('x' => doubleval($startTS), 'y' => null);
91+
$dataPoints3[] = array('x' => doubleval($startTS), 'y' => null);
92+
$dataPoints4[] = array('x' => doubleval($startTS), 'y' => null);
93+
$dataPoints5[] = array('x' => doubleval($startTS), 'y' => null);
94+
8995
$query = "";
9096

9197
if($period == 86400000)

web/graphs.php

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@ function changeState($podUID, $changes)
468468
labelFontColor: "<?=$tempColour?>",
469469
tickColor: "<?=$tempColour?>",
470470
}
471-
]
471+
],
472472
});
473473

474474
var chart2 = new CanvasJS.Chart("rssiContainer",
@@ -517,15 +517,13 @@ function changeState($podUID, $changes)
517517
itemclick: toggleDataSeries
518518
},
519519
data:
520-
[
521-
{
522-
type: "line",
523-
name: "Signal Strength [dBm]",
524-
xValueType: "dateTime",
525-
markerSize: 0,
526-
showInLegend: true,
527-
}
528-
]
520+
[{
521+
type: "line",
522+
name: "Signal Strength [dBm]",
523+
xValueType: "dateTime",
524+
markerSize: 0,
525+
showInLegend: true,
526+
}]
529527
});
530528

531529
var chart3 = new CanvasJS.Chart("costContainer",
@@ -579,16 +577,14 @@ function changeState($podUID, $changes)
579577
itemclick: toggleDataSeries
580578
},
581579
data:
582-
[
583-
{
584-
type: "column",
585-
color: "<?=$costColour?>",
586-
name: "Cost [$]",
587-
xValueType: "dateTime",
588-
markerSize: 0,
589-
showInLegend: true,
590-
}
591-
]
580+
[{
581+
type: "column",
582+
color: "<?=$costColour?>",
583+
name: "Cost [$]",
584+
xValueType: "dateTime",
585+
markerSize: 0,
586+
showInLegend: true,
587+
}],
592588
});
593589

594590
function toggleDataSeries(e)
@@ -674,6 +670,7 @@ function toggleDataSeries(e)
674670
if(period == 86400000)
675671
{
676672
chart1.options.axisX.intervalType = 'hour';
673+
// chart1.options.scales.x.time.unit = 'week';
677674
chart2.options.axisX.intervalType = 'hour';
678675
chart3.options.axisX.intervalType = 'hour';
679676
}

0 commit comments

Comments
 (0)