forked from peterrcook/d3-radialbar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
temperatures.html
90 lines (79 loc) · 1.57 KB
/
temperatures.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Radial Bar Chart example</title>
<style>
#chart {
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 14px;
}
#chart path {
fill: none;
}
/* layers */
#chart .layer-0 path {
fill: steelblue;
}
#chart .layer-1 path {
fill: white !important;
opacity: 0.3;
stroke-width: 2px;
stroke: #999;
}
/* Outer circle, tick-circles and spokes */
#chart circle.outer {
stroke: #aaa;
stroke-dasharray: 4, 4;
}
#chart .tick-circles circle {
stroke: #ddd;
stroke-dasharray: 2, 2;
}
#chart .spokes line {
stroke: #666;
stroke-width: 0.2;
}
/* Axis */
#chart .axis text {
font-size: 11px;
}
#chart .axis path {
stroke: #999;
shape-rendering: crispEdges;
}
#chart .axis line {
stroke: #999;
shape-rendering: crispEdges;
}
/* Labels */
#chart .labels text {
fill: #333;
font-size: 10px;
font-weight: 500;
}
</style>
</head>
<body>
<div id="chart"></div>
<script src="js/d3.v3.min.js"></script>
<script src="js/radialBarChart.js"></script>
<script>
d3.json('data/months.json', function(err, data) {
var chart = radialBarChart()
.barHeight(220)
.reverseLayerOrder(true)
.capitalizeLabels(true)
.barColors(['#B66199', '#9392CB', '#76D9FA'])
// .barColors(['#EEB945', '#E67323']) // Yellow/orange
.domain([0,17])
// .colorLabels(true)
.tickValues([5,10,15])
.tickCircleValues([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
d3.select('#chart')
.datum(data)
.call(chart);
});
</script>
</body>
</html>