comparison modules/roundup_cc/graph.html @ 13:63b9f41c3008

made the charts a bit more modular - can now define the div_name and the script name in the .conf data
author sean
date Wed, 05 Aug 2015 12:37:33 +0200
parents 50f4c64834cb
children
comparison
equal deleted inserted replaced
12:50f4c64834cb 13:63b9f41c3008
93 // window.onresize = function(){ 93 // window.onresize = function(){
94 // document.getElementsByClassName("chart")[0].innerHTML = ""; 94 // document.getElementsByClassName("chart")[0].innerHTML = "";
95 // makeChart(); 95 // makeChart();
96 // }; 96 // };
97 97
98 var d3jsInjectionTarget="X";
99
98 var critical=[]; 100 var critical=[];
99 var urgent=[]; 101 var urgent=[];
100 var bug=[]; 102 var bug=[];
101 var feature=[]; 103 var feature=[];
102 var wish=[]; 104 var wish=[];
262 } 264 }
263 265
264 266
265 267
266 //draw the chart 268 //draw the chart
267 function makeChart(){ 269 function makeChart(div_name){
268 270
269 //declaration 271 //declaration
270 var sizeOfSystemBorders = 20; 272 var sizeOfSystemBorders = 20;
271 // var margin = {top: 20, right: 100, bottom: 90, left: 60}; 273 // var margin = {top: 20, right: 100, bottom: 90, left: 60};
272 // var margin = {top: 0, right: 0, bottom: 0, left: 0} 274 // var margin = {top: 0, right: 0, bottom: 0, left: 0}
318 var yAxis = d3.svg.axis() 320 var yAxis = d3.svg.axis()
319 .scale(y) 321 .scale(y)
320 .orient("left"); 322 .orient("left");
321 323
322 324
323 var svg = d3.select(".chart") 325 var svg = d3.select("." + d3jsInjectionTarget)
324 .append("svg") 326 .append("svg")
325 .attr("class", "svg") 327 .attr("class", "svg")
326 // .attr("width", width) 328 // .attr("width", width)
327 // .attr("height", height) 329 // .attr("height", height)
328 .attr("width", width-20) 330 .attr("width", width-20)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)