From 7fb1ddf9179c120a50f8f3c923f402b450efb1b5 Mon Sep 17 00:00:00 2001 From: Steeve Vandecappelle Date: Sun, 26 Jul 2015 10:58:01 +0200 Subject: [PATCH] Merge pull request from bitbucket: 71 --- dist/plugins/donut/jqplot.donutRenderer.min.js | 2 +- src/plugins/donut/jqplot.donutRenderer.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/plugins/donut/jqplot.donutRenderer.min.js b/dist/plugins/donut/jqplot.donutRenderer.min.js index 4f46b01..aa3bfe1 100644 --- a/dist/plugins/donut/jqplot.donutRenderer.min.js +++ b/dist/plugins/donut/jqplot.donutRenderer.min.js @@ -1 +1 @@ -!function(a){function b(b,c,d){d=d||{},d.axesDefaults=d.axesDefaults||{},d.legend=d.legend||{},d.seriesDefaults=d.seriesDefaults||{};var e=!1;if(d.seriesDefaults.renderer==a.jqplot.DonutRenderer)e=!0;else if(d.series)for(var f=0;ff;f++)this.series[e].renderer.constructor==a.jqplot.DonutRenderer&&this.series[f].renderer.constructor==a.jqplot.DonutRenderer&&this.series[e]._previousSeries.push(this.series[f]);for(e=0;e=0;c--)a.series[c].highlightLabelSliceRenderer.unhighlight()}function g(a,b,c,d,g){if(d){var h=[d.seriesIndex,d.pointIndex,d.data],i=jQuery.Event("jqplotDataMouseOver");if(i.pageX=a.pageX,i.pageY=a.pageY,g.target.trigger(i,h),!g.series[h[0]].highlightMouseOver||h[0]==g.plugins.donutRenderer.highlightedSeriesIndex&&h[1]==g.series[h[0]]._highlightedPoint)g.series[h[0]].highlightLabelSliceRenderer.move(h[1],i.pageX,i.pageY);else{var j=jQuery.Event("jqplotDataHighlight");j.pageX=a.pageX,j.pageY=a.pageY,g.target.trigger(j,h);for(var k=g.series.length-1;k>=0;k--)g.series[k].highlightLabelSliceRenderer.unhighlight();e(g,h[0],h[1])}}else null==d&&f(g)}function h(a,b,c,d,g){if(d){var h=[d.seriesIndex,d.pointIndex,d.data];if(g.series[h[0]].highlightMouseDown&&(h[0]!=g.plugins.donutRenderer.highlightedSeriesIndex||h[1]!=g.series[h[0]]._highlightedPoint)){var i=jQuery.Event("jqplotDataHighlight");i.pageX=a.pageX,i.pageY=a.pageY,g.target.trigger(i,h),e(g,h[0],h[1])}}else null==d&&f(g)}function i(a,b,c,d,e){var g=e.plugins.donutRenderer.highlightedSeriesIndex;null!=g&&e.series[g].highlightMouseDown&&f(e)}function j(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataClick");g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f)}}function k(a,b,c,d,e){if(d){var g=[d.seriesIndex,d.pointIndex,d.data],h=e.plugins.donutRenderer.highlightedSeriesIndex;null!=h&&e.series[h].highlightMouseDown&&f(e);var i=jQuery.Event("jqplotDataRightClick");i.pageX=a.pageX,i.pageY=a.pageY,e.target.trigger(i,g)}}function l(){this.highlightLabelSliceRenderer=new a.jqplot.DonutHighlighterLabelSliceRenderer(this),this.plugins.donutRenderer&&this.plugins.donutRenderer.highlightCanvas&&(this.plugins.donutRenderer.highlightCanvas.resetCanvas(),this.plugins.donutRenderer.highlightCanvas=null),this.plugins.donutRenderer={highlightedSeriesIndex:null},this.plugins.donutRenderer.highlightCanvas=new a.jqplot.GenericCanvas;var b=a(this.targetId+" .jqplot-data-label");b.length?a(b[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this)):this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.donutRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(a){f(a.data.plot)})}a.jqplot.DonutRenderer=function(){a.jqplot.LineRenderer.call(this)},a.jqplot.DonutRenderer.prototype=new a.jqplot.LineRenderer,a.jqplot.DonutRenderer.prototype.constructor=a.jqplot.DonutRenderer,a.jqplot.DonutRenderer.prototype.init=function(b,e){if(this.diameter=null,this.innerDiameter=null,this.thickness=null,this.padding=20,this.sliceMargin=0,this.ringMargin=null,this.fill=!0,this.shadowOffset=2,this.shadowAlpha=.07,this.shadowDepth=5,this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColors=[],this.dataLabels="percent",this.showDataLabels=!1,1==this.showDataCategoryOnHover,this.dataLabelFormatString=null,this.dataLabelThreshold=3,this.dataLabelPositionFactor=.4,this.dataLabelNudge=0,this.startAngle=0,this.tickRenderer=a.jqplot.DonutTickRenderer,this._drawData=!0,this._type="donut",b.highlightMouseDown&&null==b.highlightMouseOver&&(b.highlightMouseOver=!1),a.extend(!0,this,b),null!=this.diameter&&(this.diameter=this.diameter-this.sliceMargin),this._diameter=null,this._innerDiameter=null,this._radius=null,this._innerRadius=null,this._thickness=null,this._previousSeries=[],this._numberSeries=1,this._sliceAngles=[],this._highlightedPoint=null,this.highlightLabelSliceRenderer=new a.jqplot.DonutHighlighterLabelSliceRenderer(this),this.labelsSlices=[],0==this.highlightColors.length)for(var f=0;fp;p++)n[p]=o>570?.8*n[p]:n[p]+.3*(255-n[p]),n[p]=parseInt(n[p],10);this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}e.postParseOptionsHooks.addOnce(d),e.postInitHooks.addOnce(c),e.eventListenerHooks.addOnce("jqplotMouseMove",g),e.eventListenerHooks.addOnce("jqplotMouseDown",h),e.eventListenerHooks.addOnce("jqplotMouseUp",i),e.eventListenerHooks.addOnce("jqplotClick",j),e.eventListenerHooks.addOnce("jqplotRightClick",k),e.postDrawHooks.addOnce(l)},a.jqplot.DonutRenderer.prototype.setGridData=function(a){var b=[],c=[],d=(this.startAngle/180*Math.PI,0);this._drawData=!1;for(var e=0;e0&&(b[e]+=b[e-1]),d+=this.data[e][1];for(var f=2*Math.PI/b[b.length-1],e=0;e0&&(c[f]+=c[f-1]),e+=a[f][1];for(var g=2*Math.PI/c[c.length-1],f=0;f6.282+this.startAngle&&(c=6.282+this.startAngle,b>c&&(b=6.281+this.startAngle)),b>=c||(a.beginPath(),a.fillStyle=d,a.strokeStyle=d,a.arc(0,0,g,b,c,!1),a.lineTo(h*Math.cos(c),h*Math.sin(c)),a.arc(0,0,h,c,b,!0),a.closePath(),i?a.fill():a.stroke())}var g=this._diameter/2,h=g-this._thickness,i=this.fill;if(a.save(),a.translate(this._center[0],this._center[1]),e)for(var j=0;j=0;b--)this.serie.labelsSlices[b].addClass("hidden")},a.jqplot.DonutHighlighterLabelSliceRenderer.prototype.move=function(a,b,c){var d=this.serie.labelsSlices[a].position(),e=this.serie.labelsSlices[a].find(".tooltip"),f=c-d.top-(2*this.serie.labelsSlices[a].height()+e.height()),g=b-d.left-this.serie.labelsSlices[a].width()-e.width()/2;e.css({left:g,top:f})},a.jqplot.DonutRenderer.prototype.draw=function(b,c,d,e){this.labelsSlices=[];var f,g=void 0!=d?d:{},h=0,i=0,j=1;if(d.legendInfo&&"insideGrid"==d.legendInfo.placement){var k=d.legendInfo;switch(k.location){case"nw":h=k.width+k.xoffset;break;case"w":h=k.width+k.xoffset;break;case"sw":h=k.width+k.xoffset;break;case"ne":h=k.width+k.xoffset,j=-1;break;case"e":h=k.width+k.xoffset,j=-1;break;case"se":h=k.width+k.xoffset,j=-1;break;case"n":i=k.height+k.yoffset;break;case"s":i=k.height+k.yoffset,j=-1}}for(var l=(void 0!=g.shadow?g.shadow:this.shadow,void 0!=g.showLine?g.showLine:this.showLine,void 0!=g.fill?g.fill:this.fill,b.canvas.width),m=b.canvas.height,n=l-h-2*this.padding,o=m-i-2*this.padding,p=Math.min(n,o),q=p,r=null==this.ringMargin?2*this.sliceMargin:this.ringMargin,f=0;f1&&this.index>0?this._previousSeries[0]._diameter:this._diameter;this._thickness=this.thickness||(s-this.innerDiameter-2*r*this._numberSeries)/this._numberSeries/2}else this._thickness=this.thickness||p/2/(this._numberSeries+1)*.85;this._radius=this._diameter/2;this._innerRadius=this._radius-this._thickness;var t=this.startAngle/180*Math.PI;if(this._center=[(l-j*h)/2+j*h,(m-j*i)/2+j*i],this.shadow)for(var u="rgba(0,0,0,"+this.shadowAlpha+")",f=0;f=this.dataLabelThreshold){var x,y,z=(v+w)/2;"label"==this.dataLabels?(x=this.dataLabelFormatString||"%s",y=a.jqplot.sprintf(x,c[f][0])):"value"==this.dataLabels?(x=this.dataLabelFormatString||"%d",y=a.jqplot.sprintf(x,this.data[f][1])):"percent"==this.dataLabels?(x=this.dataLabelFormatString||"%d%%",y=a.jqplot.sprintf(x,100*c[f][2])):this.dataLabels.constructor==Array&&(x=this.dataLabelFormatString||"%s",y=a.jqplot.sprintf(x,this.dataLabels[f]));var A,B=this._innerRadius+this._thickness*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,C=this._center[0]+Math.cos(z)*B+this.canvas._offsets.left,D=this._center[1]+Math.sin(z)*B+this.canvas._offsets.top;if(this.showDataCategoryOnHover){var E=this.dataLabelFormatString||"%s";labelTooltip=a.jqplot.sprintf(E,c[f][0]);var F=''+labelTooltip+"",G=''+y+F+NaN,A=a(G).insertBefore(e.eventCanvas._elem);this.labelsSlices.push(A),A.addClass("jqplot-donut-show-hover hidden")}else var A=a(''+y+"").insertBefore(e.eventCanvas._elem);C-=A.width()/2,D-=A.height()/2,C=Math.round(C),D=Math.round(D),A.css({left:C,top:D})}}},a.jqplot.DonutAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this)},a.jqplot.DonutAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer,a.jqplot.DonutAxisRenderer.prototype.constructor=a.jqplot.DonutAxisRenderer,a.jqplot.DonutAxisRenderer.prototype.init=function(b){this.tickRenderer=a.jqplot.DonutTickRenderer,a.extend(!0,this,b),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},a.jqplot.DonutLegendRenderer=function(){a.jqplot.TableLegendRenderer.call(this)},a.jqplot.DonutLegendRenderer.prototype=new a.jqplot.TableLegendRenderer,a.jqplot.DonutLegendRenderer.prototype.constructor=a.jqplot.DonutLegendRenderer,a.jqplot.DonutLegendRenderer.prototype.init=function(b){this.numberRows=null,this.numberColumns=null,a.extend(!0,this,b)},a.jqplot.DonutLegendRenderer.prototype.draw=function(){if(this.show){var b=this._series,c="position:absolute;";c+=this.background?"background:"+this.background+";":"",c+=this.border?"border:"+this.border+";":"",c+=this.fontSize?"font-size:"+this.fontSize+";":"",c+=this.fontFamily?"font-family:"+this.fontFamily+";":"",c+=this.textColor?"color:"+this.textColor+";":"",c+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",c+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",c+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",c+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=a('
');for(var d,e,f=!1,g=!1,h=0;h<=b.length-1;h+=1){var i=b[h],j=new a.jqplot.ColorGenerator(i.seriesColors);if(i.show){var k=i.data;this.numberRows?(d=this.numberRows,e=this.numberColumns?this.numberColumns:Math.ceil(k.length/d)):this.numberColumns?(e=this.numberColumns,d=Math.ceil(k.length/this.numberColumns)):(d=k.length,e=1);var l,m,n,o,p,q,r,s,t=0;for(l=0;d>l;l++)for(n=g?a('').prependTo(this._elem):a('').appendTo(this._elem),m=0;e>m;m++)t0?!0:!1,r=f?this.rowSpacing:"0",o=a('
'),p=a(''),this.escapeHtml?p.text(q):p.html(q),g?(p.prependTo(n),o.prependTo(n)):(o.appendTo(n),p.appendTo(n)),f=!0),t++}}}return this._elem};a.jqplot.preInitHooks.push(b),a.jqplot.DonutTickRenderer=function(){a.jqplot.AxisTickRenderer.call(this)},a.jqplot.DonutTickRenderer.prototype=new a.jqplot.AxisTickRenderer,a.jqplot.DonutTickRenderer.prototype.constructor=a.jqplot.DonutTickRenderer}(jQuery); \ No newline at end of file +!function(a){function b(b,c,d){d=d||{},d.axesDefaults=d.axesDefaults||{},d.legend=d.legend||{},d.seriesDefaults=d.seriesDefaults||{};var e=!1;if(d.seriesDefaults.renderer==a.jqplot.DonutRenderer)e=!0;else if(d.series)for(var f=0;ff;f++)this.series[e].renderer.constructor==a.jqplot.DonutRenderer&&this.series[f].renderer.constructor==a.jqplot.DonutRenderer&&this.series[e]._previousSeries.push(this.series[f]);for(e=0;e=0;c--)a.series[c].highlightLabelSliceRenderer.unhighlight()}function g(a,b,c,d,g){if(d){var h=[d.seriesIndex,d.pointIndex,d.data],i=jQuery.Event("jqplotDataMouseOver");if(i.pageX=a.pageX,i.pageY=a.pageY,g.target.trigger(i,h),!g.series[h[0]].highlightMouseOver||h[0]==g.plugins.donutRenderer.highlightedSeriesIndex&&h[1]==g.series[h[0]]._highlightedPoint)g.series[h[0]].highlightLabelSliceRenderer.move(h[1],i.pageX,i.pageY);else{var j=jQuery.Event("jqplotDataHighlight");j.pageX=a.pageX,j.pageY=a.pageY,g.target.trigger(j,h);for(var k=g.series.length-1;k>=0;k--)g.series[k].highlightLabelSliceRenderer.unhighlight();e(g,h[0],h[1])}}else null==d&&f(g)}function h(a,b,c,d,g){if(d){var h=[d.seriesIndex,d.pointIndex,d.data];if(g.series[h[0]].highlightMouseDown&&(h[0]!=g.plugins.donutRenderer.highlightedSeriesIndex||h[1]!=g.series[h[0]]._highlightedPoint)){var i=jQuery.Event("jqplotDataHighlight");i.pageX=a.pageX,i.pageY=a.pageY,g.target.trigger(i,h),e(g,h[0],h[1])}}else null==d&&f(g)}function i(a,b,c,d,e){var g=e.plugins.donutRenderer.highlightedSeriesIndex;null!=g&&e.series[g].highlightMouseDown&&f(e)}function j(a,b,c,d,e){if(d){var f=[d.seriesIndex,d.pointIndex,d.data],g=jQuery.Event("jqplotDataClick");g.pageX=a.pageX,g.pageY=a.pageY,e.target.trigger(g,f)}}function k(a,b,c,d,e){if(d){var g=[d.seriesIndex,d.pointIndex,d.data],h=e.plugins.donutRenderer.highlightedSeriesIndex;null!=h&&e.series[h].highlightMouseDown&&f(e);var i=jQuery.Event("jqplotDataRightClick");i.pageX=a.pageX,i.pageY=a.pageY,e.target.trigger(i,g)}}function l(){this.highlightLabelSliceRenderer=new a.jqplot.DonutHighlighterLabelSliceRenderer(this),this.plugins.donutRenderer&&this.plugins.donutRenderer.highlightCanvas&&(this.plugins.donutRenderer.highlightCanvas.resetCanvas(),this.plugins.donutRenderer.highlightCanvas=null),this.plugins.donutRenderer={highlightedSeriesIndex:null},this.plugins.donutRenderer.highlightCanvas=new a.jqplot.GenericCanvas;var b=a(this.targetId+" .jqplot-data-label");b.length?a(b[0]).before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this)):this.eventCanvas._elem.before(this.plugins.donutRenderer.highlightCanvas.createElement(this._gridPadding,"jqplot-donutRenderer-highlight-canvas",this._plotDimensions,this));this.plugins.donutRenderer.highlightCanvas.setContext();this.eventCanvas._elem.bind("mouseleave",{plot:this},function(a){f(a.data.plot)})}a.jqplot.DonutRenderer=function(){a.jqplot.LineRenderer.call(this)},a.jqplot.DonutRenderer.prototype=new a.jqplot.LineRenderer,a.jqplot.DonutRenderer.prototype.constructor=a.jqplot.DonutRenderer,a.jqplot.DonutRenderer.prototype.init=function(b,e){if(this.diameter=null,this.innerDiameter=null,this.thickness=null,this.padding=20,this.sliceMargin=0,this.ringMargin=null,this.fill=!0,this.shadowOffset=2,this.shadowAlpha=.07,this.shadowDepth=5,this.highlightMouseOver=!0,this.highlightMouseDown=!1,this.highlightColors=[],this.dataLabels="percent",this.showDataLabels=!1,1==this.showDataCategoryOnHover,this.dataLabelFormatString=null,this.dataLabelThreshold=3,this.dataLabelPositionFactor=.4,this.dataLabelNudge=0,this.startAngle=0,this.tickRenderer=a.jqplot.DonutTickRenderer,this._drawData=!0,this._type="donut",b.highlightMouseDown&&null==b.highlightMouseOver&&(b.highlightMouseOver=!1),a.extend(!0,this,b),null!=this.diameter&&(this.diameter=this.diameter-this.sliceMargin),this._diameter=null,this._innerDiameter=null,this._radius=null,this._innerRadius=null,this._thickness=null,this._previousSeries=[],this._numberSeries=1,this._sliceAngles=[],this._highlightedPoint=null,this.highlightLabelSliceRenderer=new a.jqplot.DonutHighlighterLabelSliceRenderer(this),this.labelsSlices=[],0==this.highlightColors.length)for(var f=0;fp;p++)n[p]=o>570?.8*n[p]:n[p]+.3*(255-n[p]),n[p]=parseInt(n[p],10);this.highlightColors.push("rgb("+n[0]+","+n[1]+","+n[2]+")")}e.postParseOptionsHooks.addOnce(d),e.postInitHooks.addOnce(c),e.eventListenerHooks.addOnce("jqplotMouseMove",g),e.eventListenerHooks.addOnce("jqplotMouseDown",h),e.eventListenerHooks.addOnce("jqplotMouseUp",i),e.eventListenerHooks.addOnce("jqplotClick",j),e.eventListenerHooks.addOnce("jqplotRightClick",k),e.postDrawHooks.addOnce(l)},a.jqplot.DonutRenderer.prototype.setGridData=function(a){var b=[],c=[],d=(this.startAngle/180*Math.PI,0);this._drawData=!1;for(var e=0;e0&&(b[e]+=b[e-1]),d+=this.data[e][1];for(var f=2*Math.PI/b[b.length-1],e=0;e0&&(c[f]+=c[f-1]),e+=a[f][1];for(var g=2*Math.PI/c[c.length-1],f=0;f6.282+this.startAngle&&(c=6.282+this.startAngle,b>c&&(b=6.281+this.startAngle)),b>=c||(a.beginPath(),a.fillStyle=d,a.strokeStyle=d,a.arc(0,0,g,b,c,!1),a.lineTo(h*Math.cos(c),h*Math.sin(c)),a.arc(0,0,h,c,b,!0),a.closePath(),i?a.fill():a.stroke())}var g=this._diameter/2,h=g-this._thickness,i=this.fill;if(a.save(),a.translate(this._center[0],this._center[1]),e)for(var j=0;j=0;b--)this.serie.labelsSlices[b].addClass("hidden")},a.jqplot.DonutHighlighterLabelSliceRenderer.prototype.move=function(a,b,c){var d=this.serie.labelsSlices[a].position(),e=this.serie.labelsSlices[a].find(".tooltip"),f=c-d.top-(2*this.serie.labelsSlices[a].height()+e.height()),g=b-d.left-this.serie.labelsSlices[a].width()-e.width()/2;e.css({left:g,top:f})},a.jqplot.DonutRenderer.prototype.draw=function(b,c,d,e){this.labelsSlices=[];var f,g=void 0!=d?d:{},h=0,i=0,j=1;if(d.legendInfo&&"insideGrid"==d.legendInfo.placement){var k=d.legendInfo;switch(k.location){case"nw":h=k.width+k.xoffset;break;case"w":h=k.width+k.xoffset;break;case"sw":h=k.width+k.xoffset;break;case"ne":h=k.width+k.xoffset,j=-1;break;case"e":h=k.width+k.xoffset,j=-1;break;case"se":h=k.width+k.xoffset,j=-1;break;case"n":i=k.height+k.yoffset;break;case"s":i=k.height+k.yoffset,j=-1}}for(var l=(void 0!=g.shadow?g.shadow:this.shadow,void 0!=g.showLine?g.showLine:this.showLine,void 0!=g.fill?g.fill:this.fill,b.canvas.width),m=b.canvas.height,n=l-h-2*this.padding,o=m-i-2*this.padding,p=Math.min(n,o),q=p,r=null==this.ringMargin?2*this.sliceMargin:this.ringMargin,f=0;f1&&this.index>0?this._previousSeries[0]._diameter:this._diameter;this._thickness=this.thickness||(s-this.innerDiameter-2*r*this._numberSeries)/this._numberSeries/2}else this._thickness=this.thickness||p/2/(this._numberSeries+1)*.85;this._radius=this._diameter/2;this._innerRadius=this._radius-this._thickness;var t=this.startAngle/180*Math.PI;if(this._center=[(l-j*h)/2+j*h,(m-j*i)/2+j*i],this.shadow)for(var u="rgba(0,0,0,"+this.shadowAlpha+")",f=0;f=this.dataLabelThreshold){var x,y,z=(v+w)/2;"label"==this.dataLabels?(x=this.dataLabelFormatString||"%s",y=a.jqplot.sprintf(x,c[f][0])):"value"==this.dataLabels?(x=this.dataLabelFormatString||"%d",y=a.jqplot.sprintf(x,this.data[f][1])):"percent"==this.dataLabels?(x=this.dataLabelFormatString||"%d%%",y=a.jqplot.sprintf(x,100*c[f][2])):this.dataLabels.constructor==Array&&(x=this.dataLabelFormatString||"%s",y=a.jqplot.sprintf(x,this.dataLabels[f]));var A,B=this._innerRadius+this._thickness*this.dataLabelPositionFactor+this.sliceMargin+this.dataLabelNudge,C=this._center[0]+Math.cos(z)*B+this.canvas._offsets.left,D=this._center[1]+Math.sin(z)*B+this.canvas._offsets.top;if(this.showDataCategoryOnHover){var E=this.dataLabelFormatString||"%s";labelTooltip=a.jqplot.sprintf(E,c[f][0]);var F=''+labelTooltip+"",G=''+y+F+NaN,A=a(G).insertBefore(e.eventCanvas._elem);this.labelsSlices.push(A),A.addClass("jqplot-donut-show-hover hidden")}else var A=a(''+y+"").insertBefore(e.eventCanvas._elem);C-=A.width()/2,D-=A.height()/2,C=Math.round(C),D=Math.round(D),A.css({left:C,top:D})}}},a.jqplot.DonutAxisRenderer=function(){a.jqplot.LinearAxisRenderer.call(this)},a.jqplot.DonutAxisRenderer.prototype=new a.jqplot.LinearAxisRenderer,a.jqplot.DonutAxisRenderer.prototype.constructor=a.jqplot.DonutAxisRenderer,a.jqplot.DonutAxisRenderer.prototype.init=function(b){this.tickRenderer=a.jqplot.DonutTickRenderer,a.extend(!0,this,b),this._dataBounds={min:0,max:100},this.min=0,this.max=100,this.showTicks=!1,this.ticks=[],this.showMark=!1,this.show=!1},a.jqplot.DonutLegendRenderer=function(){a.jqplot.TableLegendRenderer.call(this)},a.jqplot.DonutLegendRenderer.prototype=new a.jqplot.TableLegendRenderer,a.jqplot.DonutLegendRenderer.prototype.constructor=a.jqplot.DonutLegendRenderer,a.jqplot.DonutLegendRenderer.prototype.init=function(b){this.numberRows=null,this.numberColumns=null,a.extend(!0,this,b)},a.jqplot.DonutLegendRenderer.prototype.draw=function(){if(this.show){var b=this._series,c="position:absolute;";c+=this.background?"background:"+this.background+";":"",c+=this.border?"border:"+this.border+";":"",c+=this.fontSize?"font-size:"+this.fontSize+";":"",c+=this.fontFamily?"font-family:"+this.fontFamily+";":"",c+=this.textColor?"color:"+this.textColor+";":"",c+=null!=this.marginTop?"margin-top:"+this.marginTop+";":"",c+=null!=this.marginBottom?"margin-bottom:"+this.marginBottom+";":"",c+=null!=this.marginLeft?"margin-left:"+this.marginLeft+";":"",c+=null!=this.marginRight?"margin-right:"+this.marginRight+";":"",this._elem=a('
');for(var d,e,f=!1,g=!1,h=0;h<=b.length-1;h+=1){var i=b[h],j=new a.jqplot.ColorGenerator(i.seriesColors);if(i.show){var k=i.data;this.numberRows?(d=this.numberRows,e=this.numberColumns?this.numberColumns:Math.ceil(k.length/d)):this.numberColumns?(e=this.numberColumns,d=Math.ceil(k.length/this.numberColumns)):(d=k.length,e=1);var l,m,n,o,p,q,r,s,t=0;for(l=0;d>l;l++)for(n=g?a('').prependTo(this._elem):a('').appendTo(this._elem),m=0;e>m;m++)t0?!0:!1,r=f?this.rowSpacing:"0",o=a('
'),p=a(''),this.escapeHtml?p.text(q):p.html(q),g?(p.prependTo(n),o.prependTo(n)):(o.appendTo(n),p.appendTo(n)),f=!0),t++}}}return this._elem};a.jqplot.preInitHooks.push(b),a.jqplot.DonutTickRenderer=function(){a.jqplot.AxisTickRenderer.call(this)},a.jqplot.DonutTickRenderer.prototype=new a.jqplot.AxisTickRenderer,a.jqplot.DonutTickRenderer.prototype.constructor=a.jqplot.DonutTickRenderer}(jQuery); \ No newline at end of file diff --git a/src/plugins/donut/jqplot.donutRenderer.js b/src/plugins/donut/jqplot.donutRenderer.js index 832eb4b..0c958b4 100644 --- a/src/plugins/donut/jqplot.donutRenderer.js +++ b/src/plugins/donut/jqplot.donutRenderer.js @@ -634,10 +634,10 @@ } rs = (pad) ? this.rowSpacing : '0'; - td1 = $(''+ - '
'+ + td1 = $(''+ + '
'+ '
'); - td2 = $(''); + td2 = $(''); if (this.escapeHtml){ td2.text(lt); }