-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (56 loc) · 2.11 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html>
<head>
<title>Charts</title>
<meta charset="utf-8" />
<script src="_js/Chart.bundle.min.js"></script>
<script src="_js/default.js"></script>
<script src="_js/charts.lib.js"></script>
<style type="text/css">
.chart-container {
position: relative;
height:700px;
width:700px;
}
</style>
</head>
<body>
<div class="chart-container">
<canvas id="chart"></canvas>
</div>
<script type="text/javascript">
var dados = [
[
['1, seg', '2, ter', '3, qua', '4, qui', '5, sex', '6, sab', '7, dom', '8, seg', '9, ter', '10, qua'],
[12, 19, 3, 5, 2, 3, 4, 5, 4, 3, 4, 5, 6, 7, 8, 9, 1, 0, 5, 8, 4, 9]
],
[
['Prazo', 'Fora'],
[100, 40],
[100, 30],
[100, 20],
[100, 10],
],
];
var ds = 1;
var c = draw_chart("Prazos por Prioridade", 'doughnut', 'chart', dados[ds][0], [
{data: dados[ds][1], label: 'P 1', color: ['dark', 'red']},
{data: dados[ds][2], label: 'P 2', color: ['dark', 'red']},
{data: dados[ds][3], label: 'P 3', color: ['dark', 'red']},
{data: dados[ds][4], label: 'P 4', color: ['dark', 'red']},
]);
setInterval(function(){
var val = parseInt(Math.random() * 30);
c.data.datasets[0].data = [100 - val, val];
val = parseInt(Math.random() * 30);
c.data.datasets[1].data = [100 - val, val];
val = parseInt(Math.random() * 30);
c.data.datasets[2].data = [100 - val, val];
val = parseInt(Math.random() * 30);
c.data.datasets[3].data = [100 - val, val];
c.update();
console.log('updated');
}, 1000);
</script>
</body>
</html>