forked from jondavidjohn/bubblechart
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
50 lines (46 loc) · 1019 Bytes
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>BubbleChart</title>
<style>
#bubblechart {
background-color: whiteSmoke;
}
</style>
</head>
<body>
<canvas id="bubblechart" height="700" width="800"></canvas>
<script src="dist/bubblechart.js"></script>
<script>
(function() {
var chart,
bubbles = 5;
chart = new BubbleChart({
canvasId: "bubblechart",
metric: "things",
textColor: "#FFF",
fillColors: ["#02151A", "#B31D14", "#043A47", "#087891"]
});
chart.spinner.start()
setTimeout(function() {
chart.data = getData();
chart.reload();
chart.spinner.stop();
chart.paint();
}, 2000);
function getData() {
var data = [];
for (var i = 0; i < bubbles; i++) {
data.push({
label: Math.random().toString(36).substring(7),
data: Math.floor(Math.random() * 100),
img_src: 'http://www.opencongress.org/images/photos/thumbs_125/400184.jpeg'
});
}
return data;
}
})();
</script>
</body>
</html>