@mescius/wijmo.chart 5.20232.939
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/COMMERCIAL-LICENSE.html +485 -0
- package/README.md +363 -0
- package/es2015-commonjs.js +14 -0
- package/es2015-esm.js +14 -0
- package/es5-esm.js +14 -0
- package/index.d.ts +3580 -0
- package/index.js +14 -0
- package/package.json +44 -0
package/es5-esm.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* Wijmo Library 5.20232.939
|
|
4
|
+
* https://developer.mescius.com/wijmo
|
|
5
|
+
*
|
|
6
|
+
* Copyright(c) MESCIUS inc. All rights reserved.
|
|
7
|
+
*
|
|
8
|
+
* Licensed under the End-User License Agreement For MESCIUS Wijmo Software.
|
|
9
|
+
* us.sales@mescius.com
|
|
10
|
+
* https://developer.mescius.com/wijmo/licensing
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
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,tryCast,DataType,isDate,isArray,Event,asType,copy,asFunction,Binding,EventArgs,asCollectionView,asInt,ObservableArray,Globalize,asDate,removeChild,setCss,isIE,isEdge,hasClass,asArray,clamp,isUndefined,getElementRect,toggleClass,addClass,removeClass,isFunction,format,Control,Tooltip,CancelEventArgs,Color,mouseToPage,animate,_registerModule}from"@mescius/wijmo";import*as selfModule from"@mescius/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=void 0,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=void 0,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 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 _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;var r=this._len=i||Math.min(t.length,e.length);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=this._len*this.k,n=r;n<=this._len-1;n+=r){var s=this.calculatePoint(n);if(Math.abs(i.x-s.x)>=3||Math.abs(i.y-s.y)>=3){t.push(s.x);e.push(s.y);i=s}}return{xs:t,ys:e}};return _Spline}();export{_Spline};var Palettes=function(){function Palettes(){}Palettes._isExtended=function(t){return-1!==this._values(Palettes.Diverging).indexOf(t)||-1!==this._values(Palettes.Qualitative).indexOf(t)||-1!==this._values(Palettes.SequentialSingle).indexOf(t)||-1!==this._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._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._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"));this._baseUrl=window.location.pathname.replace(window.location.hash,"");"file:"==window.location.protocol&&(isIE()||isEdge())&&(this._baseUrl="file:"+this._baseUrl)}_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});_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);null!==this._strokeWidth&&this._setAttribute(o,"stroke-width",this._strokeWidth.toString());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 _Spline(t,e,s).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);null!==this._strokeWidth&&this._setAttribute(_,"stroke-width",this._strokeWidth.toString());_.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);null!==this._strokeWidth&&this._setAttribute(a,"stroke-width",this._strokeWidth.toString());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 ",y=" 0 0,0 ";if(Math.abs(s)>Math.PI){m=" 0 1,1 ";y=" 0 1,0 "}var x="M "+c.x.toFixed(u)+","+c.y.toFixed(u);x+=" A "+i.toFixed(u)+","+i.toFixed(u)+m;x+=f.x.toFixed(u)+","+f.y.toFixed(u);x+=l?" M "+d.x.toFixed(u)+","+d.y.toFixed(u):" L "+d.x.toFixed(u)+","+d.y.toFixed(u);x+=" A "+r.toFixed(u)+","+r.toFixed(u)+y;x+=g.x.toFixed(u)+","+g.y.toFixed(u);l||(x+=" z");_.setAttribute("d",x);h&&this._setClipPath(_,h);a&&_.setAttribute("class",a);this._applyStyle(_,o);this._appendChild(_);return _};_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.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.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+="font-size:"+this._fontSize+";");this._fontFamily&&(a+="font-family:"+this._fontFamily+";");a.length>0&&this._text.setAttribute("style",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 h in r)this._text.removeAttribute(this._deCase(h));this._textGroup.removeAttribute("class");this._text.textContent=null;if(!this._fontFamily&&!this._fontSize){var l=this._getKey(t,e,i);this._bbCache[l]={x:o.x,y:o.y+1e3,width:o.width,height:o.height}}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+="font-size:"+this._fontSize+";");this._fontFamily&&(n+="font-family:"+this._fontFamily+";");n.length>0&&i.setAttribute("style",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=t.getAttribute("style");r?t.setAttribute("style",r+e+":"+i+";"):t.setAttribute("style",e+":"+i+";")};_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,"wj-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=new Array;this._sz=new Size;this._colRowLens=[];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,"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});Legend.prototype._getDesiredSize=function(t,e,i,r){if(e==Position.None)return null;var n=this.orientation==Orientation.Auto?e==Position.Right||e==Position.Left:this.orientation==Orientation.Vertical,s=this._chart._getDesiredLegendSize(t,n,i,r);if(null!=s){if(this.title.length>0){var a=t.measureString(this.title,"wj-title","wj-legend");s.height+=a.height+this._titlePadding;a.width>s.width&&(s.width=a.width)}this._sz=s.clone();if(this.scrollbar&&s.height>r){n&&(s.width+=18);s.height=r}}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=this.orientation==Orientation.Auto?i==Position.Right||i==Position.Left:this.orientation==Orientation.Vertical;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,"wj-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,"wj-title");var h=o.height+this._titlePadding;e.y+=h;n-=h}var l=!1;this.scrollbar&&this._sz.height>n&&(l=!0);this._chart._renderLegend(t,e,this._areas,s,l?r-18:r,n);l&&this._addScrollbar(t,e,r,n,this._sz.height)};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){t.endGroup();var s=t.element,a=s.children.item(s.children.length-1);a.removeAttribute("clip-path");a.remove();Array.from(a.querySelectorAll("text,rect")).forEach((function(t){t.setAttribute("x",(+t.getAttribute("x")-e.x).toFixed(2));t.setAttribute("y",(+t.getAttribute("y")-e.y).toFixed(2))}));Array.from(a.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))}));var o=document.createElementNS("http://www.w3.org/2000/svg","foreignObject");o.setAttribute("x",e.x.toFixed(2));o.setAttribute("y",e.y.toFixed(2));o.setAttribute("width",i.toFixed(2));o.setAttribute("height",r.toFixed(2));var h=document.createElement("div");h.setAttribute("style","height:100%;overflow-x:hidden;overflow-y:scroll;");var l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("width",i.toFixed(2));l.setAttribute("height",n.toFixed(2));l.appendChild(a);h.appendChild(l);o.appendChild(h);s.appendChild(o)};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"}(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});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._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);t.beginRender();t.cssPriority=!0;if(o){this._rectChart=new Rect(0,0,s,a);this._prepareRender();if(r){var h=t.stroke,l=t.fill;t.fill=r;t.stroke=null;t.drawRect(0,0,s,a);t.fill=l;t.stroke=h}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)}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?h=this._getLegendSize(s,h):l=this._getLegendSize(a,l);if(i=n._getDesiredSize(t,o,h,l)){o==Position.Left||o==Position.Right?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.Left:e.left+=i.width;s-=i.width;r=new Point(0,e.top+.5*(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.Bottom:a-=i.height;r=new Point(.5*(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;i._clearTimeouts();if(!i.isDisabled){t||i._tooltip.hide();if(r>0)i._toShow=setTimeout((function(){i._tooltip.show(i.hostElement,t,e);i._tooltip.hideDelay>0&&(i._toHide=setTimeout((function(){i._tooltip.hide()}),i._tooltip.hideDelay))}),r);else{i._tooltip.show(i.hostElement,t,e);i._tooltip.hideDelay>0&&(i._toHide=setTimeout((function(){i._tooltip.hide()}),i._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._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="wj-legend";FlexChartBase._CSS_HEADER="wj-header";FlexChartBase._CSS_FOOTER="wj-footer";FlexChartBase._CSS_TITLE="wj-title";FlexChartBase._CSS_LABEL="wj-label";FlexChartBase._CSS_SELECTION="wj-state-selected";FlexChartBase._CSS_PLOT_AREA="wj-plot-area";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,o,h=atob(t),l=[];for(s=0;s<h.length;s+=512){a=h.slice(s,s+512);for(var _=new Array(a.length),u=0;u<a.length;u++)_[u]=a.charCodeAt(u);var c=new Uint8Array(_);l.push(c)}o=new Blob(l,{type:n});navigator.msSaveOrOpenBlob(o,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(),y=0,x=0;if(m){y=e._parsePx(m.width);x=e._parsePx(m.height)}0==y&&(y=FlexChartBase._WIDTH);0==x&&(x=FlexChartBase._HEIGHT);a=n=y;o=s=x;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+=".wj-flexchart{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){f.removeChild(t)}));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()}this.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=this.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=this.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);u.setAttribute("height",s);u.setAttribute("viewBox","0 0 "+a+" "+o);_.appendChild(u);var m=e._currentRenderEngine.canvas;if(m){var y=document.createElementNS("http://www.w3.org/2000/svg","image");y.setAttribute("width",m.width);y.setAttribute("height",m.height);y.setAttribute("href",m.toDataURL());u.insertBefore(y,u.firstChild);e.invalidate()}this.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=this,i=t.cloneNode();Array.from(t.childNodes).forEach((function(t){var r=e.cloneWithComputedStyles(t);1===t.nodeType&&("text"===t.nodeName?e.computeAttributes(t,r,e.textAttrs):"line"===t.nodeName&&e.computeAttributes(t,r,e.lineAttrs));i.appendChild(r)}));return i};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){return s=s.replace(t,t.replace(":","\\:"))}))}try{r=".wj-flexchart"==s||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+=".wj-flexchart{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("wj-control wj-flexchart",null,null);var n=r;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()}));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();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()}));r._keywords=new _KeyWords;r.hostElement.addEventListener("click",(function(t){var e=n._tooltip;e.content&&n.isTouching&&n._updateTooltip(e,t)}));r.hostElement.addEventListener("mousemove",(function(t){var e=n._tooltip;e.content&&!n.isTouching&&n._updateTooltip(e,t)}));r.hostElement.addEventListener("mouseleave",(function(t){n._hideToolTip()}));r.hostElement.addEventListener("click",(function(t){if(n.selectionMode!=SelectionMode.None){var e=n._hitTestData(t),i=FlexChartCore._SELECTION_THRESHOLD;n.tooltip&&n.tooltip.threshold&&(i=n.tooltip.threshold);e.distance<=i&&e.series?n._select(e.series,e.pointIndex):n.selectionMode==SelectionMode.Series&&(e=n.hitTest(t)).chartElement==ChartElement.Legend&&e.series?n._select(e.series,null):n._select(null,null)}if(!0===n.legendToggle&&(e=n.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);n.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){var e=this._axisX=asType(t,Axis);this.beginUpdate();if(e){void 0===e.majorGrid&&(e.majorGrid=!1);void 0===e.name&&(e.name="axisX");null==e.position&&(e.position=Position.Bottom);e._axisType=AxisType.X;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){var e=this._axisY=asType(t,Axis);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);null==e.position&&(e.position=Position.Left);e._axisType=AxisType.Y;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;null!==(n=this.legend._hitTest(i))&&n>=0&&n<this.series.length&&r._setData(this.series[n])}else if(FlexChartCore._contains(this._rectChart,i)){var s=this._hitTestLabels(i);if(s){r._chartElement=ChartElement.DataLabel;r._dist=0;r._setDataPoint(s.tag)}else{for(var a=this._hitTester.hitTest(i),o=null,h=null,l=this.series.length-1;l>=0;l--)if(this.series[l].hitTest!==Series.prototype.hitTest){var _=this.series[l].hitTest(t);if(_){if(!o||_.distance<o.distance){o=_;h=l}if(0===_.distance)break}}if(a&&a.area)if(o&&o.distance<a.distance)r=o;else if(o&&o.distance==a.distance&&h>a.area.tag.seriesIndex)r=o;else{r._setDataPoint(a.area.tag);r._dist=a.distance}else o&&(r=o);var u=!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("");u=!0;return!0}}));u||(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){return 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;(g=this._getPlotter(null)).stacking=this._stacking;if(this._curPlotter!=g){this._curPlotter&&this._curPlotter.unload();this._curPlotter=g}g.load();var s=this._isRotated();this._dataInfo.analyse(this._series,s,g.stacking,this._xvals.length>0?this._xvals:null,this.axisX._getLogBase()>0,this.axisY._getLogBase()>0);var a=g.adjustLimits(this._dataInfo,e.clone());if(s){var o=this._dataInfo.getDataTypeX();o||(o=this._xDataType);this.axisX._updateActualLimits(this._dataInfo.getDataTypeY(),a.left,a.right);this.axisY._updateActualLimits(o,a.top,a.bottom,this._xlabels,this._xvals)}else{var h=this._dataInfo.getDataTypeX();h||(h=this._xDataType);this.axisX._updateActualLimits(h,a.left,a.right,this._xlabels,this._xvals);this.axisY._updateActualLimits(this._dataInfo.getDataTypeY(),a.top,a.bottom)}var l=this._getAxes();this._updateAuxAxes(l,s);this._layout(e,n,t);t.startGroup(FlexChartCore._CSS_PLOT_AREA);t.fill="transparent";t.stroke=null;if(this.plotAreas.length>0)for(var _=0;_<this.plotAreas.length;_++){this.plotAreas[_]._render(t)}else{var u=this._plotRect;t.drawRect(u.left,u.top,u.width,u.height)}t.endGroup();var c=this._series.length;this._clearPlotters();var p={};for(_=0;_<c;_++){var f=this._series[_];if(((v=f.visibility)==SeriesVisibility.Visible||v==SeriesVisibility.Plot)&&f.getValues(0)){var d=f._getAxisY(),g=this._getPlotter(f);if(!d||d==this.axisY||g instanceof _BarPlotter)g.seriesCount++;else{var m=d._uniqueId;p[m]?p[m].count+=1:p[m]={count:1,index:0}}}}this.onRendering(new RenderEventArgs(t));if(this._getChartType()!==ChartType.Funnel)for(_=0;_<l.length;_++){var y=l[_];b=y.axisType==AxisType.X?t.startGroup(FlexChartCore._CSS_AXIS_X,this._chartRectId):t.startGroup(FlexChartCore._CSS_AXIS_Y,this._chartRectId);y._hostElement=i?b:y._hostElement;y._render(t);t.endGroup()}t.startGroup("wj-series-group");this._plotrectId="plotRect"+(1e6*Math.random()).toFixed();t.addClipRect(this._plotRect,this._plotrectId);for(_=0;_<c;_++){var x=this._series[_];x._pointIndexes=[];g=this._getPlotter(x);x._plotter=g;var b=t.startGroup(x.cssClass,g.clipping?this._plotrectId:null);x._hostElement=i?b:x._hostElement;var v=x.visibility,S=x.axisX,C=x.axisY;S||(S=this.axisX);C||(C=this.axisY);if(v==SeriesVisibility.Visible||v==SeriesVisibility.Plot){var P,w,A=p[C._uniqueId];if(!A||g instanceof _BarPlotter){P=g.seriesIndex;w=g.seriesCount;g.seriesIndex++;x.onRendering(t,P,w)||g.plotSeries(t,S,C,x,this,P,w)}else{P=A.index;w=A.count;A.index++;x.onRendering(t,P,w)||g.plotSeries(t,S,C,x,this,P,w)}x.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?18:0,h=0,l=0;this._colRowLens=[];for(var _=0;_<a;_++){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(h+d.height>r&&!this.legend.scrollbar){n.height=r;this._colRowLens.push(l);l=0;h=0}l<d.width&&(l=d.width);h+=d.height}else{if(l+d.width>i-o){n.width=i;this._colRowLens.push(h);h=0;l=0}h<d.height&&(h=d.height);l+=d.width}}}if(e){n.height<h&&(n.height=h);this._colRowLens.push(l);n.width=this._colRowLens.reduce((function(t,e){return t+e}),0)}else{n.width<l&&(n.width=l);this._colRowLens.push(h);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(){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};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){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,"wj-data-label").height}for(var d=this._getAxes(),g=this.axisY._getHeight(i,n),m=0;m<d.length;m++){var y=(A=d[m]).origin,x=A._getPosition();if(A.axisType==AxisType.X){(C=A._getHeight(i,Math.max(10,r-g)))>s.height&&(C=s.height);A._desiredSize=new Size(s.width,C);var b=A._hasOrigin=isNumber(y)&&y>this.axisY._getMinNum()&&y<this.axisY._getMaxNum(),v=Math.min(.25*r,A._annoSize.width);if(x==Position.Bottom){o=Math.max(o,.5*v);l=Math.min(l,r-.5*v);if(b){var S=this._convertY(y,c,f);f-=Math.max(0,S+C-f)}else f-=C}else if(x==Position.Top){o=Math.max(o,.5*v);l=Math.min(l,r-.5*v);if(b){S=this._convertY(y,c,f);c+=Math.max(0,c-(S-C))}else c+=C}}else if(A.axisType==AxisType.Y){var C;(C=A===this.axisX?g:A._getHeight(i,n))>a.height&&(C=a.height);A._desiredSize=new Size(a.width,C);b=A._hasOrigin=isNumber(y)&&y>this.axisX._getMinNum()&&y<this.axisX._getMaxNum();if(x==Position.Left){if(A._actualAngle<0)_=Math.min(_,n-A._annoSize.height);else if(A._actualAngle>0)h=Math.max(h,A._annoSize.height);else{h=Math.max(h,A._annoSize.height);_=Math.min(_,n-A._annoSize.height)}if(b){var P=this._convertX(y,u,p);u+=Math.max(0,u-(P-C))}else u+=C}else if(x==Position.Right){if(A._actualAngle>0)_=Math.min(_,n-A._annoSize.height);else if(A._actualAngle<0)h=Math.max(h,A._annoSize.height);else{h=Math.max(h,A._annoSize.height);_=Math.min(_,n-A._annoSize.height)}if(b){P=this._convertX(y,u,p);p-=Math.max(0,P+C-p)}else p-=C}}}var w=this._parseMargin(this.plotMargin);o=u=isNaN(w.left)?Math.max(o,u)+t.left:w.left;l=p=isNaN(w.right)?Math.min(l,p)+t.left:e.width-w.right;h=c=isNaN(w.top)?Math.max(h,c)+t.top:w.top;_=f=isNaN(w.bottom)?Math.min(_,f)+t.top:e.height-w.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 A;y=(A=d[m]).origin,x=A._getPosition();if(A.axisType==AxisType.X){var M;if(A._hasOrigin){S=this._convertY(y,this._plotRect.top,this._plotRect.bottom);if(x==Position.Bottom){M=new Rect(o,S,r,A._desiredSize.height);f+=Math.max(0,M.bottom-this._plotRect.bottom)}else if(x==Position.Top){M=new Rect(o,S-A._desiredSize.height,r,A._desiredSize.height);c-=Math.max(0,this._plotRect.top-M.top)}else M=new Rect(o,S,r,1)}else if(x==Position.Bottom){M=new Rect(o,f,r,A._desiredSize.height);f+=A._desiredSize.height}else if(x==Position.Top){M=new Rect(o,c-A._desiredSize.height,r,A._desiredSize.height);c-=A._desiredSize.height}else M=new Rect(o,c,r,1);A._layout(M,this._plotRect)}else if(A.axisType==AxisType.Y){var T;if(A._hasOrigin){P=this._convertX(y,this._plotRect.left,this._plotRect.right);if(x==Position.Left){T=new Rect(P-A._desiredSize.height,h,n,A._desiredSize.height);u-=A._desiredSize.height}else if(x==Position.Right){T=new Rect(P,h,n,A._desiredSize.height);p+=A._desiredSize.height}else T=new Rect(P,h,n,1)}else if(x==Position.Left){T=new Rect(u-A._desiredSize.height,h,n,A._desiredSize.height);u-=A._desiredSize.height}else if(x==Position.Right){T=new Rect(p,h,n,A._desiredSize.height);p+=A._desiredSize.height}else T=new Rect(u,h,n,1);A._layout(T,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,y=r,x=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));(R=P._getPosition())==Position.Bottom?E.bottom-=S.height:R==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));(R=P._getPosition())==Position.Left?E.left+=w.height:R==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=y=Math.min(y,T);M=m=Math.max(m,M);L=x=Math.min(x,L);this._plotRect=new Rect(g,m,y-g,x-m);var k=this._plotRect.clone(),F=g,I=this.plotAreas._calculateWidths(this._plotRect.width,c);for(b=0;b<c;b++){L=x;M=m;E=s[b];var N=I[b];for(l=0;l<E.axes.length;l++){var D,R=(P=E.axes[l])._getPosition(),B=new Rect(F,k.top,N,k.height);if(R==Position.Bottom){D=new Rect(F,L,N,P._desiredSize.height);L+=P._desiredSize.height}else if(R==Position.Top){D=new Rect(F,M-P._desiredSize.height,N,P._desiredSize.height);M-=P._desiredSize.height}P._layout(D,B)}for(l=0;l<this.plotAreas.length;l++){(G=this.plotAreas[l]).column==b&&G._setPlotX(F,N)}F+=N}var O=m,V=this.plotAreas._calculateHeights(this._plotRect.height,p);for(C=0;C<p;C++){A=g;T=y;E=a[C];var j=V[C];for(l=0;l<E.axes.length;l++){var H;R=(P=E.axes[l])._getPosition(),B=new Rect(k.left,O,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(R==Position.Left){H=new Rect(A-P._desiredSize.height,O,j,P._desiredSize.height);A-=P._desiredSize.height}else if(R==Position.Right){H=new Rect(T,O,j,P._desiredSize.height);T+=P._desiredSize.height}P._layout(H,B)}for(l=0;l<this.plotAreas.length;l++){var G;(G=this.plotAreas[l]).row==C&&G._setPlotY(O,j)}O+=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};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)}i?this._showToolTip(i,new Rect(e.clientX,e.clientY,5,5)):this._hideToolTip()};FlexChartCore.prototype._updateAuxAxes=function(t,e){for(var i=2;i<t.length;i++){var r=t[i];r._chart=this;for(var n,s,a=[],o=0;o<this.series.length;o++){var h=this.series[o];h.axisX!=r&&h.axisY!=r||a.push(h)}for(o=0;o<a.length;o++){var l=a[o].getDataRect()||a[o]._getDataRect();if(l)if(r.axisType==AxisType.X&&!e||r.axisType==AxisType.Y&&e){(void 0===n||l.left<n)&&(n=l.left);(void 0===s||l.right>s)&&(s=l.right)}else{(void 0===n||l.top<n)&&(n=l.top);(void 0===s||l.bottom>s)&&(s=l.bottom)}}var _=a[0].getDataType(0);null==_&&(_=DataType.Number);t[i]._updateActualLimits(_,n,s)}};FlexChartCore._CSS_AXIS_X="wj-axis-x";FlexChartCore._CSS_AXIS_Y="wj-axis-y";FlexChartCore._CSS_LINE="wj-line";FlexChartCore._CSS_GRIDLINE="wj-gridline";FlexChartCore._CSS_TICK="wj-tick";FlexChartCore._CSS_GRIDLINE_MINOR="wj-gridline-minor";FlexChartCore._CSS_TICK_MINOR="wj-tick-minor";FlexChartCore._CSS_DATA_LABELS="wj-data-labels";return FlexChartCore}(FlexChartBase);export{FlexChartCore};var _AreaDef=function(){function _AreaDef(){this._axes=new Array;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 _=r.length,u=0;u<_;u++){var c=r[u];(isNaN(this.minX)||this.minX>c)&&(this.minX=c);(isNaN(this.maxX)||this.maxX<c)&&(this.maxX=c);c>0&&(isNaN(this.minXp)||this.minXp>c)&&(this.minXp=c);if(u>0){var p=Math.abs(c-r[u-1]);!isNaN(p)&&(p<this.dx||0==this.dx)&&(this.dx=p)}}var f,d,g,m,y,x,b,v,S,C,P,_loop_1=function(){f=t[u];d=f._getChartType();g=void 0!==f.chartType;if((m=f.visibility)==SeriesVisibility.Hidden||m==SeriesVisibility.Legend)return"continue";if(y=f.getDataRect()){if(!isNaN(w.minX)&&w.minX<y.left){x=y.right;y.left=w.minX;y.width=x-w.minX}!isNaN(w.maxX)&&w.maxX>y.right&&(y.width=w.maxX-y.left);if(!f._isCustomAxisY()){if(!isNaN(w.minY)&&w.minY<y.top){x=y.bottom;y.top=w.minY;y.height=x-w.minY}!isNaN(w.maxY)&&w.maxY>y.bottom&&(y.height=w.maxY-y.top)}}b=null;e?f._isCustomAxisY()||(b=f.getValues(1)):f._isCustomAxisX()||(b=f.getValues(1));if(b){w.dataTypeX||(w.dataTypeX=f.getDataType(1));for(var n=0;n<b.length;n++){v=b[n];if(isFinite(v)){(isNaN(w.minX)||w.minX>v)&&(w.minX=v);(isNaN(w.maxX)||w.maxX<v)&&(w.maxX=v);if(n>0&&(!d||d==ChartType.Column||d==ChartType.Bar)){p=Math.abs(v-b[n-1]);!isNaN(p)&&p>0&&(p<w.dx||0==w.dx)&&(w.dx=p)}}}}S=null,C=!1;if(e){C=f._isCustomAxisX();S=f.getValues(0)}else{C=f._isCustomAxisY();S=f.getValues(0)}if(S){w.dataTypeY||C||(w.dataTypeY=f.getDataType(0));isNaN(w.minX)?w.minX=0:b||r||(w.minX=Math.min(w.minX,0));isNaN(w.maxX)?w.maxX=S.length-1:b||r||(w.maxX=Math.max(w.maxX,S.length-1));if(!C)for(var s=i==Stacking.None||g,_loop_2=function(t){var e=S[t],i=b?asNumber(b[t],!0):r?asNumber(r[t],!0):t;isArray(e)?e.forEach((function(t){a._parseYVal(t,i,s,l,o,h)})):w._parseYVal(e,i,s,l,o,h)},_=0;_<S.length;_++)_loop_2(_)}if(P=f.getDataRect(new Rect(w.minX,w.minY,w.maxX-w.minX,w.maxY-w.minY),y)){w.minX=P.left;w.maxX=P.right;if(!C){w.minY=P.top;w.maxY=P.bottom}}},w=this;for(u=0;u<t.length;u++)_loop_1();if(i==Stacking.Stacked){for(var A in o)o[A]>this.maxY&&(this.maxY=o[A]);for(var A in h)h[A]<this.minY&&(this.minY=h[A])}else if(i==Stacking.Stacked100pc){this.minY=0;this.maxY=0;for(var A in l){var M=l[A];if(isFinite(M)&&0!=M){var T=o[A],L=h[A];isFinite(T)&&(T=Math.max(T/M,this.maxY))>this.maxY&&(this.maxY=T);isFinite(L)&&(L=Math.min(L/M,this.minY))<this.minY&&(this.minY=L)}}if(this.minY==this.maxY){this.minY=0;this.maxY=1}}this.stackAbs=l;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};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._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++;this._position=t;t==Position.Bottom||t==Position.Top?this._axisType=AxisType.X: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){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){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){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._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._actualMax-this._actualMin),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{var 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 y=0;if(this.labels){y=2*(this._labelPadding||5);this._axisType==AxisType.X?y+=this._annoSize.height:y+=this._annoSize.width+this._TICK_LABEL_DISTANCE+2}var x=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&&(y+=.5*(1+b)*x);if(this._title){_=this._title;this._szTitle=t.measureString(_,r,this._groupClass);y+=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();y+=this._groupsPanel.getHeight(t)}t.fontSize=null;return y};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._chart&&this._chart._stacking!==Stacking.Stacked100pc;_||(_=this._chart._isRotated()?this.axisType==AxisType.Y:this.axisType==AxisType.X);var u=this._actualMin=null!=h&&_?h:e;if(u==(this._actualMax=null!=l&&_?l:i))if(void 0!==h&&void 0===l)this._actualMax+=1;else if(void 0===h&&void 0!==l)this._actualMin-=1;else if(0===u)this._actualMax=1;else{var c=Math.abs(u);if(c<1){this._actualMin-=c;this._actualMax+=c}else{this._actualMin-=1;this._actualMax+=1}}if(this._getLogBase()>0){var p=this.logBase,f=Math.log(p);if(!this._max){var d=Math.ceil(Math.log(this._actualMax)/f);this._actualMax=Math.pow(p,d)}if(!this._min){var g=Math.floor(Math.log(this._actualMin)/f);this._actualMin=Math.pow(p,g)}(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,y="value",x="text";if(this.binding){var b=this.binding.split(",");if(2==b.length){y=b[0];x=b[1]}}for(var v=0;v<m;v++){var S=this._items[v],C=S[y];if(isNumber(C)){this._values.push(C);this._lbls.push(S[x])}else if(isDate(C)){this._values.push(C.getTime());this._lbls.push(S[x])}}}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._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=this._actualMax-this._actualMin;if(isNumber(r)){var n=this._calcMajorUnit();0==n&&(n=.1*this._niceTickNumber(r));var s=Math.min(Axis.MAX_MAJOR,Math.floor(r/n)+1),a=[],o=[];this._rects=[];this._vals.major=a;this._vals.hasLbls=[];var h=Math.floor(this._actualMin/n)*n;h<this._actualMin&&(h+=n);var l=!1;if(this._lbls&&this._lbls.length>0){o=this._lbls;if(0==this._values.length){l=!0;for(var _=0;_<o.length;_++)a.push(_)}else a=this._values}else if(this._isTimeAxis){this._createTimeLabels(h,s,a,o);this._addMinMaxLabels(a,o)}else if(this._getLogBase()){this._createLogarithmicLabels(this._actualMin,this._actualMax,this.majorUnit,a,o,!0);this._addMinMaxLabels(a,o)}else{this._createLabels(h,s,n,a,o);this._addMinMaxLabels(a,o)}s=Math.min(a.length,o.length);t.textFill=i;var u=this._TICK_HEIGHT,c=this._TICK_OVERLAP,p=this.majorTickMarks;null==p&&(p=TickMark.Outside);p==TickMark.Outside?c=1:p==TickMark.Inside?c=-1:p==TickMark.Cross&&(c=0);var f=.5*(c-1)*u,d=.5*(1+c)*u;for(_=0;_<s;_++){var g=!0,m=a[_],y=o[_],x=this.labels;x&&(l||this.itemsSource)&&this.majorUnit&&_%this.majorUnit!=0&&(x=!1);if(m>=this._actualMin&&m<=this._actualMax){var b=t.textFill;g=this._renderLabelsAndTicks(t,_,m,y,e,p,x,f,d);t.textFill=b}this._vals.hasLbls.push(g);g&&this.axisLabels.push(y)}}(this.minorGrid||this.minorTickMarks!=TickMark.None)&&this._renderMinor(t,a,l);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._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;if(this._getLogBase()){if(this.minorUnit>0){var a=[];this._createLogarithmicLabels(this._actualMin,this._actualMax,this.minorUnit,a,null,!1);for(var o=[],h=0;h<a.length;h++){var l=a[h];-1==e.indexOf(l)&&l>this._actualMin&&o.push(l)}this._renderMinors(t,o,n,s)}}else 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,y=FlexChartCore._CSS_TICK,x=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=x;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,y)}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,y)}}else{var w=this.convert(i);if(S&&a){t.stroke=x;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,y)}}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,y)}}}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){for(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,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)?o.push(h):n&&this.majorUnit&&h%this.majorUnit!=0&&o.push(h);this._renderMinors(t,o,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,y=FlexChartCore._CSS_TICK_MINOR,x=0;x<c;x++)if(e[x]>=this.actualMin&&e[x]<=this.actualMax)if(i){var b=this.convert(e[x]);if(l){t.stroke=o;t.strokeWidth=s;r?t.drawLine(this._axrect.right-_,b,this._axrect.right-u,b,y):t.drawLine(this._axrect.left+_,b,this._axrect.left+u,b,y)}if(p){t.stroke=g;t.strokeWidth=d;t.drawLine(f.left,b,f.right,b,m)}}else{var v=this.convert(e[x]);if(l){t.stroke=o;t.strokeWidth=s;r?t.drawLine(v,this._axrect.top+_,v,this._axrect.top+u,y):t.drawLine(v,this._axrect.bottom-_,v,this._axrect.bottom-u,y)}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),y=this._rects;if(this.overlappingLabels==OverlappingLabels.Auto)for(var x=y.length,b=0;b<x;b++)if(FlexChartCore._intersects(y[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)){e.splice(0,0,this._formatValue(i));t.splice(0,0,i)}}if(this.labelMax){var r=this.actualMax;if(isFinite(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._actualMax-this._actualMin,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),y=0;y*_<a-1;y++){if((x=m*(1+y*_))>=t&&x<=e)if(0==y){r.unshift(x);n&&n.unshift(this._formatValue(x))}else{r.push(x);n&&n.push(this._formatValue(x))}}else{var x;if((x=Math.pow(_,g))>=t&&x<=e){r.push(x);n&&n.push(this._formatValue(x))}}};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 y=g;y<=o&&m;y.setFullYear(y.getFullYear()+m)){var x=y.valueOf();i.push(x);r.push(this._formatValue(x))}}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(y=g;y<=o;y.setMonth(y.getMonth()+b)){x=y.valueOf();i.push(x);r.push(this._formatValue(x))}}else{var v=1e3*p/_timeSpan.TicksPerSecond,S=(y=g,a.getTime()-y.getTime());S>v&&(y=new Date(y.getTime()+Math.floor(S/v)*v));for(;y<=o&&v;y=new Date(y.getTime()+v)){if((x=y.valueOf()+S)>=a.valueOf()){i.push(x);r.push(this._formatValue(x))}}}};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._actualMax-this._actualMin,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))}return t};Axis.prototype._getAnnoNumber=function(t){var e=t?this._annoSizeBase.height:this._annoSize.width,i=t?this._axrect.height: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.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=this.tround(n.second,r,i);return n.getTimeAsDouble()}n.second=0;if(r<_tmInc.hour){r/=_tmInc.minute;n.minute=this.tround(n.minute,r,i);return n.getTimeAsDouble()}n.minute=0;if(r<_tmInc.day){r/=_tmInc.hour;n.hour=this.tround(n.hour,r,i);return n.getTimeAsDouble()}n.hour=0;if(r<_tmInc.month){r/=_tmInc.day;n.day=this.tround(n.day,r,i);return n.getTimeAsDouble()}n.day=1;if(r<_tmInc.year){r/=_tmInc.month;1!=n.month&&(n.month=this.tround(n.month,r,i));return n.getTimeAsDouble()}n.month=1;r/=_tmInc.year;n.year=this.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};_timeHelper.secInYear=86400;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){return 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){return 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){return r+=e._margin+i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass).height})):this.groups.forEach((function(i){return r+=e._margin+i.getSize(t,FlexChartCore._CSS_LABEL,e._axis._groupClass).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 _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]=new Array)};_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;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){var e=this._axisX._chart=this._chart;e&&-1==e.axes.indexOf(this._axisX)&&e.axes.push(this._axisX)}this._invalidate()}},enumerable:!0,configurable:!0});Object.defineProperty(SeriesBase.prototype,"axisY",{get:function(){return this._axisY},set:function(t){if(t!=this._axisY){this._axisY=asType(t,Axis,!0);if(this._axisY){var e=this._axisY._chart=this._chart;e&&-1==e.axes.indexOf(this._axisY)&&e.axes.push(this._axisY)}this._invalidate()}},enumerable:!0,configurable:!0});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;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));return this._cache[t]=i.values};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];isFinite(h)&&(isNaN(r)?r=s=h:h<r?r=h:h>s&&(s=h));if(e){var l=e[o];isFinite(l)&&(isNaN(i)?i=n=l:l<i?i=l:h>s&&(n=l))}}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;SeriesBase._DEFAULT_SYM_SIZE=10;return SeriesBase}();export{SeriesBase};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("wj-control wj-flexchart wj-flexpie",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;var n=r;r.hostElement.addEventListener("mousemove",(function(t){var e=n._tooltip;if(e.content&&!n.isTouching){var i=n.hitTest(t);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()}}));r.hostElement.addEventListener("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)).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()}}}));r.hostElement.addEventListener("mouseleave",(function(t){n._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){var i=this._toControl(t,e),r=new HitTestInfo(this,i),n=null;if(FlexChartBase._contains(this._rectHeader,i))r._chartElement=ChartElement.Header;else if(FlexChartBase._contains(this._rectFooter,i))r._chartElement=ChartElement.Footer;else if(FlexChartBase._contains(this._rectLegend,i)){r._chartElement=ChartElement.Legend;null!==(n=this.legend._hitTest(i))&&n>=0&&n<this._areas.length&&r._setData(null,n)}else if(FlexChartBase._contains(this._rectChart,i)){for(var s,a=this._areas.length,o=NaN,h=0;h<a;h++){var l=i.clone(),_=this._areas[h],u=this._rotationAngles[_.gi];if(0!=u){var c=this._centers[_.gi],p=c.x,f=c.y,d=-p+l.x,g=-f+l.y,m=Math.sqrt(d*d+g*g),y=Math.atan2(g,d)-u*Math.PI/180;l.x=p+m*Math.cos(y);l.y=f+m*Math.sin(y)}if(h==this._selectedIndex){l.x-=this._selectedOffset.x;l.y-=this._selectedOffset.y}var x=this._areas[h];if(x.contains(l)){r._setDataGroup(_.gi,x.tag);r._dist=0;if(h!=this._selectedIndex)break}var b=x.distance(l);if(void 0!==b&&(isNaN(o)||b<o)){o=b;s=x}}if(0!==r._dist&&null!=s){r._setDataGroup(s.gi,s.tag);r._dist=o}r._chartElement=ChartElement.ChartArea}else r._chartElement=ChartElement.None;return r};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("wj-slice-group",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 y=0;y<s;y++)f.push(new Rect(e.left+n*y+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,l=this.legend.scrollbar?18:0;this._colRowLens=[];for(var _=0;_<a;_++){var u=this._measureLegendItem(t,s[_]);if(e){if(h+u.height>r&&!this.legend.scrollbar){n.height=r;this._colRowLens.push(o);o=0;h=0}o<u.width&&(o=u.width);h+=u.height}else{if(o+u.width>i-l){n.width=i;this._colRowLens.push(h);h=0;o=0}h<u.height&&(h=u.height);o+=u.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.top+a.height+1&&!this.legend.scrollbar){_.x+=this._colRowLens[l];l++;_.y=e.y}}else if(_.x+c.width>a.right){_.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 y=1===p?360:359.9/360;for(m=0;m<c;m++){_=g.x;u=g.y;l=t.startGroup("wj-slice");t.fill=this._getColorLight(m);t.stroke=this._getColor(m);var x=Math.abs(e[m]),b=Math.abs(x-i)<1e-10?o:o*x/i;b=Math.min(b,o*y);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=this._areas.length,i=this.dataLabel,r=i.position,n="wj-data-label",s=this._rotationAngles,a=i.connectingLine,o=i.offset?i.offset:0;t.stroke="null";t.fill="transparent";t.strokeWidth=1;t.startGroup("wj-data-labels");for(var h=0;h<e;h++){var l=this._areas[h];if(l){var _=l.radius,u=l.langle+s[l.gi],c=1,p=1;if(r==PieLabelPosition.Center||r===PieLabelPosition.Radial||r===PieLabelPosition.Circular)_*=.5*(1+(l.innerRadius||0)/l.radius);else{if((u=_Math.clampAngle(u))<=-170||u>=170){c=2;p=1}else if(u>=-100&&u<=-80){c=1;p=2}else if(u>=-10&&u<=10){c=0;p=1}else if(u>=80&&u<=100){c=1;p=0}else if(-180<u&&u<-90){c=2;p=2}else if(-90<=u&&u<0){c=0;p=2}else if(0<u&&u<90){c=0;p=0}else if(90<u&&u<180){c=2;p=0}if(r==PieLabelPosition.Inside){c=2-c;p=2-p}}u*=Math.PI/180;var f=l.gi?h-l.gi*this._values[0].length:h,d=this._getSelectedItemOffset(f,u),g=d.x,m=d.y,y=_;r==PieLabelPosition.Outside?y+=o:r==PieLabelPosition.Inside&&(y-=o);var x=l.center.x,b=l.center.y,v=this._centers[l.gi],S=x-v.x,C=b-v.y;if(0!=this._rotationAngles[l.gi]){var P=Math.sqrt(S*S+C*C),w=Math.atan2(C,S)+this._rotationAngles[l.gi]*Math.PI/180;x=v.x+P*Math.cos(w);b=v.y+P*Math.sin(w)}var A=new Point(x+g+y*Math.cos(u),b+m+y*Math.sin(u));if(i.border&&r!=PieLabelPosition.Center){0==c?A.x+=2:2==c&&(A.x-=2);0==p?A.y+=2:2==p&&(A.y-=2)}var M=new HitTestInfo(this,A);M._setDataGroup(l.gi,l.tag);var T=this._getLabelContent(M,i.content),L=new DataLabelRenderEventArgs(t,M,A,T);if(i.onRendering)if(i.onRendering(L)){T=L.text;A=L.point}else T=null;if(T){var E,k=180*Math.atan2(b-A.y,x-A.x)/Math.PI;k=(k+360)%360;if(r===PieLabelPosition.Radial||r===PieLabelPosition.Circular){if(r===PieLabelPosition.Radial)k>90&&k<270&&(k+=180);else{k>180&&k<360&&(k+=180);k-=90}(E=FlexChartBase._renderRotatedText(t,T,A,c,p,A,k,n).getBBox()).left=E.x;E.top=E.y}else E=FlexChartBase._renderText(t,T,A,c,p,n);i.border&&t.drawRect(E.left-2,E.top-2,E.width+4,E.height+4,"wj-data-label-border");if(a){var F=new Point(x+g+_*Math.cos(u),b+m+_*Math.sin(u));t.drawLine(A.x,A.y,F.x,F.y,"wj-data-label-line")}}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){var _=this._selectedOffset.x=Math.cos(a)*l*this._radius,u=this._selectedOffset.y=Math.sin(a)*l*this._radius;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=i._pieGroups;i._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="wj-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);return this._isFull||Math.abs(s)<=this._sweep?Math.sqrt(r)-this._radius:void 0};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};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};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,r=t.chart.hostElement,n=this._markers,s=r.getAttribute("data-markerIndex");if(null!=s)if((i=n[s])&&isArray(i))i.push(t);else{n[s]=[t];this._bindMoveEvent(r)}else{e=n.length,i=[t];n.push(i);r.setAttribute("data-markerIndex",e);this._bindMoveEvent(r)}};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="wj-chart-linemarker";LineMarker._CSS_MARKER_HLINE="wj-chart-linemarker-hline";LineMarker._CSS_MARKER_VLINE="wj-chart-linemarker-vline";LineMarker._CSS_MARKER_CONTENT="wj-chart-linemarker-content";LineMarker._CSS_MARKER_CONTAINER="wj-chart-linemarker-container";LineMarker._CSS_LINE_DRAGGABLE="wj-chart-linemarker-draggable";LineMarker._CSS_TOUCH_DISABLED="wj-flexchart-touch-disabled";return LineMarker}();export{LineMarker};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=null==n.position?LabelPosition.Top:n.position,l=n.border,_=n.connectingLine,u=new HitTestInfo(r,p);u._setDataPoint(i);var c=r._getLabelContent(u,n.content),p=this._getLabelPoint(s,i);this._getPointAndPosition(p,h,e,r);if(r._plotRect.contains(p)){var f=new DataLabelRenderEventArgs(t,u,p,c);if(n.onRendering)if(n.onRendering(f)){c=f.text;p=f.point}else c=null;if(c){var d=this._renderLabelAndBorder(t,c,h,a,p,_,2,l);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="wj-data-label",_="wj-data-label-line",u=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,u);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,u);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,u);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,u);break;case LabelPosition.Center:h=FlexChartCore._renderText(t,e,n,1,1,l,u)}o&&h&&t.drawRect(h.left-a,h.top-a,h.width+2*a,h.height+2*a,"wj-data-label-border");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 _AreaPlotter=function(t){__extends(_AreaPlotter,t);function _AreaPlotter(){var e=t.call(this)||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=new Array,g=new Array,m=new Array,y=new Array,x=this.stacking!=Stacking.None&&!h._isCustomAxisY(),b=this.stacking==Stacking.Stacked100pc&&!h._isCustomAxisY();void 0!==h._getChartType()&&(x=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);if(_DataInfo.isValid(T,L)){var E=v?i.convert(T):e.convert(T);if(x){if(b){L/=this.dataInfo.getStackedAbsSum(T)}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));y.push(E)}else{m.push(E);k<i.actualMin&&(k=i.actualMin);y.push(i.convert(k))}}if(v){var F=e.convert(L);if(isNaN(E)||isNaN(F)){S=!0;if(!x&&!0!==C){d.push(void 0);g.push(void 0)}}else{d.push(F);g.push(E);if(FlexChartCore._contains(A,new Point(F,E))){(I=new _CircleArea(new Point(F,E),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(_,M,L,T);this.hitTester.add(I,_)}}}else{F=i.convert(L);if(isNaN(E)||isNaN(F)){S=!0;if(!x&&!0!==C){d.push(void 0);g.push(void 0)}}else{d.push(E);g.push(F);if(FlexChartCore._contains(A,new Point(E,F))){var I;(I=new _CircleArea(new Point(E,F),this._DEFAULT_SYM_SIZE)).tag=new _DataPoint(_,M,T,L);this.hitTester.add(I,_)}}}}else{S=!0;if(!x&&!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 N=this._DEFAULT_WIDTH,D=n._getColorLight(_),R=n._getColor(_),B=_BasePlotter.cloneStyle(r.style,["fill"]),O=_BasePlotter.cloneStyle(r.style,["stroke"]);if(!x&&!0!==C&&S){var V=[],j=[];for(M=0;M<p;M++)if(void 0===d[M]){if(V.length>1){V=(H=this._modifyPoints(V,j)).x;j=H.y;t.stroke=R;t.strokeWidth=N;t.fill="none";t.drawLines(V,j,null,B);this.hitTester.add(new _LinesArea(V,j),_);if(v){V.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{V.push(V[V.length-1],V[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=D;t.stroke="none";t.drawPolygon(V,j,null,O,this.chart._plotrectId)}V=[];j=[]}else{V.push(d[M]);j.push(g[M])}if(V.length>1){V=(H=this._modifyPoints(V,j)).x;j=H.y;t.stroke=R;t.strokeWidth=N;t.fill="none";t.drawLines(V,j,null,B);this.hitTester.add(new _LinesArea(V,j),_);if(v){V.push(e.convert(e.actualMin),e.convert(e.actualMin));j.push(i.convert(i.actualMax),i.convert(i.actualMin))}else{V.push(V[V.length-1],V[0]);j.push(i.convert(i.actualMin),i.convert(i.actualMin))}t.fill=D;t.stroke="none";t.drawPolygon(V,j,null,O,this.chart._plotrectId)}}else{var H;d=(H=this._modifyPoints(d,g)).x;g=H.y;if(x){var G=this._modifyPoints(m,y);m=G.x;y=G.y;d=d.concat(m.reverse());g=g.concat(y.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,O,this.chart._plotrectId);if(x){d=d.slice(0,d.length-m.length);g=g.slice(0,g.length-y.length)}else{d=d.slice(0,d.length-2);g=g.slice(0,g.length-2)}t.stroke=R;t.strokeWidth=N;t.fill="none";t.drawLines(d,g,null,B,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=new Array,m=new Array,y=new Array,x=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=x?i.convert(P):e.convert(P);if(x){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);y.push(void 0)}}else{g.push(T);m.push(M);y.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);y.push(void 0)}}else{g.push(M);m.push(T);y.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);y.push(void 0)}}}o&&g.forEach((function(t,e){null!=t&&h.push(new Point(t,m[e]))}));var k=this._DEFAULT_WIDTH,F=n._getColorLight(l),I=n._getColor(l),N=_BasePlotter.cloneStyle(r.style,["fill"]),D=_BasePlotter.cloneStyle(r.style,["stroke"]);if(!0!==v&&b){var R=[],B=[],O=[];for(C=0;C<f;C++)if(void 0===g[C]){if(R.length>1){var V=x?O.slice(0).reverse():R.slice(0).reverse(),j=x?B.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,R,B,V,j,F,I,k,D,N);this.hitTester.add(new _LinesArea(R,B),l);this.hitTester.add(new _LinesArea(V,j),l)}R=[];B=[];O=[]}else{R.push(g[C]);B.push(m[C]);O.push(y[C])}if(R.length>1){V=x?O.slice(0).reverse():R.slice(0).reverse(),j=x?B.slice(0).reverse():O.slice(0).reverse();this._drawRangedArea(t,R,B,V,j,F,I,k,D,N);this.hitTester.add(new _LinesArea(R,B),l);this.hitTester.add(new _LinesArea(V,j),l)}}else{var H=x?y.slice(0).reverse():g.slice(0).reverse(),G=x?m.slice(0).reverse():y.slice(0).reverse();this._drawRangedArea(t,g,m,H,G,F,I,k,D,N);this.hitTester.add(new _LinesArea(g,m),l);this.hitTester.add(new _LinesArea(H,G),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 _Spline(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;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=this.chart.series.indexOf(r),_=asType(r,SeriesBase),u=this.chart._options,c=this.width,p=0;s=s||0;a=a||1;if(u&&u.groupWidth){var f=u.groupWidth;if(isNumber(f)){var d=asNumber(f);if(isFinite(d)&&d>0){p=d;c=1}}else if(isString(f)){var g=asString(f);if(g&&g.indexOf("%")>=0){g=g.replace("%","");d=parseFloat(g);if(isFinite(d)){d<0?d=0:d>100&&(d=100);p=0;c=d/100}}else{d=parseFloat(g);if(isFinite(d)&&d>0){p=d;c=1}}}}var m=c/a,y=_._getAxisY()._uniqueId,x=this.stackNegMap[y],b=this.stackPosMap[y],v=r.getValues(0),S=r.getValues(1),C=this._isRange(_),P=_._bindValues(null==_._cv?null==this.chart.collectionView?null:this.chart.collectionView.items:_._cv.items,_._getBinding(1)).values;if(v){S||(S=this.dataInfo.getXVals());if(S){var w=this.dataInfo.getDeltaX();if(w>0){c*=w;m*=w}}var A=_._getSymbolFill(l),M=_._getAltSymbolFill(l)||A,T=_._getSymbolStroke(l),L=_._getAltSymbolStroke(l)||T,E=v.length;null!=S&&(E=Math.min(E,S.length));var k,F,I=this.origin,N=0,D=this.stacking!=Stacking.None,R=this.stacking==Stacking.Stacked100pc;void 0!==_._getChartType()&&(D=R=!1);var B=this.getItemFormatter(r),O=e._actualMin,V=e._actualMax,j=i._actualMin,H=i._actualMax;if(this.rotated){I<O?I=O:I>V&&(I=V);_._isCustomAxisY()&&(D=R=!1);for(Y=e.convert(I),U=0;U<E;U++){q=S?S[U]:U,K=v[U],W=Y;this._getSymbolOrigin&&(W=i.convert(this._getSymbolOrigin(I,U)));if(C&&P&&P.length){Z=P[U];_DataInfo.isValid(Z)&&(W=e.convert(Z))}if(this._getSymbolStyles){A=(J=this._getSymbolStyles(U))&&J.fill?J.fill:A;M=J&&J.fill?J.fill:M;T=J&&J.stroke?J.fill:T;L=J&&J.stroke?J.fill:L}k=K>0?A:M;F=K>0?T:L;t.fill=k;t.stroke=F;if(_DataInfo.isValid(q,K))if(D){$=q+.5*c;if((Q=q-.5*c)<j&&$<j||Q>H&&$>H)continue;Q=i.convert(Math.max(Q,j));$=i.convert(Math.min($,H));if(R){K/=this.dataInfo.getStackedAbsSum(q)}et=0;if(K>=0){et=isNaN(b[q])?0:b[q];at=e.convert(et);tt=e.convert(et+K);b[q]=et+K}else{et=isNaN(x[q])?0:x[q];at=e.convert(et);tt=e.convert(et+K);x[q]=et+K}o&&h.push(new Point(tt,i.convert(q)));if(!_DataInfo.isValid(at,tt))continue;it=new Rect(Math.min(at,tt),Math.min(Q,$),Math.abs(tt-at),Math.abs($-Q));if(p>0){(_t=1-p/it.height)<0&&(_t=0);var G=it.top+.5*it.height;it.top+=(G-it.top)*_t;it.height=Math.min(p,it.height)}nt=new _RectArea(it);this.drawSymbol(t,it,r,U,new Point(tt,it.top+.5*it.height),B);r._setPointIndex(U,N);N++;st=R?Math.min(et+K,1):et+K;nt.tag=new _DataPoint(l,U,st,q);this.hitTester.add(nt,l)}else{$=q-.5*c+(s+1)*m;if((Q=q-.5*c+s*m)<j&&$<j||Q>H&&$>H)continue;Q=i.convert(Math.max(Q,j));$=i.convert(Math.min($,H));var z=e.convert(K);if(!_DataInfo.isValid(z,Q,$))continue;var X=new Rect(Math.min(z,W),Math.min(Q,$),Math.abs(W-z),Math.abs($-Q));o&&h.push(new Point(z,(Q+$)/2));if(p>0){(_t=1-(lt=p/a)/X.height)<0&&(_t=0);G=i.convert(q);X.top+=(G-X.top)*_t;X.height=Math.min(lt,X.height)}nt=new _RectArea(X);this.drawSymbol(t,X,r,U,new Point(z,X.top+.5*X.height),B);r._setPointIndex(U,N);N++;nt.tag=new _DataPoint(l,U,K,q);this.hitTester.add(nt,l)}else o&&h.push(null)}}else{I<j?I=j:I>H&&(I=H);var Y=i.convert(I);_._isCustomAxisY()&&(D=R=!1);for(var U=0;U<E;U++){var W=Y,q=S?S[U]:U,K=v[U];this._getSymbolOrigin&&(W=i.convert(this._getSymbolOrigin(I,U,E)));if(C&&P&&P.length){var Z=P[U];_DataInfo.isValid(Z)&&(W=i.convert(Z))}if(this._getSymbolStyles){var J;A=(J=this._getSymbolStyles(U,E))&&J.fill?J.fill:A;M=J&&J.fill?J.fill:M;T=J&&J.stroke?J.stroke:T;L=J&&J.stroke?J.stroke:L}k=K>0?A:M;F=K>0?T:L;t.fill=k;t.stroke=F;t.strokeWidth=null;if(_DataInfo.isValid(q,K))if(D){var Q,$,tt=q+.5*c;if((at=q-.5*c)<O&&tt<O||at>V&&tt>V)continue;at=e.convert(at);tt=e.convert(tt);if(!_DataInfo.isValid(at,tt))continue;if(R){K/=this.dataInfo.getStackedAbsSum(q)}var et=0;if(K>=0){et=isNaN(b[q])?0:b[q];Q=i.convert(Math.max(et,j));$=i.convert(Math.max(et+K,j));b[q]=et+K}else{et=isNaN(x[q])?0:x[q];Q=i.convert(et);$=i.convert(et+K);x[q]=et+K}o&&h.push(new Point(e.convert(q),$));if(!_DataInfo.isValid(Q,$))continue;var it=new Rect(Math.min(at,tt),Math.min(Q,$),Math.abs(tt-at),Math.abs($-Q));if(p>0){(_t=1-p/it.width)<0&&(_t=0);var rt=it.left+.5*it.width;it.left+=(rt-it.left)*_t;it.width=Math.min(p,it.width)}var nt=new _RectArea(it);this.drawSymbol(t,it,r,U,new Point(it.left+.5*it.width,$),B);r._setPointIndex(U,N);N++;var st=R?Math.min(et+K,1):et+K;nt.tag=new _DataPoint(l,U,q,st);this.hitTester.add(nt,l)}else{var at,tt=q-.5*c+(s+1)*m;if((at=q-.5*c+s*m)<O&&tt<O||at>V&&tt>V)continue;at=e.convert(at);tt=e.convert(tt);var ot=i.convert(K);if(!_DataInfo.isValid(ot,at,tt))continue;var ht=new Rect(Math.min(at,tt),Math.min(ot,W),Math.abs(tt-at),Math.abs(W-ot));o&&h.push(new Point((at+tt)/2,ot));if(p>0){var lt,_t;(_t=1-(lt=p/a)/ht.width)<0&&(_t=0);rt=e.convert(q);ht.left+=(rt-ht.left)*_t;ht.width=Math.min(lt,ht.width)}var nt=new _RectArea(ht);this.drawSymbol(t,ht,r,U,new Point(ht.left+.5*ht.width,ot),B);r._setPointIndex(U,N);N++;nt.tag=new _DataPoint(l,U,q,K);this.hitTester.add(nt,l)}else o&&h.push(null)}}o&&h&&h.length&&o(h)}};_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),y=this.chart._plotRect,x=d&&d.funnel&&null!=d.funnel.neckWidth?d.funnel.neckWidth:.2,b=d&&d.funnel&&null!=d.funnel.neckHeight?d.funnel.neckHeight:0,v=x*y.width,S=0,C=0,P=0,w=0,A=y.left,M=y.top,T=y.width,L=y.height;if(g){this.rotated&&(M+=y.height);v=v||1;m||(m=this.dataInfo.getXVals());var E=g.length;null!=m&&(E=Math.min(E,m.length));var k=0;for(S=0;S<E;S++)if(_DataInfo.isValid(g[S])){C+=g[S];g[S]>k&&(k=g[S])}var F,I,N=0;if(d&&d.funnel&&"rectangle"===d.funnel.type&&k>0){b=L/E;x=T;var D=T/k;for(S=0;S<E;S++){var R=m?m[S]:S,B=g[S],O=f._getSymbolFill(S),V=f._getAltSymbolFill(S)||O,j=f._getSymbolStroke(S),H=f._getAltSymbolStroke(S)||j;if(this._getSymbolStyles){O=(U=this._getSymbolStyles(S,E))&&U.fill?U.fill:O;V=U&&U.fill?U.fill:V;j=U&&U.stroke?U.stroke:j;H=U&&U.stroke?U.stroke:H}F=B>0?O:V;I=B>0?j:H;t.fill=F;t.stroke=I;if(_DataInfo.isValid(R)&&_DataInfo.isValid(B)){D||(D=T/B);var G=D*B;A+=(x-G)/2;this.rotated&&(M-=b);t.drawRect(A,M,G,b);z=new _FunnelSegment(new Point(A,M),G,b,G,b);this.rotated||(M+=b);x=G;z.tag=new _DataPoint(h,S,R,B);this.hitTester.add(z,h);r._setPointIndex(S,N);N++}}}else{P=y.left+y.width*(1-x)/2;w=y.top+y.height*(this.rotated?b:1-b);_=(1-x)*y.width/2/(y.height*(1-b));if(isNaN(_)||!isFinite(_)){T=v;A=P;M=w}l=y.width*x*y.height+y.width*(1-x)/2*y.height*(1-b);for(S=0;S<E;S++){R=m?m[S]:S,B=g[S];var z,X=[],Y=[];O=f._getSymbolFill(S),V=f._getAltSymbolFill(S)||O,j=f._getSymbolStroke(S),H=f._getAltSymbolStroke(S)||j;if(this._getSymbolStyles){var U;O=(U=this._getSymbolStyles(S,E))&&U.fill?U.fill:O;V=U&&U.fill?U.fill:V;j=U&&U.stroke?U.stroke:j;H=U&&U.stroke?U.stroke:H}F=B>0?O:V;I=B>0?j:H;t.fill=F;t.stroke=I;if(_DataInfo.isValid(R)&&_DataInfo.isValid(B)){var W=l*B/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];z=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);z=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];z=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);z=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);z=new _FunnelSegment(new Point(A,M),v,p,v,p);this.rotated||(M+=p)}z.tag=new _DataPoint(h,S,R,B);this.hitTester.add(z,h);r._setPointIndex(S,N);N++}}}}}};_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._neckWidth=r;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;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 y=0;y<g;y++){var x=c._getItem(y);if(x){[p?x[p]:null,f?x[f]:null,d?x[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,v=this.chart._plotRect;if(v&&v.width&&!this.isVolume){isNaN(m)&&(m=c._getSymbolSize());m+=2;var S=v.width/(v.width-m)*b;i-=.5*(S-b);b=S}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 y=this._DEFAULT_WIDTH,x=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=y;t.fill=x;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,k=0,F=null,I=null,N=this.getItemFormatter(r),D=0;D<g;D++)if(F=l._getItem(D)){var R=m?c[D]:D;if(_DataInfo.isValid(R)&&L<=R&&R<=E){var B=u[D],O=A?F[A]:null,V=M?F[M]:null,j=T?F[T]:null;t.startGroup();if(this.isEqui&&null!==I){if(I[T]!==F[T]){P=I[T]<F[T]?b:x;w=I[T]<F[T]?S:v}}else{P=V<j?b:x;w=V<j?S:v}t.fill=P;t.stroke=w;t.strokeWidth=y;if(N){var H=new HitTestInfo(this.chart,new Point(e.convert(R),i.convert(B)),ChartElement.SeriesSymbol);H._setData(l,D);N(t,H,(function(){h._drawSymbol(t,e,i,_,D,P,C,R,B,O,V,j)}));t.cssPriority=!0}else this._drawSymbol(t,e,i,_,D,P,C,R,B,O,V,j);t.endGroup();r._setPointIndex(D,k);k++}I=F}}};_FinancePlotter.prototype._drawSymbol=function(t,e,i,r,n,s,a,o,h,l,_,u){var c,p=null,f=null,d=null,g=null,m=this.chart._isRotated(),y=m?new _DataPoint(r,n,h,o):new _DataPoint(r,n,o,h);if(m){var x=i;i=e;e=x}if(!1===this._isPixel&&(d=e.convert(o-.5*a))>(g=e.convert(o+.5*a))){var b=d;d=g;g=b}o=e.convert(o);if(!1!==this._isPixel){d=o-.5*a;g=o+.5*a}if(this.isCandle){if(_DataInfo.isValid(_)&&_DataInfo.isValid(u)){_=i.convert(_);u=i.convert(u);f=(p=Math.min(_,u))+Math.abs(_-u);if(m){t.drawRect(p,d,f-p||1,g-d||1);c=new _RectArea(new Rect(p,d,f-p||1,g-d||1))}else{t.drawRect(d,p,g-d||1,f-p||1);c=new _RectArea(new Rect(d,p,g-d||1,f-p||1))}c.tag=y;this.hitTester.add(c,r)}if(_DataInfo.isValid(h)){h=i.convert(h);if(null!==p)if(m){t.drawLine(f,o,h,o);c.rect.width=c.rect.width+h}else{t.drawLine(o,p,o,h);c.rect.top=h;c.rect.height=c.rect.height+h}}if(_DataInfo.isValid(l)){l=i.convert(l);if(null!==f)if(m){t.drawLine(p,o,l,o);c.rect.left=l;c.rect.width=c.rect.width+l}else{t.drawLine(o,f,o,l);c.rect.height=c.rect.height+l}}}else if(this.isEqui){if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){h=i.convert(h);l=i.convert(l);f=(p=Math.min(h,l))+Math.abs(h-l);t.drawRect(d,p,g-d||1,f-p||1);(c=new _RectArea(new Rect(d,p,g-d||1,f-p||1))).tag=y;this.hitTester.add(c,r)}}else if(this.isArms){if(_DataInfo.isValid(_)&&_DataInfo.isValid(u)){_=i.convert(_);u=i.convert(u);f=(p=Math.min(_,u))+Math.abs(_-u);t.drawRect(d,p,g-d||1,f-p||1)}if(_DataInfo.isValid(h)&&null!==p){h=i.convert(h);t.drawLine(o,p,o,h)}if(_DataInfo.isValid(l)&&null!==f){l=i.convert(l);t.drawLine(o,f,o,l)}if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){t.fill="transparent";f=(p=Math.min(h,l))+Math.abs(h-l);t.drawRect(d,p,g-d||1,f-p||1);(c=new _RectArea(new Rect(d,p,g-d||1,f-p||1))).tag=y;this.hitTester.add(c,r)}}else{if(_DataInfo.isValid(h)&&_DataInfo.isValid(l)){h=i.convert(h);l=i.convert(l);f=(p=Math.min(h,l))+Math.abs(h-l);if(m){t.drawLine(l,o,h,o);c=new _RectArea(new Rect(p,d,f-p||1,g-d||1))}else{t.drawLine(o,l,o,h);c=new _RectArea(new Rect(d,p,g-d||1,f-p||1))}c.tag=y;this.hitTester.add(c,r)}if(_DataInfo.isValid(_)){_=i.convert(_);m?t.drawLine(_,d,_,o):t.drawLine(d,_,o,_)}if(_DataInfo.isValid(u)){u=i.convert(u);m?t.drawLine(u,o,u,g):t.drawLine(o,u,g,u)}}};return _FinancePlotter}(_BasePlotter);export{_FinancePlotter};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(_),y=l._getAltSymbolFill(_)||m,x=l._getSymbolStroke(_),b=l._getAltSymbolStroke(_)||x,v=l._getSymbolSize();t.stroke=x;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=l.interpolateNulls,k=!1,F=this.getItemFormatter(r),I=0;I<f;I++){var N=d?c[I]:I,D=u[I];if(isFinite(N)&&isFinite(D)){if(T){if(L){D/=this.dataInfo.getStackedAbsSum(N)}if(D>=0){var R=isNaN(this.stackPos[N])?0:this.stackPos[N];D=this.stackPos[N]=R+D}else{R=isNaN(this.stackNeg[N])?0:this.stackNeg[N];D=this.stackNeg[N]=R+D}}var B;if(M){B=new _DataPoint(_,I,D,N);var O=e.convert(D);D=i.convert(N);N=O}else{B=new _DataPoint(_,I,N,D);N=e.convert(N);D=i.convert(D)}if(isNaN(N)||isNaN(D)){k=!0;if(!0!==E){S[P]=NaN;C[P++]=NaN}w[A++]=1;o&&h.push(null)}else{S[P]=N;C[P++]=D;A++;o&&h.push(new Point(N,D));if(this.hitTestSymbols){var V=new _CircleArea(new Point(N,D),.5*v);V.tag=B;this.hitTester.add(V,_)}}}else{k=!0;if(!0!==E){S[P]=NaN;C[P++]=NaN}w[A++]=1;o&&h.push(null)}}var j=0;if(this.hasLines){t.fill=null;if(k&&!0!==E){var H=[],G=[];for(I=0;I<f;I++)if(isNaN(S[I])){if(H.length>1){this._drawLines(t,H,G,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(H,G),_);j++}H=[];G=[]}else{H.push(S[I]);G.push(C[I])}if(H.length>1){this._drawLines(t,H,G,null,p,this.chart._plotrectId);this.hitTester.add(new _LinesArea(H,G),_);j++}}else{this._drawLines(t,S,C,null,p,this.chart._plotrectId,P);this.hitTester.add(new _LinesArea(S,C),_);j++}}if(this.hasSymbols&&v>0||F){t.fill=m;var z=0;for(I=0;I<f;I++)if(!E||!w[I]){N=S[z],D=C[z];if(!1===this.hasLines||F){t.fill=u[I]>0?m:y;t.stroke=u[I]>0?x:b;t.strokeWidth=g}if(this.isValid(N,D,e,i)){this._drawSymbol(t,N,D,v,l,I,F);r._setPointIndex(I,j);j++}z++}}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(y=m._getBindingValues(1))for(var _=y.length,u=0;u<_;u++)if(isFinite(y[u])){(isNaN(o)||y[u]<o)&&(o=y[u]);(isNaN(h)||y[u]>h)&&(h=y[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 y=m._getBindingValues(1),x=m.getValues(1),b=m.getValues(0);if(y&&x&&b){var v=y.length;for(u=0;u<v;u++){var S=x?x[u]:u,C=b[u],P=y[u];if(_DataInfo.isValid(S,C,P)){S=i.left+i.width*(S-c.left)/c.width;C=i.top+i.height*(C-c.top)/c.height;S-(P=this._minSize+(this._maxSize-this._minSize)*(P-o)/(h-o))<p&&(p=S-P);S+P>f&&(f=S+P);C-P<d&&(d=C-P);C+P>g&&(g=C+P)}}}}}p=i.left-p+5;f=f-i.right+5;d=i.top-d+5;g=g-i.bottom+5;var w=this.chart.axisX,A=this.chart.axisY;if(!w._isLogAxis())if(this.stacking==Stacking.Stacked100pc&&this.rotated){var M=(i.width-this._maxSize)/c.width;c.left-=.5*this._maxSize/M;c.width+=this._maxSize/M}else{M=(i.width-(p+f))/c.width;c.left-=p/M;c.width+=(p+f)/M}if(!A._isLogAxis())if(this.stacking!=Stacking.Stacked100pc||this.rotated){T=(i.height-(d+g))/c.height;c.top-=d/T;c.height+=(d+g)/T}else{var T=(i.height-this._maxSize)/c.height;c.top-=.5*this._maxSize/T;c.height+=this._maxSize/T}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){r=_[u];if(isFinite(r)){null==r&&(r=this._minValue);var c=this._minValue==this._maxValue?1:Math.sqrt((r-this._minValue)/(this._maxValue-this._minValue));r=this._minSize+(this._maxSize-this._minSize)*c;if(a){var p=new HitTestInfo(this.chart,new Point(e,i),ChartElement.SeriesSymbol);p._setData(n,s);t.startGroup();a(t,p,(function(){o._drawDefaultSymbol(t,e,i,r,n.symbolMarker,n.symbolStyle)}));t.endGroup()}else this._drawDefaultSymbol(t,e,i,r,n.symbolMarker,n.symbolStyle);var f=n.getValues(1);f||(f=this.dataInfo.getXVals());var d=f?f[s]:s,g=n.getValues(0)[s],m=this.chart.series.indexOf(n),y=new _CircleArea(new Point(e,i),.5*r);y.tag=new _DataPoint(m,s,d,g);this.hitTester.add(y,m)}}}};return _BubblePlotter}(_LinePlotter);export{_BubblePlotter};_registerModule("wijmo.chart",selfModule);
|