Skip to content

Commit 9f1b390

Browse files
committed
Remove broken code
1 parent 559bab7 commit 9f1b390

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

html/tabs.php

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,6 @@
133133
$lastplayers[$count] = $playerlinedecode->players;
134134
$count = $count + 1;
135135
$uptime = $playerlinedecode->uptime;
136-
if (isset($lastplayers[6])) {
137-
if ($lastplayers[6] < 5) {
138-
$maxchart = $lastplayers[6]+1;
139-
}
140-
if ($lastplayers[6] > 5) {
141-
$maxchart = $lastplayers[6]+5;
142-
}
143-
if ($lastplayers[6] > 10) {
144-
$maxchart = $lastplayers[6]+15;
145-
}
146-
if ($lastplayers[6] > 15) {
147-
$maxchart = $lastplayers[6]+30;
148-
}
149-
} else {
150-
$maxchart = 0;
151-
}
152136
}
153137
$uptimebanner = str_replace(".", ",", round($uptime, 1))."%";
154138
?>
@@ -163,7 +147,7 @@
163147
<div class="canvasparent">
164148
<canvas id="Chart<?php echo $ServerID ?>" class="vchart" width="190" height="120"></canvas>
165149
</div>
166-
<script>Chart.defaults.color = 'white';let xLabels<?php echo $ServerID ?> = ['60','50','40','30','20','10','now'];let xValues<?php echo $ServerID ?> = <?php echo "[$lastplayers[0], $lastplayers[1], $lastplayers[2], $lastplayers[3], $lastplayers[4], $lastplayers[5], $lastplayers[6]];"; ?>new Chart("Chart<?php echo $ServerID ?>", {type: "line", data: {labels: xLabels<?php echo $ServerID ?>, datasets: [{label: "Players", data: xValues<?php echo $ServerID ?>, backgroundColor: "white", borderColor: "red", color: "white", borderWidth: 2, pointBorderWidth: 1.5, pointRadius: 2, fill: false, tension: 0.4, pointBorderColor: "white",}]}, options: {scales: {x: {grid: {display:false}, ticks: {display: true}}, y: {<?php if ($lastplayers[0] < 200) {echo "beginAtZero: true, ";} if ($lastplayers[0] < 200) {echo "max: $maxchart, ";}?>grid:{display:true, color: 'rgb(70,70,70)',},}}, responsive: true, maintainAspectRatio: false, plugins: {legend: {display: false,}}}});</script>
150+
<script>Chart.defaults.color = 'white';let xLabels<?php echo $ServerID ?> = ['60','50','40','30','20','10','now'];let xValues<?php echo $ServerID ?> = <?php echo "[$lastplayers[0], $lastplayers[1], $lastplayers[2], $lastplayers[3], $lastplayers[4], $lastplayers[5], $lastplayers[6]];"; ?>new Chart("Chart<?php echo $ServerID ?>", {type: "line", data: {labels: xLabels<?php echo $ServerID ?>, datasets: [{label: "Players", data: xValues<?php echo $ServerID ?>, backgroundColor: "white", borderColor: "red", color: "white", borderWidth: 2, pointBorderWidth: 1.5, pointRadius: 2, fill: false, tension: 0.4, pointBorderColor: "white",}]}, options: {scales: {x: {grid: {display:false}, ticks: {display: true}}, y: {<?php if ($lastplayers[0] < 200) {echo "beginAtZero: true, ";}?>grid:{display:true, color: 'rgb(70,70,70)',},}}, responsive: true, maintainAspectRatio: false, plugins: {legend: {display: false,}}}});</script>
167151
</div>
168152
</div>
169153
</div>

0 commit comments

Comments
 (0)