{"size": 42904, "ext": "js", "max_stars_repo_path": "build/charts-base/charts-base-min.js", "max_stars_repo_name": "liferay/yui3", "max_stars_repo_stars_event_min_datetime": "2015-04-13T18:54:02.000Z", "max_stars_repo_stars_event_max_datetime": "2016-03-31T18:57:49.000Z", "max_issues_repo_path": "build/charts-base/charts-base-min.js", "max_issues_repo_name": "liferay/yui3", "max_issues_repo_issues_event_min_datetime": "2015-04-29T17:35:53.000Z", "max_issues_repo_issues_event_max_datetime": "2021-09-10T10:40:18.000Z", "max_forks_repo_path": "build/charts-base/charts-base-min.js", "max_forks_repo_name": "liferay/yui3", "max_forks_repo_forks_event_min_datetime": "2015-02-13T03:42:33.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-16T18:21:35.000Z"}
{"max_stars_count": 2, "max_issues_count": 6, "max_forks_count": 31, "avg_line_length": 5363.0, "max_line_length": 6000, "alphanum_fraction": 0.7227531233}
YUI.add("charts-base",function(e,t){var i=e.config,s=i.win,r=i.doc,n=e.Lang,a=n.isString,o=e.ClassNameManager.getClassName,h=o("seriesmarker");function l(){}e.Gridlines=e.Base.create("gridlines",e.Base,[e.Renderer],{_path:null,remove:function(){var e=this._path;e&&e.destroy()},draw:function(){this.get("axis")&&this.get("graph")&&this._drawGridlines()},_drawGridlines:function(){var t,i,s,r,n,a=this.get("axis"),o=a.get("position"),h=0,l=this.get("direction"),g=this.get("graph"),d=g.get("width"),c=g.get("height"),u=this.get("styles").line,p=u.color,y=u.weight,f=u.alpha,_=this.get("count");if(isFinite(d)&&isFinite(c)&&d>0&&c>0){for(s=(i=_&&e.Lang.isNumber(_)?this._getPoints(_,d,c):"none"!==o&&a&&a.get("tickPoints")?a.get("tickPoints"):this._getPoints(a.get("styles").majorUnit.count,d,c)).length,(t=g.get("gridlines")).set("width",d),t.set("height",c),t.set("stroke",{weight:y,color:p,opacity:f}),"vertical"===l?(n=this._verticalLine,r=c):(n=this._horizontalLine,r=d),h=0;h<s;h+=1)n(t,i[h],r);t.end()}},_getPoints:function(e,t,i){var s,r,n=[],a=e-1;for(s=0;s<e;s+=1)r=s/a,n[s]={x:t*r,y:i*r};return n},_horizontalLine:function(e,t,i){e.moveTo(0,t.y),e.lineTo(i,t.y)},_verticalLine:function(e,t,i){e.moveTo(t.x,0),e.lineTo(t.x,i)},_getDefaultStyles:function(){return{line:{color:"#f0efe9",weight:1,alpha:1}}}},{ATTRS:{direction:{},axis:{},graph:{},count:{}}}),e.Graph=e.Base.create("graph",e.Widget,[e.Renderer],{bindUI:function(){this.get("boundingBox").setStyle("position","absolute"),this.after("widthChange",this._sizeChangeHandler),this.after("heightChange",this._sizeChangeHandler),this.after("stylesChange",this._updateStyles),this.after("groupMarkersChange",this._drawSeries)},syncUI:function(){var t,i,s,r=this.get("seriesCollection"),n=0,a=r?r.length:0,o=this.get("horizontalGridlines"),h=this.get("verticalGridlines");for(this.get("showBackground")&&(t=this.get("background"),this.get("contentBox"),(i=this.get("styles").background).stroke=i.border,i.stroke.opacity=i.stroke.alpha,i.fill.opacity=i.fill.alpha,i.width=this.get("width"),i.height=this.get("height"),i.type=i.shape,t.set(i));n<a;++n)(s=r[n])instanceof e.SeriesBase&&s.render();o&&o instanceof e.Gridlines&&o.draw(),h&&h instanceof e.Gridlines&&h.draw()},seriesTypes:null,getSeriesByIndex:function(e){var t,i=this.get("seriesCollection");return i&&i.length>e&&(t=i[e]),t},getSeriesByKey:function(e){var t,i=this._seriesDictionary;return i&&i.hasOwnProperty(e)&&(t=i[e]),t},addDispatcher:function(e){this._dispatchers||(this._dispatchers=[]),this._dispatchers.push(e)},_seriesCollection:null,_seriesDictionary:null,_parseSeriesCollection:function(t){if(t){var i,s,r=t.length,n=0;for(this._seriesCollection=[],this._seriesDictionary={},this.seriesTypes=[];n<r;++n)(i=t[n])instanceof e.CartesianSeries||i instanceof e.PieSeries?this._addSeries(i):this._createSeries(i);for(r=this._seriesCollection.length,n=0;n<r;++n)s="horizontal"===(i=this.get("seriesCollection")[n]).get("direction")?"yKey":"xKey",this._seriesDictionary[i.get(s)]=i}},_addSeries:function(t){var i,s=t.get("type"),r=this.get("seriesCollection"),n=r.length,a=this.seriesTypes;t.get("graph")||t.set("graph",this),r.push(t),a.hasOwnProperty(s)||(this.seriesTypes[s]=[]),i=this.seriesTypes[s],t.set("graphOrder",n),t.set("order",i.length),i.push(t),t.set("seriesTypeCollection",i),this.addDispatcher(t),t.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),this.fire("seriesAdded",t)},_createSeries:function(t){var i,s,r=t.type,n=this.get("seriesCollection"),a=this.seriesTypes;t.graph=this,a.hasOwnProperty(r)||(a[r]=[]),i=a[r],t.graph=this,t.order=i.length,t.graphOrder=n.length,s=new(this._getSeries(t.type))(t),this.addDispatcher(s),s.after("drawingComplete",e.bind(this._drawingCompleteHandler,this)),i.push(s),n.push(s),s.set("seriesTypeCollection",i),this.get("rendered")&&s.render()},_seriesMap:{line:e.LineSeries,column:e.ColumnSeries,bar:e.BarSeries,area:e.AreaSeries,candlestick:e.CandlestickSeries,ohlc:e.OHLCSeries,stackedarea:e.StackedAreaSeries,stackedline:e.StackedLineSeries,stackedcolumn:e.StackedColumnSeries,stackedbar:e.StackedBarSeries,markerseries:e.MarkerSeries,spline:e.SplineSeries,areaspline:e.AreaSplineSeries,stackedspline:e.StackedSplineSeries,stackedareaspline:e.StackedAreaSplineSeries,stackedmarkerseries:e.StackedMarkerSeries,pie:e.PieSeries,combo:e.ComboSeries,stackedcombo:e.StackedComboSeries,combospline:e.ComboSplineSeries,stackedcombospline:e.StackedComboSplineSeries},_getSeries:function(e){return n.isString(e)?this._seriesMap[e]:e},_markerEventHandler:function(e){var t=e.type,i=e.currentTarget.getAttribute("id").split("_"),s=this.getSeriesByIndex(i[1]),r=i[2];s.updateMarkerState(t,r)},_dispatchers:null,_updateStyles:function(){var e=this.get("styles").background,t=e.border;t.opacity=t.alpha,e.stroke=t,e.fill.opacity=e.fill.alpha,this.get("background").set(e),this._sizeChangeHandler()},_sizeChangeHandler:function(){var t,i=this.get("horizontalGridlines"),s=this.get("verticalGridlines"),r=this.get("width"),n=this.get("height"),a=this.get("styles").background;a&&a.border&&a.border.weight,this.get("showBackground")&&(t=this.get("background"),r&&n&&(t.set("width",r),t.set("height",n))),this._gridlines&&this._gridlines.clear(),i&&i instanceof e.Gridlines&&i.draw(),s&&s instanceof e.Gridlines&&s.draw(),this._drawSeries()},_drawSeries:function(){if(this._drawing)this._callLater=!0;else{var t,i,s,r=this.get("graphic");for(r.set("autoDraw",!1),r.set("width",this.get("width")),r.set("height",this.get("height")),this._callLater=!1,this._drawing=!0,i=0,s=(t=this.get("seriesCollection"))?t.length:0;i<s;++i)if(t[i].draw(),(!t[i].get("xcoords")||!t[i].get("ycoords"))&&!t[i]instanceof e.PieSeries){this._callLater=!0;break}this._drawing=!1,this._callLater&&this._drawSeries()}},_drawingCompleteHandler:function(t){var i,s=t.currentTarget,r=e.Array.indexOf(this._dispatchers,s);r>-1&&this._dispatchers.splice(r,1),this._dispatchers.length<1&&((i=this.get("graphic")).get("autoDraw")||i._redraw(),
this.fire("chartRendered"))},_getDefaultStyles:function(){return{background:{shape:"rect",fill:{color:"#faf9f2"},border:{color:"#dad8c9",weight:1}}}},destructor:function(){this._graphic&&(this._graphic.destroy(),this._graphic=null),this._background&&(this._background.get("graphic").destroy(),this._background=null),this._gridlines&&(this._gridlines.get("graphic").destroy(),this._gridlines=null)}},{ATTRS:{x:{setter:function(e){return this.get("boundingBox").setStyle("left",e+"px"),e}},y:{setter:function(e){return this.get("boundingBox").setStyle("top",e+"px"),e}},chart:{getter:function(){return this._state.chart||this}},seriesCollection:{getter:function(){return this._seriesCollection},setter:function(e){return this._parseSeriesCollection(e),this._seriesCollection}},showBackground:{value:!0},seriesDictionary:{readOnly:!0,getter:function(){return this._seriesDictionary}},horizontalGridlines:{value:null,setter:function(t){var i,s,r=this.get("horizontalGridlines");if(r&&r instanceof e.Gridlines&&r.remove(),t instanceof e.Gridlines)return r=t,t.set("graph",this),t;if(t){for(s in i={direction:"horizonal",graph:this},t)t.hasOwnProperty(s)&&(i[s]=t[s]);return r=new e.Gridlines(i)}}},verticalGridlines:{value:null,setter:function(t){var i,s,r=this.get("verticalGridlines");if(r&&r instanceof e.Gridlines&&r.remove(),t instanceof e.Gridlines)return r=t,t.set("graph",this),t;if(t){for(s in i={direction:"vertical",graph:this},t)t.hasOwnProperty(s)&&(i[s]=t[s]);return r=new e.Gridlines(i)}}},background:{getter:function(){return this._background||(this._backgroundGraphic=new e.Graphic({render:this.get("contentBox")}),this._backgroundGraphic.get("node").style.zIndex=0,this._background=this._backgroundGraphic.addShape({type:"rect"})),this._background}},gridlines:{readOnly:!0,getter:function(){return this._gridlines||(this._gridlinesGraphic=new e.Graphic({render:this.get("contentBox")}),this._gridlinesGraphic.get("node").style.zIndex=1,this._gridlines=this._gridlinesGraphic.addShape({type:"path"})),this._gridlines}},graphic:{readOnly:!0,getter:function(){return this._graphic||(this._graphic=new e.Graphic({render:this.get("contentBox")}),this._graphic.get("node").style.zIndex=2,this._graphic.set("autoDraw",!1)),this._graphic}},groupMarkers:{value:!1}}}),l.ATTRS={dataProvider:{lazyAdd:!1,valueFn:function(){var e=[];return this._wereSeriesKeysExplicitlySet()||this.set("seriesKeys",this._buildSeriesKeys(e),{src:"internal"}),e},setter:function(e){var t=this._setDataValues(e);return this._wereSeriesKeysExplicitlySet()||this.set("seriesKeys",this._buildSeriesKeys(t),{src:"internal"}),t}},seriesKeys:{lazyAdd:!1,setter:function(e){var t=arguments[2];return!e||t&&t.src&&"internal"===t.src?this._seriesKeysExplicitlySet=!1:this._seriesKeysExplicitlySet=!0,e}},ariaLabel:{value:"Chart Application",setter:function(e){var t=this.get("contentBox");return t&&t.setAttribute("aria-label",e),e}},ariaDescription:{value:"Use the up and down keys to navigate between series. Use the left and right keys to navigate through items in a series.",setter:function(e){return this._description&&this._description.set("text",e),e}},tooltip:{valueFn:"_getTooltip",setter:function(e){return this._updateTooltip(e)}},categoryKey:{value:"category"},categoryType:{value:"category"},interactionType:{value:"marker"},axesCollection:{},graph:{valueFn:"_getGraph"},groupMarkers:{value:!1}},l.prototype={_wereSeriesKeysExplicitlySet:function(){return this.get("seriesKeys")&&this._seriesKeysExplicitlySet},_groupMarkersChangeHandler:function(e){var t=this.get("graph"),i=e.newVal;t&&t.set("groupMarkers",i)},_itemRendered:function(t){this._itemRenderQueue=this._itemRenderQueue.splice(1+e.Array.indexOf(this._itemRenderQueue,t.currentTarget),1),this._itemRenderQueue.length<1&&this._redraw()},_getGraph:function(){var t=new e.Graph({chart:this,groupMarkers:this.get("groupMarkers")});return t.after("chartRendered",e.bind(function(){this.fire("chartRendered")},this)),t},getSeries:function(e){var t=null,i=this.get("graph");return i&&(t=n.isNumber(e)?i.getSeriesByIndex(e):i.getSeriesByKey(e)),t},getAxisByKey:function(e){var t,i=this.get("axes");return i&&i.hasOwnProperty(e)&&(t=i[e]),t},getCategoryAxis:function(){var e,t=this.get("categoryKey"),i=this.get("axes");return i.hasOwnProperty(t)&&(e=i[t]),e},_direction:"horizontal",_dataProvider:null,_setDataValues:function(e){if(n.isArray(e[0])){for(var t,i,s=[],r=e[0],a=0,o=r.length,h=e.length;a<o;++a){for(t={category:r[a]},i=1;i<h;++i)t["series"+i]=e[i][a];s[a]=t}return s}return e},_seriesCollection:null,_setSeriesCollection:function(e){this._seriesCollection=e},_getAxisClass:function(e){return this._axisClass[e]},_axisClass:{stacked:e.StackedAxis,numeric:e.NumericAxis,category:e.CategoryAxis,time:e.TimeAxis},_axes:null,initializer:function(){this._itemRenderQueue=[],this._seriesIndex=-1,this._itemIndex=-1,this.after("dataProviderChange",this._dataProviderChangeHandler)},renderUI:function(){var e=this.get("tooltip"),t=this.get("boundingBox"),i=this.get("contentBox");t.setStyle("position","absolute"),i.setStyle("position","absolute"),this._addAxes(),this._addSeries(),e&&e.show&&this._addTooltip(),this._setAriaElements(t,i)},_setAriaElements:function(e,t){var i=this._getAriaOffscreenNode(),s=this.get("id")+"_description",r=this._getAriaOffscreenNode();t.set("tabIndex",0),t.set("role","img"),t.setAttribute("aria-label",this.get("ariaLabel")),t.setAttribute("aria-describedby",s),i.set("id",s),i.set("tabIndex",-1),i.set("text",this.get("ariaDescription")),r.set("id","live-region"),r.set("aria-live","polite"),r.set("aria-atomic","true"),r.set("role","status"),e.setAttribute("role","application"),e.appendChild(i),e.appendChild(r),this._description=i,this._liveRegion=r},_getAriaOffscreenNode:function(){var t=e.Node.create("<div></div>"),i=e.UA.ie,s=i&&i<8?"rect(1px 1px 1px 1px)":"rect(1px, 1px, 1px, 1px)";return t.setStyle("position","absolute"),t.setStyle("height","1px"),t.setStyle("width","1px"),t.setStyle("overflow","hidden"),
t.setStyle("clip",s),t},syncUI:function(){this._redraw()},bindUI:function(){this.after("tooltipChange",e.bind(this._tooltipChangeHandler,this)),this.after("widthChange",this._sizeChanged),this.after("heightChange",this._sizeChanged),this.after("groupMarkersChange",this._groupMarkersChangeHandler);var t,i=this.get("tooltip"),r="mouseout",a="mouseover",o=this.get("contentBox"),l=this.get("interactionType"),g=0,d="."+h,c=s&&"ontouchstart"in s&&!(e.UA.chrome&&e.UA.chrome<6);if(e.on("keydown",e.bind(function(e){var t,i=e.keyCode,s=parseFloat(i);s>36&&s<41&&(e.halt(),t=this._getAriaMessage(s),this._liveRegion.set("text",t))},this),this.get("contentBox")),"marker"===l?(r=i.hideEvent,a=i.showEvent,c&&(e.delegate("touchend",e.bind(this._markerEventDispatcher,this),o,d),e.on("touchend",e.bind(function(e){o.contains(e.target)&&e.halt(!0),this._activeMarker&&(this._activeMarker=null,this.hideTooltip(e))},this))),e.delegate("mouseenter",e.bind(this._markerEventDispatcher,this),o,d),e.delegate("mousedown",e.bind(this._markerEventDispatcher,this),o,d),e.delegate("mouseup",e.bind(this._markerEventDispatcher,this),o,d),e.delegate("mouseleave",e.bind(this._markerEventDispatcher,this),o,d),e.delegate("click",e.bind(this._markerEventDispatcher,this),o,d),e.delegate("mousemove",e.bind(this._positionTooltip,this),o,d)):"planar"===l&&(c?this._overlay.on("touchend",e.bind(this._planarEventDispatcher,this)):(this._overlay.on("mousemove",e.bind(this._planarEventDispatcher,this)),this.on("mouseout",this.hideTooltip))),i)if(this.on("markerEvent:touchend",e.bind(function(e){var t=e.series.get("markers")[e.index];this._activeMarker&&t===this._activeMarker?(this._activeMarker=null,this.hideTooltip(e)):(this._activeMarker=t,i.markerEventHandler.apply(this,[e]))},this)),r&&a&&r===a)this.on(l+"Event:"+r,this.toggleTooltip);else if(a&&this.on(l+"Event:"+a,i[l+"EventHandler"]),r){if(n.isArray(r))for(t=r.length;g<t;++g)this.on(l+"Event:"+r[g],this.hideTooltip);this.on(l+"Event:"+r,this.hideTooltip)}},_markerEventDispatcher:function(e){var t=e.type,i=this.get("contentBox"),s=e.currentTarget,r=s.getAttribute("id").split("_"),n=r.pop(),a=r.pop(),o=this.getSeries(parseInt(a,10)),h=this.getSeriesItems(o,n),l=e&&e.hasOwnProperty("changedTouches"),g=l?e.changedTouches[0].pageX:e.pageX,d=l?e.changedTouches[0].pageY:e.pageY,c=g-i.getX(),u=d-i.getY();"mouseenter"===t?t="mouseover":"mouseleave"===t&&(t="mouseout"),o.updateMarkerState(t,n),e.halt(),this.fire("markerEvent:"+t,{originEvent:e,pageX:g,pageY:d,categoryItem:h.category,valueItem:h.value,node:s,x:c,y:u,series:o,index:n,seriesIndex:a})},_dataProviderChangeHandler:function(t){var i,s,r,n=t.newVal;if(this._seriesIndex=-1,this._itemIndex=-1,this instanceof e.CartesianChart&&(this.set("axes",this.get("axes")),this.set("seriesCollection",this.get("seriesCollection"))),i=this.get("axes"))for(s in i)i.hasOwnProperty(s)&&(r=i[s])instanceof e.Axis&&("none"!==r.get("position")&&this._addToAxesRenderQueue(r),r.set("dataProvider",n))},toggleTooltip:function(e){var t=this.get("tooltip");t.visible?this.hideTooltip():t.markerEventHandler.apply(this,[e])},_showTooltip:function(e,t,i){var s=this.get("tooltip"),r=s.node;e&&(s.visible=!0,s.setTextFunction(r,e),r.setStyle("top",i+"px"),r.setStyle("left",t+"px"),r.setStyle("visibility","visible"))},_positionTooltip:function(e){var t=this.get("tooltip").node,i=this.get("contentBox"),s=e.pageX+10-i.getX(),r=e.pageY+10-i.getY();t&&(t.setStyle("left",s+"px"),t.setStyle("top",r+"px"))},hideTooltip:function(){var e=this.get("tooltip"),t=e.node;e.visible=!1,t.set("innerHTML",""),t.setStyle("left",-1e4),t.setStyle("top",-1e4),t.setStyle("visibility","hidden")},_addTooltip:function(){var e=this.get("tooltip"),t=this.get("id")+"_tooltip",i=this.get("contentBox"),s=r.getElementById(t);s&&i.removeChild(s),e.node.set("id",t),e.node.setStyle("visibility","hidden"),i.appendChild(e.node)},_updateTooltip:function(t){var i,s,r,a=this.get("tooltip")||this._getTooltip();if(n.isObject(t)){if(s=t.styles,t.node&&a.node?(a.node.destroy(!0),r=e.one(t.node)):r=a.node,s)for(i in s)s.hasOwnProperty(i)&&r.setStyle(i,s[i]);for(i in{markerLabelFunction:"markerLabelFunction",planarLabelFunction:"planarLabelFunction",setTextFunction:"setTextFunction",showEvent:"showEvent",hideEvent:"hideEvent",markerEventHandler:"markerEventHandler",planarEventHandler:"planarEventHandler",show:"show"})t.hasOwnProperty(i)&&(a[i]=t[i]);a.node=r}return a},_getTooltip:function(){var t=r.createElement("div"),i=o("chart-tooltip"),s={setTextFunction:this._setText,markerLabelFunction:this._tooltipLabelFunction,planarLabelFunction:this._planarLabelFunction,show:!0,hideEvent:"mouseout",showEvent:"mouseover",markerEventHandler:function(e){var t=this.get("tooltip").markerLabelFunction.apply(this,[e.categoryItem,e.valueItem,e.index,e.series,e.seriesIndex]);this._showTooltip(t,e.x+10,e.y+10)},planarEventHandler:function(e){var t,i=this.get("tooltip"),s=this.get("categoryAxis");t=i.planarLabelFunction.apply(this,[s,e.valueItem,e.index,e.items,e.seriesIndex]),this._showTooltip(t,e.x+10,e.y+10)}};return(t=e.one(t)).set("id",this.get("id")+"_tooltip"),t.setStyle("fontSize","85%"),t.setStyle("opacity","0.83"),t.setStyle("position","absolute"),t.setStyle("paddingTop","2px"),t.setStyle("paddingRight","5px"),t.setStyle("paddingBottom","4px"),t.setStyle("paddingLeft","2px"),t.setStyle("backgroundColor","#fff"),t.setStyle("border","1px solid #dbdccc"),t.setStyle("pointerEvents","none"),t.setStyle("zIndex",3),t.setStyle("whiteSpace","noWrap"),t.setStyle("visibility","hidden"),t.addClass(i),s.node=e.one(t),s},_planarLabelFunction:function(e,t,i,s){var a,o,h,l,g=r.createElement("div"),d=0,c=s.length;for(e&&(h=e.get("labelFunction").apply(this,[e.getKeyValueAt(this.get("categoryKey"),i),e.get("labelFormat")]),n.isObject(h)||(h=r.createTextNode(h)),g.appendChild(h));d<c;++d)s[d].get("visible")&&(l=(o=(a=t[d]).axis).get("labelFunction").apply(this,[o.getKeyValueAt(a.key,i),o.get("labelFormat")]),
g.appendChild(r.createElement("br")),g.appendChild(r.createTextNode(a.displayName)),g.appendChild(r.createTextNode(": ")),n.isObject(l)||(l=r.createTextNode(l)),g.appendChild(l));return g},_tooltipLabelFunction:function(e,t){var i=r.createElement("div"),s=e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]),a=t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]);return i.appendChild(r.createTextNode(e.displayName)),i.appendChild(r.createTextNode(": ")),n.isObject(s)||(s=r.createTextNode(s)),i.appendChild(s),i.appendChild(r.createElement("br")),i.appendChild(r.createTextNode(t.displayName)),i.appendChild(r.createTextNode(": ")),n.isObject(a)||(a=r.createTextNode(a)),i.appendChild(a),i},_tooltipChangeHandler:function(){if(this.get("tooltip")){var e=this.get("tooltip"),t=e.node,i=e.show,s=this.get("contentBox");t&&i&&(s.contains(t)||this._addTooltip())}},_setText:function(e,t){e.empty(),n.isNumber(t)?t+="":t||(t=""),a(t)&&(t=r.createTextNode(t)),e.appendChild(t)},_getAllKeys:function(e){for(var t,i,s=0,r=e.length,n={};s<r;++s)for(i in t=e[s])t.hasOwnProperty(i)&&(n[i]=!0);return n},_buildSeriesKeys:function(e){var t,i,s=this.get("categoryKey"),r=[];if(this._seriesKeysExplicitlySet)return this._seriesKeys;for(i in t=this._getAllKeys(e))t.hasOwnProperty(i)&&i!==s&&r.push(i);return r}},e.ChartBase=l,e.CartesianChart=e.Base.create("cartesianChart",e.Widget,[e.ChartBase,e.Renderer],{renderUI:function(){var t=this.get("boundingBox"),i=this.get("contentBox"),s=this.get("tooltip"),r=o("overlay");t.setStyle("position","absolute"),i.setStyle("position","absolute"),this._addAxes(),this._addGridlines(),this._addSeries(),s&&s.show&&this._addTooltip(),"planar"===this.get("interactionType")&&(this._overlay=e.Node.create("<div></div>"),this._overlay.set("id",this.get("id")+"_overlay"),this._overlay.setStyle("position","absolute"),this._overlay.setStyle("background","#fff"),this._overlay.setStyle("opacity",0),this._overlay.addClass(r),this._overlay.setStyle("zIndex",4),i.append(this._overlay)),this._setAriaElements(t,i),this._redraw()},_planarEventDispatcher:function(e){var t,i,s,r,n,a,o,h,l,g,d=this.get("graph"),c=this.get("boundingBox"),u=d.get("contentBox"),p=e&&e.hasOwnProperty("changedTouches"),y=p?e.changedTouches[0].pageX:e.pageX,f=p?e.changedTouches[0].pageY:e.pageY,_=y-c.getX(),x=f-c.getY(),v={x:y-u.getX(),y:f-u.getY()},m=d.get("seriesCollection"),b=0,A=this._selectedIndex,S=[],w=[],C=[],k=this.get("direction");if(e.halt(!0),"horizontal"===k?(n="x",a="y"):(a="x",n="y"),o=v[n],m)for(l=m.length;b<l&&!h;)m[b]&&(h=m[b].get(n+"MarkerPlane")),b++;if(h){for(l=h.length,b=0;b<l;++b)if(o<=h[b].end&&o>=h[b].start){i=b;break}for(l=m.length,b=0;b<l;++b)g=(t=m[b]).get(a+"coords"),(r=t.get("markers"))&&!isNaN(A)&&A>-1&&t.updateMarkerState("mouseout",A),g&&g[i]>-1&&(r&&!isNaN(i)&&i>-1&&t.updateMarkerState("mouseover",i),s=this.getSeriesItems(t,i),w.push(s.category),C.push(s.value),S.push(t));this._selectedIndex=i,i>-1?this.fire("planarEvent:mouseover",{categoryItem:w,valueItem:C,x:_,y:x,pageX:y,pageY:f,items:S,index:i,originEvent:e}):this.fire("planarEvent:mouseout")}},_type:"combo",_itemRenderQueue:null,_addToAxesRenderQueue:function(t){this._itemRenderQueue||(this._itemRenderQueue=[]),e.Array.indexOf(this._itemRenderQueue,t)<0&&this._itemRenderQueue.push(t)},_addToAxesCollection:function(e,t){var i=this.get(e+"AxesCollection");i||(i=[],this.set(e+"AxesCollection",i)),i.push(t)},_getDefaultSeriesCollection:function(){var e;return this.get("dataProvider")&&(e=this._parseSeriesCollection()),e},_parseSeriesCollection:function(t){var i,s,r,a,o,h,l,g,d,c,u,p,y=this.get("direction"),f=this.get("styles").series,_=f&&n.isArray(f),x=[],v=[],m=this.get("seriesKeys").concat(),b=this.get("type"),A=[],S=this.get("categoryKey"),w=this.get("showMarkers"),C=this.get("showAreaFill"),k=this.get("showLines");for(t=t?t.concat():[],"vertical"===y?(r="yAxis",c="yKey",a="xAxis",u="xKey"):(r="xAxis",c="xKey",a="yAxis",u="yKey"),t.length;t&&t.length>0;)o=t.shift(),(d=this._getBaseAttribute(o,u))&&(l=e.Array.indexOf(m,d))>-1?(m.splice(l,1),v.push(d),x.push(o)):A.push(o);for(;A.length>0;)o=A.shift(),m.length>0?(d=m.shift(),this._setBaseAttribute(o,u,d),v.push(d),x.push(o)):o instanceof e.CartesianSeries&&o.destroy(!0);for(m.length>0&&(v=v.concat(m)),g=v.length,h=0;h<g;++h)(o=x[h]||{type:b})instanceof e.CartesianSeries?this._parseSeriesAxes(o):(o[c]=o[c]||S,o[u]=o[u]||m.shift(),o[r]=this._getCategoryAxis(),o[a]=this._getSeriesAxis(o[u]),o.type=o.type||b,o.direction=o.direction||y,"combo"!==o.type&&"stackedcombo"!==o.type&&"combospline"!==o.type&&"stackedcombospline"!==o.type||(null!==C&&(o.showAreaFill=null!==o.showAreaFill&&o.showAreaFill!==undefined?o.showAreaFill:C),null!==w&&(o.showMarkers=null!==o.showMarkers&&o.showMarkers!==undefined?o.showMarkers:w),null!==k&&(o.showLines=null!==o.showLines&&o.showLines!==undefined?o.showLines:k)),f&&(s=f[_?h:o[u]])&&(i=o.styles,o.styles=i?this._mergeStyles(i,s):s),x[h]=o);return x&&((p=this.get("graph")).set("seriesCollection",x),x=p.get("seriesCollection")),x},_parseSeriesAxes:function(t){var i,s=this.get("axes"),r=t.get("xAxis"),a=t.get("yAxis"),o=e.Axis;r&&!(r instanceof o)&&n.isString(r)&&s.hasOwnProperty(r)&&(i=s[r])instanceof o&&t.set("xAxis",i),a&&!(a instanceof o)&&n.isString(a)&&s.hasOwnProperty(a)&&(i=s[a])instanceof o&&t.set("yAxis",i)},_getCategoryAxis:function(){return this.get("axes")[this.get("categoryAxisName")||this.get("categoryKey")]},_getSeriesAxis:function(e,t){var i,s,r,n=this.get("axes");if(n)if(t&&n.hasOwnProperty(t))r=n[t];else for(i in n)if(n.hasOwnProperty(i)&&(s=n[i].get("keys"))&&s.hasOwnProperty(e)){r=n[i];break}return r},_getBaseAttribute:function(t,i){return t instanceof e.Base?t.get(i):t.hasOwnProperty(i)?t[i]:null},_setBaseAttribute:function(t,i,s){t instanceof e.Base?t.set(i,s):t[i]=s},_setAxes:function(t){var i,s,r,n,a,o,h,l,g=this._parseAxes(t),d={},c={edgeOffset:"edgeOffset",calculateEdgeOffset:"calculateEdgeOffset",
position:"position",overlapGraph:"overlapGraph",labelValues:"labelValues",hideFirstMajorUnit:"hideFirstMajorUnit",hideLastMajorUnit:"hideLastMajorUnit",labelFunction:"labelFunction",labelFunctionScope:"labelFunctionScope",labelFormat:"labelFormat",appendLabelFunction:"appendLabelFunction",appendTitleFunction:"appendTitleFunction",maximum:"maximum",minimum:"minimum",roundingMethod:"roundingMethod",alwaysShowZero:"alwaysShowZero",scaleType:"scaleType",title:"title",width:"width",height:"height"},u=this.get("dataProvider");for(s in g)if(g.hasOwnProperty(s)){if((o=g[s])instanceof e.Axis)n=o;else{for(i in n=null,(h={}).dataProvider=o.dataProvider||u,h.keys=o.keys,o.hasOwnProperty("roundingUnit")&&(h.roundingUnit=o.roundingUnit),r=o.position,o.styles&&(h.styles=o.styles),h.position=o.position,c)c.hasOwnProperty(i)&&o.hasOwnProperty(i)&&(h[i]=o[i]);t&&(n=this.getAxisByKey(s)),n&&n instanceof e.Axis?(r!==(a=n.get("position"))&&("none"!==a&&(l=this.get(a+"AxesCollection")).splice(e.Array.indexOf(l,n),1),"none"!==r&&this._addToAxesCollection(r,n)),n.setAttrs(h)):(n=new(this._getAxisClass(o.type))(h)).after("axisRendered",e.bind(this._itemRendered,this))}n&&((l=this.get(r+"AxesCollection"))&&e.Array.indexOf(l,n)>0&&n.set("overlapGraph",!1),d[s]=n)}return d},_addAxes:function(){var t,i,s,r=this.get("axes"),n=this.get("width"),a=this.get("height"),o=e.Node.one(this._parentNode);for(t in this._axesCollection||(this._axesCollection=[]),r)r.hasOwnProperty(t)&&(i=r[t])instanceof e.Axis&&(n||(this.set("width",o.get("offsetWidth")),n=this.get("width")),a||(this.set("height",o.get("offsetHeight")),a=this.get("height")),this._addToAxesRenderQueue(i),s=i.get("position"),this.get(s+"AxesCollection")?this.get(s+"AxesCollection").push(i):this.set(s+"AxesCollection",[i]),this._axesCollection.push(i),i.get("keys").hasOwnProperty(this.get("categoryKey"))&&this.set("categoryAxis",i),i.render(this.get("contentBox")))},_addSeries:function(){this.get("graph").render(this.get("contentBox"))},_addGridlines:function(){var t,i,s,r=this.get("graph"),n=this.get("horizontalGridlines"),a=this.get("verticalGridlines"),o=this.get("direction"),h=this.get("leftAxesCollection"),l=this.get("rightAxesCollection"),g=this.get("bottomAxesCollection"),d=this.get("topAxesCollection"),c=this.get("categoryAxis");this._axesCollection&&(t=this._axesCollection.concat()).splice(e.Array.indexOf(t,c),1),n&&(i=h&&h[0]?h[0]:l&&l[0]?l[0]:"horizontal"===o?c:t[0],!this._getBaseAttribute(n,"axis")&&i&&this._setBaseAttribute(n,"axis",i),this._getBaseAttribute(n,"axis")&&r.set("horizontalGridlines",n)),a&&(s=g&&g[0]?g[0]:d&&d[0]?d[0]:"vertical"===o?c:t[0],!this._getBaseAttribute(a,"axis")&&s&&this._setBaseAttribute(a,"axis",s),this._getBaseAttribute(a,"axis")&&r.set("verticalGridlines",a))},_getDefaultAxes:function(){var e;return this.get("dataProvider")&&(e=this._parseAxes()),e},_parseAxes:function(t){var i,s,r,a,o,h,l,g,d,c,u=this.get("categoryKey"),p={},y=[],f=[],_=this.get("categoryAxisName")||this.get("categoryKey"),x=this.get("valueAxisName"),v=this.get("seriesKeys").concat(),m=this.get("direction"),b=[],A=this.get("stacked")?"stacked":"numeric";if("vertical"===m?(d="bottom",c="left"):(d="left",c="bottom"),t)for(a in t)if(t.hasOwnProperty(a))if(i=t[a],r=this._getBaseAttribute(i,"keys"),"time"===(s=this._getBaseAttribute(i,"type"))||"category"===s)_=a,this.set("categoryAxisName",a),n.isArray(r)&&r.length>0&&(u=r[0],this.set("categoryKey",u)),p[a]=i;else if(a===_)p[a]=i;else{if(p[a]=i,a!==x&&r&&n.isArray(r)){for(l=r.length,h=0;h<l;++h)y.push(r[h]);b.push(p[a])}this._getBaseAttribute(p[a],"type")||this._setBaseAttribute(p[a],"type",A),this._getBaseAttribute(p[a],"position")||this._setBaseAttribute(p[a],"position",this._getDefaultAxisPosition(p[a],b,d))}for((g=e.Array.indexOf(v,u))>-1&&v.splice(g,1),o=v.length,a=0;a<o;++a)(g=e.Array.indexOf(y,v[a]))>-1&&(f=f.concat(y.splice(g,1)));for(o=(y=f.concat(y)).length,a=0;a<o;a+=1)(g=e.Array.indexOf(v,y[a]))>-1&&v.splice(g,1);return p.hasOwnProperty(_)||(p[_]={}),this._getBaseAttribute(p[_],"keys")||this._setBaseAttribute(p[_],"keys",[u]),this._getBaseAttribute(p[_],"position")||this._setBaseAttribute(p[_],"position",c),this._getBaseAttribute(p[_],"type")||this._setBaseAttribute(p[_],"type",this.get("categoryType")),!p.hasOwnProperty(x)&&v&&v.length>0&&(p[x]={keys:v},b.push(p[x])),y.length>0&&(v=v.length>0?y.concat(v):y),p.hasOwnProperty(x)&&(this._getBaseAttribute(p[x],"position")||this._setBaseAttribute(p[x],"position",this._getDefaultAxisPosition(p[x],b,d)),this._setBaseAttribute(p[x],"type",A),this._setBaseAttribute(p[x],"keys",v)),this._wereSeriesKeysExplicitlySet()||this.set("seriesKeys",v,{src:"internal"}),p},_getDefaultAxisPosition:function(t,i,s){var r=this.get("direction"),n=e.Array.indexOf(i,t);return i[n-1]&&i[n-1].position&&("horizontal"===r?"left"===i[n-1].position?s="right":"right"===i[n-1].position&&(s="left"):s="bottom"===i[n-1].position?"top":"bottom"),s},getSeriesItems:function(e,t){var i,s,r=e.get("xAxis"),n=e.get("yAxis"),a=e.get("xKey"),o=e.get("yKey");return"vertical"===this.get("direction")?(i={axis:n,key:o,value:n.getKeyValueAt(o,t)},s={axis:r,key:a,value:r.getKeyValueAt(a,t)}):(s={axis:n,key:o,value:n.getKeyValueAt(o,t)},i={axis:r,key:a,value:r.getKeyValueAt(a,t)}),i.displayName=e.get("categoryDisplayName"),s.displayName=e.get("valueDisplayName"),i.value=i.axis.getKeyValueAt(i.key,t),s.value=s.axis.getKeyValueAt(s.key,t),{category:i,value:s}},_sizeChanged:function(){if(this._axesCollection){for(var e=this._axesCollection,t=0,i=e.length;t<i;++t)this._addToAxesRenderQueue(e[t]);this._redraw()}},_getTopOverflow:function(e,t,i){var s,r,n=0,a=0;if(e)for(s=e.length;n<s;++n)r=e[n],a=Math.max(a,Math.abs(r.getMaxLabelBounds().top)-r.getEdgeOffset(r.get("styles").majorTicks.count,i));if(t)for(n=0,s=t.length;n<s;++n)r=t[n],a=Math.max(a,Math.abs(r.getMaxLabelBounds().top)-r.getEdgeOffset(r.get("styles").majorTicks.count,i));return a},_getRightOverflow:function(e,t,i){var s,r,n=0,a=0
;if(e)for(s=e.length;n<s;++n)r=e[n],a=Math.max(a,r.getMaxLabelBounds().right-r.getEdgeOffset(r.get("styles").majorTicks.count,i));if(t)for(n=0,s=t.length;n<s;++n)r=t[n],a=Math.max(a,r.getMaxLabelBounds().right-r.getEdgeOffset(r.get("styles").majorTicks.count,i));return a},_getLeftOverflow:function(e,t,i){var s,r,n=0,a=0;if(e)for(s=e.length;n<s;++n)r=e[n],a=Math.max(a,Math.abs(r.getMinLabelBounds().left)-r.getEdgeOffset(r.get("styles").majorTicks.count,i));if(t)for(n=0,s=t.length;n<s;++n)r=t[n],a=Math.max(a,Math.abs(r.getMinLabelBounds().left)-r.getEdgeOffset(r.get("styles").majorTicks.count,i));return a},_getBottomOverflow:function(e,t,i){var s,r,n=0,a=0;if(e)for(s=e.length;n<s;++n)r=e[n],a=Math.max(a,r.getMinLabelBounds().bottom-r.getEdgeOffset(r.get("styles").majorTicks.count,i));if(t)for(n=0,s=t.length;n<s;++n)r=t[n],a=Math.max(a,r.getMinLabelBounds().bottom-r.getEdgeOffset(r.get("styles").majorTicks.count,i));return a},_redraw:function(){if(this._drawing)this._callLater=!0;else{this._drawing=!0,this._callLater=!1;var e,t,i,s,r,n,a,o,h,l,g,d,c,u,p,y=this.get("width"),f=this.get("height"),_=0,x=0,v=0,m=0,b=this.get("leftAxesCollection"),A=this.get("rightAxesCollection"),S=this.get("topAxesCollection"),w=this.get("bottomAxesCollection"),C=0,k="visible",T=this.get("graph"),B=this.get("allowContentOverflow"),O={};if(b)for(c=[],C=(e=b.length)-1;C>-1;--C)c.unshift(_),_+=b[C].get("width");if(A)for(d=[],C=0,C=(e=A.length)-1;C>-1;--C)x+=A[C].get("width"),d.unshift(y-x);if(S)for(u=[],C=(e=S.length)-1;C>-1;--C)u.unshift(v),v+=S[C].get("height");if(w)for(p=[],C=(e=w.length)-1;C>-1;--C)m+=w[C].get("height"),p.unshift(f-m);if(y-(_+x),f-(m+v),O.left=_,O.top=v,O.bottom=f-m,O.right=y-x,!B){if(i=this._getTopOverflow(b,A),s=this._getBottomOverflow(b,A),r=this._getLeftOverflow(w,S),n=this._getRightOverflow(w,S),(g=i-v)>0&&(O.top=i,u))for(C=0,e=u.length;C<e;++C)u[C]+=g;if((g=s-m)>0&&(O.bottom=f-s,p))for(C=0,e=p.length;C<e;++C)p[C]-=g;if((g=r-_)>0&&(O.left=r,c))for(C=0,e=c.length;C<e;++C)c[C]+=g;if((g=n-x)>0&&(O.right=y-n,d))for(C=0,e=d.length;C<e;++C)d[C]-=g}if(a=O.right-O.left,o=O.bottom-O.top,h=O.left,l=O.top,S){for(e=S.length,C=0;C<e;C++)(t=S[C]).get("width")!==a&&t.set("width",a),t.get("boundingBox").setStyle("left",h+"px"),t.get("boundingBox").setStyle("top",u[C]+"px");t._hasDataOverflow()&&(k="hidden")}if(w){for(e=w.length,C=0;C<e;C++)(t=w[C]).get("width")!==a&&t.set("width",a),t.get("boundingBox").setStyle("left",h+"px"),t.get("boundingBox").setStyle("top",p[C]+"px");t._hasDataOverflow()&&(k="hidden")}if(b){for(e=b.length,C=0;C<e;++C)(t=b[C]).get("boundingBox").setStyle("top",l+"px"),t.get("boundingBox").setStyle("left",c[C]+"px"),t.get("height")!==o&&t.set("height",o);t._hasDataOverflow()&&(k="hidden")}if(A){for(e=A.length,C=0;C<e;++C)(t=A[C]).get("boundingBox").setStyle("top",l+"px"),t.get("boundingBox").setStyle("left",d[C]+"px"),t.get("height")!==o&&t.set("height",o);t._hasDataOverflow()&&(k="hidden")}this._drawing=!1,this._callLater?this._redraw():(T&&(T.get("boundingBox").setStyle("left",h+"px"),T.get("boundingBox").setStyle("top",l+"px"),T.set("width",a),T.set("height",o),T.get("boundingBox").setStyle("overflow",k)),this._overlay&&(this._overlay.setStyle("left",h+"px"),this._overlay.setStyle("top",l+"px"),this._overlay.setStyle("width",a+"px"),this._overlay.setStyle("height",o+"px")))}},destructor:function(){var t,i=this.get("graph"),s=0,r=this.get("seriesCollection"),n=this._axesCollection,a=this.get("tooltip").node;for(this._description&&(this._description.empty(),this._description.remove(!0)),this._liveRegion&&(this._liveRegion.empty(),this._liveRegion.remove(!0)),t=r?r.length:0;s<t;++s)r[s]instanceof e.CartesianSeries&&r[s].destroy(!0);for(t=n?n.length:0,s=0;s<t;++s)n[s]instanceof e.Axis&&n[s].destroy(!0);i&&i.destroy(!0),a&&(a.empty(),a.remove(!0)),this._overlay&&(this._overlay.empty(),this._overlay.remove(!0))},_getAriaMessage:function(e){var t,i,s,r,n,a="",o=this._seriesIndex,h=this._itemIndex,l=this.get("seriesCollection").length;return e%2==0?(l>1?(38===e?o=o<1?l-1:o-1:40===e&&(o=o>=l-1?0:o+1),this._itemIndex=-1):o=0,this._seriesIndex=o,a=(t=this.getSeries(parseInt(o,10))).get("valueDisplayName")+" series."):(o>-1?(a="",t=this.getSeries(parseInt(o,10))):(o=0,this._seriesIndex=o,a=(t=this.getSeries(parseInt(o,10))).get("valueDisplayName")+" series."),n=t._dataLength?t._dataLength:0,37===e?h=h>0?h-1:n-1:39===e&&(h=h>=n-1?0:h+1),this._itemIndex=h,s=(i=this.getSeriesItems(t,h)).category,r=i.value,s&&r&&s.value&&r.value?(a+=s.displayName+": "+s.axis.formatLabel.apply(this,[s.value,s.axis.get("labelFormat")])+", ",a+=r.displayName+": "+r.axis.formatLabel.apply(this,[r.value,r.axis.get("labelFormat")])+", "):a+="No data available.",a+=h+1+" of "+n+". "),a}},{ATTRS:{allowContentOverflow:{value:!1},axesStyles:{lazyAdd:!1,getter:function(){var t,i=this.get("axes"),s=this._axesStyles;if(i)for(t in i)i.hasOwnProperty(t)&&i[t]instanceof e.Axis&&(s||(s={}),s[t]=i[t].get("styles"));return s},setter:function(e){var t,i=this.get("axes");for(t in e)e.hasOwnProperty(t)&&i.hasOwnProperty(t)&&this._setBaseAttribute(i[t],"styles",e[t]);return e}},seriesStyles:{lazyAdd:!1,getter:function(){var e,t,i=this._seriesStyles,s=this.get("graph");if(s&&(e=s.get("seriesDictionary")))for(t in i={},e)e.hasOwnProperty(t)&&(i[t]=e[t].get("styles"));return i},setter:function(e){var t,i,s;if(n.isArray(e))for(s=this.get("seriesCollection"),t=0,i=e.length;t<i;++t)this._setBaseAttribute(s[t],"styles",e[t]);else for(t in e)e.hasOwnProperty(t)&&(s=this.getSeries(t),this._setBaseAttribute(s,"styles",e[t]));return e}},graphStyles:{lazyAdd:!1,getter:function(){var e=this.get("graph");return e?e.get("styles"):this._graphStyles},setter:function(e){var t=this.get("graph");return this._setBaseAttribute(t,"styles",e),e}},styles:{lazyAdd:!1,getter:function(){return{axes:this.get("axesStyles"),series:this.get("seriesStyles"),graph:this.get("graphStyles")}},setter:function(e){
e.hasOwnProperty("axes")&&(this.get("axesStyles")?this.set("axesStyles",e.axes):this._axesStyles=e.axes),e.hasOwnProperty("series")&&(this.get("seriesStyles")?this.set("seriesStyles",e.series):this._seriesStyles=e.series),e.hasOwnProperty("graph")&&this.set("graphStyles",e.graph)}},axes:{lazyAdd:!1,valueFn:"_getDefaultAxes",setter:function(e){return this.get("dataProvider")&&(e=this._setAxes(e)),e}},seriesCollection:{lazyAdd:!1,valueFn:"_getDefaultSeriesCollection",setter:function(e){return this.get("dataProvider")?this._parseSeriesCollection(e):e}},leftAxesCollection:{},bottomAxesCollection:{},rightAxesCollection:{},topAxesCollection:{},stacked:{value:!1},direction:{getter:function(){var e=this.get("type");return"bar"===e?"vertical":"column"===e?"horizontal":this._direction},setter:function(e){return this._direction=e,this._direction}},showAreaFill:{},showMarkers:{},showLines:{},categoryAxisName:{},valueAxisName:{value:"values"},horizontalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("horizontalGridlines"):this._horizontalGridlines},setter:function(e){var t=this.get("graph");e&&!n.isObject(e)&&(e={}),t?t.set("horizontalGridlines",e):this._horizontalGridlines=e}},verticalGridlines:{getter:function(){var e=this.get("graph");return e?e.get("verticalGridlines"):this._verticalGridlines},setter:function(e){var t=this.get("graph");e&&!n.isObject(e)&&(e={}),t?t.set("verticalGridlines",e):this._verticalGridlines=e}},type:{getter:function(){return this.get("stacked")?"stacked"+this._type:this._type},setter:function(e){return"bar"===this._type?"bar"!==e&&this.set("direction","horizontal"):"bar"===e&&this.set("direction","vertical"),this._type=e,this._type}},categoryAxis:{}}}),e.PieChart=e.Base.create("pieChart",e.Widget,[e.ChartBase],{_getSeriesCollection:function(){if(this._seriesCollection)return this._seriesCollection;var e,t,i,s=this.get("axes"),r=[],n=0,a=this.get("type");if(s)for(e=s.values.get("keyCollection"),i=s.category.get("keyCollection")[0],t=e.length;n<t;++n)r[n]={type:a},r[n].categoryAxis="category",r[n].valueAxis="values",r[n].categoryKey=i,r[n].valueKey=e[n];return this._seriesCollection=r,r},_parseAxes:function(t){this._axes||(this._axes={});var i,s,r,n,a,o,h=this.get("type"),l=this.get("width"),g=this.get("height"),d=e.Node.one(this._parentNode);for(i in l||(this.set("width",d.get("offsetWidth")),l=this.get("width")),g||(this.set("height",d.get("offsetHeight")),g=this.get("height")),t)t.hasOwnProperty(i)&&(n=t[i],s="pie"===h?"none":n.position,o=this._getAxisClass(n.type),a={dataProvider:this.get("dataProvider")},n.hasOwnProperty("roundingUnit")&&(a.roundingUnit=n.roundingUnit),a.keys=n.keys,a.width=l,a.height=g,a.position=s,a.styles=n.styles,(r=new o(a)).on("axisRendered",e.bind(this._itemRendered,this)),this._axes[i]=r)},_addAxes:function(){var e,t,i,s=this.get("axes");for(e in s||(this.set("axes",this._getDefaultAxes()),s=this.get("axes")),this._axesCollection||(this._axesCollection=[]),s)s.hasOwnProperty(e)&&(i=(t=s[e]).get("position"),this.get(i+"AxesCollection")?this.get(i+"AxesCollection").push(t):this.set(i+"AxesCollection",[t]),this._axesCollection.push(t))},_addSeries:function(){var e=this.get("graph"),t=this.get("seriesCollection");this._parseSeriesAxes(t),e.set("showBackground",!1),e.set("width",this.get("width")),e.set("height",this.get("height")),e.set("seriesCollection",t),this._seriesCollection=e.get("seriesCollection"),e.render(this.get("contentBox"))},_parseSeriesAxes:function(t){for(var i,s,r=0,n=t.length,a=this.get("axes");r<n;++r)if(i=t[r]){if(i instanceof e.PieSeries){!(s=i.get("categoryAxis"))||s instanceof e.Axis||i.set("categoryAxis",a[s]),!(s=i.get("valueAxis"))||s instanceof e.Axis||i.set("valueAxis",a[s]);continue}i.categoryAxis=a.category,i.valueAxis=a.values,i.type||(i.type=this.get("type"))}},_getDefaultAxes:function(){var e=this.get("categoryKey");return{values:{keys:this.get("seriesKeys").concat(),type:"numeric"},category:{keys:[e],type:this.get("categoryType")}}},getSeriesItems:function(e,t){var i={axis:e.get("categoryAxis"),key:e.get("categoryKey"),displayName:e.get("categoryDisplayName")},s={axis:e.get("valueAxis"),key:e.get("valueKey"),displayName:e.get("valueDisplayName")};return i.value=i.axis.getKeyValueAt(i.key,t),s.value=s.axis.getKeyValueAt(s.key,t),{category:i,value:s}},_sizeChanged:function(){this._redraw()},_redraw:function(){var e,t=this.get("graph"),i=this.get("width"),s=this.get("height");t&&(e=Math.min(i,s),t.set("width",e),t.set("height",e))},_tooltipLabelFunction:function(e,t,i,s){var n=r.createElement("div"),a=s.getTotalValues(),o=Math.round(t.value/a*1e4)/100;return n.appendChild(r.createTextNode(e.displayName+": "+e.axis.get("labelFunction").apply(this,[e.value,e.axis.get("labelFormat")]))),n.appendChild(r.createElement("br")),n.appendChild(r.createTextNode(t.displayName+": "+t.axis.get("labelFunction").apply(this,[t.value,t.axis.get("labelFormat")]))),n.appendChild(r.createElement("br")),n.appendChild(r.createTextNode(o+"%")),n},_getAriaMessage:function(e){var t,i,s,r,n,a,o,h,l="",g=this._itemIndex;return n=(h=(s=this.getSeries(parseInt(0,10))).get("markers"))&&h.length?h.length:0,37===e?g=g>0?g-1:n-1:39===e&&(g=g>=n-1?0:g+1),this._itemIndex=g,t=(i=this.getSeriesItems(s,g)).category,r=i.value,a=s.getTotalValues(),o=Math.round(r.value/a*1e4)/100,t&&r?(l+=t.displayName+": "+t.axis.formatLabel.apply(this,[t.value,t.axis.get("labelFormat")])+", ",l+=r.displayName+": "+r.axis.formatLabel.apply(this,[r.value,r.axis.get("labelFormat")])+", ",l+="Percent of total "+r.displayName+": "+o+"%,"):l+="No data available,",l+=g+1+" of "+n+". "},destructor:function(){for(var t,i=this.get("tooltip").node,s=this.get("graph"),r=this._axesCollection,n=this.get("seriesCollection");n.length>0;)n.shift().destroy(!0);for(;r.length>0;)(t=r.shift())instanceof e.Axis&&t.destroy(!0);this._description&&(this._description.empty(),this._description.remove(!0)),this._liveRegion&&(this._liveRegion.empty(),this._liveRegion.remove(!0)),
s&&s.destroy(!0),i&&(i.empty(),i.remove(!0))}},{ATTRS:{ariaDescription:{value:"Use the left and right keys to navigate through items.",setter:function(e){return this._description&&this._description.set("text",e),e}},axes:{getter:function(){return this._axes},setter:function(e){this._parseAxes(e)}},seriesCollection:{lazyAdd:!1,getter:function(){return this._getSeriesCollection()},setter:function(e){return this._setSeriesCollection(e)}},type:{value:"pie"}}}),e.Chart=function(t){return"pie"!==t.type?new e.CartesianChart(t):new e.PieChart(t)}},"@VERSION@",{requires:["dom","event-mouseenter","event-touch","graphics-group","axes","series-pie","series-line","series-marker","series-area","series-spline","series-column","series-bar","series-areaspline","series-combo","series-combospline","series-line-stacked","series-marker-stacked","series-area-stacked","series-spline-stacked","series-column-stacked","series-bar-stacked","series-areaspline-stacked","series-combo-stacked","series-combospline-stacked"]});