/*
    *
    * Wijmo Library 5.20181.436
    * http://wijmo.com/
    *
    * Copyright(c) GrapeCity, Inc.  All rights reserved.
    *
    * Licensed under the GrapeCity Commercial License.
    * sales@wijmo.com
    * wijmo.com/products/wijmo-5/license/
    *
    */
var __extends=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function n(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();define(["require","exports","wijmo/wijmo","wijmo/wijmo.chart"],function(t,e,i,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n||e;window.wijmo=window.wijmo||{},window.wijmo.chart=r;var s=function(){return function(t,e){void 0===t&&(t=0),void 0===e&&(e=0),this.x=t,this.y=e}}();e.DataPoint=s;var a=function(t){function e(e){var i=t.call(this)||this;return i._engine=e,i}return __extends(e,t),Object.defineProperty(e.prototype,"engine",{get:function(){return this._engine},enumerable:!0,configurable:!0}),e}(i.CancelEventArgs);e.RenderEventArgs=a;var o=function(t){function e(e,i,n){var r=t.call(this,e)||this;return r._index=i,r._count=n,r}return __extends(e,t),Object.defineProperty(e.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this._count},enumerable:!0,configurable:!0}),e}(a);e.SeriesRenderingEventArgs=o;var h;!function(t){t[t.Png=0]="Png",t[t.Jpeg=1]="Jpeg",t[t.Svg=2]="Svg"}(h=e.ImageFormat||(e.ImageFormat={}));var l=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._palette=null,e._selectionMode=m.None,e._defPalette=q.standard,e._notifyCurrentChanged=!0,e._legendHost=null,e._needBind=!1,e.rendering=new i.Event,e.rendered=new i.Event,e.selectionChanged=new i.Event,e}return __extends(e,t),Object.defineProperty(e.prototype,"itemsSource",{get:function(){return this._items},set:function(t){this._items!=t&&(this._cv&&(this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this),this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this),this._cv=null),this._items=t,this._cv=i.asCollectionView(t),null!=this._cv&&(this._cv.currentChanged.addHandler(this._cvCurrentChanged,this),this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)),this._clearCachedValues(),this._bindChart())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"palette",{get:function(){return this._palette},set:function(t){t!=this._palette&&(this._palette=i.asArray(t),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"plotMargin",{get:function(){return this._plotMargin},set:function(t){t!=this._plotMargin&&(this._plotMargin=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"legend",{get:function(){return this._legend},set:function(t){t!=this._legend&&(this._legend=i.asType(t,H),null!=this._legend&&(this._legend._chart=this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"header",{get:function(){return this._header},set:function(t){t!=this._header&&(this._header=i.asString(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footer",{get:function(){return this._footer},set:function(t){t!=this._footer&&(this._footer=i.asString(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"headerStyle",{get:function(){return this._headerStyle},set:function(t){t!=this._headerStyle&&(this._headerStyle=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"footerStyle",{get:function(){return this._footerStyle},set:function(t){t!=this._footerStyle&&(this._footerStyle=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionMode",{get:function(){return this._selectionMode},set:function(t){(t=i.asEnum(t,m))!=this._selectionMode&&(this._selectionMode=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){t!=this._itemFormatter&&(this._itemFormatter=i.asFunction(t),this.invalidate())},enumerable:!0,configurable:!0}),e.prototype.onRendered=function(t){this.rendered.raise(this,t)},e.prototype.onRendering=function(t){this.rendering.raise(this,t)},e.prototype.saveImageToFile=function(t){var e,i,n,r;t&&0!==t.length&&-1!==t.indexOf(".")||(t="image.png"),r=t.split("."),e=r[0].toLowerCase(),i=r[1].toLowerCase(),n=h[i[0].toUpperCase()+i.substring(1)],this.saveImageToDataUrl(n,function(t){c.downloadImage(t,e,i)})},e.prototype.saveImageToDataUrl=function(t,e){var n=i.asEnum(t,h,!1),r=h[n].toLowerCase();r&&r.length&&this._exportToImage(r,function(t){e.call(e,t)})},e.prototype._exportToImage=function(t,e){var n,r=new Image,s=this._currentRenderEngine.element;n=c.getDataUri(s),"svg"===t?e.call(null,n):(r.onload=function(){var n,a=document.createElement("canvas"),o=s.parentNode||s,h=i.getElementRect(o);a.width=h.width,a.height=h.height;var l=a.getContext("2d");l.fillStyle="#ffffff",l.fillRect(0,0,h.width,h.height);var u=window.getComputedStyle(o,null).getPropertyValue("padding-left").replace("px",""),c=window.getComputedStyle(o,null).getPropertyValue("padding-top").replace("px","");l.drawImage(r,+u||0,+c||0),n=a.toDataURL("image/"+t),e.call(null,n),a=null},r.src=n)},e.prototype.refresh=function(e){void 0===e&&(e=!0),t.prototype.refresh.call(this,e),this.isUpdating||this._refreshChart()},e.prototype.onSelectionChanged=function(t){this.selectionChanged.raise(this,t)},e.prototype.onLostFocus=function(e){this._tooltip&&this._tooltip.isVisible&&this._tooltip.hide(),t.prototype.onLostFocus.call(this,e)},e.prototype._cvCollectionChanged=function(t,e){this._clearCachedValues(),this._bindChart()},e.prototype._cvCurrentChanged=function(t,e){this._notifyCurrentChanged&&this._bindChart()},e.prototype._getColor=function(t){var e=this._defPalette;return null!=this._palette&&this._palette.length>0&&(e=this._palette),e[t%e.length]},e.prototype._getColorLight=function(t){var e=this._getColor(t);return this._getLightColor(e)},e.prototype._getLightColor=function(t){var e=new i.Color(t);return null!=e&&-1===t.indexOf("-")&&(1==e.a&&-1==t.indexOf("rgba")&&(e.a*=.7),t=e.toString()),t},e.prototype._bindChart=function(){this._needBind=!0,this.invalidate()},e.prototype._clearCachedValues=function(){},e.prototype._render=function(t,e){void 0===e&&(e=!0);this.hostElement;var n=this._getHostSize(),r=n.width,s=n.height;if(0!=r){if(isNaN(r)&&(r=S._WIDTH),(0==s||isNaN(s))&&(s=S._HEIGHT),t.beginRender(),r>0&&s>0){t.setViewportSize(r,s),this._rectChart=new i.Rect(0,0,r,s),this._prepareRender();var a=new i.Rect(0,0,r,s);this._chartRectId="chartRect"+(1e6*Math.random()).toFixed(),t.addClipRect(a,this._chartRectId),this._renderHeader(t,a),this._renderFooter(t,a),this._renderLegends(t,a),this._renderChart(t,a,e)}t.endRender()}},e.prototype._renderHeader=function(t,e){t.startGroup(S._CSS_HEADER,this._chartRectId),e=this._drawTitle(t,e,this.header,this.headerStyle,!1),t.endGroup()},e.prototype._renderFooter=function(t,e){t.startGroup(S._CSS_FOOTER,this._chartRectId),e=this._drawTitle(t,e,this.footer,this.footerStyle,!0),t.endGroup()},e.prototype._renderLegends=function(t,e){var n,r,s=this.legend,a=e.width,o=e.height,h=s._getPosition(a,o);switch(n=s._getDesiredSize(t,h,a,o),h){case M.Right:a-=n.width,r=new i.Point(a,e.top+.5*(o-n.height));break;case M.Left:e.left+=n.width,a-=n.width,r=new i.Point(0,e.top+.5*(o-n.height));break;case M.Top:o-=n.height,r=new i.Point(.5*(a-n.width),e.top),e.top+=n.height;break;case M.Bottom:o-=n.height,r=new i.Point(.5*(a-n.width),e.top+o)}e.width=a,e.height=o,n?(this._legendHost=t.startGroup(S._CSS_LEGEND,this._chartRectId),this._rectLegend=new i.Rect(r.x,r.y,n.width,n.height),this.legend._render(t,r,h,n.width,n.height),t.endGroup()):(this._legendHost=null,this._rectLegend=null)},e.prototype._prepareRender=function(){},e.prototype._renderChart=function(t,e,i){},e.prototype._performBind=function(){},e.prototype._getDesiredLegendSize=function(t,e,i,n){return null},e.prototype._renderLegend=function(t,e,i,n,r,s){},e.prototype._getHitTestItem=function(t){return null},e.prototype._getHitTestValue=function(t){return null},e.prototype._getHitTestLabel=function(t){return null},e.prototype._refreshChart=function(){this._needBind&&(this._needBind=!1,this._performBind()),this.hostElement&&this._render(this._currentRenderEngine)},e.prototype._drawTitle=function(t,e,n,r,s){var a=S._CSS_TITLE,o=s?S._CSS_FOOTER:S._CSS_HEADER,h=null;if(s?this._rectFooter=null:this._rectHeader=null,null!=n){var l=null,u=null,c=null,_=null;r&&(r.fontSize&&(l=r.fontSize),r.foreground&&(u=r.foreground),r.fill&&(u=r.fill),r.fontFamily&&(c=r.fontFamily),r.halign&&(_=r.halign)),t.fontSize=l,t.fontFamily=c,h=t.measureString(n,a,o,r),e.height-=h.height,u||(u=S._FG),t.textFill=u,s?("left"==_?S._renderText(t,n,new i.Point(e.left,e.bottom),0,0,a,o,r):"right"==_?S._renderText(t,n,new i.Point(e.left+e.width,e.bottom),2,0,a,o,r):S._renderText(t,n,new i.Point(e.left+.5*e.width,e.bottom),1,0,a,o,r),this._rectFooter=new i.Rect(e.left,e.bottom,e.width,h.height)):(this._rectHeader=new i.Rect(e.left,e.top,e.width,h.height),e.top+=h.height,"left"==_?S._renderText(t,n,new i.Point(e.left,0),0,0,a,o,r):"right"==_?S._renderText(t,n,new i.Point(e.left+e.width,0),2,0,a,o,r):S._renderText(t,n,new i.Point(e.left+.5*e.width,0),1,0,a,o,r)),t.textFill=null,t.fontSize=null,t.fontFamily=null}return e},e.prototype.pageToControl=function(t,e){return this._toControl(t,e)},e.prototype._toControl=function(t,e){i.isNumber(t)&&i.isNumber(e)?t=new i.Point(t,e):t instanceof MouseEvent&&(t=i.mouseToPage(t)),i.asType(t,i.Point);var n=t.clone(),r=this._getHostOffset();n.x-=r.x,n.y-=r.y;var s=this._getHostComputedStyle();if(s){var a=parseInt(s.paddingLeft.replace("px",""));a&&!isNaN(a)&&(n.x-=a);var o=parseInt(s.paddingTop.replace("px",""));o&&!isNaN(o)&&(n.y-=o)}return n},e.prototype._highlightItems=function(t,e,n){if(n)for(r=0;r<t.length;r++)i.addClass(t[r],e);else for(var r=0;r<t.length;r++)i.removeClass(t[r],e)},e.prototype._parseMargin=function(t){var e={};if(i.isNumber(t)&&!isNaN(t))e.top=e.bottom=e.left=e.right=i.asNumber(t);else if(i.isString(t)){var n=i.asString(t).split(" ",4),r=NaN,s=NaN,a=NaN,o=NaN;n&&(4==n.length?(r=parseFloat(n[0]),o=parseFloat(n[1]),s=parseFloat(n[2]),a=parseFloat(n[3])):2==n.length?(r=s=parseFloat(n[0]),a=o=parseFloat(n[1])):1==n.length&&(r=s=a=o=parseFloat(n[1])),isNaN(r)||(e.top=r),isNaN(s)||(e.bottom=s),isNaN(a)||(e.left=a),isNaN(o)||(e.right=o))}return e},e.prototype._showToolTip=function(t,e){var i=this,n=this._tooltip.showDelay;i._clearTimeouts(),n>0?i._toShow=setTimeout(function(){i._tooltip.show(i.hostElement,t,e),i._tooltip.hideDelay>0&&(i._toHide=setTimeout(function(){i._tooltip.hide()},i._tooltip.hideDelay))},n):(i._tooltip.show(i.hostElement,t,e),i._tooltip.hideDelay>0&&(i._toHide=setTimeout(function(){i._tooltip.hide()},i._tooltip.hideDelay)))},e.prototype._hideToolTip=function(){this._clearTimeouts(),this._tooltip.hide()},e.prototype._clearTimeouts=function(){this._toShow&&(clearTimeout(this._toShow),this._toShow=null),this._toHide&&(clearTimeout(this._toHide),this._toHide=null)},e.prototype._getHostOffset=function(){var t=i.getElementRect(this.hostElement);return new i.Point(t.left,t.top)},e.prototype._getHostSize=function(){var t=new i.Size,e=this.hostElement,n=this._getHostComputedStyle(),r=e.offsetWidth,s=e.offsetHeight;if(n){var a=parseFloat(n.paddingLeft.replace("px","")),o=parseFloat(n.paddingRight.replace("px","")),h=parseFloat(n.paddingTop.replace("px","")),l=parseFloat(n.paddingBottom.replace("px",""));isNaN(a)||(r-=a),isNaN(o)||(r-=o),isNaN(h)||(s-=h),isNaN(l)||(s-=l);var u=parseFloat(n.borderLeftWidth.replace("px","")),c=parseFloat(n.borderRightWidth.replace("px","")),_=parseFloat(n.borderTopWidth.replace("px","")),p=parseFloat(n.borderBottomWidth.replace("px",""));isNaN(u)||(r-=u),isNaN(c)||(r-=c),isNaN(_)||(s-=_),isNaN(p)||(s-=p),t.width=r,t.height=s}return t},e.prototype._getHostComputedStyle=function(){var t=this.hostElement;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(this.hostElement):null},e.prototype._find=function(t,e){for(var i=[],n=0;n<t.childElementCount;n++){var r=t.childNodes.item(n);if(e.indexOf(r.nodeName)>=0)i.push(r);else{var s=this._find(r,e);if(s.length>0)for(var a=0;a<s.length;a++)i.push(s[a])}}return i},e._WIDTH=300,e._HEIGHT=200,e._SELECTION_THRESHOLD=15,e}(i.Control);e.FlexChartBase=l;var u=function(){function t(){this._keys={},this._keys.seriesName=null,this._keys.pointIndex=null,this._keys.x=null,this._keys.y=null,this._keys.value=null,this._keys.name=null}return t.prototype.replace=function(t,e){var n=this;return i.format(t,{},function(t,i,r,s){return n.getValue(i,e,r)})},t.prototype.getValue=function(t,e,n){switch(t){case"seriesName":return e.series?e.series.name:"";case"pointIndex":return null!=e.pointIndex?e.pointIndex.toFixed():"";case"x":return n?i.Globalize.format(e.x,n):e._xfmt;case"y":return n?i.Globalize.format(e.y,n):e._yfmt;case"value":return n?i.Globalize.format(e.value,n):e.value;case"name":return e.name}return e.item&&(0==t.indexOf("item.")&&(t=t.substr(5)),t in e.item)?n?i.Globalize.format(e.item[t],n):e.item[t]:""},t}();e._KeyWords=u;var c=function(){function t(){}return t.downloadImage=function(t,e,n){var r=document.createElement("a"),s="image/"+n;if(navigator.msSaveOrOpenBlob){t=t.substring(t.indexOf(",")+1);var a,o,h,l=atob(t),u=[];for(a=0;a<l.length;a+=512){o=l.slice(a,a+512);for(var c=new Array(o.length),_=0;_<o.length;_++)c[_]=o.charCodeAt(_);var p=new Uint8Array(c);u.push(p)}h=new Blob(u,{type:s}),navigator.msSaveOrOpenBlob(h,e+"."+n)}else r.download=e+"."+n,r.href=t,document.body.appendChild(r),r.addEventListener("click",function(t){i.removeChild(r)}),r.click()},t.getDataUri=function(e){var n,r,s,a,o,h,l,u,c,_,p=document.createElement("div"),d=e.cloneNode(!0);return"svg"==e.tagName?(r=(n=i.getElementRect(e.parentNode||e)).width||0,s=n.height||0,a=e.viewBox.baseVal&&0!==e.viewBox.baseVal.width?e.viewBox.baseVal.width:r,o=e.viewBox.baseVal&&0!==e.viewBox.baseVal.height?e.viewBox.baseVal.height:s):(r=(h=e.getBBox()).x+h.width,s=h.y+h.height,d.setAttribute("transform",d.getAttribute("transform").replace(/translate\(.*?\)/,"")),a=r,o=s,(u=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(d),d=u),d.setAttribute("version","1.1"),d.setAttributeNS(t.xmlns,"xmlns","http://www.w3.org/2000/svg"),d.setAttributeNS(t.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink"),d.setAttribute("width",r),d.setAttribute("height",s),d.setAttribute("viewBox","0 0 "+a+" "+o),i.addClass(d,e.parentNode&&e.parentNode.getAttribute("class")||""),p.appendChild(d),l=t.getStyles(e),(c=document.createElement("style")).setAttribute("type","text/css"),c.innerHTML="<![CDATA[\n"+l+"\n]]>",(_=document.createElement("defs")).appendChild(c),d.insertBefore(_,d.firstChild),"data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(t.doctype+p.innerHTML)))},t.getStyles=function(t){var e="",i=document.styleSheets;return null==i||0===i.length?null:([].forEach.call(i,function(i){var n;try{if(null==i.cssRules||0===i.cssRules.length)return!0}catch(t){if("SecurityError"==t.name)return console.log("SecurityError. Can't read: "+i.href),!0}n=i.cssRules,[].forEach.call(n,function(i){var n,r=i.style;if(null==r)return!0;try{n=t.querySelector(i.selectorText)}catch(t){console.warn('Invalid CSS selector "'+i.selectorText+'"',t)}n?e+=i.selectorText+" { "+r.cssText+" }\n":i.cssText.match(/^@font-face/)&&(e+=i.cssText+"\n")})}),e)},t.doctype='<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">',t.xmlns="http://www.w3.org/2000/xmlns/",t}(),_=function(t){function e(e,n){var r=t.call(this,e,null,!0)||this;r._areas=[],r._keywords=new u,r._startAngle=0,r._innerRadius=0,r._offset=0,r._reversed=!1,r._isAnimated=!1,r._selectedItemPosition=M.None,r._selectedItemOffset=0,r._rotationAngle=0,r._center=new i.Point,r._selectedOffset=new i.Point,r._selectedIndex=-1,r._angles=[],r._colRowLens=[],r._values=[],r._labels=[],r._pels=[],r._sum=0,r.applyTemplate("wj-control wj-flexchart wj-flexpie",null,null),r._currentRenderEngine=new z(r.hostElement),r._legend=new H(r),r._tooltip=new x,r._tooltip.content="<b>{name}</b><br/>{value}",r._tooltip.showDelay=0,r._lbl=new et,r._lbl._chart=r;var s=r;return r.hostElement.addEventListener("mousemove",function(t){var e=s._tooltip;if(e.content&&!s.isTouching){var n=s.hitTest(t);if(n.distance<=e.threshold){var r=s._getLabelContent(n,s.tooltip.content);s._showToolTip(r,new i.Rect(t.clientX,t.clientY,5,5))}else s._hideToolTip()}}),r.hostElement.addEventListener("click",function(t){var e=!0;if(s.selectionMode!=m.None){var n=s.hitTest(t),r=S._SELECTION_THRESHOLD;s.tooltip&&s.tooltip.threshold&&(r=s.tooltip.threshold),n.distance<=r?(n.pointIndex!=s._selectionIndex&&s.selectedItemPosition!=M.None&&(e=!1),n.pointIndex!=s._selectionIndex&&s._select(n.pointIndex,!0)):s._selectedIndex>=0&&s._select(null)}if(e&&s.isTouching){var a=s._tooltip;if(a.content)if((n=s.hitTest(t)).distance<=a.threshold){var o=s._getLabelContent(n,s.tooltip.content);s._showToolTip(o,new i.Rect(t.clientX,t.clientY,5,5))}else s._hideToolTip()}}),r.hostElement.addEventListener("mouseleave",function(t){s._hideToolTip()}),r.initialize(n),r.refresh(),r}return __extends(e,t),Object.defineProperty(e.prototype,"binding",{get:function(){return this._binding},set:function(t){t!=this._binding&&(this._binding=i.asString(t,!0),this._bindChart())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bindingName",{get:function(){return this._bindingName},set:function(t){t!=this._bindingName&&(this._bindingName=i.asString(t,!0),this._bindChart())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"startAngle",{get:function(){return this._startAngle},set:function(t){t!=this._startAngle&&(this._startAngle=i.asNumber(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"offset",{get:function(){return this._offset},set:function(t){t!=this._offset&&(this._offset=i.asNumber(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"innerRadius",{get:function(){return this._innerRadius},set:function(t){t!=this._innerRadius&&(this._innerRadius=i.asNumber(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"reversed",{get:function(){return this._reversed},set:function(t){t!=this._reversed&&(this._reversed=i.asBoolean(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItemPosition",{get:function(){return this._selectedItemPosition},set:function(t){(t=i.asEnum(t,M,!0))!=this._selectedItemPosition&&(this._selectedItemPosition=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedItemOffset",{get:function(){return this._selectedItemOffset},set:function(t){t!=this._selectedItemOffset&&(this._selectedItemOffset=i.asNumber(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isAnimated",{get:function(){return this._isAnimated},set:function(t){t!=this._isAnimated&&(this._isAnimated=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){t!=this._lbl&&(this._lbl=t,this._lbl&&(this._lbl._chart=this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){if(t!=this._selectedIndex){var e=i.asNumber(t,!0);this._select(e,!0)}},enumerable:!0,configurable:!0}),e.prototype._getLabelsForLegend=function(){return this._labels},e.prototype.hitTest=function(t,e){var i=this._toControl(t,e),n=new U(this,i),r=null;if(S._contains(this._rectHeader,i))n._chartElement=W.Header;else if(S._contains(this._rectFooter,i))n._chartElement=W.Footer;else if(S._contains(this._rectLegend,i))n._chartElement=W.Legend,null!==(r=this.legend._hitTest(i))&&r>=0&&r<this._areas.length&&n._setData(null,r);else if(S._contains(this._rectChart,i)){for(var s,a=this._areas.length,o=NaN,h=0;h<a;h++){var l=i.clone();if(0!=this._rotationAngle){var u=this._center.x,c=this._center.y,_=-u+l.x,p=-c+l.y,d=Math.sqrt(_*_+p*p),f=Math.atan2(p,_)-this._rotationAngle*Math.PI/180;l.x=u+d*Math.cos(f),l.y=c+d*Math.sin(f)}h==this._selectedIndex&&(l.x-=this._selectedOffset.x,l.y-=this._selectedOffset.y);var g=this._areas[h];if(g.contains(l)&&(n._setData(null,g.tag),n._dist=0,h!=this._selectedIndex))break;var m=g.distance(l);void 0!==m&&(isNaN(o)||m<o)&&(o=m,s=g)}0!==n._dist&&null!=s&&(n._setData(null,s.tag),n._dist=o),n._chartElement=W.ChartArea}else n._chartElement=W.None;return n},e.prototype._performBind=function(){if(this._initData(),this._cv){this._selectionIndex=this._cv.currentPosition;var t=this._cv.items;if(t)for(var e=t.length,i=0;i<e;i++){var n=t[i];this._sum+=Math.abs(this._getBindData(n,this._values,this._labels,this.binding,this.bindingName))}}},e.prototype._initData=function(){this._sum=0,this._values=[],this._labels=[]},e.prototype._getBindData=function(t,e,n,r,s){var a,o=0;r&&(a=t[r]);o=0;if(i.isNumber(a)?o=i.asNumber(a):a&&(o=parseFloat(a.toString())),!isNaN(o)&&isFinite(o)?e.push(o):(o=0,e.push(o)),s&&t){var h=t[s];h&&(h=h.toString()),n.push(h)}else n.push(o.toString());return o},e.prototype._render=function(e,i){void 0===i&&(i=!0),this._selectionAnimationID&&clearInterval(this._selectionAnimationID),t.prototype._render.call(this,e,i)},e.prototype._prepareRender=function(){this._areas=[]},e.prototype._renderChart=function(t,n,r){var s=this._rectChart.clone();new i.Size(s.width,s.height);this.onRendering(new a(t));var o=n.width,h=n.height;this._pieGroup=t.startGroup("wj-slice-group",null,!0);var l=this._parseMargin(this.plotMargin),u=this.dataLabel,c=u.content&&u.position==J.Outside,_=c?(i.isNumber(u.offset)?u.offset:0)+24:0;isNaN(l.left)&&(l.left=c?_:e._MARGIN),isNaN(l.right)&&(l.right=c?_:e._MARGIN),isNaN(l.top)&&(l.top=c?_:e._MARGIN),isNaN(l.bottom)&&(l.bottom=c?_:e._MARGIN),n.top+=l.top;h=n.height-(l.top+l.bottom);n.height=h>0?h:24,n.left+=l.left;o=n.width-(l.left+l.right);n.width=o>0?o:24,this._renderData(t,n,this._pieGroup),t.endGroup(),this._rotationAngle=0,this._highlightCurrent(),this.dataLabel.content&&this.dataLabel.position!=J.None&&this._renderLabels(t),this.onRendered(new a(t))},e.prototype._getDesiredLegendSize=function(t,e,n,r){var s=new i.Size,a=this,o=new i.Size(n,r),h=a._getLabelsForLegend(),l=h.length,u=0,c=0;this._colRowLens=[];for(var _=0;_<l;_++){var p=a._measureLegendItem(t,h[_]);e?(c+p.height>r&&(s.height=r,this._colRowLens.push(u),u=0,c=0),u<p.width&&(u=p.width),c+=p.height):(u+p.width>n&&(s.width=n,this._colRowLens.push(c),c=0,u=0),c<p.height&&(c=p.height),u+=p.width)}return e?(s.height<c&&(s.height=c),this._colRowLens.push(u),s.width=this._colRowLens.reduce(function(t,e){return t+e},0),s.width>o.width/2&&(s.width=o.width/2)):(s.width<u&&(s.width=u),this._colRowLens.push(c),s.height=this._colRowLens.reduce(function(t,e){return t+e},0),s.height>o.height/2&&(s.height=o.height/2)),s},e.prototype._renderLegend=function(t,e,n,r,s,a){for(var o=this,h=o._rectLegend,l=o._getLabelsForLegend(),u=l.length,c=0,_=e.clone(),p=0;p<u;p++){var d=o._measureLegendItem(t,l[p]);r?_.y+d.height>h.top+h.height+1&&(_.x+=this._colRowLens[c],c++,_.y=e.y):_.x+d.width>h.left+h.width+1&&(_.y+=this._colRowLens[c],c++,_.x=e.x);var f=new i.Rect(_.x,_.y,d.width,d.height);o._drawLegendItem(t,f,p,l[p]),n.push(f),r?_.y+=d.height:_.x+=d.width}},e.prototype._renderData=function(t,e,i){this._pels=[],this._angles=[];var n=this._sum,r=this.startAngle+180,s=this.innerRadius,a=this.offset;if(n>0){var o=r*Math.PI/180,h=e.left+.5*e.width,l=e.top+.5*e.height,u=Math.min(.5*e.width,.5*e.height);this._center.x=h,this._center.y=l;var c=Math.max(a,this.selectedItemOffset);c>0&&(a*=u/=1+c),this._radius=u;var _=s*u;this._renderPie(t,u,_,o,a),this._highlightCurrent()}},e.prototype._renderPie=function(t,e,i,n,r){this._renderSlices(t,this._values,this._sum,e,i,n,2*Math.PI,r)},e.prototype._getCenter=function(){return this._center},e.prototype._renderSlices=function(t,e,i,n,r,s,a,o){for(var h,l,u,c=e.length,_=s,p=1==this.reversed,d=this._center,f=1===c?360:359.9/360,g=0;g<c;g++){l=d.x,u=d.y,h=t.startGroup("wj-slice"),t.fill=this._getColorLight(g),t.stroke=this._getColor(g);var m=Math.abs(e[g]),y=Math.abs(m-i)<1e-10?a:a*m/i;y=Math.min(y,a*f);var b=p?_-.5*y:_+.5*y;o>0&&y<a&&(l+=o*Math.cos(b),u+=o*Math.sin(b)),this._renderSlice(t,l,u,b,g,n,r,_,y,a),p?_-=y:_+=y,t.endGroup(),this._pels.push(h)}},e.prototype._renderSlice=function(t,e,n,r,s,a,o,h,l,u){var c=this,_=!!this.reversed;if(this._angles.push(r),this.itemFormatter){var p=new U(this,new i.Point(e+a*Math.cos(r),n+a*Math.sin(r)),W.SeriesSymbol);p._setData(null,s),this.itemFormatter(t,p,function(){c._drawSlice(t,s,_,e,n,a,o,h,l)})}else this._drawSlice(t,s,_,e,n,a,o,h,l)},e.prototype._renderLabels=function(t){var e=this._areas.length,n=this.dataLabel,r=n.position,s="wj-data-label",a=this._rotationAngle,o=n.connectingLine,h=n.offset?n.offset:0;t.stroke="null",t.fill="transparent",t.strokeWidth=1,t.startGroup("wj-data-labels");for(var l=0;l<e;l++){var u=this._areas[l];if(u){var c=u.radius,_=u.langle+a,d=1,f=1;r==J.Center||r===J.Radial||r===J.Circular?c*=.5*(1+(u.innerRadius||0)/u.radius):((_=p.clampAngle(_))<=-170||_>=170?(d=2,f=1):_>=-100&&_<=-80?(d=1,f=2):_>=-10&&_<=10?(d=0,f=1):_>=80&&_<=100?(d=1,f=0):-180<_&&_<-90?(d=2,f=2):-90<=_&&_<0?(d=0,f=2):0<_&&_<90?(d=0,f=0):90<_&&_<180&&(d=2,f=0),r==J.Inside&&(d=2-d,f=2-f)),_*=Math.PI/180;var g=0,m=0,y=0;l==this._selectedIndex&&this.selectedItemOffset>0&&(y=this.selectedItemOffset),y>0&&(g=Math.cos(_)*y*this._radius,m=Math.sin(_)*y*this._radius);var b=c;r==J.Outside?b+=h:r==J.Inside&&(b-=h);var v=u.center.x,x=u.center.y,w=v-this._center.x,M=x-this._center.y;if(0!=this._rotationAngle){var T=Math.sqrt(w*w+M*M),P=Math.atan2(M,w)+this._rotationAngle*Math.PI/180;v=this._center.x+T*Math.cos(P),x=this._center.y+T*Math.sin(P)}var C=new i.Point(v+g+b*Math.cos(_),x+m+b*Math.sin(_));n.border&&r!=J.Center&&(0==d?C.x+=2:2==d&&(C.x-=2),0==f?C.y+=2:2==f&&(C.y-=2));var N=new U(this,C);N._setData(null,l);var A=this._getLabelContent(N,n.content),L=new Q(t,N,C,A);if(n.onRendering&&(n.onRendering(L)?(A=L.text,C=L.point):A=null),A){var k,E=180*Math.atan2(x-C.y,v-C.x)/Math.PI;if(E=(E+360)%360,r===J.Radial||r===J.Circular?(r===J.Radial?E>90&&E<270&&(E+=180):(E>180&&E<360&&(E+=180),E-=90),(k=S._renderRotatedText(t,A,C,d,f,C,E,s).getBBox()).left=k.x,k.top=k.y):k=S._renderText(t,A,C,d,f,s),n.border&&t.drawRect(k.left-2,k.top-2,k.width+4,k.height+4,"wj-data-label-border"),o){var I=new i.Point(u.center.x+g+c*Math.cos(_),u.center.y+m+c*Math.sin(_));t.drawLine(C.x,C.y,I.x,I.y,"wj-data-label-line")}}}}t.endGroup()},e.prototype._drawSlice=function(t,e,n,r,s,a,o,h,l){var u;n?o>0?(0!=l&&t.drawDonutSegment(r,s,a,o,h-l,l),(u=new f(new i.Point(r,s),a,o,h-l,l,this.startAngle)).tag=e,this._areas.push(u)):(0!=l&&t.drawPieSegment(r,s,a,h-l,l),(u=new d(new i.Point(r,s),a,h-l,l,this.startAngle)).tag=e,this._areas.push(u)):(o>0?(0!=l&&t.drawDonutSegment(r,s,a,o,h,l),(u=new f(new i.Point(r,s),a,o,h,l,this.startAngle)).tag=e,this._areas.push(u)):(0!=l&&t.drawPieSegment(r,s,a,h,l),(u=new d(new i.Point(r,s),a,h,l,this.startAngle)).tag=e,this._areas.push(u)),h+=l)},e.prototype._measureLegendItem=function(t,e){var n=new i.Size;if(n.width=B._LEGEND_ITEM_WIDTH,n.height=B._LEGEND_ITEM_HEIGHT,e){var r=t.measureString(e,S._CSS_LABEL,S._CSS_LEGEND);n.width+=r.width,n.height<r.height&&(n.height=r.height)}return n.width+=3*B._LEGEND_ITEM_MARGIN,n.height+=2*B._LEGEND_ITEM_MARGIN,n},e.prototype._drawLegendItem=function(t,e,n,r){t.strokeWidth=1;var s=B._LEGEND_ITEM_MARGIN,a=null,o=null;null===a&&(a=this._getColorLight(n)),null===o&&(o=this._getColor(n)),t.fill=a,t.stroke=o;var h=e.top+.5*e.height,l=B._LEGEND_ITEM_WIDTH,u=B._LEGEND_ITEM_HEIGHT;t.drawRect(e.left+s,h-.5*u,l,u,null),null!=r&&S._renderText(t,r.toString(),new i.Point(e.left+u+2*s,h),0,1,S._CSS_LABEL)},e.prototype._getLabelContent=function(t,e){return i.isString(e)?this._keywords.replace(e,t):i.isFunction(e)?e(t):null},e.prototype._select=function(t,e){if(void 0===e&&(e=!1),this._highlight(!1,this._selectionIndex),this._selectionIndex=t,this.selectionMode==m.Point){var i=this._cv;i&&(this._notifyCurrentChanged=!1,i.moveCurrentToPosition(t),this._notifyCurrentChanged=!0)}!this.isAnimated&&(this.selectedItemOffset>0||this.selectedItemPosition!=M.None)?(this._selectedIndex=null==t?-1:t,this.invalidate()):this._highlight(!0,this._selectionIndex,e),this.onSelectionChanged()},e.prototype._highlightCurrent=function(){if(this.selectionMode!=m.None){var t=-1,e=this._cv;e&&(t=e.currentPosition),this._highlight(!0,t)}},e.prototype._highlight=function(t,e,i){if(void 0===i&&(i=!1),this.selectionMode==m.Point&&void 0!==e&&null!==e&&e>=0){var n=this._pels[e];if(t){if(n){n.parentNode.appendChild(n);var r=this._find(n,["ellipse"]);this._highlightItems(this._find(n,["path","ellipse"]),S._CSS_SELECTION,t)}var s=this._angles[e];if(this.selectedItemPosition!=M.None&&0!=s){var a=0;this.selectedItemPosition==M.Left?a=180:this.selectedItemPosition==M.Top?a=-90:this.selectedItemPosition==M.Bottom&&(a=90);var o=a*Math.PI/180-s;o*=180/Math.PI,i&&this.isAnimated?this._animateSelectionAngle(o,.5):(this._rotationAngle=o,this._pieGroup.transform.baseVal.getItem(0).setRotate(o,this._center.x,this._center.y))}var h=this.selectedItemOffset;if(h>0&&r&&0==r.length){var l=this._selectedOffset.x=Math.cos(s)*h*this._radius,u=this._selectedOffset.y=Math.sin(s)*h*this._radius;n&&n.setAttribute("transform","translate("+l.toFixed()+","+u.toFixed()+")")}this._selectedIndex=e}else n&&(n.parentNode.insertBefore(n,n.parentNode.childNodes.item(e)),n.removeAttribute("transform"),this._highlightItems(this._find(n,["path","ellipse"]),S._CSS_SELECTION,t)),this._selectedIndex==e&&(this._selectedIndex=-1)}},e.prototype._animateSelectionAngle=function(t,e){var n=p.clampAngle(this._rotationAngle),r=(t=p.clampAngle(t))-n,s=this,a=n,o=s._pieGroup;s._selectionAnimationID&&clearInterval(this._selectionAnimationID),this._selectionAnimationID=i.animate(function(t){o==s._pieGroup&&(s._rotationAngle=n=a+r*t,s._pieGroup.transform.baseVal.getItem(0).setRotate(n,s._center.x,s._center.y),1==t&&clearInterval(s._selectionAnimationID),t>.99&&(s.selectedItemOffset>0||s.selectedItemPosition!=M.None)&&s.invalidate())},1e3*e)},e.prototype._getHitTestItem=function(t){var e=null,i=null;return(e=null!=this._cv?this._cv.items:this.itemsSource)&&t<e.length&&(i=e[t]),i},e.prototype._getHitTestValue=function(t){return this._values[t]},e.prototype._getHitTestLabel=function(t){return this._labels[t]},e._MARGIN=4,e}(l);e.FlexPie=_;var p=function(){function t(){}return t.clampAngle=function(t,e){void 0===e&&(e=0);var i=(t+180)%360-180;return i<-180+(e<0?e+360:e)&&(i+=360),i},t}(),d=function(){function t(t,e,i,n,r){void 0===r&&(r=0),this._isFull=!1,this._center=t,this._radius=e,this._originAngle=i,this._originSweep=n,n>=2*Math.PI&&(this._isFull=!0),this._sweep=.5*n*180/Math.PI,this._angle=p.clampAngle(180*i/Math.PI+this._sweep),this._radius2=e*e,this._startAngle=r}return t.prototype.contains=function(t){var e=t.x-this._center.x,i=t.y-this._center.y;if(e*e+i*i<=this._radius2){var n=180*Math.atan2(i,e)/Math.PI,r=p.clampAngle(this._angle,this._startAngle)-p.clampAngle(n,this._startAngle);if(this._isFull||Math.abs(r)<=this._sweep)return!0}return!1},t.prototype.distance=function(t){if(this.contains(t))return 0;var e=t.x-this._center.x,i=t.y-this._center.y,n=e*e+i*i,r=180*Math.atan2(i,e)/Math.PI,s=p.clampAngle(this._angle,this._startAngle)-p.clampAngle(r,this._startAngle);return this._isFull||Math.abs(s)<=this._sweep?Math.sqrt(n)-this._radius:void 0},Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0}),t}();e._PieSegment=d;var f=function(){function t(t,e,i,n,r,s){void 0===s&&(s=0),this._isFull=!1,this._center=t,this._radius=e,this._iradius=i,this._originAngle=n,this._originSweep=r,r>=2*Math.PI&&(this._isFull=!0),this._sweep=.5*r*180/Math.PI,this._angle=p.clampAngle(180*n/Math.PI+this._sweep),this._radius2=e*e,this._iradius2=i*i,this._startAngle=s}return t.prototype.contains=function(t){var e=t.x-this._center.x,i=t.y-this._center.y,n=e*e+i*i;if(n>=this._iradius2&&n<=this._radius2){var r=180*Math.atan2(i,e)/Math.PI,s=p.clampAngle(this._angle,this._startAngle)-p.clampAngle(r,this._startAngle);if(this._isFull||Math.abs(s)<=this._sweep)return!0}return!1},t.prototype.distance=function(t){if(this.contains(t))return 0},Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"innerRadius",{get:function(){return this._iradius},enumerable:!0,configurable:!0}),t}();e._DonutSegment=f;var g;!function(t){t[t.None=0]="None",t[t.Stacked=1]="Stacked",t[t.Stacked100pc=2]="Stacked100pc"}(g=e.Stacking||(e.Stacking={}));var m;!function(t){t[t.None=0]="None",t[t.Series=1]="Series",t[t.Point=2]="Point"}(m=e.SelectionMode||(e.SelectionMode={}));var y=function(t){function e(e,n){var r=t.call(this,e,null,!0)||this;r._series=new i.ObservableArray,r._axes=new A,r._pareas=new D,r._interpolateNulls=!1,r._legendToggle=!1,r._symbolSize=10,r._dataInfo=new v,r.__barPlotter=null,r.__linePlotter=null,r.__areaPlotter=null,r.__bubblePlotter=null,r.__financePlotter=null,r.__funnelPlotter=null,r._plotters=[],r._rotated=!1,r._stacking=g.None,r._xlabels=[],r._xvals=[],r._lblAreas=[],r._colRowLens=[],r._bindingSeparator=",",r.seriesVisibilityChanged=new i.Event,r.applyTemplate("wj-control wj-flexchart",null,null);var s=r;return s._series.collectionChanged.addHandler(function(){for(var t=s._series,e=0;e<t.length;e++){var n=i.tryCast(t[e],Y);if(!n)throw"chartSeries array must contain SeriesBase objects.";n._chart=s,n.axisX&&(n.axisX._chart=s),n.axisY&&(n.axisY._chart=s)}s.invalidate()}),r._currentRenderEngine=new z(r.hostElement),r._hitTester=new pt(r),r._legend=new H(r),r._tooltip=new x,r._tooltip.showDelay=0,r._lbl=new tt,r._lbl._chart=r,r._initAxes(),s._axes.collectionChanged.addHandler(function(){for(var t=s._axes,e=0;e<t.length;e++){var n=i.tryCast(t[e],N);if(!n)throw"axes array must contain Axis objects.";n._chart=s}s.invalidate()}),s._pareas.collectionChanged.addHandler(function(){for(var t=s._pareas,e=0;e<t.length;e++){var n=i.tryCast(t[e],I);if(!n)throw"plotAreas array must contain PlotArea objects.";n._chart=s}s.invalidate()}),r._keywords=new u,r.hostElement.addEventListener("click",function(t){var e=s._tooltip;if(e.content&&s.isTouching){var n=s.hitTest(t);if(n.distance<=e.threshold){var r=s._getLabelContent(n,s._tooltip.content);s._showToolTip(r,new i.Rect(t.clientX,t.clientY,5,5))}else s._hideToolTip()}}),r.hostElement.addEventListener("mousemove",function(t){var e=s._tooltip;if(e.content&&!s.isTouching){var n=s.hitTest(t);if(n.distance<=e.threshold){var r=s._getLabelContent(n,s._tooltip.content);s._showToolTip(r,new i.Rect(t.clientX,t.clientY,5,5))}else s._hideToolTip()}}),r.hostElement.addEventListener("mouseleave",function(t){s._hideToolTip()}),r.hostElement.addEventListener("click",function(t){if(s.selectionMode!=m.None){var e=s._hitTestData(t),i=S._SELECTION_THRESHOLD;s.tooltip&&s.tooltip.threshold&&(i=s.tooltip.threshold),e.distance<=i&&e.series?s._select(e.series,e.pointIndex):s.selectionMode==m.Series&&(e=s.hitTest(t)).chartElement==W.Legend&&e.series?s._select(e.series,null):s._select(null,null)}!0===s.legendToggle&&(e=s.hitTest(t)).chartElement==W.Legend&&e.series&&(e.series.visibility==R.Legend?e.series.visibility=R.Visible:e.series.visibility==R.Visible&&(e.series.visibility=R.Legend),s.focus())}),r.initialize(n),r}return __extends(e,t),e.prototype._initAxes=function(){this._axisX=new N(M.Bottom),this._axisY=new N(M.Left),this._axisX.majorGrid=!1,this._axisX.name="axisX",this._axisY.majorGrid=!0,this._axisY.majorTickMarks=C.None,this._axisY.name="axisY",this._axisX._chart=this,this._axisY._chart=this,this._axes.push(this._axisX),this._axes.push(this._axisY)},Object.defineProperty(e.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){var e=this._axisX=i.asType(t,N);this.beginUpdate(),e&&(void 0===e.majorGrid&&(e.majorGrid=!1),void 0===e.name&&(e.name="axisX"),void 0==e.position&&(e.position=M.Bottom),e._axisType=T.X,e._chart=this),this.endUpdate()}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){var e=this._axisY=i.asType(t,N);this.beginUpdate(),e&&(void 0===e.majorGrid&&(e.majorGrid=!0),void 0===e.name&&(e.name="axisY"),e.majorTickMarks=C.None,void 0==e.position&&(e.position=M.Left),e._axisType=T.Y,e._chart=this),this.endUpdate()}},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"plotAreas",{get:function(){return this._pareas},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"binding",{get:function(){return this._binding},set:function(t){t!=this._binding&&(this._binding=i.asString(t,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"bindingX",{get:function(){return this._bindingX},set:function(t){t!=this._bindingX&&(this._bindingX=i.asString(t,!0),this._bindChart())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){t!=this._symbolSize&&(this._symbolSize=i.asNumber(t,!1,!0),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"interpolateNulls",{get:function(){return this._interpolateNulls},set:function(t){t!=this._interpolateNulls&&(this._interpolateNulls=i.asBoolean(t),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"legendToggle",{get:function(){return this._legendToggle},set:function(t){t!=this._legendToggle&&(this._legendToggle=i.asBoolean(t))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){t!=this._lbl&&(this._lbl=i.asType(t,tt),this._lbl&&(this._lbl._chart=this))},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selection",{get:function(){return this._selection},set:function(t){t!=this._selection&&(this._selection=i.asType(t,Y,!0),this.invalidate())},enumerable:!0,configurable:!0}),e.prototype.onSeriesVisibilityChanged=function(t){this.seriesVisibilityChanged.raise(this,t)},e.prototype.hitTest=function(t,e){var i=this._toControl(t,e),n=new U(this,i),r=null;if(S._contains(this._rectHeader,i))n._chartElement=W.Header;else if(S._contains(this._rectFooter,i))n._chartElement=W.Footer;else if(S._contains(this._rectLegend,i))n._chartElement=W.Legend,null!==(r=this.legend._hitTest(i))&&r>=0&&r<this.series.length&&(this._getChartType()===w.Bar?n._setData(this.series[this.series.length-1-r]):n._setData(this.series[r]));else if(S._contains(this._rectChart,i)){var s=this._hitTestLabels(i);if(s)n._chartElement=W.DataLabel,n._dist=0,n._setDataPoint(s.tag);else{for(var a=this._hitTester.hitTest(i),o=null,h=null,l=this.series.length-1;l>=0;l--)if(this.series[l].hitTest!==B.prototype.hitTest){var u=this.series[l].hitTest(t);if(u&&((!o||u.distance<o.distance)&&(o=u,h=l),0===u.distance))break}a&&a.area?o&&o.distance<a.distance?n=o:o&&o.distance==a.distance&&h>a.area.tag.seriesIndex?n=o:(n._setDataPoint(a.area.tag),n._dist=a.distance):o&&(n=o),S._contains(this.axisX._axrect,i)?n._chartElement=W.AxisX:S._contains(this.axisY._axrect,i)?n._chartElement=W.AxisY:S._contains(this._plotRect,i)?n._chartElement=W.PlotArea:S._contains(this._rectChart,i)&&(n._chartElement=W.ChartArea)}}else n._chartElement=W.None;return n},e.prototype.pointToData=function(t,e){return i.isNumber(t)&&i.isNumber(e)&&(t=new i.Point(t,e)),t instanceof MouseEvent?(t=new i.Point(t.pageX,t.pageY),t=this._toControl(t)):t=t.clone(),t.x=this.axisX.convertBack(t.x),t.y=this.axisY.convertBack(t.y),t},e.prototype.dataToPoint=function(t,e){i.isNumber(t)&&i.isNumber(e)&&(t=new i.Point(t,e)),i.asType(t,i.Point);var n=t.clone();return n.x=this.axisX.convert(n.x),n.y=this.axisY.convert(n.y),n},e.prototype._copy=function(t,e){if("series"==t){this.series.clear();for(var n=i.asArray(e),r=0;r<n.length;r++){var s=this._createSeries();i.copy(s,n[r]),this.series.push(s)}return!0}return!1},e.prototype._createSeries=function(){return new B},e.prototype._clearCachedValues=function(){for(var t=0;t<this._series.length;t++){var e=this._series[t];null==e.itemsSource&&e._clearValues()}},e.prototype._performBind=function(){if(this._xDataType=null,this._xlabels.splice(0),this._xvals.splice(0),this._cv){var t=this._cv.items;if(t){for(var e=t.length,n=0;n<e;n++){var r=t[n];if(this._bindingX){var s=r[this._bindingX];i.isNumber(s)?(this._xvals.push(i.asNumber(s)),this._xDataType=i.DataType.Number):i.isDate(s)&&(this._xvals.push(i.asDate(s).valueOf()),this._xDataType=i.DataType.Date),this._xlabels.push(r[this._bindingX])}}this._xvals.length==e?this._xlabels.splice(0):this._xvals.splice(0)}}},e.prototype._hitTestSeries=function(t,e){var i=this._toControl(t),n=new U(this,i),r=this._hitTester.hitTestSeries(i,e);return r&&r.area&&(n._setDataPoint(r.area.tag),n._chartElement=W.PlotArea,n._dist=r.distance),n},e.prototype._hitTestData=function(t){var e=this._toControl(t),i=new U(this,e),n=this._hitTester.hitTest(e,!0);return n&&n.area&&(i._setDataPoint(n.area.tag),i._dist=n.distance),i},e.prototype._hitTestLabels=function(t){for(var e=null,i=this._lblAreas.length,n=0;n<i;n++)if(this._lblAreas[n].contains(t)){e=this._lblAreas[n];break}return e},e._dist2=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n},e._dist=function(t,e,i){return Math.sqrt(S._distToSegmentSquared(t,e,i))},e._distToSegmentSquared=function(t,e,n){var r=S._dist2(e,n);if(0==r)return S._dist2(t,e);var s=((t.x-e.x)*(n.x-e.x)+(t.y-e.y)*(n.y-e.y))/r;return s<0?S._dist2(t,e):s>1?S._dist2(t,n):S._dist2(t,new i.Point(e.x+s*(n.x-e.x),e.y+s*(n.y-e.y)))},e.prototype._isRotated=function(){return this._getChartType()==w.Bar?!this._rotated:this._rotated},e.prototype._getChartType=function(){return null},e.prototype._prepareRender=function(){this._hitTester.clear()},e.prototype._renderChart=function(t,e,n){var r=this._rectChart.clone(),s=new i.Size(r.width,r.height);e.width,e.height;(y=this._getPlotter(null)).stacking=this._stacking,this._curPlotter!=y&&(this._curPlotter&&this._curPlotter.unload(),this._curPlotter=y),y.load();var o=this._isRotated();this._dataInfo.analyse(this._series,o,y.stacking,this._xvals.length>0?this._xvals:null,this.axisX.logBase>0,this.axisY.logBase>0);var h=y.adjustLimits(this._dataInfo,e.clone());if(o){var l=this._dataInfo.getDataTypeX();l||(l=this._xDataType),this.axisX._updateActualLimits(this._dataInfo.getDataTypeY(),h.left,h.right),this.axisY._updateActualLimits(l,h.top,h.bottom,this._xlabels,this._xvals)}else{var u=this._dataInfo.getDataTypeX();u||(u=this._xDataType),this.axisX._updateActualLimits(u,h.left,h.right,this._xlabels,this._xvals),this.axisY._updateActualLimits(this._dataInfo.getDataTypeY(),h.top,h.bottom)}var c=this._getAxes();if(this._updateAuxAxes(c,o),this._layout(e,s,t),t.startGroup(S._CSS_PLOT_AREA),t.fill="transparent",t.stroke=null,this.plotAreas.length>0)for(f=0;f<this.plotAreas.length;f++)this.plotAreas[f]._render(t);else{var _=this._plotRect;t.drawRect(_.left,_.top,_.width,_.height)}t.endGroup();var p=this._series.length;this._clearPlotters();for(var d={},f=0;f<p;f++){var g=this._series[f];if(((P=g.visibility)==R.Visible||P==R.Plot)&&g.getValues(0)){var m=g._getAxisY(),y=this._getPlotter(g);if(!m||m==this.axisY||y instanceof ft)y.seriesCount++;else{var b=m._uniqueId;d[b]?d[b].count+=1:d[b]={count:1,index:0}}}}if(this.onRendering(new a(t)),this._getChartType()!==w.Funnel)for(f=0;f<c.length;f++){var v=c[f];M=v.axisType==T.X?t.startGroup(S._CSS_AXIS_X,this._chartRectId):t.startGroup(S._CSS_AXIS_Y,this._chartRectId),v._hostElement=n?M:v._hostElement,v._render(t),t.endGroup()}t.startGroup("wj-series-group"),this._plotrectId="plotRect"+(1e6*Math.random()).toFixed(),t.addClipRect(this._plotRect,this._plotrectId);for(f=0;f<p;f++){var x=this._series[f];x._pointIndexes=[];y=this._getPlotter(x);x._plotter=y;var M=t.startGroup(x.cssClass,y.clipping?this._plotrectId:null);x._hostElement=n?M:x._hostElement;var P=x.visibility,C=x.axisX,N=x.axisY;if(C||(C=this.axisX),N||(N=this.axisY),P==R.Visible||P==R.Plot){var A,L,k=d[N._uniqueId];k?(A=k.index,L=k.count,k.index++,x.onRendering(t,A,L)||y.plotSeries(t,C,N,x,this,A,L)):(A=y.seriesIndex,L=y.seriesCount,y.seriesIndex++,x.onRendering(t,A,L)||y.plotSeries(t,C,N,x,this,A,L)),x.onRendered(t)}t.endGroup()}t.endGroup(),this._lblAreas=[],this.dataLabel.content&&this.dataLabel.position!=Z.None&&this._renderLabels(t),this._highlightCurrent(),this.onRendered(new a(t))},e.prototype._getDesiredLegendSize=function(t,e,n,r){var s=new i.Size,a=this.series,o=a.length,h=0,l=0;this._colRowLens=[];for(var u=0;u<o;u++){var c=i.tryCast(a[u],Y),_=c.visibility;if(c.name&&_!=R.Hidden&&_!=R.Plot)for(var p=c.legendItemLength(),d=0;d<p;d++){var f=c.measureLegendItem(t,d);e?(h+f.height>r&&(s.height=r,this._colRowLens.push(l),l=0,h=0),l<f.width&&(l=f.width),h+=f.height):(l+f.width>n&&(s.width=n,this._colRowLens.push(h),h=0,l=0),h<f.height&&(h=f.height),l+=f.width)}}return e?(s.height<h&&(s.height=h),this._colRowLens.push(l),s.width=this._colRowLens.reduce(function(t,e){return t+e},0),s.width>n/2&&(s.width=n/2)):(s.width<l&&(s.width=l),this._colRowLens.push(h),s.height=this._colRowLens.reduce(function(t,e){return t+e},0),s.height>r/2&&(s.height=r/2)),s},e.prototype._renderLegend=function(t,e,n,r,s,a){var o,h=this.series,l=h.length,u=e.clone(),c=0;if(this._getChartType()===w.Bar)for(_=l-1;_>=0;_--)o=i.tryCast(h[_],Y),c=this._renderLegendElements(t,o,e,u,n,r,s,a,c);else for(var _=0;_<l;_++)o=i.tryCast(h[_],Y),c=this._renderLegendElements(t,o,e,u,n,r,s,a,c)},e.prototype._renderLegendElements=function(t,e,n,r,s,a,o,h,l){var u=this._rectLegend,c=l;if(!e)return c;var _=e.visibility;if(!e.name||_==R.Hidden||_==R.Plot)return e._legendElement=null,s.push(null),c;var p=e.legendItemLength(),d=t.startGroup(e.cssClass);_==R.Legend?(d.setAttribute("opacity","0.5"),e._legendElement=d):_==R.Visible?e._legendElement=d:e._legendElement=null;for(var f=0;f<p;f++){var g=e.measureLegendItem(t,f);a?r.y+g.height>u.top+u.height+1&&(r.x+=this._colRowLens[c],c++,r.y=n.y):r.x+g.width>u.left+u.width+1&&(r.y+=this._colRowLens[c],c++,r.x=n.x);var m=new i.Rect(r.x,r.y,g.width,g.height);_!=R.Legend&&_!=R.Visible||e.drawLegendItem(t,m,f),s.push(m),a?r.y+=g.height:r.x+=g.width}return t.endGroup(),c},e.prototype._renderLabels=function(t){var i=this.series,n=i.length;t.stroke="null",t.fill="transparent",t.strokeWidth=1;var r=e._CSS_DATA_LABELS;t.startGroup(r);for(var s=0;s<n;s++){var a=i[s],o=this._hitTester._map[s];o&&a._renderLabels(t,o,this,this._lblAreas)}t.endGroup()},e.prototype._getAxes=function(){for(var t=[this.axisX,this.axisY],e=this.series.length,i=0;i<e;i++){var n=this.series[i],r=n.axisX;r&&-1===t.indexOf(r)&&t.push(r);var s=n.axisY;s&&-1===t.indexOf(s)&&t.push(s)}return t},e.prototype._clearPlotters=function(){for(var t=this._plotters.length,e=0;e<t;e++)this._plotters[e].clear()},e.prototype._initPlotter=function(t){t.chart=this,t.dataInfo=this._dataInfo,t.hitTester=this._hitTester,this._plotters.push(t)},Object.defineProperty(e.prototype,"_barPlotter",{get:function(){return null===this.__barPlotter&&(this.__barPlotter=new ft,this._initPlotter(this.__barPlotter)),this.__barPlotter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_linePlotter",{get:function(){return null===this.__linePlotter&&(this.__linePlotter=new gt,this._initPlotter(this.__linePlotter)),this.__linePlotter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_areaPlotter",{get:function(){return null===this.__areaPlotter&&(this.__areaPlotter=new mt,this._initPlotter(this.__areaPlotter)),this.__areaPlotter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_bubblePlotter",{get:function(){return null===this.__bubblePlotter&&(this.__bubblePlotter=new yt,this._initPlotter(this.__bubblePlotter)),this.__bubblePlotter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_financePlotter",{get:function(){return null===this.__financePlotter&&(this.__financePlotter=new bt,this._initPlotter(this.__financePlotter)),this.__financePlotter},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"_funnelPlotter",{get:function(){return null===this.__funnelPlotter&&(this.__funnelPlotter=new vt,this._initPlotter(this.__funnelPlotter)),this.__funnelPlotter},enumerable:!0,configurable:!0}),e.prototype._getPlotter=function(t){var e=this._getChartType(),i=!1;if(t){var n=t._getChartType();null!==n&&void 0!==n&&n!=e&&(e=n,i=!0)}var r;switch(e){case w.Column:this._barPlotter.isVolume=!1,this._barPlotter.width=.7,r=this._barPlotter;break;case w.Bar:this._barPlotter.rotated=!this._rotated,this._barPlotter.isVolume=!1,this._barPlotter.width=.7,r=this._barPlotter;break;case w.Line:this._linePlotter.hasSymbols=!1,this._linePlotter.hasLines=!0,this._linePlotter.isSpline=!1,r=this._linePlotter;break;case w.Scatter:this._linePlotter.hasSymbols=!0,this._linePlotter.hasLines=!1,this._linePlotter.isSpline=!1,r=this._linePlotter;break;case w.LineSymbols:this._linePlotter.hasSymbols=!0,this._linePlotter.hasLines=!0,this._linePlotter.isSpline=!1,r=this._linePlotter;break;case w.Area:this._areaPlotter.isSpline=!1,r=this._areaPlotter;break;case w.Bubble:r=this._bubblePlotter;break;case w.Candlestick:(s=this._financePlotter).isCandle=!0,s.isEqui=!1,s.isArms=!1,s.isVolume=!1,r=s;break;case w.HighLowOpenClose:var s=this._financePlotter;s.isCandle=!1,s.isEqui=!1,s.isArms=!1,s.isVolume=!1,r=s;break;case w.Spline:this._linePlotter.hasSymbols=!1,this._linePlotter.hasLines=!0,this._linePlotter.isSpline=!0,r=this._linePlotter;break;case w.SplineSymbols:this._linePlotter.hasSymbols=!0,this._linePlotter.hasLines=!0,this._linePlotter.isSpline=!0,r=this._linePlotter;break;case w.SplineArea:this._areaPlotter.isSpline=!0,r=this._areaPlotter;break;case w.Funnel:r=this._funnelPlotter;break;default:throw"Invalid chart type."}return r.rotated=this._rotated,e==w.Bar&&(r.rotated=!r.rotated),i&&(r.rotated=this._isRotated()),r},e.prototype._layout=function(t,e,i){this.plotAreas.length>0?this._layoutMultiple(t,e,i):this._layoutSingle(t,e,i)},e.prototype._layoutSingle=function(t,e,n){for(var r=t.width,s=t.height,a=new i.Size(r,.75*s),o=new i.Size(s,.75*r),h=0,l=0,u=r,c=s,_=0,p=0,d=r,f=s,g=this._getAxes(),m=0;m<g.length;m++){var y=(P=g[m]).origin,b=P._getPosition();if(P.axisType==T.X){(w=P._getHeight(n,r))>a.height&&(w=a.height),P._desiredSize=new i.Size(a.width,w);var v=P._hasOrigin=i.isNumber(y)&&y>this.axisY._getMinNum()&&y<this.axisY._getMaxNum(),x=Math.min(.25*r,P._annoSize.width);if(b==M.Bottom)if(h=Math.max(h,.5*x),u=Math.min(u,r-.5*x),v){N=this._convertY(y,p,f);f-=Math.max(0,N+w-f)}else f-=w;else if(b==M.Top)if(h=Math.max(h,.5*x),u=Math.min(u,r-.5*x),v){N=this._convertY(y,p,f);p+=Math.max(0,p-(N-w))}else p+=w}else if(P.axisType==T.Y){var w=P._getHeight(n,s);w>o.height&&(w=o.height),P._desiredSize=new i.Size(o.width,w);v=P._hasOrigin=i.isNumber(y)&&y>this.axisX._getMinNum()&&y<this.axisX._getMaxNum();if(b==M.Left)if(P._actualAngle<0?c=Math.min(c,s-P._annoSize.height):P._actualAngle>0?l=Math.max(l,P._annoSize.height):(l=Math.max(l,P._annoSize.height),c=Math.min(c,s-P._annoSize.height)),v){L=this._convertX(y,_,d);_+=Math.max(0,_-(L-w))}else _+=w;else if(b==M.Right)if(P._actualAngle>0?c=Math.min(c,s-P._annoSize.height):P._actualAngle<0?l=Math.max(l,P._annoSize.height):(l=Math.max(l,P._annoSize.height),c=Math.min(c,s-P._annoSize.height)),v){L=this._convertX(y,_,d);d-=Math.max(0,L+w-d)}else d-=w}}var S=this._parseMargin(this.plotMargin);h=_=isNaN(S.left)?Math.max(h,_)+t.left:S.left,u=d=isNaN(S.right)?Math.min(u,d)+t.left:e.width-S.right,l=p=isNaN(S.top)?Math.max(l,p)+t.top:S.top,c=f=isNaN(S.bottom)?Math.min(c,f)+t.top:e.height-S.bottom,r=Math.max(1,u-h),s=Math.max(1,c-l),this._plotRect=new i.Rect(h,l,r,s),n.stroke=null;for(m=0;m<g.length;m++){var P=g[m],y=P.origin,b=P._getPosition();if(P.axisType==T.X){var C;if(P._hasOrigin){var N=this._convertY(y,this._plotRect.top,this._plotRect.bottom);b==M.Bottom?(C=new i.Rect(h,N,r,P._desiredSize.height),f+=Math.max(0,C.bottom-this._plotRect.bottom)):b==M.Top?(C=new i.Rect(h,N-P._desiredSize.height,r,P._desiredSize.height),p-=Math.max(0,this._plotRect.top-C.top)):C=new i.Rect(h,N,r,1)}else b==M.Bottom?(C=new i.Rect(h,f,r,P._desiredSize.height),f+=P._desiredSize.height):b==M.Top?(C=new i.Rect(h,p-P._desiredSize.height,r,P._desiredSize.height),p-=P._desiredSize.height):C=new i.Rect(h,p,r,1);P._layout(C,this._plotRect)}else if(P.axisType==T.Y){var A;if(P._hasOrigin){var L=this._convertX(y,this._plotRect.left,this._plotRect.right);b==M.Left?(A=new i.Rect(L-P._desiredSize.height,l,s,P._desiredSize.height),_-=P._desiredSize.height):b==M.Right?(A=new i.Rect(L,l,s,P._desiredSize.height),d+=P._desiredSize.height):A=new i.Rect(L,l,s,1)}else b==M.Left?(A=new i.Rect(_-P._desiredSize.height,l,s,P._desiredSize.height),_-=P._desiredSize.height):b==M.Right?(A=new i.Rect(d,l,s,P._desiredSize.height),d+=P._desiredSize.height):A=new i.Rect(_,l,s,1);P._layout(A,this._plotRect)}}},e.prototype._layoutMultiple=function(t,e,n){for(var r=t.width,s=t.height,a=[],o=[],h=this._getAxes(),l=h.length,u=0;u<l;u++)if((C=h[u])._plotrect=null,C.axisType==T.X){for(var c=C.plotArea?C.plotArea.column:0;a.length<=c;)a.push(new b);a[c].axes.push(C)}else if(C.axisType==T.Y){for(var _=C.plotArea?C.plotArea.row:0;o.length<=_;)o.push(new b);o[_].axes.push(C)}for(var p=a.length,d=o.length,f=new i.Size(r,.3*s),g=new i.Size(s,.3*r),m=0,y=0,v=r,x=s,w=0;w<p;w++){(R=a[w]).right=r,R.bottom=s;for(u=0;u<R.axes.length;u++){var S=(C=R.axes[u])._getHeight(n,C.axisType==T.X?r:s);S>f.height&&(S=f.height);var P=new i.Size(f.width,S);C._desiredSize=P,0==w&&(R.left=Math.max(R.left,.5*C._annoSize.width)),w==p-1&&(R.right=Math.min(R.right,r-.5*C._annoSize.width)),(F=C._getPosition())==M.Bottom?R.bottom-=P.height:F==M.Top&&(R.top+=P.height)}}for(z=0;z<d;z++){(R=o[z]).right=r,R.bottom=s;for(u=0;u<R.axes.length;u++){var C=R.axes[u],N=new i.Size(g.width,C._getHeight(n,C.axisType==T.X?r:s));N.height>g.height&&(N.height=g.height),C._desiredSize=N,0==z&&(R.top=Math.max(R.top,.5*C._annoSize.width)),z==d-1&&(R.bottom=Math.min(R.bottom,s-.5*C._annoSize.width)),(F=C._getPosition())==M.Left?R.left+=N.height:F==M.Right&&(R.right-=N.height)}}for(var A=0,L=0,k=r,E=s,w=0;w<p;w++){R=a[w];A=Math.max(A,R.left),L=Math.max(L,R.top),k=Math.min(k,R.right),E=Math.min(E,R.bottom)}for(z=0;z<d;z++){R=o[z];A=Math.max(A,R.left),L=Math.max(L,R.top),k=Math.min(k,R.right),E=Math.min(E,R.bottom)}A=m=Math.max(m,A),k=v=Math.min(v,k),L=y=Math.max(y,L),E=x=Math.min(x,E),this._plotRect=new i.Rect(m,y,v-m,x-y);for(var I=this._plotRect.clone(),D=m,O=this.plotAreas._calculateWidths(this._plotRect.width,p),w=0;w<p;w++){E=x,L=y;for(var R=a[w],j=O[w],u=0;u<R.axes.length;u++){var V,F=(C=R.axes[u])._getPosition(),X=new i.Rect(D,I.top,j,I.height);F==M.Bottom?(V=new i.Rect(D,E,j,C._desiredSize.height),E+=C._desiredSize.height):F==M.Top&&(V=new i.Rect(D,L-C._desiredSize.height,j,C._desiredSize.height),L-=C._desiredSize.height),C._layout(V,X)}for(u=0;u<this.plotAreas.length;u++)(W=this.plotAreas[u]).column==w&&W._setPlotX(D,j);D+=j}for(var Y=y,B=this.plotAreas._calculateHeights(this._plotRect.height,d),z=0;z<d;z++){A=m,k=v;for(var R=o[z],G=B[z],u=0;u<R.axes.length;u++){var F=(C=R.axes[u])._getPosition(),X=new i.Rect(I.left,Y,I.width,G);C._plotrect?(X.left=C._plotrect.left,X.width=C._plotrect.width):O&&O.length>0&&(X.width=O[0]);var H;F==M.Left?(H=new i.Rect(A-C._desiredSize.height,Y,G,C._desiredSize.height),A-=C._desiredSize.height):F==M.Right&&(H=new i.Rect(k,Y,G,C._desiredSize.height),k+=C._desiredSize.height),C._layout(H,X)}for(u=0;u<this.plotAreas.length;u++){var W=this.plotAreas[u];W.row==z&&W._setPlotY(Y,G)}Y+=G}},e.prototype._convertX=function(t,e,i){var n=this.axisX;return n.reversed?i-(i-e)*(t-n._getMinNum())/(n._getMaxNum()-n._getMinNum()):e+(i-e)*(t-n._getMinNum())/(n._getMaxNum()-n._getMinNum())},e.prototype._convertY=function(t,e,i){var n=this.axisY;return n.reversed?e+(i-e)*(t-n._getMinNum())/(n._getMaxNum()-n._getMinNum()):i-(i-e)*(t-n._getMinNum())/(n._getMaxNum()-n._getMinNum())},e.prototype._getLabelContent=function(t,e){return i.isString(e)?this._keywords.replace(e,t):i.isFunction(e)?e(t):null},e.prototype._select=function(t,e){var i=!1;if(t==this._selection&&e==this._selectionIndex||(i=!0),this._selection&&this._highlight(this._selection,!1,this._selectionIndex),this._selection=t,this._selectionIndex=e,this._selection&&this._highlight(this._selection,!0,this._selectionIndex),this.selectionMode==m.Point){var n=t?t.collectionView:this._cv;n&&(this._notifyCurrentChanged=!1,n.moveCurrentToPosition(t?e:-1),this._notifyCurrentChanged=!0)}i&&this.onSelectionChanged()},e.prototype._highlightCurrent=function(){if(this.selectionMode!=m.None){var t=this._selection,e=-1;if(t){var i=t.collectionView;i||(i=this._cv),i&&(e=i.currentPosition),this._highlight(t,!0,e)}}},e.prototype._highlight=function(t,e,n){if(t=i.asType(t,Y,!0),this.selectionMode==m.Series){var r=this.series.indexOf(t),s=t.hostElement;e?s.parentNode.appendChild(s):s.parentNode.insertBefore(s,s.parentNode.childNodes.item(r));o=this._find(s,["rect","ellipse","polyline","polygon","line","path"]);this._highlightItems(o,S._CSS_SELECTION,e),t.legendElement&&this._highlightItems(this._find(t.legendElement,["rect","ellipse","line"]),S._CSS_SELECTION,e)}else if(this.selectionMode==m.Point){var r=this.series.indexOf(t),s=t.hostElement;if(e){s.parentNode.appendChild(s);var a=t.getPlotElement(n);if(a){"g"!=a.nodeName&&this._highlightItems([a],S._CSS_SELECTION,e);o=this._find(a,["line","rect","ellipse","path","polygon"]);this._highlightItems(o,S._CSS_SELECTION,e)}}else{s.parentNode.insertBefore(s,s.parentNode.childNodes.item(r));var o=this._find(s,["rect","ellipse","line","path","polygon"]);this._highlightItems(o,S._CSS_SELECTION,e)}}},e.prototype._updateAuxAxes=function(t,e){for(var n=2;n<t.length;n++){var r=t[n];r._chart=this;for(var s=[],a=0;a<this.series.length;a++){var o=this.series[a];o.axisX!=r&&o.axisY!=r||s.push(o)}for(var h,l,a=0;a<s.length;a++){var u=s[a].getDataRect()||s[a]._getDataRect();u&&(r.axisType==T.X&&!e||r.axisType==T.Y&&e?((void 0===h||u.left<h)&&(h=u.left),(void 0===l||u.right>l)&&(l=u.right)):((void 0===h||u.top<h)&&(h=u.top),(void 0===l||u.bottom>l)&&(l=u.bottom)))}var c=s[0].getDataType(0);null==c&&(c=i.DataType.Number),t[n]._updateActualLimits(c,h,l)}},e._contains=function(t,e){return!(!t||!e)&&(e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom)},e._intersects=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)},e._toOADate=function(t){return t.valueOf()},e._fromOADate=function(t){return new Date(t)},e._renderText=function(t,e,n,r,s,a,o,h,l){var u=t.measureString(e,a,o,h),c=n.x,_=n.y;switch(r){case 1:c-=.5*u.width;break;case 2:c-=u.width}switch(s){case 1:_+=.5*u.height;break;case 0:_+=u.height}var p=new i.Rect(c,_-u.height,u.width,u.height);return l?l(p)?(t.drawString(e,new i.Point(c,_),a,h),p):null:(t.drawString(e,new i.Point(c,_),a,h),p)},e._renderRotatedText=function(t,e,n,r,s,a,o,h,l,u){var c=t.measureString(e,h,l,u),_=n.x,p=n.y;switch(r){case 1:_-=.5*c.width;break;case 2:_-=c.width}switch(s){case 1:p+=.5*c.height;break;case 0:p+=c.height}return t.drawStringRotated(e,new i.Point(_,p),a,o,h,u)},e._CSS_AXIS_X="wj-axis-x",e._CSS_AXIS_Y="wj-axis-y",e._CSS_LINE="wj-line",e._CSS_GRIDLINE="wj-gridline",e._CSS_TICK="wj-tick",e._CSS_GRIDLINE_MINOR="wj-gridline-minor",e._CSS_TICK_MINOR="wj-tick-minor",e._CSS_LABEL="wj-label",e._CSS_LEGEND="wj-legend",e._CSS_HEADER="wj-header",e._CSS_FOOTER="wj-footer",e._CSS_TITLE="wj-title",e._CSS_SELECTION="wj-state-selected",e._CSS_PLOT_AREA="wj-plot-area",e._CSS_DATA_LABELS="wj-data-labels",e._FG="#666",e._epoch=new Date(1899,11,30).getTime(),e._msPerDay=864e5,e}(l);e.FlexChartCore=y;var b=function(){function t(){this._axes=new Array,this.left=0,this.right=0,this.top=0,this.bottom=0}return Object.defineProperty(t.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0}),t}(),v=function(){function t(){this.stackAbs={},this._xvals=null}return t.prototype.analyse=function(e,n,r,s,a,o){var h=this;this.minY=NaN,this.maxY=NaN,this.minX=NaN,this.maxX=NaN,this.minXp=NaN,this.minYp=NaN,this.dx=0;var l={},u={},c={};if(this.dataTypeX=null,this.dataTypeY=null,this._xvals=s,null!=s)for(var _=s.length,p=0;p<_;p++){N=s[p];if((isNaN(this.minX)||this.minX>N)&&(this.minX=N),(isNaN(this.maxX)||this.maxX<N)&&(this.maxX=N),N>0&&(isNaN(this.minXp)||this.minXp>N)&&(this.minXp=N),p>0){S=Math.abs(N-s[p-1]);!isNaN(S)&&(S<this.dx||0==this.dx)&&(this.dx=S)}}for(p=0;p<e.length;p++){var d=e[p],f=d._getChartType(),m=void 0!==d.chartType,y=d.visibility;if(y!=R.Hidden&&y!=R.Legend){var b,v=d.getDataRect();v&&(!isNaN(this.minX)&&this.minX<v.left&&(b=v.right,v.left=this.minX,v.width=b-this.minX),!isNaN(this.maxX)&&this.maxX>v.right&&(v.width=this.maxX-v.left),!isNaN(this.minY)&&this.minY<v.top&&(b=v.bottom,v.top=this.minY,v.height=b-this.minY),!isNaN(this.maxY)&&this.maxY>v.bottom&&(v.height=this.maxY-v.top));var x=null;if(n?d._isCustomAxisY()||(x=d.getValues(1)):d._isCustomAxisX()||(x=d.getValues(1)),x){this.dataTypeX||(this.dataTypeX=d.getDataType(1));for(P=0;P<x.length;P++){C=x[P];if(t.isValid(C)&&((isNaN(this.minX)||this.minX>C)&&(this.minX=C),(isNaN(this.maxX)||this.maxX<C)&&(this.maxX=C),P>0&&(!f||f==w.Column||f==w.Bar))){var S=Math.abs(C-x[P-1]);!isNaN(S)&&S>0&&(S<this.dx||0==this.dx)&&(this.dx=S)}}}var M=null,T=!1;if(n?(T=d._isCustomAxisX(),M=d.getValues(0)):(T=d._isCustomAxisY(),M=d.getValues(0)),M&&(this.dataTypeY||T||(this.dataTypeY=d.getDataType(0)),isNaN(this.minX)?this.minX=0:x||s||(this.minX=Math.min(this.minX,0)),isNaN(this.maxX)?this.maxX=M.length-1:x||s||(this.maxX=Math.max(this.maxX,M.length-1)),!T))for(var P=0;P<M.length;P++){var C=M[P],N=x?i.asNumber(x[P],!0):s?i.asNumber(s[P],!0):P;i.isArray(C)?C.forEach(function(t){h._parseYVal(t,N,m,c,l,u)}):this._parseYVal(C,N,m,c,l,u)}var A=d.getDataRect(new i.Rect(this.minX,this.minY,this.maxX-this.minX,this.maxY-this.minY),v);A&&(this.minX=A.left,this.maxX=A.right,this.minY=A.top,this.maxY=A.bottom)}}if(r==g.Stacked){for(var L in l)l[L]>this.maxY&&(this.maxY=l[L]);for(var L in u)u[L]<this.minY&&(this.minY=u[L])}else if(r==g.Stacked100pc){this.minY=0,this.maxY=1;for(var L in c){var k=c[L];if(isFinite(k)&&0!=k){var E=l[L],I=u[L];isFinite(E)&&(E=Math.min(E/k,this.maxY)),isFinite(I)&&(I=Math.max(I/k,this.minY))}}}this.stackAbs=c,a&&(n?this.minY=isNaN(this.minYp)?1:this.minYp:this.minX=isNaN(this.minXp)?1:this.minXp),o&&(n?this.minX=isNaN(this.minXp)?1:this.minXp:this.minY=isNaN(this.minYp)?1:this.minYp)},t.prototype._parseYVal=function(e,i,n,r,s,a){t.isValid(e)&&(null!=e&&(isNaN(this.minY)||this.minY>e)&&(this.minY=e),null!=e&&(isNaN(this.maxY)||this.maxY<e)&&(this.maxY=e),e>0&&(isNaN(this.minYp)||this.minYp>e)&&(this.minYp=e),n||(e>0?isNaN(s[i])?s[i]=e:s[i]+=e:isNaN(a[i])?a[i]=e:a[i]+=e,isNaN(r[i])?r[i]=Math.abs(e):r[i]+=Math.abs(e)))},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinXp=function(){return this.minXp},t.prototype.getMinYp=function(){return this.minYp},t.prototype.getDeltaX=function(){return this.dx},t.prototype.getDataTypeX=function(){return this.dataTypeX},t.prototype.getDataTypeY=function(){return this.dataTypeY},t.prototype.getStackedAbsSum=function(t){var e=this.stackAbs[t];return isFinite(e)?e:0},t.prototype.getXVals=function(){return this._xvals},t.isValid=function(t){return isFinite(t)},t}();e._DataInfo=v;var x=function(t){function e(){var e=t.call(this)||this;return e._content="<b>{seriesName}</b><br/>{x} {y}",e._threshold=15,e}return __extends(e,t),Object.defineProperty(e.prototype,"content",{get:function(){return this._content},set:function(t){t!=this._content&&(this._content=t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"threshold",{get:function(){return this._threshold},set:function(t){t!=this._threshold&&(this._threshold=i.asNumber(t))},enumerable:!0,configurable:!0}),e}(i.Tooltip);e.ChartTooltip=x;var w;!function(t){t[t.Column=0]="Column",t[t.Bar=1]="Bar",t[t.Scatter=2]="Scatter",t[t.Line=3]="Line",t[t.LineSymbols=4]="LineSymbols",t[t.Area=5]="Area",t[t.Bubble=6]="Bubble",t[t.Candlestick=7]="Candlestick",t[t.HighLowOpenClose=8]="HighLowOpenClose",t[t.Spline=9]="Spline",t[t.SplineSymbols=10]="SplineSymbols",t[t.SplineArea=11]="SplineArea",t[t.Funnel=12]="Funnel"}(w=e.ChartType||(e.ChartType={}));var S=function(t){function e(e,i){var n=t.call(this,e,null)||this;return n._chartType=w.Column,n.initialize(i),n}return __extends(e,t),e.prototype._getChartType=function(){return this._chartType},Object.defineProperty(e.prototype,"chartType",{get:function(){return this._chartType},set:function(t){(t=i.asEnum(t,w))!=this._chartType&&(this._chartType=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"rotated",{get:function(){return this._rotated},set:function(t){t!=this._rotated&&(this._rotated=i.asBoolean(t),this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"stacking",{get:function(){return this._stacking},set:function(t){(t=i.asEnum(t,g))!=this._stacking&&(this._stacking=t,this.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"options",{get:function(){return this._options},set:function(t){t!=this._options&&(this._options=t,this.invalidate())},enumerable:!0,configurable:!0}),e}(y);e.FlexChart=S;var M;!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Top=2]="Top",t[t.Right=3]="Right",t[t.Bottom=4]="Bottom",t[t.Auto=5]="Auto"}(M=e.Position||(e.Position={}));var T;!function(t){t[t.X=0]="X",t[t.Y=1]="Y"}(T=e.AxisType||(e.AxisType={}));var P;!function(t){t[t.Auto=0]="Auto",t[t.Show=1]="Show"}(P=e.OverlappingLabels||(e.OverlappingLabels={}));var C;!function(t){t[t.None=0]="None",t[t.Outside=1]="Outside",t[t.Inside=2]="Inside",t[t.Cross=3]="Cross"}(C=e.TickMark||(e.TickMark={}));var N=function(){function t(e){this._GRIDLINE_WIDTH=1,this._LINE_WIDTH=1,this._TICK_WIDTH=1,this._TICK_HEIGHT=4,this._TICK_OVERLAP=1,this._TICK_LABEL_DISTANCE=4,this._minorGrid=!1,this._labels=!0,this._axisLine=!0,this._isTimeAxis=!1,this._labelPadding=5,this.rangeChanged=new i.Event,this._customConvert=null,this._customConvertBack=null,this.__uniqueId=t._id++,this._position=e,e==M.Bottom||e==M.Top?this._axisType=T.X:(this._axisType=T.Y,this._axisLine=!1),this._minorTickMarks=C.None,this._overlap=P.Auto}return Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualMin",{get:function(){return this._isTimeAxis?new Date(this._actualMin):this._actualMin},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"actualMax",{get:function(){return this._isTimeAxis?new Date(this._actualMax):this._actualMax},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"min",{get:function(){return this._min},set:function(t){t!=this._min&&(i.isDate(t)?this._min=i.asDate(t,!0):this._min=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"max",{get:function(){return this._max},set:function(t){t!=this._max&&(i.isDate(t)?this._max=i.asDate(t,!0):this._max=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"reversed",{get:function(){return this._reversed},set:function(t){this._reversed!=t&&(this._reversed=i.asBoolean(t),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(t){(t=i.asEnum(t,M,!1))!=this._position&&(this._position=t,this._position==M.Bottom||this._position==M.Top?this._axisType=T.X:this._position!=M.Left&&this._position!=M.Right||(this._axisType=T.Y),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"majorUnit",{get:function(){return this._majorUnit},set:function(t){t!=this._majorUnit&&(this._majorUnit=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minorUnit",{get:function(){return this._minorUnit},set:function(t){t!=this._minorUnit&&(this._minorUnit=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=i.asString(t,!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(t){t!=this._title&&(this._title=i.asString(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this._format},set:function(t){t!=this._format&&(this._format=i.asString(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"majorGrid",{get:function(){return this._majorGrid},set:function(t){t!=this._majorGrid&&(this._majorGrid=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"majorTickMarks",{get:function(){return this._majorTickMarks},set:function(t){(t=i.asEnum(t,C,!0))!=this._majorTickMarks&&(this._majorTickMarks=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minorGrid",{get:function(){return this._minorGrid},set:function(t){t!=this._minorGrid&&(this._minorGrid=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"minorTickMarks",{get:function(){return this._minorTickMarks},set:function(t){(t=i.asEnum(t,C,!0))!=this._minorTickMarks&&(this._minorTickMarks=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"axisLine",{get:function(){return this._axisLine},set:function(t){t!=this._axisLine&&(this._axisLine=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labels",{get:function(){return this._labels},set:function(t){t!=this._labels&&(this._labels=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelAlign",{get:function(){return this._labelAlign},set:function(t){t!=this._labelAlign&&(this._labelAlign=i.asString(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelAngle",{get:function(){return this._labelAngle},set:function(t){t!=this._labelAngle&&(this._labelAngle=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"origin",{get:function(){return this._origin},set:function(t){t!=this._origin&&(this._origin=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"overlappingLabels",{get:function(){return this._overlap},set:function(t){(t=i.asEnum(t,P,!0))!=this._overlap&&(this._overlap=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsSource",{get:function(){return this._items},set:function(t){this._items!=t&&(this._cv&&(this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this),this._cv=null),this._items=t,this._cv=i.asCollectionView(t),null!=this._cv&&this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this._binding},set:function(t){t!=this._binding&&(this._binding=i.asString(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemFormatter",{get:function(){return this._ifmt},set:function(t){this._ifmt!=t&&(this._ifmt=i.asFunction(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"logBase",{get:function(){return this._logBase},set:function(t){t!=this._logBase&&(this._logBase=i.asNumber(t,!0,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"plotArea",{get:function(){return this._parea},set:function(t){t!=this._parea&&(this._parea=i.asType(t,I,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"labelPadding",{get:function(){return this._labelPadding},set:function(t){t!=this._labelPadding&&(this._labelPadding=i.asNumber(t,!0,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_groupClass",{get:function(){return this.axisType===T.X?y._CSS_AXIS_X:y._CSS_AXIS_Y},enumerable:!0,configurable:!0}),t.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)},t.prototype._getPosition=function(){if(this.axisType==T.X){if(this.position==M.Auto)return M.Bottom}else if(this.axisType==T.Y&&this.position==M.Auto)return M.Left;return this.position},t.prototype._isOverlapped=function(t,e,i,n){var r=this._lbls;if(null!=r&&r.length>1)for(var s=r.length,a=this._values&&this._values.length==s?this._values:null,o=0,h=0,l=0;l<s;l++){var u=a?a[l]:l;if(u>=this._actualMin&&u<=this._actualMax){var c=e*(u-this._actualMin)/(this._actualMax-this._actualMin),_=t.measureString(r[l],i,this._groupClass);if(this.axisType==T.X){if(l>0&&Math.abs(c-o)<Math.max(_.width,h)+12)return!0;o=c,h=_.width}else this.axisType,T.Y}}return!1},t.prototype._getHeight=function(t,e){this._actualAngle=null;var n=S._CSS_LABEL,r=S._CSS_TITLE,s=this._actualMax-this._actualMin,a=this._nicePrecision(s);(a<0||a>15)&&(a=0);var o=.1*s,h=this._lbls,l=this.labelAngle;if(this.labels&&this._chart._getChartType()!==w.Funnel){if(o=this._updateAutoFormat(o),null!=h&&h.length>0){var u=h.length,c=this._values&&this._values.length==u?this._values:null;this._annoSize=new i.Size;for(var _=0;_<u;_++){var p=c?c[_]:_;if(p>=this._actualMin&&p<=this._actualMax){f=t.measureString(h[_],n,this._groupClass);this.axisType,T.X,f.width>this._annoSize.width&&(this._annoSize.width=f.width),f.height>this._annoSize.height&&(this._annoSize.height=f.height)}}null==l&&(this._isOverlapped(t,e,n,this.axisType)?l=this._actualAngle=-45:this._actualAngle=0)}else{var d=this._formatValue(this._actualMin-o),f=t.measureString(d,n,this._groupClass);this._annoSize=f,d=this._formatValue(this._actualMax+o),(f=t.measureString(d,n,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=f.width),f.height>this._annoSize.height&&(this._annoSize.height=f.height)}if(l){l>90?l=90:l<-90&&(l=-90);var g=l*Math.PI/180,m=this._annoSize.width,y=this._annoSize.height;this._annoSize.width=m*Math.abs(Math.cos(g))+y*Math.abs(Math.sin(g)),this._annoSize.height=m*Math.abs(Math.sin(g))+y*Math.abs(Math.cos(g))}}else this._annoSize=new i.Size;y=2*(this._labelPadding||5);this._axisType==T.X?y+=this._annoSize.height:y+=this._annoSize.width+this._TICK_LABEL_DISTANCE+2;var b=this._TICK_HEIGHT,v=this._TICK_OVERLAP;x==C.Outside?v=1:x==C.Inside?v=-1:x==C.Cross&&(v=0);var x=this.majorTickMarks;return null==x&&(x=C.Outside),x!=C.None&&(y+=.5*(1+v)*b),this._title&&(d=this._title,this._szTitle=t.measureString(d,r,this._groupClass),y+=this._szTitle.height),t.fontSize=null,y},t.prototype._updateAutoFormat=function(t){if(this._isTimeAxis){var e=this.format,n=.001*(this._actualMax-this._actualMin)/10,r=new k(n*k.TicksPerSecond),s=i.isNumber(this._majorUnit)?k.fromDays(this._majorUnit):E.NiceTimeSpan(r,e);e||(this._tfmt=E.GetTimeDefaultFormat(1e3*s.TotalSeconds,0)),t=s.TotalSeconds}return t},t.prototype._updateActualLimitsByChartType=function(t,e,i){if(t&&t.length>0&&!this._isTimeAxis){var n=this._chart._getChartType();n!=w.Column&&n!=w.Bar&&(e-=.5,i+=.5)}return{min:e,max:i}},t.prototype._updateActualLimits=function(t,e,n,r,s){void 0===r&&(r=null),void 0===s&&(s=null);var a=this._actualMin,o=this._actualMax;this._isTimeAxis=t==i.DataType.Date;var h=this._updateActualLimitsByChartType(r,e,n);e=h.min,n=h.max;var l=this._min,u=this._max;if(i.isDate(l)&&(l=l.valueOf()),i.isDate(u)&&(u=u.valueOf()),this._actualMin=null!=l&&this._chart&&this._chart._stacking!==g.Stacked100pc?l:e,this._actualMax=null!=u&&this._chart&&this._chart._stacking!==g.Stacked100pc?u:n,this._actualMin==this._actualMax&&(this._actualMin-=.5,this._actualMax+=.5),this.logBase>0){var c=this.logBase,_=Math.log(c);if(!this._max){var p=Math.ceil(Math.log(this._actualMax)/_);this._actualMax=Math.pow(c,p)}if(!this._min){var d=Math.floor(Math.log(this._actualMin)/_);this._actualMin=Math.pow(c,d)}(this._actualMin<=0||!i.isNumber(this._actualMin))&&(this._actualMin=1),this._actualMax<this._actualMin&&(this._actualMax=this._actualMin+1)}if((a!=this._actualMin&&(i.isNumber(a)||i.isNumber(this._actualMin))||o!=this._actualMax&&(i.isNumber(o)||i.isNumber(this._actualMax)))&&this.onRangeChanged(),this._items){this._values=[],this._lbls=[];var f=this._items.length,m="value",y="text";if(this.binding){var b=this.binding.split(",");2==b.length&&(m=b[0],y=b[1])}for(var v=0;v<f;v++){var x=this._items[v],w=x[m];i.isNumber(w)&&(this._values.push(w),this._lbls.push(x[y]))}}else this._lbls=r,this._values=s},t.prototype._layout=function(t,e){var n=this.axisType==T.Y;this._plotrect=e,this._axrect=n?new i.Rect(t.left,t.top,t.height,t.width):t},t.prototype._hasVisibileSeries=function(){for(var t,e=this._chart.series,i=0,n=e.length;i<n;i++)if((t=e[i].visibility)==R.Plot||t==R.Visible)return!0;return!1},t.prototype._render=function(e){if(this.position!=M.None&&this._hasVisibileSeries()){this._vals={};var n=0;this.labelAngle&&((n=this.labelAngle)>90?n=90:n<-90&&(n=-90)),null==this.labelAngle&&null!=this._actualAngle&&(n=this._actualAngle);var r=S._FG,s=this._actualMax-this._actualMin;if(i.isNumber(s)){var a=this._calcMajorUnit();0==a&&(a=.1*this._niceTickNumber(s));var o=Math.min(t.MAX_MAJOR,Math.floor(s/a)+1),h=[],l=[];this._rects=[],this._vals.major=h,this._vals.hasLbls=[];var u=Math.floor(this._actualMin/a)*a;u<this._actualMin&&(u+=a);var c=!1;if(this._lbls&&this._lbls.length>0)if(l=this._lbls,0==this._values.length){c=!0;for(m=0;m<l.length;m++)h.push(m)}else h=this._values;else this._isTimeAxis?this._createTimeLabels(u,o,h,l):this.logBase?this._createLogarithmicLabels(this._actualMin,this._actualMax,this.majorUnit,h,l,!0):this._createLabels(u,o,a,h,l);o=Math.min(h.length,l.length),e.textFill=r;var _=this._TICK_HEIGHT,p=this._TICK_OVERLAP,d=this.majorTickMarks;null==d&&(d=C.Outside),d==C.Outside?p=1:d==C.Inside?p=-1:d==C.Cross&&(p=0);for(var f=.5*(p-1)*_,g=.5*(1+p)*_,m=0;m<o;m++){var y=!0,b=h[m],v=l[m],x=this.labels;if(x&&(c||this.itemsSource)&&this.majorUnit&&m%this.majorUnit!=0&&(x=!1),b>=this._actualMin&&b<=this._actualMax){var w=e.textFill;y=this._renderLabelsAndTicks(e,m,b,v,n,d,x,f,g),e.textFill=w}this._vals.hasLbls.push(y)}}(this.minorGrid||this.minorTickMarks!=C.None)&&this._renderMinor(e,h,c),e.stroke=r,e.fontSize=null,this._renderLineAndTitle(e),e.stroke=null,e.fontSize=null,e.textFill=null,e.strokeWidth=null}},t.prototype._renderLineAndTitle=function(t){var e=this._getPosition(),n=this.axisType==T.Y,r=e!=M.Top&&e!=M.Right,s=S._CSS_TITLE,a=S._CSS_LINE;if(n)if(r){if(this._title){o=new i.Point(this._axrect.left+.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);S._renderRotatedText(t,this._title,o,1,1,o,-90,s,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.right,this._axrect.top,this._axrect.right,this._axrect.bottom,a)}else{if(this._title){var o=new i.Point(this._axrect.right-.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);S._renderRotatedText(t,this._title,o,1,1,o,90,s,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.left,this._axrect.bottom,a)}else r?(this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.right,this._axrect.top,a),this._title&&S._renderText(t,this._title,new i.Point(this._axrect.left+.5*this._axrect.width,this._axrect.bottom),1,2,s)):(this.axisLine&&t.drawLine(this._axrect.left,this._axrect.bottom,this._axrect.right,this._axrect.bottom,a),this._title&&S._renderText(t,this._title,new i.Point(this._axrect.left+.5*this._axrect.width,this._axrect.top),1,0,s))},t.prototype._renderMinor=function(t,e,i){var n=this._getPosition(),r=this.axisType==T.Y,s=n!=M.Top&&n!=M.Right;if(this.logBase){if(this.minorUnit>0){var a=[];this._createLogarithmicLabels(this._actualMin,this._actualMax,this.minorUnit,a,null,!1);for(var o=[],h=0;h<a.length;h++){var l=a[h];-1==e.indexOf(l)&&l>this._actualMin&&o.push(l)}this._renderMinors(t,o,r,s)}}else this._createMinors(t,e,r,s,i)},t.prototype._renderRotatedText=function(t,e,i,n,r,s,a,o,h,l,u){if(this.itemFormatter){var c=this._getFormattedItem(t,e,i,n,h);c?(i=c.text,h=c.cls):i=null}S._renderRotatedText(t,i,n,r,s,a,o,h,l,u)},t.prototype._getFormattedItem=function(t,e,i,n,r){if(this.itemFormatter){var s=n.clone();this.axisType==T.X?this.position==M.Top?s.y=this._plotrect.top:s.y=this._plotrect.bottom:this.position==M.Right?s.x=this._plotrect.right:s.x=this._plotrect.left;var a={val:e,text:i,pos:s,cls:r};return a=this.itemFormatter(t,a)}},t.prototype._renderLabelsAndTicks=function(t,e,n,r,s,a,o,h,l){var u=this._getPosition(),c=!0,_=this.axisType==T.Y,p=u!=M.Top&&u!=M.Right,d=this.labelPadding||5,f=this._TICK_WIDTH,g=this._getLabelAlign(_),m=S._CSS_LABEL,y=S._CSS_GRIDLINE,b=S._CSS_TICK,v=S._FG,x=S._FG,w=this._GRIDLINE_WIDTH,N=n!=this._actualMin&&this.majorGrid;if(_){var A=this.convert(n);if(N&&(t.stroke=v,t.strokeWidth=w,t.drawLine(this._plotrect.left,A,this._plotrect.right,A,y)),t.stroke=x,t.strokeWidth=f,p){if(a!=C.None&&t.drawLine(this._axrect.right-h,A,this._axrect.right-l,A,b),o){k=new i.Point(this._axrect.right-l-this._TICK_LABEL_DISTANCE-d,A);s>0?90==s?this._renderRotatedText(t,n,r,k,1,0,k,s,m,this._groupClass):this._renderRotatedText(t,n,r,k,2,1,k,s,m,this._groupClass):s<0?-90==s?this._renderRotatedText(t,n,r,k,1,2,k,s,m,this._groupClass):this._renderRotatedText(t,n,r,k,2,1,k,s,m,this._groupClass):this._renderLabel(t,n,r,k,2,g,m)}}else if(a!=C.None&&t.drawLine(this._axrect.left+h,A,this._axrect.left+l,A,b),o){k=new i.Point(this._axrect.left+l+this._TICK_LABEL_DISTANCE+d,A);s>0?90==s?this._renderRotatedText(t,n,r,k,1,2,k,s,m,this._groupClass):this._renderRotatedText(t,n,r,k,0,1,k,s,m,this._groupClass):s<0?-90==s?this._renderRotatedText(t,n,r,k,1,0,k,s,m,this._groupClass):this._renderRotatedText(t,n,r,k,0,1,k,s,m,this._groupClass):this._renderLabel(t,n,r,k,0,g,m)}}else{var L=this.convert(n);if(this.overlappingLabels==P.Auto&&this._xCross(L)&&(o=!1),N&&(t.stroke=v,t.strokeWidth=w,t.drawLine(L,this._plotrect.top,L,this._plotrect.bottom,y)),t.stroke=x,t.strokeWidth=f,p){if(c=!1,o){k=new i.Point(L,this._axrect.top+l+d);c=0!=s?this._renderRotatedLabel(t,n,r,k,g,s,m,p):this._renderLabel(t,n,r,k,g,0,m)}a!=C.None&&c&&(L=this.convert(n),t.drawLine(L,this._axrect.top+h,L,this._axrect.top+l,b))}else{if(o){var k=new i.Point(L,this._axrect.bottom-l-d);c=0!=s?this._renderRotatedLabel(t,n,r,k,g,s,m,p):this._renderLabel(t,n,r,k,g,2,m)}a!=C.None&&(L=this.convert(n),t.drawLine(L,this._axrect.bottom-h,L,this._axrect.bottom-l,b))}}return c},t.prototype._xCross=function(t){for(var e=this._rects.length,i=0;i<e;i++){var n=this._rects[i];if(t>=n.left&&t<=n.right)return!0}return!1},t.prototype._createMinors=function(e,n,r,s,a){if(n&&n.length>1){for(var o=this.majorUnit?this._isTimeAxis?24*this.majorUnit*3600*1e3:this.majorUnit:n[1]-n[0],h=i.isNumber(this.minorUnit)?this._isTimeAxis?24*this.minorUnit*3600*1e3:this.minorUnit:.5*o,l=[],u=n[0];u>this._actualMin&&l.length<t.MAX_MINOR;u-=h)-1==n.indexOf(u)&&l.push(u);for(u=n[0]+h;u<this._actualMax&&l.length<t.MAX_MINOR;u+=h)-1==n.indexOf(u)?l.push(u):a&&this.majorUnit&&u%this.majorUnit!=0&&l.push(u);this._renderMinors(e,l,r,s)}},t.prototype._renderMinors=function(t,e,i,n){var r=this._TICK_HEIGHT,s=this._TICK_WIDTH,a=this._TICK_OVERLAP,o=S._FG,h=this.minorTickMarks,l=!0;this._vals.minor=e,h==C.Outside?a=1:h==C.Inside?a=-1:h==C.Cross?a=0:l=!1;for(var u=.5*(a-1)*r,c=.5*(1+a)*r,_=e?e.length:0,p=this.minorGrid,d=this._plotrect,f=this._GRIDLINE_WIDTH,g=S._FG,m=S._CSS_GRIDLINE_MINOR,y=S._CSS_TICK_MINOR,b=0;b<_;b++)if(e[b]>=this.actualMin&&e[b]<=this.actualMax)if(i){var v=this.convert(e[b]);l&&(t.stroke=o,t.strokeWidth=s,n?t.drawLine(this._axrect.right-u,v,this._axrect.right-c,v,y):t.drawLine(this._axrect.left+u,v,this._axrect.left+c,v,y)),p&&(t.stroke=g,t.strokeWidth=f,t.drawLine(d.left,v,d.right,v,m))}else{var x=this.convert(e[b]);l&&(t.stroke=o,t.strokeWidth=s,n?t.drawLine(x,this._axrect.top+u,x,this._axrect.top+c,y):t.drawLine(x,this._axrect.bottom-u,x,this._axrect.bottom-c,y)),p&&(t.stroke=g,t.strokeWidth=f,t.drawLine(x,d.top,x,d.bottom,m))}},t.prototype._renderLabel=function(t,e,n,r,s,a,o){var h=!1;if(this.itemFormatter){var l=this._getFormattedItem(t,e,n,r,o);l?(n=l.text,o=l.cls):n=null}if(n){var u=this._rects,c=this.overlappingLabels==P.Auto&&!i.isNumber(this._actualAngle),_=S._renderText(t,n,r,s,a,o,this._groupClass,null,function(t){if(c)for(var e=u.length,i=0;i<e;i++)if(S._intersects(u[i],t))return!1;return!0});_&&(_.left+=4,_.width+=8,u.push(_),h=!0)}return h},t.prototype._renderRotatedLabel=function(t,e,n,r,s,a,o,h){if(this.itemFormatter){var l=this._getFormattedItem(t,e,n,r,o);l?(n=l.text,o=l.cls):n=null}if(n){var u=t.measureString(n,o,this._groupClass),c=.5*u.height,_=.5*u.width*Math.abs(Math.sin(a*Math.PI/180)),p=.5*u.width,d=.5*(u.width*Math.abs(Math.cos(a*Math.PI/180))+u.height*Math.abs(Math.sin(a*Math.PI/180))),f=new i.Point(r.x,r.y),g=new i.Point(r.x,r.y);this.labelAlign||(s=90==a||-90==a?1:h?a>0?0:2:a>0?2:0),h?(r.y+=c+_,f.y+=c+_-.5*u.height):(r.y-=c+_-u.height,f.y-=c+_-.5*u.height);var m=0;2===s?(f.x-=d,r.x-=p+d,m=f.x+d-u.height-2):0===s?(f.x+=d,r.x-=p-d,m=f.x-d):(r.x-=p,m=f.x-u.height/2);var y=new i.Rect(m,g.y,u.height+2,u.width),b=this._rects;if(this.overlappingLabels==P.Auto)for(var v=b.length,x=0;x<v;x++)if(S._intersects(b[x],y))return!1;return S._renderRotatedText(t,n,r,0,2,f,a,o,this._groupClass),this._rects.push(y),!0}return!1},t.prototype._getLabelAlign=function(t){var e=1;if(this.labelAlign){var i=this.labelAlign.toLowerCase();t?"top"==i?e=0:"bottom"==i&&(e=2):"left"==i?e=0:"right"==i&&(e=2)}return e},t.prototype.convert=function(t,e,i){var n=null==e?this._actualMax:e,r=null==i?this._actualMin:i;if(n==r)return 0;var s=this._axrect.left,a=this._axrect.width,o=this._axrect.top,h=this._axrect.height;if(null!=this._customConvert){var l=this._customConvert(t,r,n);return this.axisType==T.Y?o+l*h:s+l*a}if(this.logBase){if(t<=0)return NaN;var u=Math.log(n/r);return this._reversed?this.axisType==T.Y?o+Math.log(t/r)/u*h:s+a-Math.log(t/r)/u*a:this.axisType==T.Y?o+h-Math.log(t/r)/u*h:s+Math.log(t/r)/u*a}return this._reversed?this.axisType==T.Y?o+(t-r)/(n-r)*h:s+a-(t-r)/(n-r)*a:this.axisType==T.Y?o+h-(t-r)/(n-r)*h:s+(t-r)/(n-r)*a},t.prototype.convertBack=function(t){if(this._actualMax==this._actualMin)return 0;var e=this._plotrect.left,i=this._plotrect.width,n=this._plotrect.top,r=this._plotrect.height,s=this._actualMax-this._actualMin,a=this.logBase;if(null!=this._customConvertBack)return this.axisType==T.Y?this._customConvertBack((t-n)/r,this._actualMin,this._actualMax):this._customConvertBack((t-e)/i,this._actualMin,this._actualMax);if(a){var o=0;return o=this._reversed?this.axisType==T.Y?(t-n)/r:1-(t-e)/i:this.axisType==T.Y?1-(t-n)/r:(t-e)/i,Math.pow(a,(Math.log(this._actualMin)+(Math.log(this._actualMax)-Math.log(this._actualMin))*o)/Math.log(a))}return this._reversed?this.axisType==T.Y?this._actualMin+(t-n)*s/r:this._actualMin+(e+i-t)*s/i:this.axisType==T.Y?this._actualMax-(t-n)*s/r:this._actualMin+(t-e)*s/i},Object.defineProperty(t.prototype,"axisType",{get:function(){var t=this._chart;if(t){if(t.axisX==this)return T.X;if(t.axisY==this)return T.Y}return this._axisType},enumerable:!0,configurable:!0}),t.prototype._getMinNum=function(){return this._actualMin},t.prototype._getMaxNum=function(){return this._actualMax},t.prototype._invalidate=function(){this._chart&&this._chart.invalidate()},t.prototype._cvCollectionChanged=function(t,e){this._invalidate()},t.prototype._createLabels=function(t,e,i,n,r){for(var s=0;s<e;s++){var a=(t+i*s).toFixed(14),o=parseFloat(a),h=this._formatValue(o);n.push(o),r.push(h)}},t.prototype._createLogarithmicLabels=function(t,e,i,n,r,s){var a=this.logBase,o=Math.log(a),h=Math.floor(Math.log(t)/o),l=Math.ceil(Math.log(e)/o),u=a,c=!0;i>0&&(c=!1,u=i),u<a&&(u=a);var _=(l-h+1)*a/u,p=1;if(s){var d=this._getPosition(),f=this._getAnnoNumber(d==M.Left||d==M.Right);_>f?p=Math.floor(_/f+1):c&&(_<=.2*f?u=.2*a:_<=.1*f&&(u=.1*a))}for(var g=h;g<=l;g+=p)if(c)for(var m=Math.pow(a,g),y=0;y*u<a-1;y++)(b=m*(1+y*u))>=t&&b<=e&&(0==y?(n.unshift(b),r&&r.unshift(this._formatValue(b))):(n.push(b),r&&r.push(this._formatValue(b))));else{var b=Math.pow(u,g);b>=t&&b<=e&&(n.push(b),r&&r.push(this._formatValue(b)))}},t.prototype._createTimeLabels=function(t,e,n,r){var s=this._actualMin,a=this._actualMax,o=new Date(s),h=new Date(a),l=this._format,u=this._getAnnoNumber(this._axisType==T.Y);u>12&&(u=12);var c=.001*(this._actualMax-this._actualMin)/u,_=new k(c*k.TicksPerSecond),p=i.isNumber(this._majorUnit)?k.fromDays(this._majorUnit):E.NiceTimeSpan(_,l);l||(this._tfmt=l=E.GetTimeDefaultFormat(1e3*p.TotalSeconds,0));var d=p.Ticks,f=E.RoundTime(s,p.TotalDays,!1);isFinite(f)&&(s=f);var g=E.RoundTime(a,p.TotalDays,!0);isFinite(g)&&(a=g);var m=new Date(s);new Date(a);if(p.TotalDays>=365&&!i.isNumber(this._majorUnit)){(m=new Date(o.getFullYear(),1,1))<o&&m.setFullYear(m.getFullYear()+1);var y=p.TotalDays/365;y-=y%1;for(x=m;x<=h&&y;x.setFullYear(x.getFullYear()+y)){S=x.valueOf();n.push(S),r.push(this._formatValue(S))}}else if(p.TotalDays>=30&&!i.isNumber(this._majorUnit)){(m=new Date(o.getFullYear(),o.getMonth(),1))<o&&m.setMonth(m.getMonth()+1);var b=p.TotalDays/30;b-=b%1;for(x=m;x<=h;x.setMonth(x.getMonth()+b)){S=x.valueOf();n.push(S),r.push(this._formatValue(S))}}else{var v=1e3*d/k.TicksPerSecond,x=m,w=o.getTime()-x.getTime();for(w>v&&(x=new Date(x.getTime()+Math.floor(w/v)*v));x<=h&&v;x=new Date(x.getTime()+v))if(x>=o){var S=x.valueOf();n.push(S),r.push(this._formatValue(S))}}},t.prototype._formatValue=function(t){if(this._isTimeAxis)return this._format?i.Globalize.format(new Date(t),this._format):i.Globalize.format(new Date(t),this._tfmt);if(this._format)return i.Globalize.format(t,this._format);var e=t==Math.round(t)?"n0":"n";return i.Globalize.format(t,e)},t.prototype._calcMajorUnit=function(){var t=this._majorUnit;if(!i.isNumber(t)){var e=this._actualMax-this._actualMin,n=this._nicePrecision(e),r=e/this._getAnnoNumber(this.axisType==T.Y);(t=this._niceNumber(2*r,-n,!0))<r&&(t=this._niceNumber(r,1-n,!1)),t<r&&(t=this._niceTickNumber(r))}return t},t.prototype._getAnnoNumber=function(t){var e=t?this._annoSize.height:this._annoSize.width,i=t?this._axrect.height:this._axrect.width;if(e>0&&i>0){var n=Math.floor(i/(e+6));return n<=0&&(n=1),n}return 10},t.prototype._nicePrecision=function(t){if(!i.isNumber(t)||t<=0)return 0;var e,n=Math.log(t)/Math.LN10;e=n>=0?Math.floor(n):Math.ceil(n);var r=t/Math.pow(10,e);return r<3&&(e=1-e,(r=t/Math.pow(10,e))<3&&(e+=1)),e},t.prototype._niceTickNumber=function(t){if(0==t)return t;t<0&&(t=-t);var e=Math.log(t)/Math.LN10,i=Math.floor(e),n=t/Math.pow(10,i),r=10;return n<=1?r=1:n<=2?r=2:n<=5&&(r=5),r*Math.pow(10,i)},t.prototype._niceNumber=function(t,e,i){if(0==t)return t;t<0&&(t=-t);var n=t/Math.pow(10,e),r=10;return i?n<1.5?r=1:n<3?r=2:n<4.5?r=4:n<7&&(r=5):n<=1?r=1:n<=2?r=2:n<=5&&(r=5),r*Math.pow(10,e)},Object.defineProperty(t.prototype,"_uniqueId",{get:function(){return this.__uniqueId},enumerable:!0,configurable:!0}),t.MAX_MAJOR=1e3,t.MAX_MINOR=2e3,t._id=0,t}();e.Axis=N;var A=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getAxis=function(t){var e=this.indexOf(t);return e>-1?this[e]:null},e.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1},e}(i.ObservableArray);e.AxisCollection=A;var L;!function(t){t[t.tickf7=-7]="tickf7",t[t.tickf6=-6]="tickf6",t[t.tickf5=-5]="tickf5",t[t.tickf4=-4]="tickf4",t[t.tickf3=-3]="tickf3",t[t.tickf2=-2]="tickf2",t[t.tickf1=-1]="tickf1",t[t.second=1]="second",t[t.minute=60]="minute",t[t.hour=3600]="hour",t[t.day=86400]="day",t[t.week=604800]="week",t[t.month=2678400]="month",t[t.year=31536e3]="year",t[t.maxtime=Number.MAX_VALUE]="maxtime"}(L||(L={}));var k=function(){function t(t){this.ticks=t}return Object.defineProperty(t.prototype,"Ticks",{get:function(){return this.ticks},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TotalSeconds",{get:function(){return this.ticks/1e7},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"TotalDays",{get:function(){return this.ticks/1e7/86400},enumerable:!0,configurable:!0}),t.fromSeconds=function(e){return new t(1e7*e)},t.fromDays=function(e){return new t(1e7*e*24*60*60)},t.TicksPerSecond=1e7,t}(),E=function(){function t(t){i.isDate(t)?this.init(t):i.isNumber(t)&&this.init(S._fromOADate(t))}return t.prototype.init=function(t){this.year=t.getFullYear(),this.month=t.getMonth(),this.day=t.getDate(),this.hour=t.getHours(),this.minute=t.getMinutes(),this.second=t.getSeconds()},t.prototype.getTimeAsDateTime=function(){this.hour>=24&&(this.hour-=24,this.day+=1),this.month<0?(-1-this.day,this.month=1):this.month>11&&(this.month-12,this.month=12),this.day<1?(-1-this.day,this.day=1):this.day>28&&2==this.month?(this.day-28,this.day=28):this.day>30&&(4==this.month||4==this.month||6==this.month||9==this.month||11==this.month)?(this.day-30,this.day=30):this.day>31&&(this.day-31,this.day=31),this.second>59&&(this.second-59,this.second=59);return this.minute>59&&(this.minute-59,this.minute=59),new Date(this.year,this.month,this.day,this.hour,this.minute,this.second)},t.prototype.getTimeAsDouble=function(){return this.getTimeAsDateTime().valueOf()},t.tround=function(t,e,i){var n=t/e*e;return n-=n%1,i&&n!=t&&(n+=e-=e%1),n},t.RoundTime=function(e,i,n){var r=24*i*60*60;if(r>0){var s=new t(e);return r<L.minute?(s.second=this.tround(s.second,r,n),s.getTimeAsDouble()):(s.second=0,r<L.hour?(r/=L.minute,s.minute=this.tround(s.minute,r,n),s.getTimeAsDouble()):(s.minute=0,r<L.day?(r/=L.hour,s.hour=this.tround(s.hour,r,n),s.getTimeAsDouble()):(s.hour=0,r<L.month?(r/=L.day,s.day=this.tround(s.day,r,n),s.getTimeAsDouble()):(s.day=1,r<L.year?(r/=L.month,1!=s.month&&(s.month=this.tround(s.month,r,n)),s.getTimeAsDouble()):(s.month=1,r/=L.year,s.year=this.tround(s.year,r,n),s.getTimeAsDouble())))))}var a=e,o=a-r,h=o/i*i;return n&&h!=o&&(h+=i),a=r+h},t.TimeSpanFromTmInc=function(t){var e=k.fromSeconds(1);if(t!=L.maxtime)if(t>L.tickf1)e=k.fromSeconds(t);else{var i=t,n=1;for(i+=7;i>0;)n*=10,i--;e=new k(n)}return e},t.manualTimeInc=function(t){var e=L.second;if(null==t||0==t.length)return e;var i=t.indexOf("f");if(i>=0){var n=-1;if(i>0&&"%"==t.substr(i-1,1))n=-1;else for(var r=1;r<6&&!(i+r>=t.length)&&"f"==t.substr(i+r,1);r++)n--;e=n}else t.indexOf("s")>=0?e=L.second:t.indexOf("m")>=0?e=L.minute:t.indexOf("h")>=0||t.indexOf("H")?e=L.hour:t.indexOf("d")>=0?e=L.day:t.indexOf("M")>=0?e=L.month:t.indexOf("y")>=0&&(e=L.year);return e},t.getNiceInc=function(t,e,i){for(var n=0;n<t.length;n++){var r=t[n]*i;if(e<=r)return r}return 0},t.NiceTimeSpan=function(e,i){var n=L.second;null!=i&&i.length>0&&(n=t.manualTimeInc(i));var r=0,s=0;if(n<L.second&&e.TotalSeconds<10){for(r=e.Ticks,s=t.TimeSpanFromTmInc(n).Ticks;r>10*s;)s*=10;var a=s;return r>a&&(a*=2),r>a&&(a=5*s),r>a&&(a=10*s),new k(a)}if(0==(r=Math.ceil(e.TotalSeconds)))return t.TimeSpanFromTmInc(n);if(s=1,n<L.minute){if(r<L.minute&&0!=(s=t.getNiceInc([1,2,5,10,15,30],r,n)))return k.fromSeconds(s);n=L.minute}if(n<L.hour){if(r<L.hour&&0!=(s=t.getNiceInc([1,2,5,10,15,30],r,n)))return k.fromSeconds(s);n=L.hour}if(n<L.day){if(r<L.day&&0!=(s=t.getNiceInc([1,3,6,12],r,n)))return k.fromSeconds(s);n=L.day}if(n<L.month){if(r<L.month&&0!=(s=t.getNiceInc([1,2,7,14],r,n)))return k.fromSeconds(s);n=L.month}if(n<L.year){if(r<L.year&&0!=(s=t.getNiceInc([1,2,3,4,6],r,n)))return k.fromSeconds(s);n=L.year}return s=100*L.year,r<s&&0==(s=t.getNiceInc([1,2,5,10,20,50],r,n))&&(s=100*L.year),k.fromSeconds(s)},t.NiceTimeUnit=function(e,i){var n=k.fromDays(e);return(n=t.NiceTimeSpan(n,i)).TotalDays},t.GetTimeDefaultFormat=function(t,e){if(!i.isNumber(t)||!i.isNumber(e))return"";var n="s",r=k.fromSeconds(.001*(t-e)),s=r.TotalSeconds;if(s>=L.year)n="yyyy";else if(s>=L.month)n="MMM yyyy";else if(s>=L.day)n="MMM d";else if(s>=L.hour)n="ddd H:mm";else if(s>=.5*L.hour)n="H:mm";else if(s>=1)n="H:mm:ss";else if(s>0){var a=r.Ticks;for(n="s.";a<k.TicksPerSecond;)a*=10,n+="f"}return n},t.secInYear=86400,t}(),I=function(){function t(t){this._row=0,this._col=0,this._rect=new i.Rect(0,0,0,0),t&&i.copy(this,t)}return Object.defineProperty(t.prototype,"row",{get:function(){return this._row},set:function(t){t!=this._row&&(this._row=i.asInt(t,!0,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"column",{get:function(){return this._col},set:function(t){t!=this._col&&(this._col=i.asInt(t,!0,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=i.asString(t,!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},set:function(t){t!=this._width&&(this._width=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},set:function(t){t!=this._height&&(this._height=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){return this._style},set:function(t){t!=this._style&&(this._style=t,this._invalidate())},enumerable:!0,configurable:!0}),t.prototype._invalidate=function(){this._chart&&this._chart.invalidate()},t.prototype._render=function(t){t.drawRect(this._rect.left,this._rect.top,this._rect.width,this._rect.height,null,this.style)},t.prototype._setPlotX=function(t,e){this._rect.left=t,this._rect.width=e},t.prototype._setPlotY=function(t,e){this._rect.top=t,this._rect.height=e},t}();e.PlotArea=I;var D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.prototype.getPlotArea=function(t){var e=this.indexOf(t);return e>-1?this[e]:null},e.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1},e.prototype._getWidth=function(t){for(var e=0;e<this.length;e++){var i=this[e];if(i.column==t&&0==i.row)return i.width}},e.prototype._getHeight=function(t){for(var e=0;e<this.length;e++){var i=this[e];if(i.row==t&&0==i.column)return i.height}},e.prototype._calculateWidths=function(t,e){if(e<=0)throw"ncols";for(var i=[],n=0;n<e;n++){var r=this._getWidth(n);i[n]=new j(r)}return this._calculateLengths(t,e,i)},e.prototype._calculateHeights=function(t,e){if(e<=0)throw"nrows";for(var i=[],n=0;n<e;n++){var r=this._getHeight(n);i[n]=new j(r)}return this._calculateLengths(t,e,i)},e.prototype._calculateLengths=function(t,e,i){for(var n=[e],r=0,s=0,a=0;a<e;a++)i[a].isAbsolute?(n[a]=i[a].value,r+=n[a]):i[a].isStar?s+=i[a].value:i[a].isAuto&&s++;for(var o=(t-r)/s,a=0;a<e;a++)i[a].isStar?n[a]=o*i[a].value:i[a].isAuto&&(n[a]=o),n[a]<0&&(n[a]=0);return n},e}(i.ObservableArray);e.PlotAreaCollection=D;var O;!function(t){t[t.Auto=0]="Auto",t[t.Pixel=1]="Pixel",t[t.Star=2]="Star"}(O||(O={}));var R,j=function(){function t(t){void 0===t&&(t=null),this._unitType=O.Auto,t&&((t=t.toString()).indexOf("*")>=0?(this._unitType=O.Star,t=t.replace("*",""),this._value=parseFloat(t),isNaN(this._value)&&(this._value=1)):(this._unitType=O.Pixel,this._value=parseFloat(t),isNaN(this._value)&&(this._unitType=O.Auto,this._value=1)))}return Object.defineProperty(t.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isStar",{get:function(){return this._unitType==O.Star},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAbsolute",{get:function(){return this._unitType==O.Pixel},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isAuto",{get:function(){return this._unitType==O.Auto},enumerable:!0,configurable:!0}),t}();!function(t){t[t.Visible=0]="Visible",t[t.Plot=1]="Plot",t[t.Legend=2]="Legend",t[t.Hidden=3]="Hidden"}(R=e.SeriesVisibility||(e.SeriesVisibility={}));var V;!function(t){t[t.Dot=0]="Dot",t[t.Box=1]="Box"}(V=e.Marker||(e.Marker={}));var F=function(){return function(){}}();e.DataArray=F;var X=function(t){function e(e){var n=t.call(this)||this;return n._series=i.asType(e,Y),n}return __extends(e,t),Object.defineProperty(e.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0}),e}(i.EventArgs);e.SeriesEventArgs=X;var Y=function(){function t(t){this._altStyle=null,this._symbolMarker=V.Dot,this._visibility=R.Visible,this.rendering=new i.Event,this.rendered=new i.Event,t&&this.initialize(t)}return Object.defineProperty(t.prototype,"style",{get:function(){return this._style},set:function(t){t!=this._style&&(this._style=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"altStyle",{get:function(){return this._altStyle},set:function(t){t!=this._altStyle&&(this._altStyle=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolStyle",{get:function(){return this._symbolStyle},set:function(t){t!=this._symbolStyle&&(this._symbolStyle=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){t!=this._symbolSize&&(this._symbolSize=i.asNumber(t,!0,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"symbolMarker",{get:function(){return this._symbolMarker},set:function(t){(t=i.asEnum(t,V,!0))!=this._symbolMarker&&(this._symbolMarker=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"binding",{get:function(){return this._binding?this._binding:this._chart?this._chart.binding:null},set:function(t){t!=this._binding&&(this._binding=i.asString(t,!0),this._clearValues(),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"bindingX",{get:function(){return this._bindingX?this._bindingX:this._chart?this._chart.bindingX:null},set:function(t){t!=this._bindingX&&(this._bindingX=i.asString(t,!0),this._clearValues(),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"itemsSource",{get:function(){return this._itemsSource},set:function(t){t!=this._itemsSource&&(this._cv&&(this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this),this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this),this._cv=null),this._itemsSource=t,this._cv=i.asCollectionView(t),null!=this._cv&&(this._cv.currentChanged.addHandler(this._cvCurrentChanged,this),this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)),this._clearValues(),this._itemsSource=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"collectionView",{get:function(){return this._cv?this._cv:this._chart?this._chart.collectionView:null},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"legendElement",{get:function(){return this._legendElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"cssClass",{get:function(){return this._cssClass},set:function(t){this._cssClass=i.asString(t,!0)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"visibility",{get:function(){return this._visibility},set:function(t){(t=i.asEnum(t,R))!=this._visibility&&(this._visibility=t,this._clearValues(),this._invalidate(),this._chart&&this._chart.onSeriesVisibilityChanged(new X(this)))},enumerable:!0,configurable:!0}),t.prototype.hitTest=function(t,e){return i.isNumber(t)&&i.isNumber(e)?t=new i.Point(t,e):t instanceof MouseEvent&&(t=new i.Point(t.pageX,t.pageY)),i.asType(t,i.Point),this._chart?this._chart._hitTestSeries(t,this._chart.series.indexOf(this)):null},t.prototype.getPlotElement=function(t){if(this.hostElement&&t<this._pointIndexes.length){var e=this._pointIndexes[t];if(e<this.hostElement.childNodes.length)return this.hostElement.childNodes[e]}return null},Object.defineProperty(t.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){if(this._axisX=i.asType(t,N,!0),this._axisX){var e=this._axisX._chart=this._chart;e&&-1==e.axes.indexOf(this._axisX)&&e.axes.push(this._axisX)}this._invalidate()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){if(this._axisY=i.asType(t,N,!0),this._axisY){var e=this._axisY._chart=this._chart;e&&-1==e.axes.indexOf(this._axisY)&&e.axes.push(this._axisY)}this._invalidate()}},enumerable:!0,configurable:!0}),t.prototype.initialize=function(t){t&&i.copy(this,t)},t.prototype.pointToData=function(t){return i.asType(t,i.Point),t=t.clone(),t.x=this._getAxisX().convertBack(t.x),t.y=this._getAxisY().convertBack(t.y),t},t.prototype.dataToPoint=function(t){return i.asType(t,i.Point),t=t.clone(),t.x=this._getAxisX().convert(t.x),t.y=this._getAxisY().convert(t.y),t},t.prototype.onRendering=function(t,e,i){var n=new o(t,e,i);return this.rendering.raise(this,n),n.cancel},t.prototype.onRendered=function(t){this.rendered.raise(this,new a(t))},Object.defineProperty(t.prototype,"_chart",{get:function(){return this.__chart},set:function(t){t!==this.__chart&&(this.__chart=t)},enumerable:!0,configurable:!0}),t.prototype._getSymbolSize=function(){return null!=this.symbolSize?this.symbolSize:this.chart.symbolSize},Object.defineProperty(t.prototype,"_plotter",{get:function(){return this.chart&&!this.__plotter&&(this.__plotter=this.chart._getPlotter(this)),this.__plotter},set:function(t){t!=this.__plotter&&(this.__plotter=t)},enumerable:!0,configurable:!0}),t.prototype.getDataType=function(t){return 0==t?this._valueDataType:1==t?this._xvalueDataType:null},t.prototype.getValues=function(t){if(0==t){if(null==this._values)if(this._valueDataType=null,null!=this._cv){i=this._bindValues(this._cv.items,this._getBinding(0));this._values=i.values,this._valueDataType=i.dataType}else if(null!=this.binding&&null!=this._chart&&null!=this._chart.collectionView){i=this._bindValues(this._chart.collectionView.items,this._getBinding(0));this._values=i.values,this._valueDataType=i.dataType}return this._values}if(1==t){if(null==this._xvalues){this._xvalueDataType=null;var e=this;if(null!=this.bindingX)if(null!=e._cv){i=this._bindValues(e._cv.items,this.bindingX,!0);this._xvalueDataType=i.dataType,this._xvalues=i.values}else{if(null==this._bindingX)return null;if(null!=e._chart&&null!=e._chart.collectionView){var i=this._bindValues(e._chart.collectionView.items,this.bindingX,!0);this._xvalueDataType=i.dataType,this._xvalues=i.values}}}return this._xvalues}return null},t.prototype.drawLegendItem=function(t,e,i){var n=this._getChartType();null==n&&(n=this._chart._getChartType()),n===w.Funnel?this._drawFunnelLegendItem(t,e,i,this.style,this.symbolStyle):this._drawLegendItem(t,e,n,this.name,this.style,this.symbolStyle)},t.prototype.measureLegendItem=function(t,e){var i=this._getChartType();return null==i&&(i=this._chart._getChartType()),i===w.Funnel?this._measureLegendItem(t,this._getFunnelLegendName(e)):this._measureLegendItem(t,this.name)},t.prototype.legendItemLength=function(){var t=this._getChartType();return null==t&&(t=this._chart._getChartType()),t===w.Funnel&&this._chart._xlabels&&this._chart._xlabels.length?this._chart._xlabels.length:1},t.prototype.getDataRect=function(t,e){return null},t.prototype._getChartType=function(){return this._chartType},t.prototype._clearValues=function(){this._values=null,this._xvalues=null,this.__plotter=null},t.prototype._getBinding=function(t){var e=this.binding;if(e){var i=this.chart?this.chart._bindingSeparator:",";if(i){var n=e.split(i);n&&n.length>t&&(e=n[t].trim())}}return e},t.prototype._getBindingValues=function(t){var e;return null!=this._cv?e=this._cv.items:null!=this._chart&&null!=this._chart.collectionView&&(e=this._chart.collectionView.items),this._bindValues(e,this._getBinding(t)).values},t.prototype._getItem=function(t){var e=null,i=null;return null!=this.itemsSource?i=null!=this._cv?this._cv.items:this.itemsSource:null!=this._chart.itemsSource&&(i=null!=this._chart.collectionView?this._chart.collectionView.items:this._chart.itemsSource),null!=i&&(e=i[t]),e},t.prototype._getLength=function(){var t=0,e=null;return null!=this.itemsSource?e=null!=this._cv?this._cv.items:this.itemsSource:null!=this._chart.itemsSource&&(e=null!=this._chart.collectionView?this._chart.collectionView.items:this._chart.itemsSource),null!=e&&(t=e.length),t},t.prototype._setPointIndex=function(t,e){this._pointIndexes[t]=e},t.prototype._getDataRect=function(){var t=this.getValues(0),e=this.getValues(1);if(t){for(var n=NaN,r=NaN,s=NaN,a=NaN,o=t.length,h=0;h<o;h++){var l=t[h];if(isFinite(l)&&(isNaN(r)?r=a=l:l<r?r=l:l>a&&(a=l)),e){var u=e[h];isFinite(u)&&(isNaN(n)?n=s=u:u<n?n=u:l>a&&(s=u))}}if(e||(n=0,s=o-1),!isNaN(r))return new i.Rect(n,r,s-n,a-r)}return null},t.prototype._isCustomAxisX=function(){return!!this._axisX&&(!this._chart||this._axisX!=this.chart.axisX)},t.prototype._isCustomAxisY=function(){return!!this._axisY&&(!this._chart||this._axisY!=this.chart.axisY)},t.prototype._getAxisX=function(){var t=null;return this.axisX?t=this.axisX:this.chart&&(t=this.chart.axisX),t},t.prototype._getAxisY=function(){var t=null;return this.axisY?t=this.axisY:this.chart&&(t=this.chart.axisY),t},t.prototype._measureLegendItem=function(t,e){var n=new i.Size;if(n.width=B._LEGEND_ITEM_WIDTH,n.height=B._LEGEND_ITEM_HEIGHT,this._name){var r=t.measureString(e,S._CSS_LABEL,S._CSS_LEGEND);n.width+=r.width,n.height<r.height&&(n.height=r.height)}return n.width+=3*B._LEGEND_ITEM_MARGIN,n.height+=2*B._LEGEND_ITEM_MARGIN,n},t.prototype._drawFunnelLegendItem=function(t,e,n,r,s){t.strokeWidth=1;var a=B._LEGEND_ITEM_MARGIN,o=null,h=null;null===o&&(o=this._chart._getColorLight(n)),null===h&&(h=this._chart._getColor(n)),t.fill=o,t.stroke=h;var l=e.top+.5*e.height,u=B._LEGEND_ITEM_WIDTH,c=B._LEGEND_ITEM_HEIGHT,_=this._getFunnelLegendName(n);t.drawRect(e.left+a,l-.5*c,u,c,null,s||r),_&&S._renderText(t,_,new i.Point(e.left+c+2*a,l),0,1,S._CSS_LABEL,S._CSS_LEGEND)},t.prototype._getFunnelLegendName=function(t){var e;return this._chart._xlabels&&this._chart._xlabels.length&&(e=this._chart._xlabels[t]),e||(e=this.name),e},t.prototype._drawLegendItem=function(t,e,n,r,s,a){t.strokeWidth=1;var o=B._LEGEND_ITEM_MARGIN,h=null,l=null;null===h&&(h=this._chart._getColorLight(this._chart.series.indexOf(this))),null===l&&(l=this._chart._getColor(this._chart.series.indexOf(this))),t.fill=h,t.stroke=l;var u=e.top+.5*e.height,c=B._LEGEND_ITEM_WIDTH,_=B._LEGEND_ITEM_HEIGHT;switch(n){case w.Area:case w.SplineArea:t.drawRect(e.left+o,u-.5*_,c,_,null,s);break;case w.Bar:case w.Column:t.drawRect(e.left+o,u-.5*_,c,_,null,a||s);break;case w.Scatter:case w.Bubble:var p=.3*c,d=.3*_;this.symbolMarker==V.Box?t.drawRect(e.left+o+.5*c-p,u-d,2*p,2*d,null,a||s):t.drawEllipse(e.left+.5*c+o,u,p,d,null,a||s);break;case w.Line:case w.Spline:t.drawLine(e.left+o,u,e.left+c+o,u,null,s);break;case w.LineSymbols:case w.SplineSymbols:var p=.3*c,d=.3*_;this.symbolMarker==V.Box?t.drawRect(e.left+o+.5*c-p,u-d,2*p,2*d,null,a||s):t.drawEllipse(e.left+.5*c+o,u,p,d,null,a||s),t.drawLine(e.left+o,u,e.left+c+o,u,null,s);break;case w.Candlestick:case w.HighLowOpenClose:t.drawLine(e.left+o,u,e.left+c+o,u,null,a||s)}this._name&&S._renderText(t,r,new i.Point(e.left+_+2*o,u),0,1,S._CSS_LABEL,S._CSS_LEGEND)},t.prototype._cvCollectionChanged=function(t,e){this._clearValues(),this._invalidate()},t.prototype._cvCurrentChanged=function(t,e){this._chart&&this._chart._notifyCurrentChanged&&this._invalidate()},t.prototype._bindValues=function(t,e,n){void 0===n&&(n=!1);var r,s,a;if(null!=t){var o=t.length;r=new Array(t.length);for(var h=0;h<o;h++){a=null;var l=t[h];null!=e&&(l=l[e]),i.isArray(l)&&l.length>0&&(a=l,l=l[0]),i.isNumber(l)?(r[h]=l,s=i.DataType.Number):i.isDate(l)?(r[h]=l.valueOf(),s=i.DataType.Date):n&&l&&(r[h]=h,s=i.DataType.Number),i.isArray(a)&&a.length>0&&(r[h]=a)}}var u=new F;return u.values=r,u.dataType=s,u},t.prototype._invalidate=function(){this._chart&&this._chart.invalidate()},t.prototype._indexToPoint=function(t){if(t>=0&&t<this._values.length){var e=this._values[t],n=this._xvalues?this._xvalues[t]:t;return new i.Point(n,e)}return null},t.prototype._getSymbolFill=function(t){var e=null;return this.symbolStyle&&(e=this.symbolStyle.fill),!e&&this.style&&(e=this.style.fill),!e&&this.chart&&(e=this.chart._getColorLight(t)),e},t.prototype._getSymbolStroke=function(t){var e=null;return this.symbolStyle&&(e=this.symbolStyle.stroke),!e&&this.style&&(e=this.style.stroke),!e&&this.chart&&(e=this.chart._getColor(t)),e},t.prototype._getAltSymbolStroke=function(t){var e=null;return this.altStyle&&(e=this.altStyle.stroke),e},t.prototype._getAltSymbolFill=function(t){var e=null;return this.altStyle&&(e=this.altStyle.fill),e},t.prototype._renderLabels=function(t,e,i,n){this._plotter&&this._plotter._renderLabels(t,this,e,i,n)},t._LEGEND_ITEM_WIDTH=10,t._LEGEND_ITEM_HEIGHT=10,t._LEGEND_ITEM_MARGIN=4,t._DEFAULT_SYM_SIZE=10,t}();e.SeriesBase=Y;var B=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),Object.defineProperty(e.prototype,"chartType",{get:function(){return this._chartType},set:function(t){(t=i.asEnum(t,w,!0))!=this._chartType&&(this._chartType=t,this._invalidate())},enumerable:!0,configurable:!0}),e}(Y);e.Series=B;var z=function(){function t(e){this._strokeWidth=1,this._fontSize=null,this._fontFamily=null,this._savedGradient={},this._bbCache={},this._element=e,this._create(),this._element.appendChild(this._svg),void 0===t._isff&&(t._isff=navigator.userAgent.toLowerCase().indexOf("firefox")>=0)}return t.prototype.beginRender=function(){for(;this._svg.firstChild;)i.removeChild(this._svg.firstChild);this._savedGradient={},this._bbCache={},this._svg.appendChild(this._defs),this._svg.appendChild(this._textGroup)},t.prototype.endRender=function(){i.removeChild(this._textGroup)},t.prototype.setViewportSize=function(t,e){this._svg.setAttribute("width",t.toString()),this._svg.setAttribute("height",e.toString())},Object.defineProperty(t.prototype,"element",{get:function(){return this._svg},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fill",{get:function(){return this._fill},set:function(t){this._fill=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._fontFamily=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"stroke",{get:function(){return this._stroke},set:function(t){this._stroke=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=t},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"textFill",{get:function(){return this._textFill},set:function(t){this._textFill=t},enumerable:!0,configurable:!0}),t.prototype.addClipRect=function(e,i){if(e&&i){var n=document.createElementNS(t.svgNS,"clipPath"),r=document.createElementNS(t.svgNS,"rect");r.setAttribute("x",(e.left-1).toFixed()),r.setAttribute("y",(e.top-1).toFixed()),r.setAttribute("width",(e.width+2).toFixed()),r.setAttribute("height",(e.height+2).toFixed()),n.appendChild(r),n.setAttribute("id",i),this._svg.appendChild(n)}},t.prototype.drawEllipse=function(e,i,n,r,s,a){var o=document.createElementNS(t.svgNS,"ellipse");return this._applyColor(o,"stroke",this._stroke),null!==this._strokeWidth&&o.setAttribute("stroke-width",this._strokeWidth.toString()),this._applyColor(o,"fill",this._fill),o.setAttribute("cx",e.toFixed(1)),o.setAttribute("cy",i.toFixed(1)),o.setAttribute("rx",n.toFixed(1)),o.setAttribute("ry",r.toFixed(1)),s&&o.setAttribute("class",s),this._applyStyle(o,a),this._appendChild(o),o},t.prototype.drawRect=function(e,i,n,r,s,a,o){var h=document.createElementNS(t.svgNS,"rect");return this._applyColor(h,"fill",this._fill),this._applyColor(h,"stroke",this._stroke),null!==this._strokeWidth&&h.setAttribute("stroke-width",this._strokeWidth.toString()),h.setAttribute("x",e.toFixed(1)),h.setAttribute("y",i.toFixed(1)),n>0&&n<.05?h.setAttribute("width","0.1"):h.setAttribute("width",n.toFixed(1)),r>0&&r<.05?h.setAttribute("height","0.1"):h.setAttribute("height",r.toFixed(1)),o&&h.setAttribute("clip-path","url(#"+o+")"),s&&h.setAttribute("class",s),this._applyStyle(h,a),this._appendChild(h),h},t.prototype.drawLine=function(e,i,n,r,s,a){var o=document.createElementNS(t.svgNS,"line");return this._applyColor(o,"stroke",this._stroke),null!==this._strokeWidth&&o.setAttribute("stroke-width",this._strokeWidth.toString()),o.setAttribute("x1",e.toFixed(1)),o.setAttribute("x2",n.toFixed(1)),o.setAttribute("y1",i.toFixed(1)),o.setAttribute("y2",r.toFixed(1)),s&&o.setAttribute("class",s),this._applyStyle(o,a),this._appendChild(o),o},t.prototype.drawLines=function(e,i,n,r,s){if(e&&i){var a=Math.min(e.length,i.length);if(a>0){var o=document.createElementNS(t.svgNS,"polyline");this._applyColor(o,"stroke",this._stroke),null!==this._strokeWidth&&o.setAttribute("stroke-width",this._strokeWidth.toString()),o.setAttribute("fill","none");for(var h="",l=0;l<a;l++)h+=e[l].toFixed(1)+","+i[l].toFixed(1)+" ";return o.setAttribute("points",h),n&&o.setAttribute("class",n),s&&o.setAttribute("clip-path","url(#"+s+")"),this._applyStyle(o,r),this._appendChild(o),o}}return null},t.prototype.drawSplines=function(e,i,n,r,s){if(e&&i){var a=new K(e,i).calculate(),o=a.xs,h=a.ys,l=Math.min(o.length,h.length);if(l>0){var u=document.createElementNS(t.svgNS,"polyline");this._applyColor(u,"stroke",this._stroke),null!==this._strokeWidth&&u.setAttribute("stroke-width",this._strokeWidth.toString()),u.setAttribute("fill","none");for(var c="",_=0;_<l;_++)c+=o[_].toFixed(1)+","+h[_].toFixed(1)+" ";return u.setAttribute("points",c),n&&u.setAttribute("class",n),s&&u.setAttribute("clip-path","url(#"+s+")"),this._applyStyle(u,r),this._appendChild(u),u}}return null},t.prototype.drawPolygon=function(e,i,n,r,s){if(e&&i){var a=Math.min(e.length,i.length);if(a>0){var o=document.createElementNS(t.svgNS,"polygon");this._applyColor(o,"stroke",this._stroke),null!==this._strokeWidth&&o.setAttribute("stroke-width",this._strokeWidth.toString()),this._applyColor(o,"fill",this._fill);for(var h="",l=0;l<a;l++)h+=e[l].toFixed(1)+","+i[l].toFixed(1)+" ";return o.setAttribute("points",h),n&&o.setAttribute("class",n),s&&o.setAttribute("clip-path","url(#"+s+")"),this._applyStyle(o,r),this._appendChild(o),o}}return null},t.prototype.drawPieSegment=function(e,n,r,s,a,o,h,l){if(a>=2*Math.PI)return this.drawEllipse(e,n,r,r,o,h);var u=document.createElementNS(t.svgNS,"path");this._applyColor(u,"fill",this._fill),this._applyColor(u,"stroke",this._stroke),null!==this._strokeWidth&&u.setAttribute("stroke-width",this._strokeWidth.toString());var c=new i.Point(e,n);c.x+=r*Math.cos(s),c.y+=r*Math.sin(s);var _=s+a,p=new i.Point(e,n);p.x+=r*Math.cos(_),p.y+=r*Math.sin(_);var d=" 0 0,1 ";Math.abs(a)>Math.PI&&(d=" 0 1,1 ");var f="M "+c.x.toFixed(1)+","+c.y.toFixed(1);return f+=" A "+r.toFixed(1)+","+r.toFixed(1)+d,f+=p.x.toFixed(1)+","+p.y.toFixed(1),f+=" L "+e.toFixed(1)+","+n.toFixed(1)+" z",u.setAttribute("d",f),l&&u.setAttribute("clip-path","url(#"+l+")"),o&&u.setAttribute("class",o),this._applyStyle(u,h),this._appendChild(u),u},t.prototype.drawDonutSegment=function(e,n,r,s,a,o,h,l,u){var c=!1;o>=2*Math.PI&&(c=!0,o-=.001);var _=document.createElementNS(t.svgNS,"path");this._applyColor(_,"fill",this._fill),this._applyColor(_,"stroke",this._stroke),null!==this._strokeWidth&&_.setAttribute("stroke-width",this._strokeWidth.toString());var p=new i.Point(e,n);p.x+=r*Math.cos(a),p.y+=r*Math.sin(a);var d=a+o,f=new i.Point(e,n);f.x+=r*Math.cos(d),f.y+=r*Math.sin(d);var g=new i.Point(e,n);g.x+=s*Math.cos(d),g.y+=s*Math.sin(d);var m=new i.Point(e,n);m.x+=s*Math.cos(a),m.y+=s*Math.sin(a);var y=" 0 0,1 ",b=" 0 0,0 ";Math.abs(o)>Math.PI&&(y=" 0 1,1 ",b=" 0 1,0 ");var v="M "+p.x.toFixed(3)+","+p.y.toFixed(3);return v+=" A "+r.toFixed(3)+","+r.toFixed(3)+y,v+=f.x.toFixed(3)+","+f.y.toFixed(3),v+=c?" M "+g.x.toFixed(3)+","+g.y.toFixed(3):" L "+g.x.toFixed(3)+","+g.y.toFixed(3),v+=" A "+s.toFixed(3)+","+s.toFixed(3)+b,v+=m.x.toFixed(3)+","+m.y.toFixed(3),c||(v+=" z"),_.setAttribute("d",v),u&&_.setAttribute("clip-path","url(#"+u+")"),h&&_.setAttribute("class",h),this._applyStyle(_,l),this._appendChild(_),_},t.prototype.drawString=function(t,e,i,n){var r=this._createText(e,t);i&&r.setAttribute("class",i),this._applyStyle(r,n),this._appendChild(r);var s,a=this._getKey(t,i,this._groupCls);return this._bbCache[a]?(s=this._bbCache[a],r.setAttribute("y",(e.y-(s.y+s.height)).toFixed(1))):(s=this._getBBox(r),r.setAttribute("y",(e.y-(s.y+s.height-e.y)).toFixed(1))),r},t.prototype.drawStringRotated=function(e,i,n,r,s,a){var o=this._createText(i,e);s&&o.setAttribute("class",s),this._applyStyle(o,a);var h=document.createElementNS(t.svgNS,"g");h.setAttribute("transform","rotate("+r.toFixed(1)+","+n.x.toFixed(1)+","+n.y.toFixed(1)+")"),h.appendChild(o),this._appendChild(h);var l=this._getBBox(o);return o.setAttribute("y",(i.y-(l.y+l.height-i.y)).toFixed(1)),o},t.prototype.measureString=function(t,e,n,r){var s=new i.Size(0,0);if(!this._fontFamily&&!this._fontSize){var a=this._getKey(t,e,n);if(this._bbCache[a])return this._bbCache[a]}this._fontSize&&this._text.setAttribute("font-size",this._fontSize),this._fontFamily&&this._text.setAttribute("font-family",this._fontFamily),e&&this._text.setAttribute("class",e),n&&this._textGroup.setAttribute("class",n),this._applyStyle(this._text,r),this._setText(this._text,t);var o=this._getBBox(this._text);if(s.width=o.width,s.height=o.height,this._text.removeAttribute("font-size"),this._text.removeAttribute("font-family"),this._text.removeAttribute("class"),r)for(var h in r)this._text.removeAttribute(this._deCase(h));if(this._textGroup.removeAttribute("class"),this._text.textContent=null,!this._fontFamily&&!this._fontSize){var l=this._getKey(t,e,n);this._bbCache[l]={x:o.x,y:o.y+1e3,width:o.width,height:o.height}}return s},t.prototype.startGroup=function(e,i,n){void 0===n&&(n=!1);var r=document.createElementNS(t.svgNS,"g");return e&&(r.setAttribute("class",e),this._groupCls=e),i&&r.setAttribute("clip-path","url(#"+i+")"),this._appendChild(r),n&&r.transform.baseVal.appendItem(this._svg.createSVGTransform()),this._group=r,r},t.prototype.endGroup=function(){if(this._group){var t=this._group.parentNode;t==this._svg?(this._group=null,this._groupCls=null):(this._group=t,this._groupCls=this._getClass(this._group))}},t.prototype.drawImage=function(e,i,n,r,s){var a=document.createElementNS(t.svgNS,"image");return a.setAttributeNS(t.xlinkNS,"href",e),a.setAttribute("x",i.toFixed(1)),a.setAttribute("y",n.toFixed(1)),a.setAttribute("width",r.toFixed(1)),a.setAttribute("height",s.toFixed(1)),this._appendChild(a),a},t.prototype._appendChild=function(t){var e=this._group;e||(e=this._svg),e.appendChild(t)},t.prototype._create=function(){this._svg=document.createElementNS(t.svgNS,"svg"),this._defs=document.createElementNS(t.svgNS,"defs"),this._svg.appendChild(this._defs),this._text=this._createText(new i.Point(-1e3,-1e3),""),this._textGroup=document.createElementNS(t.svgNS,"g"),this._textGroup.appendChild(this._text),this._svg.appendChild(this._textGroup)},t.prototype._setText=function(t,e){var i=e?e.toString():null;if(i&&i.indexOf("tspan")>=0)try{t.textContent=null;for(var n='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>",r=(new DOMParser).parseFromString(n,"text/xml").documentElement.firstChild;r;)t.appendChild(t.ownerDocument.importNode(r,!0)),r=r.nextSibling}catch(t){throw new Error("Error parsing XML string.")}else t.textContent=i},t.prototype._getKey=function(t,e,i){return t+(e||"")+(i||"")},t.prototype._createText=function(e,i){var n=document.createElementNS(t.svgNS,"text");return this._setText(n,i),n.setAttribute("x",e.x.toFixed(1)),n.setAttribute("y",e.y.toFixed(1)),null!=this._textFill&&n.setAttribute("fill",this._textFill),this._fontSize&&n.setAttribute("font-size",this._fontSize),this._fontFamily&&n.setAttribute("font-family",this._fontFamily),n},t.prototype._applyStyle=function(t,e){if(e)for(var i in e)"fill"===i||"stroke"===i?this._applyColor(t,i,e[i]):t.setAttribute(this._deCase(i),e[i])},t.prototype._deCase=function(t){return t.replace(/[A-Z]/g,function(t){return"-"+t.toLowerCase()})},t.prototype._getClass=function(t){var e;if(t)for(var i=t;i&&!(e=i.getAttribute("class"));i=i.parentNode);return e},t.prototype._getBBox=function(e){if(!t._isff)return e.getBBox();try{return e.getBBox()}catch(t){return{x:0,y:0,width:0,height:0}}},t.prototype._applyColor=function(e,n,r){var s=G.tryParse(r);if(null!=s)if(i.isString(s))e.setAttribute(n,s);else{if(null==this._savedGradient[r]){var a,o="gc"+(1e6*Math.random()).toFixed();null!=s.x1?(a=document.createElementNS(t.svgNS,"linearGradient"),["x1","y1","x2","y2","gradientUnits"].forEach(function(t){null!=s[t]&&a.setAttribute(t,s[t])})):null!=s.r&&(a=document.createElementNS(t.svgNS,"radialGradient"),["cx","cy","r","fx","fy","fr","gradientUnits"].forEach(function(t){null!=s[t]&&a.setAttribute(t,s[t])})),s.colors&&s.colors&&s.colors.length>0&&s.colors.forEach(function(e){var i=document.createElementNS(t.svgNS,"stop");null!=e.color&&i.setAttribute("stop-color",e.color),null!=e.offset&&i.setAttribute("offset",e.offset),null!=e.opacity&&i.setAttribute("stop-opacity",e.opacity),a.appendChild(i)}),a.setAttribute("id",o),this._defs.appendChild(a),this._savedGradient[r]=o}e.setAttribute(n,"url(#"+this._savedGradient[r]+")")}},t.svgNS="http://www.w3.org/2000/svg",t.xlinkNS="http://www.w3.org/1999/xlink",t}();e._SvgRenderEngine=z;var G=function(){function t(){}return t.tryParse=function(e){if(t.parsedColor[e])return t.parsedColor[e];if(null==e||-1===e.indexOf("-"))return e;var i,n=e.replace(/\s+/g,"").split(/\-/g),r=n[0][0],s=!1,a=n[0].match(/\(\S+\)/)[0].replace(/[\(\\)]/g,"").split(/\,/g);"l"===r||"L"===r?(i={x1:"0",y1:"0",x2:"0",y2:"0",colors:[]},"l"===r&&(s=!0),["x1","y1","x2","y2"].forEach(function(t,e){null!=a[e]&&(i[t]=s?100*+a[e]+"%":a[e]+"")})):"r"!==r&&"R"!==r||(i={cx:"0",cy:"0",r:"0",colors:[]},"r"===r&&(s=!0),["cx","cy","r","fx","fy","fr"].forEach(function(t,e){null!=a[e]&&""!==a[e]&&(i[t]=s?100*+a[e]+"%":a[e]+"")})),s||(i.gradientUnits="userSpaceOnUse"),t.parsedColor[e]=i;var o=n.length-1;return n.forEach(function(t,e){t.indexOf(")")>-1&&(t=t.match(/\)\S+/)[0].replace(")",""));var n=t.split(":"),r={color:"black"};null!=n[0]&&(r.color=n[0]),null!=n[1]?r.offset=s?100*+n[1]+"%":n[1]+"":r.offset=e/o*100+"%",null!=n[2]&&(r.opacity=n[2]),i.colors.push(r)}),i},t.parsedColor={},t}(),H=function(){function t(t){this._position=M.Right,this._title="",this._titleAlign="left",this._titlePadding=5,this._areas=new Array,this._sz=new i.Size,this._colRowLens=[],this._chart=t}return Object.defineProperty(t.prototype,"position",{get:function(){return this._position},set:function(t){(t=i.asEnum(t,M))!=this._position&&(this._position=t,this._chart&&this._chart.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"title",{get:function(){return this._title},set:function(t){t!=this._title&&(this._title=i.asString(t,!1),this._chart&&this._chart.invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"titleAlign",{get:function(){return this._titleAlign},set:function(t){if(t!=this._titleAlign){var e=i.asString(t,!1);this._titleAlign="right"===e?"right":"center"===e?"center":"left",this._chart&&this._chart.invalidate()}},enumerable:!0,configurable:!0}),t.prototype._getDesiredSize=function(t,e,i,n){if(e==M.None)return null;var r=e==M.Right||e==M.Left,s=this._chart._getDesiredLegendSize(t,r,i,n);if(null!=s){if(this.title.length>0){var a=t.measureString(this.title,"wj-title","wj-legend");s.height+=a.height+this._titlePadding,a.width>s.width&&(s.width=a.width)}this._sz=s}return s},t.prototype._getPosition=function(t,e){return this.position==M.Auto?t>=e?M.Right:M.Bottom:this.position},t.prototype._render=function(t,e,i,n,r){this._areas=[];var s=i==M.Right||i==M.Left;if(t.fill="transparent",t.stroke=null,t.drawRect(e.x,e.y,this._sz.width,this._sz.height),this.title.length){var a=t.drawString(this.title,e,"wj-title"),o=a.getBBox();a.setAttribute("y",Number(a.getAttribute("y"))+o.height),"right"===this.titleAlign?a.setAttribute("x",e.x+n-o.width):"center"===this.titleAlign&&a.setAttribute("x",e.x+n/2-o.width/2);var h=o.height+this._titlePadding;e.y+=h,r-=h}this._chart._renderLegend(t,e,this._areas,s,n,r)},t.prototype._hitTest=function(t){for(var e=this._areas,i=0;i<e.length;i++)if(e[i]&&y._contains(e[i],t))return i;return null},t}();e.Legend=H;var W;!function(t){t[t.PlotArea=0]="PlotArea",t[t.AxisX=1]="AxisX",t[t.AxisY=2]="AxisY",t[t.ChartArea=3]="ChartArea",t[t.Legend=4]="Legend",t[t.Header=5]="Header",t[t.Footer=6]="Footer",t[t.Series=7]="Series",t[t.SeriesSymbol=8]="SeriesSymbol",t[t.DataLabel=9]="DataLabel",t[t.None=10]="None"}(W=e.ChartElement||(e.ChartElement={}));var U=function(){function t(t,e,i){this._pointIndex=null,this._chartElement=W.None,this._chart=t,this._pt=e,this._chartElement=i}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"chartElement",{get:function(){return this._chartElement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"distance",{get:function(){return this._dist},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"item",{get:function(){if(null==this._item&&null!==this.pointIndex)if(null!=this.series)this._item=this.series._getItem(this.pointIndex);else{var t=this._chart._getHitTestItem(this.pointIndex);t&&(this._item=t)}return this._item},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){return void 0===this._x&&(this._x=this._getValue(1,!1)),this._x},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){return void 0===this._y&&(this._y=this._getValue(0,!1)),this._y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"value",{get:function(){var t=this._chart._getHitTestValue(this.pointIndex);return null!=t?t:this.y},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"name",{get:function(){if(void 0===this._name){var t=this._chart._getHitTestLabel(this.pointIndex);return null==t?this.series.name:t.toString()}return this._name},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_xfmt",{get:function(){return void 0===this.__xfmt&&(this.__xfmt=this._getValue(1,!0)),this.__xfmt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"_yfmt",{get:function(){return void 0===this.__yfmt&&(this.__yfmt=this._getValue(0,!0)),this.__yfmt},enumerable:!0,configurable:!0}),t.prototype._setData=function(t,e){this._series=t,this._pointIndex=e},t.prototype._setDataPoint=function(t){if(t=i.asType(t,ot,!0)){this._pointIndex=t.pointIndex;var e=i.asType(this._chart,y,!0),n=t.seriesIndex;null!==n&&n>=0&&n<e.series.length&&(this._series=e.series[n]),null!=t.item&&(this._item=t.item),null!=t.x&&(this._x=t.x),null!=t.y&&(this._y=t.y),null!=t.xfmt&&(this.__xfmt=t.xfmt),null!=t.yfmt&&(this.__yfmt=t.yfmt),null!=t.name&&(this._name=t.name)}},t.prototype._getValue=function(t,e){var n=this._chart._getHitTestValue(this.pointIndex);if(null!=n)return n;var r=null,s=this._chart,a=this.pointIndex,o=s._isRotated();if(null!==this.series&&null!==a){var h=this.series.getValues(t),l=this.series.getDataType(t);h&&this.pointIndex<h.length?(r=h[this.pointIndex],l!=i.DataType.Date||e||(r=new Date(r))):1==t&&(s._xlabels&&s._xlabels.length>0&&a<s._xlabels.length?r=s._xlabels[a]:s._xvals&&a<s._xvals.length&&(r=s._xvals[a],s._xDataType!=i.DataType.Date||e||(r=new Date(r))))}return null!==r&&e&&(o?0==t?r=this.ax._formatValue(r):1==t&&(r=this.ay._formatValue(r)):0==t?r=this.ay._formatValue(r):1==t&&(r=this.ax._formatValue(r))),r},Object.defineProperty(t.prototype,"ax",{get:function(){return this.series.axisX?this.series.axisX:this._chart.axisX},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"ay",{get:function(){return this.series.axisY?this.series.axisY:this._chart.axisY},enumerable:!0,configurable:!0}),t}();e.HitTestInfo=U;var q=function(){function t(){}return t.standard=["#88bde6","#fbb258","#90cd97","#f6aac9","#bfa554","#bc99c7","#eddd46","#f07e6e","#8c8c8c"],t.cocoa=["#466bb0","#c8b422","#14886e","#b54836","#6e5944","#8b3872","#73b22b","#b87320","#141414"],t.coral=["#84d0e0","#f48256","#95c78c","#efa5d6","#ba8452","#ab95c2","#ede9d0","#e96b7d","#888888"],t.dark=["#005fad","#f06400","#009330","#e400b1","#b65800","#6a279c","#d5a211","#dc0127","#000000"],t.highcontrast=["#ff82b0","#0dda2c","#0021ab","#bcf28c","#19c23b","#890d3a","#607efd","#1b7700","#000000"],t.light=["#ddca9a","#778deb","#cb9fbb","#b5eae2","#7270be","#a6c7a7","#9e95c7","#95b0c7","#9b9b9b"],t.midnight=["#83aaca","#e37849","#14a46a","#e097da","#a26d54","#a584b7","#d89c54","#e86996","#2c343b"],t.modern=["#2d9fc7","#ec993c","#89c235","#e377a4","#a68931","#a672a6","#d0c041","#e35855","#68706a"],t.organic=["#9c88d9","#a3d767","#8ec3c0","#e9c3a9","#91ab36","#d4ccc0","#61bbd8","#e2d76f","#80715a"],t.slate=["#7493cd","#f99820","#71b486","#e4a491","#cb883b","#ae83a4","#bacc5c","#e5746a","#505d65"],t.zen=["#7bb5ae","#e2d287","#92b8da","#eac4cb","#7b8bbd","#c7d189","#b9a0c8","#dfb397","#a9a9a9"],t.cyborg=["#2a9fd6","#77b300","#9933cc","#ff8800","#cc0000","#00cca3","#3d6dcc","#525252","#000000"],t.superhero=["#5cb85c","#f0ad4e","#5bc0de","#d9534f","#9f5bde","#46db8c","#b6b86e","#4e5d6c","#2b3e4b"],t.flatly=["#18bc9c","#3498db","#f39c12","#6cc1be","#99a549","#8f54b5","#e74c3c","#8a9899","#2c3e50"],t.darkly=["#375a7f","#00bc8c","#3498db","#f39c12","#e74c3c","#8f61b3","#b08725","#4a4949","#000000"],t.cerulan=["#033e76","#87c048","#59822c","#53b3eb","#fc6506","#d42323","#e3bb00","#cccccc","#222222"],t}();e.Palettes=q;var K=function(){function t(t,e){this.k=.002,this._a=[],this._b=[],this._c=[],this._d=[],this.m=[[-.5,1.5,-1.5,.5],[1,-2.5,2,-.5],[-.5,0,.5,0],[0,1,0,0]],this._x=t,this._y=e;var n=this._len=Math.min(t.length,e.length);if(n>3)for(var r=0;r<n-1;r++){var s=0==r?new i.Point(t[r],e[r]):new i.Point(t[r-1],e[r-1]),a=new i.Point(t[r],e[r]),o=new i.Point(t[r+1],e[r+1]),h=r==n-2?new i.Point(t[r+1],e[r+1]):new i.Point(t[r+2],e[r+2]),l=new i.Point,u=new i.Point,c=new i.Point,_=new i.Point;l.x=s.x*this.m[0][0]+a.x*this.m[0][1]+o.x*this.m[0][2]+h.x*this.m[0][3],u.x=s.x*this.m[1][0]+a.x*this.m[1][1]+o.x*this.m[1][2]+h.x*this.m[1][3],c.x=s.x*this.m[2][0]+a.x*this.m[2][1]+o.x*this.m[2][2]+h.x*this.m[2][3],_.x=s.x*this.m[3][0]+a.x*this.m[3][1]+o.x*this.m[3][2]+h.x*this.m[3][3],l.y=s.y*this.m[0][0]+a.y*this.m[0][1]+o.y*this.m[0][2]+h.y*this.m[0][3],u.y=s.y*this.m[1][0]+a.y*this.m[1][1]+o.y*this.m[1][2]+h.y*this.m[1][3],c.y=s.y*this.m[2][0]+a.y*this.m[2][1]+o.y*this.m[2][2]+h.y*this.m[2][3],_.y=s.y*this.m[3][0]+a.y*this.m[3][1]+o.y*this.m[3][2]+h.y*this.m[3][3],this._a.push(l),this._b.push(u),this._c.push(c),this._d.push(_)}}return t.prototype.calculatePoint=function(t){var e=Math.floor(t);e<0&&(e=0),e>this._len-2&&(e=this._len-2);var i=t-e;return{x:((this._a[e].x*i+this._b[e].x)*i+this._c[e].x)*i+this._d[e].x,y:((this._a[e].y*i+this._b[e].y)*i+this._c[e].y)*i+this._d[e].y}},t.prototype.calculate=function(){if(this._len<=3)return{xs:this._x,ys:this._y};var t=[],e=[],i=this.calculatePoint(0);t.push(i.x),e.push(i.y);for(var n=this._len*this.k,r=n;r<=this._len-1;r+=n){var s=this.calculatePoint(r);(Math.abs(i.x-s.x)>=3||Math.abs(i.y-s.y)>=3)&&(t.push(s.x),e.push(s.y),i=s)}return{xs:t,ys:e}},t}();e._Spline=K;var Z;!function(t){t[t.None=0]="None",t[t.Left=1]="Left",t[t.Top=2]="Top",t[t.Right=3]="Right",t[t.Bottom=4]="Bottom",t[t.Center=5]="Center"}(Z=e.LabelPosition||(e.LabelPosition={}));var J;!function(t){t[t.None=0]="None",t[t.Inside=1]="Inside",t[t.Center=2]="Center",t[t.Outside=3]="Outside",t[t.Radial=4]="Radial",t[t.Circular=5]="Circular"}(J=e.PieLabelPosition||(e.PieLabelPosition={}));var Q=function(t){function e(e,i,n,r){var s=t.call(this,e)||this;return s.cancel=!1,s._ht=i,s._pt=n,s._text=r,s}return __extends(e,t),Object.defineProperty(e.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"text",{get:function(){return this._text},set:function(t){this._text=i.asString(t)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hitTestInfo",{get:function(){return this._ht},enumerable:!0,configurable:!0}),e}(a);e.DataLabelRenderEventArgs=Q;var $=function(){function t(){this.rendering=new i.Event}return Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(t){t!=this._content&&(this._content=t,this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"border",{get:function(){return this._bdr},set:function(t){t!=this._bdr&&(this._bdr=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"offset",{get:function(){return this._off},set:function(t){t!=this._off&&(this._off=i.asNumber(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"connectingLine",{get:function(){return this._line},set:function(t){t!=this._line&&(this._line=i.asBoolean(t,!0),this._invalidate())},enumerable:!0,configurable:!0}),t.prototype.onRendering=function(t){return this.rendering.raise(this,t),!t.cancel},t.prototype._invalidate=function(){this._chart&&this._chart.invalidate()},t}();e.DataLabelBase=$;var tt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._pos=Z.Top,e}return __extends(e,t),Object.defineProperty(e.prototype,"position",{get:function(){return this._pos},set:function(t){(t=i.asEnum(t,Z))!=this._pos&&(this._pos=t,this._invalidate())},enumerable:!0,configurable:!0}),e}($);e.DataLabel=tt;var et=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._pos=J.Center,e}return __extends(e,t),Object.defineProperty(e.prototype,"position",{get:function(){return this._pos},set:function(t){(t=i.asEnum(t,J))!=this._pos&&(this._pos=t,this._invalidate())},enumerable:!0,configurable:!0}),e}($);e.PieDataLabel=et;var it,nt=new(function(){function t(){this._moveMarker=function(t){var e=t.currentTarget,i=this._markers,n=e.getAttribute("data-markerIndex");null!=n&&i[n].forEach(function(e){e._moveMarker(t)})},this._markers=[],this._bindMoveMarker=this._moveMarker.bind(this)}return t.prototype.attach=function(t){var e,n,r=t.chart.hostElement,s=this._markers,a=r.getAttribute("data-markerIndex");null!=a?(n=s[a])&&i.isArray(n)?n.push(t):(s[a]=[t],this._bindMoveEvent(r)):(e=s.length,n=[t],s.push(n),r.setAttribute("data-markerIndex",e),this._bindMoveEvent(r))},t.prototype.detach=function(t){var e,i,n=t.chart.hostElement,r=this._markers,s=n.getAttribute("data-markerIndex");null!=s&&((e=(i=r[s]).indexOf(t))>-1&&i.splice(e,1),0===i.length&&((e=r.indexOf(i))>-1&&(r[e]=void 0),this._unbindMoveEvent(n)))},t.prototype._unbindMoveEvent=function(t){var e=this._bindMoveMarker;t.removeEventListener("mousemove",e),"ontouchstart"in window&&t.removeEventListener("touchmove",e)},t.prototype._bindMoveEvent=function(t){var e=this._bindMoveMarker;t.addEventListener("mousemove",e),"ontouchstart"in window&&t.addEventListener("touchmove",e)},t}());!function(t){t[t.None=0]="None",t[t.Vertical=1]="Vertical",t[t.Horizontal=2]="Horizontal",t[t.Both=3]="Both"}(it=e.LineMarkerLines||(e.LineMarkerLines={}));var rt;!function(t){t[t.None=0]="None",t[t.Move=1]="Move",t[t.Drag=2]="Drag"}(rt=e.LineMarkerInteraction||(e.LineMarkerInteraction={}));var st;!function(t){t[t.Auto=2]="Auto",t[t.Right=0]="Right",t[t.Left=1]="Left",t[t.Bottom=4]="Bottom",t[t.Top=6]="Top"}(st=e.LineMarkerAlignment||(e.LineMarkerAlignment={}));var at=function(){function t(t,e){this._wrapperMousedown=null,this._wrapperMouseup=null,this.positionChanged=new i.Event;var n=this;n._chart=t,t.rendered.addHandler(n._initialize,n),n._resetDefaultValue(),i.copy(this,e),n._initialize()}return Object.defineProperty(t.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){var e=this;t!==e._isVisible&&(e._isVisible=i.asBoolean(t),e._marker&&e._toggleVisibility())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"seriesIndex",{get:function(){return this._seriesIndex},set:function(t){var e=this;t!==e._seriesIndex&&(e._seriesIndex=i.asNumber(t,!0))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"horizontalPosition",{get:function(){return this._horizontalPosition},set:function(t){var e=this;if(t!==e._horizontalPosition){if(e._horizontalPosition=i.asNumber(t,!0),e._horizontalPosition<0||e._horizontalPosition>1)throw"horizontalPosition's value should be in (0, 1).";e._marker&&e._updateMarkerPosition()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"x",{get:function(){var t=this,e=t._targetPoint.x-t._plotRect.left;return t._chart.axisX.convertBack(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"y",{get:function(){var t=this,e=t._targetPoint.y-t._plotRect.top;return t._chart.axisY.convertBack(e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"content",{get:function(){return this._content},set:function(t){t!==this._content&&(this._content=i.asFunction(t),this._updateMarkerPosition())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"verticalPosition",{get:function(){return this._verticalPosition},set:function(t){var e=this;if(t!==e._verticalPosition){if(e._verticalPosition=i.asNumber(t,!0),e._verticalPosition<0||e._verticalPosition>1)throw"verticalPosition's value should be in (0, 1).";e._marker&&e._updateMarkerPosition()}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alignment",{get:function(){return this._alignment},set:function(t){var e=this;t!==e._alignment&&(e._alignment=t,e._marker&&e._updatePositionByAlignment())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"lines",{get:function(){return this._lines},set:function(t){(t=i.asEnum(t,it))!=this._lines&&(this._lines=t,this._marker&&this._resetLinesVisibility())},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"interaction",{get:function(){return this._interaction},set:function(t){(t=i.asEnum(t,rt))!=this._interaction&&(this._marker&&this._detach(),this._interaction=t,this._marker&&this._attach(),this._toggleElesDraggableClass(this._interaction==rt.Drag))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragThreshold",{get:function(){return this._dragThreshold},set:function(t){t!=this._dragThreshold&&(this._dragThreshold=i.asNumber(t))},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragContent",{get:function(){return this._dragContent},set:function(e){var n=this;e!==n._dragContent&&(n._dragContent=i.asBoolean(e)),i.toggleClass(n._dragEle,t._CSS_LINE_DRAGGABLE,n._interaction===rt.Drag&&n._dragContent&&n._lines!==it.None)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dragLines",{get:function(){return this._dragLines},set:function(t){t!=this._dragLines&&(this._dragLines=i.asBoolean(t))},enumerable:!0,configurable:!0}),t.prototype.onPositionChanged=function(t){this.positionChanged.raise(this,t)},t.prototype.remove=function(){var t=this,e=t._chart;t._marker&&(e.rendered.removeHandler(t._initialize,t),t._detach(),t._removeMarker(),t._wrapperMoveMarker=null,t._wrapperMousedown=null,t._wrapperMouseup=null)},t.prototype._attach=function(){var e=this,n=e._chart.hostElement;this._interaction!==rt.None?i.addClass(n,t._CSS_TOUCH_DISABLED):i.removeClass(n,t._CSS_TOUCH_DISABLED),nt.attach(e),e._attachDrag()},t.prototype._attachDrag=function(){var t=this;t._interaction===rt.Drag&&(t._wrapperMousedown||(t._wrapperMousedown=t._onMousedown.bind(t)),t._wrapperMouseup||(t._wrapperMouseup=t._onMouseup.bind(t)),t._toggleDragEventAttach(!0))},t.prototype._detach=function(){var e=this;i.removeClass(e._chart.hostElement,t._CSS_TOUCH_DISABLED),nt.detach(e),e._detachDrag()},t.prototype._detachDrag=function(){var t=this;t._interaction===rt.Drag&&t._toggleDragEventAttach(!1)},t.prototype._toggleDragEventAttach=function(t){var e=this,i=e._chart.hostElement,n=t?"addEventListener":"removeEventListener";i[n]("mousedown",e._wrapperMousedown),document[n]("mouseup",e._wrapperMouseup),"ontouchstart"in window&&i[n]("touchstart",e._wrapperMousedown),"ontouchend"in window&&document[n]("touchend",e._wrapperMouseup)},t.prototype._onMousedown=function(e){var n,r,s,a,o,h=this,l=h._getEventPoint(e);h._interaction===rt.Drag&&(a=!(0===(n=i.getElementRect(h._hLine)).width||0===n.height),o=!(0===(r=i.getElementRect(h._vLine)).width||0===r.height),s=i.getElementRect(h._markerContent),h._dragContent&&h._pointInRect(l,s)?(h._capturedEle=h._markerContent,h._contentDragStartPoint=new i.Point(l.x,l.y),h._mouseDownCrossPoint=new i.Point(h._targetPoint.x,h._targetPoint.y)):a&&(Math.abs(n.top-l.y)<=h._dragThreshold||Math.abs(l.y-n.top-n.height)<=h._dragThreshold||l.y>=n.top&&l.y<=n.top+n.height)?(h._capturedEle=h._hLine,h._contentDragStartPoint=void 0,i.addClass(h._chart.hostElement,t._CSS_LINE_DRAGGABLE)):o&&(Math.abs(r.left-l.x)<=h._dragThreshold||Math.abs(l.x-r.left-r.width)<=h._dragThreshold||l.x>=r.left&&l.x<=r.left+r.width)&&(h._capturedEle=h._vLine,h._contentDragStartPoint=void 0,i.addClass(h._chart.hostElement,t._CSS_LINE_DRAGGABLE)),e.preventDefault())},t.prototype._onMouseup=function(e){var n=this,r=n._alignment===st.Auto&&n._capturedEle===n._markerContent&&n._lines!==it.None;n._capturedEle=void 0,n._contentDragStartPoint=void 0,n._mouseDownCrossPoint=void 0,r&&(n._updatePositionByAlignment(),n._updatePositionByAlignment()),i.removeClass(n._chart.hostElement,t._CSS_LINE_DRAGGABLE)},t.prototype._moveMarker=function(t){var e,n,r,s,a,o,h=this,l=h._chart,u=h._getEventPoint(t),c=h._plotRect,_=h._interaction===rt.Drag,p=h._lines===it.Horizontal,d=h._lines===it.Vertical,f=h._seriesIndex,g=i.getElementRect(l.hostElement);if(c&&h._isVisible&&h._interaction!==rt.None&&(h._interaction!==rt.Drag||h._capturedEle&&h._lines!==it.None)){if(_&&(h._contentDragStartPoint?(u.x=p?h._targetPoint.x:h._mouseDownCrossPoint.x+u.x-h._contentDragStartPoint.x,u.y=d?h._targetPoint.y:h._mouseDownCrossPoint.y+u.y-h._contentDragStartPoint.y):p||!h._dragLines&&h._capturedEle===h._hLine?u.x=h._targetPoint.x:(d||!h._dragLines&&h._capturedEle===h._vLine)&&(u.y=h._targetPoint.y)),_&&h._lines===it.Horizontal||!h._dragLines&&h._capturedEle===h._hLine){if(u.y<=c.top||u.y>=c.top+c.height)return}else if(_&&h._lines===it.Vertical||!h._dragLines&&h._capturedEle===h._vLine){if(u.x<=c.left||u.x>=c.left+c.width)return}else if(u.x<=c.left||u.y<=c.top||u.x>=c.left+c.width||u.y>=c.top+c.height)return;if(null!=f&&f>=0&&f<l.series.length){if(e=l.series[f],null==(n=e.hitTest(new i.Point(u.x,NaN)))||null==n.x||null==n.y)return;r=e.axisX||l.axisX,s=e._getAxisY(),a=i.isDate(n.x)?S._toOADate(n.x):n.x,a=i.isString(a)?n.pointIndex:a,o=i.isDate(n.y)?S._toOADate(n.y):n.y,u.x=r.convert(a)+g.left,u.y=s.convert(o)+g.top}h._updateMarkerPosition(u),t.preventDefault()}},t.prototype._show=function(t){(t||this._marker).style.display="block"},t.prototype._hide=function(t){(t||this._marker).style.display="none"},t.prototype._toggleVisibility=function(){this._isVisible?this._show():this._hide()},t.prototype._resetDefaultValue=function(){var t=this;t._isVisible=!0,t._alignment=st.Auto,t._lines=it.None,t._interaction=rt.None,t._horizontalPosition=null,t._verticalPosition=null,t._content=null,t._seriesIndex=null,t._dragThreshold=15,t._dragContent=!1,t._dragLines=!1,t._targetPoint=new i.Point},t.prototype._initialize=function(){var t,e=this,n=e._chart.hostElement.querySelector("."+S._CSS_PLOT_AREA);e._plot=n,e._marker||e._createMarker(),n&&(e._plotRect=i.getElementRect(n),t=n.getBBox(),e._plotRect.width=t.width,e._plotRect.height=t.height,e._updateMarkerSize(),e._updateLinesSize()),e._updateMarkerPosition(),e._wrapperMoveMarker=e._moveMarker.bind(e),e._attach()},t.prototype._createMarker=function(){var e,n,r=this;e=document.createElement("div"),i.addClass(e,t._CSS_MARKER),(n=r._getContainer()).appendChild(e),r._markerContainer=n,r._marker=e,r._createChildren()},t.prototype._removeMarker=function(){var t=this,e=t._markerContainer;e.removeChild(t._marker),t._content=null,t._hLine=null,t._vLine=null,e.hasChildNodes()||(t._chart.hostElement.removeChild(t._markerContainer),t._markerContainer=null),t._marker=null},t.prototype._getContainer=function(){var e=this._chart.hostElement.querySelector(t._CSS_MARKER_CONTAINER);return e||(e=this._createContainer()),e},t.prototype._createContainer=function(){var e=document.createElement("div"),n=this._chart.hostElement;return i.addClass(e,t._CSS_MARKER_CONTAINER),n.insertBefore(e,n.firstChild),e},t.prototype._createChildren=function(){var e,n,r,s,a=this,o=a._marker;(s=document.createElement("div")).style.position="absolute",s.style.height="100%",s.style.width="100%",o.appendChild(s),a._dragEle=s,e=document.createElement("div"),i.addClass(e,t._CSS_MARKER_CONTENT),o.appendChild(e),a._markerContent=e,n=document.createElement("div"),i.addClass(n,t._CSS_MARKER_HLINE),o.appendChild(n),a._hLine=n,r=document.createElement("div"),i.addClass(r,t._CSS_MARKER_VLINE),o.appendChild(r),a._vLine=r,a._toggleElesDraggableClass(a._interaction===rt.Drag),a._resetLinesVisibility()},t.prototype._toggleElesDraggableClass=function(e){var n=this;i.toggleClass(n._hLine,t._CSS_LINE_DRAGGABLE,e),i.toggleClass(n._vLine,t._CSS_LINE_DRAGGABLE,e),i.toggleClass(n._dragEle,t._CSS_LINE_DRAGGABLE,e&&n._dragContent&&n._lines!==it.None)},t.prototype._updateMarkerSize=function(){var t=this,e=t._plotRect,n=t._chart.hostElement,r=window.getComputedStyle(n,null),s=i.getElementRect(n);t._marker&&(t._marker.style.marginTop=e.top-s.top-(parseFloat(r.getPropertyValue("padding-top"))||0)+"px",t._marker.style.marginLeft=e.left-s.left-(parseFloat(r.getPropertyValue("padding-left"))||0)+"px")},t.prototype._updateLinesSize=function(){var t=this,e=t._plotRect;t._hLine&&t._vLine&&(t._hLine.style.width=e.width+"px",t._vLine.style.height=e.height+"px")},t.prototype._resetLinesVisibility=function(){var t=this;t._hLine&&t._vLine&&(t._hide(t._hLine),t._hide(t._vLine),t._lines!==it.Horizontal&&t._lines!==it.Both||t._show(t._hLine),t._lines!==it.Vertical&&t._lines!==it.Both||t._show(t._vLine))},t.prototype._updateMarkerPosition=function(t){var e,i,n=this,r=n._plotRect,s=n._targetPoint,a=!1;n._interaction;n._plot&&(e=r.left+r.width*(n._horizontalPosition||0),i=r.top+r.height*(n._verticalPosition||0),null==n._horizontalPosition&&t&&(e=t.x),null==n._verticalPosition&&t&&(i=t.y),e===s.x&&i===s.y||(a=!0),s.x=e,s.y=i,n._toggleVisibility(),n._content&&n._updateContent(),a&&n._raisePositionChanged(e,i),n._updatePositionByAlignment(!!t))},t.prototype._updateContent=function(){var t,e=this,i=e._chart,n=e._targetPoint,r=i.hitTest(n);t=e._content.call(null,r,n),e._markerContent.innerHTML=t||""},t.prototype._raisePositionChanged=function(t,e){this._plotRect;this.onPositionChanged(new i.Point(t,e))},t.prototype._updatePositionByAlignment=function(t){var e=this,i=e._alignment,n=e._targetPoint,r=e._marker,s=0,a=0,o=r.clientWidth,h=r.clientHeight,l=e._plotRect;e._plot&&(!e._capturedEle||e._capturedEle&&e._capturedEle!==e._markerContent?(i===st.Auto?(n.x+o+12>l.left+l.width&&n.x-o>=0&&(a=o),s=h,n.y-h<l.top&&(s=0)):(1==(1&i)&&(a=o),2==(2&i)&&(s=h)),e._interaction===rt.Move&&0===s&&0===a&&(a=-12)):(parseInt(e._hLine.style.top)>0&&(s=h),parseInt(e._vLine.style.left)>0&&(a=o)),r.style.left=n.x-a-l.left+"px",r.style.top=n.y-s-l.top+"px",e._hLine.style.top=s+"px",e._hLine.style.left=l.left-n.x+a+"px",e._vLine.style.top=l.top-n.y+s+"px",e._vLine.style.left=a+"px")},t.prototype._getEventPoint=function(t){return t instanceof MouseEvent?new i.Point(t.pageX,t.pageY):new i.Point(t.changedTouches[0].pageX,t.changedTouches[0].pageY)},t.prototype._pointInRect=function(t,e){return!(!t||!e)&&(t.x>=e.left&&t.x<=e.left+e.width&&t.y>=e.top&&t.y<=e.top+e.height)},t._CSS_MARKER="wj-chart-linemarker",t._CSS_MARKER_HLINE="wj-chart-linemarker-hline",t._CSS_MARKER_VLINE="wj-chart-linemarker-vline",t._CSS_MARKER_CONTENT="wj-chart-linemarker-content",t._CSS_MARKER_CONTAINER="wj-chart-linemarker-container",t._CSS_LINE_DRAGGABLE="wj-chart-linemarker-draggable",t._CSS_TOUCH_DISABLED="wj-flexchart-touch-disabled",t}();e.LineMarker=at;var ot=function(){function t(t,e,i,n){this._seriesIndex=t,this._pointIndex=e,this._dataX=i,this._dataY=n}return Object.defineProperty(t.prototype,"seriesIndex",{get:function(){return this._seriesIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataX",{get:function(){return this._dataX},set:function(t){t!==this._dataX&&(this._dataX=t)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"dataY",{get:function(){return this._dataY},set:function(t){t!==this._dataY&&(this._dataY=t)},enumerable:!0,configurable:!0}),t}();e._DataPoint=ot;var ht;!function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.XY=2]="XY"}(ht=e._MeasureOption||(e._MeasureOption={}));var lt=function(){function t(t){this._rect=t}return Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){var e=this._rect;return t.x>=e.left&&t.x<=e.right&&t.y>=e.top&&t.y<=e.bottom},t.prototype.pointDistance=function(t,e,i){var n=e.x-t.x,r=e.y-t.y;return i==ht.X?Math.abs(n):i==ht.Y?Math.abs(r):Math.sqrt(n*n+r*r)},t.prototype.distance=function(t){var e=ht.XY;null===t.x?e=ht.Y:null===t.y&&(e=ht.X);var n=this._rect;return t.x<n.left?t.y<n.top?this.pointDistance(t,new i.Point(n.left,n.top),e):t.y>n.bottom?this.pointDistance(t,new i.Point(n.left,n.bottom),e):e==ht.Y?0:n.left-t.x:t.x>n.right?t.y<n.top?this.pointDistance(t,new i.Point(n.right,n.top),e):t.y>n.bottom?this.pointDistance(t,new i.Point(n.right,n.bottom),e):e==ht.Y?0:t.x-n.right:e==ht.X?0:t.y<n.top?n.top-t.y:t.y>n.bottom?t.y-n.bottom:0},t}();e._RectArea=lt;var ut=function(){function t(t,e){this._center=t,this.setRadius(e)}return t.prototype.setRadius=function(t){this._rad=t,this._rad2=t*t},Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),t.prototype.contains=function(t){var e=this._center.x-t.x,i=this._center.y-t.y;return e*e+i*i<=this._rad2},t.prototype.distance=function(t){var e=isNaN(t.x)?0:this._center.x-t.x,i=isNaN(t.y)?0:this._center.y-t.y,n=e*e+i*i;return n<=this._rad2?0:Math.sqrt(n)-this._rad},t}();e._CircleArea=ut;var ct=function(){function t(t,e){this._x=[],this._y=[],this._x=t,this._y=e}return t.prototype.contains=function(t){return!1},t.prototype.distance=function(t){for(var e=NaN,n=0;n<this._x.length-1;n++){var r=S._dist(t,new i.Point(this._x[n],this._y[n]),new i.Point(this._x[n+1],this._y[n+1]));(isNaN(e)||r<e)&&(e=r)}return e},t}();e._LinesArea=ct;var _t=function(){return function(){}}();e._HitResult=_t;var pt=function(){function t(t){this._map={},this._chart=t}return t.prototype.add=function(t,e){this._map[e]&&(t.tag||(t.tag=new ot(e,NaN,NaN,NaN)),this._map[e].push(t))},t.prototype.clear=function(){this._map={};for(var t=this._chart.series,e=0;e<t.length;e++)t[e].hitTest===B.prototype.hitTest&&(this._map[e]=new Array)},t.prototype.hitTest=function(t,e){void 0===e&&(e=!1);for(var n=null,r=Number.MAX_VALUE,s=this._chart.series.length-1;s>=0;s--){var a=this._map[s];if(a){for(var o=a.length-1;o>=0;o--){var h=a[o];if(!i.tryCast(h,ct)||e){var l=h.distance(t);if(l<r&&(r=l,n=h,0==r))break}}if(0==r)break}}if(n){var u=new _t;return u.area=n,u.distance=r,u}return null},t.prototype.hitTestSeries=function(t,e){var i=null,n=Number.MAX_VALUE,r=this._map[e];if(r)for(var s=r.length-1;s>=0;s--){var a=r[s],o=a.distance(t);if(o<n&&(n=o,i=a,0==n))break}if(i){var h=new _t;return h.area=i,h.distance=n,h}return null},t}();e._HitTester=pt;var dt=function(){function t(){this._DEFAULT_WIDTH=2,this._DEFAULT_SYM_SIZE=10,this.clipping=!0}return t.prototype.clear=function(){this.seriesCount=0,this.seriesIndex=0},t.prototype._renderLabels=function(t,e,n,r,s){var a=n.length,o=r.dataLabel,h=o.border,l=o.offset,u=o.connectingLine;void 0===l&&(l=u?16:0),h&&(l-=2);for(var c=0;c<a;c++){var _=n[c],p=i.asType(_.tag,ot,!0);p&&this._renderLabel(t,_,p,r,o,e,l,s)}},t.prototype._renderLabel=function(t,e,i,n,r,s,a,o){var h=null==r.position?Z.Top:r.position,l=r.border,u=r.connectingLine,c=new U(n,p);c._setDataPoint(i);var _=n._getLabelContent(c,r.content),p=this._getLabelPoint(s,i);if(this._getPointAndPosition(p,h,e,n),n._plotRect.contains(p)){var d=new Q(t,c,p,_);if(r.onRendering&&(r.onRendering(d)?(_=d.text,p=d.point):_=null),_){var f=this._renderLabelAndBorder(t,_,h,a,p,u,2,l);if(f){var g=new lt(f);g.tag=i,o.push(g)}}}},t.prototype._getPointAndPosition=function(t,e,i,n){if(i instanceof lt){var r=i;n._isRotated()?t.y=r.rect.top+.5*r.rect.height:t.x=r.rect.left+.5*r.rect.width}},t.prototype._getLabelPoint=function(t,e){var n=t._getAxisX(),r=t._getAxisY();return new i.Point(n.convert(e.dataX),r.convert(e.dataY))},t.prototype._renderLabelAndBorder=function(t,e,i,n,r,s,a,o){var h,l="wj-data-label",u="wj-data-label-line",c=S._CSS_DATA_LABELS;switch(i){case Z.Top:s&&t.drawLine(r.x,r.y,r.x,r.y-n,u),r.y-=a+n,h=S._renderText(t,e,r,1,2,l,c);break;case Z.Bottom:s&&t.drawLine(r.x,r.y,r.x,r.y+n,u),r.y+=a+n,h=S._renderText(t,e,r,1,0,l,c);break;case Z.Left:s&&t.drawLine(r.x,r.y,r.x-n,r.y,u),r.x-=a+n,h=S._renderText(t,e,r,2,1,l,c);break;case Z.Right:s&&t.drawLine(r.x,r.y,r.x+n,r.y,u),r.x+=a+n,h=S._renderText(t,e,r,0,1,l,c);break;case Z.Center:h=S._renderText(t,e,r,1,1,l,c)}return o&&h&&t.drawRect(h.left-a,h.top-a,h.width+2*a,h.height+2*a,"wj-data-label-border"),h},t.prototype.getOption=function(t,e){var n=this.chart.options;if(e&&(n=n?n[e]:null),n&&!i.isUndefined(n[t])&&null!==n[t])return n[t]},t.prototype.getNumOption=function(t,e){var n=this.chart.options;if(e&&(n=n?n[e]:null),n&&n[t])return i.asNumber(n[t],!0)},t.cloneStyle=function(t,e){if(!t)return t;var i={};for(var n in t)e&&e.indexOf(n)>=0||(i[n]=t[n]);return i},t.prototype.isValid=function(t,e,n,r){return v.isValid(t)&&v.isValid(e)&&S._contains(this.chart._plotRect,new i.Point(t,e))},t.prototype.load=function(){},t.prototype.unload=function(){},t}();e._BasePlotter=dt;var ft=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.origin=0,e.width=.7,e.isVolume=!1,e._volHelper=null,e.stackPosMap={},e.stackNegMap={},e.stacking=g.None,e}return __extends(e,t),e.prototype.clear=function(){t.prototype.clear.call(this),this.stackNegMap[this.chart.axisY._uniqueId]={},this.stackPosMap[this.chart.axisY._uniqueId]={},this._volHelper=null},e.prototype.load=function(){if(t.prototype.load.call(this),this.isVolume){var e,n,r,s,a,o,h,l,u=null,c=null;for(o=0;o<this.chart.series.length;o++){if(e=this.chart.series[o],a=e.getDataType(1)||e.chart._xDataType,n=e._getAxisX(),r=e._getChartType(),(r=null===r||i.isUndefined(r)?this.chart._getChartType():r)===w.Column){var _=this.chart?this.chart._bindingSeparator:",",p=e.binding.split(_).length-1;s=e._getBindingValues(p)}else s=r===w.Candlestick?e._getBindingValues(4):null;if(a===i.DataType.Date){var d;for(h=[],l=[],o=0;o<e._getLength();o++)d=e._getItem(o)[e.bindingX].valueOf(),h.push(d),l.push({value:d,text:i.Globalize.format(new Date(d),n.format||"d")})}else h=this.dataInfo.getXVals();if(u=this.dataInfo.getMinX(),c=this.dataInfo.getMaxX(),s&&s.length>0){this._volHelper=new wt(s,h,u,c,a),n._customConvert=this._volHelper.convert.bind(this._volHelper),n._customConvertBack=this._volHelper.convertBack.bind(this._volHelper),l&&l.length>0&&(this._itemsSource=n.itemsSource=l);break}}}},e.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)(e=this.chart.series[i]._getAxisX())&&(e._customConvert=null,e._customConvertBack=null,e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null))},e.prototype.adjustLimits=function(t,e){this.dataInfo=t;var n=t.getMinX(),r=t.getMaxX(),s=t.getMinY(),a=t.getMaxY(),o=t.getDeltaX();o<=0&&(o=1),!this.isVolume||this.chart._getChartType()!==w.Column&&this.chart._getChartType()!==w.Candlestick?this.unload():this.load();for(var h=0;h<this.chart.series.length;h++){var l=this.chart.series[h],u=l._getChartType();(u=null===u||i.isUndefined(u)?this.chart._getChartType():u)!==w.Column&&u!==w.Bar||this._isRange(l)&&l._getBindingValues(1).forEach(function(t){t<s?s=t:t>a&&(a=t)})}return this.rotated?(this.chart.axisY.logBase||t.getDataTypeY()===i.DataType.Date||(this.origin>a?a=this.origin:this.origin<s&&(s=this.origin)),new i.Rect(s,n-.5*o,a-s,r-n+o)):(this.chart.axisY.logBase||t.getDataTypeY()===i.DataType.Date||(this.origin>a?a=this.origin:this.origin<s&&(s=this.origin)),new i.Rect(n-.5*o,s,r-n+o,a-s))},e.prototype._isRange=function(t){var e=this.chart?this.chart._bindingSeparator:",",i=(null==t.binding?"":t.binding.split(e)).length-1;return this.isVolume?2===i:1===i},e.prototype.plotSeries=function(t,e,n,r,s,a,o,h){var l=[],u=this.chart.series.indexOf(r),c=i.asType(r,Y),_=this.chart.options,p=this.width,d=0;if(a=a||0,o=o||1,_&&_.groupWidth){var f=_.groupWidth;if(i.isNumber(f)){y=i.asNumber(f);isFinite(y)&&y>0&&(d=y,p=1)}else if(i.isString(f)){var m=i.asString(f);if(m&&m.indexOf("%")>=0){m=m.replace("%","");y=parseFloat(m);isFinite(y)&&(y<0?y=0:y>100&&(y=100),d=0,p=y/100)}else{var y=parseFloat(m);isFinite(y)&&y>0&&(d=y,p=1)}}}var b=p/o,x=c._getAxisY()._uniqueId,w=this.stackNegMap[x],S=this.stackPosMap[x],M=r.getValues(0),T=r.getValues(1),P=this._isRange(c),C=c._bindValues(null==c._cv?null==this.chart.collectionView?null:this.chart.collectionView.items:c._cv.items,c._getBinding(1)).values;if(M){if(T||(T=this.dataInfo.getXVals()),T){var N=this.dataInfo.getDeltaX();N>0&&(p*=N,b*=N)}var A=c._getSymbolFill(u),L=c._getAltSymbolFill(u)||A,k=c._getSymbolStroke(u),E=c._getAltSymbolStroke(u)||k,I=M.length;null!=T&&(I=Math.min(I,T.length));var D,O,R=this.origin,j=0,V=this.stacking!=g.None,F=this.stacking==g.Stacked100pc;if(void 0!==c._getChartType()&&(V=F=!1),this.rotated){R<e.actualMin?R=e.actualMin:R>e.actualMax&&(R=e.actualMax),c._isCustomAxisY()&&(V=F=!1);for(var X=e.convert(R),B=n.actualMin,z=n.actualMax,G=0;G<I;G++){var H=T?T[G]:G,W=M[G],U=X;if(this._getSymbolOrigin&&(U=n.convert(this._getSymbolOrigin(R,G))),P&&C&&C.length){rt=C[G];v.isValid(rt)&&(U=e.convert(rt))}if(this._getSymbolStyles){var q=this._getSymbolStyles(G);A=q&&q.fill?q.fill:A,L=q&&q.fill?q.fill:L,k=q&&q.stroke?q.fill:k,E=q&&q.stroke?q.fill:E}if(D=W>0?A:L,O=W>0?k:E,t.fill=D,t.stroke=O,v.isValid(H)&&v.isValid(W))if(V){at=H+.5*p;if((st=H-.5*p)<B&&at<B||st>z&&at>z)continue;st=n.convert(Math.max(st,B)),at=n.convert(Math.min(at,z));var K;if(F){var Z=this.dataInfo.getStackedAbsSum(H);W/=Z}ht=0;W>0?(ht=isNaN(S[H])?0:S[H],K=e.convert(ht),ut=e.convert(ht+W),S[H]=ht+W):(ht=isNaN(w[H])?0:w[H],K=e.convert(ht),ut=e.convert(ht+W),w[H]=ht+W),h&&l.push(new i.Point(ut,n.convert(H)));Q=new i.Rect(Math.min(K,ut),Math.min(st,at),Math.abs(ut-K),Math.abs(at-st));if(d>0){(tt=1-d/Q.height)<0&&(tt=0);et=Q.top+.5*Q.height;Q.top+=(et-Q.top)*tt,Q.height=Math.min(d,Q.height)}pt=new lt(Q);this.drawSymbol(t,Q,r,G,new i.Point(ut,Q.top+.5*Q.height)),r._setPointIndex(G,j),j++,pt.tag=new ot(u,G,ht+W,H),this.hitTester.add(pt,u)}else{at=H-.5*p+(a+1)*b;if((st=H-.5*p+a*b)<B&&at<B||st>z&&at>z)continue;st=n.convert(Math.max(st,B)),at=n.convert(Math.min(at,z));var J=e.convert(W),Q=new i.Rect(Math.min(J,U),Math.min(st,at),Math.abs(U-J),Math.abs(at-st));if(h&&l.push(new i.Point(J,(st+at)/2)),d>0){var $=d/o,tt=1-$/Q.height;tt<0&&(tt=0);var et=n.convert(H);Q.top+=(et-Q.top)*tt,Q.height=Math.min($,Q.height)}pt=new lt(Q);this.drawSymbol(t,Q,r,G,new i.Point(J,Q.top+.5*Q.height)),r._setPointIndex(G,j),j++,pt.tag=new ot(u,G,W,H),this.hitTester.add(pt,u)}}}else{R<n.actualMin?R=n.actualMin:R>n.actualMax&&(R=n.actualMax);var X=n.convert(R),it=e.actualMin,nt=e.actualMax;c._isCustomAxisY()&&(V=F=!1);for(G=0;G<I;G++){var U=X,H=T?T[G]:G,W=M[G];if(this._getSymbolOrigin&&(U=n.convert(this._getSymbolOrigin(R,G,I))),P&&C&&C.length){var rt=C[G];v.isValid(rt)&&(U=n.convert(rt))}if(this._getSymbolStyles&&(A=(q=this._getSymbolStyles(G,I))&&q.fill?q.fill:A,L=q&&q.fill?q.fill:L,k=q&&q.stroke?q.stroke:k,E=q&&q.stroke?q.stroke:E),D=W>0?A:L,O=W>0?k:E,t.fill=D,t.stroke=O,v.isValid(H)&&v.isValid(W))if(V){ut=H+.5*p;if((K=H-.5*p)<it&&ut<it||K>nt&&ut>nt)continue;if(K=e.convert(K),ut=e.convert(ut),!v.isValid(K)||!v.isValid(ut))continue;var st,at;F&&(W/=Z=this.dataInfo.getStackedAbsSum(H));var ht=0;W>0?(ht=isNaN(S[H])?0:S[H],st=n.convert(ht),at=n.convert(ht+W),S[H]=ht+W):(ht=isNaN(w[H])?0:w[H],st=n.convert(ht),at=n.convert(ht+W),w[H]=ht+W),h&&l.push(new i.Point(e.convert(H),at));Q=new i.Rect(Math.min(K,ut),Math.min(st,at),Math.abs(ut-K),Math.abs(at-st));if(d>0){(tt=1-d/Q.width)<0&&(tt=0);_t=Q.left+.5*Q.width;Q.left+=(_t-Q.left)*tt,Q.width=Math.min(d,Q.width)}pt=new lt(Q);this.drawSymbol(t,Q,r,G,new i.Point(Q.left+.5*Q.width,at)),r._setPointIndex(G,j),j++,pt.tag=new ot(u,G,H,ht+W),this.hitTester.add(pt,u)}else{var ut=H-.5*p+(a+1)*b;if((K=H-.5*p+a*b)<it&&ut<it||K>nt&&ut>nt)continue;if(K=e.convert(K),ut=e.convert(ut),!v.isValid(K)||!v.isValid(ut))continue;var ct=n.convert(W),Q=new i.Rect(Math.min(K,ut),Math.min(ct,U),Math.abs(ut-K),Math.abs(U-ct));if(h&&l.push(new i.Point((K+ut)/2,ct)),d>0){(tt=1-($=d/o)/Q.width)<0&&(tt=0);var _t=e.convert(H);Q.left+=(_t-Q.left)*tt,Q.width=Math.min($,Q.width)}var pt=new lt(Q);this.drawSymbol(t,Q,r,G,new i.Point(Q.left+.5*Q.width,ct)),r._setPointIndex(G,j),j++,pt.tag=new ot(u,G,H,W),this.hitTester.add(pt,u)}}}h&&l&&l.length&&h(l)}},e.prototype.drawSymbol=function(t,e,i,n,r){var s=this;if(this.chart.itemFormatter){t.startGroup();var a=new U(this.chart,r,W.SeriesSymbol);a._setData(i,n),this.chart.itemFormatter(t,a,function(){s.drawDefaultSymbol(t,e,i)}),t.endGroup()}else this.drawDefaultSymbol(t,e,i)},e.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)},e}(dt);e._BarPlotter=ft;var gt=function(t){function e(){var e=t.call(this)||this;return e.hasSymbols=!1,e.hasLines=!0,e.isSpline=!1,e.stacking=g.None,e.stackPos={},e.stackNeg={},e.clipping=!1,e}return __extends(e,t),e.prototype.clear=function(){t.prototype.clear.call(this),this.stackNeg={},this.stackPos={}},e.prototype.adjustLimits=function(t,e){this.dataInfo=t;var n=t.getMinX(),r=t.getMinY(),s=t.getMaxX(),a=t.getMaxY();if(this.isSpline&&!this.chart.axisY.logBase){var o=.1*(a-r);r-=o,a+=o}return this.rotated?new i.Rect(r,n,a-r,s-n):new i.Rect(n,r,s-n,a-r)},e.prototype.plotSeries=function(t,e,n,r,s,a,o,h){var l=[],u=i.asType(r,Y),c=this.chart.series.indexOf(r),_=r.getValues(0),p=r.getValues(1);if(_){p||(p=this.dataInfo.getXVals());var d=dt.cloneStyle(r.style,["fill"]),f=_.length,m=!0;p?f=Math.min(f,p.length):(m=!1,p=new Array(f));var y=this._DEFAULT_WIDTH,b=u._getSymbolFill(c),x=u._getAltSymbolFill(c)||b,w=u._getSymbolStroke(c),S=u._getAltSymbolStroke(c)||w,M=u._getSymbolSize();t.stroke=w,t.strokeWidth=y,t.fill=b;var T=new Array,P=new Array,C=new Array,N=this.rotated,A=this.stacking!=g.None&&!u._isCustomAxisY(),L=this.stacking==g.Stacked100pc&&!u._isCustomAxisY();void 0!==u._getChartType()&&(A=L=!1);for(var k=this.chart.interpolateNulls,E=!1,I=0;I<f;I++){var D=m?p[I]:I,O=_[I];if(v.isValid(D)&&v.isValid(O)){if(A)if(L&&(O/=this.dataInfo.getStackedAbsSum(D)),O>=0){R=isNaN(this.stackPos[D])?0:this.stackPos[D];O=this.stackPos[D]=R+O}else{var R=isNaN(this.stackNeg[D])?0:this.stackNeg[D];O=this.stackNeg[D]=R+O}var j;if(N){j=new ot(c,I,O,D);var V=e.convert(O);O=n.convert(D),D=V}else j=new ot(c,I,D,O),D=e.convert(D),O=n.convert(O);if(isNaN(D)||isNaN(O))E=!0,!0!==k&&(T.push(void 0),P.push(void 0)),C.push(!0);else{T.push(D),P.push(O),C.push(!1),h&&l.push(new i.Point(D,O));var F=new ut(new i.Point(D,O),.5*M);F.tag=j,this.hitTester.add(F,c)}}else E=!0,!0!==k&&(T.push(void 0),P.push(void 0)),C.push(!0)}var X=0;if(this.hasLines)if(t.fill=null,E&&!0!==k){for(var B=[],z=[],I=0;I<f;I++)void 0===T[I]?(B.length>1&&(this._drawLines(t,B,z,null,d,this.chart._plotrectId),this.hitTester.add(new ct(B,z),c),X++),B=[],z=[]):(B.push(T[I]),z.push(P[I]));B.length>1&&(this._drawLines(t,B,z,null,d,this.chart._plotrectId),this.hitTester.add(new ct(B,z),c),X++)}else this._drawLines(t,T,P,null,d,this.chart._plotrectId),this.hitTester.add(new ct(T,P),c),X++;if((this.hasSymbols||this.chart.itemFormatter)&&M>0){t.fill=b;for(var G=0,I=0;I<f;I++)if(!k||!C[I]){var D=T[G],O=P[G];(!1===this.hasLines||this.chart.itemFormatter)&&(t.fill=_[I]>0?b:x,t.stroke=_[I]>0?w:S),this.isValid(D,O,e,n)&&(this._drawSymbol(t,D,O,M,u,I),r._setPointIndex(I,X),X++),G++}}h&&l&&l.length&&h(l)}},e.prototype._drawLines=function(t,e,i,n,r,s){this.isSpline?t.drawSplines(e,i,n,r,s):t.drawLines(e,i,n,r,s)},e.prototype._drawSymbol=function(t,e,n,r,s,a){var o=this;if(this.chart.itemFormatter){t.startGroup();var h=new U(this.chart,new i.Point(e,n),W.SeriesSymbol);h._setData(s,a),this.chart.itemFormatter(t,h,function(){o.hasSymbols&&o._drawDefaultSymbol(t,e,n,r,s.symbolMarker,s.symbolStyle)}),t.endGroup()}else this._drawDefaultSymbol(t,e,n,r,s.symbolMarker,s.symbolStyle)},e.prototype._drawDefaultSymbol=function(t,e,i,n,r,s){r==V.Dot?t.drawEllipse(e,i,.5*n,.5*n,null,s):r==V.Box&&t.drawRect(e-.5*n,i-.5*n,n,n,null,s)},e}(dt);e._LinePlotter=gt;var mt=function(t){function e(){var e=t.call(this)||this;return e.stacking=g.None,e.isSpline=!1,e.stackPos={},e.stackNeg={},e}return __extends(e,t),e.prototype.adjustLimits=function(t,e){this.dataInfo=t;var n=t.getMinX(),r=t.getMinY(),s=t.getMaxX(),a=t.getMaxY();if(this.isSpline){var o=.1*(a-r);this.chart.axisY.logBase||(r-=o),a+=o}return this.rotated?new i.Rect(r,n,a-r,s-n):new i.Rect(n,r,s-n,a-r)},e.prototype.clear=function(){t.prototype.clear.call(this),this.stackNeg={},this.stackPos={}},e.prototype.plotSeries=function(t,e,n,r,s,a,o,h){var l=[],u=this.chart.series.indexOf(r),c=r,_=r.getValues(0),p=r.getValues(1);if(_){var d=_.length;if(d){p||(p=this.dataInfo.getXVals());var f=!0;p?p.length<d&&(d=p.length):(f=!1,p=new Array(d));var m=new Array,y=new Array,b=new Array,x=new Array,w=this.stacking!=g.None&&!c._isCustomAxisY(),M=this.stacking==g.Stacked100pc&&!c._isCustomAxisY();void 0!==c._getChartType()&&(w=M=!1);for(var T=this.rotated,P=!1,C=this.chart.interpolateNulls,N=null,A=null,L=this.chart._plotRect,k=0;k<d;k++){var E=f?p[k]:k,I=_[k];if((null===N||E>N)&&(N=E),(null===A||E<A)&&(A=E),v.isValid(E)&&v.isValid(I)){var D=T?n.convert(E):e.convert(E);if(w){M&&(I/=this.dataInfo.getStackedAbsSum(E));var O=0;I>=0?(O=isNaN(this.stackPos[E])?0:this.stackPos[E],I=this.stackPos[E]=O+I):(O=isNaN(this.stackNeg[E])?0:this.stackNeg[E],I=this.stackNeg[E]=O+I),T?(O<e.actualMin&&(O=e.actualMin),b.push(e.convert(O)),x.push(D)):(b.push(D),O<n.actualMin&&(O=n.actualMin),x.push(n.convert(O)))}if(T){R=e.convert(I);isNaN(D)||isNaN(R)?(P=!0,w||!0===C||(m.push(void 0),y.push(void 0))):(m.push(R),y.push(D),S._contains(L,new i.Point(R,D))&&((j=new ut(new i.Point(R,D),this._DEFAULT_SYM_SIZE)).tag=new ot(u,k,I,E),this.hitTester.add(j,u)))}else{var R=n.convert(I);if(isNaN(D)||isNaN(R))P=!0,w||!0===C||(m.push(void 0),y.push(void 0));else if(m.push(D),y.push(R),S._contains(L,new i.Point(D,R))){var j=new ut(new i.Point(D,R),this._DEFAULT_SYM_SIZE);j.tag=new ot(u,k,E,I),this.hitTester.add(j,u)}}}else P=!0,w||!0===C||(m.push(void 0),y.push(void 0))}h&&m.forEach(function(t,e){null!=t&&l.push(new i.Point(t,y[e]))});var V=this._DEFAULT_WIDTH,F=s._getColorLight(u),X=s._getColor(u),Y=dt.cloneStyle(r.style,["fill"]),B=dt.cloneStyle(r.style,["stroke"]);if(!w&&!0!==C&&P){for(var z=[],G=[],k=0;k<d;k++)void 0===m[k]?(z.length>1&&(this.isSpline&&(z=(H=this._convertToSpline(z,G)).xs,G=H.ys),t.stroke=X,t.strokeWidth=V,t.fill="none",t.drawLines(z,G,null,Y),this.hitTester.add(new ct(z,G),u),T?(z.push(e.convert(e.actualMin),e.convert(e.actualMin)),G.push(n.convert(n.actualMax),n.convert(n.actualMin))):(z.push(z[z.length-1],z[0]),G.push(n.convert(n.actualMin),n.convert(n.actualMin))),t.fill=F,t.stroke="none",t.drawPolygon(z,G,null,B)),z=[],G=[]):(z.push(m[k]),G.push(y[k]));z.length>1&&(this.isSpline&&(z=(H=this._convertToSpline(z,G)).xs,G=H.ys),t.stroke=X,t.strokeWidth=V,t.fill="none",t.drawLines(z,G,null,Y),this.hitTester.add(new ct(z,G),u),T?(z.push(e.convert(e.actualMin),e.convert(e.actualMin)),G.push(n.convert(n.actualMax),n.convert(n.actualMin))):(z.push(z[z.length-1],z[0]),G.push(n.convert(n.actualMin),n.convert(n.actualMin))),t.fill=F,t.stroke="none",t.drawPolygon(z,G,null,B))}else{if(this.isSpline){var H=this._convertToSpline(m,y);m=H.xs,y=H.ys}if(w){if(this.isSpline){var W=this._convertToSpline(b,x);b=W.xs,x=W.ys}m=m.concat(b.reverse()),y=y.concat(x.reverse())}else T?(m.push(e.convert(e.actualMin),e.convert(e.actualMin)),y[0]>y[y.length-1]?y.push(n.convert(N),n.convert(A)):y.push(n.convert(A),n.convert(N))):(m[0]>m[m.length-1]?m.push(e.convert(A),e.convert(N)):m.push(e.convert(N),e.convert(A)),y.push(n.convert(n.actualMin),n.convert(n.actualMin)));t.fill=F,t.stroke="none",t.drawPolygon(m,y,null,B),w?(m=m.slice(0,m.length-b.length),y=y.slice(0,y.length-x.length)):(m=m.slice(0,m.length-2),y=y.slice(0,y.length-2)),t.stroke=X,t.strokeWidth=V,t.fill="none",t.drawLines(m,y,null,Y),this.hitTester.add(new ct(m,y),u)}this._drawSymbols(t,r,u),h&&l&&l.length&&h(l)}}},e.prototype._convertToSpline=function(t,e){if(t&&e){var i=new K(t,e).calculate();return{xs:i.xs,ys:i.ys}}return{xs:t,ys:e}},e.prototype._drawSymbols=function(t,e,n){if(null!=this.chart.itemFormatter)for(var r=this.hitTester._map[n],s=0;s<r.length;s++){var a=i.tryCast(r[s],ut);if(a){var o=a.tag;t.startGroup();var h=new U(this.chart,a.center,W.SeriesSymbol);h._setDataPoint(o),this.chart.itemFormatter(t,h,function(){}),t.endGroup()}}},e}(dt);e._AreaPlotter=mt;var yt=function(t){function e(){var e=t.call(this)||this;return e._MIN_SIZE=5,e._MAX_SIZE=30,e.hasLines=!1,e.hasSymbols=!0,e.clipping=!0,e}return __extends(e,t),e.prototype.adjustLimits=function(e,i){var n=this.getNumOption("minSize","bubble");this._minSize=n||this._MIN_SIZE;var r=this.getNumOption("maxSize","bubble");this._maxSize=r||this._MAX_SIZE;for(var s=this.chart.series,a=s.length,o=NaN,h=NaN,l=0;l<a;l++){var u=s[l]._getBindingValues(1);if(u)for(var c=u.length,_=0;_<c;_++)v.isValid(u[_])&&((isNaN(o)||u[_]<o)&&(o=u[_]),(isNaN(h)||u[_]>h)&&(h=u[_]))}this._minValue=o,this._maxValue=h;var p=t.prototype.adjustLimits.call(this,e,i),d=this.chart.axisX,f=this.chart.axisY;if(d.logBase<=0){var g=(i.width-this._maxSize)/p.width;p.left-=.5*this._maxSize/g,p.width+=this._maxSize/g}if(f.logBase<=0){var m=(i.height-this._maxSize)/p.height;p.top-=.5*this._maxSize/m,p.height+=this._maxSize/m}return p},e.prototype._drawSymbol=function(t,e,n,r,s,a){var o=this;if(null==this._minSize){var h=this.getNumOption("minSize","bubble");this._minSize=h||this._MIN_SIZE}if(null==this._maxSize){var l=this.getNumOption("maxSize","bubble");this._maxSize=l||this._MAX_SIZE}var u=s._getItem(a);if(u){var c=s._getBinding(1);if(c){var r=u[c];if(v.isValid(r)){var _=this._minValue==this._maxValue?1:Math.sqrt((r-this._minValue)/(this._maxValue-this._minValue));if(r=this._minSize+(this._maxSize-this._minSize)*_,this.chart.itemFormatter){var p=new U(this.chart,new i.Point(e,n),W.SeriesSymbol);p._setData(s,a),t.startGroup(),this.chart.itemFormatter(t,p,function(){o._drawDefaultSymbol(t,e,n,r,s.symbolMarker,s.symbolStyle)}),t.endGroup()}else this._drawDefaultSymbol(t,e,n,r,s.symbolMarker,s.symbolStyle);var d=this.hitTester._map[this.chart.series.indexOf(s)];if(null!=d)for(var f=d.length-1;f>=0;f--){var g=d[f];if(g.tag&&g.tag.pointIndex==a){var m=i.tryCast(g,ut);m&&m.setRadius(.5*r)}}}}}},e}(gt);e._BubblePlotter=yt;var bt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.isCandle=!0,e.isArms=!1,e.isEqui=!1,e.isVolume=!1,e._volHelper=null,e._symWidth=.7,e}return __extends(e,t),e.prototype.clear=function(){t.prototype.clear.call(this),this._volHelper=null},e.prototype.load=function(){if(t.prototype.load.call(this),this.isVolume){var e,n,r,s,a,o,h,l,u=null,c=null;for(o=0;o<this.chart.series.length;o++){if(e=this.chart.series[o],a=e.getDataType(1)||e.chart._xDataType,n=e._getAxisX(),r=e._getChartType(),r=null===r||i.isUndefined(r)?this.chart._getChartType():r,s=r===w.Column?e._getBindingValues(1):r===w.Candlestick?e._getBindingValues(4):null,a===i.DataType.Date){var _;for(h=[],l=[],o=0;o<e._getLength();o++)_=e._getItem(o)[e.bindingX].valueOf(),h.push(_),l.push({value:_,text:i.Globalize.format(new Date(_),n.format||"d")})}else h=this.dataInfo.getXVals();if(u=this.dataInfo.getMinX(),c=this.dataInfo.getMaxX(),s&&s.length>0){this._volHelper=new wt(s,h,u,c,a),n._customConvert=this._volHelper.convert.bind(this._volHelper),n._customConvertBack=this._volHelper.convertBack.bind(this._volHelper),l&&l.length>0&&(this._itemsSource=n.itemsSource=l);break}}}},e.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)(e=this.chart.series[i]._getAxisX())&&(e._customConvert=null,e._customConvertBack=null,e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null))},e.prototype.parseSymbolWidth=function(t){if(this._isPixel=void 0,t)if(i.isNumber(t)){var e=i.asNumber(t);isFinite(e)&&e>0&&(this._symWidth=e,this._isPixel=!0)}else if(i.isString(t)){var n=i.asString(t);if(n&&n.indexOf("%")>=0){n=n.replace("%","");r=parseFloat(n);isFinite(r)&&(r<0?r=0:r>100&&(r=100),this._symWidth=r/100,this._isPixel=!1)}else{var r=parseFloat(t);isFinite(r)&&r>0&&(this._symWidth=r,this._isPixel=!0)}}},e.prototype.adjustLimits=function(t,e){this.dataInfo=t;var n=t.getMinX(),r=t.getMinY(),s=t.getMaxX(),a=t.getMaxY(),o=t.getDeltaX(),h=this.chart._xDataType;o<=0&&(o=1);var l=this.chart.series,u=l.length,c=0;this.parseSymbolWidth(this.symbolWidth),!this.isVolume||this.chart._getChartType()!==w.Column&&this.chart._getChartType()!==w.Candlestick?this.unload():this.load();for(var _=0;_<u;_++){var p=l[_];if(!p._isCustomAxisY()){var d=p._getBinding(1),f=p._getBinding(2),g=p._getBinding(3),m=p._getLength();if(m){var y=p._getSymbolSize();y>c&&(c=y);for(var b=0;b<m;b++){var x=p._getItem(b);x&&[d?x[d]:null,f?x[f]:null,g?x[g]:null].forEach(function(t){v.isValid(t)&&null!==t&&((isNaN(r)||t<r)&&(r=t),(isNaN(a)||t>a)&&(a=t))})}}}}var S=s-n,M=this.chart._plotRect;if(M&&M.width&&!this.isVolume){y+=2;var T=M.width/(M.width-y)*S;n-=.5*(T-S),S=T}return h!==i.DataType.Date||!this.isVolume||this.chart._getChartType()!==w.Column&&this.chart._getChartType()!==w.Candlestick?this.chart._isRotated()?new i.Rect(r,n,a-r,S):new i.Rect(n,r,S,a-r):new i.Rect(n-.5*o,r,s-n+o,a-r)},e.prototype.plotSeries=function(t,e,n,r,s,a,o,h){var l=this,u=i.asType(r,Y),c=this.chart.series.indexOf(r),_=r.getValues(0),p=r.getValues(1),d=this._symWidth,f=this.chart._isRotated();if(_){if(p||(p=this.dataInfo.getXVals()),p){var g=this.dataInfo.getDeltaX();g>0&&!1===this._isPixel&&(d*=g)}var m=_.length,y=!0;p?m=Math.min(m,p.length):(y=!1,p=new Array(m));var b=this._DEFAULT_WIDTH,x=u._getSymbolFill(c),w=u._getAltSymbolFill(c)||"transparent",S=u._getSymbolStroke(c),M=u._getAltSymbolStroke(c)||S,T=void 0===this._isPixel?u._getSymbolSize():d;t.stroke=S,t.strokeWidth=b,t.fill=x;for(var P,C,N=u._getBinding(1),A=u._getBinding(2),L=u._getBinding(3),k=f?n.actualMin:e.actualMin,E=f?n.actualMax:e.actualMax,I=0,D=null,O=null,R=0;R<m;R++)if(D=u._getItem(R)){var j=y?p[R]:R;if(v.isValid(j)&&k<=j&&j<=E){var V=_[R],F=N?D[N]:null,X=A?D[A]:null,B=L?D[L]:null;if(t.startGroup(),this.isEqui&&null!==O?O[L]!==D[L]&&(P=O[L]<D[L]?w:x,C=O[L]<D[L]?M:S):(P=X<B?w:x,C=X<B?M:S),t.fill=P,t.stroke=C,this.chart.itemFormatter){var z=new U(this.chart,new i.Point(e.convert(j),n.convert(V)),W.SeriesSymbol);z._setData(u,R),this.chart.itemFormatter(t,z,function(){l._drawSymbol(t,e,n,c,R,P,T,j,V,F,X,B)})}else this._drawSymbol(t,e,n,c,R,P,T,j,V,F,X,B);t.endGroup(),r._setPointIndex(R,I),I++}O=D}}},e.prototype._drawSymbol=function(t,e,n,r,s,a,o,h,l,u,c,_){var p,d=new ot(r,s,h,l),f=null,g=null,m=null,y=null,b=this.chart._isRotated();if(b){var x=n;n=e,e=x}if(!1===this._isPixel&&(m=e.convert(h-.5*o),y=e.convert(h+.5*o),m>y)){var w=m;m=y,y=w}h=e.convert(h),!1!==this._isPixel&&(m=h-.5*o,y=h+.5*o),this.isCandle?(v.isValid(c)&&v.isValid(_)&&(c=n.convert(c),_=n.convert(_),g=(f=Math.min(c,_))+Math.abs(c-_),b?(t.drawRect(f,m,g-f||1,y-m||1),p=new lt(new i.Rect(f,m,g-f||1,y-m||1))):(t.drawRect(m,f,y-m||1,g-f||1),p=new lt(new i.Rect(m,f,y-m||1,g-f||1))),p.tag=d,this.hitTester.add(p,r)),v.isValid(l)&&(l=n.convert(l),null!==f&&(b?t.drawLine(g,h,l,h):t.drawLine(h,f,h,l))),v.isValid(u)&&(u=n.convert(u),null!==g&&(b?t.drawLine(f,h,u,h):t.drawLine(h,g,h,u)))):this.isEqui?v.isValid(l)&&v.isValid(u)&&(l=n.convert(l),u=n.convert(u),g=(f=Math.min(l,u))+Math.abs(l-u),t.drawRect(m,f,y-m||1,g-f||1),(p=new lt(new i.Rect(m,f,y-m||1,g-f||1))).tag=d,this.hitTester.add(p,r)):this.isArms?(v.isValid(c)&&v.isValid(_)&&(c=n.convert(c),_=n.convert(_),g=(f=Math.min(c,_))+Math.abs(c-_),t.drawRect(m,f,y-m||1,g-f||1)),v.isValid(l)&&null!==f&&(l=n.convert(l),t.drawLine(h,f,h,l)),v.isValid(u)&&null!==g&&(u=n.convert(u),t.drawLine(h,g,h,u)),v.isValid(l)&&v.isValid(u)&&(t.fill="transparent",g=(f=Math.min(l,u))+Math.abs(l-u),t.drawRect(m,f,y-m||1,g-f||1),(p=new lt(new i.Rect(m,f,y-m||1,g-f||1))).tag=d,this.hitTester.add(p,r))):(v.isValid(l)&&v.isValid(u)&&(l=n.convert(l),u=n.convert(u),g=(f=Math.min(l,u))+Math.abs(l-u),b?(t.drawLine(u,h,l,h),p=new lt(new i.Rect(f,m,g-f||1,y-m||1))):(t.drawLine(h,u,h,l),p=new lt(new i.Rect(m,f,y-m||1,g-f||1))),p.tag=d,this.hitTester.add(p,r)),v.isValid(c)&&(c=n.convert(c),b?t.drawLine(c,m,c,h):t.drawLine(m,c,h,c)),v.isValid(_)&&(_=n.convert(_),b?t.drawLine(_,h,_,y):t.drawLine(h,_,y,_)))},e}(dt);e._FinancePlotter=bt;var vt=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.stacking=g.None,e}return __extends(e,t),e.prototype.adjustLimits=function(t,e){this.dataInfo=t;var n=t.getMinX(),r=t.getMinY(),s=t.getMaxX(),a=t.getMaxY();return this.rotated?new i.Rect(r,n,a-r,s-n):new i.Rect(n,r,s-n,a-r)},e.prototype.plotSeries=function(t,e,n,r,s,a,o,h){var l=this.chart.series.indexOf(r);if(!(l>0)){var u,c,_,p,d,f=i.asType(r,Y),g=this.chart.options,m=r.getValues(0),y=r.getValues(1),b=this.chart._plotRect,x=g&&g.funnel&&null!=g.funnel.neckWidth?g.funnel.neckWidth:.2,w=g&&g.funnel&&null!=g.funnel.neckHeight?g.funnel.neckHeight:0,S=x*b.width,M=0,T=0,P=0,C=0,N=b.left,A=b.top,L=b.width,k=b.height;if(m){S=S||1,y||(y=this.dataInfo.getXVals());var E=m.length;for(null!=y&&(E=Math.min(E,y.length)),M=0;M<E;M++)T+=m[M];var I,D,O=0;if(g&&g.funnel&&"rectangle"===g.funnel.type){w=k/E,x=L;var R;for(M=0;M<E;M++){var j=y?y[M]:M,V=m[M],F=f._getSymbolFill(M),X=f._getAltSymbolFill(M)||F,B=f._getSymbolStroke(M),z=f._getAltSymbolStroke(M)||B;if(this._getSymbolStyles&&(F=(q=this._getSymbolStyles(M,E))&&q.fill?q.fill:F,X=q&&q.fill?q.fill:X,B=q&&q.stroke?q.stroke:B,z=q&&q.stroke?q.stroke:z),I=V>0?F:X,D=V>0?B:z,t.fill=I,t.stroke=D,v.isValid(j)&&v.isValid(V)){R||(R=L/V);var G=R*V;N+=(x-G)/2,t.drawRect(N,A,G,w),H=new xt(new i.Point(N,A),G,w,G,w),A+=w,x=G,H.tag=new ot(l,M,j,V),this.hitTester.add(H,l),r._setPointIndex(M,O),O++}}}else for(P=b.left+b.width*(1-x)/2,C=b.top+b.height*(1-w),c=(1-x)*b.width/2/(b.height*(1-w)),!isNaN(c)&&isFinite(c)||(L=S,N=P,A=C),u=b.width*x*b.height+b.width*(1-x)/2*b.height*(1-w),M=0;M<E;M++){var H,j=y?y[M]:M,V=m[M],W=[],U=[],F=f._getSymbolFill(M),X=f._getAltSymbolFill(M)||F,B=f._getSymbolStroke(M),z=f._getAltSymbolStroke(M)||B;if(this._getSymbolStyles){var q=this._getSymbolStyles(M,E);F=q&&q.fill?q.fill:F,X=q&&q.fill?q.fill:X,B=q&&q.stroke?q.stroke:B,z=q&&q.stroke?q.stroke:z}if(I=V>0?F:X,D=V>0?B:z,t.fill=I,t.stroke=D,v.isValid(j)&&v.isValid(V)){var K=u*V/T;L>S?(A+(p=this._getTrapezoidOffsetY(L,K,c))<C?(W=[N,N+(_=c*p),N+L-_,N+L],U=[A,A+p,A+p,A],H=new xt(new i.Point(N,A),L,p,L-2*_,0),L-=2*_,N+=_,A+=p):(_=c*(p=C-A),d=(K-=this._getTrapezoidArea(L,c,p))/S,W.push(N,N+_,N+_,N+_+S,N+_+S,N+L),U.push(A,A+p,A+p+d,A+p+d,A+p,A),H=new xt(new i.Point(N,A),L,p+d,S,d),L=S,N+=_,A=A+p+d),t.drawPolygon(W,U)):(d=K/S,t.drawRect(N,A,L,d),H=new xt(new i.Point(N,A),S,d,S,d),A+=d),H.tag=new ot(l,M,j,V),this.hitTester.add(H,l),r._setPointIndex(M,O),O++}}}}},e.prototype._getTrapezoidArea=function(t,e,i){var n=i*e;return n*i+(t-2*n)*i},e.prototype._getTrapezoidOffsetY=function(t,e,i){var n=Math.pow(t/2/i,2)-e/i;return t/2/i-Math.sqrt(n>=0?n:0)},e.prototype.drawSymbol=function(t,e,i,n,r){var s=this;if(this.chart.itemFormatter){t.startGroup();var a=new U(this.chart,r,W.SeriesSymbol);a._setData(i,n),this.chart.itemFormatter(t,a,function(){s.drawDefaultSymbol(t,e,i)}),t.endGroup()}else this.drawDefaultSymbol(t,e,i)},e.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)},e.prototype._getPointAndPosition=function(t,e,i,n){var r=i;t.x=r.center.x,t.y=r.center.y,e=null==e?Z.Center:e},e}(dt);e._FunnelPlotter=vt;var xt=function(){function t(t,e,n,r,s){this._startPoint=t,this._width=e,this._height=n,this._neckWidth=r,this._neckHeight=s,this._center=new i.Point(this._startPoint.x+e/2,this._startPoint.y+n/2),this._offsetX=(e-r)/2,this._offsetY=n-s}return t.prototype.contains=function(t){var e=this._startPoint,i=this._offsetX,n=this._offsetY;if(t.x>=e.x&&t.x<=e.x+this._width&&t.y>=e.y&&t.y<=e.y+this._height){if(t.x>=e.x+i&&t.x<=e.x+this._width-i)return!0;if(t.y>e.y+n)return!1;if(t.x<this._center.x)return(t.y-e.y)/(t.x-e.x)<n/i;if(t.x>this._center.x)return(t.y-e.y)/(e.x+this._width-t.x)<n/i}return!1},t.prototype.distance=function(t){if(this.contains(t))return 0;var e=this._startPoint,i=this._width,n=this._height,r=this._offsetX,s=this._offsetY;return t.y<e.y?t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(e.y-t.y,2)):e.y-t.y:t.y>e.y+n?t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y-n,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(t.y-e.y-n,2)):t.y-e.y-n:t.y>e.y+s?t.x<e.x+r?e.x+r-t.x:t.x>e.x+i-r?t.x-e.x-i+r:void 0:t.x<e.x+r?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y,2)),Math.sqrt(Math.pow(t.x-r/2-e.x,2)+Math.pow(t.y-s/2-e.y,2)),Math.sqrt(Math.pow(t.x-r-e.x,2)+Math.pow(t.y-s-e.y,2))):Math.min(Math.sqrt(Math.pow(t.x-i-e.x,2)+Math.pow(t.y-e.y,2)),Math.sqrt(Math.pow(t.x-i+r/2-e.x,2)+Math.pow(t.y-s/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+r-e.x,2)+Math.pow(t.y-s-e.y,2)))},Object.defineProperty(t.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0}),t}();e._FunnelSegment=xt;var wt=function(){function t(t,e,n,r,s){this._volumes=i.asArray(t),this._xVals=i.asArray(e),this._xDataMin=i.asNumber(n,!0,!1),this._xDataMax=i.asNumber(r,!0,!1),this._xDataType=i.asEnum(s,i.DataType,!0),this._calcData=[],this._init()}return t.prototype.convert=function(e,n,r){var s=void 0,a=this._calcData.length,o=-1;if(this._hasXs&&this._xDataType===i.DataType.Date){if(-1===(o=this._xVals.indexOf(e)))for(var h=0;h<this._xVals.length;h++){if(h<this._xVals.length-1&&this._xVals[h]<=e&&e<=this._xVals[h+1]){o=h;break}if(0===h&&e<=this._xVals[h]){o=h;break}if(h===this._xVals.length-1&&this._xVals[h]<=e){o=h;break}}-1===o&&(o=this._xVals.indexOf(Math.floor(e)),o=i.clamp(o,0,a-1))}else this._hasXs?-1===(o=this._xVals.indexOf(e))&&(o=this._xVals.indexOf(Math.floor(e)),o=i.clamp(o,0,a-1)):o=i.clamp(Math.round(e),0,a-1);return 0<=o&&o<a&&(this._hasXs&&(e=t.convertToRange(e,0,a-1,this._xDataMin,this._xDataMax)),s=((s=this._calcData[o].value+(e-o)*this._calcData[o].width-.5*this._calcData[o].width)-(n=this._getXVolume(n)))/((r=this._getXVolume(r))-n)),s},t.prototype.convertBack=function(e,i,n){var r,s=void 0,a=this._calcData.length,o=-1;for(r=0;r<a;r++)if(this._calcData[r].x1<=e&&e<=this._calcData[r].x2||0===r&&e<=this._calcData[r].x2||r===a-1&&this._calcData[r].x1<=e){o=r;break}return 0<=o&&o<a&&(s=e/this._calcData[o].width-this._calcData[o].value/this._calcData[o].width+.5+r,this._hasXs&&(s=t.convertToRange(s,this._xDataMin,this._xDataMax,0,a-1))),s},t.prototype._init=function(){this._hasXs=null!==this._xVals&&this._xVals.length>0,this._hasXs&&!i.isNumber(this._xDataMin)&&(this._xDataMin=Math.min.apply(null,this._xVals)),this._hasXs&&!i.isNumber(this._xDataMax)&&(this._xDataMax=Math.max.apply(null,this._xVals)),this._hasXs&&(this._hasXs=i.isNumber(this._xDataMin)&&i.isNumber(this._xDataMax)),this._hasXs&&this._xDataType===i.DataType.Date&&this._fillGaps();var t=0,e=0,n=null!==this._volumes&&this._volumes.length>0?this._volumes.length:0;for(e=0;e<n;e++)t+=this._volumes[e]||0;var r,s,a=0;for(e=0;e<n;e++)r=a+(s=(this._volumes[e]||0)/t),this._calcData.push({value:r,width:s,x1:a,x2:r}),a=this._calcData[e].value},t.prototype._getXVolume=function(e){var n=this._calcData.length,r=-1;if(this._hasXs){r=this._xVals.indexOf(e);for(var s=0;s<this._xVals.length;s++){if(s<this._xVals.length-1&&this._xVals[s]<=e&&e<=this._xVals[s+1]){r=s;break}if(0===s&&e<=this._xVals[s]){r=s;break}if(s===this._xVals.length-1&&this._xVals[s]<=e){r=s;break}}}return this._hasXs&&(e=t.convertToRange(e,0,n-1,this._xDataMin,this._xDataMax)),-1===r&&(r=i.clamp(Math.round(e),0,n-1)),this._calcData[r].value+(e-r)*this._calcData[r].width-.5*this._calcData[r].width},t.convertToRange=function(t,e,i,n,r){return e===i||n===r?0:(t-n)*(i-e)/(r-n)+e},t.prototype._fillGaps=function(){if(!(this._xDataType!==i.DataType.Date||null===this._xVals||this._xVals.length<=0)){var t,e=this._xDataMin,n=this._xDataMax;for(t=1;e<n;t++)(e=new Date(e)).setDate(e.getDate()+1),(e=e.valueOf())!==this._xVals[t]&&(this._xVals.splice(t,0,e),this._volumes.splice(t,0,0))}},t}();e._VolumeHelper=wt});