(function(a){a.jqplot.PointLabels=function(b){this.show=true;this.location="n";this.labelsFromSeries=false;this.seriesLabelIndex=null;this.labels=[];this.stackedValue=false;this.ypadding=6;this.xpadding=6;this.escapeHTML=true;this.edgeTolerance=0;a.extend(true,this,b)};a.jqplot.PointLabels.init=function(j,g,e,f){var c=a.extend(true,{},e,f);this.plugins.pointLabels=new a.jqplot.PointLabels(c.pointLabels);var h=this.plugins.pointLabels;if(h.labels.length==0||h.labelsFromSeries){if(h.stackedValue){if(this._plotData.length&&this._plotData[0].length){var b=h.seriesLabelIndex||this._plotData[0].length-1;for(var d=0;d<this._plotData.length;d++){h.labels.push(this._plotData[d][b])}}}else{if(this.data.length&&this.data[0].length){var b=h.seriesLabelIndex||this.data[0].length-1;for(var d=0;d<this.data.length;d++){h.labels.push(this.data[d][b])}}}}};a.jqplot.PointLabels.draw=function(o,d){var m=this.plugins.pointLabels;if(m.show){var k,j;switch(m.location){case"nw":k=function(i){return -i.outerWidth(true)-m.xpadding};j=function(i){return -i.outerHeight(true)-m.ypadding};break;case"n":k=function(i){return -i.outerWidth(true)/2};j=function(i){return -i.outerHeight(true)-m.ypadding};break;case"ne":k=function(i){return m.xpadding};j=function(i){return -i.outerHeight(true)-m.ypadding};break;case"e":k=function(i){return m.xpadding};j=function(i){return -i.outerHeight(true)/2};break;case"se":k=function(i){return m.xpadding};j=function(i){return m.ypadding};break;case"s":k=function(i){return -i.outerWidth(true)/2};j=function(i){return m.ypadding};break;case"sw":k=function(i){return -i.outerWidth(true)-m.xpadding};j=function(i){return m.ypadding};break;case"w":k=function(i){return -i.outerWidth(true)-m.xpadding};j=function(i){return -i.outerHeight(true)/2};break;default:k=function(i){return -i.outerWidth(true)-m.xpadding};j=function(i){return -i.outerHeight(true)-m.ypadding};break}for(var n=0;n<m.labels.length;n++){var v=this._plotData;var s=this._xaxis;var h=this._yaxis;var r=a('<div class="jqplot-point-label" style="position:absolute"></div>');r.insertAfter(o.canvas);if(m.escapeHTML){r.text(m.labels[n])}else{r.html(m.labels[n])}var g=s.u2p(v[n][0])+k(r);var c=h.u2p(v[n][1])+j(r);r.css("left",g);r.css("top",c);var e=g+a(r).width();var l=c+a(r).height();var u=m.edgeTolerance;var b=a(o.canvas).position().left;var q=a(o.canvas).position().top;var t=o.canvas.width+b;var f=o.canvas.height+q;if(g-u<b||c-u<q||e+u>t||l+u>f){a(r).remove()}}}};a.jqplot.postSeriesInitHooks.push(a.jqplot.PointLabels.init);a.jqplot.postDrawSeriesHooks.push(a.jqplot.PointLabels.draw)})(jQuery);