annotate graph.html @ 0:3f139db894f1

initial commit
author sean
date Thu, 02 Apr 2015 09:51:19 +0200
parents
children 2df45f6ecd81
rev   line source
0
3f139db894f1 initial commit
sean
parents:
diff changeset
1 <!DOCTYPE html>
3f139db894f1 initial commit
sean
parents:
diff changeset
2 <html>
3f139db894f1 initial commit
sean
parents:
diff changeset
3 <head>
3f139db894f1 initial commit
sean
parents:
diff changeset
4 <title> Issues </title>
3f139db894f1 initial commit
sean
parents:
diff changeset
5 <style type = text/css>
3f139db894f1 initial commit
sean
parents:
diff changeset
6 .svg div{
3f139db894f1 initial commit
sean
parents:
diff changeset
7 font: 10px sans-serif;
3f139db894f1 initial commit
sean
parents:
diff changeset
8 text-align: right;
3f139db894f1 initial commit
sean
parents:
diff changeset
9 float: left;
3f139db894f1 initial commit
sean
parents:
diff changeset
10 display: block;
3f139db894f1 initial commit
sean
parents:
diff changeset
11 padding: 10px;
3f139db894f1 initial commit
sean
parents:
diff changeset
12 margin: 10px;
3f139db894f1 initial commit
sean
parents:
diff changeset
13 color: white;
3f139db894f1 initial commit
sean
parents:
diff changeset
14 }
3f139db894f1 initial commit
sean
parents:
diff changeset
15
3f139db894f1 initial commit
sean
parents:
diff changeset
16 .axis path,
3f139db894f1 initial commit
sean
parents:
diff changeset
17
3f139db894f1 initial commit
sean
parents:
diff changeset
18 .axis line {
3f139db894f1 initial commit
sean
parents:
diff changeset
19 fill: none;
3f139db894f1 initial commit
sean
parents:
diff changeset
20 stroke: black;
3f139db894f1 initial commit
sean
parents:
diff changeset
21 stroke-width: 1px;
3f139db894f1 initial commit
sean
parents:
diff changeset
22 }
3f139db894f1 initial commit
sean
parents:
diff changeset
23
3f139db894f1 initial commit
sean
parents:
diff changeset
24 .line {
3f139db894f1 initial commit
sean
parents:
diff changeset
25 fill: none;
3f139db894f1 initial commit
sean
parents:
diff changeset
26 stroke-width: 2px;
3f139db894f1 initial commit
sean
parents:
diff changeset
27 }
3f139db894f1 initial commit
sean
parents:
diff changeset
28
3f139db894f1 initial commit
sean
parents:
diff changeset
29 .line.critical {
3f139db894f1 initial commit
sean
parents:
diff changeset
30 stroke: red;
3f139db894f1 initial commit
sean
parents:
diff changeset
31 }
3f139db894f1 initial commit
sean
parents:
diff changeset
32
3f139db894f1 initial commit
sean
parents:
diff changeset
33 .line.critical.legend {
3f139db894f1 initial commit
sean
parents:
diff changeset
34 fill: red;
3f139db894f1 initial commit
sean
parents:
diff changeset
35 }
3f139db894f1 initial commit
sean
parents:
diff changeset
36
3f139db894f1 initial commit
sean
parents:
diff changeset
37 .line.urgent {
3f139db894f1 initial commit
sean
parents:
diff changeset
38 stroke: orange;
3f139db894f1 initial commit
sean
parents:
diff changeset
39 }
3f139db894f1 initial commit
sean
parents:
diff changeset
40
3f139db894f1 initial commit
sean
parents:
diff changeset
41 .line.urgent.legend {
3f139db894f1 initial commit
sean
parents:
diff changeset
42 fill: orange;
3f139db894f1 initial commit
sean
parents:
diff changeset
43 }
3f139db894f1 initial commit
sean
parents:
diff changeset
44
3f139db894f1 initial commit
sean
parents:
diff changeset
45 .line.bug {
3f139db894f1 initial commit
sean
parents:
diff changeset
46 stroke: violet;
3f139db894f1 initial commit
sean
parents:
diff changeset
47 }
3f139db894f1 initial commit
sean
parents:
diff changeset
48
3f139db894f1 initial commit
sean
parents:
diff changeset
49 .line.bug.legend {
3f139db894f1 initial commit
sean
parents:
diff changeset
50 fill: violet;
3f139db894f1 initial commit
sean
parents:
diff changeset
51 }
3f139db894f1 initial commit
sean
parents:
diff changeset
52
3f139db894f1 initial commit
sean
parents:
diff changeset
53 .line.feature {
3f139db894f1 initial commit
sean
parents:
diff changeset
54 stroke: green;
3f139db894f1 initial commit
sean
parents:
diff changeset
55 }
3f139db894f1 initial commit
sean
parents:
diff changeset
56
3f139db894f1 initial commit
sean
parents:
diff changeset
57 .line.feature.legend {
3f139db894f1 initial commit
sean
parents:
diff changeset
58 fill: green;
3f139db894f1 initial commit
sean
parents:
diff changeset
59 }
3f139db894f1 initial commit
sean
parents:
diff changeset
60
3f139db894f1 initial commit
sean
parents:
diff changeset
61 .line.wish {
3f139db894f1 initial commit
sean
parents:
diff changeset
62 stroke: blue;
3f139db894f1 initial commit
sean
parents:
diff changeset
63 }
3f139db894f1 initial commit
sean
parents:
diff changeset
64
3f139db894f1 initial commit
sean
parents:
diff changeset
65 .line.wish.legend {
3f139db894f1 initial commit
sean
parents:
diff changeset
66 fill: blue;
3f139db894f1 initial commit
sean
parents:
diff changeset
67 }
3f139db894f1 initial commit
sean
parents:
diff changeset
68
3f139db894f1 initial commit
sean
parents:
diff changeset
69 .grid .tick {
3f139db894f1 initial commit
sean
parents:
diff changeset
70 stroke: lightgrey;
3f139db894f1 initial commit
sean
parents:
diff changeset
71 opacity: 0.7;
3f139db894f1 initial commit
sean
parents:
diff changeset
72 }
3f139db894f1 initial commit
sean
parents:
diff changeset
73
3f139db894f1 initial commit
sean
parents:
diff changeset
74 .grid path {
3f139db894f1 initial commit
sean
parents:
diff changeset
75 stroke-width: 0;
3f139db894f1 initial commit
sean
parents:
diff changeset
76 }
3f139db894f1 initial commit
sean
parents:
diff changeset
77
3f139db894f1 initial commit
sean
parents:
diff changeset
78 .title {
3f139db894f1 initial commit
sean
parents:
diff changeset
79 font: 15px sans-serif;
3f139db894f1 initial commit
sean
parents:
diff changeset
80 }
3f139db894f1 initial commit
sean
parents:
diff changeset
81
3f139db894f1 initial commit
sean
parents:
diff changeset
82 .legend{
3f139db894f1 initial commit
sean
parents:
diff changeset
83 font: 15px sans-serif;
3f139db894f1 initial commit
sean
parents:
diff changeset
84 }
3f139db894f1 initial commit
sean
parents:
diff changeset
85
3f139db894f1 initial commit
sean
parents:
diff changeset
86 </style>
3f139db894f1 initial commit
sean
parents:
diff changeset
87 </head>
3f139db894f1 initial commit
sean
parents:
diff changeset
88 <body>
3f139db894f1 initial commit
sean
parents:
diff changeset
89 <div id="burndown_chart"></div>
3f139db894f1 initial commit
sean
parents:
diff changeset
90 <script type="text/javascript" src="d3.v3.min.js"></script>
3f139db894f1 initial commit
sean
parents:
diff changeset
91 <script type="text/javascript">
3f139db894f1 initial commit
sean
parents:
diff changeset
92
3f139db894f1 initial commit
sean
parents:
diff changeset
93
3f139db894f1 initial commit
sean
parents:
diff changeset
94 var critical=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
95 var urgent=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
96 var bug=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
97 var feature=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
98 var wish=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
99 var timestamp=[];
3f139db894f1 initial commit
sean
parents:
diff changeset
100
3f139db894f1 initial commit
sean
parents:
diff changeset
101 function assignIssueToDate(issueArray, dateArray){
3f139db894f1 initial commit
sean
parents:
diff changeset
102 a = [];
3f139db894f1 initial commit
sean
parents:
diff changeset
103 for (var i = 0; i < issueArray.length; i++) {
3f139db894f1 initial commit
sean
parents:
diff changeset
104 a.push({points: issueArray[i].points, date : dateArray[i].date});
3f139db894f1 initial commit
sean
parents:
diff changeset
105 }
3f139db894f1 initial commit
sean
parents:
diff changeset
106
3f139db894f1 initial commit
sean
parents:
diff changeset
107 return a;
3f139db894f1 initial commit
sean
parents:
diff changeset
108 }
3f139db894f1 initial commit
sean
parents:
diff changeset
109
3f139db894f1 initial commit
sean
parents:
diff changeset
110
3f139db894f1 initial commit
sean
parents:
diff changeset
111 function maxInObject( array ){
3f139db894f1 initial commit
sean
parents:
diff changeset
112 var maxVal = 0;
3f139db894f1 initial commit
sean
parents:
diff changeset
113 for (var i = 0; i < array.length; i++) {
3f139db894f1 initial commit
sean
parents:
diff changeset
114 if (maxVal < array[i].points){
3f139db894f1 initial commit
sean
parents:
diff changeset
115 maxVal = array[i].points;
3f139db894f1 initial commit
sean
parents:
diff changeset
116 }
3f139db894f1 initial commit
sean
parents:
diff changeset
117 }
3f139db894f1 initial commit
sean
parents:
diff changeset
118 return maxVal;
3f139db894f1 initial commit
sean
parents:
diff changeset
119 }
3f139db894f1 initial commit
sean
parents:
diff changeset
120
3f139db894f1 initial commit
sean
parents:
diff changeset
121
3f139db894f1 initial commit
sean
parents:
diff changeset
122 function getMaxIssues(){
3f139db894f1 initial commit
sean
parents:
diff changeset
123 maxIssuesOfAllArrays = [];
3f139db894f1 initial commit
sean
parents:
diff changeset
124 maxIssuesOfAllArrays.push(maxInObject(critical));
3f139db894f1 initial commit
sean
parents:
diff changeset
125 maxIssuesOfAllArrays.push(maxInObject(urgent));
3f139db894f1 initial commit
sean
parents:
diff changeset
126 maxIssuesOfAllArrays.push(maxInObject(bug));
3f139db894f1 initial commit
sean
parents:
diff changeset
127 maxIssuesOfAllArrays.push(maxInObject(feature));
3f139db894f1 initial commit
sean
parents:
diff changeset
128 maxIssuesOfAllArrays.push(maxInObject(wish));
3f139db894f1 initial commit
sean
parents:
diff changeset
129
3f139db894f1 initial commit
sean
parents:
diff changeset
130 return Math.max.apply(Math, maxIssuesOfAllArrays)+1;
3f139db894f1 initial commit
sean
parents:
diff changeset
131 }
3f139db894f1 initial commit
sean
parents:
diff changeset
132
3f139db894f1 initial commit
sean
parents:
diff changeset
133
3f139db894f1 initial commit
sean
parents:
diff changeset
134 function dayDifference(first, second) {
3f139db894f1 initial commit
sean
parents:
diff changeset
135 "use strict";
3f139db894f1 initial commit
sean
parents:
diff changeset
136 var difference = (second - first) / (1000 * 60 * 60 * 24);
3f139db894f1 initial commit
sean
parents:
diff changeset
137
3f139db894f1 initial commit
sean
parents:
diff changeset
138 // just to avoid the get thousands of lines... would look ugly.
3f139db894f1 initial commit
sean
parents:
diff changeset
139 if (difference > 60){
3f139db894f1 initial commit
sean
parents:
diff changeset
140 difference = 60;
3f139db894f1 initial commit
sean
parents:
diff changeset
141 }
3f139db894f1 initial commit
sean
parents:
diff changeset
142
3f139db894f1 initial commit
sean
parents:
diff changeset
143 return difference;
3f139db894f1 initial commit
sean
parents:
diff changeset
144 }
3f139db894f1 initial commit
sean
parents:
diff changeset
145
3f139db894f1 initial commit
sean
parents:
diff changeset
146
3f139db894f1 initial commit
sean
parents:
diff changeset
147 // function for the grid lines
3f139db894f1 initial commit
sean
parents:
diff changeset
148 function makeGrid(direction, orientation, ticknumber) {
3f139db894f1 initial commit
sean
parents:
diff changeset
149 return d3.svg.axis()
3f139db894f1 initial commit
sean
parents:
diff changeset
150 .scale(direction)
3f139db894f1 initial commit
sean
parents:
diff changeset
151 .orient(orientation)
3f139db894f1 initial commit
sean
parents:
diff changeset
152 .ticks( ticknumber );
3f139db894f1 initial commit
sean
parents:
diff changeset
153 }
3f139db894f1 initial commit
sean
parents:
diff changeset
154
3f139db894f1 initial commit
sean
parents:
diff changeset
155
3f139db894f1 initial commit
sean
parents:
diff changeset
156 //append a svg_path. pretty generic
3f139db894f1 initial commit
sean
parents:
diff changeset
157 function draw_line(svg, data_array, css_class, line_object){
3f139db894f1 initial commit
sean
parents:
diff changeset
158 svg.append("path")
3f139db894f1 initial commit
sean
parents:
diff changeset
159 .datum(assignIssueToDate(data_array, timestamp))
3f139db894f1 initial commit
sean
parents:
diff changeset
160 .attr("class", css_class)
3f139db894f1 initial commit
sean
parents:
diff changeset
161 .attr("d", line_object);
3f139db894f1 initial commit
sean
parents:
diff changeset
162 }
3f139db894f1 initial commit
sean
parents:
diff changeset
163
3f139db894f1 initial commit
sean
parents:
diff changeset
164
3f139db894f1 initial commit
sean
parents:
diff changeset
165 //helper for the legend
3f139db894f1 initial commit
sean
parents:
diff changeset
166 function draw_legend_line(svg, width, Ypos, text){
3f139db894f1 initial commit
sean
parents:
diff changeset
167 svg.append("svg:text")
3f139db894f1 initial commit
sean
parents:
diff changeset
168 .attr("class", "legend")
3f139db894f1 initial commit
sean
parents:
diff changeset
169 .attr("x", width+50)
3f139db894f1 initial commit
sean
parents:
diff changeset
170 .attr("y", Ypos)
3f139db894f1 initial commit
sean
parents:
diff changeset
171 .text(text);
3f139db894f1 initial commit
sean
parents:
diff changeset
172
3f139db894f1 initial commit
sean
parents:
diff changeset
173 svg.append("rect")
3f139db894f1 initial commit
sean
parents:
diff changeset
174 .attr("class", "line " + text.toLowerCase() + " legend")
3f139db894f1 initial commit
sean
parents:
diff changeset
175 .attr("x", width+30)
3f139db894f1 initial commit
sean
parents:
diff changeset
176 .attr("y", Ypos-12)
3f139db894f1 initial commit
sean
parents:
diff changeset
177 .attr("width", 15)
3f139db894f1 initial commit
sean
parents:
diff changeset
178 .attr("height", 15);
3f139db894f1 initial commit
sean
parents:
diff changeset
179 }
3f139db894f1 initial commit
sean
parents:
diff changeset
180
3f139db894f1 initial commit
sean
parents:
diff changeset
181
3f139db894f1 initial commit
sean
parents:
diff changeset
182 //draw the chart
3f139db894f1 initial commit
sean
parents:
diff changeset
183 function makeChart(){
3f139db894f1 initial commit
sean
parents:
diff changeset
184
3f139db894f1 initial commit
sean
parents:
diff changeset
185 //declaration
3f139db894f1 initial commit
sean
parents:
diff changeset
186 var sizeOfSystemBorders = 50;
3f139db894f1 initial commit
sean
parents:
diff changeset
187 var margin = {top: 20, right: 200, bottom: 200, left: 65},
3f139db894f1 initial commit
sean
parents:
diff changeset
188 width = (document.documentElement.clientWidth-sizeOfSystemBorders) - margin.left - margin.right,
3f139db894f1 initial commit
sean
parents:
diff changeset
189 height = (document.documentElement.clientHeight-sizeOfSystemBorders) - (margin.top) - margin.bottom;
3f139db894f1 initial commit
sean
parents:
diff changeset
190
3f139db894f1 initial commit
sean
parents:
diff changeset
191 var x = d3.time.scale()
3f139db894f1 initial commit
sean
parents:
diff changeset
192 .range([0, width]);
3f139db894f1 initial commit
sean
parents:
diff changeset
193
3f139db894f1 initial commit
sean
parents:
diff changeset
194 var y = d3.scale.linear()
3f139db894f1 initial commit
sean
parents:
diff changeset
195 .range([height, 0]);
3f139db894f1 initial commit
sean
parents:
diff changeset
196
3f139db894f1 initial commit
sean
parents:
diff changeset
197 var base_line = d3.svg.line()
3f139db894f1 initial commit
sean
parents:
diff changeset
198 .x(function(d) { return x(d.date); })
3f139db894f1 initial commit
sean
parents:
diff changeset
199 .y(function(d) { return y(d.points); });
3f139db894f1 initial commit
sean
parents:
diff changeset
200
3f139db894f1 initial commit
sean
parents:
diff changeset
201 var color_hash = { 0 : ["apple", "green"],
3f139db894f1 initial commit
sean
parents:
diff changeset
202 1 : ["mango", "orange"],
3f139db894f1 initial commit
sean
parents:
diff changeset
203 2 : ["cherry", "red"]
3f139db894f1 initial commit
sean
parents:
diff changeset
204 };
3f139db894f1 initial commit
sean
parents:
diff changeset
205
3f139db894f1 initial commit
sean
parents:
diff changeset
206 //lines
3f139db894f1 initial commit
sean
parents:
diff changeset
207 var criticalLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
208 var urgentLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
209 var bugLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
210 var featureLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
211 var wishLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
212 var timestampLine = base_line;
3f139db894f1 initial commit
sean
parents:
diff changeset
213
3f139db894f1 initial commit
sean
parents:
diff changeset
214
3f139db894f1 initial commit
sean
parents:
diff changeset
215 //set domain of y axis
3f139db894f1 initial commit
sean
parents:
diff changeset
216
3f139db894f1 initial commit
sean
parents:
diff changeset
217 var yDomain = [ ];
3f139db894f1 initial commit
sean
parents:
diff changeset
218 yDomain[0] = 0;
3f139db894f1 initial commit
sean
parents:
diff changeset
219 yDomain[1] = getMaxIssues();
3f139db894f1 initial commit
sean
parents:
diff changeset
220 y.domain(d3.extent(yDomain, function(d){return d; }));
3f139db894f1 initial commit
sean
parents:
diff changeset
221
3f139db894f1 initial commit
sean
parents:
diff changeset
222 //set domain of y axis
3f139db894f1 initial commit
sean
parents:
diff changeset
223 x.domain(d3.extent(timestamp, function(d){return d.date; }));
3f139db894f1 initial commit
sean
parents:
diff changeset
224
3f139db894f1 initial commit
sean
parents:
diff changeset
225
3f139db894f1 initial commit
sean
parents:
diff changeset
226 var xAxis = d3.svg.axis()
3f139db894f1 initial commit
sean
parents:
diff changeset
227 .scale(x)
3f139db894f1 initial commit
sean
parents:
diff changeset
228 .orient("bottom")
3f139db894f1 initial commit
sean
parents:
diff changeset
229 .tickFormat(d3.time.format.iso);
3f139db894f1 initial commit
sean
parents:
diff changeset
230
3f139db894f1 initial commit
sean
parents:
diff changeset
231
3f139db894f1 initial commit
sean
parents:
diff changeset
232 var yAxis = d3.svg.axis()
3f139db894f1 initial commit
sean
parents:
diff changeset
233 .scale(y)
3f139db894f1 initial commit
sean
parents:
diff changeset
234 .orient("left");
3f139db894f1 initial commit
sean
parents:
diff changeset
235
3f139db894f1 initial commit
sean
parents:
diff changeset
236
3f139db894f1 initial commit
sean
parents:
diff changeset
237 var svg = d3.select("body")
3f139db894f1 initial commit
sean
parents:
diff changeset
238 .append("svg")
3f139db894f1 initial commit
sean
parents:
diff changeset
239 .attr("class", "svg")
3f139db894f1 initial commit
sean
parents:
diff changeset
240 .attr("width", width + margin.left + margin.right)
3f139db894f1 initial commit
sean
parents:
diff changeset
241 .attr("height", height + margin.top + margin.bottom)
3f139db894f1 initial commit
sean
parents:
diff changeset
242 .append("g")
3f139db894f1 initial commit
sean
parents:
diff changeset
243 .attr("transform", "translate(" + margin.left + "," + margin.top + ")");
3f139db894f1 initial commit
sean
parents:
diff changeset
244
3f139db894f1 initial commit
sean
parents:
diff changeset
245
3f139db894f1 initial commit
sean
parents:
diff changeset
246 // creation
3f139db894f1 initial commit
sean
parents:
diff changeset
247
3f139db894f1 initial commit
sean
parents:
diff changeset
248
3f139db894f1 initial commit
sean
parents:
diff changeset
249 // Draw the x Grid lines
3f139db894f1 initial commit
sean
parents:
diff changeset
250 svg.append("g")
3f139db894f1 initial commit
sean
parents:
diff changeset
251 .attr("class", "grid")
3f139db894f1 initial commit
sean
parents:
diff changeset
252 .attr("transform", "translate(0," + height + ")")
3f139db894f1 initial commit
sean
parents:
diff changeset
253 .call(makeGrid(x, "bottom", timestamp.length)
3f139db894f1 initial commit
sean
parents:
diff changeset
254 .tickSize(-height, 0, 0)
3f139db894f1 initial commit
sean
parents:
diff changeset
255 .tickFormat("")
3f139db894f1 initial commit
sean
parents:
diff changeset
256 );
3f139db894f1 initial commit
sean
parents:
diff changeset
257
3f139db894f1 initial commit
sean
parents:
diff changeset
258
3f139db894f1 initial commit
sean
parents:
diff changeset
259 // Draw the y Grid lines
3f139db894f1 initial commit
sean
parents:
diff changeset
260 svg.append("g")
3f139db894f1 initial commit
sean
parents:
diff changeset
261 .attr("class", "grid")
3f139db894f1 initial commit
sean
parents:
diff changeset
262 .call(makeGrid(y, "left", getMaxIssues())
3f139db894f1 initial commit
sean
parents:
diff changeset
263 .tickSize(-width, 0, 0)
3f139db894f1 initial commit
sean
parents:
diff changeset
264 .tickFormat("")
3f139db894f1 initial commit
sean
parents:
diff changeset
265 );
3f139db894f1 initial commit
sean
parents:
diff changeset
266
3f139db894f1 initial commit
sean
parents:
diff changeset
267
3f139db894f1 initial commit
sean
parents:
diff changeset
268 // Draw the x-axis
3f139db894f1 initial commit
sean
parents:
diff changeset
269 svg.append("g")
3f139db894f1 initial commit
sean
parents:
diff changeset
270 .attr("class", "x axis")
3f139db894f1 initial commit
sean
parents:
diff changeset
271 .attr("transform", "translate(0," + height + ")")
3f139db894f1 initial commit
sean
parents:
diff changeset
272 .call(xAxis)
3f139db894f1 initial commit
sean
parents:
diff changeset
273 .selectAll("text")
3f139db894f1 initial commit
sean
parents:
diff changeset
274 .style("text-anchor", "end")
3f139db894f1 initial commit
sean
parents:
diff changeset
275 .attr("dx", "-.8em")
3f139db894f1 initial commit
sean
parents:
diff changeset
276 .attr("dy", ".15em")
3f139db894f1 initial commit
sean
parents:
diff changeset
277 .attr("transform", function() {
3f139db894f1 initial commit
sean
parents:
diff changeset
278 return "rotate(-65)";
3f139db894f1 initial commit
sean
parents:
diff changeset
279 });
3f139db894f1 initial commit
sean
parents:
diff changeset
280
3f139db894f1 initial commit
sean
parents:
diff changeset
281
3f139db894f1 initial commit
sean
parents:
diff changeset
282 // Draw the y-axis
3f139db894f1 initial commit
sean
parents:
diff changeset
283 svg.append("g")
3f139db894f1 initial commit
sean
parents:
diff changeset
284 .attr("class", "y axis")
3f139db894f1 initial commit
sean
parents:
diff changeset
285 .call(yAxis)
3f139db894f1 initial commit
sean
parents:
diff changeset
286 .append("text")
3f139db894f1 initial commit
sean
parents:
diff changeset
287 .attr("transform", "rotate(-90)")
3f139db894f1 initial commit
sean
parents:
diff changeset
288 .attr("y", 6)
3f139db894f1 initial commit
sean
parents:
diff changeset
289 .attr("dy", ".71em")
3f139db894f1 initial commit
sean
parents:
diff changeset
290 .style("text-anchor", "end");
3f139db894f1 initial commit
sean
parents:
diff changeset
291
3f139db894f1 initial commit
sean
parents:
diff changeset
292
3f139db894f1 initial commit
sean
parents:
diff changeset
293 // Text for y-axis
3f139db894f1 initial commit
sean
parents:
diff changeset
294 svg.append("text")
3f139db894f1 initial commit
sean
parents:
diff changeset
295 .attr("transform", "rotate(-90)")
3f139db894f1 initial commit
sean
parents:
diff changeset
296 .attr("y", 10 - margin.left)
3f139db894f1 initial commit
sean
parents:
diff changeset
297 .attr("x", 0 - (height / 2))
3f139db894f1 initial commit
sean
parents:
diff changeset
298 .attr("dy", "1em")
3f139db894f1 initial commit
sean
parents:
diff changeset
299 .style("text-anchor", "middle")
3f139db894f1 initial commit
sean
parents:
diff changeset
300 .text("Issues");
3f139db894f1 initial commit
sean
parents:
diff changeset
301
3f139db894f1 initial commit
sean
parents:
diff changeset
302
3f139db894f1 initial commit
sean
parents:
diff changeset
303 //Titel und Legende
3f139db894f1 initial commit
sean
parents:
diff changeset
304
3f139db894f1 initial commit
sean
parents:
diff changeset
305 svg.append("svg:text")
3f139db894f1 initial commit
sean
parents:
diff changeset
306 .attr("class", "title")
3f139db894f1 initial commit
sean
parents:
diff changeset
307 .attr("x", 10)
3f139db894f1 initial commit
sean
parents:
diff changeset
308 .attr("y", -5)
3f139db894f1 initial commit
sean
parents:
diff changeset
309 .text("Issues Nach Zeit");
3f139db894f1 initial commit
sean
parents:
diff changeset
310
3f139db894f1 initial commit
sean
parents:
diff changeset
311
3f139db894f1 initial commit
sean
parents:
diff changeset
312 draw_legend_line(svg, width, 50, "Critical");
3f139db894f1 initial commit
sean
parents:
diff changeset
313 draw_legend_line(svg, width, 70, "Urgent");
3f139db894f1 initial commit
sean
parents:
diff changeset
314 draw_legend_line(svg, width, 90, "Bug");
3f139db894f1 initial commit
sean
parents:
diff changeset
315 draw_legend_line(svg, width, 110, "Feature");
3f139db894f1 initial commit
sean
parents:
diff changeset
316 draw_legend_line(svg, width, 130, "Wish");
3f139db894f1 initial commit
sean
parents:
diff changeset
317
3f139db894f1 initial commit
sean
parents:
diff changeset
318
3f139db894f1 initial commit
sean
parents:
diff changeset
319 draw_line(svg, critical, "line critical", criticalLine);
3f139db894f1 initial commit
sean
parents:
diff changeset
320 draw_line(svg, urgent, "line urgent", urgentLine);
3f139db894f1 initial commit
sean
parents:
diff changeset
321 draw_line(svg, bug, "line bug", bugLine);
3f139db894f1 initial commit
sean
parents:
diff changeset
322 draw_line(svg, feature, "line feature", featureLine);
3f139db894f1 initial commit
sean
parents:
diff changeset
323 draw_line(svg, wish, "line wish", wishLine);
3f139db894f1 initial commit
sean
parents:
diff changeset
324
3f139db894f1 initial commit
sean
parents:
diff changeset
325 }
3f139db894f1 initial commit
sean
parents:
diff changeset
326
3f139db894f1 initial commit
sean
parents:
diff changeset
327 makeChart();
3f139db894f1 initial commit
sean
parents:
diff changeset
328
3f139db894f1 initial commit
sean
parents:
diff changeset
329
3f139db894f1 initial commit
sean
parents:
diff changeset
330 </script>
3f139db894f1 initial commit
sean
parents:
diff changeset
331 </body>
3f139db894f1 initial commit
sean
parents:
diff changeset
332 </html>
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)