META-INF.resources.bower_components.jqplot-jwebswing.plugins.jqplot.enhancedPieLegendRenderer.min.js Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jwebmp-jqplot Show documentation
Show all versions of jwebmp-jqplot Show documentation
The JWebSwing implementation for JQPlot Plugin
(function(c){c.jqplot.EnhancedPieLegendRenderer=function(){c.jqplot.TableLegendRenderer.call(this)};c.jqplot.EnhancedPieLegendRenderer.prototype=new c.jqplot.TableLegendRenderer();c.jqplot.EnhancedPieLegendRenderer.prototype.constructor=c.jqplot.EnhancedPieLegendRenderer;c.jqplot.EnhancedPieLegendRenderer.prototype.init=function(d){this.numberRows=null;this.numberColumns=null;this.seriesToggle="normal";this.seriesToggleReplot=false;this.disableIEFading=true;this.toolTips=[];c.extend(true,this,d);if(this.seriesToggle){c.jqplot.postDrawHooks.push(b)}};c.jqplot.EnhancedPieLegendRenderer.prototype.draw=function(n,z){var g=this;if(this.show){var t=this._series;var v;var x="position:absolute;";x+=(this.background)?"background:"+this.background+";":"";x+=(this.border)?"border:"+this.border+";":"";x+=(this.fontSize)?"font-size:"+this.fontSize+";":"";x+=(this.fontFamily)?"font-family:"+this.fontFamily+";":"";x+=(this.textColor)?"color:"+this.textColor+";":"";x+=(this.marginTop!=null)?"margin-top:"+this.marginTop+";":"";x+=(this.marginBottom!=null)?"margin-bottom:"+this.marginBottom+";":"";x+=(this.marginLeft!=null)?"margin-left:"+this.marginLeft+";":"";x+=(this.marginRight!=null)?"margin-right:"+this.marginRight+";":"";this._elem=c('
');if(this.seriesToggle){this._elem.css("z-index","3")}var D=false,r=false,d,p;var v=t[0];var E=v.data.length;var e=new c.jqplot.ColorGenerator(v.seriesColors);if(this.numberRows){d=this.numberRows;if(!this.numberColumns){p=Math.ceil(E/d)}else{p=this.numberColumns}}else{if(this.numberColumns){p=this.numberColumns;d=Math.ceil(E/this.numberColumns)}else{d=E;p=1}}var C,A,f,m,l,o,q,u,k,h;var w=0;for(C=t.length-1;C>=0;C--){if(p==1&&t[C]._stack||t[C].renderer.constructor==c.jqplot.BezierCurveRenderer){r=true}}for(C=0;C0){D=true}else{D=false}}else{if(C==d-1){D=false}else{D=true}}q=(D)?this.rowSpacing:"0";m=c(document.createElement("td"));m.addClass("jqplot-table-legend jqplot-table-legend-swatch");m.css({textAlign:"center",paddingTop:q});k=c(document.createElement("div"));k.addClass("jqplot-table-legend-swatch-outline");if(tt!==undefined){k.attr("title",tt)}h=c(document.createElement("div"));h.addClass("jqplot-table-legend-swatch");h.css({backgroundColor:y,borderColor:y});m.append(k.append(h));l=c(document.createElement("td"));l.addClass("jqplot-table-legend jqplot-table-legend-label");l.css("paddingTop",q);if(tt!==undefined){l.attr("title",tt)}if(this.escapeHtml){l.text(o)}else{l.html(o)}if(r){if(this.showLabels){l.prependTo(f)}if(this.showSwatches){m.prependTo(f)}}else{if(this.showSwatches){m.appendTo(f)}if(this.showLabels){l.appendTo(f)}}if(this.seriesToggle){var B;if(typeof(this.seriesToggle)==="string"||typeof(this.seriesToggle)==="number"){if(!c.jqplot.use_excanvas||!this.disableIEFading){B=this.seriesToggle}}if(this.showSwatches){m.bind("click",{series:v,index:w,speed:B,plot:z,replot:this.seriesToggleReplot},a);m.addClass("jqplot-seriesToggle")}if(this.showLabels){l.bind("click",{series:v,index:w,speed:B,plot:z,replot:this.seriesToggleReplot},a);l.addClass("jqplot-seriesToggle")}if(v.showSlice[w]===false&&v.showLabel){m.addClass("jqplot-series-hidden");l.addClass("jqplot-series-hidden")}}D=true}}w++}m=l=k=h=null}}return this._elem};var a=function(g){var j=g.data,h=j.replot,i=j.plot,e=j.index;j.series.showSlice[e]=(j.series.showSlice[e]===false)?true:false;var f={};if(c.isPlainObject(h)){c.extend(true,f,h)}i.replot(f)};var b=function(){if(this.legend.renderer.constructor==c.jqplot.EnhancedPieLegendRenderer&&this.legend.seriesToggle){var d=this.legend._elem.detach();this.eventCanvas._elem.after(d)}}})(jQuery);
© 2015 - 2025 Weber Informatics LLC | Privacy Policy