(function(b){b.jqplot.CanvasAxisLabelRenderer=function(a){this.angle=0;this.showLabel=this.show=true;this.label="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11pt";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport=true;this.pt2px=null;this._plotDimensions={height:null,width:null};b.extend(true,this,a);if(a.angle==null&&this.axis!="xaxis"&&this.axis!="x2axis")this.angle=-90;a={fontSize:this.fontSize,fontWeight:this.fontWeight,
fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};if(this.pt2px)a.pt2px=this.pt2px;this._textRenderer=this.enableFontSupport?b.jqplot.support_canvas_text()?new b.jqplot.CanvasFontRenderer(a):new b.jqplot.CanvasTextRenderer(a):new b.jqplot.CanvasTextRenderer(a)};b.jqplot.CanvasAxisLabelRenderer.prototype.init=function(a){b.extend(true,this,a);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,
fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};b.jqplot.CanvasAxisLabelRenderer.prototype.getWidth=function(a){if(this._elem)return this._elem.outerWidth(true);else{var c=this._textRenderer,d=c.getWidth(a);a=c.getHeight(a);return Math.abs(Math.sin(c.angle)*a)+Math.abs(Math.cos(c.angle)*d)}};b.jqplot.CanvasAxisLabelRenderer.prototype.getHeight=function(a){if(this._elem)return this._elem.outerHeight(true);else{var c=this._textRenderer,d=c.getWidth(a);a=c.getHeight(a);
return Math.abs(Math.cos(c.angle)*a)+Math.abs(Math.sin(c.angle)*d)}};b.jqplot.CanvasAxisLabelRenderer.prototype.getAngleRad=function(){return this.angle*Math.PI/180};b.jqplot.CanvasAxisLabelRenderer.prototype.draw=function(a,c){if(this._elem){b.jqplot.use_excanvas&&window.G_vmlCanvasManager.uninitElement!==undefined&&window.G_vmlCanvasManager.uninitElement(this._elem.get(0));this._elem.emptyForce();this._elem=null}var d=c.canvasManager.getCanvas();this._textRenderer.setText(this.label,a);var e=this.getWidth(a),
f=this.getHeight(a);d.width=e;d.height=f;d.style.width=e;d.style.height=f;d=c.canvasManager.initCanvas(d);this._elem=b(d);this._elem.css({position:"absolute"});this._elem.addClass("jqplot-"+this.axis+"-label");return this._elem};b.jqplot.CanvasAxisLabelRenderer.prototype.pack=function(){this._textRenderer.draw(this._elem.get(0).getContext("2d"),this.label)}})(jQuery);
