-var _100=DIV(_94,_99[1]);
-_100.style.top=(y+this.options.axisTickSize)+"px";
-_100.style.left=(x-this.options.axisLabelWidth/2)+"px";
-_100.style.textAlign="center";
-_100.style.width=this.options.axisLabelWidth+"px";
-MochiKit.DOM.appendChildNodes(this.container,_100);
-this.xlabels.push(_100);
+var _104=DIV(_94,tick[1]);
+_104.style.textAlign="center";
+_104.style.bottom="0px";
+var left=(x-this.options.axisLabelWidth/2);
+if(left+this.options.axisLabelWidth>this.width){
+left=this.width-this.options.xAxisLabelWidth;
+_104.style.textAlign="right";
+}
+if(left<0){
+left=0;
+_104.style.textAlign="left";
+}
+_104.style.left=left+"px";
+_104.style.border="1px solid black";
+_104.style.width=this.options.xAxisLabelWidth+"px";
+MochiKit.DOM.appendChildNodes(this.container,_104);
+this.xlabels.push(_104);