(function(d){d.jqplot.PointLabels=function(b){this.show=d.jqplot.config.enablePlugins;this.location="n";this.labelsFromSeries=!1;this.seriesLabelIndex=null;this.labels=[];this._labels=[];this.stackedValue=!1;this.xpadding=this.ypadding=6;this.escapeHTML=!0;this.edgeTolerance=-5;this.formatter=d.jqplot.DefaultTickFormatter;this.formatString="";this.hideZeros=!1;this._elems=[];d.extend(!0,this,b)};var l={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7},m="se s sw w nw n ne e".split(" ");d.jqplot.PointLabels.init= function(b,c,a,g){b=d.extend(!0,{},a,g);b.pointLabels=b.pointLabels||{};this.renderer.constructor==d.jqplot.BarRenderer&&("horizontal"==this.barDirection&&!b.pointLabels.location)&&(b.pointLabels.location="e");this.plugins.pointLabels=new d.jqplot.PointLabels(b.pointLabels);this.plugins.pointLabels.setLabels.call(this)};d.jqplot.PointLabels.prototype.setLabels=function(){var b=this.plugins.pointLabels,c;c=null!=b.seriesLabelIndex?b.seriesLabelIndex:this.renderer.constuctor==d.jqplot.BarRenderer&& "horizontal"==this.barDirection?0:this._plotData[0].length-1;b._labels=[];if(0==b.labels.length||b.labelsFromSeries)if(b.stackedValue){if(this._plotData.length&&this._plotData[0].length)for(var a=0;a<this._plotData.length;a++)b._labels.push(this._plotData[a][c])}else{var g=this.data;this.renderer.constructor==d.jqplot.BarRenderer&&this.waterfall&&(g=this._data);if(g.length&&g[0].length)for(a=0;a<g.length;a++)b._labels.push(g[a][c])}else b.labels.length&&(b._labels=b.labels)};d.jqplot.PointLabels.prototype.xOffset= function(b,c){var c=c||this.location,a;switch(c){case "nw":a=-b.outerWidth(!0)-this.xpadding;break;case "n":a=-b.outerWidth(!0)/2;break;case "ne":a=this.xpadding;break;case "e":a=this.xpadding;break;case "se":a=this.xpadding;break;case "s":a=-b.outerWidth(!0)/2;break;case "sw":a=-b.outerWidth(!0)-this.xpadding;break;case "w":a=-b.outerWidth(!0)-this.xpadding;break;default:a=-b.outerWidth(!0)-this.xpadding}return a};d.jqplot.PointLabels.prototype.yOffset=function(b,c){var c=c||this.location,a;switch(c){case "nw":a= -b.outerHeight(!0)-this.ypadding;break;case "n":a=-b.outerHeight(!0)-this.ypadding;break;case "ne":a=-b.outerHeight(!0)-this.ypadding;break;case "e":a=-b.outerHeight(!0)/2;break;case "se":a=this.ypadding;break;case "s":a=this.ypadding;break;case "sw":a=this.ypadding;break;case "w":a=-b.outerHeight(!0)/2;break;default:a=-b.outerHeight(!0)-this.ypadding}return a};d.jqplot.PointLabels.draw=function(b){var c=this.plugins.pointLabels;c.setLabels.call(this);for(var a=0;a<c._elems.length;a++)c._elems[a].remove(); if(c.show){a="_"+this._stackAxis+"axis";c.formatString||(c.formatString=this[a]._ticks[0].formatString,c.formatter=this[a]._ticks[0].formatter);for(var g=this._plotData,n=this._xaxis,o=this._yaxis,a=c._labels.length-1;0<=a;a--){var e=c._labels[a];c.hideZeros&&0==parseInt(c._labels[a],10)&&(e="");null!=e&&(e=c.formatter(c.formatString,e));var f=d('<div class="jqplot-point-label jqplot-series-'+this.index+" jqplot-point-"+a+'" style="position:absolute"></div>');f.insertAfter(b.canvas);c._elems.push(f); c.escapeHTML?f.text(e):f.html(e);var h=c.location;this.waterfall&&0>parseInt(e,10)&&(h=m[l[h]]);e=n.u2p(g[a][0])+c.xOffset(f,h);h=o.u2p(g[a][1])+c.yOffset(f,h);this.renderer.constructor==d.jqplot.BarRenderer&&("vertical"==this.barDirection?e+=this._barNudge:h-=this._barNudge);f.css("left",e);f.css("top",h);var p=e+d(f).width(),q=h+d(f).height(),i=c.edgeTolerance,j=d(b.canvas).position().left,k=d(b.canvas).position().top,r=b.canvas.width+j,s=b.canvas.height+k;(e-i<j||h-i<k||p+i>r||q+i>s)&&d(f).detach()}}}; d.jqplot.postSeriesInitHooks.push(d.jqplot.PointLabels.init);d.jqplot.postDrawSeriesHooks.push(d.jqplot.PointLabels.draw)})(jQuery);