@grapecity/wijmo.chart 5.20261.52 → 5.20262.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/es5-esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * Wijmo Library 5.20261.52
3
+ * Wijmo Library 5.20262.60
4
4
  * https://developer.mescius.com/wijmo
5
5
  *
6
6
  * Copyright(c) MESCIUS inc. All rights reserved.
@@ -11,4 +11,4 @@
11
11
  *
12
12
  */
13
13
 
14
- var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=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])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}();import{Point,Size,Rect,asEnum,asString,isNumber,asNumber,isString,assert,asBoolean,setCss,tryCast,DataType,isDate,isArray,Event,asType,copy,asFunction,Binding,EventArgs,asCollectionView,asInt,ObservableArray,Globalize,asDate,removeChild,isIE,hasClass,addClass,UtilitesClsNames,asArray,clamp,isUndefined,getElementRect,toggleClass,removeClass,isFunction,ControlClsNames,format,Control,Tooltip,CancelEventArgs,Color,mouseToPage,ControlStateClsNames,animate,_registerModule}from"@grapecity/wijmo";import*as selfModule from"@grapecity/wijmo.chart";var _VolumeHelper=function(){function _VolumeHelper(t,e,i,r,n){this._volumes=asArray(t);this._xVals=asArray(e);this._xDataMin=asNumber(i,!0,!1);this._xDataMax=asNumber(r,!0,!1);this._xDataType=asEnum(n,DataType,!0);this._calcData=[];this._init()}_VolumeHelper.prototype.convert=function(t,e,i){var r,n=this._calcData.length,s=-1;if(this._hasXs&&this._xDataType===DataType.Date){if(-1===(s=this._xVals.indexOf(t)))for(var a=0;a<this._xVals.length;a++){if(a<this._xVals.length-1&&this._xVals[a]<=t&&t<=this._xVals[a+1]){s=a;break}if(0===a&&t<=this._xVals[a]){s=a;break}if(a===this._xVals.length-1&&this._xVals[a]<=t){s=a;break}}if(-1===s){s=this._xVals.indexOf(Math.floor(t));s=clamp(s,0,n-1)}}else if(this._hasXs){if(-1===(s=this._xVals.indexOf(t))){s=this._xVals.indexOf(Math.floor(t));s=clamp(s,0,n-1)}}else s=clamp(Math.round(t),0,n-1);if(0<=s&&s<n){this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,n-1,this._xDataMin,this._xDataMax));r=((r=this._calcData[s].value+(t-s)*this._calcData[s].width-.5*this._calcData[s].width)-(e=this._getXVolume(e)))/((i=this._getXVolume(i))-e)}return r};_VolumeHelper.prototype.convertBack=function(t,e,i){var r,n,s=this._calcData.length,a=-1;for(n=0;n<s;n++)if(this._calcData[n].x1<=t&&t<=this._calcData[n].x2||0===n&&t<=this._calcData[n].x2||n===s-1&&this._calcData[n].x1<=t){a=n;break}if(0<=a&&a<s){r=t/this._calcData[a].width-this._calcData[a].value/this._calcData[a].width+.5+n;this._hasXs&&(r=_VolumeHelper.convertToRange(r,this._xDataMin,this._xDataMax,0,s-1))}return r};_VolumeHelper.prototype._init=function(){this._hasXs=null!==this._xVals&&this._xVals.length>0;this._hasXs&&!isNumber(this._xDataMin)&&(this._xDataMin=Math.min.apply(null,this._xVals));this._hasXs&&!isNumber(this._xDataMax)&&(this._xDataMax=Math.max.apply(null,this._xVals));this._hasXs&&(this._hasXs=isNumber(this._xDataMin)&&isNumber(this._xDataMax));this._hasXs&&this._xDataType===DataType.Date&&this._fillGaps();var t=0,e=0,i=null!==this._volumes&&this._volumes.length>0?this._volumes.length:0;for(e=0;e<i;e++)t+=this._volumes[e]||0;var r,n,s=0;for(e=0;e<i;e++){r=s+(n=(this._volumes[e]||0)/t);this._calcData.push({value:r,width:n,x1:s,x2:r});s=this._calcData[e].value}};_VolumeHelper.prototype._getXVolume=function(t){var e=this._calcData.length,i=-1;if(this._hasXs){i=this._xVals.indexOf(t);for(var r=0;r<this._xVals.length;r++){if(r<this._xVals.length-1&&this._xVals[r]<=t&&t<=this._xVals[r+1]){i=r;break}if(0===r&&t<=this._xVals[r]){i=r;break}if(r===this._xVals.length-1&&this._xVals[r]<=t){i=r;break}}}this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,e-1,this._xDataMin,this._xDataMax));-1===i&&(i=clamp(Math.round(t),0,e-1));return this._calcData[i].value+(t-i)*this._calcData[i].width-.5*this._calcData[i].width};_VolumeHelper.convertToRange=function(t,e,i,r,n){return e===i||r===n?0:(t-r)*(i-e)/(n-r)+e};_VolumeHelper.prototype._fillGaps=function(){if(!(this._xDataType!==DataType.Date||null===this._xVals||this._xVals.length<=0)){var t,e=this._xDataMin,i=this._xDataMax;for(t=1;e<i;t++){(e=new Date(e)).setDate(e.getDate()+1);if((e=e.valueOf())!==this._xVals[t]){this._xVals.splice(t,0,e);this._volumes.splice(t,0,0)}}}};return _VolumeHelper}();export{_VolumeHelper};var _Curve=function(){function _Curve(t,e,i,r){this.monoX=!1;var n=i||Math.min(t.length,e.length),s=0,a=0,o=0,h=0;if(n>3)for(var l=0;l<n-1;l++)if(l>0){a=Math.min(a,t[l]-t[l-1]);s=Math.max(s,t[l]-t[l-1]);h=Math.min(h,e[l]-e[l-1]);o=Math.max(o,e[l]-e[l-1])}this.monoX=s>0&&0===a||a<0&&0===s;this.monoX&&"spline"!==r?this.calc=a<0?new _SplineMono(t.reverse(),e.reverse(),i):new _SplineMono(t,e,i):this.calc=new _Spline(t,e,i)}_Curve.prototype.calculate=function(){return this.calc.calculate()};return _Curve}();export{_Curve};var _Spline=function(){function _Spline(t,e,i){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;this._len=i||Math.min(t.length,e.length);var r=this._len;if(r>3)for(var n=0;n<r-1;n++){var s=0==n?new Point(t[n],e[n]):new Point(t[n-1],e[n-1]),a=new Point(t[n],e[n]),o=new Point(t[n+1],e[n+1]),h=n==r-2?new Point(t[n+1],e[n+1]):new Point(t[n+2],e[n+2]),l=new Point,_=new Point,u=new Point,c=new 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];_.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];u.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];c.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];_.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];u.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];c.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(_);this._c.push(u);this._d.push(c)}}_Spline.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}};_Spline.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 r=Math.min(this._len*this.k,.2),n=r;n<=this._len-1;n+=r){var s=Math.ceil(n),a=this.calculatePoint(n);if(Math.abs(i.x-a.x)>=3||Math.abs(i.y-a.y)>=3){t.push(a.x);e.push(a.y);i=a}if(n+r>=s){t.push(this._x[s]);e.push(this._y[s])}}return{xs:t,ys:e}};return _Spline}();export{_Spline};var _SplineMono=function(){function _SplineMono(t,e,i){this._x=[];this._y=[];this._c1s=[];this._c2s=[];this._c3s=[];this._len=i||Math.min(t.length,e.length);for(var r=this._len,n=0;n<r;n++){this._x.push(t[n]);this._y.push(e[n])}t=this._x;e=this._y;if(!(this._len<=3)){var s=[],a=[],o=[];for(n=0;n<r-1;n++){var h=t[n+1]-t[n],l=e[n+1]-e[n];a[n]=h;s[n]=l;o[n]=l/h}var _=this._c1s;_.push(o[0]);for(n=0;n<a.length-1;n++){var u=o[n],c=o[n+1];if(u*c<=0)_.push(0);else{var p=a[n],f=a[n+1],d=p+f;_.push(3*d/((d+f)/u+(d+p)/c))}}_.push(o[o.length-1]);var g=this._c2s,m=this._c3s;for(n=0;n<_.length-1;n++){var x=_[n],y=o[n],b=1/a[n],v=x+_[n+1]-y-y;g[n]=(y-x-v)*b;m[n]=v*b*b}}}_SplineMono.prototype.interpolate=function(t){var e=this._x.length-1;if(t>=this._x[e])return this._y[e];for(var i,r=0,n=this._c3s.length-1;r<=n;){i=Math.floor(.5*(r+n));var s=this._x[i];if(s<t)r=i+1;else{if(!(s>t))return this._y[i];n=i-1}}e=Math.max(0,n);var a=t-this._x[e];return this._y[e]+a*(this._c1s[e]+a*(this._c2s[e]+a*this._c3s[e]))};_SplineMono.prototype.calculate=function(){if(this._len<=3)return{xs:this._x,ys:this._y};for(var t=[],e=[],i=this._len,r=this._x[0],n=this._x[i-1],s=Math.min(.001*this._len,.2),a=r;a<=n;a+=s){t.push(a);e.push(this.interpolate(a))}return{xs:t,ys:e}};return _SplineMono}();export var AxisClsNames={axisX:"wj-axis-x",axisXLabels:"wj-axis-x-labels",axisY:"wj-axis-y",axisYLabels:"wj-axis-y-labels",gridline:"wj-gridline",gridlineMinor:"wj-gridline-minor",line:"wj-line",tick:"wj-tick",tickMinor:"wj-tick-minor"};export var DataLabelClsNames={border:"wj-data-label-border",label:"wj-data-label",labels:"wj-data-labels",line:"wj-data-label-line"};export var FlexChartClsNames={footer:"wj-footer",header:"wj-header",hostElement:"wj-flexchart",label:"wj-label",legend:"wj-legend",plotArea:"wj-plot-area",title:"wj-title",touchDisabled:"wj-flexchart-touch-disabled"};export var FlexPieClsNames={hostElement:"wj-flexpie",slice:"wj-slice",sliceGroup:"wj-slice-group"};export var LegendClsNames={legend:"wj-legend",title:"wj-title"};export var LineMarkerClsNames={container:"wj-chart-linemarker-container",content:"wj-chart-linemarker-content",draggable:"wj-chart-linemarker-draggable",hline:"wj-chart-linemarker-hline",linemarker:"wj-chart-linemarker",vline:"wj-chart-linemarker-vline"};export var SeriesClsNames={group:"wj-series-group"};var Palettes=function(){function Palettes(){}Palettes._isExtended=function(t){return-1!==Palettes._values(Palettes.Diverging).indexOf(t)||-1!==Palettes._values(Palettes.Qualitative).indexOf(t)||-1!==Palettes._values(Palettes.SequentialSingle).indexOf(t)||-1!==Palettes._values(Palettes.SequentialMulti).indexOf(t)};Palettes._values=function(t){return Object.keys(t).map((function(e){return t[e]}))};Palettes.standard=["#88bde6","#fbb258","#90cd97","#f6aac9","#bfa554","#bc99c7","#eddd46","#f07e6e","#8c8c8c"];Palettes.cocoa=["#466bb0","#c8b422","#14886e","#b54836","#6e5944","#8b3872","#73b22b","#b87320","#141414"];Palettes.coral=["#84d0e0","#f48256","#95c78c","#efa5d6","#ba8452","#ab95c2","#ede9d0","#e96b7d","#888888"];Palettes.dark=["#005fad","#f06400","#009330","#e400b1","#b65800","#6a279c","#d5a211","#dc0127","#000000"];Palettes.highcontrast=["#ff82b0","#0dda2c","#0021ab","#bcf28c","#19c23b","#890d3a","#607efd","#1b7700","#000000"];Palettes.light=["#ddca9a","#778deb","#cb9fbb","#b5eae2","#7270be","#a6c7a7","#9e95c7","#95b0c7","#9b9b9b"];Palettes.midnight=["#83aaca","#e37849","#14a46a","#e097da","#a26d54","#a584b7","#d89c54","#e86996","#2c343b"];Palettes.modern=["#2d9fc7","#ec993c","#89c235","#e377a4","#a68931","#a672a6","#d0c041","#e35855","#68706a"];Palettes.organic=["#9c88d9","#a3d767","#8ec3c0","#e9c3a9","#91ab36","#d4ccc0","#61bbd8","#e2d76f","#80715a"];Palettes.slate=["#7493cd","#f99820","#71b486","#e4a491","#cb883b","#ae83a4","#bacc5c","#e5746a","#505d65"];Palettes.zen=["#7bb5ae","#e2d287","#92b8da","#eac4cb","#7b8bbd","#c7d189","#b9a0c8","#dfb397","#a9a9a9"];Palettes.cyborg=["#2a9fd6","#77b300","#9933cc","#ff8800","#cc0000","#00cca3","#3d6dcc","#525252","#000000"];Palettes.superhero=["#5cb85c","#f0ad4e","#5bc0de","#d9534f","#9f5bde","#46db8c","#b6b86e","#4e5d6c","#2b3e4b"];Palettes.flatly=["#18bc9c","#3498db","#f39c12","#6cc1be","#99a549","#8f54b5","#e74c3c","#8a9899","#2c3e50"];Palettes.darkly=["#375a7f","#00bc8c","#3498db","#f39c12","#e74c3c","#8f61b3","#b08725","#4a4949","#000000"];Palettes.cerulan=["#033e76","#87c048","#59822c","#53b3eb","#fc6506","#d42323","#e3bb00","#cccccc","#222222"];Palettes.Qualitative={Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"]};Palettes.Diverging={BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]};Palettes.SequentialSingle={Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]};Palettes.SequentialMulti={BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]};return Palettes}();export{Palettes};export var empty={};var PlotArea=function(){function PlotArea(t){this._row=0;this._col=0;this._rect=new Rect(0,0,0,0);copy(this,t)}Object.defineProperty(PlotArea.prototype,"row",{get:function(){return this._row},set:function(t){if(t!=this._row){this._row=asInt(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"column",{get:function(){return this._col},set:function(t){if(t!=this._col){this._col=asInt(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=asString(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"width",{get:function(){return this._width},set:function(t){if(t!=this._width){this._width=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"height",{get:function(){return this._height},set:function(t){if(t!=this._height){this._height=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"style",{get:function(){return this._style},set:function(t){if(t!=this._style){this._style=t;this._invalidate()}},enumerable:!0,configurable:!0});PlotArea.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};PlotArea.prototype._render=function(t){t.drawRect(this._rect.left,this._rect.top,this._rect.width,this._rect.height,null,this.style)};PlotArea.prototype._setPlotX=function(t,e){this._rect.left=t;this._rect.width=e};PlotArea.prototype._setPlotY=function(t,e){this._rect.top=t;this._rect.height=e};return PlotArea}();export{PlotArea};var _GridUnitType,PlotAreaCollection=function(t){__extends(PlotAreaCollection,t);function PlotAreaCollection(){return null!==t&&t.apply(this,arguments)||this}PlotAreaCollection.prototype.getPlotArea=function(t){var e=this.indexOf(t);return e>-1?this[e]:null};PlotAreaCollection.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1};PlotAreaCollection.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}};PlotAreaCollection.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}};PlotAreaCollection.prototype._calculateWidths=function(t,e){if(e<=0)throw"ncols";for(var i=[],r=0;r<e;r++){var n=this._getWidth(r);i[r]=new _GridLength(n)}return this._calculateLengths(t,e,i)};PlotAreaCollection.prototype._calculateHeights=function(t,e){if(e<=0)throw"nrows";for(var i=[],r=0;r<e;r++){var n=this._getHeight(r);i[r]=new _GridLength(n)}return this._calculateLengths(t,e,i)};PlotAreaCollection.prototype._calculateLengths=function(t,e,i){for(var r=[e],n=0,s=0,a=0;a<e;a++)if(i[a].isAbsolute){r[a]=i[a].value;n+=r[a]}else i[a].isStar?s+=i[a].value:i[a].isAuto&&s++;var o=(t-n)/s;for(a=0;a<e;a++){i[a].isStar?r[a]=o*i[a].value:i[a].isAuto&&(r[a]=o);r[a]<0&&(r[a]=0)}return r};return PlotAreaCollection}(ObservableArray);export{PlotAreaCollection};!function(t){t[t.Auto=0]="Auto";t[t.Pixel=1]="Pixel";t[t.Star=2]="Star"}(_GridUnitType||(_GridUnitType={}));var _GridLength=function(){function _GridLength(t){void 0===t&&(t=null);this._unitType=_GridUnitType.Auto;if(t)if((t=t.toString()).indexOf("*")>=0){this._unitType=_GridUnitType.Star;t=t.replace("*","");this._value=parseFloat(t);isNaN(this._value)&&(this._value=1)}else{this._unitType=_GridUnitType.Pixel;this._value=parseFloat(t);if(isNaN(this._value)){this._unitType=_GridUnitType.Auto;this._value=1}}}Object.defineProperty(_GridLength.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isStar",{get:function(){return this._unitType==_GridUnitType.Star},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isAbsolute",{get:function(){return this._unitType==_GridUnitType.Pixel},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isAuto",{get:function(){return this._unitType==_GridUnitType.Auto},enumerable:!0,configurable:!0});return _GridLength}(),_SvgRenderEngine=function(){function _SvgRenderEngine(t){this._STROKE_JOIN="round";this._strokeWidth=1;this._fontSize=null;this._fontFamily=null;this._savedGradient={};this._bbCache={};this._baseUrl="";this._cssPriority=!0;this._readOnly=!1;this._isRtl=!1;this._precision=1;this._options=null;this._htmlText=!1;this._element=t;this._create();this._element&&this._element.appendChild(this._svg);var e=navigator.userAgent.toLowerCase();void 0===_SvgRenderEngine._isff&&(_SvgRenderEngine._isff=e.indexOf("firefox")>=0);void 0===_SvgRenderEngine._isSafari&&(_SvgRenderEngine._isSafari=e.indexOf("safari")>-1&&-1==e.indexOf("chrome"))}_SvgRenderEngine.prototype.attach=function(t){this._element=t;if(t){t.insertBefore(this._svg,t.childNodes[0]);t.appendChild(this._svg)}};_SvgRenderEngine.prototype.detach=function(){this._element&&this._element.removeChild(this._svg);for(;this._svg.firstChild;)removeChild(this._svg.firstChild)};_SvgRenderEngine.prototype.beginRender=function(){for(;this._svg.firstChild;)removeChild(this._svg.firstChild);this._savedGradient={};this._bbCache={};this._svg.appendChild(this._defs);this._svg.appendChild(this._textGroup);this._isRtl=this._checkRtl()};_SvgRenderEngine.prototype.endRender=function(){removeChild(this._textGroup)};_SvgRenderEngine.prototype.setViewportSize=function(t,e){this._svg.setAttribute("width",t.toString());this._svg.setAttribute("height",e.toString())};Object.defineProperty(_SvgRenderEngine.prototype,"element",{get:function(){return this._svg},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fill",{get:function(){return this._fill},set:function(t){this._fill=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._fontFamily=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"stroke",{get:function(){return this._stroke},set:function(t){this._stroke=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=void 0===t?null:t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"textFill",{get:function(){return this._textFill},set:function(t){this._textFill=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"cssPriority",{get:function(){return this._cssPriority},set:function(t){this._cssPriority=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"readOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"precision",{get:function(){return this._precision},set:function(t){this._precision=asNumber(t)},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"group",{get:function(){return this._group},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t},enumerable:!0,configurable:!0});_SvgRenderEngine.prototype.addClipRect=function(t,e){if(t&&e){var i=this.precision,r=document.createElementNS(_SvgRenderEngine.svgNS,"clipPath"),n=document.createElementNS(_SvgRenderEngine.svgNS,"rect");n.setAttribute("x",(t.left-1).toFixed(i));n.setAttribute("y",(t.top-1).toFixed(i));n.setAttribute("width",(t.width+2).toFixed(i));n.setAttribute("height",(t.height+2).toFixed(i));r.appendChild(n);r.setAttribute("id",e);this._svg.appendChild(r)}};_SvgRenderEngine.prototype.drawEllipse=function(t,e,i,r,n,s){var a=document.createElementNS(_SvgRenderEngine.svgNS,"ellipse"),o=this.precision;this._applyColor(a,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());this._applyColor(a,"fill",this._fill);a.setAttribute("cx",t.toFixed(o));a.setAttribute("cy",e.toFixed(o));a.setAttribute("rx",i.toFixed(o));a.setAttribute("ry",r.toFixed(o));n&&a.setAttribute("class",n);this._applyStyle(a,s);this._appendChild(a);return a};_SvgRenderEngine.prototype.drawRect=function(t,e,i,r,n,s,a){var o=document.createElementNS(_SvgRenderEngine.svgNS,"rect"),h=this.precision;this._applyColor(o,"fill",this._fill);this._applyColor(o,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(o,"stroke-width",this._strokeWidth.toString());o.setAttribute("x",t.toFixed(h));isNaN(Number(e))||o.setAttribute("y",e.toFixed(h));i>0&&i<.05?o.setAttribute("width","0.1"):o.setAttribute("width",i.toFixed(h));r>0&&r<.05?o.setAttribute("height","0.1"):o.setAttribute("height",r.toFixed(h));a&&this._setClipPath(o,a);n&&o.setAttribute("class",n);this._applyStyle(o,s);this._appendChild(o);return o};_SvgRenderEngine.prototype.drawLine=function(t,e,i,r,n,s){var a=document.createElementNS(_SvgRenderEngine.svgNS,"line"),o=this.precision;this._applyColor(a,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());a.setAttribute("x1",t.toFixed(o));a.setAttribute("x2",i.toFixed(o));a.setAttribute("y1",e.toFixed(o));a.setAttribute("y2",r.toFixed(o));n&&a.setAttribute("class",n);this._applyStyle(a,s);this._appendChild(a);return a};_SvgRenderEngine.prototype.drawLines=function(t,e,i,r,n,s){if(t&&e){var a=s||Math.min(t.length,e.length);if(a>0){var o=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),h=this.precision;this._applyColor(o,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(o,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(o,"stroke-linejoin",this._STROKE_JOIN)}o.setAttribute("fill","none");for(var l="",_=0;_<a;_++)l+=t[_].toFixed(h)+","+e[_].toFixed(h)+" ";o.setAttribute("points",l);i&&o.setAttribute("class",i);n&&this._setClipPath(o,n);this._applyStyle(o,r);this._appendChild(o);return o}}return null};_SvgRenderEngine.prototype.drawSplines=function(t,e,i,r,n,s){if(t&&e){var a=new _Curve(t,e,s,this._options&&this._options.spline).calculate(),o=a.xs,h=a.ys,l=Math.min(o.length,h.length);if(l>0){var _=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),u=this.precision;this._applyColor(_,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(_,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(_,"stroke-linejoin",this._STROKE_JOIN)}_.setAttribute("fill","none");for(var c="",p=0;p<l;p++)c+=o[p].toFixed(u)+","+h[p].toFixed(u)+" ";_.setAttribute("points",c);i&&_.setAttribute("class",i);n&&this._setClipPath(_,n);this._applyStyle(_,r);this._appendChild(_);return _}}return null};_SvgRenderEngine.prototype.drawPolygon=function(t,e,i,r,n){if(t&&e){var s=Math.min(t.length,e.length);if(s>0){var a=document.createElementNS(_SvgRenderEngine.svgNS,"polygon"),o=this.precision;this._applyColor(a,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(a,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(a,"stroke-linejoin",this._STROKE_JOIN)}this._applyColor(a,"fill",this._fill);for(var h="",l=0;l<s;l++)h+=t[l].toFixed(o)+","+e[l].toFixed(o)+" ";a.setAttribute("points",h);i&&a.setAttribute("class",i);n&&this._setClipPath(a,n);this._applyStyle(a,r);this._appendChild(a);return a}}return null};_SvgRenderEngine.prototype.drawPieSegment=function(t,e,i,r,n,s,a,o){if(n>=2*Math.PI)return this.drawEllipse(t,e,i,i,s,a);var h=document.createElementNS(_SvgRenderEngine.svgNS,"path"),l=this.precision;this._applyColor(h,"fill",this._fill);this._applyColor(h,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(h,"stroke-width",this._strokeWidth.toString());var _=new Point(t,e);_.x+=i*Math.cos(r);_.y+=i*Math.sin(r);var u=r+n,c=new Point(t,e);c.x+=i*Math.cos(u);c.y+=i*Math.sin(u);var p=" 0 0,1 ";Math.abs(n)>Math.PI&&(p=" 0 1,1 ");var f="M "+_.x.toFixed(l)+","+_.y.toFixed(l);f+=" A "+i.toFixed(l)+","+i.toFixed(l)+p;f+=c.x.toFixed(l)+","+c.y.toFixed(l);f+=" L "+t.toFixed(l)+","+e.toFixed(l)+" z";h.setAttribute("d",f);o&&this._setClipPath(h,o);s&&h.setAttribute("class",s);this._applyStyle(h,a);this._appendChild(h);return h};_SvgRenderEngine.prototype.drawDonutSegment=function(t,e,i,r,n,s,a,o,h){var l=!1;if(s>=2*Math.PI){l=!0;s-=.001}var _=document.createElementNS(_SvgRenderEngine.svgNS,"path"),u=this.precision+2;this._applyColor(_,"fill",this._fill);this._applyColor(_,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(_,"stroke-width",this._strokeWidth.toString());var c=new Point(t,e);c.x+=i*Math.cos(n);c.y+=i*Math.sin(n);var p=n+s,f=new Point(t,e);f.x+=i*Math.cos(p);f.y+=i*Math.sin(p);var d=new Point(t,e);d.x+=r*Math.cos(p);d.y+=r*Math.sin(p);var g=new Point(t,e);g.x+=r*Math.cos(n);g.y+=r*Math.sin(n);var m=" 0 0,1 ",x=" 0 0,0 ";if(Math.abs(s)>Math.PI){m=" 0 1,1 ";x=" 0 1,0 "}var y="M "+c.x.toFixed(u)+","+c.y.toFixed(u);y+=" A "+i.toFixed(u)+","+i.toFixed(u)+m;y+=" "+f.x.toFixed(u)+","+f.y.toFixed(u);y+=l?" M "+d.x.toFixed(u)+","+d.y.toFixed(u):" L "+d.x.toFixed(u)+","+d.y.toFixed(u);y+=" A "+r.toFixed(u)+","+r.toFixed(u)+x;y+=g.x.toFixed(u)+","+g.y.toFixed(u);l||(y+=" z");_.setAttribute("d",y);h&&this._setClipPath(_,h);a&&_.setAttribute("class",a);this._applyStyle(_,o);this._appendChild(_);return _};_SvgRenderEngine.prototype.drawString=function(t,e,i,r){return this._isHtmlString(t)?this._drawStringHtml(t,e,i,r):this._drawString(t,e,i,r)};_SvgRenderEngine.prototype._isHtmlString=function(t){return this._htmlText&&/<\/?[a-z][\s\S]*>/i.test(t)};_SvgRenderEngine.prototype._drawString=function(t,e,i,r){var n=this._createText(e,t),s=this.precision;i&&n.setAttribute("class",i);this._applyStyle(n,r);this._appendChild(n);var a,o=this._getKey(t,i,this._groupCls);if(this._bbCache[o]){a=this._bbCache[o];n.setAttribute("y",(e.y-(a.y+a.height)).toFixed(s))}else{a=this._getBBox(n);n.setAttribute("y",(e.y-(a.y+a.height-e.y)).toFixed(s))}this._isRtl&&!isIE()&&n.setAttribute("x",(e.x+a.width).toFixed(s));return n};_SvgRenderEngine.prototype._drawStringHtml=function(t,e,i,r){var n=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");n.setAttribute("width","1000");n.setAttribute("height","100");n.setAttribute("x",e.x.toFixed(2));var s=document.createElement("span"),a=this._groupCls;a&&addClass(s,a);i&&addClass(s,i);this._applyStyle(s,r);s.innerHTML=t;n.appendChild(s);this._appendChild(n);var o=s.getBoundingClientRect();n.setAttribute("width",Math.ceil(o.width+2).toFixed(2));n.setAttribute("height",Math.ceil(o.height+1).toFixed(2));n.setAttribute("y",(e.y-o.height).toFixed(2));return n};_SvgRenderEngine.prototype.drawStringRotated=function(t,e,i,r,n,s){return this._isHtmlString(t)?this._drawStringRotatedHtml(t,e,i,r,n,s):this._drawStringRotated(t,e,i,r,n,s)};_SvgRenderEngine.prototype._drawStringRotated=function(t,e,i,r,n,s){var a=this._createText(e,t),o=this.precision;n&&a.setAttribute("class",n);this._applyStyle(a,s);var h=document.createElementNS(_SvgRenderEngine.svgNS,"g");h.setAttribute("transform","rotate("+r.toFixed(o)+","+i.x.toFixed(o)+","+i.y.toFixed(o)+")");h.appendChild(a);this._appendChild(h);var l=this._getBBox(a);a.setAttribute("y",(e.y-(l.y+l.height-e.y)).toFixed(o));this._isRtl&&!isIE()&&a.setAttribute("x",(e.x+l.width).toFixed(o));return a};_SvgRenderEngine.prototype._drawStringRotatedHtml=function(t,e,i,r,n,s){var a=this.precision,o=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");o.setAttribute("width","1000");o.setAttribute("height","100");o.setAttribute("x",e.x.toFixed(2));var h=document.createElement("span"),l=this._groupCls;l&&addClass(h,l);n&&addClass(h,n);this._applyStyle(h,s);h.innerHTML=t;o.appendChild(h);this._appendChild(o);var _=h.getBoundingClientRect();o.setAttribute("width",Math.ceil(_.width+2).toFixed(2));o.setAttribute("height",Math.ceil(_.height+1).toFixed(2));o.setAttribute("y",(e.y-_.height).toFixed(2));var u=document.createElementNS(_SvgRenderEngine.svgNS,"g");u.setAttribute("transform","rotate("+r.toFixed(a)+","+i.x.toFixed(a)+","+i.y.toFixed(a)+")");u.appendChild(o);this._appendChild(u);return o};_SvgRenderEngine.prototype.measureString=function(t,e,i,r){return this._isHtmlString(t)?this._measureStringHtml(t,e,i,r):this._measureString(t,e,i,r)};_SvgRenderEngine.prototype._measureString=function(t,e,i,r){var n=new Size(0,0);if(!this._fontFamily&&!this._fontSize){var s=this._getKey(t,e,i);if(this._bbCache[s])return this._bbCache[s]}if(this.cssPriority){this._fontSize&&this._text.setAttribute("font-size",this._fontSize);this._fontFamily&&this._text.setAttribute("font-family",this._fontFamily)}else{var a={};this._fontSize&&(a.fontSize=this._fontSize);this._fontFamily&&(a.fontFamily=this._fontFamily);Object.keys(a).length>0&&setCss(this._text,a)}e&&this._text.setAttribute("class",e);i&&this._textGroup.setAttribute("class",i);this._applyStyle(this._text,r);this._setText(this._text,t);var o=this._getBBox(this._text);n.width=o.width;n.height=o.height;this._text.removeAttribute("font-size");this._text.removeAttribute("font-family");this._text.removeAttribute("class");this._text.removeAttribute("style");if(r)for(var s in r)this._text.removeAttribute(this._deCase(s));this._textGroup.removeAttribute("class");this._text.textContent=null;if(!this._fontFamily&&!this._fontSize){s=this._getKey(t,e,i);this._bbCache[s]={x:o.x,y:o.y+1e3,width:o.width,height:o.height}}return n};_SvgRenderEngine.prototype._measureStringHtml=function(t,e,i,r){var n=new Size(0,0),s=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");s.setAttribute("width","1000");s.setAttribute("height","100");s.setAttribute("x","-1000");s.setAttribute("y","-1000");var a=document.createElement("span");i&&addClass(a,i);e&&addClass(a,e);this._applyStyle(a,r);a.innerHTML=t;s.appendChild(a);e&&this._text.setAttribute("class",e);this._applyStyle(this._text,r);this._appendChild(s);var o=a.getBoundingClientRect();n.width=o.width;n.height=o.height;s.remove();return n};_SvgRenderEngine.prototype.startGroup=function(t,e,i){void 0===i&&(i=!1);var r=document.createElementNS(_SvgRenderEngine.svgNS,"g");if(t){r.setAttribute("class",t);this._groupCls=t}e&&this._setClipPath(r,e);this._appendChild(r);i&&r.transform.baseVal.appendItem(this._svg.createSVGTransform());this._group=r;return r};_SvgRenderEngine.prototype.endGroup=function(){if(this._group){var t=this._group.parentNode;if(t==this._svg){this._group=null;this._groupCls=null}else{this._group=t;this._groupCls=this._getClass(this._group)}}};_SvgRenderEngine.prototype.drawImage=function(t,e,i,r,n){var s=document.createElementNS(_SvgRenderEngine.svgNS,"image"),a=this.precision;s.setAttributeNS(_SvgRenderEngine.xlinkNS,"href",t);s.setAttribute("x",e.toFixed(a));s.setAttribute("y",i.toFixed(a));s.setAttribute("width",r.toFixed(a));s.setAttribute("height",n.toFixed(a));this._appendChild(s);return s};_SvgRenderEngine.prototype._setClipPath=function(t,e){t.setAttribute("clip-path","url(#"+e+")");_SvgRenderEngine._isSafari&&setCss(t,{"-webkit-clip-path":"url(#"+e+")"})};_SvgRenderEngine.prototype._appendChild=function(t){if(!this.readOnly){var e=this._group;e||(e=this._svg);e.appendChild(t)}};_SvgRenderEngine.prototype._create=function(){this._svg=document.createElementNS(_SvgRenderEngine.svgNS,"svg");this._defs=document.createElementNS(_SvgRenderEngine.svgNS,"defs");this._svg.appendChild(this._defs);this._text=this._createText(new Point(-1e3,-1e3),"");this._textGroup=document.createElementNS(_SvgRenderEngine.svgNS,"g");this._textGroup.appendChild(this._text);this._svg.appendChild(this._textGroup)};_SvgRenderEngine.prototype._setText=function(t,e){var i=e?e.toString():null;if(i&&i.indexOf("tspan")>=0)try{t.textContent=null;for(var r=new DOMParser,n='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>",s=r.parseFromString(n,"text/xml").documentElement.firstChild;s;){t.appendChild(t.ownerDocument.importNode(s,!0));s=s.nextSibling}}catch(t){throw new Error("Error parsing XML string.")}else t.textContent=i};_SvgRenderEngine.prototype._getKey=function(t,e,i){return t+(e||"")+(i||"")};_SvgRenderEngine.prototype._createText=function(t,e){var i=document.createElementNS(_SvgRenderEngine.svgNS,"text"),r=this.precision;this._setText(i,e);i.setAttribute("x",t.x.toFixed(r));i.setAttribute("y",t.y.toFixed(r));if(this.cssPriority){null!=this._textFill&&i.setAttribute("fill",this._textFill);this._fontSize&&i.setAttribute("font-size",this._fontSize);this._fontFamily&&i.setAttribute("font-family",this._fontFamily)}else{var n={};null!=this._textFill&&(n.fill=this._textFill);this._fontSize&&(n.fontSize=this._fontSize);this._fontFamily&&(n.fontFamily=this._fontFamily);Object.keys(n).length>0&&setCss(i,n)}return i};_SvgRenderEngine.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])};_SvgRenderEngine.prototype._deCase=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))};_SvgRenderEngine.prototype._getClass=function(t){var e;if(t)for(var i=t;i&&!(e=i.getAttribute("class"));i=i.parentNode);return e};_SvgRenderEngine.prototype._getBBox=function(t){if(!_SvgRenderEngine._isff)return t.getBBox();try{return t.getBBox()}catch(t){return{x:0,y:0,width:0,height:0}}};_SvgRenderEngine.prototype._applyColor=function(t,e,i){var r=_GradientColorUtil.tryParse(i);if(null!=r){if(!isString(r)){if(null==this._savedGradient[i]){var n,s="gc"+(1e6*Math.random()).toFixed();if(null!=r.x1){n=document.createElementNS(_SvgRenderEngine.svgNS,"linearGradient");["x1","y1","x2","y2","gradientUnits"].forEach((function(t){null!=r[t]&&n.setAttribute(t,r[t])}))}else if(null!=r.r){n=document.createElementNS(_SvgRenderEngine.svgNS,"radialGradient");["cx","cy","r","fx","fy","fr","gradientUnits"].forEach((function(t){null!=r[t]&&n.setAttribute(t,r[t])}))}r.colors&&r.colors&&r.colors.length>0&&r.colors.forEach((function(t){var e=document.createElementNS(_SvgRenderEngine.svgNS,"stop");null!=t.color&&e.setAttribute("stop-color",t.color);null!=t.offset&&e.setAttribute("offset",t.offset);null!=t.opacity&&e.setAttribute("stop-opacity",t.opacity);n.appendChild(e)}));n.setAttribute("id",s);this._defs.appendChild(n);this._savedGradient[i]=s}r="url("+this._baseUrl+"#"+this._savedGradient[i]+")"}this.cssPriority?t.setAttribute(e,r):this._addInlineStyle(t,e,r)}};_SvgRenderEngine.prototype._addInlineStyle=function(t,e,i){var r={};r[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]=i;setCss(t,r)};_SvgRenderEngine.prototype._setAttribute=function(t,e,i){this.cssPriority?t.setAttribute(e,i):this._addInlineStyle(t,e,i)};_SvgRenderEngine.prototype._checkRtl=function(){return this._element&&hasClass(this._element,UtilitesClsNames.rtl)};_SvgRenderEngine.svgNS="http://www.w3.org/2000/svg";_SvgRenderEngine.xlinkNS="http://www.w3.org/1999/xlink";return _SvgRenderEngine}();export{_SvgRenderEngine};var _GradientColorUtil=function(){function _GradientColorUtil(){}_GradientColorUtil.tryParse=function(t){if(_GradientColorUtil.parsedColor[t])return _GradientColorUtil.parsedColor[t];if(null==t||-1===t.indexOf("-")||-1!==t.indexOf("var("))return t;var e,i=t.replace(/\s+/g,"").split(/-/g),r=i[0][0],n=!1,s=i[0].match(/\(\S+\)/);if(!s||0==s.length)return t;var a=s[0].replace(/[(\\)]/g,"").split(/,/g);if("l"===r||"L"===r){e={x1:"0",y1:"0",x2:"0",y2:"0",colors:[]};"l"===r&&(n=!0);["x1","y1","x2","y2"].forEach((function(t,i){null!=a[i]&&(e[t]=n?100*+a[i]+"%":""+a[i])}))}else if("r"===r||"R"===r){e={cx:"0",cy:"0",r:"0",colors:[]};"r"===r&&(n=!0);["cx","cy","r","fx","fy","fr"].forEach((function(t,i){null!=a[i]&&""!==a[i]&&(e[t]=n?100*+a[i]+"%":""+a[i])}))}n||(e.gradientUnits="userSpaceOnUse");_GradientColorUtil.parsedColor[t]=e;var o=i.length-1;i.forEach((function(t,i){t.indexOf(")")>-1&&(t=t.match(/\)\S+/)[0].replace(")",""));var r=t.split(":"),s={color:"black"};null!=r[0]&&(s.color=r[0]);null!=r[1]?s.offset=n?100*+r[1]+"%":""+r[1]:s.offset=i/o*100+"%";null!=r[2]&&(s.opacity=r[2]);e.colors.push(s)}));return e};_GradientColorUtil.parsedColor={};return _GradientColorUtil}(),SvgRenderEngine=function(t){__extends(SvgRenderEngine,t);function SvgRenderEngine(){return null!==t&&t.apply(this,arguments)||this}return SvgRenderEngine}(_SvgRenderEngine);export{SvgRenderEngine};var Legend=function(){function Legend(t){this._position=Position.Right;this._title="";this._titleAlign="left";this._titlePadding=5;this._areas=[];this._sz=new Size;this._orient=Orientation.Auto;this._scrollbar=!1;this._chart=t}Object.defineProperty(Legend.prototype,"position",{get:function(){return this._position},set:function(t){if((t=asEnum(t,Position))!=this._position){this._position=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"reverse",{get:function(){return this._reverse},set:function(t){if(t!=this._reverse){this._reverse=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"title",{get:function(){return this._title},set:function(t){if(t!=this._title){this._title=asString(t,!1);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"titleAlign",{get:function(){return this._titleAlign},set:function(t){if(t!=this._titleAlign){var e=asString(t,!1);this._titleAlign="right"===e?"right":"center"===e?"center":"left";this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"orientation",{get:function(){return this._orient},set:function(t){if((t=asEnum(t,Orientation))!=this._orient){this._orient=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"maxSize",{get:function(){return this._maxSz},set:function(t){if(t!=this._maxSz){if(isNumber(t))this._maxSz=t;else if(isString(t)){var e=asString(t);assert(FlexChartBase._endsWith(e,"px")||FlexChartBase._endsWith(e,"%"),"number with unit (px or %) expected.");this._maxSz=e}else t&&assert(!1,"number or string expected.");this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"scrollbar",{get:function(){return this._scrollbar},set:function(t){if(t!=this._scrollbar){this._scrollbar=asBoolean(t,!1);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"isVertical",{get:function(){return this.orientation==Orientation.Auto?null==this.position||this.position==Position.Auto||this.position==Position.Right||this.position==Position.Left||this.position==Position.LeftTop||this.position==Position.LeftBottom||this.position==Position.RightTop||this.position==Position.RightBottom:this.orientation==Orientation.Vertical},enumerable:!0,configurable:!0});Legend.prototype._getDesiredSize=function(t,e,i,r){if(e==Position.None)return null;var n=new Size;this.title.length>0&&(r-=(n=t.measureString(this.title,LegendClsNames.title,LegendClsNames.legend)).height+this._titlePadding);var s=this._chart._getDesiredLegendSize(t,this.isVertical,i,r);if(null!=s){if(this.title.length>0){s.height+=n.height+this._titlePadding;if(n.width>s.width)if(this.position==Position.Left||this.position==Position.Right||this.position==Position.LeftTop||this.position==Position.LeftBottom||this.position==Position.RightTop||this.position==Position.RightBottom){var a=Math.min(n.width,this._getMaxSize(i));s.width=a;n.width=a}else i>s.width&&i<n.width?s.width=i:i>=n.width&&(s.width=n.width)}this._sz=s.clone();if(this.scrollbar)if(this.isVertical&&s.height>r){s.width+=18;s.height=r}else if(!this.isVertical&&s.width>i){s.width=i;s.height+=18}}return s};Legend.prototype._getPosition=function(t,e){return this.position==Position.Auto?t>=e?Position.Right:Position.Bottom:this.position};Legend.prototype._render=function(t,e,i,r,n){this._areas=[];var s=0;t.fill="transparent";t.stroke=null;t.drawRect(e.x,e.y,r,n);if(this.title.length){var a=e.clone(),o=t.measureString(this.title,LegendClsNames.title+"`");a.y+=o.height;"right"===this.titleAlign?a.x=e.x+r-o.width:"center"===this.titleAlign&&(a.x=e.x+.5*(r-o.width));t.drawString(this.title,a,LegendClsNames.title);s=o.height+this._titlePadding;e.y+=s;n-=s}var h=!1;this.scrollbar&&(this._sz.height>n&&this.isVertical||this._sz.width>r&&!this.isVertical)&&(h=!0);this._chart._renderLegend(t,e,this._areas,this.isVertical,h?r-18:r,n);if(h){n+=s;this._addScrollbar(t,e,r,n,this._sz,this.isVertical,s)}};Legend.prototype._hitTest=function(t){for(var e=this._areas,i=0;i<e.length;i++)if(e[i]&&FlexChartBase._contains(e[i],t))return i;return null};Legend.prototype._addScrollbar=function(t,e,i,r,n,s,a){t.endGroup();var o=100-a/r*100,h=t.element,l=h.children.item(h.children.length-1),_=l.getBoundingClientRect();l.removeAttribute("clip-path");var u=[];l.children.length>0&&u.push(l.children.item(0));a>0&&u.push(l.children.item(1));Array.from(l.querySelectorAll("text,rect")).forEach((function(t){if(-1==u.indexOf(t)){t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))}}));Array.from(l.querySelectorAll("foreignObject")).forEach((function(t){if(-1==u.indexOf(t)){t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))}}));Array.from(l.querySelectorAll("ellipse")).forEach((function(t){t.setAttribute("cx",(+t.getAttribute("cx")-e.x).toFixed(2));t.setAttribute("cy",(+t.getAttribute("cy")-e.y).toFixed(2))}));Array.from(l.querySelectorAll("line")).forEach((function(t){t.setAttribute("x1",(+t.getAttribute("x1")-e.x).toFixed(2));t.setAttribute("y1",(+t.getAttribute("y1")-e.y).toFixed(2));t.setAttribute("x2",(+t.getAttribute("x2")-e.x).toFixed(2));t.setAttribute("y2",(+t.getAttribute("y2")-e.y).toFixed(2))}));var c=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");c.setAttribute("x",e.x.toFixed(2));c.setAttribute("y",e.y.toFixed(2));c.setAttribute("width",i.toFixed(2));c.setAttribute("height",r.toFixed(2));var p=document.createElement("div");p.className="wj-legend-scrollable";setCss(p,s?{width:"100%",height:o+"%",overflowX:"hidden",overflowY:"scroll"}:{width:"100%",height:o+"%",overflowY:"hidden",overflowX:"scroll"});var f=document.createElementNS("http://www.w3.org/2000/svg","svg");f.setAttribute("height",(_.height-a).toFixed(2));var d=_.width;!s&&n.width<d&&(d=n.width);f.setAttribute("width",d.toFixed(2));for(;l.children.length>u.length;){var g=l.children.item(u.length);l.removeChild(g);f.appendChild(g)}p.appendChild(f);c.appendChild(p);l.appendChild(c)};Legend.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};Legend.prototype._getMaxSize=function(t){var e=this.maxSize;if(isNumber(e)){if((r=asNumber(e,!0))>0)return Math.min(r,t)}else{var i=asString(e,!0);if(i)if(FlexChartBase._endsWith(i,"px")){if((r=parseFloat(i.replace("px","")))>0)return Math.min(r,t)}else if(FlexChartBase._endsWith(i,"%")){var r;if((r=parseFloat(i.replace("%","")))>0)return t*Math.min(r,100)/100}}return.5*t};return Legend}();export{Legend};var DataPoint=function DataPoint(t,e){void 0===t&&(t=0);void 0===e&&(e=0);this.x=t;this.y=e};export{DataPoint};var RenderEventArgs=function(t){__extends(RenderEventArgs,t);function RenderEventArgs(e){var i=t.call(this)||this;i._engine=e;return i}Object.defineProperty(RenderEventArgs.prototype,"engine",{get:function(){return this._engine},enumerable:!0,configurable:!0});return RenderEventArgs}(CancelEventArgs);export{RenderEventArgs};var SeriesRenderingEventArgs=function(t){__extends(SeriesRenderingEventArgs,t);function SeriesRenderingEventArgs(e,i,r){var n=t.call(this,e)||this;n._index=i;n._count=r;return n}Object.defineProperty(SeriesRenderingEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(SeriesRenderingEventArgs.prototype,"count",{get:function(){return this._count},enumerable:!0,configurable:!0});return SeriesRenderingEventArgs}(RenderEventArgs);export{SeriesRenderingEventArgs};export var ImageFormat;!function(t){t[t.Png=0]="Png";t[t.Jpeg=1]="Jpeg";t[t.Svg=2]="Svg"}(ImageFormat||(ImageFormat={}));export var SelectionMode;!function(t){t[t.None=0]="None";t[t.Series=1]="Series";t[t.Point=2]="Point"}(SelectionMode||(SelectionMode={}));export var Position;!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";t[t.TopLeft=6]="TopLeft";t[t.TopRight=7]="TopRight";t[t.BottomLeft=8]="BottomLeft";t[t.BottomRight=9]="BottomRight";t[t.LeftTop=10]="LeftTop";t[t.LeftBottom=11]="LeftBottom";t[t.RightTop=12]="RightTop";t[t.RightBottom=13]="RightBottom"}(Position||(Position={}));export var Orientation;!function(t){t[t.Auto=0]="Auto";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal"}(Orientation||(Orientation={}));var FlexChartBase=function(t){__extends(FlexChartBase,t);function FlexChartBase(){var e=null!==t&&t.apply(this,arguments)||this;e._palette=null;e._selectionMode=SelectionMode.None;e._defPalette=Palettes.standard;e._notifyCurrentChanged=!0;e._legendHost=null;e._needBind=!1;e._skipLightClr=!1;e.rendering=new Event;e.rendered=new Event;e.itemsSourceChanging=new Event;e.itemsSourceChanged=new Event;e.selectionChanged=new Event;return e}Object.defineProperty(FlexChartBase.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){var e=new CancelEventArgs;if(!this.onItemsSourceChanging(e))return;if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._clearCachedValues();this.onItemsSourceChanged(e);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"palette",{get:function(){return this._palette},set:function(t){if(t!=this._palette){this._palette=asArray(t);this._skipLightClr=Palettes._isExtended(this._palette);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"plotMargin",{get:function(){return this._plotMargin},set:function(t){if(t!=this._plotMargin){this._plotMargin=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"legend",{get:function(){return this._legend},set:function(t){if(t!=this._legend){this._legend=asType(t,Legend);null!=this._legend&&(this._legend._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"header",{get:function(){return this._header},set:function(t){if(t!=this._header){this._header=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"footer",{get:function(){return this._footer},set:function(t){if(t!=this._footer){this._footer=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"headerStyle",{get:function(){return this._headerStyle},set:function(t){if(t!=this._headerStyle){this._headerStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"footerStyle",{get:function(){return this._footerStyle},set:function(t){if(t!=this._footerStyle){this._footerStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"selectionMode",{get:function(){return this._selectionMode},set:function(t){if((t=asEnum(t,SelectionMode))!=this._selectionMode){this._selectionMode=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=asFunction(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"options",{get:function(){return this._options},set:function(t){if(t!=this._options){this._options=t;this.invalidate()}},enumerable:!0,configurable:!0});FlexChartBase.prototype.onRendering=function(t){this.rendering.raise(this,t)};FlexChartBase.prototype.onRendered=function(t){this.rendered.raise(this,t)};FlexChartBase.prototype.onItemsSourceChanging=function(t){this.itemsSourceChanging.raise(this,t);return!t.cancel};FlexChartBase.prototype.onItemsSourceChanged=function(t){this.itemsSourceChanged.raise(this,t)};FlexChartBase.prototype.saveImageToFile=function(t){var e,i,r,n;t&&0!==t.length&&-1!==t.indexOf(".")||(t="image.png");n=t.split(".");e=n[0];i=n[1].toLowerCase();r=ImageFormat[i[0].toUpperCase()+i.substring(1)];this.saveImageToDataUrl(r,(function(t){ExportHelper.downloadImage(t,e,i)}))};FlexChartBase.prototype.saveImageToDataUrl=function(t,e){var i=asEnum(t,ImageFormat,!1),r=ImageFormat[i].toLowerCase();r&&r.length&&this._exportToImage(r,(function(t){e.call(e,t)}))};FlexChartBase.prototype.saveSvgToDataUrl=function(t,e){void 0===e&&(e=!0);this._exportToImage("svg",(function(e){t.call(t,e)}),{embedCss:e})};FlexChartBase.prototype.saveSvgToFile=function(t,e){void 0===e&&(e=!0);this.saveSvgToDataUrl((function(e){ExportHelper.downloadImage(e,t,"svg")}),e)};FlexChartBase.prototype._exportToImage=function(t,e,i){var r=this;void 0===i&&(i=null);var n=this._currentRenderEngine.element;i&&!1===i.embedCss?ExportHelper.getDataUri2(n,this,(function(i){r.prepareDataUri(n,t,i,e)})):ExportHelper.getDataUri(n,this,(function(i){r.prepareDataUri(n,t,i,e)}))};FlexChartBase.prototype.prepareDataUri=function(t,e,i,r){var n=this;if("svg"===e)r.call(null,i);else{var s=new Image;s.onload=function(){var i,a=document.createElement("canvas"),o=t.parentNode||t,h=getElementRect(o);a.width=h.width;a.height=h.height;var l=a.getContext("2d"),_=n._bgColor(n.hostElement);n._isTransparent(_)&&(_="#ffffff");l.fillStyle=_;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(s,+u||0,+c||0);i=a.toDataURL("image/"+e);r.call(null,i);a=null};s.src=i}};FlexChartBase.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.isUpdating||this.disposed||this._refreshChart()};FlexChartBase.prototype.onSelectionChanged=function(t){this.selectionChanged.raise(this,t)};FlexChartBase.prototype.onLostFocus=function(e){this._tooltip&&this._tooltip.isVisible&&!this.isTouching&&this._tooltip.hide();t.prototype.onLostFocus.call(this,e)};FlexChartBase.prototype._cvCollectionChanged=function(t,e){this._clearCachedValues();this._bindChart()};FlexChartBase.prototype._cvCurrentChanged=function(t,e){this._notifyCurrentChanged&&this._bindChart()};FlexChartBase.prototype._bgColor=function(t){if(!t)return"transparent";var e=getComputedStyle(t).backgroundColor;return this._isTransparent(e)?this._bgColor(t.parentElement):e};FlexChartBase.prototype._isTransparent=function(t){var e=new Color(t);return 0==e.a&&0==e.b&&0==e.g&&0==e.r};FlexChartBase.prototype._getColor=function(t){var e=this._defPalette;null!=this._palette&&this._palette.length>0&&(e=this._palette);return e[t%e.length]};FlexChartBase.prototype._getColorLight=function(t){var e=this._getColor(t);this._skipLightClr||(e=this._getLightColor(e));return e};FlexChartBase.prototype._getLightColor=function(t){var e=new Color(t);if(null!=e&&-1===t.indexOf("-")){1==e.a&&-1==t.indexOf("rgba")&&-1==t.indexOf("hsla")&&(e.a*=.7);t=e.toString()}return t};FlexChartBase.prototype._bindChart=function(){this._needBind=!0;this.invalidate()};FlexChartBase.prototype._clearCachedValues=function(){};FlexChartBase.prototype._renderEls=function(t,e,i,r,n){void 0===i&&(i=!0);void 0===r&&(r=null);void 0===n&&(n=!1);var s=e.width,a=e.height;if(0!=s){(isNaN(s)||s<0)&&(s=FlexChartBase._WIDTH);(a<=0||isNaN(a))&&(a=FlexChartBase._HEIGHT);var o=s>0&&a>0;o&&t.setViewportSize(s,a);var h=0,l=0;if(this.legend.scrollbar&&this._legendHost){if(p=this._legendHost.querySelector(".wj-legend-scrollable"))if(this.legend.isVertical){l=0;h=p.scrollTop}else{h=0;l=p.scrollLeft}}this._currentRenderEngine._htmlText=this._isHtmlText();t.beginRender();t.cssPriority=!0;if(o){this._rectChart=new Rect(0,0,s,a);this._prepareRender();if(r){var _=t.stroke,u=t.fill;t.fill=r;t.stroke=null;t.drawRect(0,0,s,a);t.fill=u;t.stroke=_}var c=new Rect(0,0,s,a);this._chartRectId="chartRect"+(1e6*Math.random()).toFixed();t.addClipRect(c,this._chartRectId);this._renderHeader(t,c);this._renderFooter(t,c);this._renderLegends(t,c);this._renderChart(t,c,i);if(this.legend.scrollbar&&this._legendHost){var p;if(p=this._legendHost.querySelector(".wj-legend-scrollable")){p.scrollTop=h;p.scrollLeft=l}}}t.endRender()}};FlexChartBase.prototype._render=function(t,e,i){void 0===e&&(e=!0);void 0===i&&(i=null);var r=this._getHostSize();if(this._h){var n=r.height-this._h;n>=4&&n<=6&&!1!==this._isPCUnit("height")&&(r.height=this._h)}this._h=r.height;this._renderEls(t,r,e,i)};FlexChartBase.prototype._isPCUnit=function(t){var e=null,i=this.hostElement;if(i&&i.computedStyleMap){var r=i.computedStyleMap();if(r){var n=r.get(t);n&&(e="percent"==n.unit)}}return e};FlexChartBase.prototype._renderHidden=function(t,e){void 0===t&&(t=null);void 0===e&&(e=null);var i=document.createElement("div");addClass(i,this.hostElement.getAttribute("class")||"");i.style.visibility="hidden";var r=new _SvgRenderEngine(i);document.body.appendChild(i);if(!t){var n=this._getHostComputedStyle(),s=0,a=0;if(n){s=this._parsePx(n.width);a=this._parsePx(n.height);0==s&&(s=FlexChartBase._WIDTH);0==a&&(a=FlexChartBase._HEIGHT);s-=this._parsePx(n.paddingLeft);s-=this._parsePx(n.paddingRight);a-=this._parsePx(n.paddingTop);a-=this._parsePx(n.paddingBottom);s-=this._parsePx(n.borderLeftWidth);s-=this._parsePx(n.borderRightWidth);a-=this._parsePx(n.borderTopWidth);a-=this._parsePx(n.borderBottomWidth)}0==s&&(s=FlexChartBase._WIDTH);0==a&&(a=FlexChartBase._HEIGHT);t=new Size(s,a)}this._renderEls(r,t,!0,e,!0);removeChild(i);return r.element};FlexChartBase.prototype._renderHeader=function(t,e){t.startGroup(FlexChartBase._CSS_HEADER,this._chartRectId);e=this._drawTitle(t,e,this.header,this.headerStyle,!1);t.endGroup()};FlexChartBase.prototype._renderFooter=function(t,e){t.startGroup(FlexChartBase._CSS_FOOTER,this._chartRectId);e=this._drawTitle(t,e,this.footer,this.footerStyle,!0);t.endGroup()};FlexChartBase.prototype._renderLegends=function(t,e){var i,r,n=this.legend,s=e.width,a=e.height,o=n._getPosition(s,a),h=s,l=a;o==Position.Left||o==Position.Right||o==Position.LeftTop||o==Position.LeftBottom||o==Position.RightTop||o==Position.RightBottom?h=this._getLegendSize(s,h):l=this._getLegendSize(a,l);if(i=n._getDesiredSize(t,o,h,l)){o==Position.Left||o==Position.Right||o==Position.LeftTop||o==Position.LeftBottom||o==Position.RightTop||o==Position.RightBottom?i.width=this._getLegendSize(s,i.width):i.height=this._getLegendSize(a,i.height);i.height>e.height&&(i.height=e.height);switch(o){case Position.Right:s-=i.width;r=new Point(s,e.top+.5*(a-i.height));break;case Position.RightTop:s-=i.width;r=new Point(s,e.top);break;case Position.RightBottom:s-=i.width;r=new Point(s,e.top+(a-i.height));break;case Position.Left:e.left+=i.width;s-=i.width;r=new Point(0,e.top+.5*(a-i.height));break;case Position.LeftTop:e.left+=i.width;s-=i.width;r=new Point(0,e.top);break;case Position.LeftBottom:e.left+=i.width;s-=i.width;r=new Point(0,e.top+(a-i.height));break;case Position.Top:a-=i.height;r=new Point(.5*(s-i.width),e.top);e.top+=i.height;break;case Position.TopLeft:a-=i.height;r=new Point(0,e.top);e.top+=i.height;break;case Position.TopRight:a-=i.height;r=new Point(s-i.width,e.top);e.top+=i.height;break;case Position.Bottom:a-=i.height;r=new Point(.5*(s-i.width),e.top+a);break;case Position.BottomLeft:a-=i.height;r=new Point(0,e.top+a);break;case Position.BottomRight:a-=i.height;r=new Point(s-i.width,e.top+a)}e.width=s;e.height=a;this._rectLegend=new Rect(r.x,r.y,i.width,i.height);var _="legRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._rectLegend,_);this._legendHost=t.startGroup(FlexChartBase._CSS_LEGEND,_);this.legend._render(t,r,o,i.width,i.height);t.endGroup()}else{this._legendHost=null;this._rectLegend=null}};FlexChartBase.prototype._prepareRender=function(){};FlexChartBase.prototype._renderChart=function(t,e,i){};FlexChartBase.prototype._performBind=function(){};FlexChartBase.prototype._getDesiredLegendSize=function(t,e,i,r){return null};FlexChartBase.prototype._renderLegend=function(t,e,i,r,n,s){};FlexChartBase.prototype._getHitTestItem=function(t){return null};FlexChartBase.prototype._getHitTestValue=function(t,e){return null};FlexChartBase.prototype._getHitTestLabel=function(t){return null};FlexChartBase.prototype._refreshChart=function(){if(this._needBind){this._needBind=!1;this._performBind()}this.hostElement&&this._render(this._currentRenderEngine)};FlexChartBase.prototype._drawTitle=function(t,e,i,r,n){var s=FlexChartBase._CSS_TITLE,a=n?FlexChartBase._CSS_FOOTER:FlexChartBase._CSS_HEADER,o=null;n?this._rectFooter=null:this._rectHeader=null;if(null!=i){var h=null,l=null,_=null,u=null;if(r){r.fontSize&&(h=r.fontSize);r.foreground&&(l=r.foreground);r.fill&&(l=r.fill);r.fontFamily&&(_=r.fontFamily);r.halign&&(u=r.halign)}t.fontSize=h;t.fontFamily=_;o=t.measureString(i,s,a,r);e.height-=o.height;l||(l=FlexChartBase._FG);t.textFill=l;if(n){"left"==u?FlexChartBase._renderText(t,i,new Point(e.left,e.bottom),0,0,s,a,r):"right"==u?FlexChartBase._renderText(t,i,new Point(e.left+e.width,e.bottom),2,0,s,a,r):FlexChartBase._renderText(t,i,new Point(e.left+.5*e.width,e.bottom),1,0,s,a,r);this._rectFooter=new Rect(e.left,e.bottom,e.width,o.height)}else{this._rectHeader=new Rect(e.left,e.top,e.width,o.height);e.top+=o.height;"left"==u?FlexChartBase._renderText(t,i,new Point(e.left,0),0,0,s,a,r):"right"==u?FlexChartBase._renderText(t,i,new Point(e.left+e.width,0),2,0,s,a,r):FlexChartBase._renderText(t,i,new Point(e.left+.5*e.width,0),1,0,s,a,r)}t.textFill=null;t.fontSize=null;t.fontFamily=null}return e};FlexChartBase.prototype.pageToControl=function(t,e){return this._toControl(t,e)};FlexChartBase.prototype._toControl=function(t,e){isNumber(t)&&isNumber(e)?t=new Point(t,e):t instanceof MouseEvent&&(t=mouseToPage(t));asType(t,Point);var i=t.clone(),r=this._getHostOffset();i.x-=r.x;i.y-=r.y;var n=this._currentRenderEngine?this._currentRenderEngine.element:null;if(null!=n){var s=n.getBoundingClientRect(),a=parseFloat(n.getAttribute("width")),o=parseFloat(n.getAttribute("height"));s.width!=a&&(i.x*=a/s.width);s.height!=o&&(i.y*=o/s.height)}var h=this._getHostComputedStyle();if(h){var l=parseInt(h.paddingLeft.replace("px",""));l&&!isNaN(l)&&(i.x-=l);var _=parseInt(h.paddingTop.replace("px",""));_&&!isNaN(_)&&(i.y-=_)}return i};FlexChartBase.prototype._highlightItems=function(t,e,i){if(i)for(var r=0;r<t.length;r++)addClass(t[r],e);else for(r=0;r<t.length;r++)removeClass(t[r],e)};FlexChartBase.prototype._parseMargin=function(t){var e={};if(isNumber(t)&&!isNaN(t))e.top=e.bottom=e.left=e.right=asNumber(t);else if(isString(t)){var i=asString(t).split(" ",4),r=NaN,n=NaN,s=NaN,a=NaN;if(i){if(4==i.length){r=parseFloat(i[0]);a=parseFloat(i[1]);n=parseFloat(i[2]);s=parseFloat(i[3])}else if(2==i.length){r=n=parseFloat(i[0]);s=a=parseFloat(i[1])}else 1==i.length&&(r=n=s=a=parseFloat(i[1]));isNaN(r)||(e.top=r);isNaN(n)||(e.bottom=n);isNaN(s)||(e.left=s);isNaN(a)||(e.right=a)}}return e};FlexChartBase.prototype._showToolTip=function(t,e){var i=this,r=this._tooltip.showDelay;this._clearTimeouts();if(!this.isDisabled){t||this._tooltip.hide();if(r>0)this._toShow=setTimeout((function(){i._tooltip.show(i.hostElement,t,e);i._tooltip.hideDelay>0&&(i._toHide=setTimeout((function(){i._tooltip.hide()}),i._tooltip.hideDelay))}),r);else{this._tooltip.show(this.hostElement,t,e);this._tooltip.hideDelay>0&&(this._toHide=setTimeout((function(){i._tooltip.hide()}),this._tooltip.hideDelay))}}};FlexChartBase.prototype._hideToolTip=function(){this._clearTimeouts();this._tooltip.hide()};FlexChartBase.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHide){clearTimeout(this._toHide);this._toHide=null}};FlexChartBase.prototype._getHostOffset=function(){var t=getElementRect(this.hostElement);return new Point(t.left,t.top)};FlexChartBase.prototype._getHostSize=function(){var t=new Size,e=this.hostElement,i=this._getHostComputedStyle(),r=e.offsetWidth,n=e.offsetHeight;if(i){r-=this._parsePx(i.paddingLeft);r-=this._parsePx(i.paddingRight);n-=this._parsePx(i.paddingTop);n-=this._parsePx(i.paddingBottom);r-=this._parsePx(i.borderLeftWidth);r-=this._parsePx(i.borderRightWidth);n-=this._parsePx(i.borderTopWidth);n-=this._parsePx(i.borderBottomWidth);t.width=r;t.height=n}return t};FlexChartBase.prototype._parsePx=function(t){var e=parseFloat(t.replace("px",""));return isNaN(e)?0:e};FlexChartBase.prototype._getHostComputedStyle=function(){var t=this.hostElement;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(this.hostElement):null};FlexChartBase.prototype._find=function(t,e){for(var i=[],r=0;r<t.childElementCount;r++){var n=t.childNodes.item(r);if(e.indexOf(n.nodeName)>=0)i.push(n);else{var s=this._find(n,e);if(s.length>0)for(var a=0;a<s.length;a++)i.push(s[a])}}return i};FlexChartBase.prototype._getLegendSize=function(t,e){return Math.min(e,this.legend._getMaxSize(t))};FlexChartBase.prototype._isHtmlText=function(){return this._options&&this._options.htmlText};FlexChartBase._contains=function(t,e){return!(!t||!e)&&(e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom)};FlexChartBase._intersects=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)};FlexChartBase._toOADate=function(t){return t.valueOf()};FlexChartBase._fromOADate=function(t){return new Date(t)};FlexChartBase._renderText=function(t,e,i,r,n,s,a,o,h){var l=t.measureString(e,s,a,o),_=i.x,u=i.y;switch(r){case 1:_-=.5*l.width;break;case 2:_-=l.width}switch(n){case 1:u+=.5*l.height;break;case 0:u+=l.height}var c=new Rect(_,u-l.height,l.width,l.height);if(h){if(h(c)){t.drawString(e,new Point(_,u),s,o);return c}return null}t.drawString(e,new Point(_,u),s,o);return c};FlexChartBase._renderRotatedText=function(t,e,i,r,n,s,a,o,h,l){var _=t.measureString(e,o,h,l),u=i.x,c=i.y;switch(r){case 1:u-=.5*_.width;break;case 2:u-=_.width}switch(n){case 1:c+=.5*_.height;break;case 0:c+=_.height}return t.drawStringRotated(e,new Point(u,c),s,a,o,l)};FlexChartBase._endsWith=function(t,e){if(t&&e){var i=t.length-e.length;return i>=0&&t.indexOf(e,i)===i}return!1};FlexChartBase._WIDTH=300;FlexChartBase._HEIGHT=200;FlexChartBase._SELECTION_THRESHOLD=15;FlexChartBase._CSS_LEGEND=FlexChartClsNames.legend;FlexChartBase._CSS_HEADER=FlexChartClsNames.header;FlexChartBase._CSS_FOOTER=FlexChartClsNames.footer;FlexChartBase._CSS_TITLE=FlexChartClsNames.title;FlexChartBase._CSS_LABEL=FlexChartClsNames.label;FlexChartBase._CSS_SELECTION=ControlStateClsNames.selected;FlexChartBase._CSS_PLOT_AREA=FlexChartClsNames.plotArea;FlexChartBase._FG="#666";FlexChartBase._epoch=new Date(1899,11,30).getTime();FlexChartBase._msPerDay=864e5;return FlexChartBase}(Control);export{FlexChartBase};var _KeyWords=function(){function _KeyWords(){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}_KeyWords.prototype.replace=function(t,e){var i=this;return format(t,{},(function(t,r,n,s){return i.getValue(r,e,n)}))};_KeyWords.prototype.getValue=function(t,e,i){switch(t){case"seriesName":return e.series?e.series.name:"";case"pointIndex":return null!=e.pointIndex?e.pointIndex.toFixed():"";case"x":return i?Globalize.format(e.x,i):e._xfmt;case"y":return i?Globalize.format(e.y,i):e._yfmt;case"value":return i?Globalize.format(e.value,i):e._getValueFmt();case"name":return e.name}if(e.item){0==t.indexOf("item.")&&(t=t.substr(5));var r=e.item[t];if(!isUndefined(r))return i?Globalize.format(r,i):r}return""};return _KeyWords}();export{_KeyWords};var ExportHelper=function(){function ExportHelper(){}ExportHelper.downloadImage=function(t,e,i){var r=document.createElement("a"),n="image/"+i;if(navigator.msSaveOrOpenBlob){t=t.substring(t.indexOf(",")+1);var s,a=atob(t),o=[],h=void 0,l=void 0;for(h=0;h<a.length;h+=512){l=a.slice(h,h+512);for(var _=new Array(l.length),u=0;u<l.length;u++)_[u]=l.charCodeAt(u);var c=new Uint8Array(_);o.push(c)}s=new Blob(o,{type:n});navigator.msSaveOrOpenBlob(s,e+"."+i)}else{r.download=e+"."+i;r.href=t;document.body.appendChild(r);r.addEventListener("click",(function(t){removeChild(r)}));r.click()}};ExportHelper.getDataUri=function(t,e,i){var r,n,s,a,o,h,l,_,u,c,p=document.createElement("div"),f=t.cloneNode(!0),d=!1;if("svg"==t.tagName){n=(r=getElementRect(t.parentNode||t)).width||0;s=r.height||0;0==n&&(d=!0);a=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:n;o=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:s}else{n=(h=t.getBBox()).x+h.width;s=h.y+h.height;f.setAttribute("transform",f.getAttribute("transform").replace(/translate\(.*?\)/,""));a=n;o=s;(_=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(f);f=_}if(d){var g=e._renderHidden(),m=e._getHostComputedStyle(),x=0,y=0;if(m){x=e._parsePx(m.width);y=e._parsePx(m.height)}0==x&&(x=FlexChartBase._WIDTH);0==y&&(y=FlexChartBase._HEIGHT);a=n=x;o=s=y;f=g.cloneNode(!0)}f.setAttribute("version","1.1");f.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");f.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");f.setAttribute("width",n);f.setAttribute("height",s);f.setAttribute("viewBox","0 0 "+a+" "+o);addClass(f,t.parentNode&&t.parentNode.getAttribute("class")||"");p.appendChild(f);l=ExportHelper.getStyles(t);l+="."+FlexChartClsNames.hostElement+"{margin:0px;padding:0px;border:none;width:"+n+"px;height:"+s+"px;}\n";(u=document.createElement("style")).setAttribute("type","text/css");u.innerHTML="<![CDATA[\n"+l+"\n]]>";(c=document.createElementNS("http://www.w3.org/2000/svg","defs")).appendChild(u);f.insertBefore(c,f.firstChild);isIE()||f.querySelectorAll("foreignObject").forEach((function(t){if(f===t.parentNode)f.removeChild(t);else for(var e=0,i=t.children;e<i.length;e++){i[e].setAttribute("xmlns","http://www.w3.org/1999/xhtml")}}));var b=e._currentRenderEngine.canvas;if(b){var v=document.createElementNS("http://www.w3.org/2000/svg","image");v.setAttribute("width",b.width);v.setAttribute("height",b.height);v.setAttribute("href",b.toDataURL());f.insertBefore(v,f.firstChild);e.invalidate()}ExportHelper.convertImagesToDataUrl(f,(function(){var t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+p.innerHTML)));i.call(null,t)}))};ExportHelper.convertImagesToDataUrl=function(t,e){var i=t.querySelectorAll("image");if(0!==i.length){var r=Array.from(i);Array.from(i).forEach((function(t){var i=new Image;i.onload=function(){var n=document.createElement("canvas");n.width=+t.getAttribute("width");n.height=+t.getAttribute("height");var s=n.getContext("2d"),a=i.width/i.height;a<n.width/n.height?s.drawImage(i,0,0,i.width,i.height,.5*(n.width-a*n.height),0,a*n.height,n.height):s.drawImage(i,0,0,i.width,i.height,0,.5*(n.height-n.width/a),n.width,n.width/a);t.setAttribute("href",n.toDataURL());i.remove();r.splice(r.indexOf(t),1);0==r.length&&e()};i.src=t.getAttribute("href")}))}else e()};ExportHelper.getDataUri2=function(t,e,i){var r,n,s,a,o,h,l,_=document.createElement("div"),u=ExportHelper.cloneWithComputedStyles(t),c=!1;if("svg"==t.tagName){n=(r=getElementRect(t.parentNode||t)).width||0;s=r.height||0;0==n&&(c=!0);a=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:n;o=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:s}else{n=(h=t.getBBox()).x+h.width;s=h.y+h.height;u.setAttribute("transform",u.getAttribute("transform").replace(/translate\(.*?\)/,""));a=n;o=s;(l=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(u);u=l}if(c){var p=e._renderHidden(),f=e._getHostComputedStyle(),d=0,g=0;if(f){d=e._parsePx(f.width);g=e._parsePx(f.height)}0==d&&(d=FlexChartBase._WIDTH);0==g&&(g=FlexChartBase._HEIGHT);a=n=d;o=s=g;u=ExportHelper.cloneWithComputedStyles(p)}u.setAttribute("version","1.1");u.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");u.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");u.setAttribute("width",n.toString());u.setAttribute("height",s.toString());u.setAttribute("viewBox","0 0 "+a+" "+o);_.appendChild(u);var m=e._currentRenderEngine.canvas;if(m){var x=document.createElementNS("http://www.w3.org/2000/svg","image");x.setAttribute("width",m.width);x.setAttribute("height",m.height);x.setAttribute("href",m.toDataURL());u.insertBefore(x,u.firstChild);e.invalidate()}ExportHelper.convertImagesToDataUrl(u,(function(){var t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+_.innerHTML)));i.call(null,t)}))};ExportHelper.computeAttributes=function(t,e,i){var r=getComputedStyle(t);i.forEach((function(t){var i=r.getPropertyValue(t);i&&i.length>0&&e.setAttribute(t,i)}))};ExportHelper.cloneWithComputedStyles=function(t){var e=t.cloneNode();Array.from(t.childNodes).forEach((function(t){var i=ExportHelper.cloneWithComputedStyles(t);1===t.nodeType&&("text"===t.nodeName?ExportHelper.computeAttributes(t,i,ExportHelper.textAttrs):"line"===t.nodeName&&ExportHelper.computeAttributes(t,i,ExportHelper.lineAttrs));e.appendChild(i)}));return e};ExportHelper.getStyles=function(t){var e="",i=document.styleSheets;if(null==i||0===i.length)return null;[].forEach.call(i,(function(i){var r;try{if(null==i.cssRules||0===i.cssRules.length)return!0}catch(t){if("SecurityError"==t.name){console.log("SecurityError. Can't read: "+i.href);return!0}}r=i.cssRules;[].forEach.call(r,(function(i){var r,n=i.style;if(null==n)return!0;var s=i.selectorText;if(isIE()&&s){var a=s.match(/\[(.*?)\]/g);a&&a.forEach((function(t){s=s.replace(t,t.replace(":","\\:"))}))}try{r=s=="."+FlexChartClsNames.hostElement||t.querySelector(s)}catch(t){console.warn('Invalid CSS selector "'+i.selectorText+'"',t)}r?e+=i.selectorText+" { "+n.cssText+" }\n":i.cssText.match(/^@font-face/)&&(e+=i.cssText+"\n")}))}));var r=getComputedStyle(t),n=r?r.getPropertyValue("font"):null;n&&(e+="."+FlexChartClsNames.hostElement+"{font:"+n+"}\n");return e};ExportHelper.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">';ExportHelper.xmlns="http://www.w3.org/2000/xmlns/";ExportHelper.textAttrs=["font-family","font-size","font-style","font-weight","fill"];ExportHelper.lineAttrs=["stroke","stroke-width","stroke-dasharray"];return ExportHelper}(),ChartTooltip=function(t){__extends(ChartTooltip,t);function ChartTooltip(){var e=t.call(this)||this;e._content="<b>{seriesName}</b><br/>{x} {y}";e._threshold=15;return e}Object.defineProperty(ChartTooltip.prototype,"content",{get:function(){return this._content},set:function(t){t!=this._content&&(this._content=t)},enumerable:!0,configurable:!0});Object.defineProperty(ChartTooltip.prototype,"threshold",{get:function(){return this._threshold},set:function(t){t!=this._threshold&&(this._threshold=asNumber(t))},enumerable:!0,configurable:!0});ChartTooltip.prototype.show=function(e,i,r){t.prototype.show.call(this,e,i,r);var n=ChartTooltip._eTip;n&&n.style&&(n.style.pointerEvents="none")};return ChartTooltip}(Tooltip);export{ChartTooltip};export var ChartType;!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";t[t.Step=13]="Step";t[t.StepSymbols=14]="StepSymbols";t[t.StepArea=15]="StepArea"}(ChartType||(ChartType={}));export var Stacking;!function(t){t[t.None=0]="None";t[t.Stacked=1]="Stacked";t[t.Stacked100pc=2]="Stacked100pc"}(Stacking||(Stacking={}));var FlexChartCore=function(t){__extends(FlexChartCore,t);function FlexChartCore(e,i){var r=t.call(this,e,null,!0)||this;r._series=new ObservableArray;r._axes=new AxisCollection;r._pareas=new PlotAreaCollection;r._interpolateNulls=!1;r._legendToggle=!1;r._symbolSize=10;r._dataInfo=new _DataInfo;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=Stacking.None;r._xlabels=[];r._xvals=[];r._lblAreas=[];r._colRowLens=[];r._selectedEls=[];r._markers=[];r._bindingSeparator=",";r.seriesVisibilityChanged=new Event;r.applyTemplate(ControlClsNames.hostElement+" "+FlexChartClsNames.hostElement,null,null);r._series.collectionChanged.addHandler((function(){for(var t=r._series,e=0;e<t.length;e++){var i=tryCast(t[e],SeriesBase);if(!i)throw"chartSeries array must contain SeriesBase objects.";i._chart=r;if(i.axisX&&null==i.axisX._chart){i.axisX._chart=r;r.axes.push(i.axisX)}if(i.axisY&&null==i.axisY._chart){i.axisY._chart=r;r.axes.push(i.axisY)}}r.invalidate()}));r._currentRenderEngine=new _SvgRenderEngine(r.hostElement);r._hitTester=new _HitTester(r);r._legend=new Legend(r);r._tooltip=new ChartTooltip;r._tooltip.showDelay=0;r._lbl=new DataLabel;r._lbl._chart=r;r._initAxes();r._axes.collectionChanged.addHandler((function(){for(var t=r._axes,e=0;e<t.length;e++){var i=tryCast(t[e],Axis);if(!i)throw"axes array must contain Axis objects.";i._chart=r}r.invalidate()}));r._pareas.collectionChanged.addHandler((function(){for(var t=r._pareas,e=0;e<t.length;e++){var i=tryCast(t[e],PlotArea);if(!i)throw"plotAreas array must contain PlotArea objects.";i._chart=r}r.invalidate()}));r._keywords=new _KeyWords;r.addEventListener(r.hostElement,"click",(function(t){var e=r._tooltip;e.content&&r.isTouching&&r._updateTooltip(e,t)}));r.addEventListener(r.hostElement,"mousemove",(function(t){var e=r._tooltip;e.content&&!r.isTouching&&r._updateTooltip(e,t)}));r.addEventListener(r.hostElement,"mouseleave",(function(t){r._hideToolTip()}));r.addEventListener(r.hostElement,"click",(function(t){var e=r._hitTestData(t);if(r.selectionMode!=SelectionMode.None){var i=FlexChartCore._SELECTION_THRESHOLD;r.tooltip&&r.tooltip.threshold&&(i=r.tooltip.threshold);e.distance<=i&&e.series?r._select(e.series,e.pointIndex):r.selectionMode==SelectionMode.Series&&(e=r.hitTest(t)).chartElement==ChartElement.Legend&&e.series?r._select(e.series,null):r._select(null,null)}if(!0===r.legendToggle&&(e=r.hitTest(t)).chartElement==ChartElement.Legend&&e.series){e.series.visibility==SeriesVisibility.Legend?e.series.visibility=SeriesVisibility.Visible:e.series.visibility==SeriesVisibility.Visible&&(e.series.visibility=SeriesVisibility.Legend);r.focus()}}));r.deferUpdate((function(){return r.initialize(i)}));return r}FlexChartCore.prototype.initialize=function(e){if(e&&e.renderEngine){var i=asType(this._currentRenderEngine,_SvgRenderEngine,!0);i&&i.detach();this._currentRenderEngine=null}t.prototype.initialize.call(this,e)};FlexChartCore.prototype._initAxes=function(){this._axisX=new Axis(Position.Bottom);this._axisY=new Axis(Position.Left);this._axisX.majorGrid=!1;this._axisX.name="axisX";this._axisY.majorGrid=!0;this._axisY.majorTickMarks=TickMark.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(FlexChartCore.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){this._axisX=asType(t,Axis);var e=this._axisX;this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!1);void 0===e.name&&(e.name="axisX");e._axisType=AxisType.X;null!=e.position&&e.position!=Position.Left&&e.position!=Position.Right&&e.position!=Position.BottomLeft&&e.position!=Position.BottomRight&&e.position!=Position.TopLeft&&e.position!=Position.TopRight&&e.position!=Position.LeftTop&&e.position!=Position.LeftBottom&&e.position!=Position.RightTop&&e.position!=Position.RightBottom||(e.position=Position.Bottom);e._chart=this}this.endUpdate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){this._axisY=asType(t,Axis);var e=this._axisY;this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!0);void 0===e.name&&(e.name="axisY");void 0===e.majorTickMarks&&(e.majorTickMarks=TickMark.None);e._axisType=AxisType.Y;null!=e.position&&e.position!=Position.Top&&e.position!=Position.Bottom&&e.position!=Position.BottomLeft&&e.position!=Position.BottomRight&&e.position!=Position.TopLeft&&e.position!=Position.TopRight&&e.position!=Position.LeftTop&&e.position!=Position.LeftBottom&&e.position!=Position.RightTop&&e.position!=Position.RightBottom||(e.position=Position.Left);e._chart=this}this.endUpdate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"plotAreas",{get:function(){return this._pareas},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"bindingX",{get:function(){return this._bindingX},set:function(t){if(t!=this._bindingX){this._bindingX=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){if(t!=this._symbolSize){this._symbolSize=asNumber(t,!1,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"interpolateNulls",{get:function(){return this._interpolateNulls},set:function(t){if(t!=this._interpolateNulls){this._interpolateNulls=asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"legendToggle",{get:function(){return this._legendToggle},set:function(t){t!=this._legendToggle&&(this._legendToggle=asBoolean(t))},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){if(t!=this._lbl){this._lbl=asType(t,DataLabel);this._lbl&&(this._lbl._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"selection",{get:function(){return this._selection},set:function(t){if(t!=this._selection){this._selection=asType(t,SeriesBase,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"renderEngine",{get:function(){return this._currentRenderEngine},set:function(t){if(t!=this._currentRenderEngine){var e=asType(this._currentRenderEngine,_SvgRenderEngine,!0);e&&e.detach();this._currentRenderEngine=t;var i=asType(this._currentRenderEngine,_SvgRenderEngine,!0);i&&i.attach(this.hostElement);this.refresh()}},enumerable:!0,configurable:!0});FlexChartCore.prototype.onSeriesVisibilityChanged=function(t){this.seriesVisibilityChanged.raise(this,t)};FlexChartCore.prototype.hitTest=function(t,e){var i=this._toControl(t,e),r=new HitTestInfo(this,i),n=null;if(FlexChartCore._contains(this._rectHeader,i))r._chartElement=ChartElement.Header;else if(FlexChartCore._contains(this._rectFooter,i))r._chartElement=ChartElement.Footer;else if(FlexChartCore._contains(this._rectLegend,i)){r._chartElement=ChartElement.Legend;var s=i.clone();if(this.legend.scrollbar&&this._legendHost){var a=this._legendHost.querySelector(".wj-legend-scrollable");if(a){if(this.rightToLeft&&!this.legend.isVertical){var o=a.scrollWidth-a.clientWidth-1;s.x+=o+a.scrollLeft}else s.x+=a.scrollLeft;s.y+=a.scrollTop}}null!==(n=this.legend._hitTest(s))&&n>=0&&n<this.series.length&&r._setData(this.series[n])}else if(FlexChartCore._contains(this._rectChart,i)){var h=this._hitTestLabels(i);if(h){r._chartElement=ChartElement.DataLabel;r._dist=0;r._setDataPoint(h.tag)}else{for(var l=this._hitTester.hitTest(i),_=null,u=null,c=this.series.length-1;c>=0;c--)if(this.series[c].hitTest!==Series.prototype.hitTest){var p=this.series[c].hitTest(t);if(p){if(!_||p.distance<_.distance){_=p;u=c}if(0===p.distance)break}}if(l&&l.area)if(_&&_.distance<l.distance)r=_;else if(_&&_.distance==l.distance&&u>l.area.tag.seriesIndex)r=_;else{r._setDataPoint(l.area.tag);r._dist=l.distance}else _&&(r=_);var f=!1;this.axes.some((function(t){if(FlexChartCore._contains(t._axrect,i)){var e=void 0;if(t.axisType===AxisType.X){r._chartElement=ChartElement.AxisX;e=t._hitTest(i)}else{r._chartElement=ChartElement.AxisY;e=t._hitTest(i)}e?r._setName(e.label):r._setName("");f=!0;return!0}return!1}));f||(FlexChartCore._contains(this._plotRect,i)?r._chartElement=ChartElement.PlotArea:FlexChartCore._contains(this._rectChart,i)&&(r._chartElement=ChartElement.ChartArea))}}else r._chartElement=ChartElement.None;return r};FlexChartCore.prototype.pointToData=function(t,e){isNumber(t)&&isNumber(e)&&(t=new Point(t,e));if(t instanceof MouseEvent){t=new Point(t.pageX,t.pageY);t=this._toControl(t)}else t=t.clone();t.x=this.axisX.convertBack(t.x);t.y=this.axisY.convertBack(t.y);return t};FlexChartCore.prototype.dataToPoint=function(t,e){isNumber(t)&&isNumber(e)&&(t=new Point(t,e));asType(t,Point);var i=t.clone();i.x=this.axisX.convert(i.x);i.y=this.axisY.convert(i.y);return i};FlexChartCore.prototype.dispose=function(){this._markers.forEach((function(t){t.remove()}));this._markers=[];t.prototype.dispose.call(this)};FlexChartCore.prototype._copy=function(t,e){if("series"==t){this.series.clear();for(var i=asArray(e),r=0;r<i.length;r++){var n=this._createSeries();copy(n,i[r]);this.series.push(n)}return!0}return!1};FlexChartCore.prototype._createSeries=function(){return new Series};FlexChartCore.prototype._clearCachedValues=function(){for(var t=0;t<this._series.length;t++){var e=this._series[t];null==e.itemsSource&&e._clearValues()}};FlexChartCore.prototype._performBind=function(){this._xDataType=null;this._xlabels.splice(0);this._xvals.splice(0);if(this._cv){var t=this._cv.items;if(t){for(var e=t.length,i=this.bindingX?new Binding(this.bindingX):null,r=0;r<e;r++){var n=t[r];if(i){var s=i.getValue(n);if(isNumber(s)){this._xvals.push(asNumber(s));this._xDataType=DataType.Number}else if(isDate(s)){this._xvals.push(asDate(s).valueOf());this._xDataType=DataType.Date}this._xlabels.push(s)}}this._xvals.length==e?this._xlabels.splice(0):this._xvals.splice(0)}}};FlexChartCore.prototype._hitTestSeries=function(t,e){var i=this._toControl(t),r=new HitTestInfo(this,i),n=this._hitTester.hitTestSeries(i,e);if(n&&n.area){r._setDataPoint(n.area.tag);r._chartElement=ChartElement.PlotArea;r._dist=n.distance}return r};FlexChartCore.prototype._hitTestData=function(t){var e=this._toControl(t),i=new HitTestInfo(this,e),r=this._hitTester.hitTest(e,!0);if(r&&r.area){i._setDataPoint(r.area.tag);i._dist=r.distance}return i};FlexChartCore.prototype._hitTestLabels=function(t){for(var e=null,i=this._lblAreas.length,r=0;r<i;r++)if(this._lblAreas[r].contains(t)){e=this._lblAreas[r];break}return e};FlexChartCore._dist2=function(t,e){var i=t.x-e.x,r=t.y-e.y;return i*i+r*r};FlexChartCore._dist=function(t,e,i){return Math.sqrt(FlexChartCore._distToSegmentSquared(t,e,i))};FlexChartCore._distToSegmentSquared=function(t,e,i){var r=FlexChartCore._dist2(e,i);if(0==r)return FlexChartCore._dist2(t,e);var n=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/r;return n<0?FlexChartCore._dist2(t,e):n>1?FlexChartCore._dist2(t,i):FlexChartCore._dist2(t,new Point(e.x+n*(i.x-e.x),e.y+n*(i.y-e.y)))};FlexChartCore.prototype._isRotated=function(){return this._getChartType()==ChartType.Bar?!this._rotated:this._rotated};FlexChartCore.prototype._getChartType=function(){return null};FlexChartCore.prototype._prepareRender=function(){this._hitTester.clear()};FlexChartCore.prototype._renderChart=function(t,e,i){var r=this._rectChart.clone(),n=new Size(r.width,r.height);e.width,e.height;this._selectedEls.length=0;var s=this._getPlotter(null);s.stacking=this._stacking;if(this._curPlotter!=s){this._curPlotter&&this._curPlotter.unload();this._curPlotter=s}s.load();var a=this._isRotated();this._dataInfo.analyse(this._series,a,s.stacking,this._xvals.length>0?this._xvals:null,this.axisX._getLogBase()>0,this.axisY._getLogBase()>0);var o=s.adjustLimits(this._dataInfo,e.clone());if(a){var h=this._dataInfo.getDataTypeX();h||(h=this._xDataType);this.axisX._updateActualLimits(this._dataInfo.getDataTypeY(),o.left,o.right);this.axisY._updateActualLimits(h,o.top,o.bottom,this._xlabels,this._xvals)}else{var l=this._dataInfo.getDataTypeX();l||(l=this._xDataType);this.axisX._updateActualLimits(l,o.left,o.right,this._xlabels,this._xvals);this.axisY._updateActualLimits(this._dataInfo.getDataTypeY(),o.top,o.bottom)}var _=this._getAxes();this._updateAuxAxes(_,a);this._layout(e,n,t);t.startGroup(FlexChartCore._CSS_PLOT_AREA);t.fill="transparent";t.stroke=null;if(this.plotAreas.length>0)for(var u=0;u<this.plotAreas.length;u++){this.plotAreas[u]._render(t)}else{var c=this._plotRect;t.drawRect(c.left,c.top,c.width,c.height)}t.endGroup();var p=this._series.length;this._clearPlotters();var f,d,g,m={};for(u=0;u<p;u++){if(((w=(S=this._series[u]).visibility)==SeriesVisibility.Visible||w==SeriesVisibility.Plot)&&S.getValues(0)){var x=S._getAxisY(),y=this._getPlotter(S);if(!x||x==this.axisY||y instanceof _BarPlotter)y.seriesCount++;else{var b=x._uniqueId;m[b]?m[b].count+=1:m[b]={count:1,index:0}}}}this.onRendering(new RenderEventArgs(t));if(this._getChartType()!==ChartType.Funnel)for(u=0;u<_.length;u++){var v=_[u];f=v.axisType==AxisType.X?t.startGroup(FlexChartCore._CSS_AXIS_X,this._chartRectId):t.startGroup(FlexChartCore._CSS_AXIS_Y,this._chartRectId);v._hostElement=i?f:v._hostElement;v._render(t);t.endGroup()}t.startGroup(SeriesClsNames.group);this._plotrectId="plotRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._plotRect,this._plotrectId);t.options=this._options&&this._options.spline?{spline:this._options.spline.approximation}:null;for(u=0;u<p;u++){var S;(S=this._series[u])._pointIndexes=[];var C=this._getPlotter(S);S._plotter=C;var P=t.startGroup(S.cssClass,C.clipping?this._plotrectId:null);S._hostElement=i?P:S._hostElement;var w=S.visibility,A=S.axisX,M=S.axisY;A||(A=this.axisX);M||(M=this.axisY);if(w==SeriesVisibility.Visible||w==SeriesVisibility.Plot){var T=m[M._uniqueId];if(!T||C instanceof _BarPlotter){d=C.seriesIndex;g=C.seriesCount;C.seriesIndex++;S.onRendering(t,d,g)||C.plotSeries(t,A,M,S,this,d,g)}else{d=T.index;g=T.count;T.index++;S.onRendering(t,d,g)||C.plotSeries(t,A,M,S,this,d,g)}S.onRendered(t)}t.endGroup()}t.endGroup();this._lblAreas=[];this.dataLabel.content&&this.dataLabel.position!=LabelPosition.None&&this._renderLabels(t);this._highlightCurrent();this.onRendered(new RenderEventArgs(t))};FlexChartCore.prototype._getDesiredLegendSize=function(t,e,i,r){var n=new Size,s=this.series,a=s.length,o=(this.legend.scrollbar,0),h=0;this._colRowLens=[];for(var l=0;l<a;l++){var _=l;this._legendReversed()&&(_=a-l-1);var u=tryCast(s[_],SeriesBase),c=u.visibility;if(u.name&&c!=SeriesVisibility.Hidden&&c!=SeriesVisibility.Plot)for(var p=u.legendItemLength(),f=0;f<p;f++){var d=u.measureLegendItem(t,f);if(e){if(o+d.height>r&&!this.legend.scrollbar){n.height=r;this._colRowLens.push(h);h=0;o=0}h<d.width&&(h=d.width);o+=d.height}else{if(h+d.width>i&&!this.legend.scrollbar){n.width=i;this._colRowLens.push(o);o=0;h=0}o<d.height&&(o=d.height);h+=d.width}}}if(e){n.height<o&&(n.height=o);this._colRowLens.push(h);n.width=this._colRowLens.reduce((function(t,e){return t+e}),0)}else{n.width<h&&(n.width=h);this._colRowLens.push(o);n.height=this._colRowLens.reduce((function(t,e){return t+e}),0)}return n};FlexChartCore.prototype._renderLegend=function(t,e,i,r,n,s){var a,o=this.series,h=o.length,l=e.clone(),_=0;if(this._legendReversed()){for(var u=h-1;u>=0;u--){a=tryCast(o[u],SeriesBase);_=this._renderLegendElements(t,a,e,l,i,r,n,s,_)}i.reverse()}else for(u=0;u<h;u++){a=tryCast(o[u],SeriesBase);_=this._renderLegendElements(t,a,e,l,i,r,n,s,_)}};FlexChartCore.prototype._legendReversed=function(){if(null==this._legend.reverse||null===this._legend.reverse){var t=!1,e=this._getChartType();(e===ChartType.Bar||e===ChartType.Column&&this._rotated)&&(this._stacking!==Stacking.None||this.axisY.reversed||(t=!0));return t}return this._legend.reverse};FlexChartCore.prototype._renderLegendElements=function(t,e,i,r,n,s,a,o,h){var l=new Rect(i.x,i.y,a,o),_=h;if(!e)return _;var u=e.visibility;if(!e.name||u==SeriesVisibility.Hidden||u==SeriesVisibility.Plot){e._legendElement=null;n.push(null);return _}var c=e.legendItemLength(),p=t.startGroup(e.cssClass);if(u==SeriesVisibility.Legend){p.setAttribute("opacity","0.5");e._legendElement=p}else u==SeriesVisibility.Visible?e._legendElement=p:e._legendElement=null;for(var f=0;f<c;f++){var d=e.measureLegendItem(t,f);if(s){if(r.y+d.height>l.bottom+1&&!this.legend.scrollbar){r.x+=this._colRowLens[_];_++;r.y=i.y}}else if(r.x+d.width>l.right+1&&!this.legend.scrollbar){r.y+=this._colRowLens[_];_++;r.x=i.x}var g=new Rect(r.x,r.y,d.width,d.height);u!=SeriesVisibility.Legend&&u!=SeriesVisibility.Visible||e.drawLegendItem(t,g,f);n.push(g);s?r.y+=d.height:r.x+=d.width}t.endGroup();return _};FlexChartCore.prototype._renderLabels=function(t){var e=this.series,i=e.length;t.stroke="null";t.fill="transparent";t.strokeWidth=1;var r=FlexChartCore._CSS_DATA_LABELS;t.startGroup(r);for(var n=0;n<i;n++){var s=e[n],a=this._hitTester._map[n];a&&s._renderLabels(t,a,this,this._lblAreas)}t.endGroup()};FlexChartCore.prototype._getAxes=function(){for(var t=[this.axisX,this.axisY],e=this.series.length,i=0;i<e;i++){var r=this.series[i],n=r.axisX;n&&-1===t.indexOf(n)&&t.push(n);var s=r.axisY;s&&-1===t.indexOf(s)&&t.push(s)}return t};FlexChartCore.prototype._clearPlotters=function(){for(var t=this._plotters.length,e=0;e<t;e++)this._plotters[e].clear()};FlexChartCore.prototype._initPlotter=function(t){t.chart=this;t.dataInfo=this._dataInfo;t.hitTester=this._hitTester;this._plotters.push(t)};Object.defineProperty(FlexChartCore.prototype,"_barPlotter",{get:function(){if(null===this.__barPlotter){this.__barPlotter=new _BarPlotter;this._initPlotter(this.__barPlotter)}return this.__barPlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_linePlotter",{get:function(){if(null===this.__linePlotter){this.__linePlotter=new _LinePlotter;this._initPlotter(this.__linePlotter)}return this.__linePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_areaPlotter",{get:function(){if(null===this.__areaPlotter){this.__areaPlotter=new _AreaPlotter;this._initPlotter(this.__areaPlotter)}return this.__areaPlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_bubblePlotter",{get:function(){if(null===this.__bubblePlotter){this.__bubblePlotter=new _BubblePlotter;this._initPlotter(this.__bubblePlotter)}return this.__bubblePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_financePlotter",{get:function(){if(null===this.__financePlotter){this.__financePlotter=new _FinancePlotter;this._initPlotter(this.__financePlotter)}return this.__financePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_funnelPlotter",{get:function(){if(null===this.__funnelPlotter){this.__funnelPlotter=new _FunnelPlotter;this._initPlotter(this.__funnelPlotter)}return this.__funnelPlotter},enumerable:!0,configurable:!0});FlexChartCore.prototype._getPlotter=function(t){var e,i=this._getChartType(),r=!1;if(t){var n=t._getChartType();if(null!=n&&n!=i){i=n;r=!0}}switch(i){case ChartType.Column:this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Bar:this._barPlotter.rotated=!this._rotated;this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Line:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Scatter:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!1;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.LineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Area:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Bubble:e=this._bubblePlotter;break;case ChartType.Candlestick:(s=this._financePlotter).isCandle=!0;s.isEqui=!1;s.isArms=!1;s.isVolume=!1;e=s;break;case ChartType.HighLowOpenClose:var s;(s=this._financePlotter).isCandle=!1;s.isEqui=!1;s.isArms=!1;s.isVolume=!1;e=s;break;case ChartType.Spline:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineArea:this._areaPlotter.isSpline=!0;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Funnel:e=this._funnelPlotter;break;case ChartType.Step:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepArea:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!0;e=this._areaPlotter;break;default:throw"Invalid chart type."}e.rotated=this._rotated;i==ChartType.Bar&&(e.rotated=!e.rotated);r&&(e.rotated=this._isRotated());return e};FlexChartCore.prototype._layout=function(t,e,i){this.plotAreas.length>0?this._layoutMultiple(t,e,i):this._layoutSingle(t,e,i)};FlexChartCore.prototype._layoutSingle=function(t,e,i){var r=t.width,n=t.height,s=new Size(r,.75*n),a=new Size(n,.75*r),o=0,h=0,l=r,_=n,u=0,c=0,p=r,f=n;if(this.dataLabel.position===LabelPosition.Top?this.dataLabel.content:null){h=i.measureString(this.dataLabel.content,DataLabelClsNames.label).height}for(var d=this._getAxes(),g=this.axisY._getHeight(i,n),m=0;m<d.length;m++){var x=(T=d[m]).origin,y=T._getPosition();if(T.axisType==AxisType.X){(C=T._getHeight(i,Math.max(10,r-g)))>s.height&&(C=s.height);T._desiredSize=new Size(s.width,C);T._hasOrigin=isNumber(x)&&x>this.axisY._getMinNum()&&x<this.axisY._getMaxNum();var b=T._hasOrigin,v=Math.min(.25*r,T._annoSize.width);if(y==Position.Bottom){o=Math.max(o,.5*v);l=Math.min(l,r-.5*v);if(b){var S=this._convertY(x,c,f);f-=Math.max(0,S+C-f)}else f-=C}else if(y==Position.Top){o=Math.max(o,.5*v);l=Math.min(l,r-.5*v);if(b){S=this._convertY(x,c,f);c+=Math.max(0,c-(S-C))}else c+=C}}else if(T.axisType==AxisType.Y){var C;(C=T===this.axisX?g:T._getHeight(i,n))>a.height&&(C=a.height);T._desiredSize=new Size(a.width,C);T._hasOrigin=isNumber(x)&&x>this.axisX._getMinNum()&&x<this.axisX._getMaxNum();b=T._hasOrigin;if(y==Position.Left){if(T._actualAngle<0)_=Math.min(_,n-T._annoSize.height);else if(T._actualAngle>0)h=Math.max(h,T._annoSize.height);else{h=Math.max(h,T._annoSize.height);_=Math.min(_,n-T._annoSize.height)}if(b){var P=this._convertX(x,u,p);u+=Math.max(0,u-(P-C))}else u+=C}else if(y==Position.Right){if(T._actualAngle>0)_=Math.min(_,n-T._annoSize.height);else if(T._actualAngle<0)h=Math.max(h,T._annoSize.height);else{h=Math.max(h,T._annoSize.height);_=Math.min(_,n-T._annoSize.height)}if(b){P=this._convertX(x,u,p);p-=Math.max(0,P+C-p)}else p-=C}}}var w,A,M=this._parseMargin(this.plotMargin);o=u=isNaN(M.left)?Math.max(o,u)+t.left:M.left;l=p=isNaN(M.right)?Math.min(l,p)+t.left:e.width-M.right;h=c=isNaN(M.top)?Math.max(h,c)+t.top:M.top;_=f=isNaN(M.bottom)?Math.min(_,f)+t.top:e.height-M.bottom;r=Math.max(1,l-o);n=Math.max(1,_-h);this._plotRect=new Rect(o,h,r,n);_<=h&&(f=c+1);i.stroke=null;for(m=0;m<d.length;m++){var T,L=(T=d[m]).origin;y=T._getPosition();if(T.axisType==AxisType.X){if(T._hasOrigin){S=this._convertY(L,this._plotRect.top,this._plotRect.bottom);if(y==Position.Bottom){w=new Rect(o,S,r,T._desiredSize.height);f+=Math.max(0,w.bottom-this._plotRect.bottom)}else if(y==Position.Top){w=new Rect(o,S-T._desiredSize.height,r,T._desiredSize.height);c-=Math.max(0,this._plotRect.top-w.top)}else w=new Rect(o,S,r,1)}else if(y==Position.Bottom){w=new Rect(o,f,r,T._desiredSize.height);f+=T._desiredSize.height}else if(y==Position.Top){w=new Rect(o,c-T._desiredSize.height,r,T._desiredSize.height);c-=T._desiredSize.height}else w=new Rect(o,c,r,1);T._layout(w,this._plotRect)}else if(T.axisType==AxisType.Y){if(T._hasOrigin){P=this._convertX(L,this._plotRect.left,this._plotRect.right);if(y==Position.Left){A=new Rect(P-T._desiredSize.height,h,n,T._desiredSize.height);u-=T._desiredSize.height}else if(y==Position.Right){A=new Rect(P,h,n,T._desiredSize.height);p+=T._desiredSize.height}else A=new Rect(P,h,n,1)}else if(y==Position.Left){A=new Rect(u-T._desiredSize.height,h,n,T._desiredSize.height);u-=T._desiredSize.height}else if(y==Position.Right){A=new Rect(p,h,n,T._desiredSize.height);p+=T._desiredSize.height}else A=new Rect(u,h,n,1);T._layout(A,this._plotRect)}}};FlexChartCore.prototype._layoutMultiple=function(t,e,i){for(var r=t.width,n=t.height,s=[],a=[],o=this._getAxes(),h=o.length,l=0;l<h;l++){(P=o[l])._plotrect=null;if(P.axisType==AxisType.X){for(var _=P.plotArea?P.plotArea.column:0;s.length<=_;)s.push(new _AreaDef);s[_].axes.push(P)}else if(P.axisType==AxisType.Y){for(var u=P.plotArea?P.plotArea.row:0;a.length<=u;)a.push(new _AreaDef);a[u].axes.push(P)}}for(var c=s.length,p=a.length,f=new Size(r,.3*n),d=new Size(n,.3*r),g=0,m=0,x=r,y=n,b=0;b<c;b++){(E=s[b]).right=r;E.bottom=n;for(l=0;l<E.axes.length;l++){var v=(P=E.axes[l])._getHeight(i,P.axisType==AxisType.X?r:n);v>f.height&&(v=f.height);var S=new Size(f.width,v);P._desiredSize=S;0==b&&(E.left=Math.max(E.left,.5*P._annoSize.width));b==c-1&&(E.right=Math.min(E.right,r-.5*P._annoSize.width));(D=P._getPosition())==Position.Bottom?E.bottom-=S.height:D==Position.Top&&(E.top+=S.height)}}for(var C=0;C<p;C++){(E=a[C]).right=r;E.bottom=n;for(l=0;l<E.axes.length;l++){var P=E.axes[l],w=new Size(d.width,P._getHeight(i,P.axisType==AxisType.X?r:n));w.height>d.height&&(w.height=d.height);P._desiredSize=w;0==C&&(E.top=Math.max(E.top,.5*P._annoSize.width));C==p-1&&(E.bottom=Math.min(E.bottom,n-.5*P._annoSize.width));(D=P._getPosition())==Position.Left?E.left+=w.height:D==Position.Right&&(E.right-=w.height)}}var A=0,M=0,T=r,L=n;for(b=0;b<c;b++){var E=s[b];A=Math.max(A,E.left);M=Math.max(M,E.top);T=Math.min(T,E.right);L=Math.min(L,E.bottom)}for(C=0;C<p;C++){E=a[C];A=Math.max(A,E.left);M=Math.max(M,E.top);T=Math.min(T,E.right);L=Math.min(L,E.bottom)}A=g=Math.max(g,A);T=x=Math.min(x,T);M=m=Math.max(m,M);L=y=Math.min(y,L);this._plotRect=new Rect(g,m,x-g,y-m);var F,k=this._plotRect.clone(),N=g,I=this.plotAreas._calculateWidths(this._plotRect.width,c);for(b=0;b<c;b++){L=y;M=m;E=s[b];var R=I[b];for(l=0;l<E.axes.length;l++){var D=(P=E.axes[l])._getPosition(),B=new Rect(N,k.top,R,k.height);if(D==Position.Bottom){F=new Rect(N,L,R,P._desiredSize.height);L+=P._desiredSize.height}else if(D==Position.Top){F=new Rect(N,M-P._desiredSize.height,R,P._desiredSize.height);M-=P._desiredSize.height}P._layout(F,B)}for(l=0;l<this.plotAreas.length;l++){(z=this.plotAreas[l]).column==b&&z._setPlotX(N,R)}N+=R}var O,V=m,H=this.plotAreas._calculateHeights(this._plotRect.height,p);for(C=0;C<p;C++){A=g;T=x;E=a[C];var j=H[C];for(l=0;l<E.axes.length;l++){D=(P=E.axes[l])._getPosition(),B=new Rect(k.left,V,k.width,j);if(P._plotrect){B.left=P._plotrect.left;B.width=P._plotrect.width}else I&&I.length>0&&(B.width=I[0]);if(D==Position.Left){O=new Rect(A-P._desiredSize.height,V,j,P._desiredSize.height);A-=P._desiredSize.height}else if(D==Position.Right){O=new Rect(T,V,j,P._desiredSize.height);T+=P._desiredSize.height}P._layout(O,B)}for(l=0;l<this.plotAreas.length;l++){var z;(z=this.plotAreas[l]).row==C&&z._setPlotY(V,j)}V+=j}};FlexChartCore.prototype._convertX=function(t,e,i){var r=this.axisX;return r.reversed?i-(i-e)*(t-r._getMinNum())/(r._getMaxNum()-r._getMinNum()):e+(i-e)*(t-r._getMinNum())/(r._getMaxNum()-r._getMinNum())};FlexChartCore.prototype._convertY=function(t,e,i){var r=this.axisY;return r.reversed?e+(i-e)*(t-r._getMinNum())/(r._getMaxNum()-r._getMinNum()):i-(i-e)*(t-r._getMinNum())/(r._getMaxNum()-r._getMinNum())};FlexChartCore.prototype._getLabelContent=function(t,e){return t.chartElement!==ChartElement.AxisX&&t.chartElement!==ChartElement.AxisY||!t.name?isString(e)?this._keywords.replace(e,t):isFunction(e)?e(t):null:t.name};FlexChartCore.prototype._select=function(t,e){var i=this.selectionMode,r=!1;(t!=this._selection||i==SelectionMode.Point&&e!=this._selectionIndex)&&(r=!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);if(i==SelectionMode.Point){var n=t?t.collectionView:this._cv;if(n){this._notifyCurrentChanged=!1;n.moveCurrentToPosition(t?e:-1);this._notifyCurrentChanged=!0}}r&&this.onSelectionChanged()};FlexChartCore.prototype._highlightCurrent=function(){if(this.selectionMode!=SelectionMode.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)}}};FlexChartCore.prototype._highlight=function(t,e,i){t=asType(t,SeriesBase,!0);if(this.selectionMode==SelectionMode.Series){var r=this.series.indexOf(t),n=t.hostElement;e?n.parentNode.appendChild(n):n.parentNode.insertBefore(n,n.parentNode.childNodes.item(r));var s=this._find(n,["rect","ellipse","polyline","polygon","line","path"]);this._highlightItems(s,FlexChartCore._CSS_SELECTION,e);t.legendElement&&this._highlightItems(this._find(t.legendElement,["rect","ellipse","line"]),FlexChartCore._CSS_SELECTION,e)}else if(this.selectionMode==SelectionMode.Point){r=this.series.indexOf(t),n=t.hostElement;if(e){n.parentNode.appendChild(n);var a=t.getPlotElement(i);if(a)if(a instanceof SVGElement){if("g"!=a.nodeName){this._highlightItems([a],FlexChartCore._CSS_SELECTION,e);this._selectedEls.push(a)}if((s=this._find(a,["line","rect","ellipse","path","polygon"])).length>0){this._highlightItems(s,FlexChartCore._CSS_SELECTION,e);for(var o=0;o<s.length;o++)this._selectedEls.push(s[o])}}else if(Array.isArray(a)){this._highlightItems(a,FlexChartCore._CSS_SELECTION,e);for(o=0;o<a.length;o++)this._selectedEls.push(a[o])}}else{n.parentNode.insertBefore(n,n.parentNode.childNodes.item(r));if(this._selectedEls.length>0){this._highlightItems(this._selectedEls,FlexChartCore._CSS_SELECTION,e);this._selectedEls.length=0}}}};FlexChartCore.prototype._updateTooltip=function(t,e){var i,r=this.hitTest(e);if(r.distance<=t.threshold){var n=t.content;if(r.series){var s=r.series.tooltipContent;(s||""===s)&&(n=s)}i=this._getLabelContent(r,n)}this._hideToolTip();i&&this._showToolTip(i,new Rect(e.clientX,e.clientY,5,5))};FlexChartCore.prototype._updateAuxAxes=function(t,e){for(var i,r,n=2;n<t.length;n++){var s=t[n];s._chart=this;for(var a=[],o=0;o<this.series.length;o++){var h=this.series[o];h.axisX!=s&&h.axisY!=s||a.push(h)}for(o=0;o<a.length;o++){var l=a[o].getDataRect()||a[o]._getDataRect();if(l)if(s.axisType==AxisType.X&&!e||s.axisType==AxisType.Y&&e){(void 0===i||l.left<i)&&(i=l.left);(void 0===r||l.right>r)&&(r=l.right)}else{(void 0===i||l.top<i)&&(i=l.top);(void 0===r||l.bottom>r)&&(r=l.bottom)}}var _=a[0].getDataType(0);null==_&&(_=DataType.Number);t[n]._updateActualLimits(_,i,r)}};FlexChartCore._CSS_AXIS_X=AxisClsNames.axisX;FlexChartCore._CSS_AXIS_Y=AxisClsNames.axisY;FlexChartCore._CSS_LINE=AxisClsNames.line;FlexChartCore._CSS_GRIDLINE=AxisClsNames.gridline;FlexChartCore._CSS_TICK=AxisClsNames.tick;FlexChartCore._CSS_GRIDLINE_MINOR=AxisClsNames.gridlineMinor;FlexChartCore._CSS_TICK_MINOR=AxisClsNames.tickMinor;FlexChartCore._CSS_DATA_LABELS=DataLabelClsNames.labels;return FlexChartCore}(FlexChartBase);export{FlexChartCore};var _AreaDef=function(){function _AreaDef(){this._axes=[];this.left=0;this.right=0;this.top=0;this.bottom=0}Object.defineProperty(_AreaDef.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0});return _AreaDef}(),_DataInfo=function(){function _DataInfo(){this.stackAbs={};this._xvals=null}_DataInfo.prototype.analyse=function(t,e,i,r,n,s){var a=this;this.minY=NaN;this.maxY=NaN;this.minX=NaN;this.maxX=NaN;this.minXp=NaN;this.minYp=NaN;this.dx=0;var o,h={},l={},_={};this.dataTypeX=null;this.dataTypeY=null;this._xvals=r;if(null!=r)for(var u=r.length,c=0;c<u;c++){var p=r[c];(isNaN(this.minX)||this.minX>p)&&(this.minX=p);(isNaN(this.maxX)||this.maxX<p)&&(this.maxX=p);p>0&&(isNaN(this.minXp)||this.minXp>p)&&(this.minXp=p);if(c>0){var f=Math.abs(p-r[c-1]);!isNaN(f)&&(f<this.dx||0==this.dx)&&(this.dx=f)}}var _loop_1=function(n){var s=t[n],u=s._getChartType(),c=void 0!==s.chartType,p=s.visibility;if(p==SeriesVisibility.Hidden||p==SeriesVisibility.Legend)return"continue";var f=s.getDataRect();if(f){if(!isNaN(d.minX)&&d.minX<f.left){o=f.right;f.left=d.minX;f.width=o-d.minX}!isNaN(d.maxX)&&d.maxX>f.right&&(f.width=d.maxX-f.left);if(!s._isCustomAxisY()){if(!isNaN(d.minY)&&d.minY<f.top){o=f.bottom;f.top=d.minY;f.height=o-d.minY}!isNaN(d.maxY)&&d.maxY>f.bottom&&(f.height=d.maxY-f.top)}}var g=null;e?s._isCustomAxisY()||(g=s.getValues(1)):s._isCustomAxisX()||(g=s.getValues(1));if(g){d.dataTypeX||(d.dataTypeX=s.getDataType(1));for(var m=0;m<g.length;m++){var x=g[m];if(isFinite(x)){(isNaN(d.minX)||d.minX>x)&&(d.minX=x);(isNaN(d.maxX)||d.maxX<x)&&(d.maxX=x);if(m>0&&(!u||u==ChartType.Column||u==ChartType.Bar)){var y=Math.abs(x-g[m-1]);!isNaN(y)&&y>0&&(y<d.dx||0==d.dx)&&(d.dx=y)}}}}var b=null,v=!1;if(e){v=s._isCustomAxisX();b=s.getValues(0)}else{v=s._isCustomAxisY();b=s.getValues(0)}if(b){d.dataTypeY||v||(d.dataTypeY=s.getDataType(0));isNaN(d.minX)?d.minX=0:g||r||(d.minX=Math.min(d.minX,0));isNaN(d.maxX)?d.maxX=b.length-1:g||r||(d.maxX=Math.max(d.maxX,b.length-1));if(!v){var S=i==Stacking.None||c,_loop_2=function(t){var e=b[t],i=g?asNumber(g[t],!0):r?asNumber(r[t],!0):t;isArray(e)?e.forEach((function(t){a._parseYVal(t,i,S,_,h,l)})):d._parseYVal(e,i,S,_,h,l)};for(m=0;m<b.length;m++)_loop_2(m)}}var C=s.getDataRect(new Rect(d.minX,d.minY,d.maxX-d.minX,d.maxY-d.minY),f);if(C){d.minX=C.left;d.maxX=C.right;if(!v){d.minY=C.top;d.maxY=C.bottom}}},d=this;for(c=0;c<t.length;c++)_loop_1(c);if(i==Stacking.Stacked){for(var g in h)h[g]>this.maxY&&(this.maxY=h[g]);for(var g in l)l[g]<this.minY&&(this.minY=l[g])}else if(i==Stacking.Stacked100pc){this.minY=0;this.maxY=0;for(var g in _){var m=_[g];if(isFinite(m)&&0!=m){var x=h[g],y=l[g];isFinite(x)&&(x=Math.max(x/m,this.maxY))>this.maxY&&(this.maxY=x);isFinite(y)&&(y=Math.min(y/m,this.minY))<this.minY&&(this.minY=y)}}if(this.minY==this.maxY){this.minY=0;this.maxY=1}}this.stackAbs=_;n&&(e?this.minY=isNaN(this.minYp)?1:this.minYp:this.minX=isNaN(this.minXp)?1:this.minXp);s&&(e?this.minX=isNaN(this.minXp)?1:this.minXp:this.minY=isNaN(this.minYp)?1:this.minYp)};_DataInfo.prototype._parseYVal=function(t,e,i,r,n,s){if(isFinite(t)){null!=t&&(isNaN(this.minY)||this.minY>t)&&(this.minY=t);null!=t&&(isNaN(this.maxY)||this.maxY<t)&&(this.maxY=t);t>0&&(isNaN(this.minYp)||this.minYp>t)&&(this.minYp=t);if(!i){t>0?isNaN(n[e])?n[e]=t:n[e]+=t:isNaN(s[e])?s[e]=t:s[e]+=t;isNaN(r[e])?r[e]=Math.abs(t):r[e]+=Math.abs(t)}}};_DataInfo.prototype.getMinY=function(){return this.minY};_DataInfo.prototype.getMaxY=function(){return this.maxY};_DataInfo.prototype.getMinX=function(){return this.minX};_DataInfo.prototype.getMaxX=function(){return this.maxX};_DataInfo.prototype.getMinXp=function(){return this.minXp};_DataInfo.prototype.getMinYp=function(){return this.minYp};_DataInfo.prototype.getDeltaX=function(){return this.dx};_DataInfo.prototype.getDataTypeX=function(){return this.dataTypeX};_DataInfo.prototype.getDataTypeY=function(){return this.dataTypeY};_DataInfo.prototype.getStackedAbsSum=function(t){var e=this.stackAbs[t];return isFinite(e)?e:0};_DataInfo.prototype.getXVals=function(){return this._xvals};_DataInfo.isValid=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t.length,r=0;r<i;r++)if(!isFinite(t[r]))return!1;return!0};return _DataInfo}();export{_DataInfo};var FlexChart=function(t){__extends(FlexChart,t);function FlexChart(e,i){var r=t.call(this,e,null)||this;r._chartType=ChartType.Column;r.initialize(i);return r}FlexChart.prototype._getChartType=function(){return this._chartType};Object.defineProperty(FlexChart.prototype,"chartType",{get:function(){return this._chartType},set:function(t){if((t=asEnum(t,ChartType))!=this._chartType){this._chartType=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"rotated",{get:function(){return this._rotated},set:function(t){if(t!=this._rotated){this._rotated=asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"stacking",{get:function(){return this._stacking},set:function(t){if((t=asEnum(t,Stacking))!=this._stacking){this._stacking=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"options",{get:function(){return this._options},set:function(t){if(t!=this._options){this._options=t;this.invalidate()}},enumerable:!0,configurable:!0});return FlexChart}(FlexChartCore);export{FlexChart};export var LabelPosition;!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"}(LabelPosition||(LabelPosition={}));export var PieLabelPosition;!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"}(PieLabelPosition||(PieLabelPosition={}));var DataLabelRenderEventArgs=function(t){__extends(DataLabelRenderEventArgs,t);function DataLabelRenderEventArgs(e,i,r,n){var s=t.call(this,e)||this;s.cancel=!1;s._ht=i;s._pt=r;s._text=n;return s}Object.defineProperty(DataLabelRenderEventArgs.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelRenderEventArgs.prototype,"text",{get:function(){return this._text},set:function(t){this._text=asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelRenderEventArgs.prototype,"hitTestInfo",{get:function(){return this._ht},enumerable:!0,configurable:!0});return DataLabelRenderEventArgs}(RenderEventArgs);export{DataLabelRenderEventArgs};var DataLabelBase=function(){function DataLabelBase(){this.rendering=new Event}Object.defineProperty(DataLabelBase.prototype,"content",{get:function(){return this._content},set:function(t){if(t!=this._content){this._content=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"border",{get:function(){return this._bdr},set:function(t){if(t!=this._bdr){this._bdr=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"offset",{get:function(){return this._off},set:function(t){if(t!=this._off){this._off=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"connectingLine",{get:function(){return this._line},set:function(t){if(t!=this._line){this._line=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});DataLabelBase.prototype.onRendering=function(t){this.rendering.raise(this,t);return!t.cancel};DataLabelBase.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};return DataLabelBase}();export{DataLabelBase};var DataLabel=function(t){__extends(DataLabel,t);function DataLabel(){var e=null!==t&&t.apply(this,arguments)||this;e._pos=LabelPosition.Top;return e}Object.defineProperty(DataLabel.prototype,"position",{get:function(){return this._pos},set:function(t){if((t=asEnum(t,LabelPosition))!=this._pos){this._pos=t;this._invalidate()}},enumerable:!0,configurable:!0});return DataLabel}(DataLabelBase);export{DataLabel};var PieDataLabel=function(t){__extends(PieDataLabel,t);function PieDataLabel(){var e=null!==t&&t.apply(this,arguments)||this;e._pos=PieLabelPosition.Center;return e}Object.defineProperty(PieDataLabel.prototype,"position",{get:function(){return this._pos},set:function(t){if((t=asEnum(t,PieLabelPosition))!=this._pos){this._pos=t;this._invalidate()}},enumerable:!0,configurable:!0});return PieDataLabel}(DataLabelBase);export{PieDataLabel};var _DataPoint=function(){function _DataPoint(t,e,i,r){this._seriesIndex=t;this._pointIndex=e;this._dataX=i;this._dataY=r}Object.defineProperty(_DataPoint.prototype,"seriesIndex",{get:function(){return this._seriesIndex},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"dataX",{get:function(){return this._dataX},set:function(t){t!==this._dataX&&(this._dataX=t)},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"dataY",{get:function(){return this._dataY},set:function(t){t!==this._dataY&&(this._dataY=t)},enumerable:!0,configurable:!0});return _DataPoint}();export{_DataPoint};export var _MeasureOption;!function(t){t[t.X=0]="X";t[t.Y=1]="Y";t[t.XY=2]="XY"}(_MeasureOption||(_MeasureOption={}));var _RectArea=function(){function _RectArea(t){this._rect=t}Object.defineProperty(_RectArea.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0});_RectArea.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};_RectArea.prototype.pointDistance=function(t,e,i){var r=e.x-t.x,n=e.y-t.y;return i==_MeasureOption.X?Math.abs(r):i==_MeasureOption.Y?Math.abs(n):Math.sqrt(r*r+n*n)};_RectArea.prototype.distance=function(t){var e=_MeasureOption.XY;isNaN(t.x)||null===t.x?e=_MeasureOption.Y:(isNaN(t.y)||null===t.y)&&(e=_MeasureOption.X);var i=this._rect;return t.x<i.left?t.y<i.top?this.pointDistance(t,new Point(i.left,i.top),e):t.y>i.bottom?this.pointDistance(t,new Point(i.left,i.bottom),e):e==_MeasureOption.Y?0:i.left-t.x:t.x>i.right?t.y<i.top?this.pointDistance(t,new Point(i.right,i.top),e):t.y>i.bottom?this.pointDistance(t,new Point(i.right,i.bottom),e):e==_MeasureOption.Y?0:t.x-i.right:e==_MeasureOption.X?0:t.y<i.top?i.top-t.y:t.y>i.bottom?t.y-i.bottom:0};return _RectArea}();export{_RectArea};var _CircleArea=function(){function _CircleArea(t,e){this._center=t;this.setRadius(e)}_CircleArea.prototype.setRadius=function(t){this._rad=t;this._rad2=t*t};Object.defineProperty(_CircleArea.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});_CircleArea.prototype.contains=function(t){var e=this._center.x-t.x,i=this._center.y-t.y;return e*e+i*i<=this._rad2};_CircleArea.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,r=e*e+i*i;return r<=this._rad2?0:Math.sqrt(r)-this._rad};return _CircleArea}();export{_CircleArea};var _LinesArea=function(){function _LinesArea(t,e){this._x=[];this._y=[];this._x=t;this._y=e}_LinesArea.prototype.contains=function(t){return!1};_LinesArea.prototype.distance=function(t){for(var e=NaN,i=0;i<this._x.length-1;i++){var r=FlexChartCore._dist(t,new Point(this._x[i],this._y[i]),new Point(this._x[i+1],this._y[i+1]));(isNaN(e)||r<e)&&(e=r)}return e};return _LinesArea}();export{_LinesArea};var _HitResult=function _HitResult(){};export{_HitResult};var _HitTester=function(){function _HitTester(t){this._map={};this._chart=t}_HitTester.prototype.add=function(t,e){if(this._map[e]){t.tag||(t.tag=new _DataPoint(e,NaN,NaN,NaN));this._map[e].push(t)}};_HitTester.prototype.clear=function(){this._map={};for(var t=this._chart.series,e=0;e<t.length;e++)t[e].hitTest===Series.prototype.hitTest&&(this._map[e]=[])};_HitTester.prototype.hitTest=function(t,e){void 0===e&&(e=!1);for(var i=null,r=Number.MAX_VALUE,n=this._chart.series.length-1;n>=0;n--){var s=this._map[n];if(s){for(var a=s.length-1;a>=0;a--){var o=s[a];if(!tryCast(o,_LinesArea)||e){var h=o.distance(t);if(h<r){i=o;if(0==(r=h))break}}}if(0==r)break}}if(i){var l=new _HitResult;l.area=i;l.distance=r;return l}return null};_HitTester.prototype.hitTestSeries=function(t,e){var i=null,r=Number.MAX_VALUE,n=this._map[e];if(n)for(var s=n.length-1;s>=0;s--){var a=n[s],o=a.distance(t);if(o<r){i=a;if(0==(r=o))break}}if(i){var h=new _HitResult;h.area=i;h.distance=r;return h}return null};return _HitTester}();export{_HitTester};export var ChartElement;!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"}(ChartElement||(ChartElement={}));var HitTestInfo=function(){function HitTestInfo(t,e,i){this._pointIndex=null;this._chartElement=ChartElement.None;this._chart=t;this._pt=e;this._chartElement=i}Object.defineProperty(HitTestInfo.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"chartElement",{get:function(){return this._chartElement},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"distance",{get:function(){return this._dist},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.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(HitTestInfo.prototype,"x",{get:function(){void 0===this._x&&(this._x=this._getValue(1,!1));return this._x},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"y",{get:function(){void 0===this._y&&(this._y=this._getValue(0,!1));return this._y},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"value",{get:function(){var t=this._chart._getHitTestValue(this.pointIndex,this._groupIndex);return null!=t?t:this.series&&null!=this.series._getValue?this.series._getValue(this.pointIndex):this.y},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.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(HitTestInfo.prototype,"groupIndex",{get:function(){return this._groupIndex},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"_xfmt",{get:function(){void 0===this.__xfmt&&(this.__xfmt=this._getValue(1,!0));return this.__xfmt},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"_yfmt",{get:function(){void 0===this.__yfmt&&(this.__yfmt=this._getValue(0,!0));return this.__yfmt},enumerable:!0,configurable:!0});HitTestInfo.prototype._setData=function(t,e){this._series=t;this._pointIndex=e};HitTestInfo.prototype._setDataGroup=function(t,e){this._groupIndex=t;this._pointIndex=e};HitTestInfo.prototype._setName=function(t){this._name=t;t&&(this._dist=0)};HitTestInfo.prototype._setDataPoint=function(t){if(t=asType(t,_DataPoint,!0)){this._pointIndex=t.pointIndex;var e=asType(this._chart,FlexChartCore,!0),i=t.seriesIndex;null!==i&&i>=0&&i<e.series.length&&(this._series=e.series[i]);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)}};HitTestInfo.prototype._getValueFmt=function(){var t=this.value;if(null!=t){if(null==this.series){var e=t==Math.round(t)?"{val:n0}":"{val:n}";return format(e,{val:t})}t=this._chart._isRotated()?this.ax._formatValue(t):this.ay._formatValue(t)}return t};HitTestInfo.prototype._getValue=function(t,e){var i=this._chart._getHitTestValue(this.pointIndex,this.groupIndex);if(null!==i)return i;var r=null,n=this._chart,s=this.pointIndex,a=n._isRotated();if(null!==this.series&&null!==s){var o=this.series.getValues(t),h=this.series.getDataType(t);if(o&&this.pointIndex<o.length){r=o[this.pointIndex];h!=DataType.Date||e||(r=new Date(r))}else if(1==t)if(n._xlabels&&n._xlabels.length>0&&s<n._xlabels.length)r=n._xlabels[s];else if(n._xvals&&s<n._xvals.length){r=n._xvals[s];n._xDataType!=DataType.Date||e||(r=new Date(r))}}null!==r&&e&&(a?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)));return r};Object.defineProperty(HitTestInfo.prototype,"ax",{get:function(){return this.series.axisX?this.series.axisX:this._chart.axisX},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"ay",{get:function(){return this.series.axisY?this.series.axisY:this._chart.axisY},enumerable:!0,configurable:!0});return HitTestInfo}();export{HitTestInfo};export var SeriesVisibility;!function(t){t[t.Visible=0]="Visible";t[t.Plot=1]="Plot";t[t.Legend=2]="Legend";t[t.Hidden=3]="Hidden"}(SeriesVisibility||(SeriesVisibility={}));export var Marker;!function(t){t[t.Dot=0]="Dot";t[t.Box=1]="Box"}(Marker||(Marker={}));var DataArray=function DataArray(){};export{DataArray};var SeriesEventArgs=function(t){__extends(SeriesEventArgs,t);function SeriesEventArgs(e){var i=t.call(this)||this;i._series=asType(e,SeriesBase);return i}Object.defineProperty(SeriesEventArgs.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});return SeriesEventArgs}(EventArgs);export{SeriesEventArgs};var SeriesBase=function(){function SeriesBase(t){this._altStyle=null;this._symbolMarker=Marker.Dot;this._visibility=SeriesVisibility.Visible;this._interpolateNulls=null;this._cache={};this.rendering=new Event;this.rendered=new Event;this.initialize(t)}Object.defineProperty(SeriesBase.prototype,"interpolateNulls",{get:function(){return null==this._interpolateNulls?this._chart&&this._chart.interpolateNulls:this._interpolateNulls},set:function(t){if(t!=this._interpolateNulls){this._interpolateNulls=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"style",{get:function(){return this._style},set:function(t){if(t!=this._style){this._style=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"altStyle",{get:function(){return this._altStyle},set:function(t){if(t!=this._altStyle){this._altStyle=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolStyle",{get:function(){return this._symbolStyle},set:function(t){if(t!=this._symbolStyle){this._symbolStyle=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){if(t!=this._symbolSize){this._symbolSize=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolMarker",{get:function(){return this._symbolMarker},set:function(t){if((t=asEnum(t,Marker,!0))!=this._symbolMarker){this._symbolMarker=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"binding",{get:function(){return this._binding?this._binding:this._chart?this._chart.binding:null},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._clearValues();this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"bindingX",{get:function(){return this._bindingX?this._bindingX:this._chart?this._chart.bindingX:null},set:function(t){if(t!=this._bindingX){this._bindingX=asString(t,!0);this._clearValues();this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"itemsSource",{get:function(){return this._itemsSource},set:function(t){if(t!=this._itemsSource){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._itemsSource=t;this._cv=asCollectionView(t);if(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(SeriesBase.prototype,"collectionView",{get:function(){return this._cv?this._cv:this._chart?this._chart.collectionView:null},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"legendElement",{get:function(){return this._legendElement},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"cssClass",{get:function(){return this._cssClass},set:function(t){this._cssClass=asString(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"visibility",{get:function(){return this._visibility},set:function(t){if((t=asEnum(t,SeriesVisibility))!=this._visibility){this._visibility=t;this._clearValues();this._invalidate();this._chart&&this._chart.onSeriesVisibilityChanged(new SeriesEventArgs(this))}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"tooltipContent",{get:function(){return this._tooltipContent},set:function(t){t!=this._tooltipContent&&(this._tooltipContent=t)},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=asFunction(t);this._invalidate()}},enumerable:!0,configurable:!0});SeriesBase.prototype.hitTest=function(t,e){isNumber(t)&&isNumber(e)?t=new Point(t,e):t instanceof MouseEvent&&(t=new Point(t.pageX,t.pageY));asType(t,Point);return this._chart?this._chart._hitTestSeries(t,this._chart.series.indexOf(this)):null};SeriesBase.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(SeriesBase.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){this._axisX=asType(t,Axis,!0);if(this._axisX){this._axisX._chart=this._chart;var e=this._axisX._chart;e&&-1==e.axes.indexOf(this._axisX)&&e.axes.push(this._axisX)}this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){this._axisY=asType(t,Axis,!0);if(this._axisY){this._axisY._chart=this._chart;var e=this._axisY._chart;e&&-1==e.axes.indexOf(this._axisY)&&e.axes.push(this._axisY)}this._invalidate()}},enumerable:!0,configurable:!0});SeriesBase.prototype.initialize=function(t){copy(this,t)};SeriesBase.prototype.pointToData=function(t){asType(t,Point);(t=t.clone()).x=this._getAxisX().convertBack(t.x);t.y=this._getAxisY().convertBack(t.y);return t};SeriesBase.prototype.dataToPoint=function(t){asType(t,Point);(t=t.clone()).x=this._getAxisX().convert(t.x);t.y=this._getAxisY().convert(t.y);return t};SeriesBase.prototype.onRendering=function(t,e,i){var r=new SeriesRenderingEventArgs(t,e,i);this.rendering.raise(this,r);return r.cancel};SeriesBase.prototype.onRendered=function(t){this.rendered.raise(this,new RenderEventArgs(t))};Object.defineProperty(SeriesBase.prototype,"_chart",{get:function(){return this.__chart},set:function(t){t!==this.__chart&&(this.__chart=t)},enumerable:!0,configurable:!0});SeriesBase.prototype._getSymbolSize=function(){return null!=this.symbolSize?this.symbolSize:this.chart.symbolSize};Object.defineProperty(SeriesBase.prototype,"_plotter",{get:function(){this.chart&&!this.__plotter&&(this.__plotter=this.chart._getPlotter(this));return this.__plotter},set:function(t){t!=this.__plotter&&(this.__plotter=t)},enumerable:!0,configurable:!0});SeriesBase.prototype.getDataType=function(t){return 0==t?this._valueDataType:1==t?this._xvalueDataType:null};SeriesBase.prototype.getValues=function(t){if(0==t){if(null==this._values){this._valueDataType=null;if(null!=this._cv){var e=this._bindValues(this._cv.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}else if(null!=this.binding&&null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}}return this._values}if(1==t){if(null==this._xvalues){this._xvalueDataType=null;if(null!=this.bindingX)if(null!=this._cv){e=this._bindValues(this._cv.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}else{if(null==this._bindingX)return null;if(null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}}}return this._xvalues}return null};SeriesBase.prototype.drawLegendItem=function(t,e,i){var r=this._getChartType();null==r&&(r=this._chart._getChartType());var n=this._getLegendStyle(this.style);r===ChartType.Funnel?this._drawFunnelLegendItem(t,e,i,n,this.symbolStyle):this._drawLegendItem(t,e,r,this.name,n,this.symbolStyle)};SeriesBase.prototype._getLegendStyle=function(t){if(t){var e={};t.fill&&(e.fill=t.fill);t.stroke&&(e.stroke=t.stroke);return e}};SeriesBase.prototype.measureLegendItem=function(t,e){var i=this._getChartType();null==i&&(i=this._chart._getChartType());return i===ChartType.Funnel?this._measureLegendItem(t,this._getFunnelLegendName(e)):this._measureLegendItem(t,this.name)};SeriesBase.prototype.legendItemLength=function(){var t=this._getChartType();null==t&&(t=this._chart._getChartType());return t===ChartType.Funnel?this._chart._xlabels&&this._chart._xlabels.length?this._chart._xlabels.length:this._chart._xvals&&this._chart._xvals.length?this._chart._xvals.length:1:1};SeriesBase.prototype.getDataRect=function(t,e){return null};SeriesBase.prototype._getChartType=function(){return this._chartType};SeriesBase.prototype._clearValues=function(){this._values=null;this._xvalues=null;this.__plotter=null;this._cache={}};SeriesBase.prototype._getBinding=function(t){var e=this.binding;if(e){var i=this.chart?this.chart._bindingSeparator:",";if(i){var r=e.split(i);r&&r.length>t&&(e=r[t].trim())}}return e};SeriesBase.prototype._getBindingValues=function(t){if(this._cache[t])return this._cache[t];var e=void 0;null!=this._cv?e=this._cv.items:null!=this._chart&&null!=this._chart.collectionView&&(e=this._chart.collectionView.items);var i=this._bindValues(e,this._getBinding(t));this._cache[t]=i.values;return this._cache[t]};SeriesBase.prototype._getItem=function(t){var e=null,i=null;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]);return e};SeriesBase.prototype._getLength=function(){var t=0,e=null;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);return t};SeriesBase.prototype._setPointIndex=function(t,e){this._pointIndexes[t]=e};SeriesBase.prototype._getDataRect=function(){var t=this.getValues(0),e=this.getValues(1);if(t){for(var i=NaN,r=NaN,n=NaN,s=NaN,a=t.length,o=0;o<a;o++){var h=t[o];if(isArray(h)){var l=h,_=Math.min.apply(Math,l),u=Math.max.apply(Math,l);if(isNaN(r)){r=_;s=u}else{_<r&&(r=_);u>s&&(s=u)}}else isFinite(h)&&(isNaN(r)?r=s=h:h<r?r=h:h>s&&(s=h));if(e){var c=e[o];isFinite(c)&&(isNaN(i)?i=n=c:c<i?i=c:h>s&&(n=c))}}if(!e){i=0;n=a-1}if(!isNaN(r))return new Rect(i,r,n-i,s-r)}return null};SeriesBase.prototype._isCustomAxisX=function(){return!!this._axisX&&(!this._chart||this._axisX!=this.chart.axisX)};SeriesBase.prototype._isCustomAxisY=function(){return!!this._axisY&&(!this._chart||this._axisY!=this.chart.axisY)};SeriesBase.prototype._getAxisX=function(){var t=null;this.axisX?t=this.axisX:this.chart&&(t=this.chart.axisX);return t};SeriesBase.prototype._getAxisY=function(){var t=null;this.axisY?t=this.axisY:this.chart&&(t=this.chart.axisY);return t};SeriesBase.prototype._measureLegendItem=function(t,e){var i=new Size;i.width=SeriesBase._LEGEND_ITEM_WIDTH;i.height=SeriesBase._LEGEND_ITEM_HEIGHT;if(this._name){var r=t.measureString(e,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND);i.width+=r.width;i.height<r.height&&(i.height=r.height)}i.width+=3*SeriesBase._LEGEND_ITEM_MARGIN;i.height+=2*SeriesBase._LEGEND_ITEM_MARGIN;return i};SeriesBase.prototype._drawFunnelLegendItem=function(t,e,i,r,n){t.strokeWidth=1;var s=SeriesBase._LEGEND_ITEM_MARGIN,a=null,o=null;null===a&&(a=this._chart._getColorLight(i));null===o&&(o=this._chart._getColor(i));t.fill=a;t.stroke=o;var h=e.top+.5*e.height,l=SeriesBase._LEGEND_ITEM_WIDTH,_=SeriesBase._LEGEND_ITEM_HEIGHT,u=this._getFunnelLegendName(i);t.drawRect(e.left+s,h-.5*_,l,_,null,n||r);null!=u&&FlexChartCore._renderText(t,u,new Point(e.left+_+2*s,h),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)};SeriesBase.prototype._getFunnelLegendName=function(t){var e,i=this._chart;if(i._xlabels&&i._xlabels.length&&t<i._xlabels.length)e=i._xlabels[t];else if(i._xvals&&i._xvals.length&&t<i._xvals.length){e=i._xvals[t];i._xDataType===DataType.Date&&(e=FlexChartCore._fromOADate(e))}null==e&&(e=this.name);return e.toString()};SeriesBase.prototype._drawLegendItem=function(t,e,i,r,n,s){t.strokeWidth=1;var a=SeriesBase._LEGEND_ITEM_MARGIN,o=null,h=null;null===o&&(o=this._chart._getColorLight(this._chart.series.indexOf(this)));null===h&&(h=this._chart._getColor(this._chart.series.indexOf(this)));t.fill=o;t.stroke=h;var l=e.top+.5*e.height,_=SeriesBase._LEGEND_ITEM_WIDTH,u=SeriesBase._LEGEND_ITEM_HEIGHT;switch(i){case ChartType.Area:case ChartType.SplineArea:case ChartType.StepArea:t.drawRect(e.left+a,l-.5*u,_,u,null,n);break;case ChartType.Bar:case ChartType.Column:t.drawRect(e.left+a,l-.5*u,_,u,null,s||n);break;case ChartType.Scatter:case ChartType.Bubble:var c=.3*_,p=.3*u;this.symbolMarker==Marker.Box?t.drawRect(e.left+a+.5*_-c,l-p,2*c,2*p,null,s||n):t.drawEllipse(e.left+.5*_+a,l,c,p,null,s||n);break;case ChartType.Line:case ChartType.Spline:case ChartType.Step:t.drawLine(e.left+a,l,e.left+_+a,l,null,n);break;case ChartType.LineSymbols:case ChartType.SplineSymbols:case ChartType.StepSymbols:c=.3*_,p=.3*u;this.symbolMarker==Marker.Box?t.drawRect(e.left+a+.5*_-c,l-p,2*c,2*p,null,s||n):t.drawEllipse(e.left+.5*_+a,l,c,p,null,s||n);t.drawLine(e.left+a,l,e.left+_+a,l,null,n);break;case ChartType.Candlestick:case ChartType.HighLowOpenClose:t.drawLine(e.left+a,l,e.left+_+a,l,null,s||n)}this._name&&FlexChartCore._renderText(t,r,new Point(e.left+u+2*a,l),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)};SeriesBase.prototype._cvCollectionChanged=function(t,e){this._clearValues();this._invalidate()};SeriesBase.prototype._cvCurrentChanged=function(t,e){this._chart&&this._chart._notifyCurrentChanged&&this._invalidate()};SeriesBase.prototype._bindValues=function(t,e,i){void 0===i&&(i=!1);var r,n,s;if(null!=t){var a=t.length;r=new Array(t.length);for(var o=e?new Binding(e):null,h=0;h<a;h++){s=null;var l=t[h];null!=o&&(l=o.getValue(l));if(isArray(l)&&l.length>0){s=l;l=l[0]}if(isNumber(l)){r[h]=l;n=DataType.Number}else if(isDate(l)){r[h]=l.valueOf();n=DataType.Date}else if(i&&l){r[h]=h;n=DataType.Number}isArray(s)&&s.length>0&&(r[h]=s)}}var _=new DataArray;_.values=r;_.dataType=n;return _};SeriesBase.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};SeriesBase.prototype._indexToPoint=function(t){if(t>=0&&t<this._values.length){var e=this._values[t],i=this._xvalues?this._xvalues[t]:t;return new Point(i,e)}return null};SeriesBase.prototype._getSymbolFill=function(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.fill);!e&&this.style&&(e=this.style.fill);!e&&this.chart&&(e=this.chart._getColorLight(t));return e};SeriesBase.prototype._getSymbolStroke=function(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.stroke);!e&&this.style&&(e=this.style.stroke);!e&&this.chart&&(e=this.chart._getColor(t));return e};SeriesBase.prototype._getAltSymbolStroke=function(t){var e=null;this.altStyle&&(e=this.altStyle.stroke);return e};SeriesBase.prototype._getAltSymbolFill=function(t){var e=null;this.altStyle&&(e=this.altStyle.fill);return e};SeriesBase.prototype._renderLabels=function(t,e,i,r){this._plotter&&this._plotter._renderLabels(t,this,e,i,r)};SeriesBase._LEGEND_ITEM_WIDTH=10;SeriesBase._LEGEND_ITEM_HEIGHT=10;SeriesBase._LEGEND_ITEM_MARGIN=4;return SeriesBase}();export{SeriesBase};var _BasePlotter=function(){function _BasePlotter(){this._DEFAULT_WIDTH=2;this._DEFAULT_SYM_SIZE=10;this.clipping=!0}_BasePlotter.prototype.clear=function(){this.seriesCount=0;this.seriesIndex=0};_BasePlotter.prototype._renderLabels=function(t,e,i,r,n){var s=i.length,a=r.dataLabel,o=a.border,h=a.offset,l=a.connectingLine;void 0===h&&(h=l?16:0);o&&(h-=2);for(var _=0;_<s;_++){var u=i[_],c=asType(u.tag,_DataPoint,!0);c&&!u.ignoreLabel&&this._renderLabel(t,u,c,r,a,e,h,n)}};_BasePlotter.prototype._renderLabel=function(t,e,i,r,n,s,a,o){var h,l=null==n.position?LabelPosition.Top:n.position,_=n.border,u=n.connectingLine,c=new HitTestInfo(r,h);c._setDataPoint(i);var p=r._getLabelContent(c,n.content);h=this._getLabelPoint(s,i);this._getPointAndPosition(h,l,e,r);if(r._plotRect.contains(h)){var f=new DataLabelRenderEventArgs(t,c,h,p);if(n.onRendering)if(n.onRendering(f)){p=f.text;h=f.point}else p=null;if(p){var d=this._renderLabelAndBorder(t,p,l,a,h,u,2,_);if(d){var g=new _RectArea(d);g.tag=i;o.push(g)}}t.cssPriority=!0}};_BasePlotter.prototype._getPointAndPosition=function(t,e,i,r){if(i instanceof _RectArea){var n=i;r._isRotated()?t.y=n.rect.top+.5*n.rect.height:t.x=n.rect.left+.5*n.rect.width}};_BasePlotter.prototype._getLabelPoint=function(t,e){var i=t._getAxisX(),r=t._getAxisY();return new Point(i.convert(e.dataX),r.convert(e.dataY))};_BasePlotter.prototype._renderLabelAndBorder=function(t,e,i,r,n,s,a,o){var h,l=DataLabelClsNames.label,_=DataLabelClsNames.line,u=DataLabelClsNames.border,c=FlexChartCore._CSS_DATA_LABELS;switch(i){case LabelPosition.Top:s&&t.drawLine(n.x,n.y,n.x,n.y-r,_);n.y-=a+r;h=FlexChartCore._renderText(t,e,n,1,2,l,c);break;case LabelPosition.Bottom:s&&t.drawLine(n.x,n.y,n.x,n.y+r,_);n.y+=a+r;h=FlexChartCore._renderText(t,e,n,1,0,l,c);break;case LabelPosition.Left:s&&t.drawLine(n.x,n.y,n.x-r,n.y,_);n.x-=a+r;h=FlexChartCore._renderText(t,e,n,2,1,l,c);break;case LabelPosition.Right:s&&t.drawLine(n.x,n.y,n.x+r,n.y,_);n.x+=a+r;h=FlexChartCore._renderText(t,e,n,0,1,l,c);break;case LabelPosition.Center:h=FlexChartCore._renderText(t,e,n,1,1,l,c)}o&&h&&t.drawRect(h.left-a,h.top-a,h.width+2*a,h.height+2*a,u);return h};_BasePlotter.prototype.getOption=function(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&!isUndefined(i[t])&&null!==i[t])return i[t]};_BasePlotter.prototype.getNumOption=function(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&i[t])return asNumber(i[t],!0)};_BasePlotter.prototype.getItemFormatter=function(t){if(t instanceof SeriesBase){var e=t;return e.itemFormatter?e.itemFormatter:this.chart.itemFormatter}return this.chart.itemFormatter};_BasePlotter.cloneStyle=function(t,e){if(!t)return t;var i={};for(var r in t)e&&e.indexOf(r)>=0||(i[r]=t[r]);return i};_BasePlotter.prototype.isValid=function(t,e,i,r){return isFinite(t)&&isFinite(e)&&FlexChartCore._contains(this.chart._plotRect,new Point(t,e))};_BasePlotter.prototype.load=function(){};_BasePlotter.prototype.unload=function(){};_BasePlotter.prototype._createSteps=function(t,e,i){var r=this.getOption("position","step"),n=i||t.length,s=[],a=[],o=this.chart._isRotated();if("center"==r)if(o)for(var h=0;h<n;h++){var l=0==h?e[h+1]-e[h]:e[h]-e[h-1],_=h==n-1?e[h]-e[h-1]:e[h+1]-e[h];s.push(t[h]);a.push(e[h]-.5*l);s.push(t[h]);a.push(e[h]+.5*_)}else for(h=0;h<n;h++){var u=0==h?t[h+1]-t[h]:t[h]-t[h-1],c=h==n-1?t[h]-t[h-1]:t[h+1]-t[h];s.push(t[h]-.5*u);a.push(e[h]);s.push(t[h]+.5*c);a.push(e[h])}else if("end"==r)for(h=0;h<n;h++){if(h>0)if(o){s.push(t[h]);a.push(e[h-1])}else{s.push(t[h-1]);a.push(e[h])}s.push(t[h]);a.push(e[h])}else for(h=0;h<n;h++){s.push(t[h]);a.push(e[h]);if(h<n-1)if(o){s.push(t[h]);a.push(e[h+1])}else{s.push(t[h+1]);a.push(e[h])}}return{x:s,y:a}};return _BasePlotter}();export{_BasePlotter};var Series=function(t){__extends(Series,t);function Series(){return null!==t&&t.apply(this,arguments)||this}Object.defineProperty(Series.prototype,"chartType",{get:function(){return this._chartType},set:function(t){if((t=asEnum(t,ChartType,!0))!=this._chartType){this._chartType=t;this._invalidate()}},enumerable:!0,configurable:!0});return Series}(SeriesBase);export{Series};var FlexPie=function(t){__extends(FlexPie,t);function FlexPie(e,i){var r=t.call(this,e,null,!0)||this;r._areas=[];r._keywords=new _KeyWords;r._startAngle=0;r._innerRadius=0;r._offset=0;r._reversed=!1;r._isAnimated=!1;r._selectedItemPosition=Position.None;r._selectedItemOffset=0;r._pieGroups=[];r._rotationAngles=[];r._centers=[new Point];r._selectedOffset=new Point;r._selectedIndex=-1;r._angles=[];r._colRowLens=[];r._titles=void 0;r._values=[];r._labels=[];r._pels=[];r._sum=0;r._sums=[];r._bindingSeparator=",";r.applyTemplate(ControlClsNames.hostElement+" "+FlexChartClsNames.hostElement+" "+FlexPieClsNames.hostElement,null,null);r._currentRenderEngine=new _SvgRenderEngine(r.hostElement);r._legend=new Legend(r);r._tooltip=new ChartTooltip;r._tooltip.content="<b>{name}</b><br/>{value}";r._tooltip.showDelay=0;r._lbl=new PieDataLabel;r._lbl._chart=r;r.addEventListener(r.hostElement,"mousemove",(function(t){var e=r._tooltip;if(e.content&&!r.isTouching){var i=r.hitTest(t,void 0,!0);if(i.distance<=e.threshold){var n=r._getLabelContent(i,r.tooltip.content);r._showToolTip(n,new Rect(t.clientX,t.clientY,5,5))}else r._hideToolTip()}}));r.addEventListener(r.hostElement,"click",(function(t){var e=!0;if(r.selectionMode==SelectionMode.Point){var i=r.hitTest(t),n=FlexChartBase._SELECTION_THRESHOLD;r.tooltip&&r.tooltip.threshold&&(n=r.tooltip.threshold);if(i.distance<=n){i.pointIndex!=r._selectionIndex&&r.selectedItemPosition!=Position.None&&(e=!1);i.pointIndex!=r._selectionIndex&&r._select(i.pointIndex,!0)}else r._selectedIndex>=0&&r._select(null)}if(e&&r.isTouching){var s=r._tooltip;if(s.content){if((i=r.hitTest(t,void 0,!0)).distance<=s.threshold){var a=r._getLabelContent(i,r.tooltip.content);r._showToolTip(a,new Rect(t.clientX,t.clientY,5,5))}else r._hideToolTip()}}}));r.addEventListener(r.hostElement,"mouseleave",(function(t){r._hideToolTip()}));r.deferUpdate((function(){return r.initialize(i)}));return r}Object.defineProperty(FlexPie.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"bindingName",{get:function(){return this._bindingName},set:function(t){if(t!=this._bindingName){this._bindingName=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"startAngle",{get:function(){return this._startAngle},set:function(t){if(t!=this._startAngle){this._startAngle=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"offset",{get:function(){return this._offset},set:function(t){if(t!=this._offset){this._offset=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerRadius",{get:function(){return this._innerRadius},set:function(t){if(t!=this._innerRadius){this._innerRadius=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerTextStyle",{get:function(){return this._innerTextStyle},set:function(t){if(t!=this._innerText){this._innerTextStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerText",{get:function(){return this._innerText},set:function(t){if(t!=this._innerText){this._innerText=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"reversed",{get:function(){return this._reversed},set:function(t){if(t!=this._reversed){this._reversed=asBoolean(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedItemPosition",{get:function(){return this._selectedItemPosition},set:function(t){if((t=asEnum(t,Position,!0))!=this._selectedItemPosition){this._selectedItemPosition=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedItemOffset",{get:function(){return this._selectedItemOffset},set:function(t){if(t!=this._selectedItemOffset){this._selectedItemOffset=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"isAnimated",{get:function(){return this._isAnimated},set:function(t){t!=this._isAnimated&&(this._isAnimated=t)},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){if(t!=this._lbl){this._lbl=t;this._lbl&&(this._lbl._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){if(t!=this._selectedIndex){var e=asNumber(t,!0);this._select(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"titles",{get:function(){return this._titles},set:function(t){if(t!==this._titles){this._titles=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"chartsPerLine",{get:function(){return this._chartsPerLine},set:function(t){if(t!=this._chartsPerLine){this._chartsPerLine=asNumber(t,!0,!0);this.invalidate()}},enumerable:!0,configurable:!0});FlexPie.prototype._getLabelsForLegend=function(){return this._labels};FlexPie.prototype.hitTest=function(t,e,i){var r=this._toControl(t,e),n=new HitTestInfo(this,r),s=null;if(FlexChartBase._contains(this._rectHeader,r))n._chartElement=ChartElement.Header;else if(FlexChartBase._contains(this._rectFooter,r))n._chartElement=ChartElement.Footer;else if(FlexChartBase._contains(this._rectLegend,r)){n._chartElement=ChartElement.Legend;null!==(s=this.legend._hitTest(r))&&s>=0&&s<this._areas.length&&n._setData(null,s)}else if(FlexChartBase._contains(this._rectChart,r)){this._hitTestData(n,r,i);n._chartElement=ChartElement.ChartArea}else n._chartElement=ChartElement.None;return n};FlexPie.prototype._hitTestData=function(t,e,i){for(var r,n=this._areas.length,s=NaN,a=0;a<n;a++){var o=e.clone(),h=this._areas[a],l=this._rotationAngles[h.gi];if(0!=l){var _=this._centers[h.gi],u=_.x,c=_.y,p=-u+o.x,f=-c+o.y,d=Math.sqrt(p*p+f*f),g=Math.atan2(f,p)-l*Math.PI/180;o.x=u+d*Math.cos(g);o.y=c+d*Math.sin(g)}if(a==this._selectedIndex){o.x-=this._selectedOffset.x;o.y-=this._selectedOffset.y}var m=this._areas[a];if(m.contains(o)){if(!0===i){s=0;r=m;continue}t._setDataGroup(h.gi,m.tag);t._dist=0;if(a!=this._selectedIndex)break}var x=m.distance(o);if(void 0!==x&&(isNaN(s)||x<s||!0===i&&this._isSmallSegment(x,r,m))){s=x;r=m}}if(0!==t._dist&&null!=r){t._setDataGroup(r.gi,r.tag);t._dist=s}};FlexPie.prototype._isSmallSegment=function(t,e,i){return t<=.5*this.tooltip.threshold&&Math.abs(i.sweep)<=.035&&Math.abs(e.sweep/i.sweep)>=10};FlexPie.prototype._performBind=function(){this._initData();if(this._cv){this._selectionIndex=this._cv.currentPosition;var t=this._cv.items;if(t){for(var e=t.length,i=this._getBindings(),r=0;r<i.length;r++){this._values[r]=[];this._sums[r]=0}for(var n=0;n<e;n++){var s=t[n];for(r=0;r<i.length;r++)this._sums[r]+=Math.abs(this._getBindData(s,this._values[r],0==r?this._labels:null,i[r],this.bindingName))}}}};FlexPie.prototype._getBindings=function(){var t=[],e=this.binding;if(e){var i=this._bindingSeparator;i&&(t=e.split(i))}return t};FlexPie.prototype._initData=function(){this._sum=0;this._sums=[];this._values=[];this._labels=[]};FlexPie.prototype._getBindData=function(t,e,i,r,n){var s,a=0,o=r?new Binding(r):null;o&&(s=o.getValue(t));a=0;isNumber(s)?a=asNumber(s):s&&(a=parseFloat(s.toString()));if(!isNaN(a)&&isFinite(a))e.push(a);else{a=0;e.push(a)}var h=n?new Binding(n):null;if(i)if(h&&t){var l=h.getValue(t);l&&(l=l.toString());i.push(l)}else i.push(a.toString());return a};FlexPie.prototype._render=function(e,i,r){void 0===i&&(i=!0);void 0===r&&(r=null);this._selectionAnimationID&&clearInterval(this._selectionAnimationID);this.onRendering(new RenderEventArgs(e));t.prototype._render.call(this,e,i,r)};FlexPie.prototype._prepareRender=function(){this._areas=[]};FlexPie.prototype._renderChart=function(t,e,i){var r=this._rectChart.clone(),n=(new Size(r.width,r.height),e.width),s=e.height,a=this._parseMargin(this.plotMargin),o=this.dataLabel,h=o.content&&o.position==PieLabelPosition.Outside,l=h?(isNumber(o.offset)?o.offset:0)+24:0;isNaN(a.left)&&(a.left=h?l:FlexPie._MARGIN);isNaN(a.right)&&(a.right=h?l:FlexPie._MARGIN);isNaN(a.top)&&(a.top=h?l:FlexPie._MARGIN);isNaN(a.bottom)&&(a.bottom=h?l:FlexPie._MARGIN);e.top+=a.top;s=e.height-(a.top+a.bottom);e.height=s>0?s:24;e.left+=a.left;n=e.width-(a.left+a.right);e.width=n>0?n:24;var _=this._getBindings(),u=this.titles;void 0===u&&_.length>1&&(u=_);var c=this._layout(t,e,u,_.length);this._angles=[];this._pels=[];this._pieGroups=[];this._rotationAngles=[];for(var p=0;p<_.length;p++){var f=c[p];u&&p<u.length&&u[p]&&FlexChartBase._renderText(t,u[p],new Point(f.left+.5*f.width,f.top),1,2,FlexPie._CSS_GROUP_TITLE);var d=t.startGroup(FlexPieClsNames.sliceGroup,null,!0);this._pieGroups.push(d);this._renderData(t,f,p,d);t.endGroup();this._rotationAngles.push(0)}this._highlightCurrent();this.innerText&&this._renderInnerText(t);this.dataLabel.content&&this.dataLabel.position!=PieLabelPosition.None&&this._renderLabels(t);this.onRendered(new RenderEventArgs(t))};FlexPie.prototype._layout=function(t,e,i,r){var n=0,s=r,a=1,o=0;if(i)for(var h=0;h<i.length;h++)o=Math.max(o,t.measureString(i[h],FlexPie._CSS_GROUP_TITLE).height);var l=Math.floor(this.chartsPerLine);if(l>0){s=Math.min(r,l);a=Math.ceil(r/s);var _=Math.floor(e.width/s),u=Math.floor(e.height/a)-o;n=Math.min(_,u)}else for(var c=1;c<=r;c++){var p=Math.floor((r+(c-1))/c);_=Math.floor(e.width/c),u=Math.floor(e.height/p);(u-=o)<_&&(_=u);if(_>n){n=_;s=c;a=p}}for(var f=[],d=.5*(e.width-n*s),g=.5*(e.height-(n+o)*a),m=0;m<a;m++)for(var x=0;x<s;x++)f.push(new Rect(e.left+n*x+8+d,e.top+(n+o)*m+8+g+o,n-16,n-16));return f};FlexPie.prototype._getDesiredLegendSize=function(t,e,i,r){var n=new Size,s=(new Size(i,r),this._getLabelsForLegend()),a=s.length,o=0,h=0;this.legend.scrollbar;this._colRowLens=[];for(var l=0;l<a;l++){var _=this._measureLegendItem(t,s[l]);if(e){if(h+_.height>r&&!this.legend.scrollbar){n.height=r;this._colRowLens.push(o);o=0;h=0}o<_.width&&(o=_.width);h+=_.height}else{if(o+_.width>i&&!this.legend.scrollbar){n.width=i;this._colRowLens.push(h);h=0;o=0}h<_.height&&(h=_.height);o+=_.width}}if(e){n.height<h&&(n.height=h);this._colRowLens.push(o);n.width=this._colRowLens.reduce((function(t,e){return t+e}),0)}else{n.width<o&&(n.width=o);this._colRowLens.push(h);n.height=this._colRowLens.reduce((function(t,e){return t+e}),0)}return n};FlexPie.prototype._renderLegend=function(t,e,i,r,n,s){for(var a=new Rect(e.x,e.y,n,s),o=this._getLabelsForLegend(),h=o.length,l=0,_=e.clone(),u=0;u<h;u++){var c=this._measureLegendItem(t,o[u]);if(r){if(_.y+c.height>a.bottom+1&&!this.legend.scrollbar){_.x+=this._colRowLens[l];l++;_.y=e.y}}else if(_.x+c.width>a.right+1&&!this.legend.scrollbar){_.y+=this._colRowLens[l];l++;_.x=e.x}var p=new Rect(_.x,_.y,c.width,c.height);this._drawLegendItem(t,p,u,o[u]);i.push(p);r?_.y+=c.height:_.x+=c.width}};FlexPie.prototype._renderData=function(t,e,i,r){var n=this._sums[i],s=this.startAngle+180,a=this.innerRadius,o=this.offset;a>1&&(a=1);if(n>0){var h=s*Math.PI/180,l=e.left+.5*e.width,_=e.top+.5*e.height,u=Math.min(.5*e.width,.5*e.height);this._centers[i]=new Point(l,_);var c=Math.max(o,this.selectedItemOffset);c>0&&(o*=u/=1+c);this._radius=u;var p=a*u;this._renderPie(t,i,u,p,h,o)}};FlexPie.prototype._renderPie=function(t,e,i,r,n,s){this._renderSlices(t,this._values[e],this._sums[e],e,i,r,n,2*Math.PI,s)};FlexPie.prototype._getCenter=function(){return this._centers[0]};FlexPie.prototype._renderSlices=function(t,e,i,r,n,s,a,o,h){for(var l,_,u,c=e.length,p=0,f=a,d=1==this.reversed,g=this._centers[r],m=0;m<c;m++)e[m]>0&&p++;var x=1===p?360:359.9/360;for(m=0;m<c;m++){_=g.x;u=g.y;l=t.startGroup(FlexPieClsNames.slice);t.fill=this._getColorLight(m);t.stroke=this._getColor(m);var y=Math.abs(e[m]),b=Math.abs(y-i)<1e-10?o:o*y/i;b=Math.min(b,o*x);var v=d?f-.5*b:f+.5*b;if(h>0&&b<o){_+=h*Math.cos(v);u+=h*Math.sin(v)}this._renderSlice(t,_,u,v,r,m,n,s,f,b,o);d?f-=b:f+=b;t.endGroup();this._pels.push(l)}};FlexPie.prototype._renderSlice=function(t,e,i,r,n,s,a,o,h,l,_){var u=this,c=!!this.reversed;this._angles.push(r);if(this.itemFormatter){var p=new HitTestInfo(this,new Point(e+a*Math.cos(r),i+a*Math.sin(r)),ChartElement.SeriesSymbol);p._setData(null,s);this.itemFormatter(t,p,(function(){u._drawSlice(t,n,s,c,e,i,a,o,h,l)}));t.cssPriority=!0}else this._drawSlice(t,n,s,c,e,i,a,o,h,l)};FlexPie.prototype._getSelectedItemOffset=function(t,e){var i=0,r=0,n=0;t==this._selectedIndex&&this.selectedItemOffset>0&&(n=this.selectedItemOffset);if(n>0){i=Math.cos(e)*n*this._radius;r=Math.sin(e)*n*this._radius}return{x:i,y:r}};FlexPie.prototype._renderInnerText=function(t){for(var e=this.innerText,i=this.innerTextStyle,r=0;r<this._centers.length;r++){var n=this._centers[r],s=void 0;if(s=isFunction(e)?e(r):isArray(e)?asString(e[r]):asString(e)){s=format(s,{total:this._sums[r],binding:this._getBindings()[r]});i&&(t.cssPriority=!1);FlexPie._renderText(t,s,n,1,1,FlexChartBase._CSS_TITLE,null,i);t.cssPriority=!0}}};FlexPie.prototype._renderLabels=function(t){var e,i=this._areas.length,r=this.dataLabel,n=r.position,s=DataLabelClsNames.labels,a=DataLabelClsNames.label,o=DataLabelClsNames.border,h=DataLabelClsNames.line,l=this._rotationAngles,_=r.connectingLine,u=r.offset?r.offset:0;t.stroke="null";t.fill="transparent";t.strokeWidth=1;t.startGroup(s);for(var c=0;c<i;c++){var p=this._areas[c];if(p){var f=p.radius,d=p.langle+l[p.gi],g=1,m=1;if(n==PieLabelPosition.Center||n===PieLabelPosition.Radial||n===PieLabelPosition.Circular)f*=.5*(1+(p.innerRadius||0)/p.radius);else{if((d=_Math.clampAngle(d))<=-170||d>=170){g=2;m=1}else if(d>=-100&&d<=-80){g=1;m=2}else if(d>=-10&&d<=10){g=0;m=1}else if(d>=80&&d<=100){g=1;m=0}else if(-180<d&&d<-90){g=2;m=2}else if(-90<=d&&d<0){g=0;m=2}else if(0<d&&d<90){g=0;m=0}else if(90<d&&d<180){g=2;m=0}if(n==PieLabelPosition.Inside){g=2-g;m=2-m}}d*=Math.PI/180;var x=p.gi?c-p.gi*this._values[0].length:c,y=this._getSelectedItemOffset(x,d),b=y.x,v=y.y,S=f;n==PieLabelPosition.Outside?S+=u:n==PieLabelPosition.Inside&&(S-=u);var C=p.center.x,P=p.center.y,w=this._centers[p.gi],A=C-w.x,M=P-w.y;if(0!=this._rotationAngles[p.gi]){var T=Math.sqrt(A*A+M*M),L=Math.atan2(M,A)+this._rotationAngles[p.gi]*Math.PI/180;C=w.x+T*Math.cos(L);P=w.y+T*Math.sin(L)}var E=new Point(C+b+S*Math.cos(d),P+v+S*Math.sin(d));if(r.border&&n!=PieLabelPosition.Center){0==g?E.x+=2:2==g&&(E.x-=2);0==m?E.y+=2:2==m&&(E.y-=2)}var F=new HitTestInfo(this,E);F._setDataGroup(p.gi,p.tag);var k=this._getLabelContent(F,r.content),N=new DataLabelRenderEventArgs(t,F,E,k);if(r.onRendering)if(r.onRendering(N)){k=N.text;E=N.point}else k=null;if(k){var I=180*Math.atan2(P-E.y,C-E.x)/Math.PI;I=(I+360)%360;if(n===PieLabelPosition.Radial||n===PieLabelPosition.Circular){if(n===PieLabelPosition.Radial)I>90&&I<270&&(I+=180);else{I>180&&I<360&&(I+=180);I-=90}(e=FlexChartBase._renderRotatedText(t,k,E,g,m,E,I,a).getBBox()).left=e.x;e.top=e.y}else e=FlexChartBase._renderText(t,k,E,g,m,a);r.border&&t.drawRect(e.left-2,e.top-2,e.width+4,e.height+4,o);if(_){var R=new Point(C+b+f*Math.cos(d),P+v+f*Math.sin(d));t.drawLine(E.x,E.y,R.x,R.y,h)}}t.cssPriority=!0}}t.endGroup()};FlexPie.prototype._drawSlice=function(t,e,i,r,n,s,a,o,h,l){var _;if(r)if(o>0){0!=l&&t.drawDonutSegment(n,s,a,o,h-l,l);(_=new _DonutSegment(new Point(n,s),a,o,h-l,l,this.startAngle)).tag=i;this._areas.push(_)}else{0!=l&&t.drawPieSegment(n,s,a,h-l,l);(_=new _PieSegment(new Point(n,s),a,h-l,l,this.startAngle)).tag=i;this._areas.push(_)}else{if(o>0){0!=l&&t.drawDonutSegment(n,s,a,o,h,l);(_=new _DonutSegment(new Point(n,s),a,o,h,l,this.startAngle)).tag=i;this._areas.push(_)}else{0!=l&&t.drawPieSegment(n,s,a,h,l);(_=new _PieSegment(new Point(n,s),a,h,l,this.startAngle)).tag=i;this._areas.push(_)}h+=l}_&&(_.gi=e)};FlexPie.prototype._measureLegendItem=function(t,e){var i=new Size;i.width=Series._LEGEND_ITEM_WIDTH;i.height=Series._LEGEND_ITEM_HEIGHT;if(e){var r=t.measureString(e,FlexChartBase._CSS_LABEL,FlexChartBase._CSS_LEGEND);i.width+=r.width;i.height<r.height&&(i.height=r.height)}i.width+=3*Series._LEGEND_ITEM_MARGIN;i.height+=2*Series._LEGEND_ITEM_MARGIN;return i};FlexPie.prototype._drawLegendItem=function(t,e,i,r){t.strokeWidth=1;var n=Series._LEGEND_ITEM_MARGIN,s=null,a=null;null===s&&(s=this._getColorLight(i));null===a&&(a=this._getColor(i));t.fill=s;t.stroke=a;var o=e.top+.5*e.height,h=Series._LEGEND_ITEM_WIDTH,l=Series._LEGEND_ITEM_HEIGHT;t.drawRect(e.left+n,o-.5*l,h,l,null);null!=r&&FlexChartBase._renderText(t,r.toString(),new Point(e.left+l+2*n,o),0,1,FlexChartBase._CSS_LABEL)};FlexPie.prototype._getLabelContent=function(t,e){return isString(e)?this._keywords.replace(e,t):isFunction(e)?e(t):null};FlexPie.prototype._select=function(t,e){void 0===e&&(e=!1);this._highlight(!1,this._selectionIndex);this._selectionIndex=t;if(this.selectionMode==SelectionMode.Point){var i=this._cv;if(i){this._notifyCurrentChanged=!1;i.moveCurrentToPosition(t);this._notifyCurrentChanged=!0}}if(null==t){this._selectedIndex=-1;this.invalidate()}else if(this.isAnimated&&this.selectedItemPosition!=Position.None||!(this.selectedItemOffset>0||this.selectedItemPosition!=Position.None))this._highlight(!0,this._selectionIndex,e);else{this._selectedIndex=t;this.invalidate()}this.onSelectionChanged()};FlexPie.prototype._highlightCurrent=function(){if(this.selectionMode!=SelectionMode.None){var t=-1,e=this._cv;e&&(t=e.currentPosition);this._highlight(!0,t)}};FlexPie.prototype._highlight=function(t,e,i){void 0===i&&(i=!1);if(this.selectionMode==SelectionMode.Point&&null!=e&&e>=0)if(t){for(var r=[],n=0;n<this._pieGroups.length;n++){if(c=this._pels[e+n*this._values[0].length]){c.parentNode.appendChild(c);var s=this._find(c,["ellipse"]);this._highlightItems(this._find(c,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}var a=this._angles[e+n*this._values[0].length];if(this.selectedItemPosition!=Position.None&&0!=a){var o=0;this.selectedItemPosition==Position.Left?o=180:this.selectedItemPosition==Position.Top?o=-90:this.selectedItemPosition==Position.Bottom&&(o=90);var h=o*Math.PI/180-a;h*=180/Math.PI;if(i&&this.isAnimated)r.push(h);else{this._rotationAngles[n]=h;this._pieGroups[n].transform.baseVal.getItem(0).setRotate(h,this._centers[n].x,this._centers[n].y)}}var l=this.selectedItemOffset;if(l>0&&s&&0==s.length){this._selectedOffset.x=Math.cos(a)*l*this._radius;var _=this._selectedOffset.x;this._selectedOffset.y=Math.sin(a)*l*this._radius;var u=this._selectedOffset.y;c&&c.setAttribute("transform","translate("+_.toFixed()+","+u.toFixed()+")")}this._selectedIndex=e}r.length>0&&this._animateSelectionAngle(r,.5)}else{for(n=0;n<this._pieGroups.length;n++){var c;if(c=this._pels[e+n*this._values[0].length]){c.parentNode.insertBefore(c,c.parentNode.childNodes.item(e));c.removeAttribute("transform");this._highlightItems(this._find(c,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}}this._selectedIndex==e&&(this._selectedIndex=-1)}};FlexPie.prototype._animateSelectionAngle=function(t,e){var i=this,r=this._pieGroups;this._selectionAnimationID&&clearInterval(this._selectionAnimationID);this._selectionAnimationID=animate((function(e){if(r==i._pieGroups){for(var n=0;n<r.length;n++){var s=_Math.clampAngle(i._rotationAngles[n]),a=_Math.clampAngle(t[n])-s,o=s;i._rotationAngles[n]=s=o+a*e;r[n].transform.baseVal.getItem(0).setRotate(s,i._centers[n].x,i._centers[n].y)}1==e&&clearInterval(i._selectionAnimationID);e>.99&&(i.selectedItemOffset>0||i.selectedItemPosition!=Position.None)&&i.invalidate()}}),1e3*e)};FlexPie.prototype._getHitTestItem=function(t){var e=null,i=null;(e=null!=this._cv?this._cv.items:this.itemsSource)&&t<e.length&&(i=e[t]);return i};FlexPie.prototype._getHitTestValue=function(t,e){null==e&&(e=0);return this._values[e][t]};FlexPie.prototype._getHitTestLabel=function(t){return this._labels[t]};FlexPie._MARGIN=4;FlexPie._CSS_GROUP_TITLE=FlexChartClsNames.label;return FlexPie}(FlexChartBase);export{FlexPie};var _Math=function(){function _Math(){}_Math.clampAngle=function(t,e){void 0===e&&(e=0);var i=(t+180)%360-180;i<-180+(e<0?e+360:e)&&(i+=360);return i};return _Math}(),_PieSegment=function(){function _PieSegment(t,e,i,r,n){void 0===n&&(n=0);this._isFull=!1;this._center=t;this._radius=e;this._originAngle=i;this._originSweep=r;r>=2*Math.PI&&(this._isFull=!0);this._sweep=.5*r*180/Math.PI;this._angle=_Math.clampAngle(180*i/Math.PI+this._sweep);this._radius2=e*e;this._startAngle=n}_PieSegment.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 r=180*Math.atan2(i,e)/Math.PI,n=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(r,this._startAngle);if(this._isFull||Math.abs(n)<=this._sweep)return!0}return!1};_PieSegment.prototype.distance=function(t){if(this.contains(t))return 0;var e=t.x-this._center.x,i=t.y-this._center.y,r=e*e+i*i,n=180*Math.atan2(i,e)/Math.PI,s=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(n,this._startAngle);if(this._isFull||Math.abs(s)<=this._sweep)return Math.sqrt(r)-this._radius;var a=this.center.clone();a.x+=this.radius*Math.cos(this._originAngle);a.y+=this.radius*Math.sin(this._originAngle);var o=this.center.clone();o.x+=this.radius*Math.cos(this._originAngle+this._originSweep);o.y+=this.radius*Math.sin(this._originAngle+this._originSweep);var h=FlexChartCore._dist(t,this.center,a),l=FlexChartCore._dist(t,this.center,o);return Math.min(h,l)};Object.defineProperty(_PieSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0});return _PieSegment}();export{_PieSegment};var _DonutSegment=function(){function _DonutSegment(t,e,i,r,n,s){void 0===s&&(s=0);this._isFull=!1;this._center=t;this._radius=e;this._iradius=i;this._originAngle=r;this._originSweep=n;n>=2*Math.PI&&(this._isFull=!0);this._sweep=.5*n*180/Math.PI;this._angle=_Math.clampAngle(180*r/Math.PI+this._sweep);this._radius2=e*e;this._iradius2=i*i;this._startAngle=s}_DonutSegment.prototype.contains=function(t){var e=t.x-this._center.x,i=t.y-this._center.y,r=e*e+i*i;if(r>=this._iradius2&&r<=this._radius2){var n=180*Math.atan2(i,e)/Math.PI,s=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(n,this._startAngle);if(this._isFull||Math.abs(s)<=this._sweep)return!0}return!1};_DonutSegment.prototype.distance=function(t){if(this.contains(t))return 0;var e=this.center.clone();e.x+=this.radius*Math.cos(this._originAngle);e.y+=this.radius*Math.sin(this._originAngle);var i=this.center.clone();i.x+=this._iradius*Math.cos(this._originAngle);i.y+=this._iradius*Math.sin(this._originAngle);var r=this.center.clone();r.x+=this.radius*Math.cos(this._originAngle+this._originSweep);r.y+=this.radius*Math.sin(this._originAngle+this._originSweep);var n=this.center.clone();n.x+=this._iradius*Math.cos(this._originAngle+this._originSweep);n.y+=this._iradius*Math.sin(this._originAngle+this._originSweep);var s=FlexChartCore._dist(t,e,i),a=FlexChartCore._dist(t,r,n);return Math.min(s,a)};Object.defineProperty(_DonutSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"innerRadius",{get:function(){return this._iradius},enumerable:!0,configurable:!0});return _DonutSegment}();export{_DonutSegment};export var AxisType;!function(t){t[t.X=0]="X";t[t.Y=1]="Y"}(AxisType||(AxisType={}));export var OverlappingLabels;!function(t){t[t.Auto=0]="Auto";t[t.Show=1]="Show"}(OverlappingLabels||(OverlappingLabels={}));export var TickMark;!function(t){t[t.None=0]="None";t[t.Outside=1]="Outside";t[t.Inside=2]="Inside";t[t.Cross=3]="Cross"}(TickMark||(TickMark={}));export var AxisGroupsDisplay;!function(t){t[t.None=0]="None";t[t.Show=1]="Show";t[t.ShowGrid=2]="ShowGrid"}(AxisGroupsDisplay||(AxisGroupsDisplay={}));var Axis=function(){function Axis(t){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._isMinimumAuto=!0;this._isMaximumAuto=!0;this._labels=!0;this._isTimeAxis=!1;this._labelPadding=5;this._actualLabels=[];this._labelMin=!1;this._labelMax=!1;this.rangeChanged=new Event;this._customConvert=null;this._customConvertBack=null;this.__uniqueId=Axis._id++;t==Position.BottomLeft||t==Position.BottomRight||t==Position.TopLeft||t==Position.TopRight||t==Position.LeftTop||t==Position.LeftBottom||t==Position.RightTop||t==Position.RightBottom?this._position=void 0:this._position=t;this._position==Position.Bottom||this._position==Position.Top?this._axisType=AxisType.X:this._position!=Position.Left&&this._position!=Position.Right||(this._axisType=AxisType.Y);this._minorTickMarks=TickMark.None;this._overlap=OverlappingLabels.Auto}Object.defineProperty(Axis.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"actualMin",{get:function(){return this._isTimeAxis?new Date(this._actualMin):this._actualMin},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"actualMax",{get:function(){return this._isTimeAxis?new Date(this._actualMax):this._actualMax},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"min",{get:function(){return this._min},set:function(t){if(t!=this._min){this._isMinimumAuto=!1;isDate(t)?this._min=asDate(t,!0):this._min=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"max",{get:function(){return this._max},set:function(t){if(t!=this._max){this._isMaximumAuto=!1;isDate(t)?this._max=asDate(t,!0):this._max=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"reversed",{get:function(){return this._reversed},set:function(t){if(this._reversed!=t){this._reversed=asBoolean(t);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"position",{get:function(){return this._position},set:function(t){if((t=asEnum(t,Position,!1))!=this._position){t==Position.BottomLeft||t==Position.BottomRight||t==Position.TopLeft||t==Position.TopRight||t==Position.LeftTop||t==Position.LeftBottom||t==Position.RightTop||t==Position.RightBottom?this._position=this._axisType==AxisType.X?Position.Bottom:this._axisType==AxisType.Y?Position.Left:void 0:this._position=t;this._position==Position.Bottom||this._position==Position.Top?null==this._axisType?this._axisType=AxisType.X:this._axisType==AxisType.Y&&(this._position=Position.Left):this._position!=Position.Left&&this._position!=Position.Right||(null==this._axisType?this._axisType=AxisType.Y:this._axisType==AxisType.X&&(this._position=Position.Bottom));this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorUnit",{get:function(){return this._majorUnit},set:function(t){if(t!=this._majorUnit){this._majorUnit=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorUnit",{get:function(){return this._minorUnit},set:function(t){if(t!=this._minorUnit){this._minorUnit=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=asString(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"title",{get:function(){return this._title},set:function(t){if(t!=this._title){this._title=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this._format){this._format=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorGrid",{get:function(){return this._majorGrid},set:function(t){if(t!=this._majorGrid){this._majorGrid=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorTickMarks",{get:function(){return this._majorTickMarks},set:function(t){if((t=asEnum(t,TickMark,!0))!=this._majorTickMarks){this._majorTickMarks=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorGrid",{get:function(){return this._minorGrid},set:function(t){if(t!=this._minorGrid){this._minorGrid=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorTickMarks",{get:function(){return this._minorTickMarks},set:function(t){if((t=asEnum(t,TickMark,!0))!=this._minorTickMarks){this._minorTickMarks=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"axisLine",{get:function(){return void 0===this._axisLine?this.axisType==AxisType.X:this._axisLine},set:function(t){if(t!=this._axisLine){this._axisLine=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labels",{get:function(){return this._labels},set:function(t){if(t!=this._labels){this._labels=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelAlign",{get:function(){return this._labelAlign},set:function(t){if(t!=this._labelAlign){this._labelAlign=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelAngle",{get:function(){return this._labelAngle},set:function(t){if(t!=this._labelAngle){this._labelAngle=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelMin",{get:function(){return this._labelMin},set:function(t){if(t!=this._labelMin){this._labelMin=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelMax",{get:function(){return this._labelMax},set:function(t){if(t!=this._labelMax){this._labelMax=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"origin",{get:function(){return this._origin},set:function(t){if(t!=this._origin){this._origin=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"overlappingLabels",{get:function(){return this._overlap},set:function(t){if((t=asEnum(t,OverlappingLabels,!0))!=this._overlap){this._overlap=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=asCollectionView(t);null!=this._cv&&this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"itemFormatter",{get:function(){return this._ifmt},set:function(t){if(this._ifmt!=t){this._ifmt=asFunction(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"logBase",{get:function(){return this._logBase},set:function(t){if(t!=this._logBase){this._logBase=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"groupsOptions",{get:function(){return this._groupsOptions},set:function(t){if(t!=this._groupsOptions){this._groupsOptions=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"axisLabels",{get:function(){return this._actualLabels},enumerable:!0,configurable:!0});Axis.prototype._getLogBase=function(){return this._chart&&this._chart._stacking===Stacking.Stacked100pc?0:this.logBase};Axis.prototype._isLogAxis=function(){var t=this._getLogBase();return null!=t&&t>0};Object.defineProperty(Axis.prototype,"plotArea",{get:function(){return this._parea},set:function(t){if(t!=this._parea){this._parea=asType(t,PlotArea,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelPadding",{get:function(){return this._labelPadding},set:function(t){if(t!=this._labelPadding){this._labelPadding=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"_groupClass",{get:function(){return this.axisType===AxisType.X?FlexChartCore._CSS_AXIS_X:FlexChartCore._CSS_AXIS_Y},enumerable:!0,configurable:!0});Axis.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};Axis.prototype._getPosition=function(){if(this.axisType==AxisType.X){if(this.position==Position.Auto)return Position.Bottom}else if(this.axisType==AxisType.Y&&this.position==Position.Auto)return Position.Left;return this.position};Axis.prototype._isOverlapped=function(t,e,i,r){var n=this._lbls;if(null!=n&&n.length>1)for(var s=n.length,a=this._values&&this._values.length==s?this._values:null,o=0,h=0,l=0;l<s;l++){var _=a?a[l]:l;if(_>=this._actualMin&&_<=this._actualMax){var u=e*(_-this._actualMin)/(this._actualMax-this._actualMin),c=t.measureString(n[l],i,this._groupClass);if(this.axisType==AxisType.X){if(l>0&&Math.abs(u-o)<.5*(c.width+h))return!0;o=u;h=c.width}else this.axisType,AxisType.Y}}return!1};Axis.prototype._getHeight=function(t,e){this._actualAngle=null;var i=FlexChartCore._CSS_LABEL,r=FlexChartCore._CSS_TITLE,n=.1*this._getActualRange(),s=this._lbls,a=this.labelAngle;if(this.labels&&this._chart._getChartType()!==ChartType.Funnel){n=this._updateAutoFormat(n);if(null!=s&&s.length>0){var o=s.length,h=this._values&&this._values.length==o?this._values:null;this._annoSize=new Size;for(var l=0;l<o;l++){if((p=h?h[l]:l)>=this._actualMin&&p<=this._actualMax){var _=s[l],u=i;if(this.itemFormatter){_=(f=this._getFormattedItem(t,p,_,new Point,i,!0)).text;u=f.cls}var c=t.measureString(_,u,this._groupClass);this.axisType,AxisType.X,c.width>this._annoSize.width&&(this._annoSize.width=c.width);c.height>this._annoSize.height&&(this._annoSize.height=c.height)}}null==a&&this.axisType==AxisType.X&&(this._isOverlapped(t,Math.max(10,e-this._annoSize.width),i,this.axisType)?a=this._actualAngle=-45:this._actualAngle=0)}else if(isNumber(this.majorUnit)&&this._axisType===AxisType.Y&&this.itemFormatter){h=[];this._annoSize=new Size;this._getAutoLbsAndVals([],h);for(l=0;l<h.length;l++){var p=h[l];_=this._formatValue(p),u=i;_=(f=this._getFormattedItem(t,p,_,new Point,i,!0)).text;u=i;(c=t.measureString(_,u,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=c.width);c.height>this._annoSize.height&&(this._annoSize.height=c.height)}}else{p=this._actualMin-n,_=this._formatValue(p),u=i;if(this.itemFormatter){_=(f=this._getFormattedItem(t,p,_,new Point,i,!0)).text;u=i}c=t.measureString(_,u,this._groupClass);this._annoSize=c;p=this._actualMax+n;_=this._formatValue(p);u=i;if(this.itemFormatter){var f;_=(f=this._getFormattedItem(t,p,_,new Point,i,!0)).text;u=i}(c=t.measureString(_,u,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=c.width);c.height>this._annoSize.height&&(this._annoSize.height=c.height)}this._annoSizeBase=new Size(this._annoSize.width,this._annoSize.height);if(a){a>90?a=90:a<-90&&(a=-90);var d=a*Math.PI/180,g=this._annoSize.width,m=this._annoSize.height;this._annoSize.width=g*Math.abs(Math.cos(d))+m*Math.abs(Math.sin(d));this._annoSize.height=g*Math.abs(Math.sin(d))+m*Math.abs(Math.cos(d));this._actualAngle=a}}else{this._annoSize=new Size(8,8);this._annoSizeBase=new Size(this._annoSize.width,this._annoSize.height)}var x=0;if(this.labels){x=2*(this._labelPadding||5);this._axisType==AxisType.X?x+=this._annoSize.height:x+=this._annoSize.width+this._TICK_LABEL_DISTANCE+2}var y=this._TICK_HEIGHT,b=this._TICK_OVERLAP,v=this.majorTickMarks;v==TickMark.Outside?b=1:v==TickMark.Inside?b=-1:v==TickMark.Cross&&(b=0);null==v&&(v=TickMark.Outside);v!=TickMark.None&&(x+=.5*(1+b)*y);if(this._title){_=this._title;this._szTitle=t.measureString(_,r,this._groupClass);x+=this._szTitle.height}else this._szTitle=void 0;if(this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None){this._groupsPanel||(this._groupsPanel=new _AxisGroups(this));this._groupsPanel.createGroups();x+=this._groupsPanel.getHeight(t)}t.fontSize=null;return x};Axis.prototype._updateAutoFormat=function(t){if(this._isTimeAxis){var e=this.format,i=.001*this._getActualRange()/10,r=new _timeSpan(i*_timeSpan.TicksPerSecond),n=isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(r,e);e||(this._tfmt=_timeHelper.GetTimeDefaultFormat(1e3*n.TotalSeconds,0));t=n.TotalSeconds}return t};Axis.prototype._getActualRange=function(){return this._actualMax-this._actualMin};Axis.prototype._updateActualLimitsByChartType=function(t,e,i){if(t&&t.length>0&&!this._isTimeAxis){var r=this._chart._getChartType();if(r!=ChartType.Column&&r!=ChartType.Bar){e-=.5;i+=.5}}return{min:e,max:i}};Axis.prototype._updateActualLimits=function(t,e,i,r,n){void 0===r&&(r=null);void 0===n&&(n=null);var s=this._actualMin,a=this._actualMax;this._isTimeAxis=t==DataType.Date;var o=this._updateActualLimitsByChartType(r,e,i);e=o.min;i=o.max;var h=this._min,l=this._max;isDate(h)&&(h=h.valueOf());isDate(l)&&(l=l.valueOf());var _=this._getSeries(),u=this._chart&&(null!=_&&void 0!==_._getChartType()||this._chart._stacking!==Stacking.Stacked100pc);u||(u=this._chart._isRotated()?this.axisType==AxisType.Y:this.axisType==AxisType.X);this._actualMin=null!=h&&u?h:e;var c=this._actualMin;this._actualMax=null!=l&&u?l:i;if(c==this._actualMax)if(void 0!==h&&void 0===l)this._actualMax+=1;else if(void 0===h&&void 0!==l)this._actualMin-=1;else if(0===c)this._actualMax=1;else{var p=Math.abs(c);if(p<1){this._actualMin-=p;this._actualMax+=p}else{this._actualMin-=1;this._actualMax+=1}}if(this._getLogBase()>0){var f=this.logBase,d=Math.log(f);if(!this._max){var g=Math.ceil(Math.log(this._actualMax)/d);this._actualMax=Math.pow(f,g)}if(!this._min){var m=Math.floor(Math.log(this._actualMin)/d);this._actualMin=Math.pow(f,m)}(this._actualMin<=0||!isNumber(this._actualMin))&&(this._actualMin=1);this._actualMax<this._actualMin?this._actualMax=this._actualMin+1:this._actualMax===this._actualMin&&(this._actualMin=.1*this._actualMax)}(s!=this._actualMin&&(isNumber(s)||isNumber(this._actualMin))||a!=this._actualMax&&(isNumber(a)||isNumber(this._actualMax)))&&this.onRangeChanged();if(this._items){this._values=[];this._lbls=[];var x=this._items.length,y="value",b="text";if(this.binding){var v=this.binding.split(",");if(2==v.length){y=v[0];b=v[1]}}for(var S=0;S<x;S++){var C=this._items[S],P=C[y];if(isNumber(P)){this._values.push(P);this._lbls.push(C[b])}else if(isDate(P)){this._values.push(P.getTime());this._lbls.push(C[b])}}}else{this._lbls=r;this._values=n}};Axis.prototype._layout=function(t,e){var i=this.axisType==AxisType.Y;this._plotrect=e;this._axrect=i?new Rect(t.left,t.top,t.height,t.width):t;this._groupsPanel&&this._groupsPanel.layout()};Axis.prototype._hasVisibileSeries=function(){for(var t,e=this._chart.series,i=0,r=e.length;i<r;i++)if((t=e[i].visibility)==SeriesVisibility.Plot||t==SeriesVisibility.Visible)return!0;return!1};Axis.prototype._getSeries=function(){if(this._chart)for(var t=this._chart.series,e=0,i=t.length;e<i;e++)if(t[e].axisY==this||t[e].axisX==this)return t[e];return null};Axis.prototype._render=function(t){if(this.position!=Position.None&&this._hasVisibileSeries()){this.axisLabels.length=0;this._vals={};var e=0;this.labelAngle&&((e=this.labelAngle)>90?e=90:e<-90&&(e=-90));null==this.labelAngle&&null!=this._actualAngle&&(e=this._actualAngle);var i=FlexChartCore._FG,r=[],n=!1,s=this._getActualRange();if(isNumber(s)){var a=[];this._rects=[];this._vals.major=r;this._vals.hasLbls=[];if(this._lbls&&this._lbls.length>0){a=this._lbls;if(0==this._values.length){n=!0;for(var o=0;o<a.length;o++)r.push(o)}else r=this._values}else this._getAutoLbsAndVals(a,r);var h=Math.min(r.length,a.length);t.textFill=i;var l=this._TICK_HEIGHT,_=this._TICK_OVERLAP,u=this.majorTickMarks;null==u&&(u=TickMark.Outside);u==TickMark.Outside?_=1:u==TickMark.Inside?_=-1:u==TickMark.Cross&&(_=0);var c=.5*(_-1)*l,p=.5*(1+_)*l;if(this._isTimeAxis&&h>=2){if(r[1]-r[0]>864e5){null==this._min&&(this._actualMin=_timeHelper.FloorDay(this._actualMin));null==this._max&&(this._actualMax=_timeHelper.CeilDay(this._actualMax))}}for(o=0;o<h;o++){var f=!0,d=r[o],g=a[o],m=this.labels;m&&(n||this.itemsSource)&&this.majorUnit&&o%this.majorUnit!=0&&(m=!1);if(d>=this._actualMin&&d<=this._actualMax){var x=t.textFill;f=this._renderLabelsAndTicks(t,o,d,g,e,u,m,c,p);t.textFill=x}this._vals.hasLbls.push(f);f&&this.axisLabels.push(g)}}(this.minorGrid||this.minorTickMarks!=TickMark.None)&&this._renderMinor(t,r,n);t.stroke=i;t.fontSize=null;this._renderLineAndTitle(t);this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None&&this._groupsPanel&&this._groupsPanel.render(t);t.stroke=null;t.fontSize=null;t.textFill=null;t.strokeWidth=null}};Axis.prototype._getAutoLbsAndVals=function(t,e){var i=this._actualMax-this._actualMin,r=this._calcMajorUnit();0==r&&(r=.1*this._niceTickNumber(i));var n=Math.floor(this._actualMin/r)*r;n<this._actualMin&&(n+=r);var s=Math.min(Axis.MAX_MAJOR,Math.floor(i/r)+1);if(this._isTimeAxis){this._createTimeLabels(n,s,e,t);this._addMinMaxLabels(e,t)}else if(this._getLogBase()){this._createLogarithmicLabels(this._actualMin,this._actualMax,this.majorUnit,e,t,!0);this._addMinMaxLabels(e,t)}else{this._createLabels(n,s,r,e,t);this._addMinMaxLabels(e,t)}};Axis.prototype._renderLineAndTitle=function(t){var e=this._getPosition(),i=this.axisType==AxisType.Y,r=e!=Position.Top&&e!=Position.Right,n=FlexChartCore._CSS_TITLE,s=FlexChartCore._CSS_LINE;if(i)if(r){if(this._title){var a=new Point(this._axrect.left+.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,a,1,1,a,-90,n,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.right,this._axrect.top,this._axrect.right,this._axrect.bottom,s)}else{if(this._title){a=new Point(this._axrect.right-.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,a,1,1,a,90,n,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.left,this._axrect.bottom,s)}else if(r){this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.right,this._axrect.top,s);this._title&&FlexChartCore._renderText(t,this._title,new Point(this._axrect.left+.5*this._axrect.width,this._axrect.bottom),1,2,n)}else{this.axisLine&&t.drawLine(this._axrect.left,this._axrect.bottom,this._axrect.right,this._axrect.bottom,s);this._title&&FlexChartCore._renderText(t,this._title,new Point(this._axrect.left+.5*this._axrect.width,this._axrect.top),1,0,n)}};Axis.prototype._renderMinor=function(t,e,i){var r=this._getPosition(),n=this.axisType==AxisType.Y,s=r!=Position.Top&&r!=Position.Right;this._getLogBase()?this._createLogarithmicMinors(t,e,n,s,i):this._createMinors(t,e,n,s,i)};Axis.prototype._renderRotatedText=function(t,e,i,r,n,s,a,o,h,l,_){if(this.itemFormatter){var u=this._getFormattedItem(t,e,i,r,h);if(u){i=u.text;h=u.cls}else i=null}FlexChartCore._renderRotatedText(t,i,r,n,s,a,o,h,l,_)};Axis.prototype._getFormattedItem=function(t,e,i,r,n,s){void 0===s&&(s=!1);if(this.itemFormatter){var a=r.clone();this._plotrect&&(this.axisType==AxisType.X?this.position==Position.Top?a.y=this._plotrect.top:a.y=this._plotrect.bottom:this.position==Position.Right?a.x=this._plotrect.right:a.x=this._plotrect.left);var o={val:e,text:i,pos:a,cls:n};s&&(t.readOnly=!0);o=this.itemFormatter(t,o);s&&(t.readOnly=!1);return o}};Axis.prototype._renderLabelsAndTicks=function(t,e,i,r,n,s,a,o,h){var l=this._getPosition(),_=!1,u=this.axisType==AxisType.Y,c=l!=Position.Top&&l!=Position.Right,p=this.labelPadding||5,f=this._TICK_WIDTH,d=this._getLabelAlign(u),g=FlexChartCore._CSS_LABEL,m=FlexChartCore._CSS_GRIDLINE,x=FlexChartCore._CSS_TICK,y=FlexChartCore._FG,b=FlexChartCore._FG,v=this._GRIDLINE_WIDTH,S=i!=this._actualMin&&this.majorGrid;if(u){var C=this.convert(i);if(S){t.stroke=y;t.strokeWidth=v;t.drawLine(this._plotrect.left,C,this._plotrect.right,C,m)}t.stroke=b;t.strokeWidth=f;if(c){if(a){_=!0;var P=new Point(this._axrect.right-h-this._TICK_LABEL_DISTANCE-p,C);n>0?90==n?this._renderRotatedText(t,i,r,P,1,0,P,n,g,this._groupClass):this._renderRotatedText(t,i,r,P,2,1,P,n,g,this._groupClass):n<0?-90==n?this._renderRotatedText(t,i,r,P,1,2,P,n,g,this._groupClass):this._renderRotatedText(t,i,r,P,2,1,P,n,g,this._groupClass):_=this._renderLabel(t,i,r,P,2,d,g)}s!=TickMark.None&&_&&t.drawLine(this._axrect.right-o,C,this._axrect.right-h,C,x)}else{if(a){_=!0;P=new Point(this._axrect.left+h+this._TICK_LABEL_DISTANCE+p,C);n>0?90==n?this._renderRotatedText(t,i,r,P,1,2,P,n,g,this._groupClass):this._renderRotatedText(t,i,r,P,0,1,P,n,g,this._groupClass):n<0?-90==n?this._renderRotatedText(t,i,r,P,1,0,P,n,g,this._groupClass):this._renderRotatedText(t,i,r,P,0,1,P,n,g,this._groupClass):_=this._renderLabel(t,i,r,P,0,d,g)}s!=TickMark.None&&_&&t.drawLine(this._axrect.left+o,C,this._axrect.left+h,C,x)}}else{var w=this.convert(i);if(S&&a){t.stroke=y;t.strokeWidth=v;t.drawLine(w,this._plotrect.top,w,this._plotrect.bottom,m)}this.overlappingLabels==OverlappingLabels.Auto&&this._xCross(w)&&(a=!1);t.stroke=b;t.strokeWidth=f;if(c){if(a){P=new Point(w,this._axrect.top+h+p);_=0!=n?this._renderRotatedLabel(t,i,r,P,d,n,g,c):this._renderLabel(t,i,r,P,d,0,g)}if(s!=TickMark.None&&_){w=this.convert(i);t.drawLine(w,this._axrect.top+o,w,this._axrect.top+h,x)}}else{if(a){P=new Point(w,this._axrect.bottom-h-p);_=0!=n?this._renderRotatedLabel(t,i,r,P,d,n,g,c):this._renderLabel(t,i,r,P,d,2,g)}if(s!=TickMark.None&&_){w=this.convert(i);t.drawLine(w,this._axrect.bottom-o,w,this._axrect.bottom-h,x)}}}return _};Axis.prototype._xCross=function(t){for(var e=this._rects.length,i=0;i<e;i++){var r=this._rects[i];if(t>=r.left&&t<=r.right)return!0}return!1};Axis.prototype._createMinors=function(t,e,i,r,n){if(e){var s=this.majorUnit?this._isTimeAxis?24*this.majorUnit*3600*1e3:this.majorUnit:e.length>1?e[1]-e[0]:e[0],a=isNumber(this.minorUnit)?this._isTimeAxis?24*this.minorUnit*3600*1e3:this.minorUnit:.5*s;if(a<=0)return;for(var o=[],h=e[0];h>this._actualMin&&o.length<Axis.MAX_MINOR;h-=a)-1==e.indexOf(h)&&o.push(h);for(h=e[0]+a;h<this._actualMax&&o.length<Axis.MAX_MINOR;h+=a)(-1==e.indexOf(h)||n&&this.majorUnit&&h%this.majorUnit!=0)&&o.push(h);this._renderMinors(t,o,i,r)}};Axis.prototype._createLogarithmicMinors=function(t,e,i,r,n){if(e&&(!this.minorUnit||this.minorUnit<this._getLogBase())){var s=this.logBase;this.majorUnit>s&&(s=this.majorUnit);if(0==e.length){var a=Math.log(s),o=Math.floor(Math.log(this._actualMin)/a),h=Math.ceil(Math.log(this.actualMax)/a);if(this.majorUnit>0){e.push(Math.pow(s,o));e.push(Math.pow(s,h))}else{e.push(Math.pow(s,h));e.push(Math.pow(s,o))}}this.minorUnit||(this.minorUnit=s-1<1?.2*(s-1):.2*s);var l=[];if(this.majorUnit>0){for(var _=e[0]-e[0]/s*this.minorUnit;_>=this._actualMin&&l.length<Axis.MAX_MINOR;_-=e[0]/s*this.minorUnit)l.push(_);for(var u=0;u<e.length-1;u++)for(_=e[u]+e[u]*this.minorUnit;_<e[u+1]&&l.length<Axis.MAX_MINOR;_+=e[u]*this.minorUnit)_>=this._actualMin&&_<=this._actualMax&&l.push(_);for(_=e[e.length-1]+e[e.length-1]*this.minorUnit;_<=this._actualMax&&l.length<Axis.MAX_MINOR;_+=e[e.length-1]*this.minorUnit)l.push(_)}else{for(_=e[e.length-1]-e[e.length-1]/s*this.minorUnit;_>=this._actualMin&&l.length<Axis.MAX_MINOR;_-=e[e.length-1]/s*this.minorUnit)l.push(_);for(u=0;u<e.length-1;u++)for(_=e[u]-e[u+1]*this.minorUnit;_>e[u+1]&&l.length<Axis.MAX_MINOR;_-=e[u+1]*this.minorUnit)_>=this._actualMin&&_<=this._actualMax&&l.push(_);for(_=e[0]+e[0]*this.minorUnit;_<=this._actualMax&&l.length<Axis.MAX_MINOR;_+=e[0]*this.minorUnit)l.push(_)}this._renderMinors(t,l,i,r)}};Axis.prototype._renderMinors=function(t,e,i,r){var n=this._TICK_HEIGHT,s=this._TICK_WIDTH,a=this._TICK_OVERLAP,o=FlexChartCore._FG,h=this.minorTickMarks,l=!0;this._vals.minor=e;h==TickMark.Outside?a=1:h==TickMark.Inside?a=-1:h==TickMark.Cross?a=0:l=!1;for(var _=.5*(a-1)*n,u=.5*(1+a)*n,c=e?e.length:0,p=this.minorGrid,f=this._plotrect,d=this._GRIDLINE_WIDTH,g=FlexChartCore._FG,m=FlexChartCore._CSS_GRIDLINE_MINOR,x=FlexChartCore._CSS_TICK_MINOR,y=0;y<c;y++)if(e[y]>=this.actualMin&&e[y]<=this.actualMax)if(i){var b=this.convert(e[y]);if(l){t.stroke=o;t.strokeWidth=s;r?t.drawLine(this._axrect.right-_,b,this._axrect.right-u,b,x):t.drawLine(this._axrect.left+_,b,this._axrect.left+u,b,x)}if(p){t.stroke=g;t.strokeWidth=d;t.drawLine(f.left,b,f.right,b,m)}}else{var v=this.convert(e[y]);if(l){t.stroke=o;t.strokeWidth=s;r?t.drawLine(v,this._axrect.top+_,v,this._axrect.top+u,x):t.drawLine(v,this._axrect.bottom-_,v,this._axrect.bottom-u,x)}if(p){t.stroke=g;t.strokeWidth=d;t.drawLine(v,f.top,v,f.bottom,m)}}};Axis.prototype._renderLabel=function(t,e,i,r,n,s,a){var o=!1;if(this.itemFormatter){var h=this._getFormattedItem(t,e,i,r,a);if(h){i=h.text;a=h.cls}else i=null}if(i){var l=this._rects,_=this.overlappingLabels==OverlappingLabels.Auto&&!isNumber(this._actualAngle),u=FlexChartCore._renderText(t,i,r,n,s,a,this._groupClass,null,(function(t){if(_)for(var e=l.length,i=0;i<e;i++)if(FlexChartCore._intersects(l[i],t))return!1;return!0}));if(u){u.left+=4;u.width+=8;l.push(u);o=!0}}return o};Axis.prototype._renderRotatedLabel=function(t,e,i,r,n,s,a,o){if(this.itemFormatter){var h=this._getFormattedItem(t,e,i,r,a);if(h){i=h.text;a=h.cls}else i=null}if(i){var l=t.measureString(i,a,this._groupClass),_=.5*l.height,u=.5*l.width*Math.abs(Math.sin(s*Math.PI/180)),c=.5*l.width,p=.5*(l.width*Math.abs(Math.cos(s*Math.PI/180))+l.height*Math.abs(Math.sin(s*Math.PI/180))),f=new Point(r.x,r.y),d=new Point(r.x,r.y);this.labelAlign||(n=90==s||-90==s?1:o?s>0?0:2:s>0?2:0);if(o){r.y+=_+u;f.y+=_+u-.5*l.height}else{r.y-=_+u-l.height;f.y-=_+u-.5*l.height}var g=0;if(2===n){f.x-=p;r.x-=c+p;g=f.x+p-l.height-2}else if(0===n){f.x+=p;r.x-=c-p;g=f.x-p}else{r.x-=c;g=f.x-l.height/2}var m=new Rect(g,d.y,l.height+2,l.width),x=this._rects;if(this.overlappingLabels==OverlappingLabels.Auto)for(var y=x.length,b=0;b<y;b++)if(FlexChartCore._intersects(x[b],m))return!1;FlexChartCore._renderRotatedText(t,i,r,0,2,f,s,a,this._groupClass);this._rects.push(m);return!0}return!1};Axis.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};Axis.prototype._addMinMaxLabels=function(t,e){if(this.labelMin){var i=this.actualMin;if(isFinite(i)&&!t.includes(i)){e.splice(0,0,this._formatValue(i));t.splice(0,0,i)}}if(this.labelMax){var r=this.actualMax;if(isFinite(r)&&!t.includes(r)){e.splice(0,0,this._formatValue(r));t.splice(0,0,r)}}};Axis.prototype.convert=function(t,e,i){var r=null==e?this._actualMax:e,n=null==i?this._actualMin:i;if(r==n||!this._axrect)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,n,r);return this.axisType==AxisType.Y?o+l*h:s+l*a}if(this._getLogBase()){if(t<=0)return NaN;var _=Math.log(r/n);return this._reversed?this.axisType==AxisType.Y?o+Math.log(t/n)/_*h:s+a-Math.log(t/n)/_*a:this.axisType==AxisType.Y?o+h-Math.log(t/n)/_*h:s+Math.log(t/n)/_*a}return this._reversed?this.axisType==AxisType.Y?o+(t-n)/(r-n)*h:s+a-(t-n)/(r-n)*a:this.axisType==AxisType.Y?o+h-(t-n)/(r-n)*h:s+(t-n)/(r-n)*a};Axis.prototype.convertBack=function(t){if(this._actualMax==this._actualMin)return 0;var e=this._plotrect.left,i=this._plotrect.width,r=this._plotrect.top,n=this._plotrect.height,s=this._getActualRange(),a=this._getLogBase();if(null!=this._customConvertBack)return this.axisType==AxisType.Y?this._customConvertBack((t-r)/n,this._actualMin,this._actualMax):this._customConvertBack((t-e)/i,this._actualMin,this._actualMax);if(a){var o=0;o=this._reversed?this.axisType==AxisType.Y?(t-r)/n:1-(t-e)/i:this.axisType==AxisType.Y?1-(t-r)/n:(t-e)/i;return Math.pow(a,(Math.log(this._actualMin)+(Math.log(this._actualMax)-Math.log(this._actualMin))*o)/Math.log(a))}return this._reversed?this.axisType==AxisType.Y?this._actualMin+(t-r)*s/n:this._actualMin+(e+i-t)*s/i:this.axisType==AxisType.Y?this._actualMax-(t-r)*s/n:this._actualMin+(t-e)*s/i};Object.defineProperty(Axis.prototype,"axisType",{get:function(){var t=this._chart;if(t){if(t.axisX==this)return AxisType.X;if(t.axisY==this)return AxisType.Y}return this._axisType},enumerable:!0,configurable:!0});Axis.prototype._getMinNum=function(){return this._actualMin};Axis.prototype._getMaxNum=function(){return this._actualMax};Axis.prototype._getTitleSize=function(){return this._szTitle?this._szTitle:new Size};Axis.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};Axis.prototype._cvCollectionChanged=function(t,e){this._invalidate()};Axis.prototype._createLabels=function(t,e,i,r,n){for(var s=0;s<e;s++){var a=(t+i*s).toFixed(14),o=parseFloat(a),h=this._formatAxisValue(o),l=n.indexOf(h);if(l>=0&&!isNumber(this.majorUnit)&&!this._format){var _=parseFloat(h);Math.abs(_-o)<Math.abs(_-r[l])&&(r[l]=o)}else{r.push(o);n.push(h)}}};Axis.prototype._createLogarithmicLabels=function(t,e,i,r,n,s){var a=this._getLogBase(),o=Math.log(a),h=Math.floor(Math.log(t)/o),l=Math.ceil(Math.log(e)/o),_=a,u=!0;if(i>0){u=!1;_=i}_<a&&(_=a);var c=(l-h+1)*a/_,p=1;if(s){var f=this._getPosition(),d=this._getAnnoNumber(f==Position.Left||f==Position.Right);c>d?p=Math.floor(c/d+1):u&&(c<=.2*d?_=.2*a:c<=.1*d&&(_=.1*a))}for(var g=h;g<=l;g+=p)if(u)for(var m=Math.pow(a,g),x=0;x*_<a-1;x++){if((y=m*(1+x*_))>=t&&y<=e)if(0==x){r.unshift(y);n&&n.unshift(this._formatValue(y))}else if(!this.minorGrid&&this.minorTickMarks==TickMark.None){r.push(y);n&&n.push(this._formatValue(y))}}else{var y;if((y=Math.pow(_,g))>=t&&y<=e){r.push(y);n&&n.push(this._formatValue(y))}}};Axis.prototype._createTimeLabels=function(t,e,i,r){var n=this._actualMin,s=this._actualMax,a=new Date(n),o=new Date(s),h=this._format,l=this._getAnnoNumber(this._axisType==AxisType.Y);l>10&&(l=10);var _=.001*(this._actualMax-this._actualMin)/l,u=new _timeSpan(_*_timeSpan.TicksPerSecond),c=isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(u,h);h||(this._tfmt=h=_timeHelper.GetTimeDefaultFormat(1e3*c.TotalSeconds,0));var p=c.Ticks,f=_timeHelper.RoundTime(n,c.TotalDays,!1);isFinite(f)&&(n=f);var d=_timeHelper.RoundTime(s,c.TotalDays,!0);isFinite(d)&&(s=d);var g=new Date(n);new Date(s);if(c.TotalDays>=365&&!isNumber(this._majorUnit)){(g=new Date(a.getFullYear(),0,1))<a&&g.setFullYear(g.getFullYear()+1);var m=c.TotalDays/365;m-=m%1;for(var x=g;x<=o&&m;x.setFullYear(x.getFullYear()+m)){var y=x.valueOf();i.push(y);r.push(this._formatValue(y))}}else if(c.TotalDays>=30&&!isNumber(this._majorUnit)){(g=new Date(a.getFullYear(),a.getMonth(),1))<a&&g.setMonth(g.getMonth()+1);var b=c.TotalDays/30;b-=b%1;for(x=g;x<=o;x.setMonth(x.getMonth()+b)){y=x.valueOf();i.push(y);r.push(this._formatValue(y))}}else{var v=1e3*p/_timeSpan.TicksPerSecond,S=(x=g,a.getTime()-x.getTime());S>v&&(x=new Date(x.getTime()+Math.floor(S/v)*v));for(;x<=o&&v;x=new Date(x.getTime()+v)){y=x.valueOf();i.push(y);r.push(this._formatValue(y))}}};Axis.prototype._formatValue=function(t){if(this._isTimeAxis)return this._format?Globalize.format(new Date(t),this._format):Globalize.format(new Date(t),this._tfmt);if(this._format)return Globalize.format(t,this._format);var e=t==Math.round(t)?"n0":"n";return Globalize.format(t,e)};Axis.prototype._hitTest=function(t){return this._groupsPanel?this._groupsPanel.hitTest(t):void 0};Axis.prototype._formatAxisValue=function(t,e){void 0===e&&(e=void 0);if(this._isTimeAxis)return this._format?Globalize.format(new Date(t),this._format):Globalize.format(new Date(t),this._tfmt);if(this._format)return Globalize.format(t,this._format);if(isNumber(t)){var i=this._findFormat(t,e);return Globalize.format(t,i)}return t};Axis.prototype._findFormat=function(t,e){void 0===e&&(e=void 0);var i=t==Math.round(t)?"n0":"n";void 0!==e&&(i+=e.toString());if("n"==i){var r=t.toFixed(14),n=r.search(".");if(n>=0){e=1;for(var s=r.length-1;s>=n;s--)if("0"!=r[s]){e=s-n-1;break}i+=e.toString()}}return i};Axis.prototype._calcMajorUnit=function(){var t=this._majorUnit;if(!isNumber(t)){var e=this._getActualRange(),i=this._nicePrecision(e),r=e/this._getAnnoNumber(this.axisType==AxisType.Y);(t=this._niceNumber(2*r,-i,!0))<r&&(t=this._niceNumber(r,1-i,!1));t<r&&(t=this._niceTickNumber(r))>r&&(t*=.5)}return t};Axis.prototype._getAnnoNumber=function(t){var e=t?this._annoSizeBase&&this._annoSizeBase.height:this._annoSize&&this._annoSize.width,i=t?this._axrect&&this._axrect.height:this._axrect&&this._axrect.width;if(e>0&&i>0){var r=Math.floor(i/(e+6));r<=0&&(r=1);return r}return 10};Axis.prototype._nicePrecision=function(t){if(!isNumber(t)||t<=0)return 0;var e,i=Math.log(t)/Math.LN10;e=i>=0?Math.floor(i):Math.ceil(i);var r=t/Math.pow(10,e);if(r<3){e=1-e;(r=t/Math.pow(10,e))<3&&(e+=1)}return e};Axis.prototype._niceTickNumber=function(t){if(0==t)return t;t<0&&(t=-t);var e=Math.log(t)/Math.LN10,i=Math.floor(e),r=t/Math.pow(10,i),n=10;r<=1?n=1:r<=2?n=2:r<=5&&(n=5);return n*Math.pow(10,i)};Axis.prototype._niceNumber=function(t,e,i){if(0==t)return t;t<0&&(t=-t);var r=t/Math.pow(10,e),n=10;i?r<1.5?n=1:r<3?n=2:r<4.5?n=4:r<7&&(n=5):r<=1?n=1:r<=2?n=2:r<=5&&(n=5);return n*Math.pow(10,e)};Object.defineProperty(Axis.prototype,"_uniqueId",{get:function(){return this.__uniqueId},enumerable:!0,configurable:!0});Axis.MAX_MAJOR=1e3;Axis.MAX_MINOR=2e3;Axis._id=0;return Axis}();export{Axis};var _tmInc,AxisCollection=function(t){__extends(AxisCollection,t);function AxisCollection(){return null!==t&&t.apply(this,arguments)||this}AxisCollection.prototype.getAxis=function(t){var e=this.indexOf(t);return e>-1?this[e]:null};AxisCollection.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1};return AxisCollection}(ObservableArray);export{AxisCollection};!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"}(_tmInc||(_tmInc={}));var _timeSpan=function(){function _timeSpan(t){this.ticks=t}Object.defineProperty(_timeSpan.prototype,"Ticks",{get:function(){return this.ticks},enumerable:!0,configurable:!0});Object.defineProperty(_timeSpan.prototype,"TotalSeconds",{get:function(){return this.ticks/1e7},enumerable:!0,configurable:!0});Object.defineProperty(_timeSpan.prototype,"TotalDays",{get:function(){return this.ticks/1e7/86400},enumerable:!0,configurable:!0});_timeSpan.fromSeconds=function(t){return new _timeSpan(1e7*t)};_timeSpan.fromDays=function(t){return new _timeSpan(1e7*t*24*60*60)};_timeSpan.TicksPerSecond=1e7;return _timeSpan}(),_timeHelper=function(){function _timeHelper(t){isDate(t)?this.init(t):isNumber(t)&&this.init(FlexChartCore._fromOADate(t))}_timeHelper.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()};_timeHelper.prototype.getTimeAsDateTime=function(){if(this.hour>=24){this.hour-=24;this.day+=1}if(this.month<0){-1-this.day;this.month=1}else if(this.month>11){this.month-12;this.month=11}if(this.day<1){-1-this.day;this.day=1}else if(this.day>28&&1==this.month){this.day-28;this.day=28}else if(this.day>30&&(3==this.month||5==this.month||8==this.month||10==this.month)){this.day-30;this.day=30}else if(this.day>31){this.day-31;this.day=31}if(this.second>59){this.second-59;this.second=59}if(this.minute>59){this.minute-59;this.minute=59}return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second)};_timeHelper.prototype.getTimeAsDouble=function(){return this.getTimeAsDateTime().valueOf()};_timeHelper.tround=function(t,e,i){var r=t/e*e;r-=r%1;i&&r!=t&&(r+=e-=e%1);return r};_timeHelper.FloorDay=function(t){var e=new Date(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()};_timeHelper.CeilDay=function(t){var e=new Date(t),i=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return i<t?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1).valueOf():i};_timeHelper.RoundTime=function(t,e,i){var r=24*e*60*60;if(r>0){var n=new _timeHelper(t);if(r<_tmInc.minute){n.second=_timeHelper.tround(n.second,r,i);return n.getTimeAsDouble()}n.second=0;if(r<_tmInc.hour){r/=_tmInc.minute;n.minute=_timeHelper.tround(n.minute,r,i);return n.getTimeAsDouble()}n.minute=0;if(r<_tmInc.day){r/=_tmInc.hour;n.hour=_timeHelper.tround(n.hour,r,i);return n.getTimeAsDouble()}n.hour=0;if(r<_tmInc.month){r/=_tmInc.day;n.day=_timeHelper.tround(n.day,r,i);return n.getTimeAsDouble()}n.day=1;if(r<_tmInc.year){r/=_tmInc.month;1!=n.month&&(n.month=_timeHelper.tround(n.month,r,i));return n.getTimeAsDouble()}n.month=1;r/=_tmInc.year;n.year=_timeHelper.tround(n.year,r,i);return n.getTimeAsDouble()}var s=t,a=s-r,o=a/e*e;i&&o!=a&&(o+=e);return s=r+o};_timeHelper.TimeSpanFromTmInc=function(t){var e=_timeSpan.fromSeconds(1);if(t!=_tmInc.maxtime)if(t>_tmInc.tickf1)e=_timeSpan.fromSeconds(t);else{var i=t,r=1;i+=7;for(;i>0;){r*=10;i--}e=new _timeSpan(r)}return e};_timeHelper.manualTimeInc=function(t){var e=_tmInc.second;if(null==t||0==t.length)return e;var i=t.indexOf("f");if(i>=0){var r=-1;if(i>0&&"%"==t.substr(i-1,1))r=-1;else for(var n=1;n<6&&!(i+n>=t.length);n++){if("f"!=t.substr(i+n,1))break;r--}e=r}else t.indexOf("s")>=0?e=_tmInc.second:t.indexOf("m")>=0?e=_tmInc.minute:t.indexOf("h")>=0||t.indexOf("H")?e=_tmInc.hour:t.indexOf("d")>=0?e=_tmInc.day:t.indexOf("M")>=0?e=_tmInc.month:t.indexOf("y")>=0&&(e=_tmInc.year);return e};_timeHelper.getNiceInc=function(t,e,i){for(var r=0;r<t.length;r++){var n=t[r]*i;if(e<=n)return n}return 0};_timeHelper.NiceTimeSpan=function(t,e){var i=_tmInc.second;null!=e&&e.length>0&&(i=_timeHelper.manualTimeInc(e));var r=0,n=0;if(i<_tmInc.second&&t.TotalSeconds<10){r=t.Ticks;n=_timeHelper.TimeSpanFromTmInc(i).Ticks;for(;r>10*n;)n*=10;var s=n;r>s&&(s*=2);r>s&&(s=5*n);r>s&&(s=10*n);return new _timeSpan(s)}if(0==(r=Math.ceil(t.TotalSeconds)))return _timeHelper.TimeSpanFromTmInc(i);n=1;if(i<_tmInc.minute){if(r<_tmInc.minute&&0!=(n=_timeHelper.getNiceInc([1,2,5,10,15,30],r,i)))return _timeSpan.fromSeconds(n);i=_tmInc.minute}if(i<_tmInc.hour){if(r<_tmInc.hour&&0!=(n=_timeHelper.getNiceInc([1,2,5,10,15,30],r,i)))return _timeSpan.fromSeconds(n);i=_tmInc.hour}if(i<_tmInc.day){if(r<_tmInc.day&&0!=(n=_timeHelper.getNiceInc([1,3,6,12],r,i)))return _timeSpan.fromSeconds(n);i=_tmInc.day}if(i<_tmInc.month){if(r<_tmInc.month&&0!=(n=_timeHelper.getNiceInc([1,2,7,14],r,i)))return _timeSpan.fromSeconds(n);i=_tmInc.month}if(i<_tmInc.year){if(r<_tmInc.year&&0!=(n=_timeHelper.getNiceInc([1,2,3,4,6],r,i)))return _timeSpan.fromSeconds(n);i=_tmInc.year}r<(n=100*_tmInc.year)&&0==(n=_timeHelper.getNiceInc([1,2,5,10,20,50],r,i))&&(n=100*_tmInc.year);return _timeSpan.fromSeconds(n)};_timeHelper.NiceTimeUnit=function(t,e){var i=_timeSpan.fromDays(t);return(i=_timeHelper.NiceTimeSpan(i,e)).TotalDays};_timeHelper.GetTimeDefaultFormat=function(t,e){if(!isNumber(t)||!isNumber(e))return"";var i="s",r=_timeSpan.fromSeconds(.001*(t-e)),n=r.TotalSeconds;if(n>=_tmInc.year)i="yyyy";else if(n>=_tmInc.month)i="MMM yyyy";else if(n>=_tmInc.day)i="MMM d";else if(n>=_tmInc.hour)i="ddd H:mm";else if(n>=.5*_tmInc.hour)i="H:mm";else if(n>=1)i="H:mm:ss";else if(n>0){var s=r.Ticks;i="s.";for(;s<_timeSpan.TicksPerSecond;){s*=10;i+="f"}}return i};return _timeHelper}(),_AxisLabel=function(){function _AxisLabel(t,e,i){this._start=e-.5;this._end=e+i-.5;this._value=e+.5*(i-1);this._label=t}Object.defineProperty(_AxisLabel.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"rect",{get:function(){return this._rect},set:function(t){this._rect=t},enumerable:!0,configurable:!0});return _AxisLabel}();export{_AxisLabel};var _AxisGroup=function(){function _AxisGroup(t,e){this._labels=[];this._index=0;this._size=new Size;this._level=0;this._level=t;this._last=e}Object.defineProperty(_AxisGroup.prototype,"labels",{get:function(){return this._labels},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"index",{get:function(){return this._index},set:function(t){this._index=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"height",{get:function(){return this._size.height},set:function(t){this._size.height=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"width",{get:function(){return this._size.width},set:function(t){this._size.width=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0});_AxisGroup.prototype.getSize=function(t,e,i){var r=this;this._size=new Size;this.labels.forEach((function(n){var s=t.measureString(n.label,e,i);r._size.width=Math.max(r._size.width,s.width);r._size.height=Math.max(r._size.height,s.height)}));return this._size};_AxisGroup.prototype.render=function(t,e,i,r,n){var s=this,a=e._getPosition(),o=e.axisType===AxisType.X;this.labels.forEach((function(h){var l,_=h.label,u=!1,c=o?Math.abs(e.convert(h.end)-e.convert(h.start)):s.width,p=t.measureString(_,r,n);if(p.width>c){_=s._trimText(_,p.width,c);u=!0}switch(a){case Position.Bottom:l=FlexChartCore._renderText(t,_,new Point(e.convert(h.value),i),1,2,r,n);break;case Position.Top:l=FlexChartCore._renderText(t,_,new Point(e.convert(h.value),i),1,0,r,n);break;case Position.Left:l=FlexChartCore._renderText(t,_,new Point(i+s._size.width,e.convert(h.value)),2,1,r,n);break;case Position.Right:l=FlexChartCore._renderText(t,_,new Point(i-s._size.width,e.convert(h.value)),0,1,r,n)}h.rect=u?l:void 0}));a===Position.Bottom||a===Position.Top?this.renderLinesX(t,e,i):this.renderLinesY(t,e,i)};_AxisGroup.prototype.hitTest=function(t){for(var e,i=0;i<this.labels.length;i++){var r=this.labels[i];if(r.rect&&r.rect.contains(t)){e=r;break}}return e};_AxisGroup.prototype.renderLinesX=function(t,e,i){var r=this,n=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,s=e._getPosition(),a=4,o=s===Position.Bottom?1:-1,h=i-o*(this.height+a);a*=o;if(n){var l=e.convert(e.actualMin),_=e.convert(e.actualMax);this.drawLine(t,l,i+a,_,i+a);this.drawLine(t,l,h,_,h);var u=e.convert(this.labels[0].start),c=0===this.level?1===o?e._axrect.top:e._axrect.bottom:h;this.drawLine(t,u,i+a,u,c);this.labels.forEach((function(n){var s=new Point(e.convert(n.end),i);r._last?r.drawLine(t,s.x,s.y+a,s.x,1===o?e._axrect.top:e._axrect.bottom):r.drawLine(t,s.x,s.y+a,s.x,c)}))}else this.labels.forEach((function(i){var n=e.convert(i.start)+Math.abs(a),s=e.convert(i.end)-Math.abs(a);r.drawLine(t,n,h,s,h);if(e.labels||!r._last){r.drawLine(t,n,h,n,h-2*a);r.drawLine(t,s,h,s,h-2*a)}var o=e.convert(i.value);r.drawLine(t,o,h,o,h+a)}))};_AxisGroup.prototype.renderLinesY=function(t,e,i){var r=this,n=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,s=e._getPosition(),a=4,o=s===Position.Left?-1:1,h=i-o*(this.width+a);a*=o;if(n){var l=e.convert(e.actualMin),_=e.convert(e.actualMax);this.drawLine(t,i+a,l,i+a,_);this.drawLine(t,h,l,h,_);var u=e.convert(this.labels[0].start),c=0===this.level?1===o?e._axrect.left:e._axrect.right:h;this.drawLine(t,i+a,u,c,u);this.labels.forEach((function(n){var s=e.convert(n.end);r._last?r.drawLine(t,i+a,s,1===o?e._axrect.left:e._axrect.right,s):r.drawLine(t,i+a,s,c,s)}))}else this.labels.forEach((function(i){var n=e.convert(i.start)-Math.abs(a),s=e.convert(i.end)+Math.abs(a);r.drawLine(t,h,n,h,s);r.drawLine(t,h,n,h-2*a,n);r.drawLine(t,h,s,h-2*a,s);var o=e.convert(i.value);r.drawLine(t,h,o,h+a,o)}))};_AxisGroup.prototype.drawLine=function(t,e,i,r,n){t.drawLine(e,i,r,n,FlexChartCore._CSS_LINE)};_AxisGroup.prototype._trimText=function(t,e,i){var r="",n=t.length,s=Math.floor((1-(e-i)/e)*n);t.length>0&&(r=t[0]+(s>1?t.substring(1,s-1)+"..":""));return r};return _AxisGroup}(),_AxisGroups=function(){function _AxisGroups(t){this._groups=[];this._margin=8;this._axis=t}Object.defineProperty(_AxisGroups.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroups.prototype,"axis",{get:function(){return this._axis},enumerable:!0,configurable:!0});_AxisGroups.prototype.createGroups=function(){var t=this;this._groups=[];var e=this.axis._chart.collectionView;e&&e.groups&&e.groups.length>0&&e.groups.forEach((function(e){t.createGroup(e,0)}))};_AxisGroups.prototype.createGroup=function(t,e){var i=this;this.groups[e]||(this.groups[e]=new _AxisGroup(e,t.isBottomLevel));var r=this.groups[e],n=t.items;r.labels.push(new _AxisLabel(t.name,r.index,n.length));r.index+=n.length;t.groups.forEach((function(t){i.createGroup(t,e+1)}))};_AxisGroups.prototype.layoutGroups=function(t){this.groups.forEach((function(e){e.width*=t}))};_AxisGroups.prototype.getHeight=function(t){var e=this,i=this._axis._getPosition(),r=0;i===Position.Bottom||i===Position.Top?this.groups.forEach((function(i){var n=i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass);r+=e._margin+n.height})):this.groups.forEach((function(i){var n=i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass);r+=e._margin+n.width}));if(r>0&&this._axis.labels){var n=this.groups.length;r+=this._margin*n}this._height=r;return r};_AxisGroups.prototype.layout=function(){var t=this._axis,e=t._axrect;if(t.axisType===AxisType.Y){var i=(t.labels?t._annoSize.width+t._TICK_LABEL_DISTANCE+12:4)+t._getTitleSize().height,r=e.width-i;if(r<this._height){var n=this._margin*this._groups.length;this.layoutGroups((r-n)/(this._height-n));this._height=r}}};_AxisGroups.prototype.render=function(t){var e=this,i=this._axis._getPosition(),r=this._axis._getTitleSize();if(i===Position.Bottom){var n=this.axis._axrect.bottom-r.height-this._margin;this.groups.forEach((function(i){i.render(t,e.axis,n,FlexChartCore._CSS_LABEL,e._axis._groupClass);n-=i.height+e._margin}))}else if(i===Position.Top){var s=this.axis._axrect.top+r.height+this._margin;this.groups.forEach((function(i){i.render(t,e.axis,s,FlexChartCore._CSS_LABEL,e._axis._groupClass);s+=i.height+e._margin}))}else if(i===Position.Left){var a=this.axis._axrect.left+r.height+this._margin;this.groups.forEach((function(i){i.render(t,e.axis,a,FlexChartCore._CSS_LABEL,e._axis._groupClass);a+=i.width+e._margin}))}else if(i===Position.Right){var o=this.axis._axrect.right-r.height-this._margin;this.groups.forEach((function(i){i.render(t,e.axis,o,FlexChartCore._CSS_LABEL,e._axis._groupClass);o-=i.width+e._margin}))}};_AxisGroups.prototype.hitTest=function(t){for(var e,i=0;i<this._groups.length;i++){var r=this._groups[i].hitTest(t);if(r){e=r;break}}return e};return _AxisGroups}();export{_AxisGroups};var _AreaPlotter=function(t){__extends(_AreaPlotter,t);function _AreaPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.stacking=Stacking.None;e.isSpline=!1;e.isStep=!1;e.stackPos={};e.stackNeg={};return e}_AreaPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;for(var i=t.getMinX(),r=t.getMinY(),n=t.getMaxX(),s=t.getMaxY(),a=0;a<this.chart.series.length;a++){var o=this.chart.series[a];if(this._isRange(o)){var h=o._getChartType();if(!h||h==ChartType.Area)for(var l=o._getBindingValues(1),_=0;_<l.length;_++)l[_]>s?s=l[_]:l[_]<r&&(r=l[_])}}if(this.isSpline){var u=.1*(s-r);this.chart.axisY._getLogBase()||(r-=u);s+=u}return this.rotated?new Rect(r,i,s-r,n-i):new Rect(i,r,n-i,s-r)};_AreaPlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNeg={};this.stackPos={}};_AreaPlotter.prototype.plotSeries=function(t,e,i,r,n,s,a,o){var h=r;if(this._isRange(h))this.plotSeriesRanged(t,e,i,r,n,s,a,o);else{var l=[],_=this.chart.series.indexOf(r),u=r.getValues(0),c=r.getValues(1);if(u){var p=u.length;if(p){c||(c=this.dataInfo.getXVals());var f=!0;if(c)c.length<p&&(p=c.length);else{f=!1;c=new Array(p)}var d=[],g=[],m=[],x=[],y=this.stacking!=Stacking.None&&!h._isCustomAxisY(),b=this.stacking==Stacking.Stacked100pc&&!h._isCustomAxisY();void 0!==h._getChartType()&&(y=b=!1);for(var v=this.rotated,S=!1,C=h.interpolateNulls,P=null,w=null,A=this.chart._plotRect,M=0;M<p;M++){var T=f?c[M]:M,L=u[M];(null===P||T>P)&&(P=T);(null===w||T<w)&&(w=T);y&&(null==L||Number.isNaN(L))&&Number.isFinite(T)&&(L=0);if(_DataInfo.isValid(T,L)){var E=v?i.convert(T):e.convert(T);if(y){if(b){var F=this.dataInfo.getStackedAbsSum(T);L=F>0?L/F:0}var k=0;if(L>=0){k=isNaN(this.stackPos[T])?0:this.stackPos[T];L=this.stackPos[T]=k+L}else{k=isNaN(this.stackNeg[T])?0:this.stackNeg[T];L=this.stackNeg[T]=k+L}if(v){k<e.actualMin&&(k=e.actualMin);m.push(e.convert(k));x.push(E)}else{m.push(E);k<i.actualMin&&(k=i.actualMin);x.push(i.convert(k))}}if(v){var N=e.convert(L);if(isNaN(E)||isNaN(N)){S=!0;if(!y&&!0!==C){d.push(void 0);g.push(void 0)}}else{d.push(N);g.push(E);if(FlexChartCore._contains(A,new Point(N,E))){(I=new _CircleArea(new Point(N,E),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(_,M,L,T);this.hitTester.add(I,_)}}}else{N=i.convert(L);if(isNaN(E)||isNaN(N)){S=!0;if(!y&&!0!==C){d.push(void 0);g.push(void 0)}}else{d.push(E);g.push(N);if(FlexChartCore._contains(A,new Point(E,N))){var I;(I=new _CircleArea(new Point(E,N),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(_,M,T,L);this.hitTester.add(I,_)}}}}else{S=!0;if(!y&&!0!==C){d.push(void 0);g.push(void 0)}}}o&&d.forEach((function(t,e){null!=t&&l.push(new Point(t,g[e]))}));var R=this._DEFAULT_WIDTH,D=n._getColorLight(_),B=n._getColor(_),O=_BasePlotter.cloneStyle(r.style,["fill"]),V=_BasePlotter.cloneStyle(r.style,["stroke"]);if(!y&&!0!==C&&S){var H=[],j=[];for(M=0;M<p;M++)if(void 0===d[M]){if(H.length>1){H=(z=this._modifyPoints(H,j)).x;j=z.y;t.stroke=B;t.strokeWidth=R;t.fill="none";t.drawLines(H,j,null,O);this.hitTester.add(new _LinesArea(H,j),_);if(v){H.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{H.push(H[H.length-1],H[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=D;t.stroke="none";t.drawPolygon(H,j,null,V,this.chart._plotrectId)}H=[];j=[]}else{H.push(d[M]);j.push(g[M])}if(H.length>1){H=(z=this._modifyPoints(H,j)).x;j=z.y;t.stroke=B;t.strokeWidth=R;t.fill="none";t.drawLines(H,j,null,O);this.hitTester.add(new _LinesArea(H,j),_);if(v){H.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{H.push(H[H.length-1],H[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=D;t.stroke="none";t.drawPolygon(H,j,null,V,this.chart._plotrectId)}}else{var z;d=(z=this._modifyPoints(d,g)).x;g=z.y;if(y){var G=this._modifyPoints(m,x);m=G.x;x=G.y;d=d.concat(m.reverse());g=g.concat(x.reverse())}else if(v){d.push(e.convert(e.actualMin),e.convert(e.actualMin));g.push(g[g.length-1],g[0])}else{d.push(d[d.length-1],d[0]);g.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=D;t.stroke="none";t.drawPolygon(d,g,null,V,this.chart._plotrectId);if(y){d=d.slice(0,d.length-m.length);g=g.slice(0,g.length-x.length)}else{d=d.slice(0,d.length-2);g=g.slice(0,g.length-2)}t.stroke=B;t.strokeWidth=R;t.fill="none";t.drawLines(d,g,null,O,this.chart._plotrectId);this.hitTester.add(new _LinesArea(d,g),_)}this._drawSymbols(t,r,_);o&&l&&l.length&&o(l)}}}};_AreaPlotter.prototype._isRange=function(t){var e=this.chart?this.chart._bindingSeparator:",",i=null==t.binding?null:t.binding.split(e);return null!=i&&2==i.length};_AreaPlotter.prototype._modifyPoints=function(t,e){var i={x:t,y:e};if(this.isSpline){var r=this._convertToSpline(t,e);i.x=r.xs;i.y=r.ys}else if(this.isStep){var n=this._createSteps(t,e);i.x=n.x;i.y=n.y}return i};_AreaPlotter.prototype.plotSeriesRanged=function(t,e,i,r,n,s,a,o){var h=[],l=this.chart.series.indexOf(r),_=r,u=r.getValues(0),c=r.getValues(1),p=_._getBindingValues(1);if(u){var f=u.length;if(f){c||(c=this.dataInfo.getXVals());var d=!0;if(c)c.length<f&&(f=c.length);else{d=!1;c=new Array(f)}for(var g=[],m=[],x=[],y=this.rotated,b=!1,v=_.interpolateNulls,S=this.chart._plotRect,C=0;C<f;C++){var P=d?c[C]:C,w=u[C],A=p[C];if(_DataInfo.isValid(P,w,A)){var M=y?i.convert(P):e.convert(P);if(y){var T=e.convert(w),L=e.convert(A);if(isNaN(M)||isNaN(T)){b=!0;if(!0!==v){g.push(void 0);m.push(void 0);x.push(void 0)}}else{g.push(T);m.push(M);x.push(L);if(FlexChartCore._contains(S,new Point(T,M))){(E=new _CircleArea(new Point(T,M),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(l,C,w,P);this.hitTester.add(E,l)}if(FlexChartCore._contains(S,new Point(L,M))){(E=new _CircleArea(new Point(L,M),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(l,C,A,P);this.hitTester.add(E,l)}}}else{T=i.convert(w),L=i.convert(A);if(isNaN(M)||isNaN(T)){b=!0;if(!0!==v){g.push(void 0);m.push(void 0);x.push(void 0)}}else{g.push(M);m.push(T);x.push(L);if(FlexChartCore._contains(S,new Point(M,T))){(E=new _CircleArea(new Point(M,T),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(l,C,P,w);this.hitTester.add(E,l)}if(FlexChartCore._contains(S,new Point(M,L))){var E;(E=new _CircleArea(new Point(M,L),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(l,C,P,A);this.hitTester.add(E,l)}}}}else{b=!0;if(!0!==v){g.push(void 0);m.push(void 0);x.push(void 0)}}}o&&g.forEach((function(t,e){null!=t&&h.push(new Point(t,m[e]))}));var F=this._DEFAULT_WIDTH,k=n._getColorLight(l),N=n._getColor(l),I=_BasePlotter.cloneStyle(r.style,["fill"]),R=_BasePlotter.cloneStyle(r.style,["stroke"]);if(!0!==v&&b){var D=[],B=[],O=[];for(C=0;C<f;C++)if(void 0===g[C]){if(D.length>1){var V=y?O.slice(0).reverse():D.slice(0).reverse(),H=y?B.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,D,B,V,H,k,N,F,R,I);this.hitTester.add(new _LinesArea(D,B),l);this.hitTester.add(new _LinesArea(V,H),l)}D=[];B=[];O=[]}else{D.push(g[C]);B.push(m[C]);O.push(x[C])}if(D.length>1){V=y?O.slice(0).reverse():D.slice(0).reverse(),H=y?B.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,D,B,V,H,k,N,F,R,I);this.hitTester.add(new _LinesArea(D,B),l);this.hitTester.add(new _LinesArea(V,H),l)}}else{var j=y?x.slice(0).reverse():g.slice(0).reverse(),z=y?m.slice(0).reverse():x.slice(0).reverse();this._drawRangedArea(t,g,m,j,z,k,N,F,R,I);this.hitTester.add(new _LinesArea(g,m),l);this.hitTester.add(new _LinesArea(j,z),l)}this._drawSymbols(t,r,l);o&&h&&h.length&&o(h)}}};_AreaPlotter.prototype._drawRangedArea=function(t,e,i,r,n,s,a,o,h,l){if(this.isSpline){var _=this._convertToSpline(e,i),u=this._convertToSpline(r,n);e=_.xs;i=_.ys;r=u.xs;n=u.ys}e=e.concat(r);i=i.concat(n);t.fill=s;t.stroke="none";t.drawPolygon(e,i,null,h);e=e.slice(0,e.length-r.length);i=i.slice(0,i.length-n.length);t.stroke=a;t.strokeWidth=o;t.fill="none";t.drawLines(e,i,null,l);t.drawLines(r,n,null,l)};_AreaPlotter.prototype._convertToSpline=function(t,e){if(t&&e){var i=new _Curve(t,e).calculate();return{xs:i.xs,ys:i.ys}}return{xs:t,ys:e}};_AreaPlotter.prototype._drawSymbols=function(t,e,i){var r=this.getItemFormatter(e);if(null!=r){for(var n=this.hitTester._map[i],s=0;s<n.length;s++){var a=tryCast(n[s],_CircleArea);if(a){var o=a.tag;t.startGroup();var h=new HitTestInfo(this.chart,a.center,ChartElement.SeriesSymbol);h._setDataPoint(o);r(t,h,(function(){}));t.endGroup()}}t.cssPriority=!0}};return _AreaPlotter}(_BasePlotter);export{_AreaPlotter};var _BarPlotter=function(t){__extends(_BarPlotter,t);function _BarPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.origin=0;e.width=.7;e.isVolume=!1;e._volHelper=null;e.stackPosMap={};e.stackNegMap={};e.stacking=Stacking.None;return e}_BarPlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNegMap[this.chart.axisY._uniqueId]={};this.stackPosMap[this.chart.axisY._uniqueId]={};this._volHelper=null};_BarPlotter.prototype.load=function(){t.prototype.load.call(this);if(this.isVolume){var e,i,r,n,s,a,o,h,l=null,_=null;for(a=0;a<this.chart.series.length;a++){s=(e=this.chart.series[a]).getDataType(1)||e.chart._xDataType;i=e._getAxisX();if((r=null===(r=e._getChartType())||isUndefined(r)?this.chart._getChartType():r)===ChartType.Column){var u=this.chart?this.chart._bindingSeparator:",",c=e.binding.split(u).length-1;n=e._getBindingValues(c)}else n=r===ChartType.Candlestick?e._getBindingValues(4):null;if(s===DataType.Date){var p=void 0;o=[];h=[];for(a=0;a<e._getLength();a++){p=e._getItem(a)[e.bindingX].valueOf();o.push(p);h.push({value:p,text:Globalize.format(new Date(p),i.format||"d")})}}else o=this.dataInfo.getXVals();l=this.dataInfo.getMinX();_=this.dataInfo.getMaxX();if(n&&n.length>0){this._volHelper=new _VolumeHelper(n,o,l,_,s);i._customConvert=this._volHelper.convert.bind(this._volHelper);i._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);h&&h.length>0&&(this._itemsSource=i.itemsSource=h);break}}}};_BarPlotter.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)if(e=this.chart.series[i]._getAxisX()){e._customConvert=null;e._customConvertBack=null;e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null)}};_BarPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),r=t.getMaxX(),n=t.getMinY(),s=t.getMaxY(),a=t.getDeltaX();a<=0&&(a=1);var o=!1;!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(var h=0;h<this.chart.series.length;h++){var l=this.chart.series[h],_=l._getChartType();if((_=null===_||isUndefined(_)?this.chart._getChartType():_)===ChartType.Column||_===ChartType.Bar){if(this._isRange(l)){l._getBindingValues(1).forEach((function(t){t<n?n=t:t>s&&(s=t)}))}}o||"BoxWhisker"==l.constructor.name||(o=!0)}if(this.rotated){!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==DataType.Date&&o&&(this.origin>s?s=this.origin:this.origin<n&&(n=this.origin));return new Rect(n,i-.5*a,s-n,r-i+a)}!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==DataType.Date&&o&&(this.origin>s?s=this.origin:this.origin<n&&(n=this.origin));return new Rect(i-.5*a,n,r-i+a,s-n)};_BarPlotter.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};_BarPlotter.prototype.plotSeries=function(t,e,i,r,n,s,a,o){var h,l,_,u,c=[],p=this.chart.series.indexOf(r),f=asType(r,SeriesBase),d=this.chart._options,g=this.width,m=0;s=s||0;a=a||1;if(d&&d.groupWidth){var x=d.groupWidth;if(isNumber(x)){var y=asNumber(x);if(isFinite(y)&&y>0){m=y;g=1}}else if(isString(x)){var b=asString(x);if(b&&b.indexOf("%")>=0){b=b.replace("%","");y=parseFloat(b);if(isFinite(y)){y<0?y=0:y>100&&(y=100);m=0;g=y/100}}else{y=parseFloat(b);if(isFinite(y)&&y>0){m=y;g=1}}}}var v=g/a,S=f._getAxisY()._uniqueId,C=this.stackNegMap[S],P=this.stackPosMap[S],w=r.getValues(0),A=r.getValues(1),M=this._isRange(f),T=f._bindValues(null==f._cv?null==this.chart.collectionView?null:this.chart.collectionView.items:f._cv.items,f._getBinding(1)).values;if(w){A||(A=this.dataInfo.getXVals());if(A){var L=this.dataInfo.getDeltaX();if(L>0){g*=L;v*=L}}var E=f._getSymbolFill(p),F=f._getAltSymbolFill(p)||E,k=f._getSymbolStroke(p),N=f._getAltSymbolStroke(p)||k,I=w.length;null!=A&&(I=Math.min(I,A.length));var R,D,B=this.origin,O=0,V=this.stacking!=Stacking.None,H=this.stacking==Stacking.Stacked100pc;void 0!==f._getChartType()&&(V=H=!1);var j=this.getItemFormatter(r),z=e._actualMin,G=e._actualMax,X=i._actualMin,Y=i._actualMax;if(this.rotated){B<z?B=z:B>G&&(B=G);f._isCustomAxisY()&&(V=H=!1);for(Q=e.convert(B),$=0;$<I;$++){et=A?A[$]:$,it=w[$],tt=Q;this._getSymbolOrigin&&(tt=i.convert(this._getSymbolOrigin(B,$)));if(M&&T&&T.length){rt=T[$];_DataInfo.isValid(rt)&&(tt=e.convert(rt))}if(this._getSymbolStyles){E=(nt=this._getSymbolStyles($))&&nt.fill?nt.fill:E;F=nt&&nt.fill?nt.fill:F;k=nt&&nt.stroke?nt.fill:k;N=nt&&nt.stroke?nt.fill:N}R=it>0?E:F;D=it>0?k:N;t.fill=R;t.stroke=D;if(_DataInfo.isValid(et,it))if(V){var U=et-.5*g,W=et+.5*g;if(U<X&&W<X||U>Y&&W>Y)continue;U=i.convert(Math.max(U,X));W=i.convert(Math.min(W,Y));if(H){it/=this.dataInfo.getStackedAbsSum(et)}ot=0;if(it>=0){ot=isNaN(P[et])?0:P[et];_=e.convert(ot);u=e.convert(ot+it);P[et]=ot+it}else{ot=isNaN(C[et])?0:C[et];_=e.convert(ot);u=e.convert(ot+it);C[et]=ot+it}o&&c.push(new Point(u,i.convert(et)));if(!_DataInfo.isValid(_,u))continue;ht=new Rect(Math.min(_,u),Math.min(U,W),Math.abs(u-_),Math.abs(W-U));if(m>0){(gt=1-m/ht.height)<0&&(gt=0);var q=ht.top+.5*ht.height;ht.top+=(q-ht.top)*gt;ht.height=Math.min(m,ht.height)}_t=new _RectArea(ht);this.drawSymbol(t,ht,r,$,new Point(u,ht.top+.5*ht.height),j);r._setPointIndex($,O);O++;ut=H?Math.min(ot+it,1):ot+it;_t.tag=new _DataPoint(p,$,ut,et);this.hitTester.add(_t,p)}else{var K=et-.5*g+s*v,Z=et-.5*g+(s+1)*v;if(K<X&&Z<X||K>Y&&Z>Y)continue;K=i.convert(Math.max(K,X));Z=i.convert(Math.min(Z,Y));var J=e.convert(it);if(!_DataInfo.isValid(J,K,Z))continue;ht=new Rect(Math.min(J,tt),Math.min(K,Z),Math.abs(tt-J),Math.abs(Z-K));o&&c.push(new Point(J,(K+Z)/2));if(m>0){(gt=1-(dt=m/a)/ht.height)<0&&(gt=0);q=i.convert(et);ht.top+=(q-ht.top)*gt;ht.height=Math.min(dt,ht.height)}_t=new _RectArea(ht);this.drawSymbol(t,ht,r,$,new Point(J,ht.top+.5*ht.height),j);r._setPointIndex($,O);O++;_t.tag=new _DataPoint(p,$,it,et);this.hitTester.add(_t,p)}else o&&c.push(null)}}else{B<X?B=X:B>Y&&(B=Y);var Q=i.convert(B);f._isCustomAxisY()&&(V=H=!1);for(var $=0;$<I;$++){var tt=Q,et=A?A[$]:$,it=w[$];this._getSymbolOrigin&&(tt=i.convert(this._getSymbolOrigin(B,$,I)));if(M&&T&&T.length){var rt=T[$];_DataInfo.isValid(rt)&&(tt=i.convert(rt))}if(this._getSymbolStyles){var nt;E=(nt=this._getSymbolStyles($,I))&&nt.fill?nt.fill:E;F=nt&&nt.fill?nt.fill:F;k=nt&&nt.stroke?nt.stroke:k;N=nt&&nt.stroke?nt.stroke:N}R=it>0?E:F;D=it>0?k:N;t.fill=R;t.stroke=D;t.strokeWidth=null;if(_DataInfo.isValid(et,it))if(V){var st=et-.5*g,at=et+.5*g;if(st<z&&at<z||st>G&&at>G)continue;st=e.convert(st);at=e.convert(at);if(!_DataInfo.isValid(st,at))continue;if(H){it/=this.dataInfo.getStackedAbsSum(et)}var ot=0;if(it>=0){ot=isNaN(P[et])?0:P[et];h=i.convert(Math.max(ot,X));l=i.convert(Math.max(ot+it,X));P[et]=ot+it}else{ot=isNaN(C[et])?0:C[et];h=i.convert(ot);l=i.convert(ot+it);C[et]=ot+it}o&&c.push(new Point(e.convert(et),l));if(!_DataInfo.isValid(h,l))continue;var ht=new Rect(Math.min(st,at),Math.min(h,l),Math.abs(at-st),Math.abs(l-h));if(m>0){(gt=1-m/ht.width)<0&&(gt=0);var lt=ht.left+.5*ht.width;ht.left+=(lt-ht.left)*gt;ht.width=Math.min(m,ht.width)}var _t=new _RectArea(ht);this.drawSymbol(t,ht,r,$,new Point(ht.left+.5*ht.width,l),j);r._setPointIndex($,O);O++;var ut=H?Math.min(ot+it,1):ot+it;_t.tag=new _DataPoint(p,$,et,ut);this.hitTester.add(_t,p)}else{var ct=et-.5*g+s*v,pt=et-.5*g+(s+1)*v;if(ct<z&&pt<z||ct>G&&pt>G)continue;ct=e.convert(ct);pt=e.convert(pt);var ft=i.convert(it);if(!_DataInfo.isValid(ft,ct,pt))continue;var ht=new Rect(Math.min(ct,pt),Math.min(ft,tt),Math.abs(pt-ct),Math.abs(tt-ft));o&&c.push(new Point((ct+pt)/2,ft));if(m>0){var dt,gt;(gt=1-(dt=m/a)/ht.width)<0&&(gt=0);lt=e.convert(et);ht.left+=(lt-ht.left)*gt;ht.width=Math.min(dt,ht.width)}var _t=new _RectArea(ht);this.drawSymbol(t,ht,r,$,new Point(ht.left+.5*ht.width,ft),j);r._setPointIndex($,O);O++;_t.tag=new _DataPoint(p,$,et,it);this.hitTester.add(_t,p)}else o&&c.push(null)}}o&&c&&c.length&&o(c)}};_BarPlotter.prototype.drawSymbol=function(t,e,i,r,n,s){var a=this;if(s){t.startGroup();var o=new HitTestInfo(this.chart,n,ChartElement.SeriesSymbol);o._setData(i,r);s(t,o,(function(){a.drawDefaultSymbol(t,e,i)}));t.cssPriority=!0;t.endGroup()}else this.drawDefaultSymbol(t,e,i)};_BarPlotter.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)};return _BarPlotter}(_BasePlotter);export{_BarPlotter};var _FunnelPlotter=function(t){__extends(_FunnelPlotter,t);function _FunnelPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.stacking=Stacking.None;return e}_FunnelPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),r=t.getMinY(),n=t.getMaxX(),s=t.getMaxY();return new Rect(i,r,n-i,s-r)};_FunnelPlotter.prototype.plotSeries=function(t,e,i,r,n,s,a,o){var h=this.chart.series.indexOf(r);if(!(h>0)){var l,_,u,c,p,f=asType(r,SeriesBase),d=this.chart._options,g=r.getValues(0),m=r.getValues(1),x=this.chart._plotRect,y=d&&d.funnel&&null!=d.funnel.neckWidth?d.funnel.neckWidth:.2,b=d&&d.funnel&&null!=d.funnel.neckHeight?d.funnel.neckHeight:0,v=y*x.width,S=0,C=0,P=0,w=0,A=x.left,M=x.top,T=x.width,L=x.height;if(g){this.rotated&&(M+=x.height);v=v||1;m||(m=this.dataInfo.getXVals());var E=g.length;null!=m&&(E=Math.min(E,m.length));var F=0;for(S=0;S<E;S++)if(_DataInfo.isValid(g[S])){C+=g[S];g[S]>F&&(F=g[S])}var k,N,I,R=0;if(d&&d.funnel&&"rectangle"===d.funnel.type&&F>0){b=L/E;y=T;var D=T/F;for(S=0;S<E;S++){var B=m?m[S]:S,O=g[S],V=f._getSymbolFill(S),H=f._getAltSymbolFill(S)||V,j=f._getSymbolStroke(S),z=f._getAltSymbolStroke(S)||j;if(this._getSymbolStyles){V=(U=this._getSymbolStyles(S,E))&&U.fill?U.fill:V;H=U&&U.fill?U.fill:H;j=U&&U.stroke?U.stroke:j;z=U&&U.stroke?U.stroke:z}k=O>0?V:H;N=O>0?j:z;t.fill=k;t.stroke=N;if(_DataInfo.isValid(B)&&_DataInfo.isValid(O)){D||(D=T/O);var G=D*O;A+=(y-G)/2;this.rotated&&(M-=b);t.drawRect(A,M,G,b);I=new _FunnelSegment(new Point(A,M),G,b,G,b);this.rotated||(M+=b);y=G;I.tag=new _DataPoint(h,S,B,O);this.hitTester.add(I,h);r._setPointIndex(S,R);R++}}}else{P=x.left+x.width*(1-y)/2;w=x.top+x.height*(this.rotated?b:1-b);_=(1-y)*x.width/2/(x.height*(1-b));if(isNaN(_)||!isFinite(_)){T=v;A=P;M=w}l=x.width*y*x.height+x.width*(1-y)/2*x.height*(1-b);for(S=0;S<E;S++){B=m?m[S]:S,O=g[S];var X=[],Y=[];V=f._getSymbolFill(S),H=f._getAltSymbolFill(S)||V,j=f._getSymbolStroke(S),z=f._getAltSymbolStroke(S)||j;if(this._getSymbolStyles){var U;V=(U=this._getSymbolStyles(S,E))&&U.fill?U.fill:V;H=U&&U.fill?U.fill:H;j=U&&U.stroke?U.stroke:j;z=U&&U.stroke?U.stroke:z}k=O>0?V:H;N=O>0?j:z;t.fill=k;t.stroke=N;if(_DataInfo.isValid(B)&&_DataInfo.isValid(O)){var W=l*O/C;if(T>v){c=this._getTrapezoidOffsetY(T,W,_);if(this.rotated)if(M-c>w){X=[A,A+(u=_*c),A+T-u,A+T];Y=[M,M-c,M-c,M];I=new _FunnelSegment(new Point(A,M-c),T,c,T-2*u,0,!0);T-=2*u;A+=u;M-=c}else{u=_*(c=M-w);p=(W-=this._getTrapezoidArea(T,_,c))/v;X.push(A,A+u,A+u,A+u+v,A+u+v,A+T);Y.push(M,M-c,M-c-p,M-c-p,M-c,M);I=new _FunnelSegment(new Point(A,M-c-p),T,c+p,v,p,!0);T=v;A+=u;M=M-c-p}else if(M+c<w){X=[A,A+(u=_*c),A+T-u,A+T];Y=[M,M+c,M+c,M];I=new _FunnelSegment(new Point(A,M),T,c,T-2*u,0);T-=2*u;A+=u;M+=c}else{u=_*(c=w-M);p=(W-=this._getTrapezoidArea(T,_,c))/v;X.push(A,A+u,A+u,A+u+v,A+u+v,A+T);Y.push(M,M+c,M+c+p,M+c+p,M+c,M);I=new _FunnelSegment(new Point(A,M),T,c+p,v,p);T=v;A+=u;M=M+c+p}t.drawPolygon(X,Y)}else{p=W/v;this.rotated&&(M-=p);t.drawRect(A,M,T,p);I=new _FunnelSegment(new Point(A,M),v,p,v,p);this.rotated||(M+=p)}I.tag=new _DataPoint(h,S,B,O);this.hitTester.add(I,h);r._setPointIndex(S,R);R++}}}}}};_FunnelPlotter.prototype._getTrapezoidArea=function(t,e,i){var r=i*e;return r*i+(t-2*r)*i};_FunnelPlotter.prototype._getTrapezoidOffsetY=function(t,e,i){var r=Math.pow(t/2/i,2)-e/i;return t/2/i-Math.sqrt(r>=0?r:0)};_FunnelPlotter.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)};_FunnelPlotter.prototype._getPointAndPosition=function(t,e,i,r){var n=i;t.x=n.center.x;t.y=n.center.y;e=null==e?LabelPosition.Center:e};return _FunnelPlotter}(_BasePlotter);export{_FunnelPlotter};var _FunnelSegment=function(){function _FunnelSegment(t,e,i,r,n,s){void 0===s&&(s=!1);this._startPoint=t;this._width=e;this._height=i;this._neckHeight=n;this._center=new Point(this._startPoint.x+e/2,this._startPoint.y+i/2);this._offsetX=(e-r)/2;this._offsetY=i-n;this._rotated=s}_FunnelSegment.prototype.contains=function(t){var e=this._startPoint,i=this._offsetX,r=this._offsetY;if(this._rotated){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+this._neckHeight)return!1;if(t.x<this._center.x)return(e.y+this._height-t.y)/(t.x-e.x)<r/i;if(t.x>this._center.x)return(e.y+this._height-t.y)/(e.x+this._width-t.x)<r/i}}else 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+r)return!1;if(t.x<this._center.x)return(t.y-e.y)/(t.x-e.x)<r/i;if(t.x>this._center.x)return(t.y-e.y)/(e.x+this._width-t.x)<r/i}return!1};_FunnelSegment.prototype.distance=function(t){if(this.contains(t))return 0;var e=this._startPoint,i=this._width,r=this._height,n=this._offsetX,s=this._offsetY;if(this._rotated){if(t.y>e.y+r)return t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y+r-t.y,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(e.y+r-t.y,2)):t.y-e.y-r;if(t.y<e.y)return t.x<e.x+n?Math.sqrt(Math.pow(e.x+n-t.x,2)+Math.pow(t.y-e.y-r,2)):t.x>e.x+i-n?Math.sqrt(Math.pow(t.x-e.x-i+n,2)+Math.pow(t.y-e.y-r,2)):e.y-t.y;if(!(t.y<e.y+r-s))return t.x<e.x+n?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y-r,2)),Math.sqrt(Math.pow(t.x-n/2-e.x,2)+Math.pow(t.y-r+s/2-e.y,2)),Math.sqrt(Math.pow(t.x-n-e.x,2)+Math.pow(t.y-r+s-e.y,2))):Math.min(Math.sqrt(Math.pow(t.x-i-e.x,2)+Math.pow(t.y-r-e.y,2)),Math.sqrt(Math.pow(t.x-i+n/2-e.x,2)+Math.pow(t.y-r+s/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+n-e.x,2)+Math.pow(t.y-r+s-e.y,2)));if(t.x<e.x+n)return e.x+n-t.x;if(t.x>e.x+i-n)return t.x-e.x-i+n}else{if(t.y<e.y)return 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;if(t.y>e.y+r)return t.x<e.x+n?Math.sqrt(Math.pow(e.x+n-t.x,2)+Math.pow(t.y-e.y-r,2)):t.x>e.x+i-n?Math.sqrt(Math.pow(t.x-e.x-i+n,2)+Math.pow(t.y-e.y-r,2)):t.y-e.y-r;if(!(t.y>e.y+s))return t.x<e.x+n?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y,2)),Math.sqrt(Math.pow(t.x-n/2-e.x,2)+Math.pow(t.y-s/2-e.y,2)),Math.sqrt(Math.pow(t.x-n-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+n/2-e.x,2)+Math.pow(t.y-s/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+n-e.x,2)+Math.pow(t.y-s-e.y,2)));if(t.x<e.x+n)return e.x+n-t.x;if(t.x>e.x+i-n)return t.x-e.x-i+n}};Object.defineProperty(_FunnelSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});return _FunnelSegment}();export{_FunnelSegment};var _FinancePlotter=function(t){__extends(_FinancePlotter,t);function _FinancePlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.isCandle=!0;e.isArms=!1;e.isEqui=!1;e.isVolume=!1;e._volHelper=null;e._symWidth=.7;return e}_FinancePlotter.prototype.clear=function(){t.prototype.clear.call(this);this._volHelper=null};_FinancePlotter.prototype.load=function(){t.prototype.load.call(this);if(this.isVolume){var e,i,r,n,s,a,o,h,l=null,_=null;for(a=0;a<this.chart.series.length;a++){s=(e=this.chart.series[a]).getDataType(1)||e.chart._xDataType;i=e._getAxisX();n=(r=null===(r=e._getChartType())||isUndefined(r)?this.chart._getChartType():r)===ChartType.Column?e._getBindingValues(1):r===ChartType.Candlestick?e._getBindingValues(4):null;if(s===DataType.Date){var u=void 0;o=[];h=[];for(a=0;a<e._getLength();a++){u=e._getItem(a)[e.bindingX].valueOf();o.push(u);h.push({value:u,text:Globalize.format(new Date(u),i.format||"d")})}}else o=this.dataInfo.getXVals();l=this.dataInfo.getMinX();_=this.dataInfo.getMaxX();if(n&&n.length>0){this._volHelper=new _VolumeHelper(n,o,l,_,s);i._customConvert=this._volHelper.convert.bind(this._volHelper);i._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);h&&h.length>0&&(this._itemsSource=i.itemsSource=h);break}}}};_FinancePlotter.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)if(e=this.chart.series[i]._getAxisX()){e._customConvert=null;e._customConvertBack=null;e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null)}};_FinancePlotter.prototype.parseSymbolWidth=function(t){this._isPixel=void 0;if(t)if(isNumber(t)){var e=asNumber(t);if(isFinite(e)&&e>0){this._symWidth=e;this._isPixel=!0}}else if(isString(t)){var i=asString(t);if(i&&i.indexOf("%")>=0){i=i.replace("%","");var r=parseFloat(i);if(isFinite(r)){r<0?r=0:r>100&&(r=100);this._symWidth=r/100;this._isPixel=!1}}else{r=parseFloat(t);if(isFinite(r)&&r>0){this._symWidth=r;this._isPixel=!0}}}};_FinancePlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),r=t.getMinY(),n=t.getMaxX(),s=t.getMaxY(),a=t.getDeltaX(),o=this.chart._xDataType;a<=0&&(a=1);var h=this.chart.series,l=h.length,_=0;this.parseSymbolWidth(this.symbolWidth);!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(var u=0;u<l;u++){var c=h[u];if(!c._isCustomAxisY()){var p=c._getBinding(1),f=c._getBinding(2),d=c._getBinding(3),g=c._getLength();if(g){var m=c._getSymbolSize();m>_&&(_=m);for(var x=0;x<g;x++){var y=c._getItem(x);if(y){[p?y[p]:null,f?y[f]:null,d?y[d]:null].forEach((function(t){if(_DataInfo.isValid(t)&&null!==t){(isNaN(r)||t<r)&&(r=t);(isNaN(s)||t>s)&&(s=t)}}))}}}}}var b=n-i;return!(o===DataType.Date&&this.isVolume||o===DataType.Number)||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.chart._isRotated()?new Rect(r,i,s-r,b):new Rect(i,r,b,s-r):new Rect(i-.5*a,r,n-i+a,s-r)};_FinancePlotter.prototype.plotSeries=function(t,e,i,r,n,s,a,o){var h=this,l=asType(r,SeriesBase),_=this.chart.series.indexOf(r),u=r.getValues(0),c=r.getValues(1),p=this._symWidth,f=this.chart._isRotated();if(u){c||(c=this.dataInfo.getXVals());if(c){var d=this.dataInfo.getDeltaX();d>0&&!1===this._isPixel&&(p*=d)}var g=u.length,m=!0;if(c)g=Math.min(g,c.length);else{m=!1;c=new Array(g)}var x=this._DEFAULT_WIDTH,y=l._getSymbolFill(_),b=l._getAltSymbolFill(_)||"transparent",v=l._getSymbolStroke(_),S=l._getAltSymbolStroke(_)||v,C=void 0===this._isPixel?l._getSymbolSize():p;t.stroke=v;t.strokeWidth=x;t.fill=y;for(var P,w,A=l._getBinding(1),M=l._getBinding(2),T=l._getBinding(3),L=f?i.actualMin:e.actualMin,E=f?i.actualMax:e.actualMax,F=0,k=null,N=null,I=this.getItemFormatter(r),_loop_3=function(n){if(k=l._getItem(n)){var s=m?c[n]:n;if(_DataInfo.isValid(s)&&L<=s&&s<=E){var a=u[n],o=A?k[A]:null,p=M?k[M]:null,f=T?k[T]:null;t.startGroup();if(R.isEqui&&null!==N){if(N[T]!==k[T]){P=N[T]<k[T]?b:y;w=N[T]<k[T]?S:v}}else{P=p<f?b:y;w=p<f?S:v}t.fill=P;t.stroke=w;t.strokeWidth=x;if(I){var d=new HitTestInfo(R.chart,new Point(e.convert(s),i.convert(a)),ChartElement.SeriesSymbol);d._setData(l,n);I(t,d,(function(){h._drawSymbol(t,e,i,_,n,P,C,s,a,o,p,f,g)}));t.cssPriority=!0}else R._drawSymbol(t,e,i,_,n,P,C,s,a,o,p,f,g);t.endGroup();r._setPointIndex(n,F);F++}N=k}},R=this,D=0;D<g;D++)_loop_3(D)}};_FinancePlotter.prototype._drawSymbol=function(t,e,i,r,n,s,a,o,h,l,_,u,c){var p,f=null,d=null,g=null,m=null,x=this.chart._isRotated(),y=e.convert(o),b=e._axrect,v=a/2,S=0===n&&y-b.left<=v,C=n===c-1&&b.right-y<=v,P=x?new _DataPoint(r,n,h,o):new _DataPoint(r,n,o,h);if(x){var w=i;i=e;e=w}if(!1===this._isPixel){if(S){g=o;m=o+a}else if(C){g=o-a;m=o}else{g=o-.5*a;m=o+.5*a}if((g=e.convert(g))>(m=e.convert(m))){var A=g;g=m;m=A}}o=y;if(!1!==this._isPixel)if(S){g=o;m=o+a}else if(C){g=o-a;m=o}else{g=o-.5*a;m=o+.5*a}if(this.isCandle){if(_DataInfo.isValid(_)&&_DataInfo.isValid(u)){_=i.convert(_);u=i.convert(u);d=(f=Math.min(_,u))+Math.abs(_-u);if(x){t.drawRect(f,g,d-f||1,m-g||1);p=new _RectArea(new Rect(f,g,d-f||1,m-g||1))}else{t.drawRect(g,f,m-g||1,d-f||1);p=new _RectArea(new Rect(g,f,m-g||1,d-f||1))}p.tag=P;this.hitTester.add(p,r)}if(_DataInfo.isValid(h)){h=i.convert(h);if(null!==f)if(x){t.drawLine(d,o,h,o);p.rect.width=p.rect.width+h}else{t.drawLine(o,f,o,h);p.rect.top=h;p.rect.height=p.rect.height+h}}if(_DataInfo.isValid(l)){l=i.convert(l);if(null!==d)if(x){t.drawLine(f,o,l,o);p.rect.left=l;p.rect.width=p.rect.width+l}else{t.drawLine(o,d,o,l);p.rect.height=p.rect.height+l}}}else if(this.isEqui){if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){h=i.convert(h);l=i.convert(l);d=(f=Math.min(h,l))+Math.abs(h-l);t.drawRect(g,f,m-g||1,d-f||1);(p=new _RectArea(new Rect(g,f,m-g||1,d-f||1))).tag=P;this.hitTester.add(p,r)}}else if(this.isArms){if(_DataInfo.isValid(_)&&_DataInfo.isValid(u)){_=i.convert(_);u=i.convert(u);d=(f=Math.min(_,u))+Math.abs(_-u);t.drawRect(g,f,m-g||1,d-f||1)}if(_DataInfo.isValid(h)&&null!==f){h=i.convert(h);t.drawLine(o,f,o,h)}if(_DataInfo.isValid(l)&&null!==d){l=i.convert(l);t.drawLine(o,d,o,l)}if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){t.fill="transparent";d=(f=Math.min(h,l))+Math.abs(h-l);t.drawRect(g,f,m-g||1,d-f||1);(p=new _RectArea(new Rect(g,f,m-g||1,d-f||1))).tag=P;this.hitTester.add(p,r)}}else{if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){h=i.convert(h);l=i.convert(l);d=(f=Math.min(h,l))+Math.abs(h-l);if(x){t.drawLine(l,o,h,o);p=new _RectArea(new Rect(f,g,d-f||1,m-g||1))}else{t.drawLine(o,l,o,h);p=new _RectArea(new Rect(g,f,m-g||1,d-f||1))}p.tag=P;this.hitTester.add(p,r)}if(_DataInfo.isValid(_)){_=i.convert(_);x?t.drawLine(_,g,_,o):t.drawLine(g,_,o,_)}if(_DataInfo.isValid(u)){u=i.convert(u);x?t.drawLine(u,o,u,m):t.drawLine(o,u,m,u)}}};return _FinancePlotter}(_BasePlotter);export{_FinancePlotter};var LineMarkers=function(){function LineMarkers(){this._moveMarker=function(t){var e=t.currentTarget,i=this._markers,r=e.getAttribute("data-markerIndex");null!=r&&i[r].forEach((function(e){e._moveMarker(t)}))};this._markers=[];this._bindMoveMarker=this._moveMarker.bind(this)}LineMarkers.prototype.attach=function(t){var e,i=t.chart.hostElement,r=this._markers,n=i.getAttribute("data-markerIndex"),s=[];if(null!=n)if((s=r[n])&&isArray(s))s.push(t);else{r[n]=[t];this._bindMoveEvent(i)}else{e=r.length;s=[t];r.push(s);i.setAttribute("data-markerIndex",e.toString());this._bindMoveEvent(i)}};LineMarkers.prototype.detach=function(t){var e,i,r=t.chart.hostElement,n=this._markers,s=r.getAttribute("data-markerIndex");if(null!=s){(e=(i=n[s]).indexOf(t))>-1&&i.splice(e,1);if(0===i.length){(e=n.indexOf(i))>-1&&(n[e]=void 0);this._unbindMoveEvent(r)}}};LineMarkers.prototype._unbindMoveEvent=function(t){var e=this._bindMoveMarker;t.removeEventListener("mousemove",e);"ontouchstart"in window&&t.removeEventListener("touchmove",e)};LineMarkers.prototype._bindMoveEvent=function(t){var e=this._bindMoveMarker;t.addEventListener("mousemove",e);"ontouchstart"in window&&t.addEventListener("touchmove",e)};return LineMarkers}(),lineMarkers=new LineMarkers;export var LineMarkerLines;!function(t){t[t.None=0]="None";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal";t[t.Both=3]="Both"}(LineMarkerLines||(LineMarkerLines={}));export var LineMarkerInteraction;!function(t){t[t.None=0]="None";t[t.Move=1]="Move";t[t.Drag=2]="Drag"}(LineMarkerInteraction||(LineMarkerInteraction={}));export var LineMarkerAlignment;!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"}(LineMarkerAlignment||(LineMarkerAlignment={}));var LineMarker=function(){function LineMarker(t,e){this._wrapperMousedown=null;this._wrapperMouseup=null;this._savedPosition=new Point;this.positionChanged=new Event;this._chart=t;t._markers.push(this);t.rendered.addHandler(this._initialize,this);this._resetDefaultValue();copy(this,e);this._initialize()}Object.defineProperty(LineMarker.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){if(t!==this._isVisible){this._isVisible=asBoolean(t);this._marker&&this._toggleVisibility()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"seriesIndex",{get:function(){return this._seriesIndex},set:function(t){t!==this._seriesIndex&&(this._seriesIndex=asNumber(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"horizontalPosition",{get:function(){return this._horizontalPosition},set:function(t){if(t!==this._horizontalPosition){this._horizontalPosition=asNumber(t,!0);this._savedPosition.x=this._horizontalPosition;if(this._horizontalPosition<0||this._horizontalPosition>1)throw"horizontalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"x",{get:function(){var t=this._chart.axisX,e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.x)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"y",{get:function(){var t=this._chart.axisY,e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.y)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"content",{get:function(){return this._content},set:function(t){if(t!==this._content){this._content=asFunction(t);this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"verticalPosition",{get:function(){return this._verticalPosition},set:function(t){if(t!==this._verticalPosition){this._verticalPosition=asNumber(t,!0);this._savedPosition.y=this._verticalPosition;if(this._verticalPosition<0||this._verticalPosition>1)throw"verticalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"alignment",{get:function(){return this._alignment},set:function(t){if(t!==this._alignment){this._alignment=t;this._marker&&this._updatePositionByAlignment()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"lines",{get:function(){return this._lines},set:function(t){if((t=asEnum(t,LineMarkerLines))!=this._lines){this._lines=t;this._marker&&this._resetLinesVisibility()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"interaction",{get:function(){return this._interaction},set:function(t){if((t=asEnum(t,LineMarkerInteraction))!=this._interaction){this._marker&&this._detach();this._interaction=t;this._marker&&this._attach();this._toggleElesDraggableClass(this._interaction==LineMarkerInteraction.Drag)}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragThreshold",{get:function(){return this._dragThreshold},set:function(t){t!=this._dragThreshold&&(this._dragThreshold=asNumber(t))},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragContent",{get:function(){return this._dragContent},set:function(t){t!==this._dragContent&&(this._dragContent=asBoolean(t));toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,this._interaction===LineMarkerInteraction.Drag&&this._dragContent&&this._lines!==LineMarkerLines.None)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragLines",{get:function(){return this._dragLines},set:function(t){t!=this._dragLines&&(this._dragLines=asBoolean(t))},enumerable:!0,configurable:!0});LineMarker.prototype.onPositionChanged=function(t){this.positionChanged.raise(this,t)};LineMarker.prototype.remove=function(){var t=this._chart;if(this._marker){t.rendered.removeHandler(this._initialize,this);this._detach();this._removeMarker();this._wrapperMoveMarker=null;this._wrapperMousedown=null;this._wrapperMouseup=null}};LineMarker.prototype._attach=function(){var t=this._chart.hostElement;this._interaction!==LineMarkerInteraction.None?addClass(t,LineMarker._CSS_TOUCH_DISABLED):removeClass(t,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.attach(this);this._attachDrag()};LineMarker.prototype._attachDrag=function(){if(this._interaction===LineMarkerInteraction.Drag){this._wrapperMousedown||(this._wrapperMousedown=this._onMousedown.bind(this));this._wrapperMouseup||(this._wrapperMouseup=this._onMouseup.bind(this));this._toggleDragEventAttach(!0)}};LineMarker.prototype._detach=function(){removeClass(this._chart.hostElement,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.detach(this);this._detachDrag()};LineMarker.prototype._detachDrag=function(){this._interaction===LineMarkerInteraction.Drag&&this._toggleDragEventAttach(!1)};LineMarker.prototype._toggleDragEventAttach=function(t){var e=this._chart.hostElement,i=t?"addEventListener":"removeEventListener";e[i]("mousedown",this._wrapperMousedown);document[i]("mouseup",this._wrapperMouseup);"ontouchstart"in window&&e[i]("touchstart",this._wrapperMousedown);"ontouchend"in window&&document[i]("touchend",this._wrapperMouseup)};LineMarker.prototype._onMousedown=function(t){var e,i,r,n,s,a=this._getEventPoint(t);if(this._interaction===LineMarkerInteraction.Drag){n=!(0===(e=getElementRect(this._hLine)).width||0===e.height);s=!(0===(i=getElementRect(this._vLine)).width||0===i.height);r=getElementRect(this._markerContent);if(this._dragContent&&this._pointInRect(a,r)){this._capturedEle=this._markerContent;this._contentDragStartPoint=new Point(a.x,a.y);this._mouseDownCrossPoint=new Point(this._targetPoint.x,this._targetPoint.y)}else if(n&&(Math.abs(e.top-a.y)<=this._dragThreshold||Math.abs(a.y-e.top-e.height)<=this._dragThreshold||a.y>=e.top&&a.y<=e.top+e.height)){this._capturedEle=this._hLine;this._contentDragStartPoint=void 0;addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}else if(s&&(Math.abs(i.left-a.x)<=this._dragThreshold||Math.abs(a.x-i.left-i.width)<=this._dragThreshold||a.x>=i.left&&a.x<=i.left+i.width)){this._capturedEle=this._vLine;this._contentDragStartPoint=void 0;addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}t.preventDefault()}};LineMarker.prototype._onMouseup=function(t){var e=this._alignment===LineMarkerAlignment.Auto&&this._capturedEle===this._markerContent&&this._lines!==LineMarkerLines.None;this._capturedEle=void 0;this._contentDragStartPoint=void 0;this._mouseDownCrossPoint=void 0;if(e){this._updatePositionByAlignment();this._updatePositionByAlignment()}removeClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)};LineMarker.prototype._moveMarker=function(t){var e,i,r,n,s,a,o=this._chart,h=this._getEventPoint(t),l=this._plotRect,_=this._interaction===LineMarkerInteraction.Drag,u=this._lines===LineMarkerLines.Horizontal,c=this._lines===LineMarkerLines.Vertical,p=this._seriesIndex,f=getElementRect(o.hostElement);if(l&&this._isVisible&&this._interaction!==LineMarkerInteraction.None&&(this._interaction!==LineMarkerInteraction.Drag||this._capturedEle&&this._lines!==LineMarkerLines.None)){if(_)if(this._contentDragStartPoint){h.x=u?this._targetPoint.x:this._mouseDownCrossPoint.x+h.x-this._contentDragStartPoint.x;h.y=c?this._targetPoint.y:this._mouseDownCrossPoint.y+h.y-this._contentDragStartPoint.y}else u||!this._dragLines&&this._capturedEle===this._hLine?h.x=this._targetPoint.x:(c||!this._dragLines&&this._capturedEle===this._vLine)&&(h.y=this._targetPoint.y);if(_&&this._lines===LineMarkerLines.Horizontal||!this._dragLines&&this._capturedEle===this._hLine){if(h.y<=l.top||h.y>=l.top+l.height)return}else if(_&&this._lines===LineMarkerLines.Vertical||!this._dragLines&&this._capturedEle===this._vLine){if(h.x<=l.left||h.x>=l.left+l.width)return}else{var d=this._getTop();if(h.x<=l.left||h.y<=d||h.x>=l.left+l.width||h.y>=d+l.height)return}if(null!=p&&p>=0&&p<o.series.length){if(null==(i=(e=o.series[p]).hitTest(new Point(h.x,NaN)))||null==i.x||null==i.y)return;r=e.axisX||o.axisX;n=e._getAxisY();s=isDate(i.x)?FlexChartCore._toOADate(i.x):i.x;s=isString(s)?i.pointIndex:s;a=isDate(i.y)?FlexChartCore._toOADate(i.y):i.y;var g=this._getElementPaddingValuee(o.hostElement,"padding-left"),m=this._getElementPaddingValuee(o.hostElement,"padding-top");h.x=r.convert(s)+g+f.left;this.chart._stacking!=Stacking.None&&(a=this._calcStackedValue(p,s,a));h.y=n.convert(a)+m+f.top}this._updateMarkerPosition(h);t.preventDefault()}};LineMarker.prototype._calcStackedValue=function(t,e,i){for(var r=i,n=this.chart._stacking==Stacking.Stacked100pc,s=0;s<t;s++){var a=this.chart.series[s],o=a.getValues(1),h=a.getValues(0);if(h)for(var l=0;l<h.length;l++){if(e===(o?o[l]:l)){isFinite(h[l])&&(n||this._sign(i)==this._sign(h[l]))&&(r+=h[l]);break}}}n&&r&&(r/=this.chart._dataInfo.getStackedAbsSum(e))>1&&(r=1);return r};LineMarker.prototype._sign=function(t){return t>0?1:t<0?-1:0};LineMarker.prototype._getElementPaddingValuee=function(t,e){return+window.getComputedStyle(t,null).getPropertyValue(e).replace("px","")};LineMarker.prototype._show=function(t){(t||this._marker).style.display="block"};LineMarker.prototype._hide=function(t){(t||this._marker).style.display="none"};LineMarker.prototype._toggleVisibility=function(){this._isVisible?this._show():this._hide()};LineMarker.prototype._resetDefaultValue=function(){this._isVisible=!0;this._alignment=LineMarkerAlignment.Auto;this._lines=LineMarkerLines.None;this._interaction=LineMarkerInteraction.None;this._horizontalPosition=null;this._verticalPosition=null;this._content=null;this._seriesIndex=null;this._dragThreshold=15;this._dragContent=!1;this._dragLines=!1;this._targetPoint=new Point};LineMarker.prototype._initialize=function(){var t,e=this._chart.hostElement.querySelector("."+FlexChartCore._CSS_PLOT_AREA);this._plot=e;this._marker||this._createMarker();if(e){this._plotRect=getElementRect(e);t=e.getBBox();this._plotRect.width=t.width;this._plotRect.height=t.height;this._updateMarkerSize();this._updateLinesSize()}this._updateMarkerPosition();this._wrapperMoveMarker=this._moveMarker.bind(this);this._attach()};LineMarker.prototype._createMarker=function(){var t,e;t=document.createElement("div");addClass(t,LineMarker._CSS_MARKER);(e=this._getContainer()).appendChild(t);this._markerContainer=e;this._marker=t;this._createChildren()};LineMarker.prototype._removeMarker=function(){var t=this._markerContainer;t.removeChild(this._marker);this._content=null;this._hLine=null;this._vLine=null;if(!t.hasChildNodes()){this._chart.hostElement.removeChild(this._markerContainer);this._markerContainer=null}this._marker=null};LineMarker.prototype._getContainer=function(){var t=this._chart.hostElement.querySelector(LineMarker._CSS_MARKER_CONTAINER);t||(t=this._createContainer());return t};LineMarker.prototype._createContainer=function(){var t=document.createElement("div"),e=this._chart.hostElement;addClass(t,LineMarker._CSS_MARKER_CONTAINER);e.insertBefore(t,e.firstChild);return t};LineMarker.prototype._createChildren=function(){var t,e,i,r,n=this._marker;(r=document.createElement("div")).style.position="absolute";r.style.height="100%";r.style.width="100%";n.appendChild(r);this._dragEle=r;t=document.createElement("div");addClass(t,LineMarker._CSS_MARKER_CONTENT);n.appendChild(t);this._markerContent=t;e=document.createElement("div");addClass(e,LineMarker._CSS_MARKER_HLINE);n.appendChild(e);this._hLine=e;i=document.createElement("div");addClass(i,LineMarker._CSS_MARKER_VLINE);n.appendChild(i);this._vLine=i;this._toggleElesDraggableClass(this._interaction===LineMarkerInteraction.Drag);this._resetLinesVisibility()};LineMarker.prototype._toggleElesDraggableClass=function(t){toggleClass(this._hLine,LineMarker._CSS_LINE_DRAGGABLE,t);toggleClass(this._vLine,LineMarker._CSS_LINE_DRAGGABLE,t);toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,t&&this._dragContent&&this._lines!==LineMarkerLines.None)};LineMarker.prototype._updateMarkerSize=function(){var t=this._plotRect,e=this._chart.hostElement,i=window.getComputedStyle(e,null),r=getElementRect(e);if(this._marker){this._marker.style.marginTop=t.top-r.top-(parseFloat(i.getPropertyValue("padding-top"))||0)+"px";this._marker.style.marginLeft=t.left-r.left-(parseFloat(i.getPropertyValue("padding-left"))||0)+"px"}};LineMarker.prototype._updateLinesSize=function(){var t=this._plotRect;if(this._hLine&&this._vLine){this._hLine.style.width=t.width+"px";this._vLine.style.height=t.height+"px"}};LineMarker.prototype._resetLinesVisibility=function(){if(this._hLine&&this._vLine){this._hide(this._hLine);this._hide(this._vLine);this._lines!==LineMarkerLines.Horizontal&&this._lines!==LineMarkerLines.Both||this._show(this._hLine);this._lines!==LineMarkerLines.Vertical&&this._lines!==LineMarkerLines.Both||this._show(this._vLine)}};LineMarker.prototype._updateMarkerPosition=function(t){var e,i,r=this._plotRect,n=this._targetPoint,s=!1;this._interaction,LineMarkerInteraction.Drag;if(this._plot){e=r.left+r.width*(this._horizontalPosition||0);i=r.top+r.height*(this._verticalPosition||0);null==this._horizontalPosition&&t?e=t.x:this._savedPosition.x>0&&(e=r.left+r.width*this._savedPosition.x);null==this._verticalPosition&&t?i=t.y:this._savedPosition.y>0&&(i=r.top+r.height*this._savedPosition.y);e===n.x&&i===n.y||(s=!0);n.x=e;n.y=i;this._savedPosition.x=clamp((e-r.left)/r.width,0,1);this._savedPosition.y=clamp((i-r.top)/r.height,0,1);this._toggleVisibility();this._content&&this._updateContent();s&&this._raisePositionChanged(e,i);this._updatePositionByAlignment(!!t)}};LineMarker.prototype._updateContent=function(){var t,e=this._chart,i=this._targetPoint,r=e.hitTest(i);t=this._content.call(null,r,i);this._markerContent.innerHTML=t||""};LineMarker.prototype._raisePositionChanged=function(t,e){this._plotRect;this.onPositionChanged(new Point(t,e))};LineMarker.prototype._updatePositionByAlignment=function(t){var e=this._alignment,i=this._targetPoint,r=this._marker,n=0,s=0,a=r.clientWidth,o=r.clientHeight,h=this._plotRect;if(this._plot){var l=this._getTop();if(!this._capturedEle||this._capturedEle&&this._capturedEle!==this._markerContent){if(e===LineMarkerAlignment.Auto){i.x+a+12>h.left+h.width&&i.x-a>=0&&(s=a);n=o;i.y-o<l&&(n=0)}else{1==(1&e)&&(s=a);2==(2&e)&&(n=o)}this._interaction===LineMarkerInteraction.Move&&0===n&&0===s&&null==this.verticalPosition&&(s=-12)}else{parseInt(this._hLine.style.top)>0&&(n=o);parseInt(this._vLine.style.left)>0&&(s=a)}r.style.left=i.x-s-h.left+"px";r.style.top=i.y-n-l+"px";this._hLine.style.top=n+"px";this._hLine.style.left=h.left-i.x+s+"px";this._vLine.style.top=l-i.y+n+"px";this._vLine.style.left=s+"px"}};LineMarker.prototype._getEventPoint=function(t){return t instanceof MouseEvent?new Point(t.pageX,t.pageY):new Point(t.changedTouches[0].pageX,t.changedTouches[0].pageY)};LineMarker.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)};LineMarker.prototype._getTop=function(){var t=0,e=this.chart._getHostComputedStyle();if(e){t+=this.chart._parsePx(e.paddingTop);t+=this.chart._parsePx(e.borderTopWidth);t+=this.chart._parsePx(e.marginTop)}return this._chart._plotRect.top+this._plot.getBoundingClientRect().top-t};LineMarker._CSS_MARKER=LineMarkerClsNames.linemarker;LineMarker._CSS_MARKER_HLINE=LineMarkerClsNames.hline;LineMarker._CSS_MARKER_VLINE=LineMarkerClsNames.vline;LineMarker._CSS_MARKER_CONTENT=LineMarkerClsNames.content;LineMarker._CSS_MARKER_CONTAINER=LineMarkerClsNames.container;LineMarker._CSS_LINE_DRAGGABLE=LineMarkerClsNames.draggable;LineMarker._CSS_TOUCH_DISABLED=FlexChartClsNames.touchDisabled;return LineMarker}();export{LineMarker};var _LinePlotter=function(t){__extends(_LinePlotter,t);function _LinePlotter(){var e=t.call(this)||this;e.hasSymbols=!1;e.hasLines=!0;e.isSpline=!1;e.isStep=!1;e.hitTestSymbols=!0;e.stacking=Stacking.None;e.stackPos={};e.stackNeg={};e.clipping=!1;return e}_LinePlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNeg={};this.stackPos={}};_LinePlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),r=t.getMinY(),n=t.getMaxX(),s=t.getMaxY();if(this.isSpline&&!this.chart.axisY._getLogBase()){var a=.1*(s-r);r-=a;s+=a}return this.rotated?new Rect(r,i,s-r,n-i):new Rect(i,r,n-i,s-r)};_LinePlotter.prototype.plotSeries=function(t,e,i,r,n,s,a,o){var h=[],l=asType(r,SeriesBase),_=this.chart.series.indexOf(r),u=r.getValues(0),c=r.getValues(1);if(u){c||(c=this.dataInfo.getXVals());var p=_BasePlotter.cloneStyle(r.style,["fill"]),f=u.length,d=!0;if(c)f=Math.min(f,c.length);else{d=!1;c=new Array(f)}var g=this._DEFAULT_WIDTH,m=l._getSymbolFill(_),x=l._getAltSymbolFill(_)||m,y=l._getSymbolStroke(_),b=l._getAltSymbolStroke(_)||y,v=l._getSymbolSize();t.stroke=y;t.strokeWidth=g;t.fill=m;var S=new Float64Array(f),C=new Float64Array(f),P=0,w=new Int8Array(f),A=0,M=this.rotated,T=this.stacking!=Stacking.None&&!l._isCustomAxisY(),L=this.stacking==Stacking.Stacked100pc&&!l._isCustomAxisY();void 0!==l._getChartType()&&(T=L=!1);for(var E,F=l.interpolateNulls,k=!1,N=this.getItemFormatter(r),I=0;I<f;I++){var R=d?c[I]:I,D=u[I];if(isFinite(R)&&isFinite(D)){if(T){if(L){D/=this.dataInfo.getStackedAbsSum(R)}if(D>=0){var B=isNaN(this.stackPos[R])?0:this.stackPos[R];D=this.stackPos[R]=B+D}else{B=isNaN(this.stackNeg[R])?0:this.stackNeg[R];D=this.stackNeg[R]=B+D}}if(M){E=new _DataPoint(_,I,D,R);var O=e.convert(D);D=i.convert(R);R=O}else{E=new _DataPoint(_,I,R,D);R=e.convert(R);D=i.convert(D)}if(isNaN(R)||isNaN(D)){k=!0;if(!0!==F){S[P]=NaN;C[P++]=NaN}w[A++]=1;o&&h.push(null)}else{S[P]=R;C[P++]=D;A++;o&&h.push(new Point(R,D));if(this.hitTestSymbols){var V=new _CircleArea(new Point(R,D),.5*v);V.tag=E;this.hitTester.add(V,_)}}}else{k=!0;if(!0!==F){S[P]=NaN;C[P++]=NaN}w[A++]=1;o&&h.push(null)}}var H=0;if(this.hasLines){t.fill=null;if(k&&!0!==F){var j=[],z=[];for(I=0;I<f;I++)if(isNaN(S[I])){if(j.length>1){this._drawLines(t,j,z,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(j,z),_);H++}j=[];z=[]}else{j.push(S[I]);z.push(C[I])}if(j.length>1){this._drawLines(t,j,z,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(j,z),_);H++}}else{this._drawLines(t,S,C,null,p,this.chart._plotrectId,P);this.hitTester.add(new _LinesArea(S,C),_);H++}}if(this.hasSymbols&&v>0||N){t.fill=m;var G=0;for(I=0;I<f;I++)if(!F||!w[I]){R=S[G],D=C[G];if(!1===this.hasLines||N){t.fill=u[I]>0?m:x;t.stroke=u[I]>0?y:b;t.strokeWidth=g}if(this.isValid(R,D,e,i)){this._drawSymbol(t,R,D,v,l,I,N);r._setPointIndex(I,H);H++}G++}}o&&h&&h.length&&o(h)}};_LinePlotter.prototype._drawLines=function(t,e,i,r,n,s,a){if(this.isSpline&&a>3)t.drawSplines(e,i,r,n,s,a);else if(this.isStep){var o=this._createSteps(e,i,a);e=o.x;i=o.y;t.drawLines(e,i,r,n,s)}else t.drawLines(e,i,r,n,s,a)};_LinePlotter.prototype._drawSymbol=function(t,e,i,r,n,s,a){var o=this;if(a){t.startGroup();var h=new HitTestInfo(this.chart,new Point(e,i),ChartElement.SeriesSymbol);h._setData(n,s);a(t,h,(function(){o.hasSymbols&&r>0&&o._drawDefaultSymbol(t,e,i,r,n.symbolMarker,n.symbolStyle)}));t.cssPriority=!0;t.endGroup()}else this._drawDefaultSymbol(t,e,i,r,n.symbolMarker,n.symbolStyle)};_LinePlotter.prototype._drawDefaultSymbol=function(t,e,i,r,n,s){n==Marker.Dot?t.drawEllipse(e,i,.5*r,.5*r,null,s):n==Marker.Box&&t.drawRect(e-.5*r,i-.5*r,r,r,null,s)};return _LinePlotter}(_BasePlotter);export{_LinePlotter};var _BubblePlotter=function(t){__extends(_BubblePlotter,t);function _BubblePlotter(){var e=t.call(this)||this;e._MIN_SIZE=5;e._MAX_SIZE=30;e.hasLines=!1;e.hasSymbols=!0;e.clipping=!0;e.hitTestSymbols=!1;return e}_BubblePlotter.prototype.adjustLimits=function(e,i){var r=this.getNumOption("minSize","bubble");this._minSize=r||this._MIN_SIZE;var n=this.getNumOption("maxSize","bubble");this._maxSize=n||this._MAX_SIZE;for(var s=this.chart.series,a=s.length,o=NaN,h=NaN,l=0;l<a;l++){if((m=s[l])._getChartType()==ChartType.Bubble||null==m._getChartType()&&m._chart._getChartType()==ChartType.Bubble){if(x=m._getBindingValues(1))for(var _=x.length,u=0;u<_;u++)if(isFinite(x[u])){(isNaN(o)||x[u]<o)&&(o=x[u]);(isNaN(h)||x[u]>h)&&(h=x[u])}}}this._minValue=o;this._maxValue=h;var c=t.prototype.adjustLimits.call(this,e,i),p=i.left,f=i.right,d=i.top,g=i.bottom;for(l=0;l<a;l++){var m;if((m=s[l])._getChartType()==ChartType.Bubble||null==m._getChartType()&&m._chart._getChartType()==ChartType.Bubble){var x=m._getBindingValues(1),y=m.getValues(1),b=m.getValues(0);if(x&&y&&b)for(_=x.length,u=0;u<_;u++){var v=y?y[u]:u,S=b[u],C=x[u];if(_DataInfo.isValid(v,S,C)){v=i.left+i.width*(v-c.left)/c.width;S=i.top+i.height*(S-c.top)/c.height;v-(C=this._minSize+(this._maxSize-this._minSize)*(C-o)/(h-o))<p&&(p=v-C);v+C>f&&(f=v+C);S-C<d&&(d=S-C);S+C>g&&(g=S+C)}}}}p=i.left-p+5;f=f-i.right+5;d=i.top-d+5;g=g-i.bottom+5;var P=this.chart.axisX,w=this.chart.axisY;if(!P._isLogAxis())if(this.stacking==Stacking.Stacked100pc&&this.rotated){var A=(i.width-this._maxSize)/c.width;c.left-=.5*this._maxSize/A;c.width+=this._maxSize/A}else{A=(i.width-(p+f))/c.width;c.left-=p/A;c.width+=(p+f)/A}if(!w._isLogAxis())if(this.stacking!=Stacking.Stacked100pc||this.rotated){M=(i.height-(d+g))/c.height;c.top-=d/M;c.height+=(d+g)/M}else{var M=(i.height-this._maxSize)/c.height;c.top-=.5*this._maxSize/M;c.height+=this._maxSize/M}return c};_BubblePlotter.prototype._drawSymbol=function(t,e,i,r,n,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 _=n._getItem(s);if(_){var u=n._getBinding(1);if(u){var c=_[u];if(isFinite(c)){null==c&&(c=this._minValue);var p=this._minValue==this._maxValue?1:Math.sqrt((c-this._minValue)/(this._maxValue-this._minValue));c=this._minSize+(this._maxSize-this._minSize)*p;if(a){var f=new HitTestInfo(this.chart,new Point(e,i),ChartElement.SeriesSymbol);f._setData(n,s);t.startGroup();a(t,f,(function(){o._drawDefaultSymbol(t,e,i,c,n.symbolMarker,n.symbolStyle)}));t.endGroup()}else this._drawDefaultSymbol(t,e,i,c,n.symbolMarker,n.symbolStyle);var d=n.getValues(1);d||(d=this.dataInfo.getXVals());var g=d?d[s]:s,m=n.getValues(0)[s],x=this.chart.series.indexOf(n),y=new _CircleArea(new Point(e,i),.5*c);y.tag=new _DataPoint(x,s,g,m);this.hitTester.add(y,x)}}}};return _BubblePlotter}(_LinePlotter);export{_BubblePlotter};_registerModule("wijmo.chart",selfModule);
14
+ var __extends=this&&this.__extends||function(){var extendStatics=function(t,e){return(extendStatics=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])})(t,e)};return function(t,e){extendStatics(t,e);function __(){this.constructor=t}t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)}}(),__assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++){e=arguments[i];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t}).apply(this,arguments)};import{culture,format,Globalize,isString,toPlainText,isNumberFinite,addClass,Point,Rect,removeChild,removeClass,setAttribute,Size,asEnum,asString,isNumber,asNumber,assert,asBoolean,setCss,tryCast,isNumberNaN,DataType,isDate,isArray,Event,asType,copy,asFunction,Binding,EventArgs,asCollectionView,asInt,ObservableArray,asDate,isIE,hasClass,UtilitesClsNames,asArray,clamp,isUndefined,getElementRect,toggleClass,isFunction,ControlClsNames,Control,Tooltip,CancelEventArgs,Color,_addCultureInfo,mouseToPage,ControlStateClsNames,animate,_registerModule}from"@grapecity/wijmo";import*as selfModule from"@grapecity/wijmo.chart";var _VolumeHelper=function(){function _VolumeHelper(t,e,i,n,r){this._volumes=asArray(t);this._xVals=asArray(e);this._xDataMin=asNumber(i,!0,!1);this._xDataMax=asNumber(n,!0,!1);this._xDataType=asEnum(r,DataType,!0);this._calcData=[];this._init()}_VolumeHelper.prototype.convert=function(t,e,i){var n,r=this._calcData.length,s=-1;if(this._hasXs&&this._xDataType===DataType.Date){if(-1===(s=this._xVals.indexOf(t)))for(var a=0;a<this._xVals.length;a++){if(a<this._xVals.length-1&&this._xVals[a]<=t&&t<=this._xVals[a+1]){s=a;break}if(0===a&&t<=this._xVals[a]){s=a;break}if(a===this._xVals.length-1&&this._xVals[a]<=t){s=a;break}}if(-1===s){s=this._xVals.indexOf(Math.floor(t));s=clamp(s,0,r-1)}}else if(this._hasXs){if(-1===(s=this._xVals.indexOf(t))){s=this._xVals.indexOf(Math.floor(t));s=clamp(s,0,r-1)}}else s=clamp(Math.round(t),0,r-1);if(0<=s&&s<r){this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,r-1,this._xDataMin,this._xDataMax));n=((n=this._calcData[s].value+(t-s)*this._calcData[s].width-.5*this._calcData[s].width)-(e=this._getXVolume(e)))/((i=this._getXVolume(i))-e)}return n};_VolumeHelper.prototype.convertBack=function(t,e,i){var n,r,s=this._calcData.length,a=-1;for(r=0;r<s;r++)if(this._calcData[r].x1<=t&&t<=this._calcData[r].x2||0===r&&t<=this._calcData[r].x2||r===s-1&&this._calcData[r].x1<=t){a=r;break}if(0<=a&&a<s){n=t/this._calcData[a].width-this._calcData[a].value/this._calcData[a].width+.5+r;this._hasXs&&(n=_VolumeHelper.convertToRange(n,this._xDataMin,this._xDataMax,0,s-1))}return n};_VolumeHelper.prototype._init=function(){this._hasXs=null!==this._xVals&&this._xVals.length>0;this._hasXs&&!isNumber(this._xDataMin)&&(this._xDataMin=Math.min.apply(null,this._xVals));this._hasXs&&!isNumber(this._xDataMax)&&(this._xDataMax=Math.max.apply(null,this._xVals));this._hasXs&&(this._hasXs=isNumber(this._xDataMin)&&isNumber(this._xDataMax));this._hasXs&&this._xDataType===DataType.Date&&this._fillGaps();var t=0,e=0,i=null!==this._volumes&&this._volumes.length>0?this._volumes.length:0;for(e=0;e<i;e++)t+=this._volumes[e]||0;var n,r,s=0;for(e=0;e<i;e++){n=s+(r=(this._volumes[e]||0)/t);this._calcData.push({value:n,width:r,x1:s,x2:n});s=this._calcData[e].value}};_VolumeHelper.prototype._getXVolume=function(t){var e=this._calcData.length,i=-1;if(this._hasXs){i=this._xVals.indexOf(t);for(var n=0;n<this._xVals.length;n++){if(n<this._xVals.length-1&&this._xVals[n]<=t&&t<=this._xVals[n+1]){i=n;break}if(0===n&&t<=this._xVals[n]){i=n;break}if(n===this._xVals.length-1&&this._xVals[n]<=t){i=n;break}}}this._hasXs&&(t=_VolumeHelper.convertToRange(t,0,e-1,this._xDataMin,this._xDataMax));-1===i&&(i=clamp(Math.round(t),0,e-1));return this._calcData[i].value+(t-i)*this._calcData[i].width-.5*this._calcData[i].width};_VolumeHelper.convertToRange=function(t,e,i,n,r){return e===i||n===r?0:(t-n)*(i-e)/(r-n)+e};_VolumeHelper.prototype._fillGaps=function(){if(!(this._xDataType!==DataType.Date||null===this._xVals||this._xVals.length<=0)){var t,e=this._xDataMin,i=this._xDataMax;for(t=1;e<i;t++){(e=new Date(e)).setDate(e.getDate()+1);if((e=e.valueOf())!==this._xVals[t]){this._xVals.splice(t,0,e);this._volumes.splice(t,0,0)}}}};return _VolumeHelper}();export{_VolumeHelper};var _Curve=function(){function _Curve(t,e,i,n){this.monoX=!1;var r=i||Math.min(t.length,e.length),s=0,a=0,o=0,l=0;if(r>3)for(var h=0;h<r-1;h++)if(h>0){a=Math.min(a,t[h]-t[h-1]);s=Math.max(s,t[h]-t[h-1]);l=Math.min(l,e[h]-e[h-1]);o=Math.max(o,e[h]-e[h-1])}this.monoX=s>0&&0===a||a<0&&0===s;this.monoX&&"spline"!==n?this.calc=a<0?new _SplineMono(t.reverse(),e.reverse(),i):new _SplineMono(t,e,i):this.calc=new _Spline(t,e,i)}_Curve.prototype.calculate=function(){return this.calc.calculate()};return _Curve}();export{_Curve};var _Spline=function(){function _Spline(t,e,i){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;this._len=i||Math.min(t.length,e.length);var n=this._len;if(n>3)for(var r=0;r<n-1;r++){var s=0==r?new Point(t[r],e[r]):new Point(t[r-1],e[r-1]),a=new Point(t[r],e[r]),o=new Point(t[r+1],e[r+1]),l=r==n-2?new Point(t[r+1],e[r+1]):new Point(t[r+2],e[r+2]),h=new Point,c=new Point,u=new Point,_=new Point;h.x=s.x*this.m[0][0]+a.x*this.m[0][1]+o.x*this.m[0][2]+l.x*this.m[0][3];c.x=s.x*this.m[1][0]+a.x*this.m[1][1]+o.x*this.m[1][2]+l.x*this.m[1][3];u.x=s.x*this.m[2][0]+a.x*this.m[2][1]+o.x*this.m[2][2]+l.x*this.m[2][3];_.x=s.x*this.m[3][0]+a.x*this.m[3][1]+o.x*this.m[3][2]+l.x*this.m[3][3];h.y=s.y*this.m[0][0]+a.y*this.m[0][1]+o.y*this.m[0][2]+l.y*this.m[0][3];c.y=s.y*this.m[1][0]+a.y*this.m[1][1]+o.y*this.m[1][2]+l.y*this.m[1][3];u.y=s.y*this.m[2][0]+a.y*this.m[2][1]+o.y*this.m[2][2]+l.y*this.m[2][3];_.y=s.y*this.m[3][0]+a.y*this.m[3][1]+o.y*this.m[3][2]+l.y*this.m[3][3];this._a.push(h);this._b.push(c);this._c.push(u);this._d.push(_)}}_Spline.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}};_Spline.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=Math.min(this._len*this.k,.2),r=n;r<=this._len-1;r+=n){var s=Math.ceil(r),a=this.calculatePoint(r);if(Math.abs(i.x-a.x)>=3||Math.abs(i.y-a.y)>=3){t.push(a.x);e.push(a.y);i=a}if(r+n>=s){t.push(this._x[s]);e.push(this._y[s])}}return{xs:t,ys:e}};return _Spline}();export{_Spline};var _SplineMono=function(){function _SplineMono(t,e,i){this._x=[];this._y=[];this._c1s=[];this._c2s=[];this._c3s=[];this._len=i||Math.min(t.length,e.length);for(var n=this._len,r=0;r<n;r++){this._x.push(t[r]);this._y.push(e[r])}t=this._x;e=this._y;if(!(this._len<=3)){var s=[],a=[],o=[];for(r=0;r<n-1;r++){var l=t[r+1]-t[r],h=e[r+1]-e[r];a[r]=l;s[r]=h;o[r]=h/l}var c=this._c1s;c.push(o[0]);for(r=0;r<a.length-1;r++){var u=o[r],_=o[r+1];if(u*_<=0)c.push(0);else{var p=a[r],d=a[r+1],f=p+d;c.push(3*f/((f+d)/u+(f+p)/_))}}c.push(o[o.length-1]);var g=this._c2s,y=this._c3s;for(r=0;r<c.length-1;r++){var m=c[r],b=o[r],x=1/a[r],v=m+c[r+1]-b-b;g[r]=(b-m-v)*x;y[r]=v*x*x}}}_SplineMono.prototype.interpolate=function(t){var e=this._x.length-1;if(t>=this._x[e])return this._y[e];for(var i,n=0,r=this._c3s.length-1;n<=r;){i=Math.floor(.5*(n+r));var s=this._x[i];if(s<t)n=i+1;else{if(!(s>t))return this._y[i];r=i-1}}e=Math.max(0,r);var a=t-this._x[e];return this._y[e]+a*(this._c1s[e]+a*(this._c2s[e]+a*this._c3s[e]))};_SplineMono.prototype.calculate=function(){if(this._len<=3)return{xs:this._x,ys:this._y};for(var t=[],e=[],i=this._len,n=this._x[0],r=this._x[i-1],s=Math.min(.001*this._len,.2),a=n;a<=r;a+=s){t.push(a);e.push(this.interpolate(a))}return{xs:t,ys:e}};return _SplineMono}(),Palettes=function(){function Palettes(){}Palettes._isExtended=function(t){return-1!==Palettes._values(Palettes.Diverging).indexOf(t)||-1!==Palettes._values(Palettes.Qualitative).indexOf(t)||-1!==Palettes._values(Palettes.SequentialSingle).indexOf(t)||-1!==Palettes._values(Palettes.SequentialMulti).indexOf(t)};Palettes._values=function(t){return Object.keys(t).map((function(e){return t[e]}))};Palettes.standard=["#88bde6","#fbb258","#90cd97","#f6aac9","#bfa554","#bc99c7","#eddd46","#f07e6e","#8c8c8c"];Palettes.cocoa=["#466bb0","#c8b422","#14886e","#b54836","#6e5944","#8b3872","#73b22b","#b87320","#141414"];Palettes.coral=["#84d0e0","#f48256","#95c78c","#efa5d6","#ba8452","#ab95c2","#ede9d0","#e96b7d","#888888"];Palettes.dark=["#005fad","#f06400","#009330","#e400b1","#b65800","#6a279c","#d5a211","#dc0127","#000000"];Palettes.highcontrast=["#ff82b0","#0dda2c","#0021ab","#bcf28c","#19c23b","#890d3a","#607efd","#1b7700","#000000"];Palettes.light=["#ddca9a","#778deb","#cb9fbb","#b5eae2","#7270be","#a6c7a7","#9e95c7","#95b0c7","#9b9b9b"];Palettes.midnight=["#83aaca","#e37849","#14a46a","#e097da","#a26d54","#a584b7","#d89c54","#e86996","#2c343b"];Palettes.modern=["#2d9fc7","#ec993c","#89c235","#e377a4","#a68931","#a672a6","#d0c041","#e35855","#68706a"];Palettes.organic=["#9c88d9","#a3d767","#8ec3c0","#e9c3a9","#91ab36","#d4ccc0","#61bbd8","#e2d76f","#80715a"];Palettes.slate=["#7493cd","#f99820","#71b486","#e4a491","#cb883b","#ae83a4","#bacc5c","#e5746a","#505d65"];Palettes.zen=["#7bb5ae","#e2d287","#92b8da","#eac4cb","#7b8bbd","#c7d189","#b9a0c8","#dfb397","#a9a9a9"];Palettes.cyborg=["#2a9fd6","#77b300","#9933cc","#ff8800","#cc0000","#00cca3","#3d6dcc","#525252","#000000"];Palettes.superhero=["#5cb85c","#f0ad4e","#5bc0de","#d9534f","#9f5bde","#46db8c","#b6b86e","#4e5d6c","#2b3e4b"];Palettes.flatly=["#18bc9c","#3498db","#f39c12","#6cc1be","#99a549","#8f54b5","#e74c3c","#8a9899","#2c3e50"];Palettes.darkly=["#375a7f","#00bc8c","#3498db","#f39c12","#e74c3c","#8f61b3","#b08725","#4a4949","#000000"];Palettes.cerulan=["#033e76","#87c048","#59822c","#53b3eb","#fc6506","#d42323","#e3bb00","#cccccc","#222222"];Palettes.Qualitative={Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"]};Palettes.Diverging={BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]};Palettes.SequentialSingle={Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]};Palettes.SequentialMulti={BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]};return Palettes}();export{Palettes};export var empty={};var PlotArea=function(){function PlotArea(t){this._row=0;this._col=0;this._rect=new Rect(0,0,0,0);copy(this,t)}Object.defineProperty(PlotArea.prototype,"row",{get:function(){return this._row},set:function(t){if(t!=this._row){this._row=asInt(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"column",{get:function(){return this._col},set:function(t){if(t!=this._col){this._col=asInt(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=asString(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"width",{get:function(){return this._width},set:function(t){if(t!=this._width){this._width=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"height",{get:function(){return this._height},set:function(t){if(t!=this._height){this._height=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(PlotArea.prototype,"style",{get:function(){return this._style},set:function(t){if(t!=this._style){this._style=t;this._invalidate()}},enumerable:!0,configurable:!0});PlotArea.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};PlotArea.prototype._render=function(t){t.drawRect(this._rect.left,this._rect.top,this._rect.width,this._rect.height,null,this.style)};PlotArea.prototype._setPlotX=function(t,e){this._rect.left=t;this._rect.width=e};PlotArea.prototype._setPlotY=function(t,e){this._rect.top=t;this._rect.height=e};return PlotArea}();export{PlotArea};var _GridUnitType,PlotAreaCollection=function(t){__extends(PlotAreaCollection,t);function PlotAreaCollection(){return null!==t&&t.apply(this,arguments)||this}PlotAreaCollection.prototype.getPlotArea=function(t){var e=this.indexOf(t);return e>-1?this[e]:null};PlotAreaCollection.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1};PlotAreaCollection.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}};PlotAreaCollection.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}};PlotAreaCollection.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 _GridLength(r)}return this._calculateLengths(t,e,i)};PlotAreaCollection.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 _GridLength(r)}return this._calculateLengths(t,e,i)};PlotAreaCollection.prototype._calculateLengths=function(t,e,i){for(var n=[e],r=0,s=0,a=0;a<e;a++)if(i[a].isAbsolute){n[a]=i[a].value;r+=n[a]}else i[a].isStar?s+=i[a].value:i[a].isAuto&&s++;var o=(t-r)/s;for(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};return PlotAreaCollection}(ObservableArray);export{PlotAreaCollection};!function(t){t[t.Auto=0]="Auto";t[t.Pixel=1]="Pixel";t[t.Star=2]="Star"}(_GridUnitType||(_GridUnitType={}));var _GridLength=function(){function _GridLength(t){void 0===t&&(t=null);this._unitType=_GridUnitType.Auto;if(t)if((t=t.toString()).indexOf("*")>=0){this._unitType=_GridUnitType.Star;t=t.replace("*","");this._value=parseFloat(t);isNumberNaN(+this._value)&&(this._value=1)}else{this._unitType=_GridUnitType.Pixel;this._value=parseFloat(t);if(isNumberNaN(+this._value)){this._unitType=_GridUnitType.Auto;this._value=1}}}Object.defineProperty(_GridLength.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isStar",{get:function(){return this._unitType==_GridUnitType.Star},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isAbsolute",{get:function(){return this._unitType==_GridUnitType.Pixel},enumerable:!0,configurable:!0});Object.defineProperty(_GridLength.prototype,"isAuto",{get:function(){return this._unitType==_GridUnitType.Auto},enumerable:!0,configurable:!0});return _GridLength}(),_SvgRenderEngine=function(){function _SvgRenderEngine(t){this._STROKE_JOIN="round";this._strokeWidth=1;this._fontSize=null;this._fontFamily=null;this._savedGradient={};this._bbCache={};this._baseUrl="";this._cssPriority=!0;this._readOnly=!1;this._isRtl=!1;this._precision=1;this._options=null;this._htmlText=!1;this._element=t;this._create();this._element&&this._element.appendChild(this._svg);var e=navigator.userAgent.toLowerCase();void 0===_SvgRenderEngine._isff&&(_SvgRenderEngine._isff=e.indexOf("firefox")>=0);void 0===_SvgRenderEngine._isSafari&&(_SvgRenderEngine._isSafari=e.indexOf("safari")>-1&&-1==e.indexOf("chrome"))}_SvgRenderEngine.prototype.attach=function(t){this._element=t;if(t){t.insertBefore(this._svg,t.childNodes[0]);t.appendChild(this._svg)}};_SvgRenderEngine.prototype.detach=function(){this._element&&this._element.removeChild(this._svg);for(;this._svg.firstChild;)removeChild(this._svg.firstChild)};_SvgRenderEngine.prototype.beginRender=function(){for(;this._svg.firstChild;)removeChild(this._svg.firstChild);this._savedGradient={};this._bbCache={};this._svg.appendChild(this._defs);this._svg.appendChild(this._textGroup);this._isRtl=this._checkRtl()};_SvgRenderEngine.prototype.endRender=function(){removeChild(this._textGroup)};_SvgRenderEngine.prototype.setViewportSize=function(t,e){this._svg.setAttribute("width",t.toString());this._svg.setAttribute("height",e.toString())};Object.defineProperty(_SvgRenderEngine.prototype,"element",{get:function(){return this._svg},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fill",{get:function(){return this._fill},set:function(t){this._fill=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"fontFamily",{get:function(){return this._fontFamily},set:function(t){this._fontFamily=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"stroke",{get:function(){return this._stroke},set:function(t){this._stroke=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"strokeWidth",{get:function(){return this._strokeWidth},set:function(t){this._strokeWidth=void 0===t?null:t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"textFill",{get:function(){return this._textFill},set:function(t){this._textFill=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"cssPriority",{get:function(){return this._cssPriority},set:function(t){this._cssPriority=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"readOnly",{get:function(){return this._readOnly},set:function(t){this._readOnly=t},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"precision",{get:function(){return this._precision},set:function(t){this._precision=asNumber(t)},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"group",{get:function(){return this._group},enumerable:!0,configurable:!0});Object.defineProperty(_SvgRenderEngine.prototype,"options",{get:function(){return this._options},set:function(t){this._options=t},enumerable:!0,configurable:!0});_SvgRenderEngine.prototype.addClipRect=function(t,e){if(t&&e){var i=this.precision,n=document.createElementNS(_SvgRenderEngine.svgNS,"clipPath"),r=document.createElementNS(_SvgRenderEngine.svgNS,"rect");r.setAttribute("x",(t.left-1).toFixed(i));r.setAttribute("y",(t.top-1).toFixed(i));r.setAttribute("width",(t.width+2).toFixed(i));r.setAttribute("height",(t.height+2).toFixed(i));n.appendChild(r);n.setAttribute("id",e);this._svg.appendChild(n)}};_SvgRenderEngine.prototype.drawEllipse=function(t,e,i,n,r,s){var a=document.createElementNS(_SvgRenderEngine.svgNS,"ellipse"),o=this.precision;this._applyColor(a,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());this._applyColor(a,"fill",this._fill);a.setAttribute("cx",t.toFixed(o));a.setAttribute("cy",e.toFixed(o));a.setAttribute("rx",i.toFixed(o));a.setAttribute("ry",n.toFixed(o));r&&a.setAttribute("class",r);this._applyStyle(a,s);this._appendChild(a);return a};_SvgRenderEngine.prototype.drawRect=function(t,e,i,n,r,s,a){var o=document.createElementNS(_SvgRenderEngine.svgNS,"rect"),l=this.precision;this._applyColor(o,"fill",this._fill);this._applyColor(o,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(o,"stroke-width",this._strokeWidth.toString());o.setAttribute("x",t.toFixed(l));isNumberNaN(+Number(e))||o.setAttribute("y",e.toFixed(l));i>0&&i<.05?o.setAttribute("width","0.1"):o.setAttribute("width",i.toFixed(l));n>0&&n<.05?o.setAttribute("height","0.1"):o.setAttribute("height",n.toFixed(l));a&&this._setClipPath(o,a);r&&o.setAttribute("class",r);this._applyStyle(o,s);this._appendChild(o);return o};_SvgRenderEngine.prototype.drawLine=function(t,e,i,n,r,s){var a=document.createElementNS(_SvgRenderEngine.svgNS,"line"),o=this.precision;this._applyColor(a,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());a.setAttribute("x1",t.toFixed(o));a.setAttribute("x2",i.toFixed(o));a.setAttribute("y1",e.toFixed(o));a.setAttribute("y2",n.toFixed(o));r&&a.setAttribute("class",r);this._applyStyle(a,s);this._appendChild(a);return a};_SvgRenderEngine.prototype.drawLines=function(t,e,i,n,r,s){if(t&&e){var a=s||Math.min(t.length,e.length);if(a>0){var o=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),l=this.precision;this._applyColor(o,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(o,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(o,"stroke-linejoin",this._STROKE_JOIN)}o.setAttribute("fill","none");for(var h="",c=0;c<a;c++)h+=t[c].toFixed(l)+","+e[c].toFixed(l)+" ";o.setAttribute("points",h);i&&o.setAttribute("class",i);r&&this._setClipPath(o,r);this._applyStyle(o,n);this._appendChild(o);return o}}return null};_SvgRenderEngine.prototype.drawSplines=function(t,e,i,n,r,s){if(t&&e){var a=new _Curve(t,e,s,this._options&&this._options.spline).calculate(),o=a.xs,l=a.ys,h=Math.min(o.length,l.length);if(h>0){var c=document.createElementNS(_SvgRenderEngine.svgNS,"polyline"),u=this.precision;this._applyColor(c,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(c,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(c,"stroke-linejoin",this._STROKE_JOIN)}c.setAttribute("fill","none");for(var _="",p=0;p<h;p++)_+=o[p].toFixed(u)+","+l[p].toFixed(u)+" ";c.setAttribute("points",_);i&&c.setAttribute("class",i);r&&this._setClipPath(c,r);this._applyStyle(c,n);this._appendChild(c);return c}}return null};_SvgRenderEngine.prototype.drawPolygon=function(t,e,i,n,r){if(t&&e){var s=Math.min(t.length,e.length);if(s>0){var a=document.createElementNS(_SvgRenderEngine.svgNS,"polygon"),o=this.precision;this._applyColor(a,"stroke",this._stroke);if(null!==this._strokeWidth){this._setAttribute(a,"stroke-width",this._strokeWidth.toString());this._strokeWidth>1&&this._setAttribute(a,"stroke-linejoin",this._STROKE_JOIN)}this._applyColor(a,"fill",this._fill);for(var l="",h=0;h<s;h++)l+=t[h].toFixed(o)+","+e[h].toFixed(o)+" ";a.setAttribute("points",l);i&&a.setAttribute("class",i);r&&this._setClipPath(a,r);this._applyStyle(a,n);this._appendChild(a);return a}}return null};_SvgRenderEngine.prototype.drawPieSegment=function(t,e,i,n,r,s,a,o){if(r>=2*Math.PI)return this.drawEllipse(t,e,i,i,s,a);var l=document.createElementNS(_SvgRenderEngine.svgNS,"path"),h=this.precision;this._applyColor(l,"fill",this._fill);this._applyColor(l,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(l,"stroke-width",this._strokeWidth.toString());var c=new Point(t,e);c.x+=i*Math.cos(n);c.y+=i*Math.sin(n);var u=n+r,_=new Point(t,e);_.x+=i*Math.cos(u);_.y+=i*Math.sin(u);var p=" 0 0,1 ";Math.abs(r)>Math.PI&&(p=" 0 1,1 ");var d="M "+c.x.toFixed(h)+","+c.y.toFixed(h);d+=" A "+i.toFixed(h)+","+i.toFixed(h)+p;d+=_.x.toFixed(h)+","+_.y.toFixed(h);d+=" L "+t.toFixed(h)+","+e.toFixed(h)+" z";l.setAttribute("d",d);o&&this._setClipPath(l,o);s&&l.setAttribute("class",s);this._applyStyle(l,a);this._appendChild(l);return l};_SvgRenderEngine.prototype.drawDonutSegment=function(t,e,i,n,r,s,a,o,l){var h=!1;if(s>=2*Math.PI){h=!0;s-=.001}var c=document.createElementNS(_SvgRenderEngine.svgNS,"path"),u=this.precision+2;this._applyColor(c,"fill",this._fill);this._applyColor(c,"stroke",this._stroke);null!==this._strokeWidth&&this._setAttribute(c,"stroke-width",this._strokeWidth.toString());var _=new Point(t,e);_.x+=i*Math.cos(r);_.y+=i*Math.sin(r);var p=r+s,d=new Point(t,e);d.x+=i*Math.cos(p);d.y+=i*Math.sin(p);var f=new Point(t,e);f.x+=n*Math.cos(p);f.y+=n*Math.sin(p);var g=new Point(t,e);g.x+=n*Math.cos(r);g.y+=n*Math.sin(r);var y=" 0 0,1 ",m=" 0 0,0 ";if(Math.abs(s)>Math.PI){y=" 0 1,1 ";m=" 0 1,0 "}var b="M "+_.x.toFixed(u)+","+_.y.toFixed(u);b+=" A "+i.toFixed(u)+","+i.toFixed(u)+y;b+=" "+d.x.toFixed(u)+","+d.y.toFixed(u);b+=h?" M "+f.x.toFixed(u)+","+f.y.toFixed(u):" L "+f.x.toFixed(u)+","+f.y.toFixed(u);b+=" A "+n.toFixed(u)+","+n.toFixed(u)+m;b+=g.x.toFixed(u)+","+g.y.toFixed(u);h||(b+=" z");c.setAttribute("d",b);l&&this._setClipPath(c,l);a&&c.setAttribute("class",a);this._applyStyle(c,o);this._appendChild(c);return c};_SvgRenderEngine.prototype.drawString=function(t,e,i,n){return this._isHtmlString(t)?this._drawStringHtml(t,e,i,n):this._drawString(t,e,i,n)};_SvgRenderEngine.prototype._isHtmlString=function(t){return this._htmlText&&/<\/?[a-z][\s\S]*>/i.test(t)};_SvgRenderEngine.prototype._drawString=function(t,e,i,n){var r=this._createText(e,t),s=this.precision;i&&r.setAttribute("class",i);this._applyStyle(r,n);this._appendChild(r);var a,o=this._getKey(t,i,this._groupCls);if(this._bbCache[o]){a=this._bbCache[o];r.setAttribute("y",(e.y-(a.y+a.height)).toFixed(s))}else{a=this._getBBox(r);r.setAttribute("y",(e.y-(a.y+a.height-e.y)).toFixed(s))}this._isRtl&&!isIE()&&r.setAttribute("x",(e.x+a.width).toFixed(s));return r};_SvgRenderEngine.prototype._drawStringHtml=function(t,e,i,n){var r=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");r.setAttribute("width","1000");r.setAttribute("height","100");r.setAttribute("x",e.x.toFixed(2));var s=document.createElement("span"),a=this._groupCls;a&&addClass(s,a);i&&addClass(s,i);this._applyStyle(s,n);s.innerHTML=t;r.appendChild(s);this._appendChild(r);var o=s.getBoundingClientRect();r.setAttribute("width",Math.ceil(o.width+2).toFixed(2));r.setAttribute("height",Math.ceil(o.height+1).toFixed(2));r.setAttribute("y",(e.y-o.height).toFixed(2));return r};_SvgRenderEngine.prototype.drawStringRotated=function(t,e,i,n,r,s){return this._isHtmlString(t)?this._drawStringRotatedHtml(t,e,i,n,r,s):this._drawStringRotated(t,e,i,n,r,s)};_SvgRenderEngine.prototype._drawStringRotated=function(t,e,i,n,r,s){var a=this._createText(e,t),o=this.precision;r&&a.setAttribute("class",r);this._applyStyle(a,s);var l=document.createElementNS(_SvgRenderEngine.svgNS,"g");l.setAttribute("transform","rotate("+n.toFixed(o)+","+i.x.toFixed(o)+","+i.y.toFixed(o)+")");l.appendChild(a);this._appendChild(l);var h=this._getBBox(a);a.setAttribute("y",(e.y-(h.y+h.height-e.y)).toFixed(o));this._isRtl&&!isIE()&&a.setAttribute("x",(e.x+h.width).toFixed(o));return a};_SvgRenderEngine.prototype._drawStringRotatedHtml=function(t,e,i,n,r,s){var a=this.precision,o=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");o.setAttribute("width","1000");o.setAttribute("height","100");o.setAttribute("x",e.x.toFixed(2));var l=document.createElement("span"),h=this._groupCls;h&&addClass(l,h);r&&addClass(l,r);this._applyStyle(l,s);l.innerHTML=t;o.appendChild(l);this._appendChild(o);var c=l.getBoundingClientRect();o.setAttribute("width",Math.ceil(c.width+2).toFixed(2));o.setAttribute("height",Math.ceil(c.height+1).toFixed(2));o.setAttribute("y",(e.y-c.height).toFixed(2));var u=document.createElementNS(_SvgRenderEngine.svgNS,"g");u.setAttribute("transform","rotate("+n.toFixed(a)+","+i.x.toFixed(a)+","+i.y.toFixed(a)+")");u.appendChild(o);this._appendChild(u);return o};_SvgRenderEngine.prototype.measureString=function(t,e,i,n){return this._isHtmlString(t)?this._measureStringHtml(t,e,i,n):this._measureString(t,e,i,n)};_SvgRenderEngine.prototype._measureString=function(t,e,i,n){var r=new Size(0,0);if(!this._fontFamily&&!this._fontSize){var s=this._getKey(t,e,i);if(this._bbCache[s])return this._bbCache[s]}if(this.cssPriority){this._fontSize&&this._text.setAttribute("font-size",this._fontSize);this._fontFamily&&this._text.setAttribute("font-family",this._fontFamily)}else{var a={};this._fontSize&&(a.fontSize=this._fontSize);this._fontFamily&&(a.fontFamily=this._fontFamily);Object.keys(a).length>0&&setCss(this._text,a)}e&&this._text.setAttribute("class",e);i&&this._textGroup.setAttribute("class",i);this._applyStyle(this._text,n);this._setText(this._text,t);var o=this._getBBox(this._text);r.width=o.width;r.height=o.height;this._text.removeAttribute("font-size");this._text.removeAttribute("font-family");this._text.removeAttribute("class");this._text.removeAttribute("style");if(n)for(var s in n)this._text.removeAttribute(this._deCase(s));this._textGroup.removeAttribute("class");this._text.textContent=null;if(!this._fontFamily&&!this._fontSize){s=this._getKey(t,e,i);this._bbCache[s]={x:o.x,y:o.y+1e3,width:o.width,height:o.height}}return r};_SvgRenderEngine.prototype._measureStringHtml=function(t,e,i,n){var r=new Size(0,0),s=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");s.setAttribute("width","1000");s.setAttribute("height","100");s.setAttribute("x","-1000");s.setAttribute("y","-1000");var a=document.createElement("span");i&&addClass(a,i);e&&addClass(a,e);this._applyStyle(a,n);a.innerHTML=t;s.appendChild(a);e&&this._text.setAttribute("class",e);this._applyStyle(this._text,n);this._appendChild(s);var o=a.getBoundingClientRect();r.width=o.width;r.height=o.height;s.remove();return r};_SvgRenderEngine.prototype.startGroup=function(t,e,i){void 0===i&&(i=!1);var n=document.createElementNS(_SvgRenderEngine.svgNS,"g");if(t){n.setAttribute("class",t);this._groupCls=t}e&&this._setClipPath(n,e);this._appendChild(n);i&&n.transform.baseVal.appendItem(this._svg.createSVGTransform());this._group=n;return n};_SvgRenderEngine.prototype.endGroup=function(){if(this._group){var t=this._group.parentNode;if(t==this._svg){this._group=null;this._groupCls=null}else{this._group=t;this._groupCls=this._getClass(this._group)}}};_SvgRenderEngine.prototype.drawImage=function(t,e,i,n,r){var s=document.createElementNS(_SvgRenderEngine.svgNS,"image"),a=this.precision;s.setAttributeNS(_SvgRenderEngine.xlinkNS,"href",t);s.setAttribute("x",e.toFixed(a));s.setAttribute("y",i.toFixed(a));s.setAttribute("width",n.toFixed(a));s.setAttribute("height",r.toFixed(a));this._appendChild(s);return s};_SvgRenderEngine.prototype._setClipPath=function(t,e){t.setAttribute("clip-path","url(#"+e+")");_SvgRenderEngine._isSafari&&setCss(t,{"-webkit-clip-path":"url(#"+e+")"})};_SvgRenderEngine.prototype._appendChild=function(t){if(!this.readOnly){var e=this._group;e||(e=this._svg);e.appendChild(t)}};_SvgRenderEngine.prototype._create=function(){this._svg=document.createElementNS(_SvgRenderEngine.svgNS,"svg");this._svg.setAttribute("role","presentation");this._svg.setAttribute("aria-hidden","true");this._defs=document.createElementNS(_SvgRenderEngine.svgNS,"defs");this._svg.appendChild(this._defs);this._text=this._createText(new Point(-1e3,-1e3),"");this._textGroup=document.createElementNS(_SvgRenderEngine.svgNS,"g");this._textGroup.appendChild(this._text);this._svg.appendChild(this._textGroup)};_SvgRenderEngine.prototype._setText=function(t,e){var i=e?e.toString():null;if(i&&i.indexOf("tspan")>=0)try{t.textContent=null;for(var n=new DOMParser,r='<svg xmlns="http://www.w3.org/2000/svg">'+i+"</svg>",s=n.parseFromString(r,"text/xml").documentElement.firstChild;s;){t.appendChild(t.ownerDocument.importNode(s,!0));s=s.nextSibling}}catch(t){throw new Error("Error parsing XML string.")}else t.textContent=i};_SvgRenderEngine.prototype._getKey=function(t,e,i){return t+(e||"")+(i||"")};_SvgRenderEngine.prototype._createText=function(t,e){var i=document.createElementNS(_SvgRenderEngine.svgNS,"text"),n=this.precision;this._setText(i,e);i.setAttribute("x",t.x.toFixed(n));i.setAttribute("y",t.y.toFixed(n));if(this.cssPriority){null!=this._textFill&&i.setAttribute("fill",this._textFill);this._fontSize&&i.setAttribute("font-size",this._fontSize);this._fontFamily&&i.setAttribute("font-family",this._fontFamily)}else{var r={};null!=this._textFill&&(r.fill=this._textFill);this._fontSize&&(r.fontSize=this._fontSize);this._fontFamily&&(r.fontFamily=this._fontFamily);Object.keys(r).length>0&&setCss(i,r)}return i};_SvgRenderEngine.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])};_SvgRenderEngine.prototype._deCase=function(t){return t.replace(/[A-Z]/g,(function(t){return"-"+t.toLowerCase()}))};_SvgRenderEngine.prototype._getClass=function(t){var e;if(t)for(var i=t;i&&!(e=i.getAttribute("class"));i=i.parentNode);return e};_SvgRenderEngine.prototype._getBBox=function(t){if(!_SvgRenderEngine._isff)return t.getBBox();try{return t.getBBox()}catch(t){return{x:0,y:0,width:0,height:0}}};_SvgRenderEngine.prototype._applyColor=function(t,e,i){var n=_GradientColorUtil.tryParse(i);if(null!=n){if(!isString(n)){if(null==this._savedGradient[i]){var r,s="gc"+(1e6*Math.random()).toFixed();if(null!=n.x1){r=document.createElementNS(_SvgRenderEngine.svgNS,"linearGradient");["x1","y1","x2","y2","gradientUnits"].forEach((function(t){null!=n[t]&&r.setAttribute(t,n[t])}))}else if(null!=n.r){r=document.createElementNS(_SvgRenderEngine.svgNS,"radialGradient");["cx","cy","r","fx","fy","fr","gradientUnits"].forEach((function(t){null!=n[t]&&r.setAttribute(t,n[t])}))}n.colors&&n.colors.length>0&&n.colors.forEach((function(t){var e=document.createElementNS(_SvgRenderEngine.svgNS,"stop");null!=t.color&&e.setAttribute("stop-color",t.color);null!=t.offset&&e.setAttribute("offset",t.offset);null!=t.opacity&&e.setAttribute("stop-opacity",t.opacity);r.appendChild(e)}));r.setAttribute("id",s);this._defs.appendChild(r);this._savedGradient[i]=s}n="url("+this._baseUrl+"#"+this._savedGradient[i]+")"}this.cssPriority?t.setAttribute(e,n):this._addInlineStyle(t,e,n)}};_SvgRenderEngine.prototype._addInlineStyle=function(t,e,i){var n={};n[e.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))]=i;setCss(t,n)};_SvgRenderEngine.prototype._setAttribute=function(t,e,i){this.cssPriority?t.setAttribute(e,i):this._addInlineStyle(t,e,i)};_SvgRenderEngine.prototype._checkRtl=function(){return this._element&&hasClass(this._element,UtilitesClsNames.rtl)};_SvgRenderEngine.svgNS="http://www.w3.org/2000/svg";_SvgRenderEngine.xlinkNS="http://www.w3.org/1999/xlink";return _SvgRenderEngine}();export{_SvgRenderEngine};var _GradientColorUtil=function(){function _GradientColorUtil(){}_GradientColorUtil.tryParse=function(t){if(_GradientColorUtil.parsedColor[t])return _GradientColorUtil.parsedColor[t];if(null==t||-1===t.indexOf("-")||-1!==t.indexOf("var("))return t;var e,i=t.replace(/\s+/g,"").split(/-/g),n=i[0][0],r=!1,s=i[0].match(/\(\S+\)/);if(!s||0==s.length)return t;var a=s[0].replace(/[(\\)]/g,"").split(/,/g);if("l"===n||"L"===n){e={x1:"0",y1:"0",x2:"0",y2:"0",colors:[]};"l"===n&&(r=!0);["x1","y1","x2","y2"].forEach((function(t,i){null!=a[i]&&(e[t]=r?100*+a[i]+"%":""+a[i])}))}else if("r"===n||"R"===n){e={cx:"0",cy:"0",r:"0",colors:[]};"r"===n&&(r=!0);["cx","cy","r","fx","fy","fr"].forEach((function(t,i){null!=a[i]&&""!==a[i]&&(e[t]=r?100*+a[i]+"%":""+a[i])}))}r||(e.gradientUnits="userSpaceOnUse");_GradientColorUtil.parsedColor[t]=e;var o=i.length-1;i.forEach((function(t,i){t.indexOf(")")>-1&&(t=t.match(/\)\S+/)[0].replace(")",""));var n=t.split(":"),s={color:"black"};null!=n[0]&&(s.color=n[0]);null!=n[1]?s.offset=r?100*+n[1]+"%":""+n[1]:s.offset=i/o*100+"%";null!=n[2]&&(s.opacity=n[2]);e.colors.push(s)}));return e};_GradientColorUtil.parsedColor={};return _GradientColorUtil}(),SvgRenderEngine=function(t){__extends(SvgRenderEngine,t);function SvgRenderEngine(){return null!==t&&t.apply(this,arguments)||this}return SvgRenderEngine}(_SvgRenderEngine);export{SvgRenderEngine};export var AxisClsNames={axisX:"wj-axis-x",axisXLabels:"wj-axis-x-labels",axisY:"wj-axis-y",axisYLabels:"wj-axis-y-labels",gridline:"wj-gridline",gridlineMinor:"wj-gridline-minor",line:"wj-line",tick:"wj-tick",tickMinor:"wj-tick-minor"};export var DataLabelClsNames={border:"wj-data-label-border",label:"wj-data-label",labels:"wj-data-labels",line:"wj-data-label-line"};export var FlexChartClsNames={footer:"wj-footer",focusLayerHost:"wj-flexchart-focus-layer-host",header:"wj-header",hostElement:"wj-flexchart",label:"wj-label",legend:"wj-legend",plotArea:"wj-plot-area",title:"wj-title",touchDisabled:"wj-flexchart-touch-disabled"};export var FlexPieClsNames={hostElement:"wj-flexpie",slice:"wj-slice",sliceGroup:"wj-slice-group"};export var LegendClsNames={legend:"wj-legend",title:"wj-title"};export var LineMarkerClsNames={container:"wj-chart-linemarker-container",content:"wj-chart-linemarker-content",draggable:"wj-chart-linemarker-draggable",hline:"wj-chart-linemarker-hline",linemarker:"wj-chart-linemarker",vline:"wj-chart-linemarker-vline"};export var SeriesClsNames={group:"wj-series-group"};var Legend=function(){function Legend(t){this._position=Position.Right;this._title="";this._titleAlign="left";this._titlePadding=5;this._areas=[];this._sz=new Size;this._orient=Orientation.Auto;this._scrollbar=!1;this._chart=t}Object.defineProperty(Legend.prototype,"position",{get:function(){return this._position},set:function(t){if((t=asEnum(t,Position))!=this._position){this._position=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"reverse",{get:function(){return this._reverse},set:function(t){if(t!=this._reverse){this._reverse=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"title",{get:function(){return this._title},set:function(t){if(t!=this._title){this._title=asString(t,!1);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"titleAlign",{get:function(){return this._titleAlign},set:function(t){if(t!=this._titleAlign){var e=asString(t,!1);this._titleAlign="right"===e?"right":"center"===e?"center":"left";this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"orientation",{get:function(){return this._orient},set:function(t){if((t=asEnum(t,Orientation))!=this._orient){this._orient=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"maxSize",{get:function(){return this._maxSz},set:function(t){if(t!=this._maxSz){if(isNumber(t))this._maxSz=t;else if(isString(t)){var e=asString(t);assert(FlexChartBase._endsWith(e,"px")||FlexChartBase._endsWith(e,"%"),"number with unit (px or %) expected.");this._maxSz=e}else t&&assert(!1,"number or string expected.");this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"scrollbar",{get:function(){return this._scrollbar},set:function(t){if(t!=this._scrollbar){this._scrollbar=asBoolean(t,!1);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Legend.prototype,"isVertical",{get:function(){return this.orientation==Orientation.Auto?null==this.position||this.position==Position.Auto||this.position==Position.Right||this.position==Position.Left||this.position==Position.LeftTop||this.position==Position.LeftBottom||this.position==Position.RightTop||this.position==Position.RightBottom:this.orientation==Orientation.Vertical},enumerable:!0,configurable:!0});Legend.prototype._getDesiredSize=function(t,e,i,n){if(e==Position.None)return null;var r=new Size;this.title.length>0&&(n-=(r=t.measureString(this.title,LegendClsNames.title,LegendClsNames.legend)).height+this._titlePadding);var s=this._chart._getDesiredLegendSize(t,this.isVertical,i,n);if(null!=s){if(this.title.length>0){s.height+=r.height+this._titlePadding;if(r.width>s.width)if(this.position==Position.Left||this.position==Position.Right||this.position==Position.LeftTop||this.position==Position.LeftBottom||this.position==Position.RightTop||this.position==Position.RightBottom){var a=Math.min(r.width,this._getMaxSize(i));s.width=a;r.width=a}else i>s.width&&i<r.width?s.width=i:i>=r.width&&(s.width=r.width)}this._sz=s.clone();if(this.scrollbar)if(this.isVertical&&s.height>n){s.width+=18;s.height=n}else if(!this.isVertical&&s.width>i){s.width=i;s.height+=18}}return s};Legend.prototype._getPosition=function(t,e){return this.position==Position.Auto?t>=e?Position.Right:Position.Bottom:this.position};Legend.prototype._render=function(t,e,i,n,r){this._areas=[];var s=0;t.fill="transparent";t.stroke=null;t.drawRect(e.x,e.y,n,r);if(this.title.length){var a=e.clone(),o=t.measureString(this.title,LegendClsNames.title+"`");a.y+=o.height;"right"===this.titleAlign?a.x=e.x+n-o.width:"center"===this.titleAlign&&(a.x=e.x+.5*(n-o.width));t.drawString(this.title,a,LegendClsNames.title);s=o.height+this._titlePadding;e.y+=s;r-=s}var l=!1;this.scrollbar&&(this._sz.height>r&&this.isVertical||this._sz.width>n&&!this.isVertical)&&(l=!0);this._chart._renderLegend(t,e,this._areas,this.isVertical,l?n-18:n,r);if(l){r+=s;this._addScrollbar(t,e,n,r,this._sz,this.isVertical,s)}};Legend.prototype._hitTest=function(t){for(var e=this._areas,i=0;i<e.length;i++)if(e[i]&&FlexChartBase._contains(e[i],t))return i;return null};Legend.prototype._addScrollbar=function(t,e,i,n,r,s,a){t.endGroup();var o=100-a/n*100,l=t.element,h=l.children.item(l.children.length-1),c=h.getBoundingClientRect();h.removeAttribute("clip-path");var u=[];h.children.length>0&&u.push(h.children.item(0));a>0&&u.push(h.children.item(1));Array.from(h.querySelectorAll("text,rect")).forEach((function(t){if(-1==u.indexOf(t)){t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))}}));Array.from(h.querySelectorAll("foreignObject")).forEach((function(t){if(-1==u.indexOf(t)){t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))}}));Array.from(h.querySelectorAll("ellipse")).forEach((function(t){t.setAttribute("cx",(+t.getAttribute("cx")-e.x).toFixed(2));t.setAttribute("cy",(+t.getAttribute("cy")-e.y).toFixed(2))}));Array.from(h.querySelectorAll("line")).forEach((function(t){t.setAttribute("x1",(+t.getAttribute("x1")-e.x).toFixed(2));t.setAttribute("y1",(+t.getAttribute("y1")-e.y).toFixed(2));t.setAttribute("x2",(+t.getAttribute("x2")-e.x).toFixed(2));t.setAttribute("y2",(+t.getAttribute("y2")-e.y).toFixed(2))}));var _=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");_.setAttribute("x",e.x.toFixed(2));_.setAttribute("y",e.y.toFixed(2));_.setAttribute("width",i.toFixed(2));_.setAttribute("height",n.toFixed(2));var p=document.createElement("div");p.className="wj-legend-scrollable";setCss(p,s?{width:"100%",height:o+"%",overflowX:"hidden",overflowY:"scroll"}:{width:"100%",height:o+"%",overflowY:"hidden",overflowX:"scroll"});var d=document.createElementNS("http://www.w3.org/2000/svg","svg");d.setAttribute("height",(c.height-a).toFixed(2));var f=c.width;!s&&r.width<f&&(f=r.width);d.setAttribute("width",f.toFixed(2));for(;h.children.length>u.length;){var g=h.children.item(u.length);h.removeChild(g);d.appendChild(g)}p.appendChild(d);_.appendChild(p);h.appendChild(_)};Legend.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};Legend.prototype._getMaxSize=function(t){var e=this.maxSize;if(isNumber(e)){if((n=asNumber(e,!0))>0)return Math.min(n,t)}else{var i=asString(e,!0);if(i)if(FlexChartBase._endsWith(i,"px")){if((n=parseFloat(i.replace("px","")))>0)return Math.min(n,t)}else if(FlexChartBase._endsWith(i,"%")){var n;if((n=parseFloat(i.replace("%","")))>0)return t*Math.min(n,100)/100}}return.5*t};return Legend}();export{Legend};export function _getDefaultAccessibilityAriaLabel(t){var e=[],i=culture.FlexChart.ariaLabels,n=t&&t.title,r=t&&t.type,s=t&&t.series?t.series:[];n&&e.push(format(i.chartTitle,{title:n}));r&&e.push(format(i.chartType,{type:r}));if(s.length){var a=s.map((function(t,e){return format(i.seriesName,{index:e+1,name:_getSeriesDisplayName(t)})})).join(", ");e.push(format(i.seriesSummary,{count:s.length,seriesText:a}))}return e.length?e.join(". ")+".":i.chart+"."}export function _getBaseAccessibilityModel(t,e){return{title:_toAccessibilityText(t&&t.header),type:e||_getAccessibleChartTypeName("chart"),series:[],legendItems:[],annotations:[]}}export function _getUnnamedAccessibilitySeriesName(t){return format(culture.FlexChart.ariaLabels.unnamedSeries,{index:t+1})}export function _getAccessibilityPointDescription(t,e,i,n){var r=culture.FlexChart.ariaLabels,s=t&&t.points?t.points.length:0,a=[r.seriesRegion,format(r.seriesName,{index:i+1,name:_getSeriesDisplayName(t)}),format(r.pointPosition,{index:n+1,count:s})],o=_toAccessibilityText(e&&e.category),l=e&&e.values,h=l&&l.length>1?l.map((function(t){return _toAccessibilityText(t)})).filter((function(t){return!!t})).join(", "):_toAccessibilityText(e&&e.value),c=_toAccessibilityText(e&&e.details);o&&a.push(format(r.pointCategory,{category:o}));h&&a.push(format(r.pointValue,{value:h}));c&&a.push(c);return a.join(". ")+"."}export function _getAccessibilityLegendDescription(t,e,i){return format(culture.FlexChart.ariaLabels.legendItem,{index:e+1,count:i,name:t.name})+"."}export function _getAccessibilityAnnotationDescription(t,e,i){var n=culture.FlexChart.ariaLabels.annotationItem,r=format(n,{index:e+1,count:i,label:t.label});return/[.!?\u3002\uff01\uff1f]$/.test(r)?r:r+"."}export function _getAccessibleChartTypeName(t,e,i,n){var r=culture.FlexChart.ariaLabels;if("string"==typeof t)return r[t]||r.chart;var s=_toAccessibilityTypeText(t&&t[e]);return s?n&&"financial"===n.family?format(r.financialChartTypeName,{type:s}):n&&"radar"===n.family?n.supportsStacking&&1===i?format(r.stackedRadarChartTypeName,{type:s}):n.supportsStacking&&2===i?format(r.stacked100RadarChartTypeName,{type:s}):format(r.radarChartTypeName,{type:s}):format(0===e||1===e?1===i?r.stackedChartTypeName:2===i?r.stacked100ChartTypeName:r.clusteredChartTypeName:r.chartTypeName,{type:s}):r.chart}export function _toAccessibilityText(t){return null==t?"":(isString(t)?toPlainText(t):Globalize.format(t,null)).replace(/\s+/g," ").trim()}export function _toAccessibilityTypeText(t){return null==t?"":t.toString().replace(/([A-Z]+)([A-Z][a-z])/g,"$1 $2").replace(/([a-z\d])([A-Z])/g,"$1 $2").replace(/([A-Za-z])(\d)/g,"$1 $2").replace(/(\d)([A-Za-z])/g,"$1 $2").replace(/\b100\s*pc\b/gi,"100%").replace(/\s+/g," ").trim()}export function _formatAccessibilityValue(t){return null!=t&&isNumberFinite(+t)?Globalize.format(t,null):""}export function _getAccessibilityAriaLabels(){return culture.FlexChart.ariaLabels}export function _formatAccessibilityLabel(t,e){return t?format(t,e):""}export function _joinAccessibilityParts(t){return t.filter((function(t){return!!t})).join(". ")}function _getSeriesDisplayName(t){var e=_toAccessibilityText(t&&t.name),i=_toAccessibilityText(t&&t.description);return i?e?e+", "+i:i:e}var _ChartAccessibilityFocusManager=function(){function _ChartAccessibilityFocusManager(t){this._owner=t}_ChartAccessibilityFocusManager.prototype.update=function(t){this._state=t||null;this._render()};_ChartAccessibilityFocusManager.prototype.refresh=function(){this._render()};_ChartAccessibilityFocusManager.prototype.clear=function(){this._state=null;this._removeLayer()};_ChartAccessibilityFocusManager.prototype._render=function(){var t=_getFocusStateShape(this._owner,this._state);if(this._isValidShape(t)){var e=this._getSvg();e?this._renderShape(e,t):this._removeLayer()}else this._removeLayer()};_ChartAccessibilityFocusManager.prototype._renderShape=function(t,e){var i=this._ensureElement(t,this._getElementName(e));if("rect"===e.type){var n=this._fitRectToSvg(this._inflateRect(e.rect,3),t);i.setAttribute("x",n.left.toFixed(1));i.setAttribute("y",n.top.toFixed(1));i.setAttribute("width",n.width.toFixed(1));i.setAttribute("height",n.height.toFixed(1))}else if("circle"===e.type){i.setAttribute("cx",e.center.x.toFixed(1));i.setAttribute("cy",e.center.y.toFixed(1));i.setAttribute("r",(e.radius+3).toFixed(1))}else"segment"===e.type?i.setAttribute("d",this._getSegmentPath(e,3)):"polygon"===e.type&&i.setAttribute("d",this._getPolygonPath(e,3))};_ChartAccessibilityFocusManager.prototype._ensureElement=function(t,e){if(!this._element||this._element.ownerSVGElement!==t||this._element.tagName.toLowerCase()!==e){this._removeElement();this._element=document.createElementNS("http://www.w3.org/2000/svg",e);this._element.setAttribute("class",FlexChartClsNames.hostElement+"-focus");this._element.setAttribute("aria-hidden","true");this._element.setAttribute("pointer-events","none")}this._element.parentNode===t&&t.lastChild===this._element||t.appendChild(this._element);return this._element};_ChartAccessibilityFocusManager.prototype._removeElement=function(){if(this._element){removeChild(this._element);this._element=null}};_ChartAccessibilityFocusManager.prototype._removeLayer=function(){this._removeElement();if(this._layer){removeChild(this._layer);this._layer=null}this._removeOverlayHostClass()};_ChartAccessibilityFocusManager.prototype._inflateRect=function(t,e){return new Rect(t.left-e,t.top-e,t.width+2*e,t.height+2*e)};_ChartAccessibilityFocusManager.prototype._fitRectToSvg=function(t,e){var i=this._getSvgBounds(e);if(!i)return t;var n=Math.max(t.left,i.left+1),r=Math.max(t.top,i.top+1),s=Math.min(t.right,i.right-1),a=Math.min(t.bottom,i.bottom-1);return s>n&&a>r?new Rect(n,r,s-n,a-r):t};_ChartAccessibilityFocusManager.prototype._getSvgBounds=function(t){var e=t.viewBox&&t.viewBox.baseVal;if(e&&e.width>0&&e.height>0)return new Rect(e.x,e.y,e.width,e.height);var i=this._getSvgLength(t,"width"),n=this._getSvgLength(t,"height");return i>0&&n>0?new Rect(0,0,i,n):null};_ChartAccessibilityFocusManager.prototype._getSvgLength=function(t,e){var i=t.getAttribute(e),n=i&&i.indexOf("%")>=0,r=i&&!n?parseFloat(i):NaN;if(isNumberFinite(+r)&&r>0)return r;if(!n){var s="width"===e?t.width:t.height;if(s&&s.baseVal&&s.baseVal.value>0)return s.baseVal.value}var a=t.getBoundingClientRect();return"width"===e?a.width:a.height};_ChartAccessibilityFocusManager.prototype._getElementName=function(t){return"rect"===t.type?"rect":"circle"===t.type?"circle":"path"};_ChartAccessibilityFocusManager.prototype._isValidShape=function(t){return!!t&&("rect"===t.type?t.rect&&t.rect.width>0&&t.rect.height>0:"circle"===t.type?t.center&&isNumberFinite(+t.radius)&&t.radius>0:"segment"===t.type?t.center&&isNumberFinite(+t.radius)&&t.radius>0&&isNumberFinite(+t.angle)&&isNumberFinite(+t.sweep)&&0!==t.sweep:t.points&&t.points.length>1)};_ChartAccessibilityFocusManager.prototype._getSegmentPath=function(t,e){var i=t.center,n=t.radius+e,r=Math.max((t.innerRadius||0)-e,0),s=this._normalizeSweep(t.sweep),a=t.angle,o=a+s,l=_getAnglePoint(i,n,a),h=_getAnglePoint(i,n,o),c=Math.abs(s)>Math.PI?1:0,u=s>=0?1:0,_=u?0:1;if(r<=0)return"M "+l.x.toFixed(1)+","+l.y.toFixed(1)+" A "+n.toFixed(1)+","+n.toFixed(1)+" 0 "+c+","+u+" "+h.x.toFixed(1)+","+h.y.toFixed(1)+" L "+i.x.toFixed(1)+","+i.y.toFixed(1)+" z";var p=_getAnglePoint(i,r,o),d=_getAnglePoint(i,r,a);return"M "+l.x.toFixed(1)+","+l.y.toFixed(1)+" A "+n.toFixed(1)+","+n.toFixed(1)+" 0 "+c+","+u+" "+h.x.toFixed(1)+","+h.y.toFixed(1)+" L "+p.x.toFixed(1)+","+p.y.toFixed(1)+" A "+r.toFixed(1)+","+r.toFixed(1)+" 0 "+c+","+_+" "+d.x.toFixed(1)+","+d.y.toFixed(1)+" z"};_ChartAccessibilityFocusManager.prototype._normalizeSweep=function(t){var e=2*Math.PI-.001;return Math.abs(t)>=2*Math.PI?t<0?-e:e:t};_ChartAccessibilityFocusManager.prototype._getPolygonPath=function(t,e){void 0===e&&(e=0);for(var i=e?this._inflatePolygon(t.points,e):t.points,n="M "+i[0].x.toFixed(1)+","+i[0].y.toFixed(1),r=1;r<i.length;r++)n+=" L "+i[r].x.toFixed(1)+","+i[r].y.toFixed(1);return n+" z"};_ChartAccessibilityFocusManager.prototype._getSvg=function(){var t=this._owner,e=t&&t._currentRenderEngine?t._currentRenderEngine.element:null;if(e&&e.tagName&&"svg"===e.tagName.toLowerCase()){this._layer&&this._removeLayer();return e}return this._getOverlaySvg(e)};_ChartAccessibilityFocusManager.prototype._getOverlaySvg=function(t){var e=this._owner,i=e&&e.hostElement,n=e&&e._rectChart;if(!i||!n)return null;this._ensureOverlayHostClass(i);if(!this._layer){this._layer=document.createElementNS("http://www.w3.org/2000/svg","svg");this._layer.setAttribute("class",FlexChartClsNames.hostElement+"-focus-layer");this._layer.setAttribute("aria-hidden","true");this._layer.setAttribute("focusable","false")}this._syncOverlaySvg(t);this._layer.parentElement===i&&this._layer===i.lastChild||i.appendChild(this._layer);return this._layer};_ChartAccessibilityFocusManager.prototype._ensureOverlayHostClass=function(t){"static"===getComputedStyle(t).position&&addClass(t,FlexChartClsNames.focusLayerHost)};_ChartAccessibilityFocusManager.prototype._removeOverlayHostClass=function(){var t=this._owner&&this._owner.hostElement;t&&removeClass(t,FlexChartClsNames.focusLayerHost)};_ChartAccessibilityFocusManager.prototype._syncOverlaySvg=function(t){var e=this._layer,i=this._owner.hostElement,n=this._owner._rectChart,r=0,s=0,a=n.width,o=n.height;if(t&&t.parentElement===i&&null!=t.offsetWidth){var l=t;r=l.offsetLeft||0;s=l.offsetTop||0;a=l.offsetWidth||a;o=l.offsetHeight||o}e.setAttribute("width",a.toFixed(1));e.setAttribute("height",o.toFixed(1));e.setAttribute("viewBox","0 0 "+a.toFixed(1)+" "+o.toFixed(1));e.style.left=r+"px";e.style.top=s+"px";e.style.width=a+"px";e.style.height=o+"px"};_ChartAccessibilityFocusManager.prototype._inflatePolygon=function(t,e){var i=_getPolygonRect(t),n=i.left+i.width/2,r=i.top+i.height/2;return t.map((function(t){var i=t.x-n,s=t.y-r,a=Math.sqrt(i*i+s*s);return a?new Point(t.x+e*i/a,t.y+e*s/a):t}))};return _ChartAccessibilityFocusManager}();export{_ChartAccessibilityFocusManager};export function _getRectFocusShape(t){return t?{type:"rect",rect:t}:null}export function _getFocusStateShape(t,e){if(!e||!t)return null;if("chart"===e.region)return _getRectFocusShape(t._rectChart);if("title"===e.region)return _getRectFocusShape(t._rectHeader);if("series"===e.region&&t._getAccessibilitySeriesPointShape)return t._getAccessibilitySeriesPointShape(e.seriesIndex,e.pointIndex);if("annotation"===e.region&&t._getAccessibilityAnnotationShape){var i=(n=t._accessibilityModel)&&n.annotations?n.annotations[e.annotationIndex]:null;return t._getAccessibilityAnnotationShape(i,e.annotationIndex)}if("legend"===e.region&&t._getAccessibilityLegendItemShape){var n;i=(n=t._accessibilityModel)&&n.legendItems?n.legendItems[e.legendIndex]:null;return t._getAccessibilityLegendItemShape(i,e.legendIndex)}return null}export function _getFocusShapeRect(t){return t?"rect"===t.type?t.rect:"circle"===t.type||"segment"===t.type?new Rect(t.center.x-t.radius,t.center.y-t.radius,2*t.radius,2*t.radius):"polygon"===t.type&&t.points&&t.points.length?_getPolygonRect(t.points):null:null}export function _getAreaShape(t){if(!t)return null;if(t.rect)return _getRectFocusShape(t.rect);if(t.center&&isNumberFinite(+t.radius)&&isNumberFinite(+t.angle)&&isNumberFinite(+t.sweep))return!t.innerRadius&&Math.abs(t.sweep)>=2*Math.PI-.001?{type:"circle",center:t.center,radius:t.radius}:{type:"segment",center:t.center,radius:t.radius,innerRadius:t.innerRadius,angle:t.angle,sweep:t.sweep};var e=null!=t.radius?t.radius:t._rad;return t.center&&e?{type:"circle",center:t.center,radius:e}:t._startPoint&&null!=t._width&&null!=t._height?_getFunnelShape(t):null}function _getPolygonRect(t){for(var e=t[0].x,i=t[0].x,n=t[0].y,r=t[0].y,s=1;s<t.length;s++){var a=t[s];e=Math.min(e,a.x);i=Math.max(i,a.x);n=Math.min(n,a.y);r=Math.max(r,a.y)}return new Rect(e,n,i-e,r-n)}function _getFunnelShape(t){var e=t._startPoint,i=t._width,n=t._height,r=t._offsetX||0,s=t._offsetY||0,a=t._neckHeight||0;return e&&isNumberFinite(+i)&&isNumberFinite(+n)?{type:"polygon",points:t._rotated?a>0?[new Point(e.x+r,e.y),new Point(e.x+i-r,e.y),new Point(e.x+i-r,e.y+a),new Point(e.x+i,e.y+n),new Point(e.x,e.y+n),new Point(e.x+r,e.y+a)]:[new Point(e.x+r,e.y),new Point(e.x+i-r,e.y),new Point(e.x+i,e.y+n),new Point(e.x,e.y+n)]:a>0?[new Point(e.x,e.y),new Point(e.x+i,e.y),new Point(e.x+i-r,e.y+s),new Point(e.x+i-r,e.y+n),new Point(e.x+r,e.y+n),new Point(e.x+r,e.y+s)]:[new Point(e.x,e.y),new Point(e.x+i,e.y),new Point(e.x+i-r,e.y+s),new Point(e.x+r,e.y+s)]}:null}function _getAnglePoint(t,e,i){return new Point(t.x+e*Math.cos(i),t.y+e*Math.sin(i))}var _ChartAccessibilityKeyboardManager=function(){function _ChartAccessibilityKeyboardManager(t){this._regions=[];this._regionElements={};this._seriesIndex=0;this._pointIndex=0;this._annotationIndex=0;this._legendIndex=0;this._restoreFocusLost=!1;this._tabKeyShift=!1;this._owner=t}_ChartAccessibilityKeyboardManager.prototype.clear=function(){this._clearFocus();this._clearFocusRestore();this._pendingLegendAnnouncement=null;this._statusElement&&(this._statusElement.textContent="");this._activeRegion=null;this._regions.length=0;for(var t in this._regionElements)removeChild(this._regionElements[t]);this._container&&removeChild(this._container)};_ChartAccessibilityKeyboardManager.prototype.update=function(){var t=this._owner.hostElement,e=this._owner._accessibilityModel;if(t&&e){this._ensureContainer(t);var i=this._regions;this._regions=[];e.title&&this._addRegion("title",format(culture.FlexChart.ariaLabels.chartTitle,{title:e.title}));var n=this._getNearestSeriesPoint(this._seriesIndex,this._pointIndex);if(n){this._seriesIndex=n.seriesIndex;this._pointIndex=n.pointIndex;this._addRegion("series",this._getSeriesRegionLabel())}if(e.annotations&&e.annotations.length){this._annotationIndex=Math.min(this._annotationIndex,e.annotations.length-1);this._addRegion("annotation",this._getAnnotationRegionLabel())}if(e.legendItems&&e.legendItems.length){this._legendIndex=Math.min(this._legendIndex,e.legendItems.length-1);this._addRegion("legend",this._getLegendRegionLabel())}this._removeUnusedRegions(i);if(this._activeRegion&&!this._getRegion(this._activeRegion)){this._clearFocusRestore(this._activeRegion);this._activeRegion=null;this._clearFocus()}else{this._syncFocus();this._completeFocusRestore()}this._announcePendingLegendChange()}};_ChartAccessibilityKeyboardManager.prototype.activate=function(t){if(!t||"chart"===t.region)return!1;var e=t.region;if(!this._getRegion(e))return!1;this._activeRegion=e;"series"===e?this._setSeriesFocusIndex(t.seriesIndex,t.pointIndex):"annotation"===e&&null!=t.annotationIndex?this._setAnnotationFocusIndex(t.annotationIndex):"legend"===e&&null!=t.legendIndex&&this._setLegendFocusIndex(t.legendIndex);this._updateRegionLabel(e);this._syncFocus();return!0};_ChartAccessibilityKeyboardManager.prototype._ensureContainer=function(t){if(!this._container){this._container=document.createElement("div");addClass(this._container,FlexChartClsNames.hostElement+"-accessibility");setAttribute(this._container,"style","position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;");this._statusElement=document.createElement("span");addClass(this._statusElement,"wj-sr-only");setAttribute(this._statusElement,"role","status");setAttribute(this._statusElement,"aria-live","polite");setAttribute(this._statusElement,"aria-atomic","true");this._container.appendChild(this._statusElement)}this._container.parentElement===t&&this._container===t.firstChild||t.insertBefore(this._container,t.firstChild)};_ChartAccessibilityKeyboardManager.prototype._removeUnusedRegions=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];this._getRegion(n.type)||removeChild(n.element)}};_ChartAccessibilityKeyboardManager.prototype._addRegion=function(t,e){var i=this._getRegionElement(t);this._setRegionLabel(i,e);this._container.appendChild(i);this._regions.push({type:t,element:i})};_ChartAccessibilityKeyboardManager.prototype._getRegionElement=function(t){var e=this._regionElements[t];if(!e){e=document.createElement("div");setAttribute(e,"tabindex","0");this._owner.addEventListener(e,"keydown",this._onRegionKeyDown.bind(this,t),!1,!1);this._owner.addEventListener(e,"focus",this._onRegionFocus.bind(this,t),!1,!1);this._owner.addEventListener(e,"blur",this._onRegionBlur.bind(this,t),!1,!1);this._regionElements[t]=e}this._updateRegionSemantics(t,e);return e};_ChartAccessibilityKeyboardManager.prototype._updateRegionSemantics=function(t,e){setAttribute(e,"aria-pressed",null);if("legend"===t){if(null!=this._getCurrentLegendItemState()){setAttribute(e,"role","button");return}}setAttribute(e,"role","group")};_ChartAccessibilityKeyboardManager.prototype._onRegionFocus=function(t){this._activeRegion=t;this._updateRegionLabel(t);this._syncFocus()};_ChartAccessibilityKeyboardManager.prototype._onRegionBlur=function(t,e){if(this._activeRegion===t){if(this._shouldRestoreFocusAfterBlur(t,e.relatedTarget)){this._restoreFocusLost=!0;this._syncFocus();this._completeFocusRestore();return}this._clearFocusRestore(t);this._activeRegion=null;e.relatedTarget===this._owner.hostElement&&this._owner._setAccessibilityFocus&&(this._shouldShowHostFocus()||this._isShiftTabbingToHost(t))?this._owner._setAccessibilityFocus({region:"chart"}):this._clearFocus();this._clearTabKeyState(t)}};_ChartAccessibilityKeyboardManager.prototype._onRegionKeyDown=function(t,e){var i=this,n=!1,r=this._getScrollPositions(e.target);if("Tab"!==e.key){!this._restoreFocusRegion||this._restoreFocusLost||"legend"===t&&this._isLegendActivationKey(e.key)||this._clearFocusRestore();"series"===t?n=this._handleSeriesKey(e.key):"annotation"===t?n=this._handleAnnotationKey(e.key):"legend"===t&&(n=this._handleLegendKey(e.key));if(n){e.preventDefault();e.stopPropagation();this._updateRegionLabel(t);this._syncFocus();if(this._shouldRestoreScroll(e.key)){this._restoreScrollPositions(r);window.setTimeout((function(){return i._restoreScrollPositions(r)}),0)}}}else{this._clearFocusRestore();this._tabKeyRegion=t;this._tabKeyShift=e.shiftKey}};_ChartAccessibilityKeyboardManager.prototype._shouldRestoreScroll=function(t){return"ArrowLeft"===t||"ArrowRight"===t||"ArrowUp"===t||"ArrowDown"===t||"Home"===t||"End"===t};_ChartAccessibilityKeyboardManager.prototype._getScrollPositions=function(t){for(var e=[{left:window.pageXOffset,top:window.pageYOffset}],i=t&&t.parentElement;i;i=i.parentElement)(i.scrollWidth>i.clientWidth||i.scrollHeight>i.clientHeight)&&e.push({element:i,left:i.scrollLeft,top:i.scrollTop});return e};_ChartAccessibilityKeyboardManager.prototype._restoreScrollPositions=function(t){for(var e=0,i=t;e<i.length;e++){var n=i[e];if(n.element){n.element.scrollLeft=n.left;n.element.scrollTop=n.top}else window.scrollTo(n.left,n.top)}};_ChartAccessibilityKeyboardManager.prototype._handleSeriesKey=function(t){var e=this._owner._accessibilityModel,i=e&&e.series?e.series[this._seriesIndex]:null;if(!i||!i.points||!i.points.length)return!1;switch(t){case"ArrowLeft":this._pointIndex=Math.max(0,this._pointIndex-1);return!0;case"ArrowRight":this._pointIndex=Math.min(i.points.length-1,this._pointIndex+1);return!0;case"ArrowUp":return this._moveSeries(-1);case"ArrowDown":return this._moveSeries(1);case"Home":this._pointIndex=0;return!0;case"End":this._pointIndex=i.points.length-1;return!0}return!1};_ChartAccessibilityKeyboardManager.prototype._handleAnnotationKey=function(t){var e=this._owner._accessibilityModel,i=e&&e.annotations?e.annotations:[];if(!i.length)return!1;switch(t){case"ArrowLeft":case"ArrowUp":this._annotationIndex=Math.max(0,this._annotationIndex-1);return!0;case"ArrowRight":case"ArrowDown":this._annotationIndex=Math.min(i.length-1,this._annotationIndex+1);return!0;case"Home":this._annotationIndex=0;return!0;case"End":this._annotationIndex=i.length-1;return!0}return!1};_ChartAccessibilityKeyboardManager.prototype._handleLegendKey=function(t){var e=this._owner._accessibilityModel,i=e&&e.legendItems?e.legendItems:[];if(!i.length)return!1;switch(t){case"ArrowLeft":this._legendIndex=Math.max(0,this._legendIndex-1);return!0;case"ArrowRight":this._legendIndex=Math.min(i.length-1,this._legendIndex+1);return!0;case"ArrowUp":return this._moveLegendSeries(-1);case"ArrowDown":return this._moveLegendSeries(1);case"Home":this._legendIndex=0;return!0;case"End":this._legendIndex=i.length-1;return!0;case"Enter":case" ":case"Spacebar":if(this._owner._activateAccessibilityLegendItem){var n=i[this._legendIndex];if(!n||!this._owner._getAccessibilityLegendItemState||null==this._owner._getAccessibilityLegendItemState(n))return!1;this._queueFocusRestore("legend");var r=this._owner._activateAccessibilityLegendItem(n);r?this._queueLegendAnnouncement(this._getLegendItemVisibilityLabel(n)):this._clearFocusRestore("legend");return r}return!1}return!1};_ChartAccessibilityKeyboardManager.prototype._queueLegendAnnouncement=function(t){this._pendingLegendAnnouncement=t;this._statusElement.textContent=""};_ChartAccessibilityKeyboardManager.prototype._announcePendingLegendChange=function(){if(this._pendingLegendAnnouncement&&this._statusElement){this._statusElement.textContent=this._pendingLegendAnnouncement;this._pendingLegendAnnouncement=null}};_ChartAccessibilityKeyboardManager.prototype._isLegendActivationKey=function(t){return"Enter"===t||" "===t||"Spacebar"===t};_ChartAccessibilityKeyboardManager.prototype._moveSeries=function(t){var e=this._owner._accessibilityModel,i=e&&e.series?e.series:[];if(!t)return!1;for(var n=this._seriesIndex+t;n>=0&&n<i.length;n+=t)if(i[n].points&&i[n].points.length){this._seriesIndex=n;this._pointIndex=Math.min(this._pointIndex,i[n].points.length-1);return!0}return!0};_ChartAccessibilityKeyboardManager.prototype._moveLegendSeries=function(t){var e=this._owner._accessibilityModel,i=e&&e.legendItems?e.legendItems:[],n=i[this._legendIndex];if(!n||null==n.seriesIndex)return!1;if(!t)return!1;for(var r=this._legendIndex+t;r>=0&&r<i.length;r+=t)if(i[r].seriesIndex!==n.seriesIndex){this._legendIndex=r;return!0}this._legendIndex=Math.max(0,Math.min(i.length-1,this._legendIndex+t));return!0};_ChartAccessibilityKeyboardManager.prototype._getNearestSeriesPoint=function(t,e){var i=this._owner._accessibilityModel,n=i&&i.series?i.series:[];if(!n.length)return null;for(var r=Math.min(t,n.length-1);r<n.length;r++)if(n[r].points&&n[r].points.length)return{seriesIndex:r,pointIndex:Math.min(e,n[r].points.length-1)};for(r=Math.min(t,n.length-1);r>=0;r--)if(n[r].points&&n[r].points.length)return{seriesIndex:r,pointIndex:Math.min(e,n[r].points.length-1)};return null};_ChartAccessibilityKeyboardManager.prototype._setSeriesFocusIndex=function(t,e){var i=this._owner._accessibilityModel,n=i&&i.series?i.series:[],r=n.findIndex((function(e){return e.index===t})),s=(r>=0&&n[r].points?n[r].points:[]).findIndex((function(t){return t.index===e}));if(r>=0&&s>=0){this._seriesIndex=r;this._pointIndex=s}};_ChartAccessibilityKeyboardManager.prototype._setAnnotationFocusIndex=function(t){var e=this._owner._accessibilityModel,i=e&&e.annotations?e.annotations:[];i.length&&(this._annotationIndex=Math.max(0,Math.min(t,i.length-1)))};_ChartAccessibilityKeyboardManager.prototype._setLegendFocusIndex=function(t){var e=this._owner._accessibilityModel,i=e&&e.legendItems?e.legendItems:[];i.length&&(this._legendIndex=Math.max(0,Math.min(t,i.length-1)))};_ChartAccessibilityKeyboardManager.prototype._updateRegionLabel=function(t){var e=this._getRegion(t);if(e){this._updateRegionSemantics(t,e.element);this._setRegionLabel(e.element,this._getRegionLabel(t))}};_ChartAccessibilityKeyboardManager.prototype._setRegionLabel=function(t,e){e=e||"";t.getAttribute("aria-label")!==e&&setAttribute(t,"aria-label",e);t.textContent&&(t.textContent="")};_ChartAccessibilityKeyboardManager.prototype._getRegionLabel=function(t){if("title"===t){var e=this._owner._accessibilityModel;return format(culture.FlexChart.ariaLabels.chartTitle,{title:e&&e.title})}return"series"===t?this._getSeriesRegionLabel():"annotation"===t?this._getAnnotationRegionLabel():this._getLegendRegionLabel()};_ChartAccessibilityKeyboardManager.prototype._getSeriesRegionLabel=function(){var t=this._owner._accessibilityModel,e=t&&t.series?t.series[this._seriesIndex]:null,i=e&&e.points?e.points[this._pointIndex]:null;return e&&i?_getAccessibilityPointDescription(e,i,this._seriesIndex,this._pointIndex):culture.FlexChart.ariaLabels.seriesRegion};_ChartAccessibilityKeyboardManager.prototype._getAnnotationRegionLabel=function(){var t=this._owner._accessibilityModel,e=t&&t.annotations?t.annotations:[],i=e[this._annotationIndex];return i?_getAccessibilityAnnotationDescription(i,this._annotationIndex,e.length):culture.FlexChart.ariaLabels.annotationRegion};_ChartAccessibilityKeyboardManager.prototype._getLegendRegionLabel=function(){var t=this._owner._accessibilityModel,e=t&&t.legendItems?t.legendItems:[],i=e[this._legendIndex];if(!i)return culture.FlexChart.ariaLabels.legendRegion;var n=null==this._getLegendItemState(i)?i.name:this._getLegendItemVisibilityLabel(i);return _getAccessibilityLegendDescription(__assign({},i,{name:n}),this._legendIndex,e.length)};_ChartAccessibilityKeyboardManager.prototype._getCurrentLegendItemState=function(){var t=this._owner._accessibilityModel,e=t&&t.legendItems?t.legendItems:[];return this._getLegendItemState(e[this._legendIndex])};_ChartAccessibilityKeyboardManager.prototype._getLegendItemState=function(t){return t&&this._owner._getAccessibilityLegendItemState?this._owner._getAccessibilityLegendItemState(t):null};_ChartAccessibilityKeyboardManager.prototype._getLegendItemVisibilityLabel=function(t){var e=this._getLegendItemState(t);if(null==e)return t.name;var i=culture.FlexChart.ariaLabels,n=e?i.legendSeriesShown||"{name} shown":i.legendSeriesHidden||"{name} hidden";return format(n,{name:t.name})};_ChartAccessibilityKeyboardManager.prototype._getRegion=function(t){for(var e=0,i=this._regions;e<i.length;e++){var n=i[e];if(n.type===t)return n}return null};_ChartAccessibilityKeyboardManager.prototype._syncFocus=function(){if(this._activeRegion&&this._owner._setAccessibilityFocus){this._focusActiveRegionElement();var t={region:this._activeRegion};if("series"===this._activeRegion){var e=this._getCurrentSeries(),i=e&&e.points?e.points[this._pointIndex]:null;t.seriesIndex=e&&null!=e.index?e.index:this._seriesIndex;t.pointIndex=i&&null!=i.index?i.index:this._pointIndex}else"annotation"===this._activeRegion?t.annotationIndex=this._annotationIndex:"legend"===this._activeRegion&&(t.legendIndex=this._legendIndex);this._owner._setAccessibilityFocus(t);this._owner._showAccessibilityTooltip&&this._owner._showAccessibilityTooltip(t)}};_ChartAccessibilityKeyboardManager.prototype._queueFocusRestore=function(t){this._restoreFocusRegion=t;this._restoreFocusLost=!1};_ChartAccessibilityKeyboardManager.prototype._clearFocusRestore=function(t){if(!t||this._restoreFocusRegion===t){this._restoreFocusRegion=null;this._restoreFocusLost=!1}};_ChartAccessibilityKeyboardManager.prototype._completeFocusRestore=function(){var t=this._getRegion(this._restoreFocusRegion);this._restoreFocusLost&&t&&document.activeElement===t.element&&this._clearFocusRestore(this._restoreFocusRegion)};_ChartAccessibilityKeyboardManager.prototype._shouldRestoreFocusAfterBlur=function(t,e){return this._restoreFocusRegion===t&&(!e||e===document.body||e===this._owner.hostElement)};_ChartAccessibilityKeyboardManager.prototype._shouldShowHostFocus=function(){return!this._owner._shouldShowAccessibilityFocus||this._owner._shouldShowAccessibilityFocus()};_ChartAccessibilityKeyboardManager.prototype._isShiftTabbingToHost=function(t){return this._tabKeyRegion===t&&this._tabKeyShift};_ChartAccessibilityKeyboardManager.prototype._clearTabKeyState=function(t){if(!t||this._tabKeyRegion===t){this._tabKeyRegion=null;this._tabKeyShift=!1}};_ChartAccessibilityKeyboardManager.prototype._focusActiveRegionElement=function(){var t=this._getRegion(this._activeRegion);if(t&&document.activeElement!==t.element&&t.element.focus)try{t.element.focus({preventScroll:!0})}catch(e){t.element.focus()}};_ChartAccessibilityKeyboardManager.prototype._getCurrentSeries=function(){var t=this._owner._accessibilityModel;return t&&t.series?t.series[this._seriesIndex]:null};_ChartAccessibilityKeyboardManager.prototype._clearFocus=function(){this._owner._clearAccessibilityFocus&&this._owner._clearAccessibilityFocus();this._owner._hideAccessibilityTooltip&&this._owner._hideAccessibilityTooltip()};return _ChartAccessibilityKeyboardManager}();export{_ChartAccessibilityKeyboardManager};_addCultureInfo("FlexChart",{ariaLabels:{chart:"Chart",chartTitle:"Chart title: {title}",chartType:"type: {type}",seriesSummary:"There are {count} series in this chart, {seriesText}",seriesName:"series {index} {name}",unnamedSeries:"Series {index}",chartTypeName:"{type} chart",comboChart:"Combo chart",waterfallChart:"Waterfall chart",boxWhiskerChart:"Box Whisker chart",breakEvenChart:"Break Even chart",clusteredChartTypeName:"Clustered {type} chart",stackedChartTypeName:"Stacked {type} chart",stacked100ChartTypeName:"100% Stacked {type} chart",pieChart:"Pie chart",doughnutChart:"Doughnut chart",sunburstChart:"Sunburst chart",treeMapChart:"TreeMap chart",mapChart:"Map chart",mapZoomIn:"Zoom in",mapZoomOut:"Zoom out",radarChartTypeName:"Radar {type} chart",stackedRadarChartTypeName:"Stacked Radar {type} chart",stacked100RadarChartTypeName:"100% Stacked Radar {type} chart",financialChartTypeName:"Financial {type} chart",seriesRegion:"Series region",annotationRegion:"Annotations region",legendRegion:"Legend region",pointPosition:"Point {index} of {count}",pointCategory:"Category {category}",pointValue:"Value {value}",annotationItem:"Annotation {index} of {count}: {label}",legendItem:"Legend item {index} of {count}: {name}",legendSeriesHidden:"{name} hidden",legendSeriesShown:"{name} shown",rangeStartHandle:"Range start handle",rangeEndHandle:"Range end handle",analyticsSeriesBoxWhisker:"Box whisker series",analyticsSeriesWaterfall:"Waterfall series",analyticsSeriesBreakEven:"Break even analysis",analyticsSeriesErrorBar:"Error bar",analyticsSeriesTrendLine:"Trend line",analyticsSeriesMovingAverage:"Moving average",analyticsSeriesFunctionSeries:"Function series",analyticsSeriesGeneric:"Analytics series",analyticsLabelMin:"Min {value}",analyticsLabelQ1:"Q1 {value}",analyticsLabelMedian:"Median {value}",analyticsLabelQ3:"Q3 {value}",analyticsLabelMax:"Max {value}",analyticsLabelMean:"Mean {value}",analyticsLabelOutliers:"Outliers {values}",analyticsLabelQuartileCalculation:"Quartile calculation {type}",analyticsLabelShowsMeanMarker:"Shows mean marker",analyticsLabelShowsMeanLine:"Shows mean line",analyticsLabelShowsOutliers:"Shows outliers",analyticsLabelShowsInnerPoints:"Shows inner points",analyticsLabelBoxWhiskerStatistics:"Box whisker statistics",analyticsLabelRelativeChanges:"Relative changes",analyticsLabelAbsoluteValues:"Absolute values",analyticsLabelStartValue:"Start value {value}",analyticsLabelIncludesIntermediateTotals:"Includes intermediate totals",analyticsLabelIncludesTotal:"Includes total {totalLabel}",analyticsLabelStartBar:"Start bar",analyticsLabelIntermediateTotalBar:"Intermediate total bar",analyticsLabelTotalBar:"Total bar",analyticsLabelRisingBar:"Rising bar",analyticsLabelFallingBar:"Falling bar",analyticsLabelTotalValue:"Total value {value}",analyticsLabelChange:"Change {value}",analyticsLabelCumulativeValue:"Cumulative value {value}",analyticsLabelStart:"Start",analyticsLabelFixedCost:"Fixed cost {value}",analyticsLabelVariableCost:"Variable cost {value}",analyticsLabelSalesPrice:"Sales price {value}",analyticsLabelBreakEvenQuantity:"Break-even quantity {value}",analyticsLabelBreakEvenRevenue:"Break-even revenue {value}",analyticsLabelSalesRevenue:"Sales revenue {value}",analyticsLabelTotalCost:"Total cost {value}",analyticsLabelMarginalProfit:"Marginal profit {value}",analyticsLabelQuantity:"Quantity {value}",analyticsLabelErrorAmount:"Error amount {type}",analyticsLabelDirection:"Direction {dir}",analyticsLabelEndStyle:"End style {style}",analyticsLabelPositiveError:"Positive error {value}",analyticsLabelNegativeError:"Negative error {value}",analyticsLabelFitType:"Fit type {type}",analyticsLabelSampleCount:"Sample count {count}",analyticsLabelOrder:"Order {order}",analyticsLabelType:"Type {type}",analyticsLabelPeriod:"Period {period}",analyticsLabelRange:"Range {min} to {max}",financialAnalyticsSeriesATR:"Average True Range",financialAnalyticsSeriesCCI:"Commodity Channel Index",financialAnalyticsSeriesRSI:"Relative Strength Index",financialAnalyticsSeriesWilliamsR:"Williams %R",financialAnalyticsSeriesBollingerBands:"Bollinger bands",financialAnalyticsSeriesEnvelopes:"Moving average envelopes",financialAnalyticsSeriesMacd:"MACD indicator",financialAnalyticsSeriesMacdHistogram:"MACD histogram",financialAnalyticsSeriesStochastic:"Stochastic oscillator",financialAnalyticsSeriesFibonacciRetracements:"Fibonacci retracements",financialAnalyticsSeriesFibonacciArcs:"Fibonacci arcs",financialAnalyticsSeriesFibonacciFans:"Fibonacci fans",financialAnalyticsSeriesFibonacciTimeZones:"Fibonacci time zones",financialAnalyticsLabelConstant:"Constant {value}",financialAnalyticsLabelMultiplier:"Multiplier {value}",financialAnalyticsLabelSize:"Size {value}",financialAnalyticsLabelUpperBand:"Upper band {value}",financialAnalyticsLabelMiddleBand:"Middle band {value}",financialAnalyticsLabelLowerBand:"Lower band {value}",financialAnalyticsLabelUpperEnvelope:"Upper envelope {value}",financialAnalyticsLabelLowerEnvelope:"Lower envelope {value}",financialAnalyticsLabelFastPeriod:"Fast period {period}",financialAnalyticsLabelSlowPeriod:"Slow period {period}",financialAnalyticsLabelSmoothingPeriod:"Smoothing period {period}",financialAnalyticsLabelMacdLine:"MACD line {value}",financialAnalyticsLabelSignalLine:"Signal line {value}",financialAnalyticsLabelKPeriod:"%K period {period}",financialAnalyticsLabelDPeriod:"%D period {period}",financialAnalyticsLabelKValue:"%K {value}",financialAnalyticsLabelDValue:"%D {value}",financialAnalyticsLabelDataPoint:"{name} x {x}, y {y}",financialAnalyticsLabelEnd:"End",financialAnalyticsLabelLevels:"Levels {levels}",financialAnalyticsLabelUptrend:"Uptrend",financialAnalyticsLabelDowntrend:"Downtrend",financialAnalyticsLabelStartX:"Start x {value}",financialAnalyticsLabelEndX:"End x {value}",financialAnalyticsLabelFibonacciRetracementLevel:"Fibonacci retracement level {level}%. Price {price}",financialAnalyticsLabelFibonacciArcLevel:"Fibonacci arc level {level}%",financialAnalyticsLabelFibonacciFanLevel:"Fibonacci fan level {level}%",financialAnalyticsLabelFibonacciTimeZoneLevel:"Fibonacci time zone level {level}. X {x}",ohlcHigh:"High {value}",ohlcLow:"Low {value}",ohlcOpen:"Open {value}",ohlcClose:"Close {value}",ohlcVolume:"Volume {value}",ohlcValue:"Value {value}",ohlcColumnVolume:"Column volume",ohlcMin:"Min {value}",ohlcMax:"Max {value}",ohlcBoxSize:"Box size {value}",ohlcBoxes:"Boxes {value}",ohlcRising:"Rising",ohlcFalling:"Falling",ohlcRisingXColumn:"Rising X column",ohlcFallingOColumn:"Falling O column",ohlcDerivedPoint:"Derived point",ohlcHeikinAshiPoint:"Heikin Ashi point",ohlcDescription:{candlestick:"Candlestick open high low close values",highLowOpenClose:"High low open close values",equiVolume:"EquiVolume high low open close and volume values",candleVolume:"Candle volume open high low close and volume values",armsCandleVolume:"Arms candle volume open high low close and volume values",columnVolume:"Column volume values"},ohlcPointPrefix:{candlestick:"Candlestick point",highLowOpenClose:"High low open close point",equiVolume:"EquiVolume point",candleVolume:"Candle volume point",armsCandleVolume:"Arms candle volume point",columnVolume:"Column volume point",financial:"Financial point"},ohlcDerived:{heikinAshi:"Heikin Ashi derived values",lineBreak:"Line Break derived price movements",renko:"Renko derived bricks",kagi:"Kagi derived price movements",pointAndFigure:"Point and Figure derived columns"}}});var DataPoint=function DataPoint(t,e){void 0===t&&(t=0);void 0===e&&(e=0);this.x=t;this.y=e};export{DataPoint};var RenderEventArgs=function(t){__extends(RenderEventArgs,t);function RenderEventArgs(e){var i=t.call(this)||this;i._engine=e;return i}Object.defineProperty(RenderEventArgs.prototype,"engine",{get:function(){return this._engine},enumerable:!0,configurable:!0});return RenderEventArgs}(CancelEventArgs);export{RenderEventArgs};var SeriesRenderingEventArgs=function(t){__extends(SeriesRenderingEventArgs,t);function SeriesRenderingEventArgs(e,i,n){var r=t.call(this,e)||this;r._index=i;r._count=n;return r}Object.defineProperty(SeriesRenderingEventArgs.prototype,"index",{get:function(){return this._index},enumerable:!0,configurable:!0});Object.defineProperty(SeriesRenderingEventArgs.prototype,"count",{get:function(){return this._count},enumerable:!0,configurable:!0});return SeriesRenderingEventArgs}(RenderEventArgs);export{SeriesRenderingEventArgs};export var ImageFormat;!function(t){t[t.Png=0]="Png";t[t.Jpeg=1]="Jpeg";t[t.Svg=2]="Svg"}(ImageFormat||(ImageFormat={}));export var SelectionMode;!function(t){t[t.None=0]="None";t[t.Series=1]="Series";t[t.Point=2]="Point"}(SelectionMode||(SelectionMode={}));export var Position;!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";t[t.TopLeft=6]="TopLeft";t[t.TopRight=7]="TopRight";t[t.BottomLeft=8]="BottomLeft";t[t.BottomRight=9]="BottomRight";t[t.LeftTop=10]="LeftTop";t[t.LeftBottom=11]="LeftBottom";t[t.RightTop=12]="RightTop";t[t.RightBottom=13]="RightBottom"}(Position||(Position={}));export var Orientation;!function(t){t[t.Auto=0]="Auto";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal"}(Orientation||(Orientation={}));var FlexChartBase=function(t){__extends(FlexChartBase,t);function FlexChartBase(){var e=null!==t&&t.apply(this,arguments)||this;e._palette=null;e._selectionMode=SelectionMode.None;e._accessibilityModelExtensions=[];e._focusMode=!1;e._accessibilityHostFocusHandlerAdded=!1;e._defPalette=Palettes.standard;e._notifyCurrentChanged=!0;e._legendHost=null;e._needBind=!1;e._skipLightClr=!1;e._showTooltipOnFocus=!1;e._accessibilityTooltipVisible=!1;e.rendering=new Event;e.rendered=new Event;e.itemsSourceChanging=new Event;e.itemsSourceChanged=new Event;e.selectionChanged=new Event;return e}Object.defineProperty(FlexChartBase.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){var e=new CancelEventArgs;if(!this.onItemsSourceChanging(e))return;if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=asCollectionView(t);if(null!=this._cv){this._cv.currentChanged.addHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}this._clearCachedValues();this.onItemsSourceChanged(e);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"collectionView",{get:function(){return this._cv},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"palette",{get:function(){return this._palette},set:function(t){if(t!=this._palette){this._palette=asArray(t);this._skipLightClr=Palettes._isExtended(this._palette);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"plotMargin",{get:function(){return this._plotMargin},set:function(t){if(t!=this._plotMargin){this._plotMargin=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"legend",{get:function(){return this._legend},set:function(t){if(t!=this._legend){this._legend=asType(t,Legend);null!=this._legend&&(this._legend._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"header",{get:function(){return this._header},set:function(t){if(t!=this._header){this._header=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"footer",{get:function(){return this._footer},set:function(t){if(t!=this._footer){this._footer=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"ariaLabel",{get:function(){if(this.hostElement){var t=this.hostElement.getAttribute("aria-label");if(t)return t}return this._ariaLabel},set:function(t){if((t=null==t?null:asString(t,!0))!=this._ariaLabel){var e=this._ariaLabel;this._ariaLabel=t;null==t&&null!=e&&this.hostElement&&this.hostElement.getAttribute("aria-label")===e&&setAttribute(this.hostElement,"aria-label",null);this._updateHostAriaLabel()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"focusMode",{get:function(){return this._focusMode},set:function(t){if((t=asBoolean(t,!0))!==this._focusMode){this._focusMode=t;this._updateFocusMode()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"showTooltipOnFocus",{get:function(){return this._showTooltipOnFocus},set:function(t){if((t=asBoolean(t,!0))!==this._showTooltipOnFocus){this._showTooltipOnFocus=t;t&&this.focusMode||this._hideAccessibilityTooltip()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"headerStyle",{get:function(){return this._headerStyle},set:function(t){if(t!=this._headerStyle){this._headerStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"footerStyle",{get:function(){return this._footerStyle},set:function(t){if(t!=this._footerStyle){this._footerStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"selectionMode",{get:function(){return this._selectionMode},set:function(t){if((t=asEnum(t,SelectionMode))!=this._selectionMode){this._selectionMode=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=asFunction(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartBase.prototype,"options",{get:function(){return this._options},set:function(t){if(t!=this._options){this._options=t;this.invalidate()}},enumerable:!0,configurable:!0});FlexChartBase.prototype.onRendering=function(t){this.rendering.raise(this,t)};FlexChartBase.prototype.onRendered=function(t){this.rendered.raise(this,t);this._updateAccessibilityModel();this._updateHostAriaLabel();this._updateFocusModeTabOrder();this._updateAccessibilityKeyboard();this._updateAccessibilityFocus()};FlexChartBase.prototype.dispose=function(){this._disposeAccessibilityModelExtensions();this._clearAccessibilityKeyboard();this._clearAccessibilityFocus();this._hideAccessibilityTooltip();var e=ChartTooltip._eTip;this._tooltip&&e&&e[Control._TTIP_KEY]===this.hostElement&&this._tooltip.dispose();this._accessibilityKeyboard=null;this._accessibilityFocus=null;this._accessibilityModel=null;this._accessibilityModelExtensions=null;t.prototype.dispose.call(this)};FlexChartBase.prototype.onItemsSourceChanging=function(t){this.itemsSourceChanging.raise(this,t);return!t.cancel};FlexChartBase.prototype.onItemsSourceChanged=function(t){this.itemsSourceChanged.raise(this,t)};FlexChartBase.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];i=r[1].toLowerCase();n=ImageFormat[i[0].toUpperCase()+i.substring(1)];this.saveImageToDataUrl(n,(function(t){ExportHelper.downloadImage(t,e,i)}))};FlexChartBase.prototype.saveImageToDataUrl=function(t,e){var i=asEnum(t,ImageFormat,!1),n=ImageFormat[i].toLowerCase();n&&n.length&&this._exportToImage(n,(function(t){e.call(e,t)}))};FlexChartBase.prototype.saveSvgToDataUrl=function(t,e){void 0===e&&(e=!0);this._exportToImage("svg",(function(e){t.call(t,e)}),{embedCss:e})};FlexChartBase.prototype.saveSvgToFile=function(t,e){void 0===e&&(e=!0);this.saveSvgToDataUrl((function(e){ExportHelper.downloadImage(e,t,"svg")}),e)};FlexChartBase.prototype._exportToImage=function(t,e,i){var n=this;void 0===i&&(i=null);var r=this._currentRenderEngine.element;i&&!1===i.embedCss?ExportHelper.getDataUri2(r,this,(function(i){n.prepareDataUri(r,t,i,e)})):ExportHelper.getDataUri(r,this,(function(i){n.prepareDataUri(r,t,i,e)}))};FlexChartBase.prototype.prepareDataUri=function(t,e,i,n){var r=this;if("svg"===e)n.call(null,i);else{var s=new Image;s.onload=function(){var i,a=document.createElement("canvas"),o=t.parentNode||t,l=getElementRect(o);a.width=l.width;a.height=l.height;var h=a.getContext("2d"),c=r._bgColor(r.hostElement);r._isTransparent(c)&&(c="#ffffff");h.fillStyle=c;h.fillRect(0,0,l.width,l.height);var u=window.getComputedStyle(o,null).getPropertyValue("padding-left").replace("px",""),_=window.getComputedStyle(o,null).getPropertyValue("padding-top").replace("px","");h.drawImage(s,+u||0,+_||0);i=a.toDataURL("image/"+e);n.call(null,i);a=null};s.src=i}};FlexChartBase.prototype.refresh=function(e){void 0===e&&(e=!0);t.prototype.refresh.call(this,e);this.isUpdating||this.disposed||this._refreshChart()};FlexChartBase.prototype.onSelectionChanged=function(t){this.selectionChanged.raise(this,t)};FlexChartBase.prototype.onLostFocus=function(e){this._tooltip&&this._tooltip.isVisible&&!this.isTouching&&this._tooltip.hide();this._clearAccessibilityFocus();t.prototype.onLostFocus.call(this,e)};FlexChartBase.prototype._setTabOrder=function(e){t.prototype._setTabOrder.call(this,e);this._updateFocusModeTabOrder()};FlexChartBase.prototype._setIsDisabled=function(e){t.prototype._setIsDisabled.call(this,e);this._updateFocusModeTabOrder()};FlexChartBase.prototype._cvCollectionChanged=function(t,e){this._clearCachedValues();this._bindChart()};FlexChartBase.prototype._cvCurrentChanged=function(t,e){this._notifyCurrentChanged&&this._bindChart()};FlexChartBase.prototype._bgColor=function(t){if(!t)return"transparent";var e=getComputedStyle(t).backgroundColor;return this._isTransparent(e)?this._bgColor(t.parentElement):e};FlexChartBase.prototype._isTransparent=function(t){var e=new Color(t);return 0==e.a&&0==e.b&&0==e.g&&0==e.r};FlexChartBase.prototype._shouldShowAccessibilityFocus=function(){if(!this.focusMode)return!1;var t=this.hostElement;if(t&&t.matches)try{return t.matches(":focus-visible")}catch(t){}return!1};FlexChartBase.prototype._updateHostAriaLabel=function(){setAttribute(this.hostElement,"role","figure");if(null==this._ariaLabel){var t=this.hostElement.getAttribute("aria-label");if(!t||t===this._generatedAriaLabel){this._generatedAriaLabel=_getDefaultAccessibilityAriaLabel(this._accessibilityModel);setAttribute(this.hostElement,"aria-label",this._generatedAriaLabel)}}else{this._generatedAriaLabel=null;setAttribute(this.hostElement,"aria-label",this._ariaLabel)}};FlexChartBase.prototype._getAccessibleChartTypeName=function(){return _getAccessibleChartTypeName("chart")};FlexChartBase.prototype._createAccessibilityModel=function(){return _getBaseAccessibilityModel(this,this._getAccessibleChartTypeName())};FlexChartBase.prototype._isAccessibilityLegendVisible=function(){return!!(this._rectLegend&&this._rectLegend.width>0&&this._rectLegend.height>0)};FlexChartBase.prototype._updateAccessibilityModel=function(){this._accessibilityModel=this._createAccessibilityModel();this.focusMode&&this._updateAccessibilityModelExtensions(this._accessibilityModel)};FlexChartBase.prototype._addAccessibilityModelExtension=function(t){var e=this._accessibilityModelExtensions;if(t&&e&&e.indexOf(t)<0){e.push(t);this._refreshAccessibility()}};FlexChartBase.prototype._removeAccessibilityModelExtension=function(t){var e=this._accessibilityModelExtensions,i=e?e.indexOf(t):-1;if(i>=0){e.splice(i,1);this._refreshAccessibility()}};FlexChartBase.prototype._refreshAccessibility=function(){this._updateAccessibilityModel();this._updateHostAriaLabel();this._updateAccessibilityKeyboard();this._updateAccessibilityFocus()};FlexChartBase.prototype._updateAccessibilityModelExtensions=function(t){var e=this._accessibilityModelExtensions;if(t&&e)for(var i=0,n=e;i<n.length;i++){n[i]._updateAccessibilityModel(t)}};FlexChartBase.prototype._disposeAccessibilityModelExtensions=function(){var t=this._accessibilityModelExtensions;if(t)for(var e=0,i=t;e<i.length;e++){var n=i[e];n._disposeAccessibilityExtension&&n._disposeAccessibilityExtension()}};FlexChartBase.prototype._updateAccessibilityKeyboard=function(){if(this.focusMode){this._accessibilityKeyboard||(this._accessibilityKeyboard=new _ChartAccessibilityKeyboardManager(this));this._accessibilityKeyboard.update()}else this._clearAccessibilityKeyboard()};FlexChartBase.prototype._clearAccessibilityKeyboard=function(){this._accessibilityKeyboard&&this._accessibilityKeyboard.clear()};FlexChartBase.prototype._updateFocusMode=function(){this._updateFocusModeTabOrder();this._accessibilityModel&&this._refreshAccessibility();if(!this.focusMode){this._clearAccessibilityKeyboard();this._clearAccessibilityFocus();this._hideAccessibilityTooltip()}};FlexChartBase.prototype._updateFocusModeTabOrder=function(){if(this.hostElement&&this.focusMode){this._ensureAccessibilityHostFocusHandlers();t.prototype._setTabOrder.call(this,this.tabOrder)}};FlexChartBase.prototype._ensureAccessibilityHostFocusHandlers=function(){if(!this._accessibilityHostFocusHandlerAdded){this.addEventListener(this.hostElement,"focus",this._onAccessibilityHostFocus.bind(this),!1,!1);this.addEventListener(this.hostElement,"blur",this._onAccessibilityHostBlur.bind(this),!1,!1);this._accessibilityHostFocusHandlerAdded=!0}};FlexChartBase.prototype._onAccessibilityHostFocus=function(){this.focusMode&&document.activeElement===this.hostElement&&(this._shouldShowAccessibilityFocus()?this._setAccessibilityFocus({region:"chart"}):this._clearAccessibilityFocus())};FlexChartBase.prototype._onAccessibilityHostBlur=function(){if(this.focusMode){this._clearAccessibilityFocus();this._hideAccessibilityTooltip()}};FlexChartBase.prototype._updateAccessibilityFocus=function(){this._accessibilityFocus&&this._accessibilityFocus.refresh()};FlexChartBase.prototype._setAccessibilityFocus=function(t){this._accessibilityFocus||(this._accessibilityFocus=new _ChartAccessibilityFocusManager(this));this._accessibilityFocus.update(t)};FlexChartBase.prototype._clearAccessibilityFocus=function(){this._accessibilityFocus&&this._accessibilityFocus.clear()};FlexChartBase.prototype._updateAccessibilityFocusFromState=function(t){if(this.focusMode)if(t){if(this._accessibilityKeyboard&&this._accessibilityKeyboard.activate(t))return;this._setAccessibilityFocus(t);this._showAccessibilityTooltip(t)}else{this._clearAccessibilityFocus();this._hideAccessibilityTooltip()}};FlexChartBase.prototype._getAccessibilitySeriesPointShape=function(t,e){return _getRectFocusShape(this._rectChart)};FlexChartBase.prototype._getAccessibilityAnnotationShape=function(t,e){return t&&t.shape||_getRectFocusShape(this._rectChart)};FlexChartBase.prototype._getAccessibilityLegendItemShape=function(t,e){var i=this.legend,n=i&&i._areas,r=t&&null!=t.legendIndex?t.legendIndex:e;return _getRectFocusShape((n&&null!=r?n[r]:null)||this._rectLegend)};FlexChartBase.prototype._showAccessibilityTooltip=function(t){if(this.focusMode&&this.showTooltipOnFocus&&this._tooltip&&t&&"chart"!==t.region&&"title"!==t.region){var e=this._getAccessibilityTooltipContent(t),i=this._isAccessibilityTooltipContentCustom(t),n=e?this._getAccessibilityTooltipBounds(t):null;this._hideAccessibilityTooltip();e&&n&&this._showToolTip(e,n,!0,i)}else this._hideAccessibilityTooltip()};FlexChartBase.prototype._hideAccessibilityTooltip=function(){this._accessibilityTooltipVisible&&this._tooltip&&this._hideToolTip()};FlexChartBase.prototype._getAccessibilityTooltipContent=function(t){if(t&&"annotation"===t.region){var e=this._accessibilityModel,i=e&&e.annotations?e.annotations[t.annotationIndex]:null;return i&&(i.tooltip||i.label)}return null};FlexChartBase.prototype._isAccessibilityTooltipContentCustom=function(t){return!!(t&&"annotation"!==t.region&&this._tooltip&&this._tooltip._isContentCustomized())};FlexChartBase.prototype._getAccessibilityTooltipBounds=function(t){var e=_getFocusStateShape(this,t),i=e?_getFocusShapeRect(e):this._rectChart;if(!i)return null;var n=this.hostElement.getBoundingClientRect();return new Rect(n.left+i.left+i.width/2,n.top+i.top+i.height/2,5,5)};FlexChartBase.prototype._getColor=function(t){var e=this._defPalette;null!=this._palette&&this._palette.length>0&&(e=this._palette);return e[t%e.length]};FlexChartBase.prototype._getColorLight=function(t){var e=this._getColor(t);this._skipLightClr||(e=this._getLightColor(e));return e};FlexChartBase.prototype._getLightColor=function(t){var e=new Color(t);if(null!=e&&-1===t.indexOf("-")){1==e.a&&-1==t.indexOf("rgba")&&-1==t.indexOf("hsla")&&(e.a*=.7);t=e.toString()}return t};FlexChartBase.prototype._bindChart=function(){this._needBind=!0;this.invalidate()};FlexChartBase.prototype._clearCachedValues=function(){};FlexChartBase.prototype._renderEls=function(t,e,i,n,r){void 0===i&&(i=!0);void 0===n&&(n=null);void 0===r&&(r=!1);var s=e.width,a=e.height;if(0!=s){(isNumberNaN(+s)||s<0)&&(s=FlexChartBase._WIDTH);(a<=0||isNumberNaN(+a))&&(a=FlexChartBase._HEIGHT);var o=s>0&&a>0;o&&t.setViewportSize(s,a);var l=0,h=0;if(this.legend.scrollbar&&this._legendHost){if(p=this._legendHost.querySelector(".wj-legend-scrollable"))if(this.legend.isVertical){h=0;l=p.scrollTop}else{l=0;h=p.scrollLeft}}this._currentRenderEngine._htmlText=this._isHtmlText();t.beginRender();t.cssPriority=!0;if(o){this._rectChart=new Rect(0,0,s,a);this._prepareRender();if(n){var c=t.stroke,u=t.fill;t.fill=n;t.stroke=null;t.drawRect(0,0,s,a);t.fill=u;t.stroke=c}var _=new Rect(0,0,s,a);this._chartRectId="chartRect"+(1e6*Math.random()).toFixed();t.addClipRect(_,this._chartRectId);this._renderHeader(t,_);this._renderFooter(t,_);this._renderLegends(t,_);this._renderChart(t,_,i);if(this.legend.scrollbar&&this._legendHost){var p;if(p=this._legendHost.querySelector(".wj-legend-scrollable")){p.scrollTop=l;p.scrollLeft=h}}}t.endRender()}};FlexChartBase.prototype._render=function(t,e,i){void 0===e&&(e=!0);void 0===i&&(i=null);var n=this._getHostSize();if(this._h){var r=n.height-this._h;r>=4&&r<=6&&!1!==this._isPCUnit("height")&&(n.height=this._h)}this._h=n.height;this._renderEls(t,n,e,i)};FlexChartBase.prototype._isPCUnit=function(t){var e=null,i=this.hostElement;if(i&&i.computedStyleMap){var n=i.computedStyleMap();if(n){var r=n.get(t);r&&(e="percent"==r.unit)}}return e};FlexChartBase.prototype._renderHidden=function(t,e){void 0===t&&(t=null);void 0===e&&(e=null);var i=document.createElement("div");addClass(i,this.hostElement.getAttribute("class")||"");i.style.visibility="hidden";var n=new _SvgRenderEngine(i);document.body.appendChild(i);if(!t){var r=this._getHostComputedStyle(),s=0,a=0;if(r){s=this._parsePx(r.width);a=this._parsePx(r.height);0==s&&(s=FlexChartBase._WIDTH);0==a&&(a=FlexChartBase._HEIGHT);s-=this._parsePx(r.paddingLeft);s-=this._parsePx(r.paddingRight);a-=this._parsePx(r.paddingTop);a-=this._parsePx(r.paddingBottom);s-=this._parsePx(r.borderLeftWidth);s-=this._parsePx(r.borderRightWidth);a-=this._parsePx(r.borderTopWidth);a-=this._parsePx(r.borderBottomWidth)}0==s&&(s=FlexChartBase._WIDTH);0==a&&(a=FlexChartBase._HEIGHT);t=new Size(s,a)}this._renderEls(n,t,!0,e,!0);removeChild(i);return n.element};FlexChartBase.prototype._renderHeader=function(t,e){t.startGroup(FlexChartBase._CSS_HEADER,this._chartRectId);e=this._drawTitle(t,e,this.header,this.headerStyle,!1);t.endGroup()};FlexChartBase.prototype._renderFooter=function(t,e){t.startGroup(FlexChartBase._CSS_FOOTER,this._chartRectId);e=this._drawTitle(t,e,this.footer,this.footerStyle,!0);t.endGroup()};FlexChartBase.prototype._renderLegends=function(t,e){var i,n,r=this.legend,s=e.width,a=e.height,o=r._getPosition(s,a),l=s,h=a;o==Position.Left||o==Position.Right||o==Position.LeftTop||o==Position.LeftBottom||o==Position.RightTop||o==Position.RightBottom?l=this._getLegendSize(s,l):h=this._getLegendSize(a,h);if(i=r._getDesiredSize(t,o,l,h)){o==Position.Left||o==Position.Right||o==Position.LeftTop||o==Position.LeftBottom||o==Position.RightTop||o==Position.RightBottom?i.width=this._getLegendSize(s,i.width):i.height=this._getLegendSize(a,i.height);i.height>e.height&&(i.height=e.height);switch(o){case Position.Right:s-=i.width;n=new Point(s,e.top+.5*(a-i.height));break;case Position.RightTop:s-=i.width;n=new Point(s,e.top);break;case Position.RightBottom:s-=i.width;n=new Point(s,e.top+(a-i.height));break;case Position.Left:e.left+=i.width;s-=i.width;n=new Point(0,e.top+.5*(a-i.height));break;case Position.LeftTop:e.left+=i.width;s-=i.width;n=new Point(0,e.top);break;case Position.LeftBottom:e.left+=i.width;s-=i.width;n=new Point(0,e.top+(a-i.height));break;case Position.Top:a-=i.height;n=new Point(.5*(s-i.width),e.top);e.top+=i.height;break;case Position.TopLeft:a-=i.height;n=new Point(0,e.top);e.top+=i.height;break;case Position.TopRight:a-=i.height;n=new Point(s-i.width,e.top);e.top+=i.height;break;case Position.Bottom:a-=i.height;n=new Point(.5*(s-i.width),e.top+a);break;case Position.BottomLeft:a-=i.height;n=new Point(0,e.top+a);break;case Position.BottomRight:a-=i.height;n=new Point(s-i.width,e.top+a)}e.width=s;e.height=a;this._rectLegend=new Rect(n.x,n.y,i.width,i.height);var c="legRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._rectLegend,c);this._legendHost=t.startGroup(FlexChartBase._CSS_LEGEND,c);this.legend._render(t,n,o,i.width,i.height);t.endGroup()}else{this._legendHost=null;this._rectLegend=null}};FlexChartBase.prototype._prepareRender=function(){};FlexChartBase.prototype._renderChart=function(t,e,i){};FlexChartBase.prototype._performBind=function(){};FlexChartBase.prototype._getDesiredLegendSize=function(t,e,i,n){return null};FlexChartBase.prototype._renderLegend=function(t,e,i,n,r,s){};FlexChartBase.prototype._getHitTestItem=function(t){return null};FlexChartBase.prototype._getHitTestValue=function(t,e){return null};FlexChartBase.prototype._getHitTestLabel=function(t){return null};FlexChartBase.prototype._refreshChart=function(){if(this._needBind){this._needBind=!1;this._performBind()}this.hostElement&&this._render(this._currentRenderEngine)};FlexChartBase.prototype._drawTitle=function(t,e,i,n,r){var s=FlexChartBase._CSS_TITLE,a=r?FlexChartBase._CSS_FOOTER:FlexChartBase._CSS_HEADER,o=null;r?this._rectFooter=null:this._rectHeader=null;if(null!=i){var l=null,h=null,c=null,u=null;if(n){n.fontSize&&(l=n.fontSize);n.foreground&&(h=n.foreground);n.fill&&(h=n.fill);n.fontFamily&&(c=n.fontFamily);n.halign&&(u=n.halign)}t.fontSize=l;t.fontFamily=c;o=t.measureString(i,s,a,n);e.height-=o.height;h||(h=FlexChartBase._FG);t.textFill=h;if(r){"left"==u?FlexChartBase._renderText(t,i,new Point(e.left,e.bottom),0,0,s,a,n):"right"==u?FlexChartBase._renderText(t,i,new Point(e.left+e.width,e.bottom),2,0,s,a,n):FlexChartBase._renderText(t,i,new Point(e.left+.5*e.width,e.bottom),1,0,s,a,n);this._rectFooter=this._getTitleFocusRect(new Rect(e.left,e.bottom,e.width,o.height),!0)}else{this._rectHeader=this._getTitleFocusRect(new Rect(e.left,e.top,e.width,o.height),!1);e.top+=o.height;"left"==u?FlexChartBase._renderText(t,i,new Point(e.left,this._rectHeader.top),0,0,s,a,n):"right"==u?FlexChartBase._renderText(t,i,new Point(e.left+e.width,this._rectHeader.top),2,0,s,a,n):FlexChartBase._renderText(t,i,new Point(e.left+.5*e.width,this._rectHeader.top),1,0,s,a,n)}t.textFill=null;t.fontSize=null;t.fontFamily=null}return e};FlexChartBase.prototype._getTitleFocusRect=function(t,e){var i=Math.max(t.height,16);return new Rect(t.left,e?t.top-(i-t.height):t.top,t.width,i)};FlexChartBase.prototype.pageToControl=function(t,e){return this._toControl(t,e)};FlexChartBase.prototype._toControl=function(t,e){isNumber(t)&&isNumber(e)?t=new Point(t,e):t instanceof MouseEvent&&(t=mouseToPage(t));asType(t,Point);var i=t.clone(),n=this._getHostOffset();i.x-=n.x;i.y-=n.y;var r=this._currentRenderEngine?this._currentRenderEngine.element:null;if(null!=r){var s=r.getBoundingClientRect(),a=parseFloat(r.getAttribute("width")),o=parseFloat(r.getAttribute("height"));s.width!=a&&(i.x*=a/s.width);s.height!=o&&(i.y*=o/s.height)}var l=this._getHostComputedStyle();if(l){var h=parseInt(l.paddingLeft.replace("px",""));h&&!isNumberNaN(+h)&&(i.x-=h);var c=parseInt(l.paddingTop.replace("px",""));c&&!isNumberNaN(+c)&&(i.y-=c)}return i};FlexChartBase.prototype._highlightItems=function(t,e,i){if(i)for(var n=0;n<t.length;n++)addClass(t[n],e);else for(n=0;n<t.length;n++)removeClass(t[n],e)};FlexChartBase.prototype._parseMargin=function(t){var e={};if(isNumber(t)&&!isNumberNaN(+t))e.top=e.bottom=e.left=e.right=asNumber(t);else if(isString(t)){var i=asString(t).split(" ",4),n=NaN,r=NaN,s=NaN,a=NaN;if(i){if(4==i.length){n=parseFloat(i[0]);a=parseFloat(i[1]);r=parseFloat(i[2]);s=parseFloat(i[3])}else if(2==i.length){n=r=parseFloat(i[0]);s=a=parseFloat(i[1])}else 1==i.length&&(n=r=s=a=parseFloat(i[1]));isNumberNaN(+n)||(e.top=n);isNumberNaN(+r)||(e.bottom=r);isNumberNaN(+s)||(e.left=s);isNumberNaN(+a)||(e.right=a)}}return e};FlexChartBase.prototype._showToolTip=function(t,e,i,n){var r=this;void 0===i&&(i=!1);void 0===n&&(n=!1);var s=this._tooltip.showDelay;this._clearTimeouts();if(!this.isDisabled)if(t){this._accessibilityTooltipVisible=!!i;if(s>0)this._toShow=setTimeout((function(){i?r._tooltip._showAccessibilityTooltip(r.hostElement,t,e,n):r._tooltip.show(r.hostElement,t,e);r._accessibilityTooltipVisible=i;r._tooltip.hideDelay>0&&(r._toHide=setTimeout((function(){r._tooltip.hide();r._accessibilityTooltipVisible=!1}),r._tooltip.hideDelay))}),s);else{i?this._tooltip._showAccessibilityTooltip(this.hostElement,t,e,n):this._tooltip.show(this.hostElement,t,e);this._accessibilityTooltipVisible=i;this._tooltip.hideDelay>0&&(this._toHide=setTimeout((function(){r._tooltip.hide();r._accessibilityTooltipVisible=!1}),this._tooltip.hideDelay))}}else{this._tooltip.hide();this._accessibilityTooltipVisible=!1}};FlexChartBase.prototype._hideToolTip=function(){this._clearTimeouts();this._tooltip.hide();this._accessibilityTooltipVisible=!1};FlexChartBase.prototype._clearTimeouts=function(){if(this._toShow){clearTimeout(this._toShow);this._toShow=null}if(this._toHide){clearTimeout(this._toHide);this._toHide=null}};FlexChartBase.prototype._getHostOffset=function(){var t=getElementRect(this.hostElement);return new Point(t.left,t.top)};FlexChartBase.prototype._getHostSize=function(){var t=new Size,e=this.hostElement,i=this._getHostComputedStyle(),n=e.offsetWidth,r=e.offsetHeight;if(i){n-=this._parsePx(i.paddingLeft);n-=this._parsePx(i.paddingRight);r-=this._parsePx(i.paddingTop);r-=this._parsePx(i.paddingBottom);n-=this._parsePx(i.borderLeftWidth);n-=this._parsePx(i.borderRightWidth);r-=this._parsePx(i.borderTopWidth);r-=this._parsePx(i.borderBottomWidth);t.width=n;t.height=r}return t};FlexChartBase.prototype._parsePx=function(t){var e=parseFloat(t.replace("px",""));return isNumberNaN(+e)?0:e};FlexChartBase.prototype._getHostComputedStyle=function(){var t=this.hostElement;return t&&t.ownerDocument&&t.ownerDocument.defaultView?t.ownerDocument.defaultView.getComputedStyle(this.hostElement):null};FlexChartBase.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};FlexChartBase.prototype._getLegendSize=function(t,e){return Math.min(e,this.legend._getMaxSize(t))};FlexChartBase.prototype._isHtmlText=function(){return this._options&&this._options.htmlText};FlexChartBase._contains=function(t,e){return!(!t||!e)&&(e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom)};FlexChartBase._intersects=function(t,e){return!(t.left>e.right||t.right<e.left||t.top>e.bottom||t.bottom<e.top)};FlexChartBase._toOADate=function(t){return t.valueOf()};FlexChartBase._fromOADate=function(t){return new Date(t)};FlexChartBase._renderText=function(t,e,i,n,r,s,a,o,l){var h=t.measureString(e,s,a,o),c=i.x,u=i.y;switch(n){case 1:c-=.5*h.width;break;case 2:c-=h.width}switch(r){case 1:u+=.5*h.height;break;case 0:u+=h.height}var _=new Rect(c,u-h.height,h.width,h.height);if(l){if(l(_)){t.drawString(e,new Point(c,u),s,o);return _}return null}t.drawString(e,new Point(c,u),s,o);return _};FlexChartBase._renderRotatedText=function(t,e,i,n,r,s,a,o,l,h){var c=t.measureString(e,o,l,h),u=i.x,_=i.y;switch(n){case 1:u-=.5*c.width;break;case 2:u-=c.width}switch(r){case 1:_+=.5*c.height;break;case 0:_+=c.height}return t.drawStringRotated(e,new Point(u,_),s,a,o,h)};FlexChartBase._endsWith=function(t,e){if(t&&e){var i=t.length-e.length;return i>=0&&t.indexOf(e,i)===i}return!1};FlexChartBase._WIDTH=300;FlexChartBase._HEIGHT=200;FlexChartBase._SELECTION_THRESHOLD=15;FlexChartBase._CSS_LEGEND=FlexChartClsNames.legend;FlexChartBase._CSS_HEADER=FlexChartClsNames.header;FlexChartBase._CSS_FOOTER=FlexChartClsNames.footer;FlexChartBase._CSS_TITLE=FlexChartClsNames.title;FlexChartBase._CSS_LABEL=FlexChartClsNames.label;FlexChartBase._CSS_SELECTION=ControlStateClsNames.selected;FlexChartBase._CSS_PLOT_AREA=FlexChartClsNames.plotArea;FlexChartBase._FG="#666";FlexChartBase._epoch=new Date(1899,11,30).getTime();FlexChartBase._msPerDay=864e5;return FlexChartBase}(Control);export{FlexChartBase};var _KeyWords=function(){function _KeyWords(){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}_KeyWords.prototype.replace=function(t,e){var i=this;return format(t,{},(function(t,n,r,s){return i.getValue(n,e,r)}))};_KeyWords.prototype.getValue=function(t,e,i){switch(t){case"seriesName":return e.series?e.series.name:"";case"pointIndex":return null!=e.pointIndex?e.pointIndex.toFixed():"";case"x":return i?Globalize.format(e.x,i):e._xfmt;case"y":return i?Globalize.format(e.y,i):e._yfmt;case"value":return i?Globalize.format(e.value,i):e._getValueFmt();case"name":return e.name}if(e.item){0==t.indexOf("item.")&&(t=t.substr(5));var n=e.item[t];if(!isUndefined(n))return i?Globalize.format(n,i):n}return""};return _KeyWords}();export{_KeyWords};var ExportHelper=function(){function ExportHelper(){}ExportHelper.downloadImage=function(t,e,i){var n=document.createElement("a"),r="image/"+i;if(navigator.msSaveOrOpenBlob){t=t.substring(t.indexOf(",")+1);var s,a=atob(t),o=[],l=void 0,h=void 0;for(l=0;l<a.length;l+=512){h=a.slice(l,l+512);for(var c=new Array(h.length),u=0;u<h.length;u++)c[u]=h.charCodeAt(u);var _=new Uint8Array(c);o.push(_)}s=new Blob(o,{type:r});navigator.msSaveOrOpenBlob(s,e+"."+i)}else{n.download=e+"."+i;n.href=t;document.body.appendChild(n);n.addEventListener("click",(function(t){removeChild(n)}));n.click()}};ExportHelper.getDataUri=function(t,e,i){var n,r,s,a,o,l,h,c,u,_,p=document.createElement("div"),d=t.cloneNode(!0),f=!1;if("svg"==t.tagName){r=(n=getElementRect(t.parentNode||t)).width||0;s=n.height||0;0==r&&(f=!0);a=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:r;o=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:s}else{r=(l=t.getBBox()).x+l.width;s=l.y+l.height;d.setAttribute("transform",d.getAttribute("transform").replace(/translate\(.*?\)/,""));a=r;o=s;(c=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(d);d=c}if(f){var g=e._renderHidden(),y=e._getHostComputedStyle(),m=0,b=0;if(y){m=e._parsePx(y.width);b=e._parsePx(y.height)}0==m&&(m=FlexChartBase._WIDTH);0==b&&(b=FlexChartBase._HEIGHT);a=r=m;o=s=b;d=g.cloneNode(!0)}ExportHelper.removeAccessibilityOverlays(d);d.setAttribute("version","1.1");d.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");d.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");d.setAttribute("width",r);d.setAttribute("height",s);d.setAttribute("viewBox","0 0 "+a+" "+o);addClass(d,t.parentNode&&t.parentNode.getAttribute("class")||"");p.appendChild(d);h=ExportHelper.getStyles(t);h+="."+FlexChartClsNames.hostElement+"{margin:0px;padding:0px;border:none;width:"+r+"px;height:"+s+"px;}\n";(u=document.createElement("style")).setAttribute("type","text/css");u.innerHTML="<![CDATA[\n"+h+"\n]]>";(_=document.createElementNS("http://www.w3.org/2000/svg","defs")).appendChild(u);d.insertBefore(_,d.firstChild);isIE()||d.querySelectorAll("foreignObject").forEach((function(t){if(d===t.parentNode)d.removeChild(t);else for(var e=0,i=t.children;e<i.length;e++){i[e].setAttribute("xmlns","http://www.w3.org/1999/xhtml")}}));var x=e._currentRenderEngine.canvas;if(x){var v=document.createElementNS("http://www.w3.org/2000/svg","image");v.setAttribute("width",x.width);v.setAttribute("height",x.height);v.setAttribute("href",x.toDataURL());d.insertBefore(v,d.firstChild);e.invalidate()}ExportHelper.convertImagesToDataUrl(d,(function(){var t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+p.innerHTML)));i.call(null,t)}))};ExportHelper.convertImagesToDataUrl=function(t,e){var i=t.querySelectorAll("image");if(0!==i.length){var n=Array.from(i);Array.from(i).forEach((function(t){var i=new Image;i.onload=function(){var r=document.createElement("canvas");r.width=+t.getAttribute("width");r.height=+t.getAttribute("height");var s=r.getContext("2d"),a=i.width/i.height;a<r.width/r.height?s.drawImage(i,0,0,i.width,i.height,.5*(r.width-a*r.height),0,a*r.height,r.height):s.drawImage(i,0,0,i.width,i.height,0,.5*(r.height-r.width/a),r.width,r.width/a);t.setAttribute("href",r.toDataURL());i.remove();n.splice(n.indexOf(t),1);0==n.length&&e()};i.src=t.getAttribute("href")}))}else e()};ExportHelper.getDataUri2=function(t,e,i){var n,r,s,a,o,l,h,c=document.createElement("div"),u=ExportHelper.cloneWithComputedStyles(t),_=!1;if("svg"==t.tagName){r=(n=getElementRect(t.parentNode||t)).width||0;s=n.height||0;0==r&&(_=!0);a=t.viewBox.baseVal&&0!==t.viewBox.baseVal.width?t.viewBox.baseVal.width:r;o=t.viewBox.baseVal&&0!==t.viewBox.baseVal.height?t.viewBox.baseVal.height:s}else{r=(l=t.getBBox()).x+l.width;s=l.y+l.height;u.setAttribute("transform",u.getAttribute("transform").replace(/translate\(.*?\)/,""));a=r;o=s;(h=document.createElementNS("http://www.w3.org/2000/svg","svg")).appendChild(u);u=h}if(_){var p=e._renderHidden(),d=e._getHostComputedStyle(),f=0,g=0;if(d){f=e._parsePx(d.width);g=e._parsePx(d.height)}0==f&&(f=FlexChartBase._WIDTH);0==g&&(g=FlexChartBase._HEIGHT);a=r=f;o=s=g;u=ExportHelper.cloneWithComputedStyles(p)}ExportHelper.removeAccessibilityOverlays(u);u.setAttribute("version","1.1");u.setAttributeNS(ExportHelper.xmlns,"xmlns","http://www.w3.org/2000/svg");u.setAttributeNS(ExportHelper.xmlns,"xmlns:xlink","http://www.w3.org/1999/xlink");u.setAttribute("width",r.toString());u.setAttribute("height",s.toString());u.setAttribute("viewBox","0 0 "+a+" "+o);c.appendChild(u);var y=e._currentRenderEngine.canvas;if(y){var m=document.createElementNS("http://www.w3.org/2000/svg","image");m.setAttribute("width",y.width);m.setAttribute("height",y.height);m.setAttribute("href",y.toDataURL());u.insertBefore(m,u.firstChild);e.invalidate()}ExportHelper.convertImagesToDataUrl(u,(function(){var t="data:image/svg+xml;base64,"+window.btoa(window.unescape(encodeURIComponent(ExportHelper.doctype+c.innerHTML)));i.call(null,t)}))};ExportHelper.removeAccessibilityOverlays=function(t){if(t&&t.querySelectorAll)for(var e="."+FlexChartClsNames.hostElement+"-focus, ."+FlexChartClsNames.hostElement+"-focus-layer",i=t.querySelectorAll(e),n=0;n<i.length;n++)removeChild(i[n])};ExportHelper.computeAttributes=function(t,e,i){var n=getComputedStyle(t);i.forEach((function(t){var i=n.getPropertyValue(t);i&&i.length>0&&e.setAttribute(t,i)}))};ExportHelper.cloneWithComputedStyles=function(t){var e=t.cloneNode();Array.from(t.childNodes).forEach((function(t){var i=ExportHelper.cloneWithComputedStyles(t);1===t.nodeType&&("text"===t.nodeName?ExportHelper.computeAttributes(t,i,ExportHelper.textAttrs):"line"===t.nodeName&&ExportHelper.computeAttributes(t,i,ExportHelper.lineAttrs));e.appendChild(i)}));return e};ExportHelper.getStyles=function(t){var e="",i=document.styleSheets;if(null==i||0===i.length)return 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){console.log("SecurityError. Can't read: "+i.href);return!0}}n=i.cssRules;[].forEach.call(n,(function(i){var n,r=i.style;if(null==r)return!0;var s=i.selectorText;if(isIE()&&s){var a=s.match(/\[(.*?)\]/g);a&&a.forEach((function(t){s=s.replace(t,t.replace(":","\\:"))}))}try{n=s=="."+FlexChartClsNames.hostElement||t.querySelector(s)}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")}))}));var n=getComputedStyle(t),r=n?n.getPropertyValue("font"):null;r&&(e+="."+FlexChartClsNames.hostElement+"{font:"+r+"}\n");return e};ExportHelper.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">';ExportHelper.xmlns="http://www.w3.org/2000/xmlns/";ExportHelper.textAttrs=["font-family","font-size","font-style","font-weight","fill"];ExportHelper.lineAttrs=["stroke","stroke-width","stroke-dasharray"];return ExportHelper}(),ChartTooltip=function(t){__extends(ChartTooltip,t);function ChartTooltip(){var e=t.call(this)||this;e._content="<b>{seriesName}</b><br/>{x} {y}";e._threshold=15;return e}Object.defineProperty(ChartTooltip.prototype,"content",{get:function(){return this._content},set:function(t){t!=this._content&&(this._content=t)},enumerable:!0,configurable:!0});ChartTooltip.prototype._isContentCustomized=function(){return"function"==typeof this._content};Object.defineProperty(ChartTooltip.prototype,"threshold",{get:function(){return this._threshold},set:function(t){t!=this._threshold&&(this._threshold=asNumber(t))},enumerable:!0,configurable:!0});ChartTooltip.prototype.show=function(e,i,n){t.prototype.show.call(this,e,i,n);this._disablePointerEvents()};ChartTooltip.prototype._showAccessibilityTooltip=function(e,i,n,r){void 0===r&&(r=!1);t.prototype._show.call(this,e,i,n,void 0,r,!1);this._disablePointerEvents()};ChartTooltip.prototype._disablePointerEvents=function(){var t=ChartTooltip._eTip;t&&t.style&&(t.style.pointerEvents="none")};return ChartTooltip}(Tooltip);export{ChartTooltip};export var ChartType;!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";t[t.Step=13]="Step";t[t.StepSymbols=14]="StepSymbols";t[t.StepArea=15]="StepArea"}(ChartType||(ChartType={}));export var Stacking;!function(t){t[t.None=0]="None";t[t.Stacked=1]="Stacked";t[t.Stacked100pc=2]="Stacked100pc"}(Stacking||(Stacking={}));var FlexChartCore=function(t){__extends(FlexChartCore,t);function FlexChartCore(e,i){var n=t.call(this,e,null,!0)||this;n._series=new ObservableArray;n._axes=new AxisCollection;n._pareas=new PlotAreaCollection;n._interpolateNulls=!1;n._legendToggle=!1;n._symbolSize=10;n._dataInfo=new _DataInfo;n.__barPlotter=null;n.__linePlotter=null;n.__areaPlotter=null;n.__bubblePlotter=null;n.__financePlotter=null;n.__funnelPlotter=null;n._plotters=[];n._rotated=!1;n._stacking=Stacking.None;n._xlabels=[];n._xvals=[];n._lblAreas=[];n._accessibilityVisualPoints={};n._colRowLens=[];n._selectedEls=[];n._markers=[];n._bindingSeparator=",";n.seriesVisibilityChanged=new Event;n.applyTemplate(ControlClsNames.hostElement+" "+FlexChartClsNames.hostElement,null,null);n._series.collectionChanged.addHandler((function(){for(var t=n._series,e=0;e<t.length;e++){var i=tryCast(t[e],SeriesBase);if(!i)throw"chartSeries array must contain SeriesBase objects.";i._chart=n;if(i.axisX&&null==i.axisX._chart){i.axisX._chart=n;n.axes.push(i.axisX)}if(i.axisY&&null==i.axisY._chart){i.axisY._chart=n;n.axes.push(i.axisY)}}n.invalidate()}));n._currentRenderEngine=new _SvgRenderEngine(n.hostElement);n._hitTester=new _HitTester(n);n._legend=new Legend(n);n._tooltip=new ChartTooltip;n._tooltip.showDelay=0;n._lbl=new DataLabel;n._lbl._chart=n;n._initAxes();n._axes.collectionChanged.addHandler((function(){for(var t=n._axes,e=0;e<t.length;e++){var i=tryCast(t[e],Axis);if(!i)throw"axes array must contain Axis objects.";i._chart=n}n.invalidate()}));n._pareas.collectionChanged.addHandler((function(){for(var t=n._pareas,e=0;e<t.length;e++){var i=tryCast(t[e],PlotArea);if(!i)throw"plotAreas array must contain PlotArea objects.";i._chart=n}n.invalidate()}));n._keywords=new _KeyWords;n.addEventListener(n.hostElement,"click",(function(t){var e=n._tooltip;e.content&&n.isTouching&&n._updateTooltip(e,t)}));n.addEventListener(n.hostElement,"mousemove",(function(t){var e=n._tooltip;e.content&&!n.isTouching&&n._updateTooltip(e,t)}));n.addEventListener(n.hostElement,"mouseleave",(function(t){n._hideToolTip()}));n.addEventListener(n.hostElement,"click",(function(t){t._wjAccessibilityLegendClick||n._handleHostClick(t)}));n.deferUpdate((function(){return n.initialize(i)}));return n}FlexChartCore.prototype.initialize=function(e){if(e&&e.renderEngine){var i=asType(this._currentRenderEngine,_SvgRenderEngine,!0);i&&i.detach();this._currentRenderEngine=null}t.prototype.initialize.call(this,e)};FlexChartCore.prototype._initAxes=function(){this._axisX=new Axis(Position.Bottom);this._axisY=new Axis(Position.Left);this._axisX.majorGrid=!1;this._axisX.name="axisX";this._axisY.majorGrid=!0;this._axisY.majorTickMarks=TickMark.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(FlexChartCore.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){this._axisX=asType(t,Axis);var e=this._axisX;this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!1);void 0===e.name&&(e.name="axisX");e._axisType=AxisType.X;null!=e.position&&e.position!=Position.Left&&e.position!=Position.Right&&e.position!=Position.BottomLeft&&e.position!=Position.BottomRight&&e.position!=Position.TopLeft&&e.position!=Position.TopRight&&e.position!=Position.LeftTop&&e.position!=Position.LeftBottom&&e.position!=Position.RightTop&&e.position!=Position.RightBottom||(e.position=Position.Bottom);e._chart=this}this.endUpdate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){this._axisY=asType(t,Axis);var e=this._axisY;this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!0);void 0===e.name&&(e.name="axisY");void 0===e.majorTickMarks&&(e.majorTickMarks=TickMark.None);e._axisType=AxisType.Y;null!=e.position&&e.position!=Position.Top&&e.position!=Position.Bottom&&e.position!=Position.BottomLeft&&e.position!=Position.BottomRight&&e.position!=Position.TopLeft&&e.position!=Position.TopRight&&e.position!=Position.LeftTop&&e.position!=Position.LeftBottom&&e.position!=Position.RightTop&&e.position!=Position.RightBottom||(e.position=Position.Left);e._chart=this}this.endUpdate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"plotAreas",{get:function(){return this._pareas},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"bindingX",{get:function(){return this._bindingX},set:function(t){if(t!=this._bindingX){this._bindingX=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){if(t!=this._symbolSize){this._symbolSize=asNumber(t,!1,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"interpolateNulls",{get:function(){return this._interpolateNulls},set:function(t){if(t!=this._interpolateNulls){this._interpolateNulls=asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"legendToggle",{get:function(){return this._legendToggle},set:function(t){t!=this._legendToggle&&(this._legendToggle=asBoolean(t))},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){if(t!=this._lbl){this._lbl=asType(t,DataLabel);this._lbl&&(this._lbl._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"selection",{get:function(){return this._selection},set:function(t){if(t!=this._selection){this._selection=asType(t,SeriesBase,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"renderEngine",{get:function(){return this._currentRenderEngine},set:function(t){if(t!=this._currentRenderEngine){var e=asType(this._currentRenderEngine,_SvgRenderEngine,!0);e&&e.detach();this._currentRenderEngine=t;var i=asType(this._currentRenderEngine,_SvgRenderEngine,!0);i&&i.attach(this.hostElement);this.refresh()}},enumerable:!0,configurable:!0});FlexChartCore.prototype.onSeriesVisibilityChanged=function(t){this.seriesVisibilityChanged.raise(this,t)};FlexChartCore.prototype.hitTest=function(t,e){var i=this._toControl(t,e),n=new HitTestInfo(this,i),r=null;if(FlexChartCore._contains(this._rectHeader,i))n._chartElement=ChartElement.Header;else if(FlexChartCore._contains(this._rectFooter,i))n._chartElement=ChartElement.Footer;else if(FlexChartCore._contains(this._rectLegend,i)){n._chartElement=ChartElement.Legend;var s=i.clone();if(this.legend.scrollbar&&this._legendHost){var a=this._legendHost.querySelector(".wj-legend-scrollable");if(a){if(this.rightToLeft&&!this.legend.isVertical){var o=a.scrollWidth-a.clientWidth-1;s.x+=o+a.scrollLeft}else s.x+=a.scrollLeft;s.y+=a.scrollTop}}null!==(r=this.legend._hitTest(s))&&r>=0&&r<this.series.length&&n._setData(this.series[r])}else if(FlexChartCore._contains(this._rectChart,i)){var l=this._hitTestLabels(i);if(l){n._chartElement=ChartElement.DataLabel;n._dist=0;n._setDataPoint(l.tag)}else{for(var h=this._hitTester.hitTest(i),c=null,u=null,_=this.series.length-1;_>=0;_--)if(this.series[_].hitTest!==Series.prototype.hitTest){var p=this.series[_].hitTest(t);if(p){if(!c||p.distance<c.distance){c=p;u=_}if(0===p.distance)break}}if(h&&h.area)if(c&&c.distance<h.distance)n=c;else if(c&&c.distance==h.distance&&u>h.area.tag.seriesIndex)n=c;else{n._setDataPoint(h.area.tag);n._dist=h.distance}else c&&(n=c);var d=!1;this.axes.some((function(t){if(FlexChartCore._contains(t._axrect,i)){var e=void 0;if(t.axisType===AxisType.X){n._chartElement=ChartElement.AxisX;e=t._hitTest(i)}else{n._chartElement=ChartElement.AxisY;e=t._hitTest(i)}e?n._setName(e.label):n._setName("");d=!0;return!0}return!1}));d||(FlexChartCore._contains(this._plotRect,i)?n._chartElement=ChartElement.PlotArea:FlexChartCore._contains(this._rectChart,i)&&(n._chartElement=ChartElement.ChartArea))}}else n._chartElement=ChartElement.None;return n};FlexChartCore.prototype.pointToData=function(t,e){isNumber(t)&&isNumber(e)&&(t=new Point(t,e));if(t instanceof MouseEvent){t=new Point(t.pageX,t.pageY);t=this._toControl(t)}else t=t.clone();t.x=this.axisX.convertBack(t.x);t.y=this.axisY.convertBack(t.y);return t};FlexChartCore.prototype.dataToPoint=function(t,e){isNumber(t)&&isNumber(e)&&(t=new Point(t,e));asType(t,Point);var i=t.clone();i.x=this.axisX.convert(i.x);i.y=this.axisY.convert(i.y);return i};FlexChartCore.prototype.dispose=function(){this._markers.forEach((function(t){t.remove()}));this._markers=[];t.prototype.dispose.call(this)};FlexChartCore.prototype._copy=function(t,e){if("series"==t){this.series.clear();for(var i=asArray(e),n=0;n<i.length;n++){var r=this._createSeries();copy(r,i[n]);this.series.push(r)}return!0}return!1};FlexChartCore.prototype._createSeries=function(){return new Series};FlexChartCore.prototype._clearCachedValues=function(){for(var t=0;t<this._series.length;t++){var e=this._series[t];null==e.itemsSource&&e._clearValues()}};FlexChartCore.prototype._performBind=function(){this._xDataType=null;this._xlabels.splice(0);this._xvals.splice(0);if(this._cv){var t=this._cv.items;if(t){for(var e=t.length,i=this.bindingX?new Binding(this.bindingX):null,n=0;n<e;n++){var r=t[n];if(i){var s=i.getValue(r);if(isNumber(s)){this._xvals.push(asNumber(s));this._xDataType=DataType.Number}else if(isDate(s)){this._xvals.push(asDate(s).valueOf());this._xDataType=DataType.Date}this._xlabels.push(s)}}this._xvals.length==e?this._xlabels.splice(0):this._xvals.splice(0)}}};FlexChartCore.prototype._hitTestSeries=function(t,e){var i=this._toControl(t),n=new HitTestInfo(this,i),r=this._hitTester.hitTestSeries(i,e);if(r&&r.area){n._setDataPoint(r.area.tag);n._chartElement=ChartElement.PlotArea;n._dist=r.distance}return n};FlexChartCore.prototype._hitTestData=function(t){var e=this._toControl(t),i=new HitTestInfo(this,e),n=this._hitTester.hitTest(e,!0);if(n&&n.area){i._setDataPoint(n.area.tag);i._dist=n.distance}return i};FlexChartCore.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};FlexChartCore._dist2=function(t,e){var i=t.x-e.x,n=t.y-e.y;return i*i+n*n};FlexChartCore._dist=function(t,e,i){return Math.sqrt(FlexChartCore._distToSegmentSquared(t,e,i))};FlexChartCore._distToSegmentSquared=function(t,e,i){var n=FlexChartCore._dist2(e,i);if(0==n)return FlexChartCore._dist2(t,e);var r=((t.x-e.x)*(i.x-e.x)+(t.y-e.y)*(i.y-e.y))/n;return r<0?FlexChartCore._dist2(t,e):r>1?FlexChartCore._dist2(t,i):FlexChartCore._dist2(t,new Point(e.x+r*(i.x-e.x),e.y+r*(i.y-e.y)))};FlexChartCore.prototype._isRotated=function(){return this._getChartType()==ChartType.Bar?!this._rotated:this._rotated};FlexChartCore.prototype._getChartType=function(){return null};FlexChartCore.prototype._handleHostClick=function(t){var e=this._hitTestData(t),i=this.focusMode?this._getAccessibilityFocusStateFromClick(t,e):null;if(this.selectionMode!=SelectionMode.None){var n=FlexChartCore._SELECTION_THRESHOLD;this.tooltip&&this.tooltip.threshold&&(n=this.tooltip.threshold);e.distance<=n&&e.series?this._select(e.series,e.pointIndex):this.selectionMode==SelectionMode.Series&&(e=this.hitTest(t)).chartElement==ChartElement.Legend&&e.series?this._select(e.series,null):this._select(null,null)}!0===this.legendToggle&&(e=this.hitTest(t)).chartElement==ChartElement.Legend&&e.series&&this._toggleLegendClickSeries(e.series,!0);this._updateAccessibilityFocusFromState(i)};FlexChartCore.prototype._getAccessibilityFocusStateFromClick=function(t,e){var i=FlexChartCore._SELECTION_THRESHOLD;this.tooltip&&this.tooltip.threshold&&(i=this.tooltip.threshold);if(e&&e.distance<=i&&e.series&&null!=e.pointIndex){var n=this.series.indexOf(e.series);if(n>=0)return{region:"series",seriesIndex:n,pointIndex:e.pointIndex}}var r=this.hitTest(t);if(r.chartElement===ChartElement.Header&&this.header)return{region:"title"};if(r.chartElement===ChartElement.Legend){var s=this._getAccessibilityLegendFocusIndex(r.series,r.pointIndex);if(s>=0)return{region:"legend",legendIndex:s}}return r.chartElement===ChartElement.PlotArea||r.chartElement===ChartElement.ChartArea?{region:"chart"}:null};FlexChartCore.prototype._getAccessibilityLegendFocusIndex=function(t,e){var i=this._accessibilityModel,n=i&&i.legendItems?i.legendItems:[],r=t?this.series.indexOf(t):-1;if(r<0)return-1;for(var s=0;s<n.length;s++){var a=n[s];if(a.seriesIndex===r&&(null==e||null==a.pointIndex||a.pointIndex===e))return s}return-1};FlexChartCore.prototype._selectLegendClickSeries=function(t){t&&this.selectionMode!=SelectionMode.None&&(this.selectionMode==SelectionMode.Series?this._select(t,null):this._select(null,null))};FlexChartCore.prototype._toggleLegendClickSeries=function(t,e){var i=this._toggleAccessibilityLegendSeries(t);i&&e&&this.focus();return i};FlexChartCore.prototype._getAccessibleChartTypeName=function(){return _getAccessibleChartTypeName(ChartType,this._getChartType(),this._stacking)};FlexChartCore.prototype._getAccessibilityPointCategory=function(t,e,i){var n=void 0!==i?i:t&&t.getValues(1),r=t&&t.getDataType(1);return n&&e<n.length?r===DataType.Date?new Date(n[e]):n[e]:this._xlabels&&this._xlabels.length&&e<this._xlabels.length?this._xlabels[e]:this._xvals&&this._xvals.length&&e<this._xvals.length?this._xDataType===DataType.Date?new Date(this._xvals[e]):this._xvals[e]:e};FlexChartCore.prototype._createAccessibilityModel=function(){var e=t.prototype._createAccessibilityModel.call(this),i=this.focusMode,n="",r=!1;i?this._updateAccessibilityVisualPoints():this._accessibilityVisualPoints={};for(var s=0;s<this._getAccessibilitySeriesCount();s++){var a=this.series[s],o=a&&a.visibility;if(a&&o!==SeriesVisibility.Hidden&&o!==SeriesVisibility.Legend){var l=i?this._getAccessibleSeriesPoints(a):[];if(!i||l){var h={index:s,name:this._getAccessibleSeriesName(a,s),description:this._getAccessibleSeriesDescription(a),points:l||[]};e.series.push(h);var c=this._getAccessibleSeriesChartTypeName(a);n?c!==n&&(r=!0):n=c}}}n&&(e.type=r?_getAccessibleChartTypeName("comboChart"):n);i&&this._addAccessibilityLegendItems(e);return e};FlexChartCore.prototype._getAccessibilitySeriesCount=function(){return this._getChartType()===ChartType.Funnel?Math.min(this.series.length,1):this.series.length};FlexChartCore.prototype._getAccessibleSeriesName=function(t,e){return _toAccessibilityText(t.name||t.binding)||_getUnnamedAccessibilitySeriesName(e)};FlexChartCore.prototype._getAccessibleSeriesChartTypeName=function(t){var e=t._getAccessibleChartTypeName();if(e)return e;var i=t instanceof Series?t.chartType:null;return null==i?this._getAccessibleChartTypeName():_getAccessibleChartTypeName(ChartType,i,this._stacking)};FlexChartCore.prototype._getAccessibleSeriesDescription=function(t){var e=t&&t._getAccessibilitySeriesDescription;return e?_toAccessibilityText(e.call(t)):""};FlexChartCore.prototype._getAccessibleSeriesPointDetails=function(t,e){var i=t&&t._getAccessibilityPointDetails;return i?_toAccessibilityText(i.call(t,e)):""};FlexChartCore.prototype._getAccessibleSeriesPointDetailsIncludeValue=function(t,e){var i=t&&t._getAccessibilityPointDetailsIncludeValue;return!!i&&!!i.call(t,e)};FlexChartCore.prototype._getAccessibleSeriesPoints=function(t){var e=t&&t._getAccessibilityPoints;if(e)return e.call(t,this)||[];var i=t&&t.getValues(0);if(!i)return null;for(var n=t.getValues(1),r=n||this._dataInfo&&this._dataInfo.getXVals(),s=this._getAccessibleSeriesValueDimensions(t,i,n),a=this.series.indexOf(t),o=[],l=0;l<i.length;l++)if(this._isAccessibleSeriesPoint(i,r,a,l)){var h=this._getAccessibleSeriesHitTestInfo(t,l),c=this._getAccessibleSeriesPointValue(h,i[l]),u=this._getAccessibleSeriesPointDetailsIncludeValue(t,l),_={index:l,category:this._getAccessibleSeriesPointCategory(t,l,n,h),details:this._getAccessibleSeriesPointDetails(t,l)};if(!u){_.value=c;_.values=this._getAccessibleSeriesPointValues(s,l,c)}o.push(_)}return o};FlexChartCore.prototype._isAccessibleSeriesPoint=function(t,e,i,n){if(!this._isAccessibleSeriesPointValue(t[n]))return!1;if(e&&(n>=e.length||!this._isAccessibleSeriesPointValue(e[n])))return!1;var r=i>=0?this._accessibilityVisualPoints[this._getAccessibilityPointKey(i,n)]:null;return!r||r.focusable};FlexChartCore.prototype._isAccessibleSeriesPointValue=function(t){return null!=t&&isNumberFinite(+t)};FlexChartCore.prototype._getAccessibleSeriesPointCategory=function(t,e,i,n){var r=n&&n._xfmt;return null!=r&&""!==r?r:this._getAccessibilityPointCategory(t,e,i)};FlexChartCore.prototype._getAccessibleSeriesPointValue=function(t,e){var i=t&&t._getValueFmt();return null!=i&&""!==i?i:e};FlexChartCore.prototype._getAccessibleSeriesHitTestInfo=function(t,e){if(!t||null==e)return null;var i=new HitTestInfo(this,new Point,ChartElement.SeriesSymbol);i._setData(t,e);return i};FlexChartCore.prototype._getAccessibleSeriesValueDimensions=function(t,e,i){for(var n=[e,i],r=2;r<5;r++)n[r]=t.getValues(r);return n};FlexChartCore.prototype._getAccessibleSeriesPointValues=function(t,e,i){if(!t)return null;for(var n=[],r=0;r<t.length;r++)if(1!==r){var s=t[r];s&&e<s.length&&n.push(0===r?i:s[e])}return n.length>1?n:null};FlexChartCore.prototype._addAccessibilityLegendItems=function(t){if(this._isAccessibilityLegendVisible())for(var e=0,i=this._legendReversed(),n=this.legend&&this.legend._areas,r=0;r<this._getAccessibilitySeriesCount();r++){var s=this.series[r],a=s&&s.visibility;if(s&&s.name&&a!==SeriesVisibility.Plot&&a!==SeriesVisibility.Hidden){for(var o=s.legendItemLength(),l=this._getAccessibleSeriesName(s,r),h=0;h<o;h++){var c=e+(i?o-1-h:h),u=n&&n[c];n&&(!u||u.width<=0||u.height<=0)||t.legendItems.push({name:this._getAccessibleLegendItemName(s,l,h,o),seriesIndex:r,pointIndex:o>1?h:null,legendIndex:c})}e+=o}else e++}};FlexChartCore.prototype._getAccessibleLegendItemName=function(t,e,i,n){if(n<=1)return e;var r=t._getAccessibilityLegendItemName||t._getName;return(r?_toAccessibilityText(r.call(t,i)):"")||_toAccessibilityText(this._getAccessibleSeriesPointCategory(t,i))||e};FlexChartCore.prototype._activateAccessibilityLegendItem=function(t){var e=this._getAccessibilityLegendSeries(t);if(!e)return!1;this._selectLegendClickSeries(e);this._toggleLegendClickSeries(e,!1);this._dispatchAccessibilityLegendClick(t);return!0};FlexChartCore.prototype._dispatchAccessibilityLegendClick=function(t){var e=this._getAccessibilityLegendClickPoint(t);if(!e)return!1;var i=document.createEvent("MouseEvents");i.initMouseEvent("click",!0,!0,window,0,e.x,e.y,e.x,e.y,!1,!1,!1,!1,0,null);i._wjAccessibilityLegendClick=!0;this.hostElement.dispatchEvent(i);return!0};FlexChartCore.prototype._getAccessibilityLegendClickPoint=function(t){if(!t)return null;var e=this.legend,i=e&&e._areas,n=t.legendIndex,r=i&&null!=n?i[n]:null;if(!r)return null;var s=this.hostElement.getBoundingClientRect(),a=this._getAccessibilityLegendScrollOffset();return new Point(s.left+r.left-a.x+r.width/2,s.top+r.top-a.y+r.height/2)};FlexChartCore.prototype._getAccessibilityLegendScrollOffset=function(){if(this.legend.scrollbar&&this._legendHost){var t=this._legendHost.querySelector(".wj-legend-scrollable");if(t){var e=this.rightToLeft&&!this.legend.isVertical?t.scrollWidth-t.clientWidth-1+t.scrollLeft:t.scrollLeft;return new Point(e,t.scrollTop)}}return new Point(0,0)};FlexChartCore.prototype._getAccessibilityLegendItemState=function(t){var e=this._getAccessibilityLegendSeries(t);return this.legendToggle&&e&&(e.visibility===SeriesVisibility.Visible||e.visibility===SeriesVisibility.Legend)?e.visibility===SeriesVisibility.Visible:null};FlexChartCore.prototype._getAccessibilityLegendSeries=function(t){return t&&null!=t.seriesIndex?this.series[t.seriesIndex]:null};FlexChartCore.prototype._toggleAccessibilityLegendSeries=function(t){if(!this.legendToggle||!t)return!1;if(t.visibility===SeriesVisibility.Legend){t.visibility=SeriesVisibility.Visible;return!0}if(t.visibility===SeriesVisibility.Visible){t.visibility=SeriesVisibility.Legend;return!0}return!1};FlexChartCore.prototype._getAccessibilityTooltipContent=function(e){if(e&&"series"===e.region){var i=this.series[e.seriesIndex],n=e.pointIndex;if(i&&null!=n){var r=this.tooltip.content,s=i.tooltipContent;(s||""===s)&&(r=s);if(r){var a=new HitTestInfo(this,new Point);a._chartElement=ChartElement.SeriesSymbol;a._setData(i,n);return this._getLabelContent(a,r)}}}return t.prototype._getAccessibilityTooltipContent.call(this,e)};FlexChartCore.prototype._isAccessibilityTooltipContentCustom=function(e){if(e&&"series"===e.region){var i=this.series[e.seriesIndex];if(i&&null!=i.tooltipContent)return!0}return t.prototype._isAccessibilityTooltipContentCustom.call(this,e)};FlexChartCore.prototype._getAccessibilitySeriesPointShape=function(t,e){if(t>=this._getAccessibilitySeriesCount())return null;var i=this._accessibilityVisualPoints&&this._accessibilityVisualPoints[this._getAccessibilityPointKey(t,e)];return i&&i.shape?i.shape:this._getAccessibilitySeriesPointFallbackShape(t,e)||_getRectFocusShape(this._plotRect||this._rectChart)};FlexChartCore.prototype._updateAccessibilityVisualPoints=function(){this._accessibilityVisualPoints={};var t=this._hitTester&&this._hitTester._map;if(t)for(var e in t){var i=t[e],n=this._getAccessibilityLineAreas(i);if(i)for(var r=0,s=i;r<s.length;r++){var a=s[r],o=a&&a.tag;if(o&&null!=o.seriesIndex&&null!=o.pointIndex){var l=_getAreaShape(a);l&&(this._accessibilityVisualPoints[this._getAccessibilityPointKey(o.seriesIndex,o.pointIndex)]={shape:l,focusable:this._isAccessibilityAreaFocusable(a,n)})}}}};FlexChartCore.prototype._getAccessibilityLineAreas=function(t){var e=[];if(t)for(var i=0,n=t;i<n.length;i++){var r=n[i],s=tryCast(r,_LinesArea);s&&e.push(s)}return e};FlexChartCore.prototype._isAccessibilityAreaFocusable=function(t,e){var i=tryCast(t,_CircleArea);if(!i||!e.length)return!0;for(var n=0,r=e;n<r.length;n++){var s=r[n].distanceToPoint(i.center);if(isNumberFinite(+s)&&s<=i.radius)return!0}return!1};FlexChartCore.prototype._getAccessibilityPointKey=function(t,e){return t+":"+e};FlexChartCore.prototype._getAccessibilitySeriesPointFallbackShape=function(t,e){var i=this.series[t],n=i&&i.getValues(0);if(!i||!n||null==e||e<0||e>=n.length)return null;var r=i.getValues(1);r||(r=this._dataInfo.getXVals());var s,a,o=r&&e<r.length?r[e]:e,l=n[e];if(!isNumberFinite(+o)||!isNumberFinite(+l))return null;if(this._isRotated()){s=i._getAxisX().convert(l);a=i._getAxisY().convert(o)}else{s=i._getAxisX().convert(o);a=i._getAxisY().convert(l)}return isNumberFinite(+s)&&isNumberFinite(+a)?{type:"circle",center:new Point(s,a),radius:5}:null};FlexChartCore.prototype._prepareRender=function(){this._hitTester.clear()};FlexChartCore.prototype._renderChart=function(t,e,i){var n=this._rectChart.clone(),r=new Size(n.width,n.height);e.width,e.height;this._selectedEls.length=0;var s=this._getPlotter(null);s.stacking=this._stacking;if(this._curPlotter!=s){this._curPlotter&&this._curPlotter.unload();this._curPlotter=s}s.load();var a=this._isRotated();this._dataInfo.analyse(this._series,a,s.stacking,this._xvals.length>0?this._xvals:null,this.axisX._getLogBase()>0,this.axisY._getLogBase()>0);var o=s.adjustLimits(this._dataInfo,e.clone());if(a){var l=this._dataInfo.getDataTypeX();l||(l=this._xDataType);this.axisX._updateActualLimits(this._dataInfo.getDataTypeY(),o.left,o.right);this.axisY._updateActualLimits(l,o.top,o.bottom,this._xlabels,this._xvals)}else{var h=this._dataInfo.getDataTypeX();h||(h=this._xDataType);this.axisX._updateActualLimits(h,o.left,o.right,this._xlabels,this._xvals);this.axisY._updateActualLimits(this._dataInfo.getDataTypeY(),o.top,o.bottom)}var c=this._getAxes();this._updateAuxAxes(c,a);this._layout(e,r,t);t.startGroup(FlexChartCore._CSS_PLOT_AREA);t.fill="transparent";t.stroke=null;if(this.plotAreas.length>0)for(var u=0;u<this.plotAreas.length;u++){this.plotAreas[u]._render(t)}else{var _=this._plotRect;t.drawRect(_.left,_.top,_.width,_.height)}t.endGroup();var p=this._series.length;this._clearPlotters();var d,f,g,y={};for(u=0;u<p;u++){if(((w=(C=this._series[u]).visibility)==SeriesVisibility.Visible||w==SeriesVisibility.Plot)&&C.getValues(0)){var m=C._getAxisY(),b=this._getPlotter(C);if(!m||m==this.axisY||b instanceof _BarPlotter)b.seriesCount++;else{var x=m._uniqueId;y[x]?y[x].count+=1:y[x]={count:1,index:0}}}}this.onRendering(new RenderEventArgs(t));if(this._getChartType()!==ChartType.Funnel)for(u=0;u<c.length;u++){var v=c[u];d=v.axisType==AxisType.X?t.startGroup(FlexChartCore._CSS_AXIS_X,this._chartRectId):t.startGroup(FlexChartCore._CSS_AXIS_Y,this._chartRectId);v._hostElement=i?d:v._hostElement;v._render(t);t.endGroup()}t.startGroup(SeriesClsNames.group);this._plotrectId="plotRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._plotRect,this._plotrectId);t.options=this._options&&this._options.spline?{spline:this._options.spline.approximation}:null;for(u=0;u<p;u++){var C;(C=this._series[u])._pointIndexes=[];var S=this._getPlotter(C);C._plotter=S;var A=t.startGroup(C.cssClass,S.clipping?this._plotrectId:null);C._hostElement=i?A:C._hostElement;var w=C.visibility,P=C.axisX,M=C.axisY;P||(P=this.axisX);M||(M=this.axisY);if(w==SeriesVisibility.Visible||w==SeriesVisibility.Plot){var T=y[M._uniqueId];if(!T||S instanceof _BarPlotter){f=S.seriesIndex;g=S.seriesCount;S.seriesIndex++;C.onRendering(t,f,g)||S.plotSeries(t,P,M,C,this,f,g)}else{f=T.index;g=T.count;T.index++;C.onRendering(t,f,g)||S.plotSeries(t,P,M,C,this,f,g)}C.onRendered(t)}t.endGroup()}t.endGroup();this._lblAreas=[];this.dataLabel.content&&this.dataLabel.position!=LabelPosition.None&&this._renderLabels(t);this._highlightCurrent();this.onRendered(new RenderEventArgs(t))};FlexChartCore.prototype._getDesiredLegendSize=function(t,e,i,n){var r=new Size,s=this.series,a=s.length,o=(this.legend.scrollbar,0),l=0;this._colRowLens=[];for(var h=0;h<a;h++){var c=h;this._legendReversed()&&(c=a-h-1);var u=tryCast(s[c],SeriesBase),_=u.visibility;if(u.name&&_!=SeriesVisibility.Hidden&&_!=SeriesVisibility.Plot)for(var p=u.legendItemLength(),d=0;d<p;d++){var f=u.measureLegendItem(t,d);if(e){if(o+f.height>n&&!this.legend.scrollbar){r.height=n;this._colRowLens.push(l);l=0;o=0}l<f.width&&(l=f.width);o+=f.height}else{if(l+f.width>i&&!this.legend.scrollbar){r.width=i;this._colRowLens.push(o);o=0;l=0}o<f.height&&(o=f.height);l+=f.width}}}if(e){r.height<o&&(r.height=o);this._colRowLens.push(l);r.width=this._colRowLens.reduce((function(t,e){return t+e}),0)}else{r.width<l&&(r.width=l);this._colRowLens.push(o);r.height=this._colRowLens.reduce((function(t,e){return t+e}),0)}return r};FlexChartCore.prototype._renderLegend=function(t,e,i,n,r,s){var a,o=this.series,l=o.length,h=e.clone(),c=0;if(this._legendReversed()){for(var u=l-1;u>=0;u--){a=tryCast(o[u],SeriesBase);c=this._renderLegendElements(t,a,e,h,i,n,r,s,c)}i.reverse()}else for(u=0;u<l;u++){a=tryCast(o[u],SeriesBase);c=this._renderLegendElements(t,a,e,h,i,n,r,s,c)}};FlexChartCore.prototype._legendReversed=function(){if(null==this._legend.reverse||null===this._legend.reverse){var t=!1,e=this._getChartType();(e===ChartType.Bar||e===ChartType.Column&&this._rotated)&&(this._stacking!==Stacking.None||this.axisY.reversed||(t=!0));return t}return this._legend.reverse};FlexChartCore.prototype._renderLegendElements=function(t,e,i,n,r,s,a,o,l){var h=new Rect(i.x,i.y,a,o),c=l;if(!e)return c;var u=e.visibility;if(!e.name||u==SeriesVisibility.Hidden||u==SeriesVisibility.Plot){e._legendElement=null;r.push(null);return c}var _=e.legendItemLength(),p=t.startGroup(e.cssClass);if(u==SeriesVisibility.Legend){p.setAttribute("opacity","0.5");e._legendElement=p}else u==SeriesVisibility.Visible?e._legendElement=p:e._legendElement=null;for(var d=0;d<_;d++){var f=e.measureLegendItem(t,d);if(s){if(n.y+f.height>h.bottom+1&&!this.legend.scrollbar){n.x+=this._colRowLens[c];c++;n.y=i.y}}else if(n.x+f.width>h.right+1&&!this.legend.scrollbar){n.y+=this._colRowLens[c];c++;n.x=i.x}var g=new Rect(n.x,n.y,f.width,f.height);u!=SeriesVisibility.Legend&&u!=SeriesVisibility.Visible||e.drawLegendItem(t,g,d);r.push(g);s?n.y+=f.height:n.x+=f.width}t.endGroup();return c};FlexChartCore.prototype._renderLabels=function(t){var e=this.series,i=e.length;t.stroke="null";t.fill="transparent";t.strokeWidth=1;var n=FlexChartCore._CSS_DATA_LABELS;t.startGroup(n);for(var r=0;r<i;r++){var s=e[r],a=this._hitTester._map[r];a&&s._renderLabels(t,a,this,this._lblAreas)}t.endGroup()};FlexChartCore.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};FlexChartCore.prototype._clearPlotters=function(){for(var t=this._plotters.length,e=0;e<t;e++)this._plotters[e].clear()};FlexChartCore.prototype._initPlotter=function(t){t.chart=this;t.dataInfo=this._dataInfo;t.hitTester=this._hitTester;this._plotters.push(t)};Object.defineProperty(FlexChartCore.prototype,"_barPlotter",{get:function(){if(null===this.__barPlotter){this.__barPlotter=new _BarPlotter;this._initPlotter(this.__barPlotter)}return this.__barPlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_linePlotter",{get:function(){if(null===this.__linePlotter){this.__linePlotter=new _LinePlotter;this._initPlotter(this.__linePlotter)}return this.__linePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_areaPlotter",{get:function(){if(null===this.__areaPlotter){this.__areaPlotter=new _AreaPlotter;this._initPlotter(this.__areaPlotter)}return this.__areaPlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_bubblePlotter",{get:function(){if(null===this.__bubblePlotter){this.__bubblePlotter=new _BubblePlotter;this._initPlotter(this.__bubblePlotter)}return this.__bubblePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_financePlotter",{get:function(){if(null===this.__financePlotter){this.__financePlotter=new _FinancePlotter;this._initPlotter(this.__financePlotter)}return this.__financePlotter},enumerable:!0,configurable:!0});Object.defineProperty(FlexChartCore.prototype,"_funnelPlotter",{get:function(){if(null===this.__funnelPlotter){this.__funnelPlotter=new _FunnelPlotter;this._initPlotter(this.__funnelPlotter)}return this.__funnelPlotter},enumerable:!0,configurable:!0});FlexChartCore.prototype._getPlotter=function(t){var e,i=this._getChartType(),n=!1;if(t){var r=t._getChartType();if(null!=r&&r!=i){i=r;n=!0}}switch(i){case ChartType.Column:this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Bar:this._barPlotter.rotated=!this._rotated;this._barPlotter.isVolume=!1;this._barPlotter.width=.7;e=this._barPlotter;break;case ChartType.Line:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Scatter:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!1;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.LineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.Area:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Bubble:e=this._bubblePlotter;break;case ChartType.Candlestick:(s=this._financePlotter).isCandle=!0;s.isEqui=!1;s.isArms=!1;s.isVolume=!1;e=s;break;case ChartType.HighLowOpenClose:var s;(s=this._financePlotter).isCandle=!1;s.isEqui=!1;s.isArms=!1;s.isVolume=!1;e=s;break;case ChartType.Spline:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!0;this._linePlotter.isStep=!1;e=this._linePlotter;break;case ChartType.SplineArea:this._areaPlotter.isSpline=!0;this._areaPlotter.isStep=!1;e=this._areaPlotter;break;case ChartType.Funnel:e=this._funnelPlotter;break;case ChartType.Step:this._linePlotter.hasSymbols=!1;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepSymbols:this._linePlotter.hasSymbols=!0;this._linePlotter.hasLines=!0;this._linePlotter.isSpline=!1;this._linePlotter.isStep=!0;e=this._linePlotter;break;case ChartType.StepArea:this._areaPlotter.isSpline=!1;this._areaPlotter.isStep=!0;e=this._areaPlotter;break;default:throw"Invalid chart type."}e.rotated=this._rotated;i==ChartType.Bar&&(e.rotated=!e.rotated);n&&(e.rotated=this._isRotated());return e};FlexChartCore.prototype._layout=function(t,e,i){this.plotAreas.length>0?this._layoutMultiple(t,e,i):this._layoutSingle(t,e,i)};FlexChartCore.prototype._layoutSingle=function(t,e,i){var n=t.width,r=t.height,s=new Size(n,.75*r),a=new Size(r,.75*n),o=0,l=0,h=n,c=r,u=0,_=0,p=n,d=r;if(this.dataLabel.position===LabelPosition.Top?this.dataLabel.content:null){l=i.measureString(this.dataLabel.content,DataLabelClsNames.label).height}for(var f=this._getAxes(),g=this.axisY._getHeight(i,r),y=0;y<f.length;y++){var m=(T=f[y]).origin,b=T._getPosition();if(T.axisType==AxisType.X){(S=T._getHeight(i,Math.max(10,n-g)))>s.height&&(S=s.height);T._desiredSize=new Size(s.width,S);T._hasOrigin=isNumber(m)&&m>this.axisY._getMinNum()&&m<this.axisY._getMaxNum();var x=T._hasOrigin,v=Math.min(.25*n,T._annoSize.width);if(b==Position.Bottom){o=Math.max(o,.5*v);h=Math.min(h,n-.5*v);if(x){var C=this._convertY(m,_,d);d-=Math.max(0,C+S-d)}else d-=S}else if(b==Position.Top){o=Math.max(o,.5*v);h=Math.min(h,n-.5*v);if(x){C=this._convertY(m,_,d);_+=Math.max(0,_-(C-S))}else _+=S}}else if(T.axisType==AxisType.Y){var S;(S=T===this.axisX?g:T._getHeight(i,r))>a.height&&(S=a.height);T._desiredSize=new Size(a.width,S);T._hasOrigin=isNumber(m)&&m>this.axisX._getMinNum()&&m<this.axisX._getMaxNum();x=T._hasOrigin;if(b==Position.Left){if(T._actualAngle<0)c=Math.min(c,r-T._annoSize.height);else if(T._actualAngle>0)l=Math.max(l,T._annoSize.height);else{l=Math.max(l,T._annoSize.height);c=Math.min(c,r-T._annoSize.height)}if(x){var A=this._convertX(m,u,p);u+=Math.max(0,u-(A-S))}else u+=S}else if(b==Position.Right){if(T._actualAngle>0)c=Math.min(c,r-T._annoSize.height);else if(T._actualAngle<0)l=Math.max(l,T._annoSize.height);else{l=Math.max(l,T._annoSize.height);c=Math.min(c,r-T._annoSize.height)}if(x){A=this._convertX(m,u,p);p-=Math.max(0,A+S-p)}else p-=S}}}var w,P,M=this._parseMargin(this.plotMargin);o=u=isNumberNaN(+M.left)?Math.max(o,u)+t.left:M.left;h=p=isNumberNaN(+M.right)?Math.min(h,p)+t.left:e.width-M.right;l=_=isNumberNaN(+M.top)?Math.max(l,_)+t.top:M.top;c=d=isNumberNaN(+M.bottom)?Math.min(c,d)+t.top:e.height-M.bottom;n=Math.max(1,h-o);r=Math.max(1,c-l);this._plotRect=new Rect(o,l,n,r);c<=l&&(d=_+1);i.stroke=null;for(y=0;y<f.length;y++){var T,L=(T=f[y]).origin;b=T._getPosition();if(T.axisType==AxisType.X){if(T._hasOrigin){C=this._convertY(L,this._plotRect.top,this._plotRect.bottom);if(b==Position.Bottom){w=new Rect(o,C,n,T._desiredSize.height);d+=Math.max(0,w.bottom-this._plotRect.bottom)}else if(b==Position.Top){w=new Rect(o,C-T._desiredSize.height,n,T._desiredSize.height);_-=Math.max(0,this._plotRect.top-w.top)}else w=new Rect(o,C,n,1)}else if(b==Position.Bottom){w=new Rect(o,d,n,T._desiredSize.height);d+=T._desiredSize.height}else if(b==Position.Top){w=new Rect(o,_-T._desiredSize.height,n,T._desiredSize.height);_-=T._desiredSize.height}else w=new Rect(o,_,n,1);T._layout(w,this._plotRect)}else if(T.axisType==AxisType.Y){if(T._hasOrigin){A=this._convertX(L,this._plotRect.left,this._plotRect.right);if(b==Position.Left){P=new Rect(A-T._desiredSize.height,l,r,T._desiredSize.height);u-=T._desiredSize.height}else if(b==Position.Right){P=new Rect(A,l,r,T._desiredSize.height);p+=T._desiredSize.height}else P=new Rect(A,l,r,1)}else if(b==Position.Left){P=new Rect(u-T._desiredSize.height,l,r,T._desiredSize.height);u-=T._desiredSize.height}else if(b==Position.Right){P=new Rect(p,l,r,T._desiredSize.height);p+=T._desiredSize.height}else P=new Rect(u,l,r,1);T._layout(P,this._plotRect)}}};FlexChartCore.prototype._layoutMultiple=function(t,e,i){for(var n=t.width,r=t.height,s=[],a=[],o=this._getAxes(),l=o.length,h=0;h<l;h++){(A=o[h])._plotrect=null;if(A.axisType==AxisType.X){for(var c=A.plotArea?A.plotArea.column:0;s.length<=c;)s.push(new _AreaDef);s[c].axes.push(A)}else if(A.axisType==AxisType.Y){for(var u=A.plotArea?A.plotArea.row:0;a.length<=u;)a.push(new _AreaDef);a[u].axes.push(A)}}for(var _=s.length,p=a.length,d=new Size(n,.3*r),f=new Size(r,.3*n),g=0,y=0,m=n,b=r,x=0;x<_;x++){(F=s[x]).right=n;F.bottom=r;for(h=0;h<F.axes.length;h++){var v=(A=F.axes[h])._getHeight(i,A.axisType==AxisType.X?n:r);v>d.height&&(v=d.height);var C=new Size(d.width,v);A._desiredSize=C;0==x&&(F.left=Math.max(F.left,.5*A._annoSize.width));x==_-1&&(F.right=Math.min(F.right,n-.5*A._annoSize.width));(B=A._getPosition())==Position.Bottom?F.bottom-=C.height:B==Position.Top&&(F.top+=C.height)}}for(var S=0;S<p;S++){(F=a[S]).right=n;F.bottom=r;for(h=0;h<F.axes.length;h++){var A=F.axes[h],w=new Size(f.width,A._getHeight(i,A.axisType==AxisType.X?n:r));w.height>f.height&&(w.height=f.height);A._desiredSize=w;0==S&&(F.top=Math.max(F.top,.5*A._annoSize.width));S==p-1&&(F.bottom=Math.min(F.bottom,r-.5*A._annoSize.width));(B=A._getPosition())==Position.Left?F.left+=w.height:B==Position.Right&&(F.right-=w.height)}}var P=0,M=0,T=n,L=r;for(x=0;x<_;x++){var F=s[x];P=Math.max(P,F.left);M=Math.max(M,F.top);T=Math.min(T,F.right);L=Math.min(L,F.bottom)}for(S=0;S<p;S++){F=a[S];P=Math.max(P,F.left);M=Math.max(M,F.top);T=Math.min(T,F.right);L=Math.min(L,F.bottom)}P=g=Math.max(g,P);T=m=Math.min(m,T);M=y=Math.max(y,M);L=b=Math.min(b,L);this._plotRect=new Rect(g,y,m-g,b-y);var E,N=this._plotRect.clone(),I=g,R=this.plotAreas._calculateWidths(this._plotRect.width,_);for(x=0;x<_;x++){L=b;M=y;F=s[x];var k=R[x];for(h=0;h<F.axes.length;h++){var B=(A=F.axes[h])._getPosition(),D=new Rect(I,N.top,k,N.height);if(B==Position.Bottom){E=new Rect(I,L,k,A._desiredSize.height);L+=A._desiredSize.height}else if(B==Position.Top){E=new Rect(I,M-A._desiredSize.height,k,A._desiredSize.height);M-=A._desiredSize.height}A._layout(E,D)}for(h=0;h<this.plotAreas.length;h++){(z=this.plotAreas[h]).column==x&&z._setPlotX(I,k)}I+=k}var O,V=y,H=this.plotAreas._calculateHeights(this._plotRect.height,p);for(S=0;S<p;S++){P=g;T=m;F=a[S];var j=H[S];for(h=0;h<F.axes.length;h++){B=(A=F.axes[h])._getPosition(),D=new Rect(N.left,V,N.width,j);if(A._plotrect){D.left=A._plotrect.left;D.width=A._plotrect.width}else R&&R.length>0&&(D.width=R[0]);if(B==Position.Left){O=new Rect(P-A._desiredSize.height,V,j,A._desiredSize.height);P-=A._desiredSize.height}else if(B==Position.Right){O=new Rect(T,V,j,A._desiredSize.height);T+=A._desiredSize.height}A._layout(O,D)}for(h=0;h<this.plotAreas.length;h++){var z;(z=this.plotAreas[h]).row==S&&z._setPlotY(V,j)}V+=j}};FlexChartCore.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())};FlexChartCore.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())};FlexChartCore.prototype._getLabelContent=function(t,e){return t.chartElement!==ChartElement.AxisX&&t.chartElement!==ChartElement.AxisY||!t.name?isString(e)?this._keywords.replace(e,t):isFunction(e)?e(t):null:t.name};FlexChartCore.prototype._select=function(t,e){var i=this.selectionMode,n=!1;(t!=this._selection||i==SelectionMode.Point&&e!=this._selectionIndex)&&(n=!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);if(i==SelectionMode.Point){var r=t?t.collectionView:this._cv;if(r){this._notifyCurrentChanged=!1;r.moveCurrentToPosition(t?e:-1);this._notifyCurrentChanged=!0}}n&&this.onSelectionChanged()};FlexChartCore.prototype._highlightCurrent=function(){if(this.selectionMode!=SelectionMode.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)}}};FlexChartCore.prototype._highlight=function(t,e,i){t=asType(t,SeriesBase,!0);if(this.selectionMode==SelectionMode.Series){var n=this.series.indexOf(t),r=t.hostElement;e?r.parentNode.appendChild(r):r.parentNode.insertBefore(r,r.parentNode.childNodes.item(n));var s=this._find(r,["rect","ellipse","polyline","polygon","line","path"]);this._highlightItems(s,FlexChartCore._CSS_SELECTION,e);t.legendElement&&this._highlightItems(this._find(t.legendElement,["rect","ellipse","line"]),FlexChartCore._CSS_SELECTION,e)}else if(this.selectionMode==SelectionMode.Point){n=this.series.indexOf(t),r=t.hostElement;if(e){r.parentNode.appendChild(r);var a=t.getPlotElement(i);if(a)if(a instanceof SVGElement){if("g"!=a.nodeName){this._highlightItems([a],FlexChartCore._CSS_SELECTION,e);this._selectedEls.push(a)}if((s=this._find(a,["line","rect","ellipse","path","polygon"])).length>0){this._highlightItems(s,FlexChartCore._CSS_SELECTION,e);for(var o=0;o<s.length;o++)this._selectedEls.push(s[o])}}else if(Array.isArray(a)){this._highlightItems(a,FlexChartCore._CSS_SELECTION,e);for(o=0;o<a.length;o++)this._selectedEls.push(a[o])}}else{r.parentNode.insertBefore(r,r.parentNode.childNodes.item(n));if(this._selectedEls.length>0){this._highlightItems(this._selectedEls,FlexChartCore._CSS_SELECTION,e);this._selectedEls.length=0}}}};FlexChartCore.prototype._updateTooltip=function(t,e){var i,n=this.hitTest(e);if(n.distance<=t.threshold){var r=t.content;if(n.series){var s=n.series.tooltipContent;(s||""===s)&&(r=s)}i=this._getLabelContent(n,r)}this._hideToolTip();i&&this._showToolTip(i,new Rect(e.clientX,e.clientY,5,5))};FlexChartCore.prototype._updateAuxAxes=function(t,e){for(var i,n,r=2;r<t.length;r++){var s=t[r];s._chart=this;for(var a=[],o=0;o<this.series.length;o++){var l=this.series[o];l.axisX!=s&&l.axisY!=s||a.push(l)}for(o=0;o<a.length;o++){var h=a[o].getDataRect()||a[o]._getDataRect();if(h)if(s.axisType==AxisType.X&&!e||s.axisType==AxisType.Y&&e){(void 0===i||h.left<i)&&(i=h.left);(void 0===n||h.right>n)&&(n=h.right)}else{(void 0===i||h.top<i)&&(i=h.top);(void 0===n||h.bottom>n)&&(n=h.bottom)}}var c=a[0].getDataType(0);null==c&&(c=DataType.Number);t[r]._updateActualLimits(c,i,n)}};FlexChartCore._CSS_AXIS_X=AxisClsNames.axisX;FlexChartCore._CSS_AXIS_Y=AxisClsNames.axisY;FlexChartCore._CSS_LINE=AxisClsNames.line;FlexChartCore._CSS_GRIDLINE=AxisClsNames.gridline;FlexChartCore._CSS_TICK=AxisClsNames.tick;FlexChartCore._CSS_GRIDLINE_MINOR=AxisClsNames.gridlineMinor;FlexChartCore._CSS_TICK_MINOR=AxisClsNames.tickMinor;FlexChartCore._CSS_DATA_LABELS=DataLabelClsNames.labels;return FlexChartCore}(FlexChartBase);export{FlexChartCore};var _AreaDef=function(){function _AreaDef(){this._axes=[];this.left=0;this.right=0;this.top=0;this.bottom=0}Object.defineProperty(_AreaDef.prototype,"axes",{get:function(){return this._axes},enumerable:!0,configurable:!0});return _AreaDef}(),_DataInfo=function(){function _DataInfo(){this.stackAbs={};this._xvals=null}_DataInfo.prototype.analyse=function(t,e,i,n,r,s){var a=this;this.minY=NaN;this.maxY=NaN;this.minX=NaN;this.maxX=NaN;this.minXp=NaN;this.minYp=NaN;this.dx=0;var o,l={},h={},c={};this.dataTypeX=null;this.dataTypeY=null;this._xvals=n;if(null!=n)for(var u=n.length,_=0;_<u;_++){var p=n[_];(isNumberNaN(+this.minX)||this.minX>p)&&(this.minX=p);(isNumberNaN(+this.maxX)||this.maxX<p)&&(this.maxX=p);p>0&&(isNumberNaN(+this.minXp)||this.minXp>p)&&(this.minXp=p);if(_>0){var d=Math.abs(p-n[_-1]);!isNumberNaN(+d)&&(d<this.dx||0==this.dx)&&(this.dx=d)}}var _loop_1=function(r){var s=t[r],u=s._getChartType(),_=void 0!==s.chartType,p=s.visibility;if(p==SeriesVisibility.Hidden||p==SeriesVisibility.Legend)return"continue";var d=s.getDataRect();if(d){if(!isNumberNaN(+f.minX)&&f.minX<d.left){o=d.right;d.left=f.minX;d.width=o-f.minX}!isNumberNaN(+f.maxX)&&f.maxX>d.right&&(d.width=f.maxX-d.left);if(!s._isCustomAxisY()){if(!isNumberNaN(+f.minY)&&f.minY<d.top){o=d.bottom;d.top=f.minY;d.height=o-f.minY}!isNumberNaN(+f.maxY)&&f.maxY>d.bottom&&(d.height=f.maxY-d.top)}}var g=null;e?s._isCustomAxisY()||(g=s.getValues(1)):s._isCustomAxisX()||(g=s.getValues(1));if(g){f.dataTypeX||(f.dataTypeX=s.getDataType(1));for(var y=0;y<g.length;y++){var m=g[y];if(isNumberFinite(+m)){(isNumberNaN(+f.minX)||f.minX>m)&&(f.minX=m);(isNumberNaN(+f.maxX)||f.maxX<m)&&(f.maxX=m);if(y>0&&(!u||u==ChartType.Column||u==ChartType.Bar)){var b=Math.abs(m-g[y-1]);!isNumberNaN(+b)&&b>0&&(b<f.dx||0==f.dx)&&(f.dx=b)}}}}var x=null,v=!1;if(e){v=s._isCustomAxisX();x=s.getValues(0)}else{v=s._isCustomAxisY();x=s.getValues(0)}if(x){f.dataTypeY||v||(f.dataTypeY=s.getDataType(0));isNumberNaN(+f.minX)?f.minX=0:g||n||(f.minX=Math.min(f.minX,0));isNumberNaN(+f.maxX)?f.maxX=x.length-1:g||n||(f.maxX=Math.max(f.maxX,x.length-1));if(!v){var C=i==Stacking.None||_,_loop_2=function(t){var e=x[t],i=g?asNumber(g[t],!0):n?asNumber(n[t],!0):t;isArray(e)?e.forEach((function(t){a._parseYVal(t,i,C,c,l,h)})):f._parseYVal(e,i,C,c,l,h)};for(y=0;y<x.length;y++)_loop_2(y)}}var S=s.getDataRect(new Rect(f.minX,f.minY,f.maxX-f.minX,f.maxY-f.minY),d);if(S){f.minX=S.left;f.maxX=S.right;if(!v){f.minY=S.top;f.maxY=S.bottom}}},f=this;for(_=0;_<t.length;_++)_loop_1(_);if(i==Stacking.Stacked){for(var g in l)l[g]>this.maxY&&(this.maxY=l[g]);for(var g in h)h[g]<this.minY&&(this.minY=h[g])}else if(i==Stacking.Stacked100pc){this.minY=0;this.maxY=0;for(var g in c){var y=c[g];if(isNumberFinite(+y)&&0!=y){var m=l[g],b=h[g];isNumberFinite(+m)&&(m=Math.max(m/y,this.maxY))>this.maxY&&(this.maxY=m);isNumberFinite(+b)&&(b=Math.min(b/y,this.minY))<this.minY&&(this.minY=b)}}if(this.minY==this.maxY){this.minY=0;this.maxY=1}}this.stackAbs=c;r&&(e?this.minY=isNumberNaN(+this.minYp)?1:this.minYp:this.minX=isNumberNaN(+this.minXp)?1:this.minXp);s&&(e?this.minX=isNumberNaN(+this.minXp)?1:this.minXp:this.minY=isNumberNaN(+this.minYp)?1:this.minYp)};_DataInfo.prototype._parseYVal=function(t,e,i,n,r,s){if(isNumberFinite(+t)){null!=t&&(isNumberNaN(+this.minY)||this.minY>t)&&(this.minY=t);null!=t&&(isNumberNaN(+this.maxY)||this.maxY<t)&&(this.maxY=t);t>0&&(isNumberNaN(+this.minYp)||this.minYp>t)&&(this.minYp=t);if(!i){t>0?isNumberNaN(+r[e])?r[e]=t:r[e]+=t:isNumberNaN(+s[e])?s[e]=t:s[e]+=t;isNumberNaN(+n[e])?n[e]=Math.abs(t):n[e]+=Math.abs(t)}}};_DataInfo.prototype.getMinY=function(){return this.minY};_DataInfo.prototype.getMaxY=function(){return this.maxY};_DataInfo.prototype.getMinX=function(){return this.minX};_DataInfo.prototype.getMaxX=function(){return this.maxX};_DataInfo.prototype.getMinXp=function(){return this.minXp};_DataInfo.prototype.getMinYp=function(){return this.minYp};_DataInfo.prototype.getDeltaX=function(){return this.dx};_DataInfo.prototype.getDataTypeX=function(){return this.dataTypeX};_DataInfo.prototype.getDataTypeY=function(){return this.dataTypeY};_DataInfo.prototype.getStackedAbsSum=function(t){var e=this.stackAbs[t];return isNumberFinite(+e)?e:0};_DataInfo.prototype.getXVals=function(){return this._xvals};_DataInfo.isValid=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var i=t.length,n=0;n<i;n++)if(!isNumberFinite(+t[n]))return!1;return!0};return _DataInfo}();export{_DataInfo};var FlexChart=function(t){__extends(FlexChart,t);function FlexChart(e,i){var n=t.call(this,e,null)||this;n._chartType=ChartType.Column;n.initialize(i);return n}FlexChart.prototype._getChartType=function(){return this._chartType};Object.defineProperty(FlexChart.prototype,"chartType",{get:function(){return this._chartType},set:function(t){if((t=asEnum(t,ChartType))!=this._chartType){this._chartType=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"rotated",{get:function(){return this._rotated},set:function(t){if(t!=this._rotated){this._rotated=asBoolean(t);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"stacking",{get:function(){return this._stacking},set:function(t){if((t=asEnum(t,Stacking))!=this._stacking){this._stacking=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexChart.prototype,"options",{get:function(){return this._options},set:function(t){if(t!=this._options){this._options=t;this.invalidate()}},enumerable:!0,configurable:!0});return FlexChart}(FlexChartCore);export{FlexChart};export var LabelPosition;!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"}(LabelPosition||(LabelPosition={}));export var PieLabelPosition;!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"}(PieLabelPosition||(PieLabelPosition={}));var DataLabelRenderEventArgs=function(t){__extends(DataLabelRenderEventArgs,t);function DataLabelRenderEventArgs(e,i,n,r){var s=t.call(this,e)||this;s.cancel=!1;s._ht=i;s._pt=n;s._text=r;return s}Object.defineProperty(DataLabelRenderEventArgs.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelRenderEventArgs.prototype,"text",{get:function(){return this._text},set:function(t){this._text=asString(t)},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelRenderEventArgs.prototype,"hitTestInfo",{get:function(){return this._ht},enumerable:!0,configurable:!0});return DataLabelRenderEventArgs}(RenderEventArgs);export{DataLabelRenderEventArgs};var DataLabelBase=function(){function DataLabelBase(){this.rendering=new Event}Object.defineProperty(DataLabelBase.prototype,"content",{get:function(){return this._content},set:function(t){if(t!=this._content){this._content=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"border",{get:function(){return this._bdr},set:function(t){if(t!=this._bdr){this._bdr=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"offset",{get:function(){return this._off},set:function(t){if(t!=this._off){this._off=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(DataLabelBase.prototype,"connectingLine",{get:function(){return this._line},set:function(t){if(t!=this._line){this._line=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});DataLabelBase.prototype.onRendering=function(t){this.rendering.raise(this,t);return!t.cancel};DataLabelBase.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};return DataLabelBase}();export{DataLabelBase};var DataLabel=function(t){__extends(DataLabel,t);function DataLabel(){var e=null!==t&&t.apply(this,arguments)||this;e._pos=LabelPosition.Top;return e}Object.defineProperty(DataLabel.prototype,"position",{get:function(){return this._pos},set:function(t){if((t=asEnum(t,LabelPosition))!=this._pos){this._pos=t;this._invalidate()}},enumerable:!0,configurable:!0});return DataLabel}(DataLabelBase);export{DataLabel};var PieDataLabel=function(t){__extends(PieDataLabel,t);function PieDataLabel(){var e=null!==t&&t.apply(this,arguments)||this;e._pos=PieLabelPosition.Center;return e}Object.defineProperty(PieDataLabel.prototype,"position",{get:function(){return this._pos},set:function(t){if((t=asEnum(t,PieLabelPosition))!=this._pos){this._pos=t;this._invalidate()}},enumerable:!0,configurable:!0});return PieDataLabel}(DataLabelBase);export{PieDataLabel};var _DataPoint=function(){function _DataPoint(t,e,i,n){this._seriesIndex=t;this._pointIndex=e;this._dataX=i;this._dataY=n}Object.defineProperty(_DataPoint.prototype,"seriesIndex",{get:function(){return this._seriesIndex},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"dataX",{get:function(){return this._dataX},set:function(t){t!==this._dataX&&(this._dataX=t)},enumerable:!0,configurable:!0});Object.defineProperty(_DataPoint.prototype,"dataY",{get:function(){return this._dataY},set:function(t){t!==this._dataY&&(this._dataY=t)},enumerable:!0,configurable:!0});return _DataPoint}();export{_DataPoint};export var _MeasureOption;!function(t){t[t.X=0]="X";t[t.Y=1]="Y";t[t.XY=2]="XY"}(_MeasureOption||(_MeasureOption={}));var _RectArea=function(){function _RectArea(t){this._rect=t}Object.defineProperty(_RectArea.prototype,"rect",{get:function(){return this._rect},enumerable:!0,configurable:!0});_RectArea.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};_RectArea.prototype.pointDistance=function(t,e,i){var n=e.x-t.x,r=e.y-t.y;return i==_MeasureOption.X?Math.abs(n):i==_MeasureOption.Y?Math.abs(r):Math.sqrt(n*n+r*r)};_RectArea.prototype.distance=function(t){var e=_MeasureOption.XY;isNumberNaN(+t.x)||null===t.x?e=_MeasureOption.Y:(isNumberNaN(+t.y)||null===t.y)&&(e=_MeasureOption.X);var i=this._rect;return t.x<i.left?t.y<i.top?this.pointDistance(t,new Point(i.left,i.top),e):t.y>i.bottom?this.pointDistance(t,new Point(i.left,i.bottom),e):e==_MeasureOption.Y?0:i.left-t.x:t.x>i.right?t.y<i.top?this.pointDistance(t,new Point(i.right,i.top),e):t.y>i.bottom?this.pointDistance(t,new Point(i.right,i.bottom),e):e==_MeasureOption.Y?0:t.x-i.right:e==_MeasureOption.X?0:t.y<i.top?i.top-t.y:t.y>i.bottom?t.y-i.bottom:0};return _RectArea}();export{_RectArea};var _CircleArea=function(){function _CircleArea(t,e){this._center=t;this.setRadius(e)}_CircleArea.prototype.setRadius=function(t){this._rad=t;this._rad2=t*t};Object.defineProperty(_CircleArea.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});Object.defineProperty(_CircleArea.prototype,"radius",{get:function(){return this._rad},enumerable:!0,configurable:!0});_CircleArea.prototype.contains=function(t){var e=this._center.x-t.x,i=this._center.y-t.y;return e*e+i*i<=this._rad2};_CircleArea.prototype.distance=function(t){var e=isNumberNaN(+t.x)?0:this._center.x-t.x,i=isNumberNaN(+t.y)?0:this._center.y-t.y,n=e*e+i*i;return n<=this._rad2?0:Math.sqrt(n)-this._rad};return _CircleArea}();export{_CircleArea};var _LinesArea=function(){function _LinesArea(t,e){this._x=[];this._y=[];this._x=t;this._y=e}_LinesArea.prototype.distanceToPoint=function(t){if(!t)return NaN;for(var e=NaN,i=0;i<this._x.length;i++){if(this._x[i]===t.x&&this._y[i]===t.y)return 0;if(i<this._x.length-1){var n=FlexChartCore._dist(t,new Point(this._x[i],this._y[i]),new Point(this._x[i+1],this._y[i+1]));(isNumberNaN(+e)||n<e)&&(e=n)}}return e};_LinesArea.prototype.contains=function(t){return!1};_LinesArea.prototype.distance=function(t){return this.distanceToPoint(t)};return _LinesArea}();export{_LinesArea};var _HitResult=function _HitResult(){};export{_HitResult};var _HitTester=function(){function _HitTester(t){this._map={};this._chart=t}_HitTester.prototype.add=function(t,e){if(this._map[e]){t.tag||(t.tag=new _DataPoint(e,NaN,NaN,NaN));this._map[e].push(t)}};_HitTester.prototype.clear=function(){this._map={};for(var t=this._chart.series,e=0;e<t.length;e++)t[e].hitTest===Series.prototype.hitTest&&(this._map[e]=[])};_HitTester.prototype.hitTest=function(t,e){void 0===e&&(e=!1);for(var i=null,n=Number.MAX_VALUE,r=this._chart.series.length-1;r>=0;r--){var s=this._map[r];if(s){for(var a=s.length-1;a>=0;a--){var o=s[a];if(!tryCast(o,_LinesArea)||e){var l=o.distance(t);if(l<n){i=o;if(0==(n=l))break}}}if(0==n)break}}if(i){var h=new _HitResult;h.area=i;h.distance=n;return h}return null};_HitTester.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){i=a;if(0==(n=o))break}}if(i){var l=new _HitResult;l.area=i;l.distance=n;return l}return null};return _HitTester}();export{_HitTester};export var ChartElement;!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"}(ChartElement||(ChartElement={}));var HitTestInfo=function(){function HitTestInfo(t,e,i){this._pointIndex=null;this._chartElement=ChartElement.None;this._chart=t;this._pt=e;this._chartElement=i}Object.defineProperty(HitTestInfo.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"point",{get:function(){return this._pt},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"pointIndex",{get:function(){return this._pointIndex},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"chartElement",{get:function(){return this._chartElement},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"distance",{get:function(){return this._dist},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.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(HitTestInfo.prototype,"x",{get:function(){void 0===this._x&&(this._x=this._getValue(1,!1));return this._x},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"y",{get:function(){void 0===this._y&&(this._y=this._getValue(0,!1));return this._y},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"value",{get:function(){var t=this._chart._getHitTestValue(this.pointIndex,this._groupIndex);return null!=t?t:this.series&&null!=this.series._getValue?this.series._getValue(this.pointIndex):this.y},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.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(HitTestInfo.prototype,"groupIndex",{get:function(){return this._groupIndex},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"_xfmt",{get:function(){void 0===this.__xfmt&&(this.__xfmt=this._getValue(1,!0));return this.__xfmt},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"_yfmt",{get:function(){void 0===this.__yfmt&&(this.__yfmt=this._getValue(0,!0));return this.__yfmt},enumerable:!0,configurable:!0});HitTestInfo.prototype._setData=function(t,e){this._series=t;this._pointIndex=e};HitTestInfo.prototype._setDataGroup=function(t,e){this._groupIndex=t;this._pointIndex=e};HitTestInfo.prototype._setName=function(t){this._name=t;t&&(this._dist=0)};HitTestInfo.prototype._setDataPoint=function(t){if(t=asType(t,_DataPoint,!0)){this._pointIndex=t.pointIndex;var e=asType(this._chart,FlexChartCore,!0),i=t.seriesIndex;null!==i&&i>=0&&i<e.series.length&&(this._series=e.series[i]);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)}};HitTestInfo.prototype._getValueFmt=function(){var t=this.value;if(null!=t){if(null==this.series){var e=t==Math.round(t)?"{val:n0}":"{val:n}";return format(e,{val:t})}t=this._chart._isRotated()?this.ax._formatValue(t):this.ay._formatValue(t)}return t};HitTestInfo.prototype._getValue=function(t,e){var i=this._chart._getHitTestValue(this.pointIndex,this.groupIndex);if(null!==i)return i;var n=null,r=this._chart,s=this.pointIndex,a=r._isRotated();if(null!==this.series&&null!==s){var o=this.series.getValues(t),l=this.series.getDataType(t);if(o&&this.pointIndex<o.length){n=o[this.pointIndex];l!=DataType.Date||e||(n=new Date(n))}else if(1==t)if(r._xlabels&&r._xlabels.length>0&&s<r._xlabels.length)n=r._xlabels[s];else if(r._xvals&&s<r._xvals.length){n=r._xvals[s];r._xDataType!=DataType.Date||e||(n=new Date(n))}}null!==n&&e&&(a?0==t?n=this.ax._formatValue(n):1==t&&(n=this.ay._formatValue(n)):0==t?n=this.ay._formatValue(n):1==t&&(n=this.ax._formatValue(n)));return n};Object.defineProperty(HitTestInfo.prototype,"ax",{get:function(){return this.series.axisX?this.series.axisX:this._chart.axisX},enumerable:!0,configurable:!0});Object.defineProperty(HitTestInfo.prototype,"ay",{get:function(){return this.series.axisY?this.series.axisY:this._chart.axisY},enumerable:!0,configurable:!0});return HitTestInfo}();export{HitTestInfo};export var SeriesVisibility;!function(t){t[t.Visible=0]="Visible";t[t.Plot=1]="Plot";t[t.Legend=2]="Legend";t[t.Hidden=3]="Hidden"}(SeriesVisibility||(SeriesVisibility={}));export var Marker;!function(t){t[t.Dot=0]="Dot";t[t.Box=1]="Box"}(Marker||(Marker={}));var DataArray=function DataArray(){};export{DataArray};var SeriesEventArgs=function(t){__extends(SeriesEventArgs,t);function SeriesEventArgs(e){var i=t.call(this)||this;i._series=asType(e,SeriesBase);return i}Object.defineProperty(SeriesEventArgs.prototype,"series",{get:function(){return this._series},enumerable:!0,configurable:!0});return SeriesEventArgs}(EventArgs);export{SeriesEventArgs};var SeriesBase=function(){function SeriesBase(t){this._altStyle=null;this._symbolMarker=Marker.Dot;this._visibility=SeriesVisibility.Visible;this._interpolateNulls=null;this._cache={};this.rendering=new Event;this.rendered=new Event;this.initialize(t)}Object.defineProperty(SeriesBase.prototype,"interpolateNulls",{get:function(){return null==this._interpolateNulls?this._chart&&this._chart.interpolateNulls:this._interpolateNulls},set:function(t){if(t!=this._interpolateNulls){this._interpolateNulls=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"style",{get:function(){return this._style},set:function(t){if(t!=this._style){this._style=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"altStyle",{get:function(){return this._altStyle},set:function(t){if(t!=this._altStyle){this._altStyle=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolStyle",{get:function(){return this._symbolStyle},set:function(t){if(t!=this._symbolStyle){this._symbolStyle=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolSize",{get:function(){return this._symbolSize},set:function(t){if(t!=this._symbolSize){this._symbolSize=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"symbolMarker",{get:function(){return this._symbolMarker},set:function(t){if((t=asEnum(t,Marker,!0))!=this._symbolMarker){this._symbolMarker=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"binding",{get:function(){return this._binding?this._binding:this._chart?this._chart.binding:null},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._clearValues();this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"bindingX",{get:function(){return this._bindingX?this._bindingX:this._chart?this._chart.bindingX:null},set:function(t){if(t!=this._bindingX){this._bindingX=asString(t,!0);this._clearValues();this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"name",{get:function(){return this._name},set:function(t){this._name=t},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"itemsSource",{get:function(){return this._itemsSource},set:function(t){if(t!=this._itemsSource){if(this._cv){this._cv.currentChanged.removeHandler(this._cvCurrentChanged,this);this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._itemsSource=t;this._cv=asCollectionView(t);if(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(SeriesBase.prototype,"collectionView",{get:function(){return this._cv?this._cv:this._chart?this._chart.collectionView:null},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"legendElement",{get:function(){return this._legendElement},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"cssClass",{get:function(){return this._cssClass},set:function(t){this._cssClass=asString(t,!0)},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"visibility",{get:function(){return this._visibility},set:function(t){if((t=asEnum(t,SeriesVisibility))!=this._visibility){this._visibility=t;this._clearValues();this._invalidate();this._chart&&this._chart.onSeriesVisibilityChanged(new SeriesEventArgs(this))}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"tooltipContent",{get:function(){return this._tooltipContent},set:function(t){t!=this._tooltipContent&&(this._tooltipContent=t)},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"itemFormatter",{get:function(){return this._itemFormatter},set:function(t){if(t!=this._itemFormatter){this._itemFormatter=asFunction(t);this._invalidate()}},enumerable:!0,configurable:!0});SeriesBase.prototype.hitTest=function(t,e){isNumber(t)&&isNumber(e)?t=new Point(t,e):t instanceof MouseEvent&&(t=new Point(t.pageX,t.pageY));asType(t,Point);return this._chart?this._chart._hitTestSeries(t,this._chart.series.indexOf(this)):null};SeriesBase.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(SeriesBase.prototype,"axisX",{get:function(){return this._axisX},set:function(t){if(t!=this._axisX){this._axisX=asType(t,Axis,!0);if(this._axisX){this._axisX._chart=this._chart;var e=this._axisX._chart;e&&-1==e.axes.indexOf(this._axisX)&&e.axes.push(this._axisX)}this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){this._axisY=asType(t,Axis,!0);if(this._axisY){this._axisY._chart=this._chart;var e=this._axisY._chart;e&&-1==e.axes.indexOf(this._axisY)&&e.axes.push(this._axisY)}this._invalidate()}},enumerable:!0,configurable:!0});SeriesBase.prototype.initialize=function(t){copy(this,t)};SeriesBase.prototype.pointToData=function(t){asType(t,Point);(t=t.clone()).x=this._getAxisX().convertBack(t.x);t.y=this._getAxisY().convertBack(t.y);return t};SeriesBase.prototype.dataToPoint=function(t){asType(t,Point);(t=t.clone()).x=this._getAxisX().convert(t.x);t.y=this._getAxisY().convert(t.y);return t};SeriesBase.prototype.onRendering=function(t,e,i){var n=new SeriesRenderingEventArgs(t,e,i);this.rendering.raise(this,n);return n.cancel};SeriesBase.prototype.onRendered=function(t){this.rendered.raise(this,new RenderEventArgs(t))};Object.defineProperty(SeriesBase.prototype,"_chart",{get:function(){return this.__chart},set:function(t){t!==this.__chart&&(this.__chart=t)},enumerable:!0,configurable:!0});SeriesBase.prototype._getSymbolSize=function(){return null!=this.symbolSize?this.symbolSize:this.chart.symbolSize};Object.defineProperty(SeriesBase.prototype,"_plotter",{get:function(){this.chart&&!this.__plotter&&(this.__plotter=this.chart._getPlotter(this));return this.__plotter},set:function(t){t!=this.__plotter&&(this.__plotter=t)},enumerable:!0,configurable:!0});SeriesBase.prototype.getDataType=function(t){return 0==t?this._valueDataType:1==t?this._xvalueDataType:null};SeriesBase.prototype.getValues=function(t){if(0==t){if(null==this._values){this._valueDataType=null;if(null!=this._cv){var e=this._bindValues(this._cv.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}else if(null!=this.binding&&null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this._getBinding(0));this._values=e.values;this._valueDataType=e.dataType}}return this._values}if(1==t){if(null==this._xvalues){this._xvalueDataType=null;if(null!=this.bindingX)if(null!=this._cv){e=this._bindValues(this._cv.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}else{if(null==this._bindingX)return null;if(null!=this._chart&&null!=this._chart.collectionView){e=this._bindValues(this._chart.collectionView.items,this.bindingX,!0);this._xvalueDataType=e.dataType;this._xvalues=e.values}}}return this._xvalues}return null};SeriesBase.prototype.drawLegendItem=function(t,e,i){var n=this._getChartType();null==n&&(n=this._chart._getChartType());var r=this._getLegendStyle(this.style);n===ChartType.Funnel?this._drawFunnelLegendItem(t,e,i,r,this.symbolStyle):this._drawLegendItem(t,e,n,this.name,r,this.symbolStyle)};SeriesBase.prototype._getLegendStyle=function(t){if(t){var e={};t.fill&&(e.fill=t.fill);t.stroke&&(e.stroke=t.stroke);return e}};SeriesBase.prototype.measureLegendItem=function(t,e){var i=this._getChartType();null==i&&(i=this._chart._getChartType());return i===ChartType.Funnel?this._measureLegendItem(t,this._getFunnelLegendName(e)):this._measureLegendItem(t,this.name)};SeriesBase.prototype.legendItemLength=function(){var t=this._getChartType();null==t&&(t=this._chart._getChartType());return t===ChartType.Funnel?this._chart._xlabels&&this._chart._xlabels.length?this._chart._xlabels.length:this._chart._xvals&&this._chart._xvals.length?this._chart._xvals.length:1:1};SeriesBase.prototype.getDataRect=function(t,e){return null};SeriesBase.prototype._getChartType=function(){return this._chartType};SeriesBase.prototype._getAccessibleChartTypeName=function(){return null};SeriesBase.prototype._clearValues=function(){this._values=null;this._xvalues=null;this.__plotter=null;this._cache={}};SeriesBase.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};SeriesBase.prototype._getBindingValues=function(t){if(this._cache[t])return this._cache[t];var e=void 0;null!=this._cv?e=this._cv.items:null!=this._chart&&null!=this._chart.collectionView&&(e=this._chart.collectionView.items);var i=this._bindValues(e,this._getBinding(t));this._cache[t]=i.values;return this._cache[t]};SeriesBase.prototype._getItem=function(t){var e=null,i=null;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]);return e};SeriesBase.prototype._getLength=function(){var t=0,e=null;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);return t};SeriesBase.prototype._setPointIndex=function(t,e){this._pointIndexes[t]=e};SeriesBase.prototype._getDataRect=function(){var t=this.getValues(0),e=this.getValues(1);if(t){for(var i=NaN,n=NaN,r=NaN,s=NaN,a=t.length,o=0;o<a;o++){var l=t[o];if(isArray(l)){var h=l,c=Math.min.apply(Math,h),u=Math.max.apply(Math,h);if(isNumberNaN(+n)){n=c;s=u}else{c<n&&(n=c);u>s&&(s=u)}}else isNumberFinite(+l)&&(isNumberNaN(+n)?n=s=l:l<n?n=l:l>s&&(s=l));if(e){var _=e[o];isNumberFinite(+_)&&(isNumberNaN(+i)?i=r=_:_<i?i=_:l>s&&(r=_))}}if(!e){i=0;r=a-1}if(!isNumberNaN(+n))return new Rect(i,n,r-i,s-n)}return null};SeriesBase.prototype._isCustomAxisX=function(){return!!this._axisX&&(!this._chart||this._axisX!=this.chart.axisX)};SeriesBase.prototype._isCustomAxisY=function(){return!!this._axisY&&(!this._chart||this._axisY!=this.chart.axisY)};SeriesBase.prototype._getAxisX=function(){var t=null;this.axisX?t=this.axisX:this.chart&&(t=this.chart.axisX);return t};SeriesBase.prototype._getAxisY=function(){var t=null;this.axisY?t=this.axisY:this.chart&&(t=this.chart.axisY);return t};SeriesBase.prototype._measureLegendItem=function(t,e){var i=new Size;i.width=SeriesBase._LEGEND_ITEM_WIDTH;i.height=SeriesBase._LEGEND_ITEM_HEIGHT;if(this._name){var n=t.measureString(e,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND);i.width+=n.width;i.height<n.height&&(i.height=n.height)}i.width+=3*SeriesBase._LEGEND_ITEM_MARGIN;i.height+=2*SeriesBase._LEGEND_ITEM_MARGIN;return i};SeriesBase.prototype._drawFunnelLegendItem=function(t,e,i,n,r){t.strokeWidth=1;var s=SeriesBase._LEGEND_ITEM_MARGIN,a=null,o=null;null===a&&(a=this._chart._getColorLight(i));null===o&&(o=this._chart._getColor(i));t.fill=a;t.stroke=o;var l=e.top+.5*e.height,h=SeriesBase._LEGEND_ITEM_WIDTH,c=SeriesBase._LEGEND_ITEM_HEIGHT,u=this._getFunnelLegendName(i);t.drawRect(e.left+s,l-.5*c,h,c,null,r||n);null!=u&&FlexChartCore._renderText(t,u,new Point(e.left+c+2*s,l),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)};SeriesBase.prototype._getFunnelLegendName=function(t){var e,i=this._chart;if(i._xlabels&&i._xlabels.length&&t<i._xlabels.length)e=i._xlabels[t];else if(i._xvals&&i._xvals.length&&t<i._xvals.length){e=i._xvals[t];i._xDataType===DataType.Date&&(e=FlexChartCore._fromOADate(e))}null==e&&(e=this.name);return e.toString()};SeriesBase.prototype._drawLegendItem=function(t,e,i,n,r,s){t.strokeWidth=1;var a=SeriesBase._LEGEND_ITEM_MARGIN,o=null,l=null;null===o&&(o=this._chart._getColorLight(this._chart.series.indexOf(this)));null===l&&(l=this._chart._getColor(this._chart.series.indexOf(this)));t.fill=o;t.stroke=l;var h=e.top+.5*e.height,c=SeriesBase._LEGEND_ITEM_WIDTH,u=SeriesBase._LEGEND_ITEM_HEIGHT;switch(i){case ChartType.Area:case ChartType.SplineArea:case ChartType.StepArea:t.drawRect(e.left+a,h-.5*u,c,u,null,r);break;case ChartType.Bar:case ChartType.Column:t.drawRect(e.left+a,h-.5*u,c,u,null,s||r);break;case ChartType.Scatter:case ChartType.Bubble:var _=.3*c,p=.3*u;this.symbolMarker==Marker.Box?t.drawRect(e.left+a+.5*c-_,h-p,2*_,2*p,null,s||r):t.drawEllipse(e.left+.5*c+a,h,_,p,null,s||r);break;case ChartType.Line:case ChartType.Spline:case ChartType.Step:t.drawLine(e.left+a,h,e.left+c+a,h,null,r);break;case ChartType.LineSymbols:case ChartType.SplineSymbols:case ChartType.StepSymbols:_=.3*c,p=.3*u;this.symbolMarker==Marker.Box?t.drawRect(e.left+a+.5*c-_,h-p,2*_,2*p,null,s||r):t.drawEllipse(e.left+.5*c+a,h,_,p,null,s||r);t.drawLine(e.left+a,h,e.left+c+a,h,null,r);break;case ChartType.Candlestick:case ChartType.HighLowOpenClose:t.drawLine(e.left+a,h,e.left+c+a,h,null,s||r)}this._name&&FlexChartCore._renderText(t,n,new Point(e.left+u+2*a,h),0,1,FlexChartCore._CSS_LABEL,FlexChartCore._CSS_LEGEND)};SeriesBase.prototype._cvCollectionChanged=function(t,e){this._clearValues();this._invalidate()};SeriesBase.prototype._cvCurrentChanged=function(t,e){this._chart&&this._chart._notifyCurrentChanged&&this._invalidate()};SeriesBase.prototype._bindValues=function(t,e,i){void 0===i&&(i=!1);var n,r,s;if(null!=t){var a=t.length;n=new Array(t.length);for(var o=e?new Binding(e):null,l=0;l<a;l++){s=null;var h=t[l];null!=o&&(h=o.getValue(h));if(isArray(h)&&h.length>0){s=h;h=h[0]}if(isNumber(h)){n[l]=h;r=DataType.Number}else if(isDate(h)){n[l]=h.valueOf();r=DataType.Date}else if(i&&h){n[l]=l;r=DataType.Number}isArray(s)&&s.length>0&&(n[l]=s)}}var c=new DataArray;c.values=n;c.dataType=r;return c};SeriesBase.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};SeriesBase.prototype._indexToPoint=function(t){if(t>=0&&t<this._values.length){var e=this._values[t],i=this._xvalues?this._xvalues[t]:t;return new Point(i,e)}return null};SeriesBase.prototype._getSymbolFill=function(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.fill);!e&&this.style&&(e=this.style.fill);!e&&this.chart&&(e=this.chart._getColorLight(t));return e};SeriesBase.prototype._getSymbolStroke=function(t){var e=null;this.symbolStyle&&(e=this.symbolStyle.stroke);!e&&this.style&&(e=this.style.stroke);!e&&this.chart&&(e=this.chart._getColor(t));return e};SeriesBase.prototype._getAltSymbolStroke=function(t){var e=null;this.altStyle&&(e=this.altStyle.stroke);return e};SeriesBase.prototype._getAltSymbolFill=function(t){var e=null;this.altStyle&&(e=this.altStyle.fill);return e};SeriesBase.prototype._renderLabels=function(t,e,i,n){this._plotter&&this._plotter._renderLabels(t,this,e,i,n)};SeriesBase._LEGEND_ITEM_WIDTH=10;SeriesBase._LEGEND_ITEM_HEIGHT=10;SeriesBase._LEGEND_ITEM_MARGIN=4;return SeriesBase}();export{SeriesBase};var _BasePlotter=function(){function _BasePlotter(){this._DEFAULT_WIDTH=2;this._DEFAULT_SYM_SIZE=10;this.clipping=!0}_BasePlotter.prototype.clear=function(){this.seriesCount=0;this.seriesIndex=0};_BasePlotter.prototype._renderLabels=function(t,e,i,n,r){var s=i.length,a=n.dataLabel,o=a.border,l=a.offset,h=a.connectingLine;void 0===l&&(l=h?16:0);o&&(l-=2);for(var c=0;c<s;c++){var u=i[c],_=asType(u.tag,_DataPoint,!0);_&&!u.ignoreLabel&&this._renderLabel(t,u,_,n,a,e,l,r)}};_BasePlotter.prototype._renderLabel=function(t,e,i,n,r,s,a,o){var l,h=null==r.position?LabelPosition.Top:r.position,c=r.border,u=r.connectingLine,_=new HitTestInfo(n,l);_._setDataPoint(i);var p=n._getLabelContent(_,r.content);l=this._getLabelPoint(s,i);this._getPointAndPosition(l,h,e,n);if(n._plotRect.contains(l)){var d=new DataLabelRenderEventArgs(t,_,l,p);if(r.onRendering)if(r.onRendering(d)){p=d.text;l=d.point}else p=null;if(p){var f=this._renderLabelAndBorder(t,p,h,a,l,u,2,c);if(f){var g=new _RectArea(f);g.tag=i;o.push(g)}}t.cssPriority=!0}};_BasePlotter.prototype._getPointAndPosition=function(t,e,i,n){if(i instanceof _RectArea){var r=i;n._isRotated()?t.y=r.rect.top+.5*r.rect.height:t.x=r.rect.left+.5*r.rect.width}};_BasePlotter.prototype._getLabelPoint=function(t,e){var i=t._getAxisX(),n=t._getAxisY();return new Point(i.convert(e.dataX),n.convert(e.dataY))};_BasePlotter.prototype._renderLabelAndBorder=function(t,e,i,n,r,s,a,o){var l,h=DataLabelClsNames.label,c=DataLabelClsNames.line,u=DataLabelClsNames.border,_=FlexChartCore._CSS_DATA_LABELS;switch(i){case LabelPosition.Top:s&&t.drawLine(r.x,r.y,r.x,r.y-n,c);r.y-=a+n;l=FlexChartCore._renderText(t,e,r,1,2,h,_);break;case LabelPosition.Bottom:s&&t.drawLine(r.x,r.y,r.x,r.y+n,c);r.y+=a+n;l=FlexChartCore._renderText(t,e,r,1,0,h,_);break;case LabelPosition.Left:s&&t.drawLine(r.x,r.y,r.x-n,r.y,c);r.x-=a+n;l=FlexChartCore._renderText(t,e,r,2,1,h,_);break;case LabelPosition.Right:s&&t.drawLine(r.x,r.y,r.x+n,r.y,c);r.x+=a+n;l=FlexChartCore._renderText(t,e,r,0,1,h,_);break;case LabelPosition.Center:l=FlexChartCore._renderText(t,e,r,1,1,h,_)}o&&l&&t.drawRect(l.left-a,l.top-a,l.width+2*a,l.height+2*a,u);return l};_BasePlotter.prototype.getOption=function(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&!isUndefined(i[t])&&null!==i[t])return i[t]};_BasePlotter.prototype.getNumOption=function(t,e){var i=this.chart._options;e&&(i=i?i[e]:null);if(i&&i[t])return asNumber(i[t],!0)};_BasePlotter.prototype.getItemFormatter=function(t){if(t instanceof SeriesBase){var e=t;return e.itemFormatter?e.itemFormatter:this.chart.itemFormatter}return this.chart.itemFormatter};_BasePlotter.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};_BasePlotter.prototype.isValid=function(t,e,i,n){return isNumberFinite(+t)&&isNumberFinite(+e)&&FlexChartCore._contains(this.chart._plotRect,new Point(t,e))};_BasePlotter.prototype.load=function(){};_BasePlotter.prototype.unload=function(){};_BasePlotter.prototype._createSteps=function(t,e,i){var n=this.getOption("position","step"),r=i||t.length,s=[],a=[],o=this.chart._isRotated();if("center"==n)if(o)for(var l=0;l<r;l++){var h=0==l?e[l+1]-e[l]:e[l]-e[l-1],c=l==r-1?e[l]-e[l-1]:e[l+1]-e[l];s.push(t[l]);a.push(e[l]-.5*h);s.push(t[l]);a.push(e[l]+.5*c)}else for(l=0;l<r;l++){var u=0==l?t[l+1]-t[l]:t[l]-t[l-1],_=l==r-1?t[l]-t[l-1]:t[l+1]-t[l];s.push(t[l]-.5*u);a.push(e[l]);s.push(t[l]+.5*_);a.push(e[l])}else if("end"==n)for(l=0;l<r;l++){if(l>0)if(o){s.push(t[l]);a.push(e[l-1])}else{s.push(t[l-1]);a.push(e[l])}s.push(t[l]);a.push(e[l])}else for(l=0;l<r;l++){s.push(t[l]);a.push(e[l]);if(l<r-1)if(o){s.push(t[l]);a.push(e[l+1])}else{s.push(t[l+1]);a.push(e[l])}}return{x:s,y:a}};return _BasePlotter}();export{_BasePlotter};var Series=function(t){__extends(Series,t);function Series(){return null!==t&&t.apply(this,arguments)||this}Object.defineProperty(Series.prototype,"chartType",{get:function(){return this._chartType},set:function(t){if((t=asEnum(t,ChartType,!0))!=this._chartType){this._chartType=t;this._invalidate()}},enumerable:!0,configurable:!0});return Series}(SeriesBase);export{Series};var FlexPie=function(t){__extends(FlexPie,t);function FlexPie(e,i){var n=t.call(this,e,null,!0)||this;n._areas=[];n._keywords=new _KeyWords;n._startAngle=0;n._innerRadius=0;n._offset=0;n._reversed=!1;n._isAnimated=!1;n._selectedItemPosition=Position.None;n._selectedItemOffset=0;n._pieGroups=[];n._rotationAngles=[];n._centers=[new Point];n._selectedOffset=new Point;n._selectedIndex=-1;n._angles=[];n._colRowLens=[];n._titles=void 0;n._values=[];n._labels=[];n._pels=[];n._sum=0;n._sums=[];n._bindingSeparator=",";n.applyTemplate(ControlClsNames.hostElement+" "+FlexChartClsNames.hostElement+" "+FlexPieClsNames.hostElement,null,null);n._currentRenderEngine=new _SvgRenderEngine(n.hostElement);n._legend=new Legend(n);n._tooltip=new ChartTooltip;n._tooltip.content="<b>{name}</b><br/>{value}";n._tooltip.showDelay=0;n._lbl=new PieDataLabel;n._lbl._chart=n;n.addEventListener(n.hostElement,"mousemove",(function(t){var e=n._tooltip;if(e.content&&!n.isTouching){var i=n.hitTest(t,void 0,!0);if(i.distance<=e.threshold){var r=n._getLabelContent(i,n.tooltip.content);n._showToolTip(r,new Rect(t.clientX,t.clientY,5,5))}else n._hideToolTip()}}));n.addEventListener(n.hostElement,"click",(function(t){var e=!0;if(n.selectionMode==SelectionMode.Point){var i=n.hitTest(t),r=FlexChartBase._SELECTION_THRESHOLD;n.tooltip&&n.tooltip.threshold&&(r=n.tooltip.threshold);if(i.distance<=r){i.pointIndex!=n._selectionIndex&&n.selectedItemPosition!=Position.None&&(e=!1);i.pointIndex!=n._selectionIndex&&n._select(i.pointIndex,!0)}else n._selectedIndex>=0&&n._select(null)}if(e&&n.isTouching){var s=n._tooltip;if(s.content){if((i=n.hitTest(t,void 0,!0)).distance<=s.threshold){var a=n._getLabelContent(i,n.tooltip.content);n._showToolTip(a,new Rect(t.clientX,t.clientY,5,5))}else n._hideToolTip()}}n.focusMode&&n._updateAccessibilityFocusFromState(n._getAccessibilityFocusStateFromClick(t))}));n.addEventListener(n.hostElement,"mouseleave",(function(t){n._hideToolTip()}));n.deferUpdate((function(){return n.initialize(i)}));return n}FlexPie.prototype._getAccessibleChartTypeName=function(){return _getAccessibleChartTypeName(this.innerRadius>0?"doughnutChart":"pieChart")};FlexPie.prototype._createAccessibilityModel=function(){for(var e=t.prototype._createAccessibilityModel.call(this),i=this._getBindings(),n=this._values,r=this._getLabelsForLegend(),s=this.titles,a=n&&n.length?n.length:i.length,o=r?r.length:0,l=this.focusMode,h=0;h<a;h++){var c=n&&n[h];if(c){for(var u={index:h,name:_toAccessibilityText(s&&s[h]||i[h])||_getUnnamedAccessibilitySeriesName(h),points:[]},_=0;_<c.length;_++){var p=_toAccessibilityText(r&&r[_]);l&&this._isRenderablePiePointValue(c[_])&&u.points.push({index:_,category:p||_,value:c[_]});l&&0===h&&_<o&&this._isAccessibilityLegendVisible()&&e.legendItems.push({name:p||_getUnnamedAccessibilitySeriesName(_),seriesIndex:h,pointIndex:_})}e.series.push(u)}}return e};FlexPie.prototype._getAccessibilityTooltipContent=function(e){var i=this._accessibilityModel,n=e&&e.seriesIndex,r=e&&e.pointIndex;if(e&&"legend"===e.region){var s=i&&i.legendItems?i.legendItems[e.legendIndex]:null;n=s&&s.seriesIndex;r=s&&s.pointIndex}if((e&&"series"===e.region||e&&"legend"===e.region)&&null!=n&&null!=r&&this.tooltip.content){var a=new HitTestInfo(this,new Point);a._chartElement=ChartElement.SeriesSymbol;a._setDataGroup(n,r);return this._getLabelContent(a,this.tooltip.content)}return t.prototype._getAccessibilityTooltipContent.call(this,e)};FlexPie.prototype._isRenderablePiePointValue=function(t){return null!=t&&isNumberFinite(+t)&&Math.abs(t)>0};FlexPie.prototype._getAccessibilityFocusStateFromClick=function(t){var e=this.hitTest(t);if(e.chartElement===ChartElement.Header&&this.header)return{region:"title"};if(e.chartElement===ChartElement.Legend){var i=this._getAccessibilityLegendFocusIndex(e.pointIndex);if(i>=0)return{region:"legend",legendIndex:i}}if(null!=e.pointIndex&&e.distance<=this.tooltip.threshold){var n=e.groupIndex||0;if(this._isRenderablePiePointValue(this._getPiePointValue(n,e.pointIndex)))return{region:"series",seriesIndex:n,pointIndex:e.pointIndex}}return e.chartElement===ChartElement.ChartArea||e.chartElement===ChartElement.PlotArea?{region:"chart"}:null};FlexPie.prototype._getPiePointValue=function(t,e){var i=this._values&&this._values[t];return i&&null!=e?i[e]:null};FlexPie.prototype._getAccessibilityLegendFocusIndex=function(t){var e=this._accessibilityModel,i=e&&e.legendItems?e.legendItems:[];if(null==t)return-1;for(var n=0;n<i.length;n++)if(i[n].pointIndex===t)return n;return-1};FlexPie.prototype._getAccessibilitySeriesPointShape=function(t,e){var i=this._values&&this._values[t],n=i?i.length:0,r=n?t*n+e:e,s=this._areas&&this._areas[r],a=_getAreaShape(s);return this._getTransformedPointFocusShape(a,s,r,e)||_getRectFocusShape(this._rectChart)};FlexPie.prototype._getTransformedPointFocusShape=function(t,e,i,n){var r=this,s=e&&e.gi?e.gi:0,a=this._rotationAngles&&this._rotationAngles[s]?this._rotationAngles[s]:0,o=this._centers&&this._centers[s],l=this._getAccessibilitySelectedOffset(i,n);return t&&o&&(a||l)?"segment"===t.type?{type:t.type,center:this._transformAccessibilityPoint(t.center,o,a,l),radius:t.radius,innerRadius:t.innerRadius,angle:t.angle+a*Math.PI/180,sweep:t.sweep}:"circle"===t.type?{type:t.type,center:this._transformAccessibilityPoint(t.center,o,a,l),radius:t.radius}:"polygon"===t.type?{type:t.type,points:t.points.map((function(t){return r._transformAccessibilityPoint(t,o,a,l)}))}:t:t};FlexPie.prototype._getAccessibilitySelectedOffset=function(t,e){var i=this._angles&&this._angles[t],n=this.selectedItemOffset;return this._selectedIndex===e&&n>0&&isNumberFinite(+i)?new Point(Math.cos(i)*n*this._radius,Math.sin(i)*n*this._radius):null};FlexPie.prototype._transformAccessibilityPoint=function(t,e,i,n){var r=t.x+(n?n.x:0),s=t.y+(n?n.y:0);if(i){var a=i*Math.PI/180,o=r-e.x,l=s-e.y,h=Math.sqrt(o*o+l*l),c=Math.atan2(l,o)+a;r=e.x+h*Math.cos(c);s=e.y+h*Math.sin(c)}return new Point(r,s)};Object.defineProperty(FlexPie.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"bindingName",{get:function(){return this._bindingName},set:function(t){if(t!=this._bindingName){this._bindingName=asString(t,!0);this._bindChart()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"startAngle",{get:function(){return this._startAngle},set:function(t){if(t!=this._startAngle){this._startAngle=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"offset",{get:function(){return this._offset},set:function(t){if(t!=this._offset){this._offset=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerRadius",{get:function(){return this._innerRadius},set:function(t){if(t!=this._innerRadius){this._innerRadius=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerTextStyle",{get:function(){return this._innerTextStyle},set:function(t){if(t!=this._innerText){this._innerTextStyle=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"innerText",{get:function(){return this._innerText},set:function(t){if(t!=this._innerText){this._innerText=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"reversed",{get:function(){return this._reversed},set:function(t){if(t!=this._reversed){this._reversed=asBoolean(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedItemPosition",{get:function(){return this._selectedItemPosition},set:function(t){if((t=asEnum(t,Position,!0))!=this._selectedItemPosition){this._selectedItemPosition=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedItemOffset",{get:function(){return this._selectedItemOffset},set:function(t){if(t!=this._selectedItemOffset){this._selectedItemOffset=asNumber(t,!0);this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"isAnimated",{get:function(){return this._isAnimated},set:function(t){t!=this._isAnimated&&(this._isAnimated=t)},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"tooltip",{get:function(){return this._tooltip},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"dataLabel",{get:function(){return this._lbl},set:function(t){if(t!=this._lbl){this._lbl=t;this._lbl&&(this._lbl._chart=this)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"selectedIndex",{get:function(){return this._selectedIndex},set:function(t){if(t!=this._selectedIndex){var e=asNumber(t,!0);this._select(e,!0)}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"titles",{get:function(){return this._titles},set:function(t){if(t!==this._titles){this._titles=t;this.invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(FlexPie.prototype,"chartsPerLine",{get:function(){return this._chartsPerLine},set:function(t){if(t!=this._chartsPerLine){this._chartsPerLine=asNumber(t,!0,!0);this.invalidate()}},enumerable:!0,configurable:!0});FlexPie.prototype._getLabelsForLegend=function(){return this._labels};FlexPie.prototype.hitTest=function(t,e,i){var n=this._toControl(t,e),r=new HitTestInfo(this,n),s=null;if(FlexChartBase._contains(this._rectHeader,n))r._chartElement=ChartElement.Header;else if(FlexChartBase._contains(this._rectFooter,n))r._chartElement=ChartElement.Footer;else if(FlexChartBase._contains(this._rectLegend,n)){r._chartElement=ChartElement.Legend;null!==(s=this.legend._hitTest(n))&&s>=0&&s<this._areas.length&&r._setData(null,s)}else if(FlexChartBase._contains(this._rectChart,n)){this._hitTestData(r,n,i);r._chartElement=ChartElement.ChartArea}else r._chartElement=ChartElement.None;return r};FlexPie.prototype._hitTestData=function(t,e,i){for(var n,r=this._areas.length,s=NaN,a=0;a<r;a++){var o=e.clone(),l=this._areas[a],h=this._rotationAngles[l.gi];if(0!=h){var c=this._centers[l.gi],u=c.x,_=c.y,p=-u+o.x,d=-_+o.y,f=Math.sqrt(p*p+d*d),g=Math.atan2(d,p)-h*Math.PI/180;o.x=u+f*Math.cos(g);o.y=_+f*Math.sin(g)}if(a==this._selectedIndex){o.x-=this._selectedOffset.x;o.y-=this._selectedOffset.y}var y=this._areas[a];if(y.contains(o)){if(!0===i){s=0;n=y;continue}t._setDataGroup(l.gi,y.tag);t._dist=0;if(a!=this._selectedIndex)break}var m=y.distance(o);if(void 0!==m&&(isNumberNaN(+s)||m<s||!0===i&&this._isSmallSegment(m,n,y))){s=m;n=y}}if(0!==t._dist&&null!=n){t._setDataGroup(n.gi,n.tag);t._dist=s}};FlexPie.prototype._isSmallSegment=function(t,e,i){return t<=.5*this.tooltip.threshold&&Math.abs(i.sweep)<=.035&&Math.abs(e.sweep/i.sweep)>=10};FlexPie.prototype._performBind=function(){this._initData();if(this._cv){this._selectionIndex=this._cv.currentPosition;var t=this._cv.items;if(t){for(var e=t.length,i=this._getBindings(),n=0;n<i.length;n++){this._values[n]=[];this._sums[n]=0}for(var r=0;r<e;r++){var s=t[r];for(n=0;n<i.length;n++)this._sums[n]+=Math.abs(this._getBindData(s,this._values[n],0==n?this._labels:null,i[n],this.bindingName))}}}};FlexPie.prototype._getBindings=function(){var t=[],e=this.binding;if(e){var i=this._bindingSeparator;i&&(t=e.split(i))}return t};FlexPie.prototype._initData=function(){this._sum=0;this._sums=[];this._values=[];this._labels=[]};FlexPie.prototype._getBindData=function(t,e,i,n,r){var s,a=0,o=n?new Binding(n):null;o&&(s=o.getValue(t));a=0;isNumber(s)?a=asNumber(s):s&&(a=parseFloat(s.toString()));if(!isNumberNaN(+a)&&isNumberFinite(+a))e.push(a);else{a=0;e.push(a)}var l=r?new Binding(r):null;if(i)if(l&&t){var h=l.getValue(t);h&&(h=h.toString());i.push(h)}else i.push(a.toString());return a};FlexPie.prototype._render=function(e,i,n){void 0===i&&(i=!0);void 0===n&&(n=null);this._selectionAnimationID&&clearInterval(this._selectionAnimationID);this.onRendering(new RenderEventArgs(e));t.prototype._render.call(this,e,i,n)};FlexPie.prototype._prepareRender=function(){this._areas=[]};FlexPie.prototype._renderChart=function(t,e,i){var n=this._rectChart.clone(),r=(new Size(n.width,n.height),e.width),s=e.height,a=this._parseMargin(this.plotMargin),o=this.dataLabel,l=o.content&&o.position==PieLabelPosition.Outside,h=l?(isNumber(o.offset)?o.offset:0)+24:0;isNumberNaN(+a.left)&&(a.left=l?h:FlexPie._MARGIN);isNumberNaN(+a.right)&&(a.right=l?h:FlexPie._MARGIN);isNumberNaN(+a.top)&&(a.top=l?h:FlexPie._MARGIN);isNumberNaN(+a.bottom)&&(a.bottom=l?h:FlexPie._MARGIN);e.top+=a.top;s=e.height-(a.top+a.bottom);e.height=s>0?s:24;e.left+=a.left;r=e.width-(a.left+a.right);e.width=r>0?r:24;var c=this._getBindings(),u=this.titles;void 0===u&&c.length>1&&(u=c);var _=this._layout(t,e,u,c.length);this._angles=[];this._pels=[];this._pieGroups=[];this._rotationAngles=[];for(var p=0;p<c.length;p++){var d=_[p];u&&p<u.length&&u[p]&&FlexChartBase._renderText(t,u[p],new Point(d.left+.5*d.width,d.top),1,2,FlexPie._CSS_GROUP_TITLE);var f=t.startGroup(FlexPieClsNames.sliceGroup,null,!0);this._pieGroups.push(f);this._renderData(t,d,p,f);t.endGroup();this._rotationAngles.push(0)}this._highlightCurrent();this.innerText&&this._renderInnerText(t);this.dataLabel.content&&this.dataLabel.position!=PieLabelPosition.None&&this._renderLabels(t);this.onRendered(new RenderEventArgs(t))};FlexPie.prototype._layout=function(t,e,i,n){var r=0,s=n,a=1,o=0;if(i)for(var l=0;l<i.length;l++)o=Math.max(o,t.measureString(i[l],FlexPie._CSS_GROUP_TITLE).height);var h=Math.floor(this.chartsPerLine);if(h>0){s=Math.min(n,h);a=Math.ceil(n/s);var c=Math.floor(e.width/s),u=Math.floor(e.height/a)-o;r=Math.min(c,u)}else for(var _=1;_<=n;_++){var p=Math.floor((n+(_-1))/_);c=Math.floor(e.width/_),u=Math.floor(e.height/p);(u-=o)<c&&(c=u);if(c>r){r=c;s=_;a=p}}for(var d=[],f=.5*(e.width-r*s),g=.5*(e.height-(r+o)*a),y=0;y<a;y++)for(var m=0;m<s;m++)d.push(new Rect(e.left+r*m+8+f,e.top+(r+o)*y+8+g+o,r-16,r-16));return d};FlexPie.prototype._getDesiredLegendSize=function(t,e,i,n){var r=new Size,s=(new Size(i,n),this._getLabelsForLegend()),a=s.length,o=0,l=0;this.legend.scrollbar;this._colRowLens=[];for(var h=0;h<a;h++){var c=this._measureLegendItem(t,s[h]);if(e){if(l+c.height>n&&!this.legend.scrollbar){r.height=n;this._colRowLens.push(o);o=0;l=0}o<c.width&&(o=c.width);l+=c.height}else{if(o+c.width>i&&!this.legend.scrollbar){r.width=i;this._colRowLens.push(l);l=0;o=0}l<c.height&&(l=c.height);o+=c.width}}if(e){r.height<l&&(r.height=l);this._colRowLens.push(o);r.width=this._colRowLens.reduce((function(t,e){return t+e}),0)}else{r.width<o&&(r.width=o);this._colRowLens.push(l);r.height=this._colRowLens.reduce((function(t,e){return t+e}),0)}return r};FlexPie.prototype._renderLegend=function(t,e,i,n,r,s){for(var a=new Rect(e.x,e.y,r,s),o=this._getLabelsForLegend(),l=o.length,h=0,c=e.clone(),u=0;u<l;u++){var _=this._measureLegendItem(t,o[u]);if(n){if(c.y+_.height>a.bottom+1&&!this.legend.scrollbar){c.x+=this._colRowLens[h];h++;c.y=e.y}}else if(c.x+_.width>a.right+1&&!this.legend.scrollbar){c.y+=this._colRowLens[h];h++;c.x=e.x}var p=new Rect(c.x,c.y,_.width,_.height);this._drawLegendItem(t,p,u,o[u]);i.push(p);n?c.y+=_.height:c.x+=_.width}};FlexPie.prototype._renderData=function(t,e,i,n){var r=this._sums[i],s=this.startAngle+180,a=this.innerRadius,o=this.offset;a>1&&(a=1);if(r>0){var l=s*Math.PI/180,h=e.left+.5*e.width,c=e.top+.5*e.height,u=Math.min(.5*e.width,.5*e.height);this._centers[i]=new Point(h,c);var _=Math.max(o,this.selectedItemOffset);_>0&&(o*=u/=1+_);this._radius=u;var p=a*u;this._renderPie(t,i,u,p,l,o)}};FlexPie.prototype._renderPie=function(t,e,i,n,r,s){this._renderSlices(t,this._values[e],this._sums[e],e,i,n,r,2*Math.PI,s)};FlexPie.prototype._getCenter=function(){return this._centers[0]};FlexPie.prototype._renderSlices=function(t,e,i,n,r,s,a,o,l){for(var h,c,u,_=e.length,p=0,d=a,f=1==this.reversed,g=this._centers[n],y=0;y<_;y++)this._isRenderablePiePointValue(e[y])&&p++;var m=1===p?360:359.9/360;for(y=0;y<_;y++){c=g.x;u=g.y;h=t.startGroup(FlexPieClsNames.slice);t.fill=this._getColorLight(y);t.stroke=this._getColor(y);var b=Math.abs(e[y]),x=Math.abs(b-i)<1e-10?o:o*b/i;x=Math.min(x,o*m);var v=f?d-.5*x:d+.5*x;if(l>0&&x<o){c+=l*Math.cos(v);u+=l*Math.sin(v)}this._renderSlice(t,c,u,v,n,y,r,s,d,x,o);f?d-=x:d+=x;t.endGroup();this._pels.push(h)}};FlexPie.prototype._renderSlice=function(t,e,i,n,r,s,a,o,l,h,c){var u=this,_=!!this.reversed;this._angles.push(n);if(this.itemFormatter){var p=new HitTestInfo(this,new Point(e+a*Math.cos(n),i+a*Math.sin(n)),ChartElement.SeriesSymbol);p._setData(null,s);this.itemFormatter(t,p,(function(){u._drawSlice(t,r,s,_,e,i,a,o,l,h)}));t.cssPriority=!0}else this._drawSlice(t,r,s,_,e,i,a,o,l,h)};FlexPie.prototype._getSelectedItemOffset=function(t,e){var i=0,n=0,r=0;t==this._selectedIndex&&this.selectedItemOffset>0&&(r=this.selectedItemOffset);if(r>0){i=Math.cos(e)*r*this._radius;n=Math.sin(e)*r*this._radius}return{x:i,y:n}};FlexPie.prototype._renderInnerText=function(t){for(var e=this.innerText,i=this.innerTextStyle,n=0;n<this._centers.length;n++){var r=this._centers[n],s=void 0;if(s=isFunction(e)?e(n):isArray(e)?asString(e[n]):asString(e)){s=format(s,{total:this._sums[n],binding:this._getBindings()[n]});i&&(t.cssPriority=!1);FlexPie._renderText(t,s,r,1,1,FlexChartBase._CSS_TITLE,null,i);t.cssPriority=!0}}};FlexPie.prototype._renderLabels=function(t){var e,i=this._areas.length,n=this.dataLabel,r=n.position,s=DataLabelClsNames.labels,a=DataLabelClsNames.label,o=DataLabelClsNames.border,l=DataLabelClsNames.line,h=this._rotationAngles,c=n.connectingLine,u=n.offset?n.offset:0;t.stroke="null";t.fill="transparent";t.strokeWidth=1;t.startGroup(s);for(var _=0;_<i;_++){var p=this._areas[_];if(p){var d=p.radius,f=p.langle+h[p.gi],g=1,y=1;if(r==PieLabelPosition.Center||r===PieLabelPosition.Radial||r===PieLabelPosition.Circular)d*=.5*(1+(p.innerRadius||0)/p.radius);else{if((f=_Math.clampAngle(f))<=-170||f>=170){g=2;y=1}else if(f>=-100&&f<=-80){g=1;y=2}else if(f>=-10&&f<=10){g=0;y=1}else if(f>=80&&f<=100){g=1;y=0}else if(-180<f&&f<-90){g=2;y=2}else if(-90<=f&&f<0){g=0;y=2}else if(0<f&&f<90){g=0;y=0}else if(90<f&&f<180){g=2;y=0}if(r==PieLabelPosition.Inside){g=2-g;y=2-y}}f*=Math.PI/180;var m=p.gi?_-p.gi*this._values[0].length:_,b=this._getSelectedItemOffset(m,f),x=b.x,v=b.y,C=d;r==PieLabelPosition.Outside?C+=u:r==PieLabelPosition.Inside&&(C-=u);var S=p.center.x,A=p.center.y,w=this._centers[p.gi],P=S-w.x,M=A-w.y;if(0!=this._rotationAngles[p.gi]){var T=Math.sqrt(P*P+M*M),L=Math.atan2(M,P)+this._rotationAngles[p.gi]*Math.PI/180;S=w.x+T*Math.cos(L);A=w.y+T*Math.sin(L)}var F=new Point(S+x+C*Math.cos(f),A+v+C*Math.sin(f));if(n.border&&r!=PieLabelPosition.Center){0==g?F.x+=2:2==g&&(F.x-=2);0==y?F.y+=2:2==y&&(F.y-=2)}var E=new HitTestInfo(this,F);E._setDataGroup(p.gi,p.tag);var N=this._getLabelContent(E,n.content),I=new DataLabelRenderEventArgs(t,E,F,N);if(n.onRendering)if(n.onRendering(I)){N=I.text;F=I.point}else N=null;if(N){var R=180*Math.atan2(A-F.y,S-F.x)/Math.PI;R=(R+360)%360;if(r===PieLabelPosition.Radial||r===PieLabelPosition.Circular){if(r===PieLabelPosition.Radial)R>90&&R<270&&(R+=180);else{R>180&&R<360&&(R+=180);R-=90}(e=FlexChartBase._renderRotatedText(t,N,F,g,y,F,R,a).getBBox()).left=e.x;e.top=e.y}else e=FlexChartBase._renderText(t,N,F,g,y,a);n.border&&t.drawRect(e.left-2,e.top-2,e.width+4,e.height+4,o);if(c){var k=new Point(S+x+d*Math.cos(f),A+v+d*Math.sin(f));t.drawLine(F.x,F.y,k.x,k.y,l)}}t.cssPriority=!0}}t.endGroup()};FlexPie.prototype._drawSlice=function(t,e,i,n,r,s,a,o,l,h){var c;if(n)if(o>0){0!=h&&t.drawDonutSegment(r,s,a,o,l-h,h);(c=new _DonutSegment(new Point(r,s),a,o,l-h,h,this.startAngle)).tag=i;this._areas.push(c)}else{0!=h&&t.drawPieSegment(r,s,a,l-h,h);(c=new _PieSegment(new Point(r,s),a,l-h,h,this.startAngle)).tag=i;this._areas.push(c)}else{if(o>0){0!=h&&t.drawDonutSegment(r,s,a,o,l,h);(c=new _DonutSegment(new Point(r,s),a,o,l,h,this.startAngle)).tag=i;this._areas.push(c)}else{0!=h&&t.drawPieSegment(r,s,a,l,h);(c=new _PieSegment(new Point(r,s),a,l,h,this.startAngle)).tag=i;this._areas.push(c)}l+=h}c&&(c.gi=e)};FlexPie.prototype._measureLegendItem=function(t,e){var i=new Size;i.width=Series._LEGEND_ITEM_WIDTH;i.height=Series._LEGEND_ITEM_HEIGHT;if(e){var n=t.measureString(e,FlexChartBase._CSS_LABEL,FlexChartBase._CSS_LEGEND);i.width+=n.width;i.height<n.height&&(i.height=n.height)}i.width+=3*Series._LEGEND_ITEM_MARGIN;i.height+=2*Series._LEGEND_ITEM_MARGIN;return i};FlexPie.prototype._drawLegendItem=function(t,e,i,n){t.strokeWidth=1;var r=Series._LEGEND_ITEM_MARGIN,s=null,a=null;null===s&&(s=this._getColorLight(i));null===a&&(a=this._getColor(i));t.fill=s;t.stroke=a;var o=e.top+.5*e.height,l=Series._LEGEND_ITEM_WIDTH,h=Series._LEGEND_ITEM_HEIGHT;t.drawRect(e.left+r,o-.5*h,l,h,null);null!=n&&FlexChartBase._renderText(t,n.toString(),new Point(e.left+h+2*r,o),0,1,FlexChartBase._CSS_LABEL)};FlexPie.prototype._getLabelContent=function(t,e){return isString(e)?this._keywords.replace(e,t):isFunction(e)?e(t):null};FlexPie.prototype._select=function(t,e){void 0===e&&(e=!1);this._highlight(!1,this._selectionIndex);this._selectionIndex=t;if(this.selectionMode==SelectionMode.Point){var i=this._cv;if(i){this._notifyCurrentChanged=!1;i.moveCurrentToPosition(t);this._notifyCurrentChanged=!0}}if(null==t){this._selectedIndex=-1;this.invalidate()}else if(this.isAnimated&&this.selectedItemPosition!=Position.None||!(this.selectedItemOffset>0||this.selectedItemPosition!=Position.None))this._highlight(!0,this._selectionIndex,e);else{this._selectedIndex=t;this.invalidate()}this.onSelectionChanged()};FlexPie.prototype._highlightCurrent=function(){if(this.selectionMode!=SelectionMode.None){var t=-1,e=this._cv;e&&(t=e.currentPosition);this._highlight(!0,t)}};FlexPie.prototype._highlight=function(t,e,i){void 0===i&&(i=!1);if(this.selectionMode==SelectionMode.Point&&null!=e&&e>=0)if(t){for(var n=[],r=0;r<this._pieGroups.length;r++){if(_=this._pels[e+r*this._values[0].length]){_.parentNode.appendChild(_);var s=this._find(_,["ellipse"]);this._highlightItems(this._find(_,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}var a=this._angles[e+r*this._values[0].length];if(this.selectedItemPosition!=Position.None&&0!=a){var o=0;this.selectedItemPosition==Position.Left?o=180:this.selectedItemPosition==Position.Top?o=-90:this.selectedItemPosition==Position.Bottom&&(o=90);var l=o*Math.PI/180-a;l*=180/Math.PI;if(i&&this.isAnimated)n.push(l);else{this._rotationAngles[r]=l;this._pieGroups[r].transform.baseVal.getItem(0).setRotate(l,this._centers[r].x,this._centers[r].y)}}var h=this.selectedItemOffset;if(h>0&&s&&0==s.length){this._selectedOffset.x=Math.cos(a)*h*this._radius;var c=this._selectedOffset.x;this._selectedOffset.y=Math.sin(a)*h*this._radius;var u=this._selectedOffset.y;_&&_.setAttribute("transform","translate("+c.toFixed()+","+u.toFixed()+")")}this._selectedIndex=e}n.length>0&&this._animateSelectionAngle(n,.5)}else{for(r=0;r<this._pieGroups.length;r++){var _;if(_=this._pels[e+r*this._values[0].length]){_.parentNode.insertBefore(_,_.parentNode.childNodes.item(e));_.removeAttribute("transform");this._highlightItems(this._find(_,["path","ellipse"]),FlexChartBase._CSS_SELECTION,t)}}this._selectedIndex==e&&(this._selectedIndex=-1)}};FlexPie.prototype._animateSelectionAngle=function(t,e){var i=this,n=this._pieGroups;this._selectionAnimationID&&clearInterval(this._selectionAnimationID);this._selectionAnimationID=animate((function(e){if(n==i._pieGroups){for(var r=0;r<n.length;r++){var s=_Math.clampAngle(i._rotationAngles[r]),a=_Math.clampAngle(t[r])-s,o=s;i._rotationAngles[r]=s=o+a*e;n[r].transform.baseVal.getItem(0).setRotate(s,i._centers[r].x,i._centers[r].y)}1==e&&clearInterval(i._selectionAnimationID);e>.99&&(i.selectedItemOffset>0||i.selectedItemPosition!=Position.None)&&i.invalidate()}}),1e3*e)};FlexPie.prototype._getHitTestItem=function(t){var e=null,i=null;(e=null!=this._cv?this._cv.items:this.itemsSource)&&t<e.length&&(i=e[t]);return i};FlexPie.prototype._getHitTestValue=function(t,e){null==e&&(e=0);return this._values[e][t]};FlexPie.prototype._getHitTestLabel=function(t){return this._labels[t]};FlexPie._MARGIN=4;FlexPie._CSS_GROUP_TITLE=FlexChartClsNames.label;return FlexPie}(FlexChartBase);export{FlexPie};var _Math=function(){function _Math(){}_Math.clampAngle=function(t,e){void 0===e&&(e=0);var i=(t+180)%360-180;i<-180+(e<0?e+360:e)&&(i+=360);return i};return _Math}(),_PieSegment=function(){function _PieSegment(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=_Math.clampAngle(180*i/Math.PI+this._sweep);this._radius2=e*e;this._startAngle=r}_PieSegment.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=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(n,this._startAngle);if(this._isFull||Math.abs(r)<=this._sweep)return!0}return!1};_PieSegment.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=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(r,this._startAngle);if(this._isFull||Math.abs(s)<=this._sweep)return Math.sqrt(n)-this._radius;var a=this.center.clone();a.x+=this.radius*Math.cos(this._originAngle);a.y+=this.radius*Math.sin(this._originAngle);var o=this.center.clone();o.x+=this.radius*Math.cos(this._originAngle+this._originSweep);o.y+=this.radius*Math.sin(this._originAngle+this._originSweep);var l=FlexChartCore._dist(t,this.center,a),h=FlexChartCore._dist(t,this.center,o);return Math.min(l,h)};Object.defineProperty(_PieSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0});Object.defineProperty(_PieSegment.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0});return _PieSegment}();export{_PieSegment};var _DonutSegment=function(){function _DonutSegment(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=_Math.clampAngle(180*n/Math.PI+this._sweep);this._radius2=e*e;this._iradius2=i*i;this._startAngle=s}_DonutSegment.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=_Math.clampAngle(this._angle,this._startAngle)-_Math.clampAngle(r,this._startAngle);if(this._isFull||Math.abs(s)<=this._sweep)return!0}return!1};_DonutSegment.prototype.distance=function(t){if(this.contains(t))return 0;var e=this.center.clone();e.x+=this.radius*Math.cos(this._originAngle);e.y+=this.radius*Math.sin(this._originAngle);var i=this.center.clone();i.x+=this._iradius*Math.cos(this._originAngle);i.y+=this._iradius*Math.sin(this._originAngle);var n=this.center.clone();n.x+=this.radius*Math.cos(this._originAngle+this._originSweep);n.y+=this.radius*Math.sin(this._originAngle+this._originSweep);var r=this.center.clone();r.x+=this._iradius*Math.cos(this._originAngle+this._originSweep);r.y+=this._iradius*Math.sin(this._originAngle+this._originSweep);var s=FlexChartCore._dist(t,e,i),a=FlexChartCore._dist(t,n,r);return Math.min(s,a)};Object.defineProperty(_DonutSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"radius",{get:function(){return this._radius},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"langle",{get:function(){return this._angle},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"angle",{get:function(){return this._originAngle},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"sweep",{get:function(){return this._originSweep},enumerable:!0,configurable:!0});Object.defineProperty(_DonutSegment.prototype,"innerRadius",{get:function(){return this._iradius},enumerable:!0,configurable:!0});return _DonutSegment}();export{_DonutSegment};export var AxisType;!function(t){t[t.X=0]="X";t[t.Y=1]="Y"}(AxisType||(AxisType={}));export var OverlappingLabels;!function(t){t[t.Auto=0]="Auto";t[t.Show=1]="Show"}(OverlappingLabels||(OverlappingLabels={}));export var TickMark;!function(t){t[t.None=0]="None";t[t.Outside=1]="Outside";t[t.Inside=2]="Inside";t[t.Cross=3]="Cross"}(TickMark||(TickMark={}));export var AxisGroupsDisplay;!function(t){t[t.None=0]="None";t[t.Show=1]="Show";t[t.ShowGrid=2]="ShowGrid"}(AxisGroupsDisplay||(AxisGroupsDisplay={}));var Axis=function(){function Axis(t){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._isMinimumAuto=!0;this._isMaximumAuto=!0;this._labels=!0;this._isTimeAxis=!1;this._labelPadding=5;this._actualLabels=[];this._labelMin=!1;this._labelMax=!1;this.rangeChanged=new Event;this._customConvert=null;this._customConvertBack=null;this.__uniqueId=Axis._id++;t==Position.BottomLeft||t==Position.BottomRight||t==Position.TopLeft||t==Position.TopRight||t==Position.LeftTop||t==Position.LeftBottom||t==Position.RightTop||t==Position.RightBottom?this._position=void 0:this._position=t;this._position==Position.Bottom||this._position==Position.Top?this._axisType=AxisType.X:this._position!=Position.Left&&this._position!=Position.Right||(this._axisType=AxisType.Y);this._minorTickMarks=TickMark.None;this._overlap=OverlappingLabels.Auto}Object.defineProperty(Axis.prototype,"hostElement",{get:function(){return this._hostElement},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"actualMin",{get:function(){return this._isTimeAxis?new Date(this._actualMin):this._actualMin},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"actualMax",{get:function(){return this._isTimeAxis?new Date(this._actualMax):this._actualMax},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"min",{get:function(){return this._min},set:function(t){if(t!=this._min){this._isMinimumAuto=!1;isDate(t)?this._min=asDate(t,!0):this._min=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"max",{get:function(){return this._max},set:function(t){if(t!=this._max){this._isMaximumAuto=!1;isDate(t)?this._max=asDate(t,!0):this._max=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"reversed",{get:function(){return this._reversed},set:function(t){if(this._reversed!=t){this._reversed=asBoolean(t);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"position",{get:function(){return this._position},set:function(t){if((t=asEnum(t,Position,!1))!=this._position){t==Position.BottomLeft||t==Position.BottomRight||t==Position.TopLeft||t==Position.TopRight||t==Position.LeftTop||t==Position.LeftBottom||t==Position.RightTop||t==Position.RightBottom?this._position=this._axisType==AxisType.X?Position.Bottom:this._axisType==AxisType.Y?Position.Left:void 0:this._position=t;this._position==Position.Bottom||this._position==Position.Top?null==this._axisType?this._axisType=AxisType.X:this._axisType==AxisType.Y&&(this._position=Position.Left):this._position!=Position.Left&&this._position!=Position.Right||(null==this._axisType?this._axisType=AxisType.Y:this._axisType==AxisType.X&&(this._position=Position.Bottom));this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorUnit",{get:function(){return this._majorUnit},set:function(t){if(t!=this._majorUnit){this._majorUnit=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorUnit",{get:function(){return this._minorUnit},set:function(t){if(t!=this._minorUnit){this._minorUnit=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"name",{get:function(){return this._name},set:function(t){t!=this._name&&(this._name=asString(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"title",{get:function(){return this._title},set:function(t){if(t!=this._title){this._title=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"format",{get:function(){return this._format},set:function(t){if(t!=this._format){this._format=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorGrid",{get:function(){return this._majorGrid},set:function(t){if(t!=this._majorGrid){this._majorGrid=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"majorTickMarks",{get:function(){return this._majorTickMarks},set:function(t){if((t=asEnum(t,TickMark,!0))!=this._majorTickMarks){this._majorTickMarks=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorGrid",{get:function(){return this._minorGrid},set:function(t){if(t!=this._minorGrid){this._minorGrid=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"minorTickMarks",{get:function(){return this._minorTickMarks},set:function(t){if((t=asEnum(t,TickMark,!0))!=this._minorTickMarks){this._minorTickMarks=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"axisLine",{get:function(){return void 0===this._axisLine?this.axisType==AxisType.X:this._axisLine},set:function(t){if(t!=this._axisLine){this._axisLine=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labels",{get:function(){return this._labels},set:function(t){if(t!=this._labels){this._labels=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelAlign",{get:function(){return this._labelAlign},set:function(t){if(t!=this._labelAlign){this._labelAlign=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelAngle",{get:function(){return this._labelAngle},set:function(t){if(t!=this._labelAngle){this._labelAngle=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelMin",{get:function(){return this._labelMin},set:function(t){if(t!=this._labelMin){this._labelMin=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelMax",{get:function(){return this._labelMax},set:function(t){if(t!=this._labelMax){this._labelMax=asBoolean(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"origin",{get:function(){return this._origin},set:function(t){if(t!=this._origin){this._origin=asNumber(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"overlappingLabels",{get:function(){return this._overlap},set:function(t){if((t=asEnum(t,OverlappingLabels,!0))!=this._overlap){this._overlap=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"itemsSource",{get:function(){return this._items},set:function(t){if(this._items!=t){if(this._cv){this._cv.collectionChanged.removeHandler(this._cvCollectionChanged,this);this._cv=null}this._items=t;this._cv=asCollectionView(t);null!=this._cv&&this._cv.collectionChanged.addHandler(this._cvCollectionChanged,this)}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"binding",{get:function(){return this._binding},set:function(t){if(t!=this._binding){this._binding=asString(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"itemFormatter",{get:function(){return this._ifmt},set:function(t){if(this._ifmt!=t){this._ifmt=asFunction(t,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"logBase",{get:function(){return this._logBase},set:function(t){if(t!=this._logBase){this._logBase=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"groupsOptions",{get:function(){return this._groupsOptions},set:function(t){if(t!=this._groupsOptions){this._groupsOptions=t;this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"axisLabels",{get:function(){return this._actualLabels},enumerable:!0,configurable:!0});Axis.prototype._getLogBase=function(){return this._chart&&this._chart._stacking===Stacking.Stacked100pc?0:this.logBase};Axis.prototype._isLogAxis=function(){var t=this._getLogBase();return null!=t&&t>0};Object.defineProperty(Axis.prototype,"plotArea",{get:function(){return this._parea},set:function(t){if(t!=this._parea){this._parea=asType(t,PlotArea,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"labelPadding",{get:function(){return this._labelPadding},set:function(t){if(t!=this._labelPadding){this._labelPadding=asNumber(t,!0,!0);this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(Axis.prototype,"_groupClass",{get:function(){return this.axisType===AxisType.X?FlexChartCore._CSS_AXIS_X:FlexChartCore._CSS_AXIS_Y},enumerable:!0,configurable:!0});Axis.prototype.onRangeChanged=function(t){this.rangeChanged.raise(this,t)};Axis.prototype._getPosition=function(){if(this.axisType==AxisType.X){if(this.position==Position.Auto)return Position.Bottom}else if(this.axisType==AxisType.Y&&this.position==Position.Auto)return Position.Left;return this.position};Axis.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,l=0,h=0;h<s;h++){var c=a?a[h]:h;if(c>=this._actualMin&&c<=this._actualMax){var u=e*(c-this._actualMin)/(this._actualMax-this._actualMin),_=t.measureString(r[h],i,this._groupClass);if(this.axisType==AxisType.X){if(h>0&&Math.abs(u-o)<.5*(_.width+l))return!0;o=u;l=_.width}else this.axisType,AxisType.Y}}return!1};Axis.prototype._getHeight=function(t,e){this._actualAngle=null;var i=FlexChartCore._CSS_LABEL,n=FlexChartCore._CSS_TITLE,r=.1*this._getActualRange(),s=this._lbls,a=this.labelAngle;if(this.labels&&this._chart._getChartType()!==ChartType.Funnel){r=this._updateAutoFormat(r);if(null!=s&&s.length>0){var o=s.length,l=this._values&&this._values.length==o?this._values:null;this._annoSize=new Size;for(var h=0;h<o;h++){if((_=l?l[h]:h)>=this._actualMin&&_<=this._actualMax){var c=s[h],u=i;if(this.itemFormatter){c=(d=this._getFormattedItem(t,_,c,new Point,i,!0)).text;u=d.cls}(p=t.measureString(c,u,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=p.width);p.height>this._annoSize.height&&(this._annoSize.height=p.height)}}null==a&&this.axisType==AxisType.X&&(this._isOverlapped(t,Math.max(10,e-this._annoSize.width),i,this.axisType)?a=this._actualAngle=-45:this._actualAngle=0)}else if(isNumber(this.majorUnit)&&this._axisType===AxisType.Y&&this.itemFormatter){l=[];this._annoSize=new Size;this._getAutoLbsAndVals([],l);for(h=0;h<l.length;h++){var _=l[h];c=this._formatValue(_),u=i;c=(d=this._getFormattedItem(t,_,c,new Point,i,!0)).text;u=i;(p=t.measureString(c,u,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=p.width);p.height>this._annoSize.height&&(this._annoSize.height=p.height)}}else{_=this._actualMin-r,c=this._formatValue(_),u=i;if(this.itemFormatter){c=(d=this._getFormattedItem(t,_,c,new Point,i,!0)).text;u=i}var p=t.measureString(c,u,this._groupClass);this._annoSize=p;_=this._actualMax+r;c=this._formatValue(_);u=i;if(this.itemFormatter){var d;c=(d=this._getFormattedItem(t,_,c,new Point,i,!0)).text;u=i}(p=t.measureString(c,u,this._groupClass)).width>this._annoSize.width&&(this._annoSize.width=p.width);p.height>this._annoSize.height&&(this._annoSize.height=p.height)}this._annoSizeBase=new Size(this._annoSize.width,this._annoSize.height);if(a){a>90?a=90:a<-90&&(a=-90);var f=a*Math.PI/180,g=this._annoSize.width,y=this._annoSize.height;this._annoSize.width=g*Math.abs(Math.cos(f))+y*Math.abs(Math.sin(f));this._annoSize.height=g*Math.abs(Math.sin(f))+y*Math.abs(Math.cos(f));this._actualAngle=a}}else{this._annoSize=new Size(8,8);this._annoSizeBase=new Size(this._annoSize.width,this._annoSize.height)}var m=0;if(this.labels){m=2*(this._labelPadding||5);this._axisType==AxisType.X?m+=this._annoSize.height:m+=this._annoSize.width+this._TICK_LABEL_DISTANCE+2}var b=this._TICK_HEIGHT,x=this._TICK_OVERLAP,v=this.majorTickMarks;v==TickMark.Outside?x=1:v==TickMark.Inside?x=-1:v==TickMark.Cross&&(x=0);null==v&&(v=TickMark.Outside);v!=TickMark.None&&(m+=.5*(1+x)*b);if(this._title){c=this._title;this._szTitle=t.measureString(c,n,this._groupClass);m+=this._szTitle.height}else this._szTitle=void 0;if(this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None){this._groupsPanel||(this._groupsPanel=new _AxisGroups(this));this._groupsPanel.createGroups();m+=this._groupsPanel.getHeight(t)}t.fontSize=null;return m};Axis.prototype._updateAutoFormat=function(t){if(this._isTimeAxis){var e=this.format,i=.001*this._getActualRange()/10,n=new _timeSpan(i*_timeSpan.TicksPerSecond),r=isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(n,e);e||(this._tfmt=_timeHelper.GetTimeDefaultFormat(1e3*r.TotalSeconds,0));t=r.TotalSeconds}return t};Axis.prototype._getActualRange=function(){return this._actualMax-this._actualMin};Axis.prototype._updateActualLimitsByChartType=function(t,e,i){if(t&&t.length>0&&!this._isTimeAxis){var n=this._chart._getChartType();if(n!=ChartType.Column&&n!=ChartType.Bar){e-=.5;i+=.5}}return{min:e,max:i}};Axis.prototype._updateActualLimits=function(t,e,i,n,r){void 0===n&&(n=null);void 0===r&&(r=null);var s=this._actualMin,a=this._actualMax;this._isTimeAxis=t==DataType.Date;var o=this._updateActualLimitsByChartType(n,e,i);e=o.min;i=o.max;var l=this._min,h=this._max;isDate(l)&&(l=l.valueOf());isDate(h)&&(h=h.valueOf());var c=this._getSeries(),u=this._chart&&(null!=c&&void 0!==c._getChartType()||this._chart._stacking!==Stacking.Stacked100pc);u||(u=this._chart._isRotated()?this.axisType==AxisType.Y:this.axisType==AxisType.X);this._actualMin=null!=l&&u?l:e;var _=this._actualMin;this._actualMax=null!=h&&u?h:i;if(_==this._actualMax)if(void 0!==l&&void 0===h)this._actualMax+=1;else if(void 0===l&&void 0!==h)this._actualMin-=1;else if(0===_)this._actualMax=1;else{var p=Math.abs(_);if(p<1){this._actualMin-=p;this._actualMax+=p}else{this._actualMin-=1;this._actualMax+=1}}if(this._getLogBase()>0){var d=this.logBase,f=Math.log(d);if(!this._max){var g=Math.ceil(Math.log(this._actualMax)/f);this._actualMax=Math.pow(d,g)}if(!this._min){var y=Math.floor(Math.log(this._actualMin)/f);this._actualMin=Math.pow(d,y)}(this._actualMin<=0||!isNumber(this._actualMin))&&(this._actualMin=1);this._actualMax<this._actualMin?this._actualMax=this._actualMin+1:this._actualMax===this._actualMin&&(this._actualMin=.1*this._actualMax)}(s!=this._actualMin&&(isNumber(s)||isNumber(this._actualMin))||a!=this._actualMax&&(isNumber(a)||isNumber(this._actualMax)))&&this.onRangeChanged();if(this._items){this._values=[];this._lbls=[];var m=this._items.length,b="value",x="text";if(this.binding){var v=this.binding.split(",");if(2==v.length){b=v[0];x=v[1]}}for(var C=0;C<m;C++){var S=this._items[C],A=S[b];if(isNumber(A)){this._values.push(A);this._lbls.push(S[x])}else if(isDate(A)){this._values.push(A.getTime());this._lbls.push(S[x])}}}else{this._lbls=n;this._values=r}};Axis.prototype._layout=function(t,e){var i=this.axisType==AxisType.Y;this._plotrect=e;this._axrect=i?new Rect(t.left,t.top,t.height,t.width):t;this._groupsPanel&&this._groupsPanel.layout()};Axis.prototype._hasVisibileSeries=function(){for(var t,e=this._chart.series,i=0,n=e.length;i<n;i++)if((t=e[i].visibility)==SeriesVisibility.Plot||t==SeriesVisibility.Visible)return!0;return!1};Axis.prototype._getSeries=function(){if(this._chart)for(var t=this._chart.series,e=0,i=t.length;e<i;e++)if(t[e].axisY==this||t[e].axisX==this)return t[e];return null};Axis.prototype._render=function(t){if(this.position!=Position.None&&this._hasVisibileSeries()){this.axisLabels.length=0;this._vals={};var e=0;this.labelAngle&&((e=this.labelAngle)>90?e=90:e<-90&&(e=-90));null==this.labelAngle&&null!=this._actualAngle&&(e=this._actualAngle);var i=FlexChartCore._FG,n=[],r=!1,s=this._getActualRange();if(isNumber(s)){var a=[];this._rects=[];this._vals.major=n;this._vals.hasLbls=[];if(this._lbls&&this._lbls.length>0){a=this._lbls;if(0==this._values.length){r=!0;for(var o=0;o<a.length;o++)n.push(o)}else n=this._values}else this._getAutoLbsAndVals(a,n);var l=Math.min(n.length,a.length);t.textFill=i;var h=this._TICK_HEIGHT,c=this._TICK_OVERLAP,u=this.majorTickMarks;null==u&&(u=TickMark.Outside);u==TickMark.Outside?c=1:u==TickMark.Inside?c=-1:u==TickMark.Cross&&(c=0);var _=.5*(c-1)*h,p=.5*(1+c)*h;if(this._isTimeAxis&&l>=2){if(n[1]-n[0]>864e5){null==this._min&&(this._actualMin=_timeHelper.FloorDay(this._actualMin));null==this._max&&(this._actualMax=_timeHelper.CeilDay(this._actualMax))}}for(o=0;o<l;o++){var d=!0,f=n[o],g=a[o],y=this.labels;y&&(r||this.itemsSource)&&this.majorUnit&&o%this.majorUnit!=0&&(y=!1);if(f>=this._actualMin&&f<=this._actualMax){var m=t.textFill;d=this._renderLabelsAndTicks(t,o,f,g,e,u,y,_,p);t.textFill=m}this._vals.hasLbls.push(d);d&&this.axisLabels.push(g)}}(this.minorGrid||this.minorTickMarks!=TickMark.None)&&this._renderMinor(t,n,r);t.stroke=i;t.fontSize=null;this._renderLineAndTitle(t);this._lbls&&this.groupsOptions&&this.groupsOptions.display!==AxisGroupsDisplay.None&&this._groupsPanel&&this._groupsPanel.render(t);t.stroke=null;t.fontSize=null;t.textFill=null;t.strokeWidth=null}};Axis.prototype._getAutoLbsAndVals=function(t,e){var i=this._actualMax-this._actualMin,n=this._calcMajorUnit();0==n&&(n=.1*this._niceTickNumber(i));var r=Math.floor(this._actualMin/n)*n;r<this._actualMin&&(r+=n);var s=Math.min(Axis.MAX_MAJOR,Math.floor(i/n)+1);if(this._isTimeAxis){this._createTimeLabels(r,s,e,t);this._addMinMaxLabels(e,t)}else if(this._getLogBase()){this._createLogarithmicLabels(this._actualMin,this._actualMax,this.majorUnit,e,t,!0);this._addMinMaxLabels(e,t)}else{this._createLabels(r,s,n,e,t);this._addMinMaxLabels(e,t)}};Axis.prototype._renderLineAndTitle=function(t){var e=this._getPosition(),i=this.axisType==AxisType.Y,n=e!=Position.Top&&e!=Position.Right,r=FlexChartCore._CSS_TITLE,s=FlexChartCore._CSS_LINE;if(i)if(n){if(this._title){var a=new Point(this._axrect.left+.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,a,1,1,a,-90,r,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.right,this._axrect.top,this._axrect.right,this._axrect.bottom,s)}else{if(this._title){a=new Point(this._axrect.right-.5*this._szTitle.height,this._axrect.top+.5*this._axrect.height);FlexChartCore._renderRotatedText(t,this._title,a,1,1,a,90,r,this._groupClass)}this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.left,this._axrect.bottom,s)}else if(n){this.axisLine&&t.drawLine(this._axrect.left,this._axrect.top,this._axrect.right,this._axrect.top,s);this._title&&FlexChartCore._renderText(t,this._title,new Point(this._axrect.left+.5*this._axrect.width,this._axrect.bottom),1,2,r)}else{this.axisLine&&t.drawLine(this._axrect.left,this._axrect.bottom,this._axrect.right,this._axrect.bottom,s);this._title&&FlexChartCore._renderText(t,this._title,new Point(this._axrect.left+.5*this._axrect.width,this._axrect.top),1,0,r)}};Axis.prototype._renderMinor=function(t,e,i){var n=this._getPosition(),r=this.axisType==AxisType.Y,s=n!=Position.Top&&n!=Position.Right;this._getLogBase()?this._createLogarithmicMinors(t,e,r,s,i):this._createMinors(t,e,r,s,i)};Axis.prototype._renderRotatedText=function(t,e,i,n,r,s,a,o,l,h,c){if(this.itemFormatter){var u=this._getFormattedItem(t,e,i,n,l);if(u){i=u.text;l=u.cls}else i=null}FlexChartCore._renderRotatedText(t,i,n,r,s,a,o,l,h,c)};Axis.prototype._getFormattedItem=function(t,e,i,n,r,s){void 0===s&&(s=!1);if(this.itemFormatter){var a=n.clone();this._plotrect&&(this.axisType==AxisType.X?this.position==Position.Top?a.y=this._plotrect.top:a.y=this._plotrect.bottom:this.position==Position.Right?a.x=this._plotrect.right:a.x=this._plotrect.left);var o={val:e,text:i,pos:a,cls:r};s&&(t.readOnly=!0);o=this.itemFormatter(t,o);s&&(t.readOnly=!1);return o}};Axis.prototype._renderLabelsAndTicks=function(t,e,i,n,r,s,a,o,l){var h=this._getPosition(),c=!1,u=this.axisType==AxisType.Y,_=h!=Position.Top&&h!=Position.Right,p=this.labelPadding||5,d=this._TICK_WIDTH,f=this._getLabelAlign(u),g=FlexChartCore._CSS_LABEL,y=FlexChartCore._CSS_GRIDLINE,m=FlexChartCore._CSS_TICK,b=FlexChartCore._FG,x=FlexChartCore._FG,v=this._GRIDLINE_WIDTH,C=i!=this._actualMin&&this.majorGrid;if(u){var S=this.convert(i);if(C){t.stroke=b;t.strokeWidth=v;t.drawLine(this._plotrect.left,S,this._plotrect.right,S,y)}t.stroke=x;t.strokeWidth=d;if(_){if(a){c=!0;var A=new Point(this._axrect.right-l-this._TICK_LABEL_DISTANCE-p,S);r>0?90==r?this._renderRotatedText(t,i,n,A,1,0,A,r,g,this._groupClass):this._renderRotatedText(t,i,n,A,2,1,A,r,g,this._groupClass):r<0?-90==r?this._renderRotatedText(t,i,n,A,1,2,A,r,g,this._groupClass):this._renderRotatedText(t,i,n,A,2,1,A,r,g,this._groupClass):c=this._renderLabel(t,i,n,A,2,f,g)}s!=TickMark.None&&c&&t.drawLine(this._axrect.right-o,S,this._axrect.right-l,S,m)}else{if(a){c=!0;A=new Point(this._axrect.left+l+this._TICK_LABEL_DISTANCE+p,S);r>0?90==r?this._renderRotatedText(t,i,n,A,1,2,A,r,g,this._groupClass):this._renderRotatedText(t,i,n,A,0,1,A,r,g,this._groupClass):r<0?-90==r?this._renderRotatedText(t,i,n,A,1,0,A,r,g,this._groupClass):this._renderRotatedText(t,i,n,A,0,1,A,r,g,this._groupClass):c=this._renderLabel(t,i,n,A,0,f,g)}s!=TickMark.None&&c&&t.drawLine(this._axrect.left+o,S,this._axrect.left+l,S,m)}}else{var w=this.convert(i);if(C&&a){t.stroke=b;t.strokeWidth=v;t.drawLine(w,this._plotrect.top,w,this._plotrect.bottom,y)}this.overlappingLabels==OverlappingLabels.Auto&&this._xCross(w)&&(a=!1);t.stroke=x;t.strokeWidth=d;if(_){if(a){A=new Point(w,this._axrect.top+l+p);c=0!=r?this._renderRotatedLabel(t,i,n,A,f,r,g,_):this._renderLabel(t,i,n,A,f,0,g)}if(s!=TickMark.None&&c){w=this.convert(i);t.drawLine(w,this._axrect.top+o,w,this._axrect.top+l,m)}}else{if(a){A=new Point(w,this._axrect.bottom-l-p);c=0!=r?this._renderRotatedLabel(t,i,n,A,f,r,g,_):this._renderLabel(t,i,n,A,f,2,g)}if(s!=TickMark.None&&c){w=this.convert(i);t.drawLine(w,this._axrect.bottom-o,w,this._axrect.bottom-l,m)}}}return c};Axis.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};Axis.prototype._createMinors=function(t,e,i,n,r){if(e){var s=this.majorUnit?this._isTimeAxis?24*this.majorUnit*3600*1e3:this.majorUnit:e.length>1?e[1]-e[0]:e[0],a=isNumber(this.minorUnit)?this._isTimeAxis?24*this.minorUnit*3600*1e3:this.minorUnit:.5*s;if(a<=0)return;for(var o=[],l=e[0];l>this._actualMin&&o.length<Axis.MAX_MINOR;l-=a)-1==e.indexOf(l)&&o.push(l);for(l=e[0]+a;l<this._actualMax&&o.length<Axis.MAX_MINOR;l+=a)(-1==e.indexOf(l)||r&&this.majorUnit&&l%this.majorUnit!=0)&&o.push(l);this._renderMinors(t,o,i,n)}};Axis.prototype._createLogarithmicMinors=function(t,e,i,n,r){if(e&&(!this.minorUnit||this.minorUnit<this._getLogBase())){var s=this.logBase;this.majorUnit>s&&(s=this.majorUnit);if(0==e.length){var a=Math.log(s),o=Math.floor(Math.log(this._actualMin)/a),l=Math.ceil(Math.log(this.actualMax)/a);if(this.majorUnit>0){e.push(Math.pow(s,o));e.push(Math.pow(s,l))}else{e.push(Math.pow(s,l));e.push(Math.pow(s,o))}}this.minorUnit||(this.minorUnit=s-1<1?.2*(s-1):.2*s);var h=[];if(this.majorUnit>0){for(var c=e[0]-e[0]/s*this.minorUnit;c>=this._actualMin&&h.length<Axis.MAX_MINOR;c-=e[0]/s*this.minorUnit)h.push(c);for(var u=0;u<e.length-1;u++)for(c=e[u]+e[u]*this.minorUnit;c<e[u+1]&&h.length<Axis.MAX_MINOR;c+=e[u]*this.minorUnit)c>=this._actualMin&&c<=this._actualMax&&h.push(c);for(c=e[e.length-1]+e[e.length-1]*this.minorUnit;c<=this._actualMax&&h.length<Axis.MAX_MINOR;c+=e[e.length-1]*this.minorUnit)h.push(c)}else{for(c=e[e.length-1]-e[e.length-1]/s*this.minorUnit;c>=this._actualMin&&h.length<Axis.MAX_MINOR;c-=e[e.length-1]/s*this.minorUnit)h.push(c);for(u=0;u<e.length-1;u++)for(c=e[u]-e[u+1]*this.minorUnit;c>e[u+1]&&h.length<Axis.MAX_MINOR;c-=e[u+1]*this.minorUnit)c>=this._actualMin&&c<=this._actualMax&&h.push(c);for(c=e[0]+e[0]*this.minorUnit;c<=this._actualMax&&h.length<Axis.MAX_MINOR;c+=e[0]*this.minorUnit)h.push(c)}this._renderMinors(t,h,i,n)}};Axis.prototype._renderMinors=function(t,e,i,n){var r=this._TICK_HEIGHT,s=this._TICK_WIDTH,a=this._TICK_OVERLAP,o=FlexChartCore._FG,l=this.minorTickMarks,h=!0;this._vals.minor=e;l==TickMark.Outside?a=1:l==TickMark.Inside?a=-1:l==TickMark.Cross?a=0:h=!1;for(var c=.5*(a-1)*r,u=.5*(1+a)*r,_=e?e.length:0,p=this.minorGrid,d=this._plotrect,f=this._GRIDLINE_WIDTH,g=FlexChartCore._FG,y=FlexChartCore._CSS_GRIDLINE_MINOR,m=FlexChartCore._CSS_TICK_MINOR,b=0;b<_;b++)if(e[b]>=this.actualMin&&e[b]<=this.actualMax)if(i){var x=this.convert(e[b]);if(h){t.stroke=o;t.strokeWidth=s;n?t.drawLine(this._axrect.right-c,x,this._axrect.right-u,x,m):t.drawLine(this._axrect.left+c,x,this._axrect.left+u,x,m)}if(p){t.stroke=g;t.strokeWidth=f;t.drawLine(d.left,x,d.right,x,y)}}else{var v=this.convert(e[b]);if(h){t.stroke=o;t.strokeWidth=s;n?t.drawLine(v,this._axrect.top+c,v,this._axrect.top+u,m):t.drawLine(v,this._axrect.bottom-c,v,this._axrect.bottom-u,m)}if(p){t.stroke=g;t.strokeWidth=f;t.drawLine(v,d.top,v,d.bottom,y)}}};Axis.prototype._renderLabel=function(t,e,i,n,r,s,a){var o=!1;if(this.itemFormatter){var l=this._getFormattedItem(t,e,i,n,a);if(l){i=l.text;a=l.cls}else i=null}if(i){var h=this._rects,c=this.overlappingLabels==OverlappingLabels.Auto&&!isNumber(this._actualAngle),u=FlexChartCore._renderText(t,i,n,r,s,a,this._groupClass,null,(function(t){if(c)for(var e=h.length,i=0;i<e;i++)if(FlexChartCore._intersects(h[i],t))return!1;return!0}));if(u){u.left+=4;u.width+=8;h.push(u);o=!0}}return o};Axis.prototype._renderRotatedLabel=function(t,e,i,n,r,s,a,o){if(this.itemFormatter){var l=this._getFormattedItem(t,e,i,n,a);if(l){i=l.text;a=l.cls}else i=null}if(i){var h=t.measureString(i,a,this._groupClass),c=.5*h.height,u=.5*h.width*Math.abs(Math.sin(s*Math.PI/180)),_=.5*h.width,p=.5*(h.width*Math.abs(Math.cos(s*Math.PI/180))+h.height*Math.abs(Math.sin(s*Math.PI/180))),d=new Point(n.x,n.y),f=new Point(n.x,n.y);this.labelAlign||(r=90==s||-90==s?1:o?s>0?0:2:s>0?2:0);if(o){n.y+=c+u;d.y+=c+u-.5*h.height}else{n.y-=c+u-h.height;d.y-=c+u-.5*h.height}var g=0;if(2===r){d.x-=p;n.x-=_+p;g=d.x+p-h.height-2}else if(0===r){d.x+=p;n.x-=_-p;g=d.x-p}else{n.x-=_;g=d.x-h.height/2}var y=new Rect(g,f.y,h.height+2,h.width),m=this._rects;if(this.overlappingLabels==OverlappingLabels.Auto)for(var b=m.length,x=0;x<b;x++)if(FlexChartCore._intersects(m[x],y))return!1;FlexChartCore._renderRotatedText(t,i,n,0,2,d,s,a,this._groupClass);this._rects.push(y);return!0}return!1};Axis.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};Axis.prototype._addMinMaxLabels=function(t,e){if(this.labelMin){var i=this.actualMin;if(isNumberFinite(+i)&&!t.includes(i)){e.splice(0,0,this._formatValue(i));t.splice(0,0,i)}}if(this.labelMax){var n=this.actualMax;if(isNumberFinite(+n)&&!t.includes(n)){e.splice(0,0,this._formatValue(n));t.splice(0,0,n)}}};Axis.prototype.convert=function(t,e,i){var n=null==e?this._actualMax:e,r=null==i?this._actualMin:i;if(n==r||!this._axrect)return 0;var s=this._axrect.left,a=this._axrect.width,o=this._axrect.top,l=this._axrect.height;if(null!=this._customConvert){var h=this._customConvert(t,r,n);return this.axisType==AxisType.Y?o+h*l:s+h*a}if(this._getLogBase()){if(t<=0)return NaN;var c=Math.log(n/r);return this._reversed?this.axisType==AxisType.Y?o+Math.log(t/r)/c*l:s+a-Math.log(t/r)/c*a:this.axisType==AxisType.Y?o+l-Math.log(t/r)/c*l:s+Math.log(t/r)/c*a}return this._reversed?this.axisType==AxisType.Y?o+(t-r)/(n-r)*l:s+a-(t-r)/(n-r)*a:this.axisType==AxisType.Y?o+l-(t-r)/(n-r)*l:s+(t-r)/(n-r)*a};Axis.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._getActualRange(),a=this._getLogBase();if(null!=this._customConvertBack)return this.axisType==AxisType.Y?this._customConvertBack((t-n)/r,this._actualMin,this._actualMax):this._customConvertBack((t-e)/i,this._actualMin,this._actualMax);if(a){var o=0;o=this._reversed?this.axisType==AxisType.Y?(t-n)/r:1-(t-e)/i:this.axisType==AxisType.Y?1-(t-n)/r:(t-e)/i;return Math.pow(a,(Math.log(this._actualMin)+(Math.log(this._actualMax)-Math.log(this._actualMin))*o)/Math.log(a))}return this._reversed?this.axisType==AxisType.Y?this._actualMin+(t-n)*s/r:this._actualMin+(e+i-t)*s/i:this.axisType==AxisType.Y?this._actualMax-(t-n)*s/r:this._actualMin+(t-e)*s/i};Object.defineProperty(Axis.prototype,"axisType",{get:function(){var t=this._chart;if(t){if(t.axisX==this)return AxisType.X;if(t.axisY==this)return AxisType.Y}return this._axisType},enumerable:!0,configurable:!0});Axis.prototype._getMinNum=function(){return this._actualMin};Axis.prototype._getMaxNum=function(){return this._actualMax};Axis.prototype._getTitleSize=function(){return this._szTitle?this._szTitle:new Size};Axis.prototype._invalidate=function(){this._chart&&this._chart.invalidate()};Axis.prototype._cvCollectionChanged=function(t,e){this._invalidate()};Axis.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),l=this._formatAxisValue(o),h=r.indexOf(l);if(h>=0&&!isNumber(this.majorUnit)&&!this._format){var c=parseFloat(l);Math.abs(c-o)<Math.abs(c-n[h])&&(n[h]=o)}else{n.push(o);r.push(l)}}};Axis.prototype._createLogarithmicLabels=function(t,e,i,n,r,s){var a=this._getLogBase(),o=Math.log(a),l=Math.floor(Math.log(t)/o),h=Math.ceil(Math.log(e)/o),c=a,u=!0;if(i>0){u=!1;c=i}c<a&&(c=a);var _=(h-l+1)*a/c,p=1;if(s){var d=this._getPosition(),f=this._getAnnoNumber(d==Position.Left||d==Position.Right);_>f?p=Math.floor(_/f+1):u&&(_<=.2*f?c=.2*a:_<=.1*f&&(c=.1*a))}for(var g=l;g<=h;g+=p)if(u)for(var y=Math.pow(a,g),m=0;m*c<a-1;m++){if((b=y*(1+m*c))>=t&&b<=e)if(0==m){n.unshift(b);r&&r.unshift(this._formatValue(b))}else if(!this.minorGrid&&this.minorTickMarks==TickMark.None){n.push(b);r&&r.push(this._formatValue(b))}}else{var b;if((b=Math.pow(c,g))>=t&&b<=e){n.push(b);r&&r.push(this._formatValue(b))}}};Axis.prototype._createTimeLabels=function(t,e,i,n){var r=this._actualMin,s=this._actualMax,a=new Date(r),o=new Date(s),l=this._format,h=this._getAnnoNumber(this._axisType==AxisType.Y);h>10&&(h=10);var c=.001*(this._actualMax-this._actualMin)/h,u=new _timeSpan(c*_timeSpan.TicksPerSecond),_=isNumber(this._majorUnit)?_timeSpan.fromDays(this._majorUnit):_timeHelper.NiceTimeSpan(u,l);l||(this._tfmt=l=_timeHelper.GetTimeDefaultFormat(1e3*_.TotalSeconds,0));var p=_.Ticks,d=_timeHelper.RoundTime(r,_.TotalDays,!1);isNumberFinite(+d)&&(r=d);var f=_timeHelper.RoundTime(s,_.TotalDays,!0);isNumberFinite(+f)&&(s=f);var g=new Date(r);new Date(s);if(_.TotalDays>=365&&!isNumber(this._majorUnit)){(g=new Date(a.getFullYear(),0,1))<a&&g.setFullYear(g.getFullYear()+1);var y=_.TotalDays/365;y-=y%1;for(var m=g;m<=o&&y;m.setFullYear(m.getFullYear()+y)){var b=m.valueOf();i.push(b);n.push(this._formatValue(b))}}else if(_.TotalDays>=30&&!isNumber(this._majorUnit)){(g=new Date(a.getFullYear(),a.getMonth(),1))<a&&g.setMonth(g.getMonth()+1);var x=_.TotalDays/30;x-=x%1;for(m=g;m<=o;m.setMonth(m.getMonth()+x)){b=m.valueOf();i.push(b);n.push(this._formatValue(b))}}else{var v=1e3*p/_timeSpan.TicksPerSecond,C=(m=g,a.getTime()-m.getTime());C>v&&(m=new Date(m.getTime()+Math.floor(C/v)*v));for(;m<=o&&v;m=new Date(m.getTime()+v)){b=m.valueOf();i.push(b);n.push(this._formatValue(b))}}};Axis.prototype._formatValue=function(t){if(this._isTimeAxis)return this._format?Globalize.format(new Date(t),this._format):Globalize.format(new Date(t),this._tfmt);if(this._format)return Globalize.format(t,this._format);var e=t==Math.round(t)?"n0":"n";return Globalize.format(t,e)};Axis.prototype._hitTest=function(t){return this._groupsPanel?this._groupsPanel.hitTest(t):void 0};Axis.prototype._formatAxisValue=function(t,e){void 0===e&&(e=void 0);if(this._isTimeAxis)return this._format?Globalize.format(new Date(t),this._format):Globalize.format(new Date(t),this._tfmt);if(this._format)return Globalize.format(t,this._format);if(isNumber(t)){var i=this._findFormat(t,e);return Globalize.format(t,i)}return t};Axis.prototype._findFormat=function(t,e){void 0===e&&(e=void 0);var i=t==Math.round(t)?"n0":"n";void 0!==e&&(i+=e.toString());if("n"==i){var n=t.toFixed(14),r=n.search(".");if(r>=0){e=1;for(var s=n.length-1;s>=r;s--)if("0"!=n[s]){e=s-r-1;break}i+=e.toString()}}return i};Axis.prototype._calcMajorUnit=function(){var t=this._majorUnit;if(!isNumber(t)){var e=this._getActualRange(),i=this._nicePrecision(e),n=e/this._getAnnoNumber(this.axisType==AxisType.Y);(t=this._niceNumber(2*n,-i,!0))<n&&(t=this._niceNumber(n,1-i,!1));t<n&&(t=this._niceTickNumber(n))>n&&(t*=.5)}return t};Axis.prototype._getAnnoNumber=function(t){var e=t?this._annoSizeBase&&this._annoSizeBase.height:this._annoSize&&this._annoSize.width,i=t?this._axrect&&this._axrect.height:this._axrect&&this._axrect.width;if(e>0&&i>0){var n=Math.floor(i/(e+6));n<=0&&(n=1);return n}return 10};Axis.prototype._nicePrecision=function(t){if(!isNumber(t)||t<=0)return 0;var e,i=Math.log(t)/Math.LN10;e=i>=0?Math.floor(i):Math.ceil(i);var n=t/Math.pow(10,e);if(n<3){e=1-e;(n=t/Math.pow(10,e))<3&&(e+=1)}return e};Axis.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;n<=1?r=1:n<=2?r=2:n<=5&&(r=5);return r*Math.pow(10,i)};Axis.prototype._niceNumber=function(t,e,i){if(0==t)return t;t<0&&(t=-t);var n=t/Math.pow(10,e),r=10;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);return r*Math.pow(10,e)};Object.defineProperty(Axis.prototype,"_uniqueId",{get:function(){return this.__uniqueId},enumerable:!0,configurable:!0});Axis.MAX_MAJOR=1e3;Axis.MAX_MINOR=2e3;Axis._id=0;return Axis}();export{Axis};var _tmInc,AxisCollection=function(t){__extends(AxisCollection,t);function AxisCollection(){return null!==t&&t.apply(this,arguments)||this}AxisCollection.prototype.getAxis=function(t){var e=this.indexOf(t);return e>-1?this[e]:null};AxisCollection.prototype.indexOf=function(t){for(var e=0;e<this.length;e++)if(this[e].name==t)return e;return-1};return AxisCollection}(ObservableArray);export{AxisCollection};!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"}(_tmInc||(_tmInc={}));var _timeSpan=function(){function _timeSpan(t){this.ticks=t}Object.defineProperty(_timeSpan.prototype,"Ticks",{get:function(){return this.ticks},enumerable:!0,configurable:!0});Object.defineProperty(_timeSpan.prototype,"TotalSeconds",{get:function(){return this.ticks/1e7},enumerable:!0,configurable:!0});Object.defineProperty(_timeSpan.prototype,"TotalDays",{get:function(){return this.ticks/1e7/86400},enumerable:!0,configurable:!0});_timeSpan.fromSeconds=function(t){return new _timeSpan(1e7*t)};_timeSpan.fromDays=function(t){return new _timeSpan(1e7*t*24*60*60)};_timeSpan.TicksPerSecond=1e7;return _timeSpan}(),_timeHelper=function(){function _timeHelper(t){isDate(t)?this.init(t):isNumber(t)&&this.init(FlexChartCore._fromOADate(t))}_timeHelper.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()};_timeHelper.prototype.getTimeAsDateTime=function(){if(this.hour>=24){this.hour-=24;this.day+=1}if(this.month<0){-1-this.day;this.month=1}else if(this.month>11){this.month-12;this.month=11}if(this.day<1){-1-this.day;this.day=1}else if(this.day>28&&1==this.month){this.day-28;this.day=28}else if(this.day>30&&(3==this.month||5==this.month||8==this.month||10==this.month)){this.day-30;this.day=30}else if(this.day>31){this.day-31;this.day=31}if(this.second>59){this.second-59;this.second=59}if(this.minute>59){this.minute-59;this.minute=59}return new Date(this.year,this.month,this.day,this.hour,this.minute,this.second)};_timeHelper.prototype.getTimeAsDouble=function(){return this.getTimeAsDateTime().valueOf()};_timeHelper.tround=function(t,e,i){var n=t/e*e;n-=n%1;i&&n!=t&&(n+=e-=e%1);return n};_timeHelper.FloorDay=function(t){var e=new Date(t);return new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf()};_timeHelper.CeilDay=function(t){var e=new Date(t),i=new Date(e.getFullYear(),e.getMonth(),e.getDate()).valueOf();return i<t?new Date(e.getFullYear(),e.getMonth(),e.getDate()+1).valueOf():i};_timeHelper.RoundTime=function(t,e,i){var n=24*e*60*60;if(n>0){var r=new _timeHelper(t);if(n<_tmInc.minute){r.second=_timeHelper.tround(r.second,n,i);return r.getTimeAsDouble()}r.second=0;if(n<_tmInc.hour){n/=_tmInc.minute;r.minute=_timeHelper.tround(r.minute,n,i);return r.getTimeAsDouble()}r.minute=0;if(n<_tmInc.day){n/=_tmInc.hour;r.hour=_timeHelper.tround(r.hour,n,i);return r.getTimeAsDouble()}r.hour=0;if(n<_tmInc.month){n/=_tmInc.day;r.day=_timeHelper.tround(r.day,n,i);return r.getTimeAsDouble()}r.day=1;if(n<_tmInc.year){n/=_tmInc.month;1!=r.month&&(r.month=_timeHelper.tround(r.month,n,i));return r.getTimeAsDouble()}r.month=1;n/=_tmInc.year;r.year=_timeHelper.tround(r.year,n,i);return r.getTimeAsDouble()}var s=t,a=s-n,o=a/e*e;i&&o!=a&&(o+=e);return s=n+o};_timeHelper.TimeSpanFromTmInc=function(t){var e=_timeSpan.fromSeconds(1);if(t!=_tmInc.maxtime)if(t>_tmInc.tickf1)e=_timeSpan.fromSeconds(t);else{var i=t,n=1;i+=7;for(;i>0;){n*=10;i--}e=new _timeSpan(n)}return e};_timeHelper.manualTimeInc=function(t){var e=_tmInc.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);r++){if("f"!=t.substr(i+r,1))break;n--}e=n}else t.indexOf("s")>=0?e=_tmInc.second:t.indexOf("m")>=0?e=_tmInc.minute:t.indexOf("h")>=0||t.indexOf("H")?e=_tmInc.hour:t.indexOf("d")>=0?e=_tmInc.day:t.indexOf("M")>=0?e=_tmInc.month:t.indexOf("y")>=0&&(e=_tmInc.year);return e};_timeHelper.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};_timeHelper.NiceTimeSpan=function(t,e){var i=_tmInc.second;null!=e&&e.length>0&&(i=_timeHelper.manualTimeInc(e));var n=0,r=0;if(i<_tmInc.second&&t.TotalSeconds<10){n=t.Ticks;r=_timeHelper.TimeSpanFromTmInc(i).Ticks;for(;n>10*r;)r*=10;var s=r;n>s&&(s*=2);n>s&&(s=5*r);n>s&&(s=10*r);return new _timeSpan(s)}if(0==(n=Math.ceil(t.TotalSeconds)))return _timeHelper.TimeSpanFromTmInc(i);r=1;if(i<_tmInc.minute){if(n<_tmInc.minute&&0!=(r=_timeHelper.getNiceInc([1,2,5,10,15,30],n,i)))return _timeSpan.fromSeconds(r);i=_tmInc.minute}if(i<_tmInc.hour){if(n<_tmInc.hour&&0!=(r=_timeHelper.getNiceInc([1,2,5,10,15,30],n,i)))return _timeSpan.fromSeconds(r);i=_tmInc.hour}if(i<_tmInc.day){if(n<_tmInc.day&&0!=(r=_timeHelper.getNiceInc([1,3,6,12],n,i)))return _timeSpan.fromSeconds(r);i=_tmInc.day}if(i<_tmInc.month){if(n<_tmInc.month&&0!=(r=_timeHelper.getNiceInc([1,2,7,14],n,i)))return _timeSpan.fromSeconds(r);i=_tmInc.month}if(i<_tmInc.year){if(n<_tmInc.year&&0!=(r=_timeHelper.getNiceInc([1,2,3,4,6],n,i)))return _timeSpan.fromSeconds(r);i=_tmInc.year}n<(r=100*_tmInc.year)&&0==(r=_timeHelper.getNiceInc([1,2,5,10,20,50],n,i))&&(r=100*_tmInc.year);return _timeSpan.fromSeconds(r)};_timeHelper.NiceTimeUnit=function(t,e){var i=_timeSpan.fromDays(t);return(i=_timeHelper.NiceTimeSpan(i,e)).TotalDays};_timeHelper.GetTimeDefaultFormat=function(t,e){if(!isNumber(t)||!isNumber(e))return"";var i="s",n=_timeSpan.fromSeconds(.001*(t-e)),r=n.TotalSeconds;if(r>=_tmInc.year)i="yyyy";else if(r>=_tmInc.month)i="MMM yyyy";else if(r>=_tmInc.day)i="MMM d";else if(r>=_tmInc.hour)i="ddd H:mm";else if(r>=.5*_tmInc.hour)i="H:mm";else if(r>=1)i="H:mm:ss";else if(r>0){var s=n.Ticks;i="s.";for(;s<_timeSpan.TicksPerSecond;){s*=10;i+="f"}}return i};return _timeHelper}(),_AxisLabel=function(){function _AxisLabel(t,e,i){this._start=e-.5;this._end=e+i-.5;this._value=e+.5*(i-1);this._label=t}Object.defineProperty(_AxisLabel.prototype,"value",{get:function(){return this._value},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"label",{get:function(){return this._label},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0});Object.defineProperty(_AxisLabel.prototype,"rect",{get:function(){return this._rect},set:function(t){this._rect=t},enumerable:!0,configurable:!0});return _AxisLabel}();export{_AxisLabel};var _AxisGroup=function(){function _AxisGroup(t,e){this._labels=[];this._index=0;this._size=new Size;this._level=0;this._level=t;this._last=e}Object.defineProperty(_AxisGroup.prototype,"labels",{get:function(){return this._labels},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"index",{get:function(){return this._index},set:function(t){this._index=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"height",{get:function(){return this._size.height},set:function(t){this._size.height=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"width",{get:function(){return this._size.width},set:function(t){this._size.width=t},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroup.prototype,"level",{get:function(){return this._level},enumerable:!0,configurable:!0});_AxisGroup.prototype.getSize=function(t,e,i){var n=this;this._size=new Size;this.labels.forEach((function(r){var s=t.measureString(r.label,e,i);n._size.width=Math.max(n._size.width,s.width);n._size.height=Math.max(n._size.height,s.height)}));return this._size};_AxisGroup.prototype.render=function(t,e,i,n,r){var s=this,a=e._getPosition(),o=e.axisType===AxisType.X;this.labels.forEach((function(l){var h,c=l.label,u=!1,_=o?Math.abs(e.convert(l.end)-e.convert(l.start)):s.width,p=t.measureString(c,n,r);if(p.width>_){c=s._trimText(c,p.width,_);u=!0}switch(a){case Position.Bottom:h=FlexChartCore._renderText(t,c,new Point(e.convert(l.value),i),1,2,n,r);break;case Position.Top:h=FlexChartCore._renderText(t,c,new Point(e.convert(l.value),i),1,0,n,r);break;case Position.Left:h=FlexChartCore._renderText(t,c,new Point(i+s._size.width,e.convert(l.value)),2,1,n,r);break;case Position.Right:h=FlexChartCore._renderText(t,c,new Point(i-s._size.width,e.convert(l.value)),0,1,n,r)}l.rect=u?h:void 0}));a===Position.Bottom||a===Position.Top?this.renderLinesX(t,e,i):this.renderLinesY(t,e,i)};_AxisGroup.prototype.hitTest=function(t){for(var e,i=0;i<this.labels.length;i++){var n=this.labels[i];if(n.rect&&n.rect.contains(t)){e=n;break}}return e};_AxisGroup.prototype.renderLinesX=function(t,e,i){var n=this,r=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,s=e._getPosition(),a=4,o=s===Position.Bottom?1:-1,l=i-o*(this.height+a);a*=o;if(r){var h=e.convert(e.actualMin),c=e.convert(e.actualMax);this.drawLine(t,h,i+a,c,i+a);this.drawLine(t,h,l,c,l);var u=e.convert(this.labels[0].start),_=0===this.level?1===o?e._axrect.top:e._axrect.bottom:l;this.drawLine(t,u,i+a,u,_);this.labels.forEach((function(r){var s=new Point(e.convert(r.end),i);n._last?n.drawLine(t,s.x,s.y+a,s.x,1===o?e._axrect.top:e._axrect.bottom):n.drawLine(t,s.x,s.y+a,s.x,_)}))}else this.labels.forEach((function(i){var r=e.convert(i.start)+Math.abs(a),s=e.convert(i.end)-Math.abs(a);n.drawLine(t,r,l,s,l);if(e.labels||!n._last){n.drawLine(t,r,l,r,l-2*a);n.drawLine(t,s,l,s,l-2*a)}var o=e.convert(i.value);n.drawLine(t,o,l,o,l+a)}))};_AxisGroup.prototype.renderLinesY=function(t,e,i){var n=this,r=e.groupsOptions.display===AxisGroupsDisplay.ShowGrid,s=e._getPosition(),a=4,o=s===Position.Left?-1:1,l=i-o*(this.width+a);a*=o;if(r){var h=e.convert(e.actualMin),c=e.convert(e.actualMax);this.drawLine(t,i+a,h,i+a,c);this.drawLine(t,l,h,l,c);var u=e.convert(this.labels[0].start),_=0===this.level?1===o?e._axrect.left:e._axrect.right:l;this.drawLine(t,i+a,u,_,u);this.labels.forEach((function(r){var s=e.convert(r.end);n._last?n.drawLine(t,i+a,s,1===o?e._axrect.left:e._axrect.right,s):n.drawLine(t,i+a,s,_,s)}))}else this.labels.forEach((function(i){var r=e.convert(i.start)-Math.abs(a),s=e.convert(i.end)+Math.abs(a);n.drawLine(t,l,r,l,s);n.drawLine(t,l,r,l-2*a,r);n.drawLine(t,l,s,l-2*a,s);var o=e.convert(i.value);n.drawLine(t,l,o,l+a,o)}))};_AxisGroup.prototype.drawLine=function(t,e,i,n,r){t.drawLine(e,i,n,r,FlexChartCore._CSS_LINE)};_AxisGroup.prototype._trimText=function(t,e,i){var n="",r=t.length,s=Math.floor((1-(e-i)/e)*r);t.length>0&&(n=t[0]+(s>1?t.substring(1,s-1)+"..":""));return n};return _AxisGroup}(),_AxisGroups=function(){function _AxisGroups(t){this._groups=[];this._margin=8;this._axis=t}Object.defineProperty(_AxisGroups.prototype,"groups",{get:function(){return this._groups},enumerable:!0,configurable:!0});Object.defineProperty(_AxisGroups.prototype,"axis",{get:function(){return this._axis},enumerable:!0,configurable:!0});_AxisGroups.prototype.createGroups=function(){var t=this;this._groups=[];var e=this.axis._chart.collectionView;e&&e.groups&&e.groups.length>0&&e.groups.forEach((function(e){t.createGroup(e,0)}))};_AxisGroups.prototype.createGroup=function(t,e){var i=this;this.groups[e]||(this.groups[e]=new _AxisGroup(e,t.isBottomLevel));var n=this.groups[e],r=t.items;n.labels.push(new _AxisLabel(t.name,n.index,r.length));n.index+=r.length;t.groups.forEach((function(t){i.createGroup(t,e+1)}))};_AxisGroups.prototype.layoutGroups=function(t){this.groups.forEach((function(e){e.width*=t}))};_AxisGroups.prototype.getHeight=function(t){var e=this,i=this._axis._getPosition(),n=0;i===Position.Bottom||i===Position.Top?this.groups.forEach((function(i){var r=i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass);n+=e._margin+r.height})):this.groups.forEach((function(i){var r=i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass);n+=e._margin+r.width}));if(n>0&&this._axis.labels){var r=this.groups.length;n+=this._margin*r}this._height=n;return n};_AxisGroups.prototype.layout=function(){var t=this._axis,e=t._axrect;if(t.axisType===AxisType.Y){var i=(t.labels?t._annoSize.width+t._TICK_LABEL_DISTANCE+12:4)+t._getTitleSize().height,n=e.width-i;if(n<this._height){var r=this._margin*this._groups.length;this.layoutGroups((n-r)/(this._height-r));this._height=n}}};_AxisGroups.prototype.render=function(t){var e=this,i=this._axis._getPosition(),n=this._axis._getTitleSize();if(i===Position.Bottom){var r=this.axis._axrect.bottom-n.height-this._margin;this.groups.forEach((function(i){i.render(t,e.axis,r,FlexChartCore._CSS_LABEL,e._axis._groupClass);r-=i.height+e._margin}))}else if(i===Position.Top){var s=this.axis._axrect.top+n.height+this._margin;this.groups.forEach((function(i){i.render(t,e.axis,s,FlexChartCore._CSS_LABEL,e._axis._groupClass);s+=i.height+e._margin}))}else if(i===Position.Left){var a=this.axis._axrect.left+n.height+this._margin;this.groups.forEach((function(i){i.render(t,e.axis,a,FlexChartCore._CSS_LABEL,e._axis._groupClass);a+=i.width+e._margin}))}else if(i===Position.Right){var o=this.axis._axrect.right-n.height-this._margin;this.groups.forEach((function(i){i.render(t,e.axis,o,FlexChartCore._CSS_LABEL,e._axis._groupClass);o-=i.width+e._margin}))}};_AxisGroups.prototype.hitTest=function(t){for(var e,i=0;i<this._groups.length;i++){var n=this._groups[i].hitTest(t);if(n){e=n;break}}return e};return _AxisGroups}();export{_AxisGroups};var _AreaPlotter=function(t){__extends(_AreaPlotter,t);function _AreaPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.stacking=Stacking.None;e.isSpline=!1;e.isStep=!1;e.stackPos={};e.stackNeg={};return e}_AreaPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;for(var i=t.getMinX(),n=t.getMinY(),r=t.getMaxX(),s=t.getMaxY(),a=0;a<this.chart.series.length;a++){var o=this.chart.series[a];if(this._isRange(o)){var l=o._getChartType();if(!l||l==ChartType.Area)for(var h=o._getBindingValues(1),c=0;c<h.length;c++)h[c]>s?s=h[c]:h[c]<n&&(n=h[c])}}if(this.isSpline){var u=.1*(s-n);this.chart.axisY._getLogBase()||(n-=u);s+=u}return this.rotated?new Rect(n,i,s-n,r-i):new Rect(i,n,r-i,s-n)};_AreaPlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNeg={};this.stackPos={}};_AreaPlotter.prototype.plotSeries=function(t,e,i,n,r,s,a,o){var l=n;if(this._isRange(l))this.plotSeriesRanged(t,e,i,n,r,s,a,o);else{var h=[],c=this.chart.series.indexOf(n),u=n.getValues(0),_=n.getValues(1);if(u){var p=u.length;if(p){_||(_=this.dataInfo.getXVals());var d=!0;if(_)_.length<p&&(p=_.length);else{d=!1;_=new Array(p)}var f=[],g=[],y=[],m=[],b=this.stacking!=Stacking.None&&!l._isCustomAxisY(),x=this.stacking==Stacking.Stacked100pc&&!l._isCustomAxisY();void 0!==l._getChartType()&&(b=x=!1);for(var v=this.rotated,C=!1,S=l.interpolateNulls,A=null,w=null,P=this.chart._plotRect,M=0;M<p;M++){var T=d?_[M]:M,L=u[M];(null===A||T>A)&&(A=T);(null===w||T<w)&&(w=T);b&&(null==L||Number.isNaN(L))&&Number.isFinite(T)&&(L=0);if(_DataInfo.isValid(T,L)){var F=v?i.convert(T):e.convert(T);if(b){if(x){var E=this.dataInfo.getStackedAbsSum(T);L=E>0?L/E:0}var N=0;if(L>=0){N=isNumberNaN(+this.stackPos[T])?0:this.stackPos[T];L=this.stackPos[T]=N+L}else{N=isNumberNaN(+this.stackNeg[T])?0:this.stackNeg[T];L=this.stackNeg[T]=N+L}if(v){N<e.actualMin&&(N=e.actualMin);y.push(e.convert(N));m.push(F)}else{y.push(F);N<i.actualMin&&(N=i.actualMin);m.push(i.convert(N))}}if(v){var I=e.convert(L);if(isNumberNaN(+F)||isNumberNaN(+I)){C=!0;if(!b&&!0!==S){f.push(void 0);g.push(void 0)}}else{f.push(I);g.push(F);if(FlexChartCore._contains(P,new Point(I,F))){(R=new _CircleArea(new Point(I,F),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(c,M,L,T);this.hitTester.add(R,c)}}}else{I=i.convert(L);if(isNumberNaN(+F)||isNumberNaN(+I)){C=!0;if(!b&&!0!==S){f.push(void 0);g.push(void 0)}}else{f.push(F);g.push(I);if(FlexChartCore._contains(P,new Point(F,I))){var R;(R=new _CircleArea(new Point(F,I),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(c,M,T,L);this.hitTester.add(R,c)}}}}else{C=!0;if(!b&&!0!==S){f.push(void 0);g.push(void 0)}}}o&&f.forEach((function(t,e){null!=t&&h.push(new Point(t,g[e]))}));var k=this._DEFAULT_WIDTH,B=r._getColorLight(c),D=r._getColor(c),O=_BasePlotter.cloneStyle(n.style,["fill"]),V=_BasePlotter.cloneStyle(n.style,["stroke"]);if(!b&&!0!==S&&C){var H=[],j=[];for(M=0;M<p;M++)if(void 0===f[M]){if(H.length>1){H=(z=this._modifyPoints(H,j)).x;j=z.y;t.stroke=D;t.strokeWidth=k;t.fill="none";t.drawLines(H,j,null,O);this.hitTester.add(new _LinesArea(H,j),c);if(v){H.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{H.push(H[H.length-1],H[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=B;t.stroke="none";t.drawPolygon(H,j,null,V,this.chart._plotrectId)}H=[];j=[]}else{H.push(f[M]);j.push(g[M])}if(H.length>1){H=(z=this._modifyPoints(H,j)).x;j=z.y;t.stroke=D;t.strokeWidth=k;t.fill="none";t.drawLines(H,j,null,O);this.hitTester.add(new _LinesArea(H,j),c);if(v){H.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{H.push(H[H.length-1],H[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=B;t.stroke="none";t.drawPolygon(H,j,null,V,this.chart._plotrectId)}}else{var z;f=(z=this._modifyPoints(f,g)).x;g=z.y;if(b){var G=this._modifyPoints(y,m);y=G.x;m=G.y;f=f.concat(y.reverse());g=g.concat(m.reverse())}else if(v){f.push(e.convert(e.actualMin),e.convert(e.actualMin));g.push(g[g.length-1],g[0])}else{f.push(f[f.length-1],f[0]);g.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=B;t.stroke="none";t.drawPolygon(f,g,null,V,this.chart._plotrectId);if(b){f=f.slice(0,f.length-y.length);g=g.slice(0,g.length-m.length)}else{f=f.slice(0,f.length-2);g=g.slice(0,g.length-2)}t.stroke=D;t.strokeWidth=k;t.fill="none";t.drawLines(f,g,null,O,this.chart._plotrectId);this.hitTester.add(new _LinesArea(f,g),c)}this._drawSymbols(t,n,c);o&&h&&h.length&&o(h)}}}};_AreaPlotter.prototype._isRange=function(t){var e=this.chart?this.chart._bindingSeparator:",",i=null==t.binding?null:t.binding.split(e);return null!=i&&2==i.length};_AreaPlotter.prototype._modifyPoints=function(t,e){var i={x:t,y:e};if(this.isSpline){var n=this._convertToSpline(t,e);i.x=n.xs;i.y=n.ys}else if(this.isStep){var r=this._createSteps(t,e);i.x=r.x;i.y=r.y}return i};_AreaPlotter.prototype.plotSeriesRanged=function(t,e,i,n,r,s,a,o){var l=[],h=this.chart.series.indexOf(n),c=n,u=n.getValues(0),_=n.getValues(1),p=c._getBindingValues(1);if(u){var d=u.length;if(d){_||(_=this.dataInfo.getXVals());var f=!0;if(_)_.length<d&&(d=_.length);else{f=!1;_=new Array(d)}for(var g=[],y=[],m=[],b=this.rotated,x=!1,v=c.interpolateNulls,C=this.chart._plotRect,S=0;S<d;S++){var A=f?_[S]:S,w=u[S],P=p[S];if(_DataInfo.isValid(A,w,P)){var M=b?i.convert(A):e.convert(A);if(b){var T=e.convert(w),L=e.convert(P);if(isNumberNaN(+M)||isNumberNaN(+T)){x=!0;if(!0!==v){g.push(void 0);y.push(void 0);m.push(void 0)}}else{g.push(T);y.push(M);m.push(L);if(FlexChartCore._contains(C,new Point(T,M))){(F=new _CircleArea(new Point(T,M),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(h,S,w,A);this.hitTester.add(F,h)}if(FlexChartCore._contains(C,new Point(L,M))){(F=new _CircleArea(new Point(L,M),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(h,S,P,A);this.hitTester.add(F,h)}}}else{T=i.convert(w),L=i.convert(P);if(isNumberNaN(+M)||isNumberNaN(+T)){x=!0;if(!0!==v){g.push(void 0);y.push(void 0);m.push(void 0)}}else{g.push(M);y.push(T);m.push(L);if(FlexChartCore._contains(C,new Point(M,T))){(F=new _CircleArea(new Point(M,T),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(h,S,A,w);this.hitTester.add(F,h)}if(FlexChartCore._contains(C,new Point(M,L))){var F;(F=new _CircleArea(new Point(M,L),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(h,S,A,P);this.hitTester.add(F,h)}}}}else{x=!0;if(!0!==v){g.push(void 0);y.push(void 0);m.push(void 0)}}}o&&g.forEach((function(t,e){null!=t&&l.push(new Point(t,y[e]))}));var E=this._DEFAULT_WIDTH,N=r._getColorLight(h),I=r._getColor(h),R=_BasePlotter.cloneStyle(n.style,["fill"]),k=_BasePlotter.cloneStyle(n.style,["stroke"]);if(!0!==v&&x){var B=[],D=[],O=[];for(S=0;S<d;S++)if(void 0===g[S]){if(B.length>1){var V=b?O.slice(0).reverse():B.slice(0).reverse(),H=b?D.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,B,D,V,H,N,I,E,k,R);this.hitTester.add(new _LinesArea(B,D),h);this.hitTester.add(new _LinesArea(V,H),h)}B=[];D=[];O=[]}else{B.push(g[S]);D.push(y[S]);O.push(m[S])}if(B.length>1){V=b?O.slice(0).reverse():B.slice(0).reverse(),H=b?D.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,B,D,V,H,N,I,E,k,R);this.hitTester.add(new _LinesArea(B,D),h);this.hitTester.add(new _LinesArea(V,H),h)}}else{var j=b?m.slice(0).reverse():g.slice(0).reverse(),z=b?y.slice(0).reverse():m.slice(0).reverse();this._drawRangedArea(t,g,y,j,z,N,I,E,k,R);this.hitTester.add(new _LinesArea(g,y),h);this.hitTester.add(new _LinesArea(j,z),h)}this._drawSymbols(t,n,h);o&&l&&l.length&&o(l)}}};_AreaPlotter.prototype._drawRangedArea=function(t,e,i,n,r,s,a,o,l,h){if(this.isSpline){var c=this._convertToSpline(e,i),u=this._convertToSpline(n,r);e=c.xs;i=c.ys;n=u.xs;r=u.ys}e=e.concat(n);i=i.concat(r);t.fill=s;t.stroke="none";t.drawPolygon(e,i,null,l);e=e.slice(0,e.length-n.length);i=i.slice(0,i.length-r.length);t.stroke=a;t.strokeWidth=o;t.fill="none";t.drawLines(e,i,null,h);t.drawLines(n,r,null,h)};_AreaPlotter.prototype._convertToSpline=function(t,e){if(t&&e){var i=new _Curve(t,e).calculate();return{xs:i.xs,ys:i.ys}}return{xs:t,ys:e}};_AreaPlotter.prototype._drawSymbols=function(t,e,i){var n=this.getItemFormatter(e);if(null!=n){for(var r=this.hitTester._map[i],s=0;s<r.length;s++){var a=tryCast(r[s],_CircleArea);if(a){var o=a.tag;t.startGroup();var l=new HitTestInfo(this.chart,a.center,ChartElement.SeriesSymbol);l._setDataPoint(o);n(t,l,(function(){}));t.endGroup()}}t.cssPriority=!0}};return _AreaPlotter}(_BasePlotter);export{_AreaPlotter};var _BarPlotter=function(t){__extends(_BarPlotter,t);function _BarPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.origin=0;e.width=.7;e.isVolume=!1;e._volHelper=null;e.stackPosMap={};e.stackNegMap={};e.stacking=Stacking.None;return e}_BarPlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNegMap[this.chart.axisY._uniqueId]={};this.stackPosMap[this.chart.axisY._uniqueId]={};this._volHelper=null};_BarPlotter.prototype.load=function(){t.prototype.load.call(this);if(this.isVolume){var e,i,n,r,s,a,o,l,h,c=null,u=null;for(a=0;a<this.chart.series.length;a=h){h=a+1;s=(e=this.chart.series[a]).getDataType(1)||e.chart._xDataType;i=e._getAxisX();if((n=null===(n=e._getChartType())||isUndefined(n)?this.chart._getChartType():n)===ChartType.Column){var _=this.chart?this.chart._bindingSeparator:",",p=e.binding.split(_).length-1;r=e._getBindingValues(p)}else r=n===ChartType.Candlestick?e._getBindingValues(4):null;if(s===DataType.Date){var d=void 0;o=[];l=[];for(var f=0;f<e._getLength();f++){d=e._getItem(f)[e.bindingX].valueOf();o.push(d);l.push({value:d,text:Globalize.format(new Date(d),i.format||"d")})}h=f+1}else o=this.dataInfo.getXVals();c=this.dataInfo.getMinX();u=this.dataInfo.getMaxX();if(r&&r.length>0){this._volHelper=new _VolumeHelper(r,o,c,u,s);i._customConvert=this._volHelper.convert.bind(this._volHelper);i._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);l&&l.length>0&&(this._itemsSource=i.itemsSource=l);break}}}};_BarPlotter.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)if(e=this.chart.series[i]._getAxisX()){e._customConvert=null;e._customConvertBack=null;e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null)}};_BarPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),n=t.getMaxX(),r=t.getMinY(),s=t.getMaxY(),a=t.getDeltaX();a<=0&&(a=1);var o=!1;!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(var l=0;l<this.chart.series.length;l++){var h=this.chart.series[l],c=h._getChartType();if((c=null===c||isUndefined(c)?this.chart._getChartType():c)===ChartType.Column||c===ChartType.Bar){if(this._isRange(h)){h._getBindingValues(1).forEach((function(t){t<r?r=t:t>s&&(s=t)}))}}o||"BoxWhisker"==h.constructor.name||(o=!0)}if(this.rotated){!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==DataType.Date&&o&&(this.origin>s?s=this.origin:this.origin<r&&(r=this.origin));return new Rect(r,i-.5*a,s-r,n-i+a)}!this.chart.axisY._getLogBase()&&t.getDataTypeY()!==DataType.Date&&o&&(this.origin>s?s=this.origin:this.origin<r&&(r=this.origin));return new Rect(i-.5*a,r,n-i+a,s-r)};_BarPlotter.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};_BarPlotter.prototype.plotSeries=function(t,e,i,n,r,s,a,o){var l,h,c,u,_=[],p=this.chart.series.indexOf(n),d=asType(n,SeriesBase),f=this.chart._options,g=this.width,y=0;s=s||0;a=a||1;if(f&&f.groupWidth){var m=f.groupWidth;if(isNumber(m)){var b=asNumber(m);if(isNumberFinite(+b)&&b>0){y=b;g=1}}else if(isString(m)){var x=asString(m);if(x&&x.indexOf("%")>=0){x=x.replace("%","");b=parseFloat(x);if(isNumberFinite(+b)){b<0?b=0:b>100&&(b=100);y=0;g=b/100}}else{b=parseFloat(x);if(isNumberFinite(+b)&&b>0){y=b;g=1}}}}var v=g/a,C=d._getAxisY()._uniqueId,S=this.stackNegMap[C],A=this.stackPosMap[C],w=n.getValues(0),P=n.getValues(1),M=this._isRange(d),T=d._bindValues(null==d._cv?null==this.chart.collectionView?null:this.chart.collectionView.items:d._cv.items,d._getBinding(1)).values;if(w){P||(P=this.dataInfo.getXVals());if(P){var L=this.dataInfo.getDeltaX();if(L>0){g*=L;v*=L}}var F=d._getSymbolFill(p),E=d._getAltSymbolFill(p)||F,N=d._getSymbolStroke(p),I=d._getAltSymbolStroke(p)||N,R=w.length;null!=P&&(R=Math.min(R,P.length));var k,B,D=this.origin,O=0,V=this.stacking!=Stacking.None,H=this.stacking==Stacking.Stacked100pc;void 0!==d._getChartType()&&(V=H=!1);var j=this.getItemFormatter(n),z=e._actualMin,G=e._actualMax,X=i._actualMin,Y=i._actualMax;if(this.rotated){D<z?D=z:D>G&&(D=G);d._isCustomAxisY()&&(V=H=!1);for($=e.convert(D),J=0;J<R;J++){et=P?P[J]:J,it=w[J],tt=$;this._getSymbolOrigin&&(tt=i.convert(this._getSymbolOrigin(D,J)));if(M&&T&&T.length){nt=T[J];_DataInfo.isValid(nt)&&(tt=e.convert(nt))}if(this._getSymbolStyles){F=(rt=this._getSymbolStyles(J))&&rt.fill?rt.fill:F;E=rt&&rt.fill?rt.fill:E;N=rt&&rt.stroke?rt.fill:N;I=rt&&rt.stroke?rt.fill:I}k=it>0?F:E;B=it>0?N:I;t.fill=k;t.stroke=B;if(_DataInfo.isValid(et,it))if(V){var U=et-.5*g,K=et+.5*g;if(U<X&&K<X||U>Y&&K>Y)continue;U=i.convert(Math.max(U,X));K=i.convert(Math.min(K,Y));if(H){it/=this.dataInfo.getStackedAbsSum(et)}ot=0;if(it>=0){ot=isNumberNaN(+A[et])?0:A[et];c=e.convert(ot);u=e.convert(ot+it);A[et]=ot+it}else{ot=isNumberNaN(+S[et])?0:S[et];c=e.convert(ot);u=e.convert(ot+it);S[et]=ot+it}o&&_.push(new Point(u,i.convert(et)));if(!_DataInfo.isValid(c,u))continue;lt=new Rect(Math.min(c,u),Math.min(U,K),Math.abs(u-c),Math.abs(K-U));if(y>0){(gt=1-y/lt.height)<0&&(gt=0);var W=lt.top+.5*lt.height;lt.top+=(W-lt.top)*gt;lt.height=Math.min(y,lt.height)}ct=new _RectArea(lt);this.drawSymbol(t,lt,n,J,new Point(u,lt.top+.5*lt.height),j);n._setPointIndex(J,O);O++;ut=H?Math.min(ot+it,1):ot+it;ct.tag=new _DataPoint(p,J,ut,et);this.hitTester.add(ct,p)}else{var q=et-.5*g+s*v,Z=et-.5*g+(s+1)*v;if(q<X&&Z<X||q>Y&&Z>Y)continue;q=i.convert(Math.max(q,X));Z=i.convert(Math.min(Z,Y));var Q=e.convert(it);if(!_DataInfo.isValid(Q,q,Z))continue;lt=new Rect(Math.min(Q,tt),Math.min(q,Z),Math.abs(tt-Q),Math.abs(Z-q));o&&_.push(new Point(Q,(q+Z)/2));if(y>0){(gt=1-(ft=y/a)/lt.height)<0&&(gt=0);W=i.convert(et);lt.top+=(W-lt.top)*gt;lt.height=Math.min(ft,lt.height)}ct=new _RectArea(lt);this.drawSymbol(t,lt,n,J,new Point(Q,lt.top+.5*lt.height),j);n._setPointIndex(J,O);O++;ct.tag=new _DataPoint(p,J,it,et);this.hitTester.add(ct,p)}else o&&_.push(null)}}else{D<X?D=X:D>Y&&(D=Y);var $=i.convert(D);d._isCustomAxisY()&&(V=H=!1);for(var J=0;J<R;J++){var tt=$,et=P?P[J]:J,it=w[J];this._getSymbolOrigin&&(tt=i.convert(this._getSymbolOrigin(D,J,R)));if(M&&T&&T.length){var nt=T[J];_DataInfo.isValid(nt)&&(tt=i.convert(nt))}if(this._getSymbolStyles){var rt;F=(rt=this._getSymbolStyles(J,R))&&rt.fill?rt.fill:F;E=rt&&rt.fill?rt.fill:E;N=rt&&rt.stroke?rt.stroke:N;I=rt&&rt.stroke?rt.stroke:I}k=it>0?F:E;B=it>0?N:I;t.fill=k;t.stroke=B;t.strokeWidth=null;if(_DataInfo.isValid(et,it))if(V){var st=et-.5*g,at=et+.5*g;if(st<z&&at<z||st>G&&at>G)continue;st=e.convert(st);at=e.convert(at);if(!_DataInfo.isValid(st,at))continue;if(H){it/=this.dataInfo.getStackedAbsSum(et)}var ot=0;if(it>=0){ot=isNumberNaN(+A[et])?0:A[et];l=i.convert(Math.max(ot,X));h=i.convert(Math.max(ot+it,X));A[et]=ot+it}else{ot=isNumberNaN(+S[et])?0:S[et];l=i.convert(ot);h=i.convert(ot+it);S[et]=ot+it}o&&_.push(new Point(e.convert(et),h));if(!_DataInfo.isValid(l,h))continue;var lt=new Rect(Math.min(st,at),Math.min(l,h),Math.abs(at-st),Math.abs(h-l));if(y>0){(gt=1-y/lt.width)<0&&(gt=0);var ht=lt.left+.5*lt.width;lt.left+=(ht-lt.left)*gt;lt.width=Math.min(y,lt.width)}var ct=new _RectArea(lt);this.drawSymbol(t,lt,n,J,new Point(lt.left+.5*lt.width,h),j);n._setPointIndex(J,O);O++;var ut=H?Math.min(ot+it,1):ot+it;ct.tag=new _DataPoint(p,J,et,ut);this.hitTester.add(ct,p)}else{var _t=et-.5*g+s*v,pt=et-.5*g+(s+1)*v;if(_t<z&&pt<z||_t>G&&pt>G)continue;_t=e.convert(_t);pt=e.convert(pt);var dt=i.convert(it);if(!_DataInfo.isValid(dt,_t,pt))continue;var lt=new Rect(Math.min(_t,pt),Math.min(dt,tt),Math.abs(pt-_t),Math.abs(tt-dt));o&&_.push(new Point((_t+pt)/2,dt));if(y>0){var ft,gt;(gt=1-(ft=y/a)/lt.width)<0&&(gt=0);ht=e.convert(et);lt.left+=(ht-lt.left)*gt;lt.width=Math.min(ft,lt.width)}var ct=new _RectArea(lt);this.drawSymbol(t,lt,n,J,new Point(lt.left+.5*lt.width,dt),j);n._setPointIndex(J,O);O++;ct.tag=new _DataPoint(p,J,et,it);this.hitTester.add(ct,p)}else o&&_.push(null)}}o&&_&&_.length&&o(_)}};_BarPlotter.prototype.drawSymbol=function(t,e,i,n,r,s){var a=this;if(s){t.startGroup();var o=new HitTestInfo(this.chart,r,ChartElement.SeriesSymbol);o._setData(i,n);s(t,o,(function(){a.drawDefaultSymbol(t,e,i)}));t.cssPriority=!0;t.endGroup()}else this.drawDefaultSymbol(t,e,i)};_BarPlotter.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)};return _BarPlotter}(_BasePlotter);export{_BarPlotter};var _FunnelPlotter=function(t){__extends(_FunnelPlotter,t);function _FunnelPlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.stacking=Stacking.None;return e}_FunnelPlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),n=t.getMinY(),r=t.getMaxX(),s=t.getMaxY();return new Rect(i,n,r-i,s-n)};_FunnelPlotter.prototype.plotSeries=function(t,e,i,n,r,s,a,o){var l=this.chart.series.indexOf(n);if(!(l>0)){var h,c,u,_,p,d=asType(n,SeriesBase),f=this.chart._options,g=n.getValues(0),y=n.getValues(1),m=this.chart._plotRect,b=f&&f.funnel&&null!=f.funnel.neckWidth?f.funnel.neckWidth:.2,x=f&&f.funnel&&null!=f.funnel.neckHeight?f.funnel.neckHeight:0,v=b*m.width,C=0,S=0,A=0,w=0,P=m.left,M=m.top,T=m.width,L=m.height;if(g){this.rotated&&(M+=m.height);v=v||1;y||(y=this.dataInfo.getXVals());var F=g.length;null!=y&&(F=Math.min(F,y.length));var E=0;for(C=0;C<F;C++)if(_DataInfo.isValid(g[C])){S+=g[C];g[C]>E&&(E=g[C])}var N,I,R,k=0;if(f&&f.funnel&&"rectangle"===f.funnel.type&&E>0){x=L/F;b=T;var B=T/E;for(C=0;C<F;C++){var D=y?y[C]:C,O=g[C],V=d._getSymbolFill(C),H=d._getAltSymbolFill(C)||V,j=d._getSymbolStroke(C),z=d._getAltSymbolStroke(C)||j;if(this._getSymbolStyles){V=(U=this._getSymbolStyles(C,F))&&U.fill?U.fill:V;H=U&&U.fill?U.fill:H;j=U&&U.stroke?U.stroke:j;z=U&&U.stroke?U.stroke:z}N=O>0?V:H;I=O>0?j:z;t.fill=N;t.stroke=I;if(_DataInfo.isValid(D)&&_DataInfo.isValid(O)){B||(B=T/O);var G=B*O;P+=(b-G)/2;this.rotated&&(M-=x);t.drawRect(P,M,G,x);R=new _FunnelSegment(new Point(P,M),G,x,G,x);this.rotated||(M+=x);b=G;R.tag=new _DataPoint(l,C,D,O);this.hitTester.add(R,l);n._setPointIndex(C,k);k++}}}else{A=m.left+m.width*(1-b)/2;w=m.top+m.height*(this.rotated?x:1-x);c=(1-b)*m.width/2/(m.height*(1-x));if(isNumberNaN(+c)||!isNumberFinite(+c)){T=v;P=A;M=w}h=m.width*b*m.height+m.width*(1-b)/2*m.height*(1-x);for(C=0;C<F;C++){D=y?y[C]:C,O=g[C];var X=[],Y=[];V=d._getSymbolFill(C),H=d._getAltSymbolFill(C)||V,j=d._getSymbolStroke(C),z=d._getAltSymbolStroke(C)||j;if(this._getSymbolStyles){var U;V=(U=this._getSymbolStyles(C,F))&&U.fill?U.fill:V;H=U&&U.fill?U.fill:H;j=U&&U.stroke?U.stroke:j;z=U&&U.stroke?U.stroke:z}N=O>0?V:H;I=O>0?j:z;t.fill=N;t.stroke=I;if(_DataInfo.isValid(D)&&_DataInfo.isValid(O)){var K=h*O/S;if(T>v){_=this._getTrapezoidOffsetY(T,K,c);if(this.rotated)if(M-_>w){X=[P,P+(u=c*_),P+T-u,P+T];Y=[M,M-_,M-_,M];R=new _FunnelSegment(new Point(P,M-_),T,_,T-2*u,0,!0);T-=2*u;P+=u;M-=_}else{u=c*(_=M-w);p=(K-=this._getTrapezoidArea(T,c,_))/v;X.push(P,P+u,P+u,P+u+v,P+u+v,P+T);Y.push(M,M-_,M-_-p,M-_-p,M-_,M);R=new _FunnelSegment(new Point(P,M-_-p),T,_+p,v,p,!0);T=v;P+=u;M=M-_-p}else if(M+_<w){X=[P,P+(u=c*_),P+T-u,P+T];Y=[M,M+_,M+_,M];R=new _FunnelSegment(new Point(P,M),T,_,T-2*u,0);T-=2*u;P+=u;M+=_}else{u=c*(_=w-M);p=(K-=this._getTrapezoidArea(T,c,_))/v;X.push(P,P+u,P+u,P+u+v,P+u+v,P+T);Y.push(M,M+_,M+_+p,M+_+p,M+_,M);R=new _FunnelSegment(new Point(P,M),T,_+p,v,p);T=v;P+=u;M=M+_+p}t.drawPolygon(X,Y)}else{p=K/v;this.rotated&&(M-=p);t.drawRect(P,M,T,p);R=new _FunnelSegment(new Point(P,M),v,p,v,p);this.rotated||(M+=p)}R.tag=new _DataPoint(l,C,D,O);this.hitTester.add(R,l);n._setPointIndex(C,k);k++}}}}}};_FunnelPlotter.prototype._getTrapezoidArea=function(t,e,i){var n=i*e;return n*i+(t-2*n)*i};_FunnelPlotter.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)};_FunnelPlotter.prototype.drawDefaultSymbol=function(t,e,i){t.drawRect(e.left,e.top,e.width,e.height,null,i.symbolStyle)};_FunnelPlotter.prototype._getPointAndPosition=function(t,e,i,n){var r=i;t.x=r.center.x;t.y=r.center.y;e=null==e?LabelPosition.Center:e};return _FunnelPlotter}(_BasePlotter);export{_FunnelPlotter};var _FunnelSegment=function(){function _FunnelSegment(t,e,i,n,r,s){void 0===s&&(s=!1);this._startPoint=t;this._width=e;this._height=i;this._neckHeight=r;this._center=new Point(this._startPoint.x+e/2,this._startPoint.y+i/2);this._offsetX=(e-n)/2;this._offsetY=i-r;this._rotated=s}_FunnelSegment.prototype.contains=function(t){var e=this._startPoint,i=this._offsetX,n=this._offsetY;if(this._rotated){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+this._neckHeight)return!1;if(t.x<this._center.x)return(e.y+this._height-t.y)/(t.x-e.x)<n/i;if(t.x>this._center.x)return(e.y+this._height-t.y)/(e.x+this._width-t.x)<n/i}}else 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};_FunnelSegment.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;if(this._rotated){if(t.y>e.y+n)return t.x<e.x?Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y+n-t.y,2)):t.x>e.x+i?Math.sqrt(Math.pow(t.x-e.x-i,2)+Math.pow(e.y+n-t.y,2)):t.y-e.y-n;if(t.y<e.y)return t.x<e.x+r?Math.sqrt(Math.pow(e.x+r-t.x,2)+Math.pow(t.y-e.y-n,2)):t.x>e.x+i-r?Math.sqrt(Math.pow(t.x-e.x-i+r,2)+Math.pow(t.y-e.y-n,2)):e.y-t.y;if(!(t.y<e.y+n-s))return t.x<e.x+r?Math.min(Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(t.y-e.y-n,2)),Math.sqrt(Math.pow(t.x-r/2-e.x,2)+Math.pow(t.y-n+s/2-e.y,2)),Math.sqrt(Math.pow(t.x-r-e.x,2)+Math.pow(t.y-n+s-e.y,2))):Math.min(Math.sqrt(Math.pow(t.x-i-e.x,2)+Math.pow(t.y-n-e.y,2)),Math.sqrt(Math.pow(t.x-i+r/2-e.x,2)+Math.pow(t.y-n+s/2-e.y,2)),Math.sqrt(Math.pow(t.x-i+r-e.x,2)+Math.pow(t.y-n+s-e.y,2)));if(t.x<e.x+r)return e.x+r-t.x;if(t.x>e.x+i-r)return t.x-e.x-i+r}else{if(t.y<e.y)return 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;if(t.y>e.y+n)return t.x<e.x+r?Math.sqrt(Math.pow(e.x+r-t.x,2)+Math.pow(t.y-e.y-n,2)):t.x>e.x+i-r?Math.sqrt(Math.pow(t.x-e.x-i+r,2)+Math.pow(t.y-e.y-n,2)):t.y-e.y-n;if(!(t.y>e.y+s))return 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)));if(t.x<e.x+r)return e.x+r-t.x;if(t.x>e.x+i-r)return t.x-e.x-i+r}};Object.defineProperty(_FunnelSegment.prototype,"center",{get:function(){return this._center},enumerable:!0,configurable:!0});return _FunnelSegment}();export{_FunnelSegment};var _FinancePlotter=function(t){__extends(_FinancePlotter,t);function _FinancePlotter(){var e=null!==t&&t.apply(this,arguments)||this;e.isCandle=!0;e.isArms=!1;e.isEqui=!1;e.isVolume=!1;e._volHelper=null;e._symWidth=.7;return e}_FinancePlotter.prototype.clear=function(){t.prototype.clear.call(this);this._volHelper=null};_FinancePlotter.prototype.load=function(){t.prototype.load.call(this);if(this.isVolume){var e,i,n,r,s,a,o,l,h,c=null,u=null;for(a=0;a<this.chart.series.length;a=h){h=a+1;s=(e=this.chart.series[a]).getDataType(1)||e.chart._xDataType;i=e._getAxisX();r=(n=null===(n=e._getChartType())||isUndefined(n)?this.chart._getChartType():n)===ChartType.Column?e._getBindingValues(1):n===ChartType.Candlestick?e._getBindingValues(4):null;if(s===DataType.Date){var _=void 0;o=[];l=[];for(var p=0;p<e._getLength();p++){_=e._getItem(p)[e.bindingX].valueOf();o.push(_);l.push({value:_,text:Globalize.format(new Date(_),i.format||"d")})}h=p+1}else o=this.dataInfo.getXVals();c=this.dataInfo.getMinX();u=this.dataInfo.getMaxX();if(r&&r.length>0){this._volHelper=new _VolumeHelper(r,o,c,u,s);i._customConvert=this._volHelper.convert.bind(this._volHelper);i._customConvertBack=this._volHelper.convertBack.bind(this._volHelper);l&&l.length>0&&(this._itemsSource=i.itemsSource=l);break}}}};_FinancePlotter.prototype.unload=function(){t.prototype.unload.call(this);for(var e,i=0;i<this.chart.series.length;i++)if(e=this.chart.series[i]._getAxisX()){e._customConvert=null;e._customConvertBack=null;e.itemsSource&&e.itemsSource==this._itemsSource&&(this._itemsSource=e.itemsSource=null)}};_FinancePlotter.prototype.parseSymbolWidth=function(t){this._isPixel=void 0;if(t)if(isNumber(t)){var e=asNumber(t);if(isNumberFinite(+e)&&e>0){this._symWidth=e;this._isPixel=!0}}else if(isString(t)){var i=asString(t);if(i&&i.indexOf("%")>=0){i=i.replace("%","");var n=parseFloat(i);if(isNumberFinite(+n)){n<0?n=0:n>100&&(n=100);this._symWidth=n/100;this._isPixel=!1}}else{n=parseFloat(t);if(isNumberFinite(+n)&&n>0){this._symWidth=n;this._isPixel=!0}}}};_FinancePlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),n=t.getMinY(),r=t.getMaxX(),s=t.getMaxY(),a=t.getDeltaX(),o=this.chart._xDataType;a<=0&&(a=1);var l=this.chart.series,h=l.length,c=0;this.parseSymbolWidth(this.symbolWidth);!this.isVolume||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.unload():this.load();for(var u=0;u<h;u++){var _=l[u];if(!_._isCustomAxisY()){var p=_._getBinding(1),d=_._getBinding(2),f=_._getBinding(3),g=_._getLength();if(g){var y=_._getSymbolSize();y>c&&(c=y);for(var m=0;m<g;m++){var b=_._getItem(m);if(b){[p?b[p]:null,d?b[d]:null,f?b[f]:null].forEach((function(t){if(_DataInfo.isValid(t)&&null!==t){(isNumberNaN(+n)||t<n)&&(n=t);(isNumberNaN(+s)||t>s)&&(s=t)}}))}}}}}var x=r-i;return!(o===DataType.Date&&this.isVolume||o===DataType.Number)||this.chart._getChartType()!==ChartType.Column&&this.chart._getChartType()!==ChartType.Candlestick?this.chart._isRotated()?new Rect(n,i,s-n,x):new Rect(i,n,x,s-n):new Rect(i-.5*a,n,r-i+a,s-n)};_FinancePlotter.prototype.plotSeries=function(t,e,i,n,r,s,a,o){var l=this,h=asType(n,SeriesBase),c=this.chart.series.indexOf(n),u=n.getValues(0),_=n.getValues(1),p=this._symWidth,d=this.chart._isRotated();if(u){_||(_=this.dataInfo.getXVals());if(_){var f=this.dataInfo.getDeltaX();f>0&&!1===this._isPixel&&(p*=f)}var g=u.length,y=!0;if(_)g=Math.min(g,_.length);else{y=!1;_=new Array(g)}var m=this._DEFAULT_WIDTH,b=h._getSymbolFill(c),x=h._getAltSymbolFill(c)||"transparent",v=h._getSymbolStroke(c),C=h._getAltSymbolStroke(c)||v,S=void 0===this._isPixel?h._getSymbolSize():p;t.stroke=v;t.strokeWidth=m;t.fill=b;for(var A,w,P=h._getBinding(1),M=h._getBinding(2),T=h._getBinding(3),L=d?i.actualMin:e.actualMin,F=d?i.actualMax:e.actualMax,E=0,N=null,I=null,R=this.getItemFormatter(n),_loop_3=function(r){if(N=h._getItem(r)){var s=y?_[r]:r;if(_DataInfo.isValid(s)&&L<=s&&s<=F){var a=u[r],o=P?N[P]:null,p=M?N[M]:null,d=T?N[T]:null;t.startGroup();if(k.isEqui&&null!==I){if(I[T]!==N[T]){A=I[T]<N[T]?x:b;w=I[T]<N[T]?C:v}}else{A=p<d?x:b;w=p<d?C:v}t.fill=A;t.stroke=w;t.strokeWidth=m;if(R){var f=new HitTestInfo(k.chart,new Point(e.convert(s),i.convert(a)),ChartElement.SeriesSymbol);f._setData(h,r);R(t,f,(function(){l._drawSymbol(t,e,i,c,r,A,S,s,a,o,p,d,g)}));t.cssPriority=!0}else k._drawSymbol(t,e,i,c,r,A,S,s,a,o,p,d,g);t.endGroup();n._setPointIndex(r,E);E++}I=N}},k=this,B=0;B<g;B++)_loop_3(B)}};_FinancePlotter.prototype._drawSymbol=function(t,e,i,n,r,s,a,o,l,h,c,u,_){var p,d=null,f=null,g=null,y=null,m=this.chart._isRotated(),b=e.convert(o),x=e._axrect,v=a/2,C=0===r&&b-x.left<=v,S=r===_-1&&x.right-b<=v,A=m?new _DataPoint(n,r,l,o):new _DataPoint(n,r,o,l);if(m){var w=i;i=e;e=w}if(!1===this._isPixel){if(C){g=o;y=o+a}else if(S){g=o-a;y=o}else{g=o-.5*a;y=o+.5*a}if((g=e.convert(g))>(y=e.convert(y))){var P=g;g=y;y=P}}o=b;if(!1!==this._isPixel)if(C){g=o;y=o+a}else if(S){g=o-a;y=o}else{g=o-.5*a;y=o+.5*a}if(this.isCandle){if(_DataInfo.isValid(c)&&_DataInfo.isValid(u)){c=i.convert(c);u=i.convert(u);f=(d=Math.min(c,u))+Math.abs(c-u);if(m){t.drawRect(d,g,f-d||1,y-g||1);p=new _RectArea(new Rect(d,g,f-d||1,y-g||1))}else{t.drawRect(g,d,y-g||1,f-d||1);p=new _RectArea(new Rect(g,d,y-g||1,f-d||1))}p.tag=A;this.hitTester.add(p,n)}if(_DataInfo.isValid(l)){l=i.convert(l);if(null!==d)if(m){t.drawLine(f,o,l,o);this._extendRectArea(p,l,o)}else{t.drawLine(o,d,o,l);this._extendRectArea(p,o,l)}}if(_DataInfo.isValid(h)){h=i.convert(h);if(null!==f)if(m){t.drawLine(d,o,h,o);this._extendRectArea(p,h,o)}else{t.drawLine(o,f,o,h);this._extendRectArea(p,o,h)}}}else if(this.isEqui){if(_DataInfo.isValid(l)&&_DataInfo.isValid(h)){l=i.convert(l);h=i.convert(h);f=(d=Math.min(l,h))+Math.abs(l-h);t.drawRect(g,d,y-g||1,f-d||1);(p=new _RectArea(new Rect(g,d,y-g||1,f-d||1))).tag=A;this.hitTester.add(p,n)}}else if(this.isArms){if(_DataInfo.isValid(c)&&_DataInfo.isValid(u)){c=i.convert(c);u=i.convert(u);f=(d=Math.min(c,u))+Math.abs(c-u);t.drawRect(g,d,y-g||1,f-d||1)}if(_DataInfo.isValid(l)&&null!==d){l=i.convert(l);t.drawLine(o,d,o,l)}if(_DataInfo.isValid(h)&&null!==f){h=i.convert(h);t.drawLine(o,f,o,h)}if(_DataInfo.isValid(l)&&_DataInfo.isValid(h)){t.fill="transparent";f=(d=Math.min(l,h))+Math.abs(l-h);t.drawRect(g,d,y-g||1,f-d||1);(p=new _RectArea(new Rect(g,d,y-g||1,f-d||1))).tag=A;this.hitTester.add(p,n)}}else{if(_DataInfo.isValid(l)&&_DataInfo.isValid(h)){l=i.convert(l);h=i.convert(h);f=(d=Math.min(l,h))+Math.abs(l-h);if(m){t.drawLine(h,o,l,o);p=new _RectArea(new Rect(d,g,f-d||1,y-g||1))}else{t.drawLine(o,h,o,l);p=new _RectArea(new Rect(g,d,y-g||1,f-d||1))}p.tag=A;this.hitTester.add(p,n)}if(_DataInfo.isValid(c)){c=i.convert(c);m?t.drawLine(c,g,c,o):t.drawLine(g,c,o,c)}if(_DataInfo.isValid(u)){u=i.convert(u);m?t.drawLine(u,o,u,y):t.drawLine(o,u,y,u)}}};_FinancePlotter.prototype._extendRectArea=function(t,e,i){if(t&&t.rect&&isNumberFinite(+e)&&isNumberFinite(+i)){var n=t.rect,r=Math.min(n.left,e),s=Math.min(n.top,i),a=Math.max(n.right,e),o=Math.max(n.bottom,i);n.left=r;n.top=s;n.width=a-r;n.height=o-s}};return _FinancePlotter}(_BasePlotter);export{_FinancePlotter};var LineMarkers=function(){function LineMarkers(){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)}LineMarkers.prototype.attach=function(t){var e,i=t.chart.hostElement,n=this._markers,r=i.getAttribute("data-markerIndex"),s=[];if(null!=r)if((s=n[r])&&isArray(s))s.push(t);else{n[r]=[t];this._bindMoveEvent(i)}else{e=n.length;s=[t];n.push(s);i.setAttribute("data-markerIndex",e.toString());this._bindMoveEvent(i)}};LineMarkers.prototype.detach=function(t){var e,i,n=t.chart.hostElement,r=this._markers,s=n.getAttribute("data-markerIndex");if(null!=s){(e=(i=r[s]).indexOf(t))>-1&&i.splice(e,1);if(0===i.length){(e=r.indexOf(i))>-1&&(r[e]=void 0);this._unbindMoveEvent(n)}}};LineMarkers.prototype._unbindMoveEvent=function(t){var e=this._bindMoveMarker;t.removeEventListener("mousemove",e);"ontouchstart"in window&&t.removeEventListener("touchmove",e)};LineMarkers.prototype._bindMoveEvent=function(t){var e=this._bindMoveMarker;t.addEventListener("mousemove",e);"ontouchstart"in window&&t.addEventListener("touchmove",e)};return LineMarkers}(),lineMarkers=new LineMarkers;export var LineMarkerLines;!function(t){t[t.None=0]="None";t[t.Vertical=1]="Vertical";t[t.Horizontal=2]="Horizontal";t[t.Both=3]="Both"}(LineMarkerLines||(LineMarkerLines={}));export var LineMarkerInteraction;!function(t){t[t.None=0]="None";t[t.Move=1]="Move";t[t.Drag=2]="Drag"}(LineMarkerInteraction||(LineMarkerInteraction={}));export var LineMarkerAlignment;!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"}(LineMarkerAlignment||(LineMarkerAlignment={}));var LineMarker=function(){function LineMarker(t,e){this._wrapperMousedown=null;this._wrapperMouseup=null;this._savedPosition=new Point;this.positionChanged=new Event;this._chart=t;t._markers.push(this);t.rendered.addHandler(this._initialize,this);this._resetDefaultValue();copy(this,e);this._initialize()}Object.defineProperty(LineMarker.prototype,"chart",{get:function(){return this._chart},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"isVisible",{get:function(){return this._isVisible},set:function(t){if(t!==this._isVisible){this._isVisible=asBoolean(t);this._marker&&this._toggleVisibility()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"seriesIndex",{get:function(){return this._seriesIndex},set:function(t){t!==this._seriesIndex&&(this._seriesIndex=asNumber(t,!0))},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"horizontalPosition",{get:function(){return this._horizontalPosition},set:function(t){if(t!==this._horizontalPosition){this._horizontalPosition=asNumber(t,!0);this._savedPosition.x=this._horizontalPosition;if(this._horizontalPosition<0||this._horizontalPosition>1)throw"horizontalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"x",{get:function(){var t=this._chart.axisX,e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.x)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"y",{get:function(){var t=this._chart.axisY,e=this.chart.pageToControl(this._targetPoint);return t.convertBack(e.y)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"content",{get:function(){return this._content},set:function(t){if(t!==this._content){this._content=asFunction(t);this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"verticalPosition",{get:function(){return this._verticalPosition},set:function(t){if(t!==this._verticalPosition){this._verticalPosition=asNumber(t,!0);this._savedPosition.y=this._verticalPosition;if(this._verticalPosition<0||this._verticalPosition>1)throw"verticalPosition's value should be in (0, 1).";this._marker&&this._updateMarkerPosition()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"alignment",{get:function(){return this._alignment},set:function(t){if(t!==this._alignment){this._alignment=t;this._marker&&this._updatePositionByAlignment()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"lines",{get:function(){return this._lines},set:function(t){if((t=asEnum(t,LineMarkerLines))!=this._lines){this._lines=t;this._marker&&this._resetLinesVisibility()}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"interaction",{get:function(){return this._interaction},set:function(t){if((t=asEnum(t,LineMarkerInteraction))!=this._interaction){this._marker&&this._detach();this._interaction=t;this._marker&&this._attach();this._toggleElesDraggableClass(this._interaction==LineMarkerInteraction.Drag)}},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragThreshold",{get:function(){return this._dragThreshold},set:function(t){t!=this._dragThreshold&&(this._dragThreshold=asNumber(t))},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragContent",{get:function(){return this._dragContent},set:function(t){t!==this._dragContent&&(this._dragContent=asBoolean(t));toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,this._interaction===LineMarkerInteraction.Drag&&this._dragContent&&this._lines!==LineMarkerLines.None)},enumerable:!0,configurable:!0});Object.defineProperty(LineMarker.prototype,"dragLines",{get:function(){return this._dragLines},set:function(t){t!=this._dragLines&&(this._dragLines=asBoolean(t))},enumerable:!0,configurable:!0});LineMarker.prototype.onPositionChanged=function(t){this.positionChanged.raise(this,t)};LineMarker.prototype.remove=function(){var t=this._chart;if(this._marker){t.rendered.removeHandler(this._initialize,this);this._detach();this._removeMarker();this._wrapperMoveMarker=null;this._wrapperMousedown=null;this._wrapperMouseup=null}};LineMarker.prototype._attach=function(){var t=this._chart.hostElement;this._interaction!==LineMarkerInteraction.None?addClass(t,LineMarker._CSS_TOUCH_DISABLED):removeClass(t,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.attach(this);this._attachDrag()};LineMarker.prototype._attachDrag=function(){if(this._interaction===LineMarkerInteraction.Drag){this._wrapperMousedown||(this._wrapperMousedown=this._onMousedown.bind(this));this._wrapperMouseup||(this._wrapperMouseup=this._onMouseup.bind(this));this._toggleDragEventAttach(!0)}};LineMarker.prototype._detach=function(){removeClass(this._chart.hostElement,LineMarker._CSS_TOUCH_DISABLED);lineMarkers.detach(this);this._detachDrag()};LineMarker.prototype._detachDrag=function(){this._interaction===LineMarkerInteraction.Drag&&this._toggleDragEventAttach(!1)};LineMarker.prototype._toggleDragEventAttach=function(t){var e=this._chart.hostElement,i=t?"addEventListener":"removeEventListener";e[i]("mousedown",this._wrapperMousedown);document[i]("mouseup",this._wrapperMouseup);"ontouchstart"in window&&e[i]("touchstart",this._wrapperMousedown);"ontouchend"in window&&document[i]("touchend",this._wrapperMouseup)};LineMarker.prototype._onMousedown=function(t){var e,i,n,r,s,a=this._getEventPoint(t);if(this._interaction===LineMarkerInteraction.Drag){r=!(0===(e=getElementRect(this._hLine)).width||0===e.height);s=!(0===(i=getElementRect(this._vLine)).width||0===i.height);n=getElementRect(this._markerContent);if(this._dragContent&&this._pointInRect(a,n)){this._capturedEle=this._markerContent;this._contentDragStartPoint=new Point(a.x,a.y);this._mouseDownCrossPoint=new Point(this._targetPoint.x,this._targetPoint.y)}else if(r&&(Math.abs(e.top-a.y)<=this._dragThreshold||Math.abs(a.y-e.top-e.height)<=this._dragThreshold||a.y>=e.top&&a.y<=e.top+e.height)){this._capturedEle=this._hLine;this._contentDragStartPoint=void 0;addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}else if(s&&(Math.abs(i.left-a.x)<=this._dragThreshold||Math.abs(a.x-i.left-i.width)<=this._dragThreshold||a.x>=i.left&&a.x<=i.left+i.width)){this._capturedEle=this._vLine;this._contentDragStartPoint=void 0;addClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)}t.preventDefault()}};LineMarker.prototype._onMouseup=function(t){var e=this._alignment===LineMarkerAlignment.Auto&&this._capturedEle===this._markerContent&&this._lines!==LineMarkerLines.None;this._capturedEle=void 0;this._contentDragStartPoint=void 0;this._mouseDownCrossPoint=void 0;if(e){this._updatePositionByAlignment();this._updatePositionByAlignment()}removeClass(this._chart.hostElement,LineMarker._CSS_LINE_DRAGGABLE)};LineMarker.prototype._moveMarker=function(t){var e,i,n,r,s,a,o=this._chart,l=this._getEventPoint(t),h=this._plotRect,c=this._interaction===LineMarkerInteraction.Drag,u=this._lines===LineMarkerLines.Horizontal,_=this._lines===LineMarkerLines.Vertical,p=this._seriesIndex,d=getElementRect(o.hostElement);if(h&&this._isVisible&&this._interaction!==LineMarkerInteraction.None&&(this._interaction!==LineMarkerInteraction.Drag||this._capturedEle&&this._lines!==LineMarkerLines.None)){if(c)if(this._contentDragStartPoint){l.x=u?this._targetPoint.x:this._mouseDownCrossPoint.x+l.x-this._contentDragStartPoint.x;l.y=_?this._targetPoint.y:this._mouseDownCrossPoint.y+l.y-this._contentDragStartPoint.y}else u||!this._dragLines&&this._capturedEle===this._hLine?l.x=this._targetPoint.x:(_||!this._dragLines&&this._capturedEle===this._vLine)&&(l.y=this._targetPoint.y);if(c&&this._lines===LineMarkerLines.Horizontal||!this._dragLines&&this._capturedEle===this._hLine){if(l.y<=h.top||l.y>=h.top+h.height)return}else if(c&&this._lines===LineMarkerLines.Vertical||!this._dragLines&&this._capturedEle===this._vLine){if(l.x<=h.left||l.x>=h.left+h.width)return}else{var f=this._getTop();if(l.x<=h.left||l.y<=f||l.x>=h.left+h.width||l.y>=f+h.height)return}if(null!=p&&p>=0&&p<o.series.length){if(null==(i=(e=o.series[p]).hitTest(new Point(l.x,NaN)))||null==i.x||null==i.y)return;n=e.axisX||o.axisX;r=e._getAxisY();s=isDate(i.x)?FlexChartCore._toOADate(i.x):i.x;s=isString(s)?i.pointIndex:s;a=isDate(i.y)?FlexChartCore._toOADate(i.y):i.y;var g=this._getElementPaddingValuee(o.hostElement,"padding-left"),y=this._getElementPaddingValuee(o.hostElement,"padding-top");l.x=n.convert(s)+g+d.left;this.chart._stacking!=Stacking.None&&(a=this._calcStackedValue(p,s,a));l.y=r.convert(a)+y+d.top}this._updateMarkerPosition(l);t.preventDefault()}};LineMarker.prototype._calcStackedValue=function(t,e,i){for(var n=i,r=this.chart._stacking==Stacking.Stacked100pc,s=0;s<t;s++){var a=this.chart.series[s],o=a.getValues(1),l=a.getValues(0);if(l)for(var h=0;h<l.length;h++){if(e===(o?o[h]:h)){isNumberFinite(+l[h])&&(r||this._sign(i)==this._sign(l[h]))&&(n+=l[h]);break}}}r&&n&&(n/=this.chart._dataInfo.getStackedAbsSum(e))>1&&(n=1);return n};LineMarker.prototype._sign=function(t){return t>0?1:t<0?-1:0};LineMarker.prototype._getElementPaddingValuee=function(t,e){return+window.getComputedStyle(t,null).getPropertyValue(e).replace("px","")};LineMarker.prototype._show=function(t){(t||this._marker).style.display="block"};LineMarker.prototype._hide=function(t){(t||this._marker).style.display="none"};LineMarker.prototype._toggleVisibility=function(){this._isVisible?this._show():this._hide()};LineMarker.prototype._resetDefaultValue=function(){this._isVisible=!0;this._alignment=LineMarkerAlignment.Auto;this._lines=LineMarkerLines.None;this._interaction=LineMarkerInteraction.None;this._horizontalPosition=null;this._verticalPosition=null;this._content=null;this._seriesIndex=null;this._dragThreshold=15;this._dragContent=!1;this._dragLines=!1;this._targetPoint=new Point};LineMarker.prototype._initialize=function(){var t,e=this._chart.hostElement.querySelector("."+FlexChartCore._CSS_PLOT_AREA);this._plot=e;this._marker||this._createMarker();if(e){this._plotRect=getElementRect(e);t=e.getBBox();this._plotRect.width=t.width;this._plotRect.height=t.height;this._updateMarkerSize();this._updateLinesSize()}this._updateMarkerPosition();this._wrapperMoveMarker=this._moveMarker.bind(this);this._attach()};LineMarker.prototype._createMarker=function(){var t,e;t=document.createElement("div");addClass(t,LineMarker._CSS_MARKER);(e=this._getContainer()).appendChild(t);this._markerContainer=e;this._marker=t;this._createChildren()};LineMarker.prototype._removeMarker=function(){var t=this._markerContainer;t.removeChild(this._marker);this._content=null;this._hLine=null;this._vLine=null;if(!t.hasChildNodes()){this._chart.hostElement.removeChild(this._markerContainer);this._markerContainer=null}this._marker=null};LineMarker.prototype._getContainer=function(){var t=this._chart.hostElement.querySelector(LineMarker._CSS_MARKER_CONTAINER);t||(t=this._createContainer());return t};LineMarker.prototype._createContainer=function(){var t=document.createElement("div"),e=this._chart.hostElement;addClass(t,LineMarker._CSS_MARKER_CONTAINER);e.insertBefore(t,e.firstChild);return t};LineMarker.prototype._createChildren=function(){var t,e,i,n,r=this._marker;(n=document.createElement("div")).style.position="absolute";n.style.height="100%";n.style.width="100%";r.appendChild(n);this._dragEle=n;t=document.createElement("div");addClass(t,LineMarker._CSS_MARKER_CONTENT);r.appendChild(t);this._markerContent=t;e=document.createElement("div");addClass(e,LineMarker._CSS_MARKER_HLINE);r.appendChild(e);this._hLine=e;i=document.createElement("div");addClass(i,LineMarker._CSS_MARKER_VLINE);r.appendChild(i);this._vLine=i;this._toggleElesDraggableClass(this._interaction===LineMarkerInteraction.Drag);this._resetLinesVisibility()};LineMarker.prototype._toggleElesDraggableClass=function(t){toggleClass(this._hLine,LineMarker._CSS_LINE_DRAGGABLE,t);toggleClass(this._vLine,LineMarker._CSS_LINE_DRAGGABLE,t);toggleClass(this._dragEle,LineMarker._CSS_LINE_DRAGGABLE,t&&this._dragContent&&this._lines!==LineMarkerLines.None)};LineMarker.prototype._updateMarkerSize=function(){var t=this._plotRect,e=this._chart.hostElement,i=window.getComputedStyle(e,null),n=getElementRect(e);if(this._marker){this._marker.style.marginTop=t.top-n.top-(parseFloat(i.getPropertyValue("padding-top"))||0)+"px";this._marker.style.marginLeft=t.left-n.left-(parseFloat(i.getPropertyValue("padding-left"))||0)+"px"}};LineMarker.prototype._updateLinesSize=function(){var t=this._plotRect;if(this._hLine&&this._vLine){this._hLine.style.width=t.width+"px";this._vLine.style.height=t.height+"px"}};LineMarker.prototype._resetLinesVisibility=function(){if(this._hLine&&this._vLine){this._hide(this._hLine);this._hide(this._vLine);this._lines!==LineMarkerLines.Horizontal&&this._lines!==LineMarkerLines.Both||this._show(this._hLine);this._lines!==LineMarkerLines.Vertical&&this._lines!==LineMarkerLines.Both||this._show(this._vLine)}};LineMarker.prototype._updateMarkerPosition=function(t){var e,i,n=this._plotRect,r=this._targetPoint,s=!1;this._interaction,LineMarkerInteraction.Drag;if(this._plot){e=n.left+n.width*(this._horizontalPosition||0);i=n.top+n.height*(this._verticalPosition||0);null==this._horizontalPosition&&t?e=t.x:this._savedPosition.x>0&&(e=n.left+n.width*this._savedPosition.x);null==this._verticalPosition&&t?i=t.y:this._savedPosition.y>0&&(i=n.top+n.height*this._savedPosition.y);e===r.x&&i===r.y||(s=!0);r.x=e;r.y=i;this._savedPosition.x=clamp((e-n.left)/n.width,0,1);this._savedPosition.y=clamp((i-n.top)/n.height,0,1);this._toggleVisibility();this._content&&this._updateContent();s&&this._raisePositionChanged(e,i);this._updatePositionByAlignment(!!t)}};LineMarker.prototype._updateContent=function(){var t,e=this._chart,i=this._targetPoint,n=e.hitTest(i);t=this._content.call(null,n,i);this._markerContent.innerHTML=t||""};LineMarker.prototype._raisePositionChanged=function(t,e){this._plotRect;this.onPositionChanged(new Point(t,e))};LineMarker.prototype._updatePositionByAlignment=function(t){var e=this._alignment,i=this._targetPoint,n=this._marker,r=0,s=0,a=n.clientWidth,o=n.clientHeight,l=this._plotRect;if(this._plot){var h=this._getTop();if(!this._capturedEle||this._capturedEle&&this._capturedEle!==this._markerContent){if(e===LineMarkerAlignment.Auto){i.x+a+12>l.left+l.width&&i.x-a>=0&&(s=a);r=o;i.y-o<h&&(r=0)}else{1==(1&e)&&(s=a);2==(2&e)&&(r=o)}this._interaction===LineMarkerInteraction.Move&&0===r&&0===s&&null==this.verticalPosition&&(s=-12)}else{parseInt(this._hLine.style.top)>0&&(r=o);parseInt(this._vLine.style.left)>0&&(s=a)}n.style.left=i.x-s-l.left+"px";n.style.top=i.y-r-h+"px";this._hLine.style.top=r+"px";this._hLine.style.left=l.left-i.x+s+"px";this._vLine.style.top=h-i.y+r+"px";this._vLine.style.left=s+"px"}};LineMarker.prototype._getEventPoint=function(t){return t instanceof MouseEvent?new Point(t.pageX,t.pageY):new Point(t.changedTouches[0].pageX,t.changedTouches[0].pageY)};LineMarker.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)};LineMarker.prototype._getTop=function(){var t=0,e=this.chart._getHostComputedStyle();if(e){t+=this.chart._parsePx(e.paddingTop);t+=this.chart._parsePx(e.borderTopWidth);t+=this.chart._parsePx(e.marginTop)}return this._chart._plotRect.top+this._plot.getBoundingClientRect().top-t};LineMarker._CSS_MARKER=LineMarkerClsNames.linemarker;LineMarker._CSS_MARKER_HLINE=LineMarkerClsNames.hline;LineMarker._CSS_MARKER_VLINE=LineMarkerClsNames.vline;LineMarker._CSS_MARKER_CONTENT=LineMarkerClsNames.content;LineMarker._CSS_MARKER_CONTAINER=LineMarkerClsNames.container;LineMarker._CSS_LINE_DRAGGABLE=LineMarkerClsNames.draggable;LineMarker._CSS_TOUCH_DISABLED=FlexChartClsNames.touchDisabled;return LineMarker}();export{LineMarker};var _LinePlotter=function(t){__extends(_LinePlotter,t);function _LinePlotter(){var e=t.call(this)||this;e.hasSymbols=!1;e.hasLines=!0;e.isSpline=!1;e.isStep=!1;e.hitTestSymbols=!0;e.stacking=Stacking.None;e.stackPos={};e.stackNeg={};e.clipping=!1;return e}_LinePlotter.prototype.clear=function(){t.prototype.clear.call(this);this.stackNeg={};this.stackPos={}};_LinePlotter.prototype.adjustLimits=function(t,e){this.dataInfo=t;var i=t.getMinX(),n=t.getMinY(),r=t.getMaxX(),s=t.getMaxY();if(this.isSpline&&!this.chart.axisY._getLogBase()){var a=.1*(s-n);n-=a;s+=a}return this.rotated?new Rect(n,i,s-n,r-i):new Rect(i,n,r-i,s-n)};_LinePlotter.prototype.plotSeries=function(t,e,i,n,r,s,a,o){var l=[],h=asType(n,SeriesBase),c=this.chart.series.indexOf(n),u=n.getValues(0),_=n.getValues(1);if(u){_||(_=this.dataInfo.getXVals());var p=_BasePlotter.cloneStyle(n.style,["fill"]),d=u.length,f=!0;if(_)d=Math.min(d,_.length);else{f=!1;_=new Array(d)}var g=this._DEFAULT_WIDTH,y=h._getSymbolFill(c),m=h._getAltSymbolFill(c)||y,b=h._getSymbolStroke(c),x=h._getAltSymbolStroke(c)||b,v=h._getSymbolSize();t.stroke=b;t.strokeWidth=g;t.fill=y;var C=new Float64Array(d),S=new Float64Array(d),A=0,w=new Int8Array(d),P=0,M=this.rotated,T=this.stacking!=Stacking.None&&!h._isCustomAxisY(),L=this.stacking==Stacking.Stacked100pc&&!h._isCustomAxisY();void 0!==h._getChartType()&&(T=L=!1);for(var F,E=h.interpolateNulls,N=!1,I=this.getItemFormatter(n),R=0;R<d;R++){var k=f?_[R]:R,B=u[R];if(isNumberFinite(+k)&&isNumberFinite(+B)){if(T){if(L){B/=this.dataInfo.getStackedAbsSum(k)}if(B>=0){var D=isNumberNaN(+this.stackPos[k])?0:this.stackPos[k];B=this.stackPos[k]=D+B}else{D=isNumberNaN(+this.stackNeg[k])?0:this.stackNeg[k];B=this.stackNeg[k]=D+B}}if(M){F=new _DataPoint(c,R,B,k);var O=e.convert(B);B=i.convert(k);k=O}else{F=new _DataPoint(c,R,k,B);k=e.convert(k);B=i.convert(B)}if(isNumberNaN(+k)||isNumberNaN(+B)){N=!0;if(!0!==E){C[A]=NaN;S[A++]=NaN}w[P++]=1;o&&l.push(null)}else{C[A]=k;S[A++]=B;P++;o&&l.push(new Point(k,B));if(this.hitTestSymbols){var V=new _CircleArea(new Point(k,B),.5*v);V.tag=F;this.hitTester.add(V,c)}}}else{N=!0;if(!0!==E){C[A]=NaN;S[A++]=NaN}w[P++]=1;o&&l.push(null)}}var H=0;if(this.hasLines){t.fill=null;if(N&&!0!==E){var j=[],z=[];for(R=0;R<d;R++)if(isNumberNaN(+C[R])){if(j.length>1){this._drawLines(t,j,z,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(j,z),c);H++}j=[];z=[]}else{j.push(C[R]);z.push(S[R])}if(j.length>1){this._drawLines(t,j,z,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(j,z),c);H++}}else{this._drawLines(t,C,S,null,p,this.chart._plotrectId,A);this.hitTester.add(new _LinesArea(C,S),c);H++}}if(this.hasSymbols&&v>0||I){t.fill=y;var G=0;for(R=0;R<d;R++)if(!E||!w[R]){k=C[G],B=S[G];if(!1===this.hasLines||I){t.fill=u[R]>0?y:m;t.stroke=u[R]>0?b:x;t.strokeWidth=g}if(this.isValid(k,B,e,i)){this._drawSymbol(t,k,B,v,h,R,I);n._setPointIndex(R,H);H++}G++}}o&&l&&l.length&&o(l)}};_LinePlotter.prototype._drawLines=function(t,e,i,n,r,s,a){if(this.isSpline&&a>3)t.drawSplines(e,i,n,r,s,a);else if(this.isStep){var o=this._createSteps(e,i,a);e=o.x;i=o.y;t.drawLines(e,i,n,r,s)}else t.drawLines(e,i,n,r,s,a)};_LinePlotter.prototype._drawSymbol=function(t,e,i,n,r,s,a){var o=this;if(a){t.startGroup();var l=new HitTestInfo(this.chart,new Point(e,i),ChartElement.SeriesSymbol);l._setData(r,s);a(t,l,(function(){o.hasSymbols&&n>0&&o._drawDefaultSymbol(t,e,i,n,r.symbolMarker,r.symbolStyle)}));t.cssPriority=!0;t.endGroup()}else this._drawDefaultSymbol(t,e,i,n,r.symbolMarker,r.symbolStyle)};_LinePlotter.prototype._drawDefaultSymbol=function(t,e,i,n,r,s){r==Marker.Dot?t.drawEllipse(e,i,.5*n,.5*n,null,s):r==Marker.Box&&t.drawRect(e-.5*n,i-.5*n,n,n,null,s)};return _LinePlotter}(_BasePlotter);export{_LinePlotter};var _BubblePlotter=function(t){__extends(_BubblePlotter,t);function _BubblePlotter(){var e=t.call(this)||this;e._MIN_SIZE=5;e._MAX_SIZE=30;e.hasLines=!1;e.hasSymbols=!0;e.clipping=!0;e.hitTestSymbols=!1;return e}_BubblePlotter.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,l=NaN,h=0;h<a;h++){if((y=s[h])._getChartType()==ChartType.Bubble||null==y._getChartType()&&y._chart._getChartType()==ChartType.Bubble){if(m=y._getBindingValues(1))for(var c=m.length,u=0;u<c;u++)if(isNumberFinite(+m[u])){(isNumberNaN(+o)||m[u]<o)&&(o=m[u]);(isNumberNaN(+l)||m[u]>l)&&(l=m[u])}}}this._minValue=o;this._maxValue=l;var _=t.prototype.adjustLimits.call(this,e,i),p=i.left,d=i.right,f=i.top,g=i.bottom;for(h=0;h<a;h++){var y;if((y=s[h])._getChartType()==ChartType.Bubble||null==y._getChartType()&&y._chart._getChartType()==ChartType.Bubble){var m=y._getBindingValues(1),b=y.getValues(1),x=y.getValues(0);if(m&&b&&x)for(c=m.length,u=0;u<c;u++){var v=b?b[u]:u,C=x[u],S=m[u];if(_DataInfo.isValid(v,C,S)){v=i.left+i.width*(v-_.left)/_.width;C=i.top+i.height*(C-_.top)/_.height;v-(S=this._minSize+(this._maxSize-this._minSize)*(S-o)/(l-o))<p&&(p=v-S);v+S>d&&(d=v+S);C-S<f&&(f=C-S);C+S>g&&(g=C+S)}}}}p=i.left-p+5;d=d-i.right+5;f=i.top-f+5;g=g-i.bottom+5;var A=this.chart.axisX,w=this.chart.axisY;if(!A._isLogAxis())if(this.stacking==Stacking.Stacked100pc&&this.rotated){var P=(i.width-this._maxSize)/_.width;_.left-=.5*this._maxSize/P;_.width+=this._maxSize/P}else{P=(i.width-(p+d))/_.width;_.left-=p/P;_.width+=(p+d)/P}if(!w._isLogAxis())if(this.stacking!=Stacking.Stacked100pc||this.rotated){M=(i.height-(f+g))/_.height;_.top-=f/M;_.height+=(f+g)/M}else{var M=(i.height-this._maxSize)/_.height;_.top-=.5*this._maxSize/M;_.height+=this._maxSize/M}return _};_BubblePlotter.prototype._drawSymbol=function(t,e,i,n,r,s,a){var o=this;if(null==this._minSize){var l=this.getNumOption("minSize","bubble");this._minSize=l||this._MIN_SIZE}if(null==this._maxSize){var h=this.getNumOption("maxSize","bubble");this._maxSize=h||this._MAX_SIZE}var c=r._getItem(s);if(c){var u=r._getBinding(1);if(u){var _=c[u];if(isNumberFinite(+_)){null==_&&(_=this._minValue);var p=this._minValue==this._maxValue?1:Math.sqrt((_-this._minValue)/(this._maxValue-this._minValue));_=this._minSize+(this._maxSize-this._minSize)*p;if(a){var d=new HitTestInfo(this.chart,new Point(e,i),ChartElement.SeriesSymbol);d._setData(r,s);t.startGroup();a(t,d,(function(){o._drawDefaultSymbol(t,e,i,_,r.symbolMarker,r.symbolStyle)}));t.endGroup()}else this._drawDefaultSymbol(t,e,i,_,r.symbolMarker,r.symbolStyle);var f=r.getValues(1);f||(f=this.dataInfo.getXVals());var g=f?f[s]:s,y=r.getValues(0)[s],m=this.chart.series.indexOf(r),b=new _CircleArea(new Point(e,i),.5*_);b.tag=new _DataPoint(m,s,g,y);this.hitTester.add(b,m)}}}};return _BubblePlotter}(_LinePlotter);export{_BubblePlotter};_registerModule("wijmo.chart",selfModule);