-
Notifications
You must be signed in to change notification settings - Fork 14
/
polling-results.php
42 lines (41 loc) · 1.27 KB
/
polling-results.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php defined('BASEPATH') OR exit('No direct script access allowed') ?>
<script src="<?= base_url('assets/plugins/Chart.js') ?>"></script>
<script type="text/javascript">
$( document ).ready( function() {
const element_id = document.getElementById('canvas');
new Chart(element_id, {
type: 'bar',
data: {
labels: <?= $labels ?>,
datasets: [{
label: '',
data: <?= $data ?>,
borderWidth: 2,
backgroundColor: 'rgba(75, 192, 192, 0.2)',
borderColor: 'rgba(75, 192, 192, 1)'
}]
},
options: {
responsive: true,
scales: {
yAxes: [{
ticks: {
beginAtZero:true
}
}]
}
}
});
});
</script>
<main class="container space-y-5 my-5 flex-1">
<div class="flex flex-col lg:flex-row items-start gap-x-6 relative space-y-5 lg:space-y-0">
<div class="w-full lg:w-2/3 space-y-4">
<h1 class="font-heading text-2xl capitalize font-black text-title"><span class="fa fa-bar-chart"></span> <?= ucwords($page_title) ?></h1>
<canvas id="canvas"></canvas>
</div>
<div class="w-full lg:w-1/3 space-y-5 ">
<?php $this->load->view(THEME_PATH . 'components/sidebar') ?>
</div>
</div>
</main>