-
Notifications
You must be signed in to change notification settings - Fork 0
/
donutExample.html
30 lines (29 loc) · 1.02 KB
/
donutExample.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
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="d3.min.js"></script>
</head>
<body>
<script type="text/javascript">
var width = 600,
height = 600,
r = 200,
p = Math.PI * 2,
svgContainer = d3.select('body')
.append('svg')
.attr('width', width)
.attr('height', height),
group = svgContainer.append('g')
.attr('transform', 'translate(300,300)'),
arcFunction = d3.svg.arc()
.outerRadius(r)
.innerRadius(r-60)
.startAngle(0)
.endAngle(p),
arc = group
.append('path')
.attr('d', arcFunction)
.attr('fill', 'orange');
</script>
</body>
</html>