/*
jQWidgets v3.7.1 (2015-Feb)
Copyright (c) 2011-2015 jQWidgets.
License: http://jqwidgets.com/license/
*/

(function(a){a.extend(a.jqx._jqxChart.prototype,{_moduleApi:true,getItemsCount:function(f,b){var d=this.seriesGroups[f];if(!this._isSerieVisible(f,b)){return 0}var e=this._renderData;if(!d||!e||e.length<=f){return 0}var c=d.series[b];if(!c){return 0}return e[f].offsets[b].length},getXAxisRect:function(c){var b=this._renderData;if(!b||b.length<=c){return undefined}if(!b[c].xAxis){return undefined}return b[c].xAxis.rect},getXAxisLabels:function(k){var d=[];var l=this._renderData;if(!l||l.length<=k){return d}l=l[k].xAxis;if(!l){return d}var j=this.seriesGroups[k];if(j.polar||j.spider){for(var e=0;e<l.polarLabels.length;e++){var h=l.polarLabels[e];d.push({offset:{x:h.x,y:h.y},value:h.value})}return d}var c=this._getXAxis(k);var g=this.getXAxisRect(k);var b=c.position=="top"||c.position=="right";var f=j.orientation=="horizontal";for(var e=0;e<l.data.length;e++){if(f){d.push({offset:{x:g.x+(b?0:g.width),y:g.y+l.data.data[e]},value:l.data.xvalues[e]})}else{d.push({offset:{x:g.x+l.data.data[e],y:g.y+(b?g.height:0)},value:l.data.xvalues[e]})}}return d},getValueAxisRect:function(c){var b=this._renderData;if(!b||b.length<=c){return undefined}if(!b[c].valueAxis){return undefined}return b[c].valueAxis.rect},getValueAxisLabels:function(h){var c=[];var j=this._renderData;if(!j||j.length<=h){return c}j=j[h].valueAxis;if(!j){return c}var k=this._getValueAxis(h);var b=k.position=="top"||k.position=="right";var g=this.seriesGroups[h];var e=g.orientation=="horizontal";if(g.polar||g.spider){for(var d=0;d<j.polarLabels.length;d++){var f=j.polarLabels[d];c.push({offset:{x:f.x,y:f.y},value:f.value})}return c}for(var d=0;d<j.items.length;d++){if(e){c.push({offset:{x:j.itemOffsets[j.items[d]].x+j.itemWidth/2,y:j.rect.y+(b?j.rect.height:0)},value:j.items[d]})}else{c.push({offset:{x:j.rect.x+j.rect.width,y:j.itemOffsets[j.items[d]].y+j.itemWidth/2},value:j.items[d]})}}return c},getPlotAreaRect:function(){return this._plotRect},getRect:function(){return this._rect},getItemCoord:function(n,j,b){if(!this._isSerieVisible(n,j)||!this._renderData||this._renderData.length<=n){return{x:NaN,y:NaN}}var e=this.seriesGroups[n];var h=this._getItemCoord(n,j,b,false);if(this._isPieGroup(n)){h={x:h.x,y:h.y,innerRadius:h.innerRadius,outerRadius:h.outerRadius,fromAngle:h.fromAngle,toAngle:h.toAngle,centerOffset:h.centerOffset};return h}if(e.polar||e.spider){var l=this._renderData[n].xoffsets.data[b];var k=this._renderData[n].offsets[j][b];var m=this._toPolarCoord(this._renderData[n].polarCoords,this._plotRect,l,k.to);h.x=m.x;h.y=m.y;return h}var d=e.orientation=="horizontal";if(d){var c=h.x;h.x=h.y;h.y=c;h.width=h.x.from-h.x.to;h.x=h.x.to;var f=this.getXAxisRect(n);h.y+=-this._plotRect.x+f.y}else{h.height=h.y.from-h.y.to;h.y=h.y.to}if(e.type.indexOf("column")!=-1){var i=this._getColumnSerieWidthAndOffset(n,j);if(d){h.y+=i.offset;h.height=i.width}else{h.x+=i.offset;h.width=i.width}}return h},_getItemCoord:function(q,k,b,p){var f=this.seriesGroups[q],m,l;if(!f||!this._renderData){return{x:NaN,y:NaN}}var h=f.series[k];if(!h){return{x:NaN,y:NaN}}var j=this._plotRect;if(this._isPieGroup(q)){var o=this._renderData[q].offsets[k][b];if(!o){return{x:NaN,y:NaN}}if(p===false){return o}var e=(o.fromAngle+o.toAngle)/2*(Math.PI/180);var i=(o.innerRadius+o.outerRadius)/2;m=j.x+o.x+Math.cos(e)*i;l=j.y+o.y-Math.sin(e)*i}else{m=j.x+this._renderData[q].xoffsets.data[b];l=this._renderData[q].offsets[k][b];if(isNaN(m)||!l){return{x:NaN,y:NaN}}if(f.polar==true||f.spider==true){var n=this._getPolarAxisCoords(q,j);var d=this._toPolarCoord(n,j,m,l.from);var c=this._toPolarCoord(n,j,m,l.to);m=c.x;l={from:d.y,to:c.y}}if(p===false){return{x:m,y:l}}if(f.polar==true||f.spider==true){l=l.to}else{l=(l.from+l.to)/2}}return{x:m,y:l}},showToolTip:function(f,c,e,b,d){var g=this.getItemCoord(f,c,e);if(isNaN(g.x)||isNaN(g.y)){return}this._startTooltipTimer(f,c,e,g.x,g.y,b,d)},hideToolTip:function(c){if(isNaN(c)){c=0}var b=this;b._cancelTooltipTimer();setTimeout(function(){b._hideToolTip(0)},c)}})})(jqxBaseFramework);