From 79b7a07916acd2c5fc664320106de30a3de8664f Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Tue, 19 Apr 2016 14:50:32 +0200
Subject: [PATCH] no-jira: remove console.log

---
 .../webapp/static/js/jquery/openolat/jquery.statistics.chart.js | 2 --
 .../static/js/jquery/openolat/jquery.statistics.chart.min.js    | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.js b/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.js
index 2388ef4442b..d248f756828 100644
--- a/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.js
+++ b/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.js
@@ -205,8 +205,6 @@
     	
     	var sum =  settings.participants;
     	var max = sum;
-    	
-    	console.log(settings.colors);
 
     	var x = d3.scale.linear()
     	  .domain([0, max])
diff --git a/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.min.js b/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.min.js
index 17f16c99e68..791469471ac 100644
--- a/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.min.js
+++ b/src/main/webapp/static/js/jquery/openolat/jquery.statistics.chart.min.js
@@ -1 +1 @@
-(function(a){a.fn.qtiStatistics=function(d,b){var c=a.extend({values:[],colors:[],cut:null,participants:-1,barHeight:40,xTopLegend:"x Top",xBottomLegend:"x Bottom",yLeftLegend:"y Left",yRightLegend:"y Right"},b);try{if(d=="histogramScore"){histogramScore(this,c)}else{if(d=="histogramDuration"){histogramDuration(this,c)}else{if(d=="horizontalBarSingleChoice"){horizontalBarSingleChoice(this,c)}else{if(d=="rightAnswerPerItem"){rightAnswerPerItem(this,c)}else{if(d=="averageScorePerItem"){averageScorePerItem(this,c)}else{if(d=="horizontalBarMultipleChoice"){horizontalBarMultipleChoice(this,c)}else{if(d=="horizontalBarMultipleChoiceSurvey"){horizontalBarMultipleChoiceSurvey(this,c)}}}}}}}}catch(f){if(window.console){console.log(f)}}return this};averageScorePerItem=function(b,f){var j=b.width();var h=f.values.reverse();var m=b.height();var g={top:10,right:60,bottom:40,left:60},d=j-g.left-g.right;var n=h.length*f.barHeight;b.height(n+g.top+g.bottom+"px");var l=d3.scale.linear().domain([0,d3.max(h,function(p){return p[1]})]).range([0,d]);var e=d3.svg.axis().scale(l).orient("bottom").ticks(10);var k=d3.scale.ordinal().domain(h.map(function(p){return p[0]})).rangeRoundBands([n,0]);var c=d3.svg.axis().scale(k).orient("left");var i=d3.select("#"+b.attr("id")).append("svg").attr("width",d+g.left+g.right).attr("height",n+g.top+g.bottom).append("g").attr("transform","translate("+g.left+","+g.top+")");i.append("g").attr("class","x axis").attr("transform","translate(0,"+n+")").call(e).append("text").attr("y",(g.bottom/1.7)).attr("x",(d/2)).attr("dy","1em").style("text-anchor","middle").text(f.xBottomLegend);i.selectAll(".bar0").data(h).enter().append("rect").attr("class","bar bar_default").attr("fill","bar_default").attr("x",0).attr("y",function(p){return k(p[0])+2}).attr("width",function(p){return l(p[1])}).attr("height",k.rangeBand()-4);var o=((k.rangeBand()/2)+3)+"px";i.selectAll(".bar0").data(h).enter().append("text").attr("x",function(p){return l(p[1])}).attr("y",function(p){return k(p[0])+2}).attr("dx",-3).attr("dy",o).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(p){return(p[1]<=0)?"":d3.round(p[1],2)});i.append("g").attr("class","y axis").call(c).append("text").attr("transform","rotate(-90)").attr("y",0-(g.right/1.7)).attr("x",0-(n/2)).attr("dy","1em").style("text-anchor","middle").text(f.yLeftLegend)};rightAnswerPerItem=function(c,g){var o=c.height();var k=c.width();var i=g.values.reverse();var h={top:15,right:60,bottom:40,left:60},f=k-h.left-h.right;var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var l=g.participants;var n=d3.scale.linear().domain([0,l]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xTopLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_green").attr("fill","bar_green").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return n(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return n(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]});j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-(h.right/1.7)).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend)};horizontalBarMultipleChoiceSurvey=function(c,g){var k=c.width();var i=g.values.reverse();var h={top:40,right:15,bottom:40,left:40};var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var f=k-h.left-h.right;var l=g.participants;var n=l;console.log(g.colors);var o=d3.scale.linear().domain([0,n]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xBottomLegend);j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-h.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_default").attr("fill","bar_default").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]})};horizontalBarMultipleChoice=function(c,g){var k=c.width();var i=g.values.reverse();var h={top:40,right:15,bottom:40,left:40};var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var f=k-h.left-h.right;var l=g.participants;var n=l;var o=d3.scale.linear().domain([0,n]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xBottomlegend);j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-h.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_green").attr("fill","bar_green").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]});j.selectAll(".bar1").data(i).enter().append("rect").attr("class","bar bar_red").attr("fill","bar_red").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[2])}).attr("height",m.rangeBand()-4);j.selectAll(".bar1").data(i).enter().append("text").attr("x",function(r){return o(r[1]+r[2])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[2]<=0)?"":r[2]});j.selectAll(".bar2").data(i).enter().append("rect").attr("class","bar bar_grey").attr("fill","bar_grey").attr("x",function(r){return o(r[1]+r[2])}).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[3])}).attr("height",m.rangeBand()-4);j.selectAll(".bar2").data(i).enter().append("text").attr("x",function(r){return o(r[1]+r[2]+r[3])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[3]<=0)?"":r[3]})};horizontalBarSingleChoice=function(c,h){var l=c.width();var j=h.values.reverse();var d=h.colors.reverse();var i={top:15,right:15,bottom:40,left:40};var q=j.length*h.barHeight;c.height(q+i.top+i.bottom+"px");var g=l-i.left-i.right;var m=h.participants;var o=m;var p=d3.scale.linear().domain([0,o]).range([0,g]);var f=d3.scale.linear().domain([0,1]).range([0,g]);var b=d3.svg.axis().scale(f).orient("bottom").ticks(10,"%");var n=d3.scale.ordinal().domain(j.map(function(s){return s[0]})).rangeRoundBands([q,0]);var e=d3.svg.axis().scale(n).orient("left");var k=d3.select("#"+c.attr("id")).append("svg").attr("width",g+i.left+i.right).attr("height",q+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");k.append("g").attr("class","x axis").attr("transform","translate(0,"+q+")").call(b).append("text").attr("y",(i.bottom/1.7)).attr("x",(g/2)).attr("dy","1em").style("text-anchor","middle").text(h.xBottomLegend);k.selectAll(".bar0").data(j).enter().append("rect").attr("class",function(t,s){if(d==null){return"bar bar0 bar_default"}else{if(d.length>s){return d[s]}else{return"bar bar0 bar_default"}}}).attr("fill","bar_green").attr("x",0).attr("y",function(s){return n(s[0])+2}).attr("width",function(s){return p(s[1])}).attr("height",n.rangeBand()-4);var r=((n.rangeBand()/2)+3)+"px";k.selectAll(".bar0").data(j).enter().append("text").attr("x",function(s){return p(s[1])}).attr("y",function(s){return n(s[0])+2}).attr("dx",-3).attr("dy",r).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(s){return(s[1]<=0)?"":s[1]});k.append("g").attr("class","y axis").call(e).append("text").attr("transform","rotate(-90)").attr("y",0-i.left).attr("x",0-(q/2)).attr("dy","1em").style("text-anchor","middle").text(h.yLeftLegend)};histogramDuration=function(v,u){var c=v.height();var q=v.width();var f=u.values;var s=d3.min(f,function(x){return x});var z=d3.max(f,function(x){return x});var d="%M:%S";if(z<10){d+=":%L"}var i=new Date(2012,0,1,0,0),w=d3.format(",.f"),A=d3.time.format(d),l=function(x){return A(new Date(i.getTime()+(x*1000)))};var n={top:10,right:60,bottom:40,left:60},r=q-n.left-n.right,p=c-n.top-n.bottom;var m=d3.scale.linear().domain([0,z]).range([0,r]);var B=d3.layout.histogram().bins(m.ticks(20))(f);var h=d3.sum(B,function(x){return x.y});var k=d3.scale.linear().domain([0,d3.max(B,function(x){return x.y})]).range([p,0]);var g=d3.scale.linear().domain([0,d3.max(B,function(x){return x.y/h})]).range([p,0]);var j=d3.svg.axis().scale(m).orient("bottom").tickFormat(l);var b=d3.svg.axis().scale(k).orient("right").ticks(k.domain()[1]).tickSubdivide(0);var e=d3.svg.axis().scale(g).orient("left").ticks(10,"%");var o=d3.select("#"+v.attr("id")).append("svg").attr("width",r+n.left+n.right).attr("height",p+n.top+n.bottom).append("g").attr("transform","translate("+n.left+","+n.top+")");var t=o.selectAll(".bar").data(B).enter().append("g").attr("class","bar bar_default").attr("transform",function(x){return"translate("+m(x.x)+","+k(x.y)+")"}).append("rect").attr("x",2).attr("width",m(B[0].dx)-4).attr("height",function(x){return p-k(x.y)});o.append("g").attr("class","y axis").call(e).append("text").attr("transform","rotate(-90)").attr("y",0-n.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(u.yLeftLegend);o.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(j).append("text").attr("y",(n.bottom/1.1)).attr("x",(r/2)).attr("dx","1em").style("text-anchor","middle").text(u.xBottomLegend);o.append("g").attr("class","y axis").attr("transform","translate("+r+",0)").call(b).append("text").attr("transform","rotate(90)").attr("y",0-(n.right)).attr("x",(p/2)).attr("dy","1em").style("text-anchor","middle").text(u.yRightLegend)};histogramScore=function(s,r){var c=s.height();var o=s.width();var e=r.values;var l={top:10,right:60,bottom:40,left:60},p=o-l.left-l.right,n=c-l.top-l.bottom;var f=r.cut;var t=d3.max(e,function(v){return v});if(t<1){t=1}var k=d3.scale.linear().domain([0,t]).range([0,p]);var u=d3.layout.histogram().bins(k.ticks(20))(e);var h=d3.sum(u,function(v){return v.y});var j=d3.scale.linear().domain([0,d3.max(u,function(v){return v.y})]).range([n,0]);var g=d3.scale.linear().domain([0,d3.max(u,function(v){return v.y/h})]).range([n,0]);var i=d3.svg.axis().scale(k).orient("bottom").tickFormat(d3.format(".01f"));var b=d3.svg.axis().scale(j).orient("right").ticks(j.domain()[1]).tickSubdivide(0);var d=d3.svg.axis().scale(g).orient("left").ticks(10,"%");var m=d3.select("#"+s.attr("id")).append("svg").attr("width",p+l.left+l.right).attr("height",n+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")");var q=m.selectAll(".bar").data(u).enter().append("g").attr("class",function(w,v){if(f==null){return"bar bar_default"}else{if(u[v].x<f){return"bar bar_red"}else{return"bar bar_green"}}}).attr("transform",function(v){return"translate("+k(v.x)+","+j(v.y)+")"}).append("rect").attr("x",2).attr("width",k(u[0].dx)-4).attr("height",function(v){return n-j(v.y)});m.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-l.left).attr("x",0-(n/2)).attr("dy","1em").style("text-anchor","middle").text(r.yLeftLegend);m.append("g").attr("class","x axis").attr("transform","translate(0,"+n+")").call(i).append("text").attr("y",(l.bottom/1.1)).attr("x",(p/2)).attr("dx","1em").style("text-anchor","middle").text(r.xBottomLegend);m.append("g").attr("class","y axis").attr("transform","translate("+p+",0)").call(b).append("text").attr("transform","rotate(90)").attr("y",0-(l.right)).attr("x",(n/2)).attr("dy","1em").style("text-anchor","middle").text(r.yRightLegend)}}(jQuery));
\ No newline at end of file
+(function(a){a.fn.qtiStatistics=function(d,b){var c=a.extend({values:[],colors:[],cut:null,participants:-1,barHeight:40,xTopLegend:"x Top",xBottomLegend:"x Bottom",yLeftLegend:"y Left",yRightLegend:"y Right"},b);try{if(d=="histogramScore"){histogramScore(this,c)}else{if(d=="histogramDuration"){histogramDuration(this,c)}else{if(d=="horizontalBarSingleChoice"){horizontalBarSingleChoice(this,c)}else{if(d=="rightAnswerPerItem"){rightAnswerPerItem(this,c)}else{if(d=="averageScorePerItem"){averageScorePerItem(this,c)}else{if(d=="horizontalBarMultipleChoice"){horizontalBarMultipleChoice(this,c)}else{if(d=="horizontalBarMultipleChoiceSurvey"){horizontalBarMultipleChoiceSurvey(this,c)}}}}}}}}catch(f){if(window.console){console.log(f)}}return this};averageScorePerItem=function(b,f){var j=b.width();var h=f.values.reverse();var m=b.height();var g={top:10,right:60,bottom:40,left:60},d=j-g.left-g.right;var n=h.length*f.barHeight;b.height(n+g.top+g.bottom+"px");var l=d3.scale.linear().domain([0,d3.max(h,function(p){return p[1]})]).range([0,d]);var e=d3.svg.axis().scale(l).orient("bottom").ticks(10);var k=d3.scale.ordinal().domain(h.map(function(p){return p[0]})).rangeRoundBands([n,0]);var c=d3.svg.axis().scale(k).orient("left");var i=d3.select("#"+b.attr("id")).append("svg").attr("width",d+g.left+g.right).attr("height",n+g.top+g.bottom).append("g").attr("transform","translate("+g.left+","+g.top+")");i.append("g").attr("class","x axis").attr("transform","translate(0,"+n+")").call(e).append("text").attr("y",(g.bottom/1.7)).attr("x",(d/2)).attr("dy","1em").style("text-anchor","middle").text(f.xBottomLegend);i.selectAll(".bar0").data(h).enter().append("rect").attr("class","bar bar_default").attr("fill","bar_default").attr("x",0).attr("y",function(p){return k(p[0])+2}).attr("width",function(p){return l(p[1])}).attr("height",k.rangeBand()-4);var o=((k.rangeBand()/2)+3)+"px";i.selectAll(".bar0").data(h).enter().append("text").attr("x",function(p){return l(p[1])}).attr("y",function(p){return k(p[0])+2}).attr("dx",-3).attr("dy",o).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(p){return(p[1]<=0)?"":d3.round(p[1],2)});i.append("g").attr("class","y axis").call(c).append("text").attr("transform","rotate(-90)").attr("y",0-(g.right/1.7)).attr("x",0-(n/2)).attr("dy","1em").style("text-anchor","middle").text(f.yLeftLegend)};rightAnswerPerItem=function(c,g){var o=c.height();var k=c.width();var i=g.values.reverse();var h={top:15,right:60,bottom:40,left:60},f=k-h.left-h.right;var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var l=g.participants;var n=d3.scale.linear().domain([0,l]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xTopLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_green").attr("fill","bar_green").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return n(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return n(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]});j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-(h.right/1.7)).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend)};horizontalBarMultipleChoiceSurvey=function(c,g){var k=c.width();var i=g.values.reverse();var h={top:40,right:15,bottom:40,left:40};var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var f=k-h.left-h.right;var l=g.participants;var n=l;var o=d3.scale.linear().domain([0,n]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xBottomLegend);j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-h.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_default").attr("fill","bar_default").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]})};horizontalBarMultipleChoice=function(c,g){var k=c.width();var i=g.values.reverse();var h={top:40,right:15,bottom:40,left:40};var p=i.length*g.barHeight;c.height(p+h.top+h.bottom+"px");var f=k-h.left-h.right;var l=g.participants;var n=l;var o=d3.scale.linear().domain([0,n]).range([0,f]);var e=d3.scale.linear().domain([0,1]).range([0,f]);var b=d3.svg.axis().scale(e).orient("bottom").ticks(10,"%");var m=d3.scale.ordinal().domain(i.map(function(r){return r[0]})).rangeRoundBands([p,0]);var d=d3.svg.axis().scale(m).orient("left");var j=d3.select("#"+c.attr("id")).append("svg").attr("width",f+h.left+h.right).attr("height",p+h.top+h.bottom).append("g").attr("transform","translate("+h.left+","+h.top+")");j.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(b).append("text").attr("y",(h.bottom/1.7)).attr("x",(f/2)).attr("dy","1em").style("text-anchor","middle").text(g.xBottomlegend);j.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-h.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(g.yLeftLegend);j.selectAll(".bar0").data(i).enter().append("rect").attr("class","bar bar_green").attr("fill","bar_green").attr("x",0).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[1])}).attr("height",m.rangeBand()-4);var q=((m.rangeBand()/2)+3)+"px";j.selectAll(".bar0").data(i).enter().append("text").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[1]<=0)?"":r[1]});j.selectAll(".bar1").data(i).enter().append("rect").attr("class","bar bar_red").attr("fill","bar_red").attr("x",function(r){return o(r[1])}).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[2])}).attr("height",m.rangeBand()-4);j.selectAll(".bar1").data(i).enter().append("text").attr("x",function(r){return o(r[1]+r[2])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[2]<=0)?"":r[2]});j.selectAll(".bar2").data(i).enter().append("rect").attr("class","bar bar_grey").attr("fill","bar_grey").attr("x",function(r){return o(r[1]+r[2])}).attr("y",function(r){return m(r[0])+2}).attr("width",function(r){return o(r[3])}).attr("height",m.rangeBand()-4);j.selectAll(".bar2").data(i).enter().append("text").attr("x",function(r){return o(r[1]+r[2]+r[3])}).attr("y",function(r){return m(r[0])+2}).attr("dx",-3).attr("dy",q).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(r){return(r[3]<=0)?"":r[3]})};horizontalBarSingleChoice=function(c,h){var l=c.width();var j=h.values.reverse();var d=h.colors.reverse();var i={top:15,right:15,bottom:40,left:40};var q=j.length*h.barHeight;c.height(q+i.top+i.bottom+"px");var g=l-i.left-i.right;var m=h.participants;var o=m;var p=d3.scale.linear().domain([0,o]).range([0,g]);var f=d3.scale.linear().domain([0,1]).range([0,g]);var b=d3.svg.axis().scale(f).orient("bottom").ticks(10,"%");var n=d3.scale.ordinal().domain(j.map(function(s){return s[0]})).rangeRoundBands([q,0]);var e=d3.svg.axis().scale(n).orient("left");var k=d3.select("#"+c.attr("id")).append("svg").attr("width",g+i.left+i.right).attr("height",q+i.top+i.bottom).append("g").attr("transform","translate("+i.left+","+i.top+")");k.append("g").attr("class","x axis").attr("transform","translate(0,"+q+")").call(b).append("text").attr("y",(i.bottom/1.7)).attr("x",(g/2)).attr("dy","1em").style("text-anchor","middle").text(h.xBottomLegend);k.selectAll(".bar0").data(j).enter().append("rect").attr("class",function(t,s){if(d==null){return"bar bar0 bar_default"}else{if(d.length>s){return d[s]}else{return"bar bar0 bar_default"}}}).attr("fill","bar_green").attr("x",0).attr("y",function(s){return n(s[0])+2}).attr("width",function(s){return p(s[1])}).attr("height",n.rangeBand()-4);var r=((n.rangeBand()/2)+3)+"px";k.selectAll(".bar0").data(j).enter().append("text").attr("x",function(s){return p(s[1])}).attr("y",function(s){return n(s[0])+2}).attr("dx",-3).attr("dy",r).attr("text-anchor","end").attr("fill","rgb(48,48,48)").attr("stroke","none").text(function(s){return(s[1]<=0)?"":s[1]});k.append("g").attr("class","y axis").call(e).append("text").attr("transform","rotate(-90)").attr("y",0-i.left).attr("x",0-(q/2)).attr("dy","1em").style("text-anchor","middle").text(h.yLeftLegend)};histogramDuration=function(v,u){var c=v.height();var q=v.width();var f=u.values;var s=d3.min(f,function(x){return x});var z=d3.max(f,function(x){return x});var d="%M:%S";if(z<10){d+=":%L"}var i=new Date(2012,0,1,0,0),w=d3.format(",.f"),A=d3.time.format(d),l=function(x){return A(new Date(i.getTime()+(x*1000)))};var n={top:10,right:60,bottom:40,left:60},r=q-n.left-n.right,p=c-n.top-n.bottom;var m=d3.scale.linear().domain([0,z]).range([0,r]);var B=d3.layout.histogram().bins(m.ticks(20))(f);var h=d3.sum(B,function(x){return x.y});var k=d3.scale.linear().domain([0,d3.max(B,function(x){return x.y})]).range([p,0]);var g=d3.scale.linear().domain([0,d3.max(B,function(x){return x.y/h})]).range([p,0]);var j=d3.svg.axis().scale(m).orient("bottom").tickFormat(l);var b=d3.svg.axis().scale(k).orient("right").ticks(k.domain()[1]).tickSubdivide(0);var e=d3.svg.axis().scale(g).orient("left").ticks(10,"%");var o=d3.select("#"+v.attr("id")).append("svg").attr("width",r+n.left+n.right).attr("height",p+n.top+n.bottom).append("g").attr("transform","translate("+n.left+","+n.top+")");var t=o.selectAll(".bar").data(B).enter().append("g").attr("class","bar bar_default").attr("transform",function(x){return"translate("+m(x.x)+","+k(x.y)+")"}).append("rect").attr("x",2).attr("width",m(B[0].dx)-4).attr("height",function(x){return p-k(x.y)});o.append("g").attr("class","y axis").call(e).append("text").attr("transform","rotate(-90)").attr("y",0-n.left).attr("x",0-(p/2)).attr("dy","1em").style("text-anchor","middle").text(u.yLeftLegend);o.append("g").attr("class","x axis").attr("transform","translate(0,"+p+")").call(j).append("text").attr("y",(n.bottom/1.1)).attr("x",(r/2)).attr("dx","1em").style("text-anchor","middle").text(u.xBottomLegend);o.append("g").attr("class","y axis").attr("transform","translate("+r+",0)").call(b).append("text").attr("transform","rotate(90)").attr("y",0-(n.right)).attr("x",(p/2)).attr("dy","1em").style("text-anchor","middle").text(u.yRightLegend)};histogramScore=function(s,r){var c=s.height();var o=s.width();var e=r.values;var l={top:10,right:60,bottom:40,left:60},p=o-l.left-l.right,n=c-l.top-l.bottom;var f=r.cut;var t=d3.max(e,function(v){return v});if(t<1){t=1}var k=d3.scale.linear().domain([0,t]).range([0,p]);var u=d3.layout.histogram().bins(k.ticks(20))(e);var h=d3.sum(u,function(v){return v.y});var j=d3.scale.linear().domain([0,d3.max(u,function(v){return v.y})]).range([n,0]);var g=d3.scale.linear().domain([0,d3.max(u,function(v){return v.y/h})]).range([n,0]);var i=d3.svg.axis().scale(k).orient("bottom").tickFormat(d3.format(".01f"));var b=d3.svg.axis().scale(j).orient("right").ticks(j.domain()[1]).tickSubdivide(0);var d=d3.svg.axis().scale(g).orient("left").ticks(10,"%");var m=d3.select("#"+s.attr("id")).append("svg").attr("width",p+l.left+l.right).attr("height",n+l.top+l.bottom).append("g").attr("transform","translate("+l.left+","+l.top+")");var q=m.selectAll(".bar").data(u).enter().append("g").attr("class",function(w,v){if(f==null){return"bar bar_default"}else{if(u[v].x<f){return"bar bar_red"}else{return"bar bar_green"}}}).attr("transform",function(v){return"translate("+k(v.x)+","+j(v.y)+")"}).append("rect").attr("x",2).attr("width",k(u[0].dx)-4).attr("height",function(v){return n-j(v.y)});m.append("g").attr("class","y axis").call(d).append("text").attr("transform","rotate(-90)").attr("y",0-l.left).attr("x",0-(n/2)).attr("dy","1em").style("text-anchor","middle").text(r.yLeftLegend);m.append("g").attr("class","x axis").attr("transform","translate(0,"+n+")").call(i).append("text").attr("y",(l.bottom/1.1)).attr("x",(p/2)).attr("dx","1em").style("text-anchor","middle").text(r.xBottomLegend);m.append("g").attr("class","y axis").attr("transform","translate("+p+",0)").call(b).append("text").attr("transform","rotate(90)").attr("y",0-(l.right)).attr("x",(n/2)).attr("dy","1em").style("text-anchor","middle").text(r.yRightLegend)}}(jQuery));
\ No newline at end of file
-- 
GitLab