-
Notifications
You must be signed in to change notification settings - Fork 4
/
output.html
38 lines (27 loc) · 926 Bytes
/
output.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
<!DOCTYPE html>
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.15/c3.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.4.15/c3.min.css">
<style>
table, th, td {
border: 1px solid black;
}
</style>
</head>
<body>
<h1>Donut Chart</h1>
<!--
<input type="button" onclick="chart.transform('bar')" value="Bar" />
<input type="button" onclick="chart.transform('pie')" value="Pie" />
<input type="button" onclick="chart.transform('donut')" value="Donut" />
-->
<div id="chart"></div>
<script>
var chart = c3.generate(
{"bindto":"#chart","data":{"columns":[["Yes",60],["No",40]],"type":"donut"},"axis":{"x":{}},"grid":{"x":{"lines":{}},"y":{"lines":{}}},"donut":{"title":"Votes"},"bar":{"WidthRatio":0,"Width":0}}
);
</script>
</body>
</html>