Repository navigation
Expand file tree
/
Copy pathjqplot.cursor.min.js
More file actions
1 lines (1 loc) · 17.3 KB
/
Copy pathjqplot.cursor.min.js
File metadata and controls
1 lines (1 loc) · 17.3 KB
1
!function(o){function t(t,e,r){var i=r.plugins.cursor,n="",a=!1;if(i.showTooltipGridPosition&&(n=t.x+", "+t.y,a=!0),i.showTooltipUnitPosition)for(var l,d=0;d<i.tooltipAxisGroups.length;d++){if(l=i.tooltipAxisGroups[d],a&&(n+="<br />"),i.useAxesFormatters)for(var c=0;c<l.length;c++){c&&(n+=", ");var u=r.axes[l[c]]._ticks[0].formatter,p=r.axes[l[c]]._ticks[0].formatString;n+=u(p,e[l[c]])}else n+=o.jqplot.sprintf(i.tooltipFormatString,e[l[0]],e[l[1]]);a=!0}if(i.showTooltipDataPosition)for(var m=r.series,g=s(r,t.x,t.y),a=!1,d=0;d<m.length;d++)if(m[d].show){var h=m[d].index,f=m[d].label.toString(),v=o.inArray(h,g.indices),x=void 0,_=void 0;if(-1!=v){var w=g.data[v].data;if(i.useAxesFormatters){var z=m[d]._xaxis._ticks[0].formatter,y=m[d]._yaxis._ticks[0].formatter,k=m[d]._xaxis._ticks[0].formatString,j=m[d]._yaxis._ticks[0].formatString;x=z(k,w[0]),_=y(j,w[1])}else x=w[0],_=w[1];a&&(n+="<br />"),n+=o.jqplot.sprintf(i.tooltipFormatString,f,x,_),a=!0}}i._tooltipElem.html(n)}function e(t,e){var r=e.plugins.cursor,i=r.cursorCanvas._ctx;i.clearRect(0,0,i.canvas.width,i.canvas.height),r.showVerticalLine&&r.shapeRenderer.draw(i,[[t.x,0],[t.x,i.canvas.height]]),r.showHorizontalLine&&r.shapeRenderer.draw(i,[[0,t.y],[i.canvas.width,t.y]]);var n=s(e,t.x,t.y);if(r.showCursorLegend)for(var a=o(e.targetId+" td.jqplot-cursor-legend-label"),l=0;l<a.length;l++){var d=o(a[l]).data("seriesIndex"),c=e.series[d],u=c.label.toString(),p=o.inArray(d,n.indices),m=void 0,g=void 0;if(-1!=p){var h=n.data[p].data;if(r.useAxesFormatters){var f=c._xaxis._ticks[0].formatter,v=c._yaxis._ticks[0].formatter,x=c._xaxis._ticks[0].formatString,_=c._yaxis._ticks[0].formatString;m=f(x,h[0]),g=v(_,h[1])}else m=h[0],g=h[1]}e.legend.escapeHtml?o(a[l]).text(o.jqplot.sprintf(r.cursorLegendFormatString,u,m,g)):o(a[l]).html(o.jqplot.sprintf(r.cursorLegendFormatString,u,m,g))}i=null}function s(o,t){for(var e,s,r,i,n,a,l={indices:[],data:[]},d=o.plugins.cursor,s=0;s<o.series.length;s++)if(e=o.series[s],i=e.renderer,e.show){a=d.intersectionThreshold,e.showMarker&&(a+=e.markerRenderer.size/2);for(var r=0;r<e.gridData.length;r++)n=e.gridData[r],d.showVerticalLine&&Math.abs(t-n[0])<=a&&(l.indices.push(s),l.data.push({seriesIndex:s,pointIndex:r,gridData:n,data:e.data[r]}))}return l}function r(o,t){var e=t.plugins.cursor,s=e._tooltipElem;switch(e.tooltipLocation){case"nw":var r=o.x+t._gridPadding.left-s.outerWidth(!0)-e.tooltipOffset,i=o.y+t._gridPadding.top-e.tooltipOffset-s.outerHeight(!0);break;case"n":var r=o.x+t._gridPadding.left-s.outerWidth(!0)/2,i=o.y+t._gridPadding.top-e.tooltipOffset-s.outerHeight(!0);break;case"ne":var r=o.x+t._gridPadding.left+e.tooltipOffset,i=o.y+t._gridPadding.top-e.tooltipOffset-s.outerHeight(!0);break;case"e":var r=o.x+t._gridPadding.left+e.tooltipOffset,i=o.y+t._gridPadding.top-s.outerHeight(!0)/2;break;case"se":var r=o.x+t._gridPadding.left+e.tooltipOffset,i=o.y+t._gridPadding.top+e.tooltipOffset;break;case"s":var r=o.x+t._gridPadding.left-s.outerWidth(!0)/2,i=o.y+t._gridPadding.top+e.tooltipOffset;break;case"sw":var r=o.x+t._gridPadding.left-s.outerWidth(!0)-e.tooltipOffset,i=o.y+t._gridPadding.top+e.tooltipOffset;break;case"w":var r=o.x+t._gridPadding.left-s.outerWidth(!0)-e.tooltipOffset,i=o.y+t._gridPadding.top-s.outerHeight(!0)/2;break;default:var r=o.x+t._gridPadding.left+e.tooltipOffset,i=o.y+t._gridPadding.top+e.tooltipOffset}s.css("left",r),s.css("top",i),s=null}function i(o){var t=o._gridPadding,e=o.plugins.cursor,s=e._tooltipElem;switch(e.tooltipLocation){case"nw":var r=t.left+e.tooltipOffset,i=t.top+e.tooltipOffset;s.css("left",r),s.css("top",i);break;case"n":var r=(t.left+(o._plotDimensions.width-t.right))/2-s.outerWidth(!0)/2,i=t.top+e.tooltipOffset;s.css("left",r),s.css("top",i);break;case"ne":var r=t.right+e.tooltipOffset,i=t.top+e.tooltipOffset;s.css({right:r,top:i});break;case"e":var r=t.right+e.tooltipOffset,i=(t.top+(o._plotDimensions.height-t.bottom))/2-s.outerHeight(!0)/2;s.css({right:r,top:i});break;case"se":var r=t.right+e.tooltipOffset,i=t.bottom+e.tooltipOffset;s.css({right:r,bottom:i});break;case"s":var r=(t.left+(o._plotDimensions.width-t.right))/2-s.outerWidth(!0)/2,i=t.bottom+e.tooltipOffset;s.css({left:r,bottom:i});break;case"sw":var r=t.left+e.tooltipOffset,i=t.bottom+e.tooltipOffset;s.css({left:r,bottom:i});break;case"w":var r=t.left+e.tooltipOffset,i=(t.top+(o._plotDimensions.height-t.bottom))/2-s.outerHeight(!0)/2;s.css({left:r,top:i});break;default:var r=t.right-e.tooltipOffset,i=t.bottom+e.tooltipOffset;s.css({right:r,bottom:i})}s=null}function n(o,t,e,s,r){o.preventDefault(),o.stopImmediatePropagation();var i=r.plugins.cursor;i.clickReset&&i.resetZoom(r,i);var n=window.getSelection;return document.selection&&document.selection.empty?document.selection.empty():n&&!n().isCollapsed&&n().collapse(),!1}function a(o,t,e,s,r){o.preventDefault(),o.stopImmediatePropagation();var i=r.plugins.cursor;i.dblClickReset&&i.resetZoom(r,i);var n=window.getSelection;return document.selection&&document.selection.empty?document.selection.empty():n&&!n().isCollapsed&&n().collapse(),!1}function l(t,e,s,r,i){var n=i.plugins.cursor;if(n.onGrid=!1,n.show){if(o(t.target).css("cursor",n.previousCursor),!n.showTooltip||n._zoom.zooming&&n.showTooltipOutsideZoom&&!n.constrainOutsideZoom||(n._tooltipElem.empty(),n._tooltipElem.hide()),n.zoom&&(n._zoom.gridpos=e,n._zoom.datapos=s),n.showVerticalLine||n.showHorizontalLine){var a=n.cursorCanvas._ctx;a.clearRect(0,0,a.canvas.width,a.canvas.height),a=null}if(n.showCursorLegend)for(var l=o(i.targetId+" td.jqplot-cursor-legend-label"),d=0;d<l.length;d++){var c=o(l[d]).data("seriesIndex"),u=i.series[c],p=u.label.toString();i.legend.escapeHtml?o(l[d]).text(o.jqplot.sprintf(n.cursorLegendFormatString,p,void 0,void 0)):o(l[d]).html(o.jqplot.sprintf(n.cursorLegendFormatString,p,void 0,void 0))}}}function d(o,s,n,a,l){var d=l.plugins.cursor;d.onGrid=!0,d.show&&(d.previousCursor=o.target.style.cursor,o.target.style.cursor=d.style,d.showTooltip&&(t(s,n,l),d.followMouse?r(s,l):i(l),d._tooltipElem.show()),(d.showVerticalLine||d.showHorizontalLine)&&e(s,l))}function c(o,s,i,n,a){var l=a.plugins.cursor;l.show&&(l.showTooltip&&(t(s,i,a),l.followMouse&&r(s,a)),(l.showVerticalLine||l.showHorizontalLine)&&e(s,a))}function u(o){var t,e,s=o.data.plot,r=s.eventCanvas._elem.offset(),i={x:o.pageX-r.left,y:o.pageY-r.top},n={xaxis:null,yaxis:null,x2axis:null,y2axis:null,y3axis:null,y4axis:null,y5axis:null,y6axis:null,y7axis:null,y8axis:null,y9axis:null,yMidAxis:null},a=["xaxis","yaxis","x2axis","y2axis","y3axis","y4axis","y5axis","y6axis","y7axis","y8axis","y9axis","yMidAxis"],l=s.axes;for(t=11;t>0;t--)e=a[t-1],l[e].show&&(n[e]=l[e].series_p2u(i[e.charAt(0)]));return{offsets:r,gridPos:i,dataPos:n}}function p(o){var e=o.data.plot,s=e.plugins.cursor;if(s.show&&s.zoom&&s._zoom.started&&!s.zoomTarget){o.preventDefault();var i=s.zoomCanvas._ctx,n=u(o),a=n.gridPos,l=n.dataPos;s._zoom.gridpos=a,s._zoom.datapos=l,s._zoom.zooming=!0;var d=a.x,c=a.y,p=i.canvas.height,m=i.canvas.width;s.showTooltip&&!s.onGrid&&s.showTooltipOutsideZoom&&(t(a,l,e),s.followMouse&&r(a,e)),"x"==s.constrainZoomTo?s._zoom.end=[d,p]:"y"==s.constrainZoomTo?s._zoom.end=[m,c]:s._zoom.end=[d,c];var g=window.getSelection;document.selection&&document.selection.empty?document.selection.empty():g&&!g().isCollapsed&&g().collapse(),h.call(s),i=null}}function m(t,e,s,r,i){var n=i.plugins.cursor;i.plugins.mobile?o(document).one("vmouseup.jqplot_cursor",{plot:i},g):o(document).one("mouseup.jqplot_cursor",{plot:i},g);i.axes;if(void 0!=document.onselectstart&&(n._oldHandlers.onselectstart=document.onselectstart,document.onselectstart=function(){return!1}),void 0!=document.ondrag&&(n._oldHandlers.ondrag=document.ondrag,document.ondrag=function(){return!1}),void 0!=document.onmousedown&&(n._oldHandlers.onmousedown=document.onmousedown,document.onmousedown=function(){return!1}),n.zoom){if(!n.zoomProxy){var a=n.zoomCanvas._ctx;a.clearRect(0,0,a.canvas.width,a.canvas.height),a=null}"x"==n.constrainZoomTo?n._zoom.start=[e.x,0]:"y"==n.constrainZoomTo?n._zoom.start=[0,e.y]:n._zoom.start=[e.x,e.y],n._zoom.started=!0;for(var l in s)n._zoom.axes.start[l]=s[l];i.plugins.mobile?o(document).bind("vmousemove.jqplotCursor",{plot:i},p):o(document).bind("mousemove.jqplotCursor",{plot:i},p)}}function g(t){var e=t.data.plot,s=e.plugins.cursor;if(s.zoom&&s._zoom.zooming&&!s.zoomTarget){var r=s._zoom.gridpos.x,i=s._zoom.gridpos.y,n=s._zoom.datapos,a=s.zoomCanvas._ctx.canvas.height,l=s.zoomCanvas._ctx.canvas.width,d=e.axes;if(s.constrainOutsideZoom&&!s.onGrid){0>r?r=0:r>l&&(r=l),0>i?i=0:i>a&&(i=a);for(var c in n)n[c]&&("x"==c.charAt(0)?n[c]=d[c].series_p2u(r):n[c]=d[c].series_p2u(i))}"x"==s.constrainZoomTo?i=a:"y"==s.constrainZoomTo&&(r=l),s._zoom.end=[r,i],s._zoom.gridpos={x:r,y:i},s.doZoom(s._zoom.gridpos,n,e,s)}s._zoom.started=!1,s._zoom.zooming=!1,o(document).unbind("mousemove.jqplotCursor",p),void 0!=document.onselectstart&&null!=s._oldHandlers.onselectstart&&(document.onselectstart=s._oldHandlers.onselectstart,s._oldHandlers.onselectstart=null),void 0!=document.ondrag&&null!=s._oldHandlers.ondrag&&(document.ondrag=s._oldHandlers.ondrag,s._oldHandlers.ondrag=null),void 0!=document.onmousedown&&null!=s._oldHandlers.onmousedown&&(document.onmousedown=s._oldHandlers.onmousedown,s._oldHandlers.onmousedown=null)}function h(){var o,t,e,s,r=this._zoom.start,i=this._zoom.end,n=this.zoomCanvas._ctx;i[0]>r[0]?(o=r[0],s=i[0]-r[0]):(o=i[0],s=r[0]-i[0]),i[1]>r[1]?(t=r[1],e=i[1]-r[1]):(t=i[1],e=r[1]-i[1]),n.fillStyle="rgba(0,0,0,0.2)",n.strokeStyle="#999999",n.lineWidth=1,n.clearRect(0,0,n.canvas.width,n.canvas.height),n.fillRect(0,0,n.canvas.width,n.canvas.height),n.clearRect(o,t,s,e),n.strokeRect(o,t,s,e),n=null}o.jqplot.Cursor=function(t){this.style="crosshair",this.previousCursor="auto",this.show=o.jqplot.config.enablePlugins,this.showTooltip=!0,this.followMouse=!1,this.tooltipLocation="se",this.tooltipOffset=6,this.showTooltipGridPosition=!1,this.showTooltipUnitPosition=!0,this.showTooltipDataPosition=!1,this.tooltipFormatString="%.4P, %.4P",this.useAxesFormatters=!0,this.tooltipAxisGroups=[],this.zoom=!1,this.zoomProxy=!1,this.zoomTarget=!1,this.looseZoom=!0,this.clickReset=!1,this.dblClickReset=!0,this.showVerticalLine=!1,this.showHorizontalLine=!1,this.constrainZoomTo="none",this.shapeRenderer=new o.jqplot.ShapeRenderer,this._zoom={start:[],end:[],started:!1,zooming:!1,isZoomed:!1,axes:{start:{},end:{}},gridpos:{},datapos:{}},this._tooltipElem,this.zoomCanvas,this.cursorCanvas,this.intersectionThreshold=2,this.showCursorLegend=!1,this.cursorLegendFormatString=o.jqplot.Cursor.cursorLegendFormatString,this._oldHandlers={onselectstart:null,ondrag:null,onmousedown:null},this.constrainOutsideZoom=!0,this.showTooltipOutsideZoom=!1,this.onGrid=!1,o.extend(!0,this,t)},o.jqplot.Cursor.cursorLegendFormatString="%s x:%s, y:%s",o.jqplot.Cursor.init=function(t,e,s){var r=s||{};this.plugins.cursor=new o.jqplot.Cursor(r.cursor);var i=this.plugins.cursor;i.show&&(o.jqplot.eventListenerHooks.push(["jqplotMouseEnter",d]),o.jqplot.eventListenerHooks.push(["jqplotMouseLeave",l]),o.jqplot.eventListenerHooks.push(["jqplotMouseMove",c]),i.showCursorLegend&&(s.legend=s.legend||{},s.legend.renderer=o.jqplot.CursorLegendRenderer,s.legend.formatString=this.plugins.cursor.cursorLegendFormatString,s.legend.show=!0),i.zoom&&(o.jqplot.eventListenerHooks.push(["jqplotMouseDown",m]),i.clickReset&&o.jqplot.eventListenerHooks.push(["jqplotClick",n]),i.dblClickReset&&o.jqplot.eventListenerHooks.push(["jqplotDblClick",a])),this.resetZoom=function(){var o=this.axes;if(i.zoomProxy){var t=this.plugins.cursor.zoomCanvas._ctx;t.clearRect(0,0,t.canvas.width,t.canvas.height),t=null}else{for(var e in o)o[e].reset(),o[e]._ticks=[],void 0!==i._zoom.axes[e]&&(o[e]._autoFormatString=i._zoom.axes[e].tickFormatString);this.redraw()}this.plugins.cursor._zoom.isZoomed=!1,this.target.trigger("jqplotResetZoom",[this,this.plugins.cursor])},i.showTooltipDataPosition&&(i.showTooltipUnitPosition=!1,i.showTooltipGridPosition=!1,void 0==r.cursor.tooltipFormatString&&(i.tooltipFormatString=o.jqplot.Cursor.cursorLegendFormatString)))},o.jqplot.Cursor.postDraw=function(){var t=this.plugins.cursor;t.zoomCanvas&&(t.zoomCanvas.resetCanvas(),t.zoomCanvas=null),t.cursorCanvas&&(t.cursorCanvas.resetCanvas(),t.cursorCanvas=null),t._tooltipElem&&(t._tooltipElem.emptyForce(),t._tooltipElem=null),t.zoom&&(t.zoomCanvas=new o.jqplot.GenericCanvas,this.eventCanvas._elem.before(t.zoomCanvas.createElement(this._gridPadding,"jqplot-zoom-canvas",this._plotDimensions,this)),t.zoomCanvas.setContext());var e=document.createElement("div");if(t._tooltipElem=o(e),e=null,t._tooltipElem.addClass("jqplot-cursor-tooltip"),t._tooltipElem.css({position:"absolute",display:"none"}),t.zoomCanvas?t.zoomCanvas._elem.before(t._tooltipElem):this.eventCanvas._elem.before(t._tooltipElem),(t.showVerticalLine||t.showHorizontalLine)&&(t.cursorCanvas=new o.jqplot.GenericCanvas,this.eventCanvas._elem.before(t.cursorCanvas.createElement(this._gridPadding,"jqplot-cursor-canvas",this._plotDimensions,this)),t.cursorCanvas.setContext()),t.showTooltipUnitPosition&&0===t.tooltipAxisGroups.length){for(var s,r=this.series,i=[],n=0;n<r.length;n++){s=r[n];var a=s.xaxis+","+s.yaxis;-1==o.inArray(a,i)&&i.push(a)}for(var n=0;n<i.length;n++)t.tooltipAxisGroups.push(i[n].split(","))}},o.jqplot.Cursor.zoomProxy=function(o,t){function e(t,e,s,i,n){r.doZoom(e,s,o,n)}function s(){o.resetZoom()}var r=o.plugins.cursor,i=t.plugins.cursor;r.zoomTarget=!0,r.zoom=!0,r.style="auto",r.dblClickReset=!1,i.zoom=!0,i.zoomProxy=!0,t.target.bind("jqplotZoom",e),t.target.bind("jqplotResetZoom",s)},o.jqplot.Cursor.prototype.resetZoom=function(o,t){var e=o.axes,s=t._zoom.axes;if(!o.plugins.cursor.zoomProxy&&t._zoom.isZoomed){for(var r in e)e[r].reset(),e[r]._ticks=[],e[r]._autoFormatString=s[r].tickFormatString;o.redraw(),t._zoom.isZoomed=!1}else{var i=t.zoomCanvas._ctx;i.clearRect(0,0,i.canvas.width,i.canvas.height),i=null}o.target.trigger("jqplotResetZoom",[o,t])},o.jqplot.Cursor.resetZoom=function(o){o.resetZoom()},o.jqplot.Cursor.prototype.doZoom=function(t,e,s,r){var i,n,a,l,d,c,u,p=r,m=s.axes,g=p._zoom.axes,h=g.start,f=(g.end,s.plugins.cursor.zoomCanvas._ctx);if("none"==p.constrainZoomTo&&Math.abs(t.x-p._zoom.start[0])>6&&Math.abs(t.y-p._zoom.start[1])>6||"x"==p.constrainZoomTo&&Math.abs(t.x-p._zoom.start[0])>6||"y"==p.constrainZoomTo&&Math.abs(t.y-p._zoom.start[1])>6){if(!s.plugins.cursor.zoomProxy){for(var v in e)void 0==p._zoom.axes[v]&&(p._zoom.axes[v]={},p._zoom.axes[v].numberTicks=m[v].numberTicks,p._zoom.axes[v].tickInterval=m[v].tickInterval,p._zoom.axes[v].daTickInterval=m[v].daTickInterval,p._zoom.axes[v].min=m[v].min,p._zoom.axes[v].max=m[v].max,p._zoom.axes[v].tickFormatString=null!=m[v].tickOptions?m[v].tickOptions.formatString:""),("none"==p.constrainZoomTo||"x"==p.constrainZoomTo&&"x"==v.charAt(0)||"y"==p.constrainZoomTo&&"y"==v.charAt(0))&&(i=e[v],null!=i&&(i>h[v]?(a=h[v],l=i):(n=h[v]-i,a=i,l=h[v]),d=m[v],c=null,d.alignTicks&&("x2axis"===d.name&&s.axes.xaxis.show?c=s.axes.xaxis.numberTicks:"y"===d.name.charAt(0)&&"yaxis"!==d.name&&"yMidAxis"!==d.name&&s.axes.yaxis.show&&(c=s.axes.yaxis.numberTicks)),!this.looseZoom||m[v].renderer.constructor!==o.jqplot.LinearAxisRenderer&&m[v].renderer.constructor!==o.jqplot.LogAxisRenderer?(m[v].min=a,m[v].max=l,m[v].tickInterval=null,m[v].numberTicks=null,m[v].daTickInterval=null):(u=o.jqplot.LinearTickGenerator(a,l,d._scalefact,c),m[v].tickInset&&u[0]<m[v].min+m[v].tickInset*m[v].tickInterval&&(u[0]+=u[4],u[2]-=1),m[v].tickInset&&u[1]>m[v].max-m[v].tickInset*m[v].tickInterval&&(u[1]-=u[4],u[2]-=1),m[v].renderer.constructor===o.jqplot.LogAxisRenderer&&u[0]<m[v].min&&(u[0]+=u[4],u[2]-=1),m[v].min=u[0],m[v].max=u[1],m[v]._autoFormatString=u[3],m[v].numberTicks=u[2],m[v].tickInterval=u[4],m[v].daTickInterval=[u[4]/1e3,"seconds"]),m[v]._ticks=[]));f.clearRect(0,0,f.canvas.width,f.canvas.height),s.redraw(),p._zoom.isZoomed=!0,f=null}s.target.trigger("jqplotZoom",[t,e,s,r])}},o.jqplot.preInitHooks.push(o.jqplot.Cursor.init),o.jqplot.postDrawHooks.push(o.jqplot.Cursor.postDraw),o.jqplot.CursorLegendRenderer=function(t){o.jqplot.TableLegendRenderer.call(this,t),this.formatString="%s"},o.jqplot.CursorLegendRenderer.prototype=new o.jqplot.TableLegendRenderer,o.jqplot.CursorLegendRenderer.prototype.constructor=o.jqplot.CursorLegendRenderer,o.jqplot.CursorLegendRenderer.prototype.draw=function(){function t(t,e,s,r){var i=s?this.rowSpacing:"0",n=o('<tr class="jqplot-legend jqplot-cursor-legend"></tr>').appendTo(this._elem);n.data("seriesIndex",r),o('<td class="jqplot-legend jqplot-cursor-legend-swatch" style="padding-top:'+i+';"><div style="border:1px solid #cccccc;padding:0.2em;"><div class="jqplot-cursor-legend-swatch" style="background-color:'+e+';"></div></div></td>').appendTo(n);var a=o('<td class="jqplot-legend jqplot-cursor-legend-label" style="vertical-align:middle;padding-top:'+i+';"></td>');a.appendTo(n),a.data("seriesIndex",r),this.escapeHtml?a.text(t):a.html(t),n=null,a=null}if(this._elem&&(this._elem.emptyForce(),this._elem=null),this.show){var e,s=this._series,r=document.createElement("table");this._elem=o(r),r=null,this._elem.addClass("jqplot-legend jqplot-cursor-legend"),this._elem.css("position","absolute");for(var i=!1,n=0;n<s.length;n++)if(e=s[n],e.show&&e.showLabel){var a=o.jqplot.sprintf(this.formatString,e.label.toString());if(a){var l=e.color;e._stack&&!e.fill&&(l=""),t.call(this,a,l,i,n),i=!0}for(var d=0;d<o.jqplot.addLegendRowHooks.length;d++){var c=o.jqplot.addLegendRowHooks[d].call(this,e);c&&(t.call(this,c.label,c.color,i),i=!0)}}s=e=null,delete s,delete e}return this._elem}}(jQuery);