(function($){$.jqplot.BlockRenderer=function(){$.jqplot.LineRenderer.call(this)};$.jqplot.BlockRenderer.prototype=new $.jqplot.LineRenderer();$.jqplot.BlockRenderer.prototype.constructor=$.jqplot.BlockRenderer;$.jqplot.BlockRenderer.prototype.init=function(options){this.css={padding:'2px',border:'1px solid #999',textAlign:'center'};this.escapeHtml=!1;this.insertBreaks=!0;this.varyBlockColors=!1;$.extend(!0,this,options);if(this.css.backgroundColor){this.color=this.css.backgroundColor}
else if(this.css.background){this.color=this.css.background}
else if(!this.varyBlockColors){this.css.background=this.color}
this.canvas=new $.jqplot.BlockCanvas();this.shadowCanvas=new $.jqplot.BlockCanvas();this.canvas._plotDimensions=this._plotDimensions;this.shadowCanvas._plotDimensions=this._plotDimensions;this._type='block';this.moveBlock=function(idx,x,y,duration){var el=this.canvas._elem.children(':eq('+idx+')');this.data[idx][0]=x;this.data[idx][1]=y;this._plotData[idx][0]=x;this._plotData[idx][1]=y;this._stackData[idx][0]=x;this._stackData[idx][1]=y;this.gridData[idx][0]=this._xaxis.series_u2p(x);this.gridData[idx][1]=this._yaxis.series_u2p(y);var w=el.outerWidth();var h=el.outerHeight();var left=this.gridData[idx][0]-w/2+'px';var top=this.gridData[idx][1]-h/2+'px';if(duration){if(parseInt(duration,10)){duration=parseInt(duration,10)}
el.animate({left:left,top:top},duration)}
else{el.css({left:left,top:top})}
el=null}};$.jqplot.BlockRenderer.prototype.draw=function(ctx,gd,options){if(this.plugins.pointLabels){this.plugins.pointLabels.show=!1}
var i,el,d,gd,t,css,w,h,left,top;var opts=(options!=undefined)?options:{};var colorGenerator=new $.jqplot.ColorGenerator(this.seriesColors);this.canvas._elem.empty();for(i=0;i<this.gridData.length;i++){d=this.data[i];gd=this.gridData[i];t='';css={};if(typeof d[2]=='string'){t=d[2]}
else if(typeof d[2]=='object'){css=d[2]}
if(typeof d[3]=='object'){css=d[3]}
if(this.insertBreaks){t=t.replace(/ /g,'<br />')}
css=$.extend(!0,{},this.css,css);el=$('<div style="position:absolute;margin-left:auto;margin-right:auto;"></div>');this.canvas._elem.append(el);this.escapeHtml?el.text(t):el.html(t);delete css.position;delete css.marginRight;delete css.marginLeft;if(!css.background&&!css.backgroundColor&&!css.backgroundImage){css.background=colorGenerator.next()}
el.css(css);w=el.outerWidth();h=el.outerHeight();left=gd[0]-w/2+'px';top=gd[1]-h/2+'px';el.css({left:left,top:top});el=null}};$.jqplot.BlockCanvas=function(){$.jqplot.ElemContainer.call(this);this._ctx};$.jqplot.BlockCanvas.prototype=new $.jqplot.ElemContainer();$.jqplot.BlockCanvas.prototype.constructor=$.jqplot.BlockCanvas;$.jqplot.BlockCanvas.prototype.createElement=function(offsets,clss,plotDimensions){this._offsets=offsets;var klass='jqplot-blockCanvas';if(clss!=undefined){klass=clss}
var elem;if(this._elem){elem=this._elem.get(0)}
else{elem=document.createElement('div')}
if(plotDimensions!=undefined){this._plotDimensions=plotDimensions}
var w=this._plotDimensions.width-this._offsets.left-this._offsets.right+'px';var h=this._plotDimensions.height-this._offsets.top-this._offsets.bottom+'px';this._elem=$(elem);this._elem.css({position:'absolute',width:w,height:h,left:this._offsets.left,top:this._offsets.top});this._elem.addClass(klass);return this._elem};$.jqplot.BlockCanvas.prototype.setContext=function(){this._ctx={canvas:{width:0,height:0},clearRect:function(){return null}};return this._ctx}})(jQuery)