-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
92 lines (86 loc) · 2.05 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<title>Largest Municipalities in Puerto Rico</title>
</head>
<body>
<div class="container">
<canvas id="myChart"></canvas>
</div>
<script>
let myChart = document.getElementById('myChart').getContext('2d');
// Global Options
Chart.defaults.global.defaultFontFamily = 'Lato';
Chart.defaults.global.defaultFontsize = 18;
Chart.defaults.global.defaultFontColor = '#777';
let PrPopChart = new Chart(myChart, {
type:'pie', // bar, horizontalBar, pie, line, doughnut, radar, polarArea
data:{
labels:['San Juan', 'Bayamón', 'Carolina', 'Ponce', 'Caguas', 'Guaynabo', 'Mayaguez', 'Trujillo Alto', 'Arecibo', 'Fajardo'],
datasets:[{
label:'Population',
data:[
418140,
203499,
170404,
152634,
86804,
81360,
78647,
54189,
49318,
34068
],
// backgroundColor: 'green',
backgroundColor:[
'#e65100',
'#e65100',
'#f57c00',
'#fb8c00',
'#ff9800',
'#ffa726',
'#ffb74d',
'#ffcc80',
'#ffe0b2',
'#fff3e0'
],
borderWidth:1,
borderColor:'white',
hoverBorderWidth: 3,
hoverBorderColor: 'grey'
}]
},
options:{
title:{
display: true,
text: 'Largest Municipalities in Puerto Rico',
fontSize:25
},
legend:{
display:true,
position:'right',
labels:{
fontColor: '#000'
}
},
layout:{
padding:{
left:50,
right:0,
bottom:0,
top:0
}
},
tooltips:{
enabled:true
}
}
});
</script>
</body>
</html>