-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestChart.html
80 lines (75 loc) · 2.07 KB
/
testChart.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
<!DOCTYPE html>
<html>
<head>
<title>Chi's "Who Wants to be a Millionaire" Game</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<style>
#main {
background-color: lightgreen;
height: 100vh;
}
#LL-message {
height: 100vh
}
</style>
</head>
<body>
<div class='container-fluid'>
<div class='row'>
<div class='col-xs-4'>
<div id='LL-message'></div>
</div>
<div class='col-xs-8' id='main'></div>
</div>
</div>
<script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.6.0/Chart.min.js'></script>
<script>
$('document').ready(()=>{
var canvas = $('<canvas>');
canvas.attr('id', 'pollChart');
$('#LL-message').append(canvas);
var ctx = document.getElementById("pollChart").getContext('2d');
var chartObj = {
type: 'bar',
data: {
//red, blue, yellow, green
labels: ['C','D'],
datasets: [{
label: '# of Votes',
data: [10,20],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
],
borderWidth: 1
}]
},
options: {
maintainAspectRatio: false,
scales: {
yAxes: [{
display: true,
ticks: {
beginAtZero: true,
steps: 10,
stepValue: 10,
max: 100
}
}]
},
}
};
var myChart = new Chart(ctx, chartObj);
})
</script>
</body>
</html>