-
Notifications
You must be signed in to change notification settings - Fork 1
/
live.html
83 lines (75 loc) · 2.49 KB
/
live.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{% extends "layouts/base.html" %}
{% block title %} Blank {% endblock %}
<!-- Specific Page CSS goes HERE -->
{% block stylesheets %}{% endblock stylesheets %}
{% block content %}
<!-- Content here -->
<section class="section section bg-primary pb-11 pb-lg-12 text-white overflow-hidden z-2">
<div class="container z-2">
<div class="row justify-content-center text-center pt-6 pb-3" role="banner">
<div class="col-12 col-md-8">
<h1 class="display-1 font-weight-light mb-3">Live Graph</h1>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<canvas id="myChart" width="50" height="50"> </canvas>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
</div>
</div>
</div>
</div>
</div>
</section>
{% endblock content %}
<!-- Specific Page JS goes HERE -->
{% block javascripts %}
<script>
var ctx = document.getElementById('myChart');
var myChart = new Chart(ctx, {
type: 'pie',
data: {
labels: ['Happy', 'Calm', 'Optimistic', 'Sad', 'Anxious', 'Stressed', 'Angry'],
datasets: [{
label: 'Emotions',
data: [12, 19, 3, 5, 2, 3, 14],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(0, 210, 217, 0.2)',
'rgba(255, 234, 0, 0.2)',
'rgba(85, 0, 255, 0.2)',
'rgba(255, 83, 64, 0.2)',
'rgba(140, 255, 102, 0.2)'
],
borderColor: [
'rgba(255, 99, 132, 1)',
'rgba(54, 162, 235, 1)',
'rgba(0, 210, 217, 1)',
'rgba(255, 234, 0, 1)',
'rgba(85, 0, 255, 1)',
'rgba(255, 83, 64, 1)',
'rgba(140, 255, 102, 1)'
],
borderWidth: 1
}]
},
options: {
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
});
function addData(chart, data){
};
chart.update();
</script>
{% endblock javascripts %}