mirror of
https://bitbucket.org/jsuto/piler.git
synced 2025-06-13 06:47:01 +02:00
@ -1,12 +1,42 @@
|
||||
<p>
|
||||
|
||||
<?php if($timespan == "daily"){ ?>
|
||||
<?php if($timespan == "daily"){ $date_format = "H:i"; ?>
|
||||
<strong><?php print $text_daily_report; ?></strong> <a href="index.php?route=stat/stat&timespan=monthly<?php if(isset($uid)) { ?>&uid=<?php print $uid; } ?>"><?php print $text_monthly_report; ?></a>
|
||||
<?php } else { ?>
|
||||
<?php } else { $date_format = "m.d."; ?>
|
||||
<a href="index.php?route=stat/stat&timespan=daily<?php if(isset($uid)) { ?>&uid=<?php print $uid; } ?>"><?php print $text_daily_report; ?></a> <strong><?php print $text_monthly_report; ?></strong>
|
||||
<?php } ?>
|
||||
|
||||
</p>
|
||||
|
||||
<p><img src="index.php?route=stat/graph&timespan=<?php print $timespan; ?>&uid=<?php print $uid; ?>" border="1" /> </p>
|
||||
|
||||
<div>
|
||||
<canvas id="myChart"></canvas>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
|
||||
<script>
|
||||
const labels = [
|
||||
<?php foreach(array_keys($data) as $d) { print "'" . date($date_format, $d) . "',"; } ?>
|
||||
];
|
||||
|
||||
const data = {
|
||||
labels: labels,
|
||||
datasets: [{
|
||||
label: '<?php print $text_archived_messages; ?>',
|
||||
backgroundColor: 'rgb(255, 99, 132)',
|
||||
borderColor: 'rgb(255, 99, 132)',
|
||||
data: [
|
||||
<?php foreach(array_values($data) as $d) { print "'" . $d . "',"; } ?>
|
||||
],
|
||||
}]
|
||||
};
|
||||
|
||||
const config = {
|
||||
type: 'line',
|
||||
data: data,
|
||||
options: {}
|
||||
};
|
||||
|
||||
const chart = new Chart(document.getElementById('myChart'), config);
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user