/** * Copyright (c) 2009 Chris Leonello * jqPlot is currently available for use in all personal or commercial projects * under both the MIT and GPL version 2.0 licenses. This means that you can * choose the license that best suits your project and use it accordingly. * * Although not required, the author would appreciate an email letting him * know of any substantial use of jqPlot. You can reach the author at: * chris dot leonello at gmail dot com or see http://www.jqplot.com/info.php . * * If you are feeling kind and generous, consider supporting the project by * making a donation at: http://www.jqplot.com/donate.php . */ (function(c){c.jqplot.PointLabels=function(e){this.show=c.jqplot.config.enablePlugins;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;this.hideZeros=false;c.extend(true,this,e)};var a=["nw","n","ne","e","se","s","sw","w"];var d={nw:0,n:1,ne:2,e:3,se:4,s:5,sw:6,w:7};var b=["se","s","sw","w","nw","n","ne","e"];c.jqplot.PointLabels.init=function(k,h,g,e){var n=c.extend(true,{},g,e);this.plugins.pointLabels=new c.jqplot.PointLabels(n.pointLabels);var f=this.plugins.pointLabels;if(f.labels.length==0||f.labelsFromSeries){if(f.stackedValue){if(this._plotData.length&&this._plotData[0].length){var m=f.seriesLabelIndex||this._plotData[0].length-1;for(var j=0;j');u.insertAfter(s.canvas);if(q.escapeHTML){u.text(m)}else{u.html(m)}var f=q.location;if(this.waterfall&&parseInt(m,10)<0){f=b[d[f]]}var l=v.u2p(y[r][0])+q.xOffset(u,f);var g=n.u2p(y[r][1])+q.yOffset(u,f);u.css("left",l);u.css("top",g);var j=l+c(u).width();var o=g+c(u).height();var x=q.edgeTolerance;var e=c(s.canvas).position().left;var t=c(s.canvas).position().top;var w=s.canvas.width+e;var k=s.canvas.height+t;if(l-xw||o+x>k){c(u).remove()}}}};c.jqplot.postSeriesInitHooks.push(c.jqplot.PointLabels.init);c.jqplot.postDrawSeriesHooks.push(c.jqplot.PointLabels.draw)})(jQuery);