(function(c){c.jqplot.CanvasAxisTickRenderer=function(a){this.mark="outside";this.showGridline=this.showMark=!0;this.isMinorTick=!1;this.angle=0;this.markSize=4;this.showLabel=this.show=!0;this.labelPosition="auto";this.label="";this.value=null;this._styles={};this.formatter=c.jqplot.DefaultTickFormatter;this.formatString="";this.fontFamily='"Trebuchet MS", Arial, Helvetica, sans-serif';this.fontSize="11px";this.fontWeight="normal";this.fontStretch=1;this.textColor="#666666";this.enableFontSupport= !1;this.pt2px=null;this._elem;this._ctx;this._plotWidth;this._plotHeight;this._plotDimensions={height:null,width:null};c.extend(!0,this,a);a={fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch,fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily};this.pt2px&&(a.pt2px=this.pt2px);if(this.enableFontSupport)if(c.browser.safari){for(var b=c.browser.version.split("."),d=0;d<b.length;d++)b[d]=Number(b[d]);if(528<b[0]||528==b[0]&&16<=b[1])this._textRenderer= new c.jqplot.CanvasFontRenderer(a)}else c.browser.mozilla?(b=c.browser.version.split("."),this._textRenderer=1<b[0]||1==b[0]&&9<=b[1]&&0<b[2]?new c.jqplot.CanvasFontRenderer(a):new c.jqplot.CanvasTextRenderer(a)):this._textRenderer=new c.jqplot.CanvasTextRenderer(a);else this._textRenderer=new c.jqplot.CanvasTextRenderer(a)};c.jqplot.CanvasAxisTickRenderer.prototype.init=function(a){c.extend(!0,this,a);this._textRenderer.init({fontSize:this.fontSize,fontWeight:this.fontWeight,fontStretch:this.fontStretch, fillStyle:this.textColor,angle:this.getAngleRad(),fontFamily:this.fontFamily})};c.jqplot.CanvasAxisTickRenderer.prototype.getWidth=function(a){if(this._elem)return this._elem.outerWidth(!0);var b=this._textRenderer,c=b.getWidth(a),a=b.getHeight(a);return Math.abs(Math.sin(b.angle)*a)+Math.abs(Math.cos(b.angle)*c)};c.jqplot.CanvasAxisTickRenderer.prototype.getHeight=function(a){if(this._elem)return this._elem.outerHeight(!0);var b=this._textRenderer,c=b.getWidth(a),a=b.getHeight(a);return Math.abs(Math.cos(b.angle)* a)+Math.abs(Math.sin(b.angle)*c)};c.jqplot.CanvasAxisTickRenderer.prototype.getAngleRad=function(){return this.angle*Math.PI/180};c.jqplot.CanvasAxisTickRenderer.prototype.setTick=function(a,b,c){this.value=a;c&&(this.isMinorTick=!0);return this};c.jqplot.CanvasAxisTickRenderer.prototype.draw=function(a){this.label||(this.label=this.formatter(this.formatString,this.value));var b=document.createElement("canvas");this._textRenderer.setText(this.label,a);var d=this.getWidth(a),a=this.getHeight(a);b.width= d;b.height=a;b.style.width=d;b.style.height=a;b.style.textAlign="left";b.style.position="absolute";this._domelem=b;this._elem=c(b);this._elem.css(this._styles);this._elem.addClass("jqplot-"+this.axis+"-tick");return this._elem};c.jqplot.CanvasAxisTickRenderer.prototype.pack=function(){c.browser.msie&&(window.G_vmlCanvasManager.init_(document),this._domelem=window.G_vmlCanvasManager.initElement(this._domelem));var a=this._elem.get(0).getContext("2d");this._textRenderer.draw(a,this.label)}})(jQuery);