UNPKG

@progress/kendo-ui

Version:

This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.

1 lines 203 kB
!function(t){"function"==typeof define&&define.amd?define(["kendo.core.min","kendo.color.min","kendo.drawing.min","kendo.dataviz.core.min","kendo.data.min","kendo.dataviz.themes.min","kendo.userevents.min","kendo.icons.min"],t):t()}((function(){!function(t){window.kendo.dataviz=window.kendo.dataviz||{};var e=kendo.dataviz,i=e.Class,n=e.isNumber,s=e.constants,r=s.MAX_VALUE,o=s.MIN_VALUE,a=s.VALUE,h=s.CENTER,l=s.TOP,c=s.BOTTOM,u=s.LEFT,p=s.WHITE,d=s.CIRCLE,f=s.X,v=s.Y,g=s.RIGHT,x=s.BLACK,m=s.DATE,y=s.DEFAULT_PRECISION,_=s.ARC,b=e.defined,w=e.getter,A=e.isArray,S=e.ChartElement,C=e.Point,k=e.Box,P=e.alignPathToPixel,T=e.setDefaultOptions,I=e.inArray,E=e.isFunction,R=e.valueOrDefault,V=e.isObject,O=e.deepExtend,L=e.last,M=e.eventElement,B=e.getTemplate,H=e.TextBox,z=e.ShapeElement,D=e.getSpacing,F=e.CurveProcessor,N=e.append,G=e.isString,X=e.parseDate,Y=e.styleValue,q=e.CategoryAxis,U=e.BoxElement,W=e.Title,Z=e.round,j=e.limitValue,K=e.grep,Q=e.elementStyles,$=e.hasClasses,J=e.bindEvents,tt=e.services,et=e.unbindEvents,it=kendo.support,nt=kendo.drawing,st=nt.Path,rt=nt.Animation,ot=nt.AnimationFactory,at=nt.Group,ht=kendo.Color,lt=kendo.geometry,ct=lt.Point,ut=lt.transform,pt=i.extend({init:function(t){this._axis=t,this.options=t.options},value:function(t){var e=this._axis;return e.getCategory?e.getCategory(t):e.getValue(t)},slot:function(t,e,i){return void 0===i&&(i=!0),this._axis.slot(t,e,i)},range:function(){return this._axis.range()},valueRange:function(){return this._axis.valueRange()}});function dt(t,e){for(var i=0;i<e.length;i++)if(e[i].options.name===t)return e[i].prepareUserOptions(),new pt(e[i])}var ft=kendo.Class.extend({init:function(t){this.visual=t.visual,this.chartsVisual=t.chartContainer.visual,this._pane=t},findAxisByName:function(t){return dt(t,this._pane.axes)}}),vt=i.extend({init:function(t){this._plotArea=t,this.visual=t.visual,this.backgroundVisual=t._bgVisual}});function gt(t){for(var e=t.length,i=0,s=0;s<e;s++){var r=t[s];n(r)&&i++}return i}var xt={min:function(t){for(var e=t.length,i=r,s=0;s<e;s++){var o=t[s];n(o)&&(i=Math.min(i,o))}return i===r?t[0]:i},max:function(t){for(var e=t.length,i=o,s=0;s<e;s++){var r=t[s];n(r)&&(i=Math.max(i,r))}return i===o?t[0]:i},sum:function(t){for(var e=t.length,i=0,s=0;s<e;s++){var r=t[s];n(r)&&(i+=r)}return i},sumOrNull:function(t){var e=null;return gt(t)&&(e=xt.sum(t)),e},count:function(t){for(var e=t.length,i=0,n=0;n<e;n++){var s=t[n];null!==s&&b(s)&&i++}return i},avg:function(t){var e=gt(t),i=t[0];return e>0&&(i=xt.sum(t)/e),i},first:function(t){for(var e=t.length,i=0;i<e;i++){var n=t[i];if(null!==n&&b(n))return n}return t[0]}};function mt(t,e){return null===e?e:w(t,!0)(e)}var yt=i.extend({init:function(){this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}},register:function(t,e,i){var n=this;void 0===e&&(e=[a]),void 0===i&&(i={});for(var s=0;s<t.length;s++){var r=t[s];n._valueFields[r]=e,n._otherFields[r]=i,n._nullValue[r]=n._makeValue(e,null),n._undefinedValue[r]=n._makeValue(e,void 0)}},canonicalFields:function(t){return this.valueFields(t).concat(this.otherFields(t))},valueFields:function(t){return this._valueFields[t.type]||[a]},otherFields:function(t){return this._otherFields[t.type]||[a]},bindPoint:function(t,e,i){var n,s,r=t.data,o=b(i)?i:r[e],a={valueFields:{value:o}},h=this.valueFields(t),l=this._otherFields[t.type];if(null===o)s=this._nullValue[t.type];else if(b(o)){if(Array.isArray(o)){var c=o.slice(h.length);s=this._bindFromArray(o,h),n=this._bindFromArray(c,l)}else if("object"==typeof o){var u=this.sourceFields(t,h),p=this.sourceFields(t,l);s=this._bindFromObject(o,h,u),n=this._bindFromObject(o,l,p)}}else s=this._undefinedValue[t.type];return b(s)&&(1===h.length?a.valueFields.value=s[h[0]]:a.valueFields=s),a.fields=n||{},a},_makeValue:function(t,e){for(var i={},n=t.length,s=0;s<n;s++){i[t[s]]=e}return i},_bindFromArray:function(t,e){var i={};if(e)for(var n=Math.min(e.length,t.length),s=0;s<n;s++)i[e[s]]=t[s];return i},_bindFromObject:function(t,e,i){void 0===i&&(i=e);var n={};if(e)for(var s=e.length,r=0;r<s;r++){var o=e[r],a=i[r];null!==a&&(n[o]=mt(a,t))}return n},sourceFields:function(t,e){var i=[];if(e)for(var n=e.length,s=0;s<n;s++){var r=e[s],o=r===a?"field":r+"Field";i.push(null!==t[o]?t[o]||r:null)}return i}});yt.current=new yt;var _t=/percent(?:\w*)\((\d+)\)/,bt=new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$"),wt=i.extend({init:function(t,e,i){this.initGlobalRanges(t,e,i)},initGlobalRanges:function(t,e,i){var n=e.data,s=bt.exec(t);if(s){this.valueGetter=this.createValueGetter(e,i);var r=this.getAverage(n),o=this.getStandardDeviation(n,r,!1),a=s[1]?parseFloat(s[1]):1,h={low:r.value-o*a,high:r.value+o*a};this.globalRange=function(){return h}}else if(t.indexOf&&t.indexOf("stderr")>=0){this.valueGetter=this.createValueGetter(e,i);var l=this.getStandardError(n,this.getAverage(n));this.globalRange=function(t){return{low:t-l,high:t+l}}}},createValueGetter:function(t,e){var i,r=t.data,o=yt.current,a=o.valueFields(t),h=b(r[0])?r[0]:{};if(A(h)){var l=e?a.indexOf(e):0;i=w("["+l+"]")}else if(n(h))i=w();else if(typeof h===s.OBJECT){var c=o.sourceFields(t,a);i=w(c[a.indexOf(e)])}return i},getErrorRange:function(t,e){var i,s,r;if(!b(e))return null;if(this.globalRange)return this.globalRange(t);if(A(e))i=t-e[0],s=t+e[1];else if(n(r=parseFloat(e)))i=t-r,s=t+r;else{if(!(r=_t.exec(e)))throw new Error("Invalid ErrorBar value: "+e);var o=t*(parseFloat(r[1])/100);i=t-Math.abs(o),s=t+Math.abs(o)}return{low:i,high:s}},getStandardError:function(t,e){return this.getStandardDeviation(t,e,!0)/Math.sqrt(e.count)},getStandardDeviation:function(t,e,i){for(var s=t.length,r=i?e.count-1:e.count,o=0,a=0;a<s;a++){var h=this.valueGetter(t[a]);n(h)&&(o+=Math.pow(h-e.value,2))}return Math.sqrt(o/r)},getAverage:function(t){for(var e=t.length,i=0,s=0,r=0;r<e;r++){var o=this.valueGetter(t[r]);n(o)&&(i+=o,s++)}return{value:i/s,count:s}}}),At=it.browser||{},St=600,Ct="fadeIn",kt=.8,Pt=At.msie?.001:0,Tt="errorLow",It="errorHigh",Et="xErrorLow",Rt="xErrorHigh",Vt="yErrorLow",Ot="yErrorHigh",Lt="zero",Mt="interpolate",Bt="gap",Ht="above",zt="below",Dt="smooth",Ft="step",Nt="area",Gt="bar",Xt="boxPlot",Yt="bubble",qt="bullet",Ut="candlestick",Wt="column",Zt="donut",jt="funnel",Kt="heatmap",Qt="horizontalWaterfall",$t="line",Jt="ohlc",te="pie",ee="polarArea",ie="polarLine",ne="polarScatter",se="radarArea",re="radarColumn",oe="radarLine",ae="rangeArea",he="rangeBar",le="rangeColumn",ce="scatter",ue="scatterLine",pe="verticalArea",de="verticalBoxPlot",fe="verticalBullet",ve="verticalLine",ge="verticalRangeArea",xe="waterfall",me=[Gt,Wt,Jt,Ut,Xt,de,qt,le,he,xe,Qt],ye="legendItemClick",_e="legendItemHover",be="legendItemLeave",we="seriesClick",Ae="seriesHover",Se="seriesOver",Ce="seriesLeave",ke="plotAreaClick",Pe="plotAreaHover",Te="plotAreaLeave",Ie="drag",Ee="dragEnd",Re="dragStart",Ve="zoomStart",Oe="zoom",Le="zoomEnd",Me="selectStart",Be="select",He="selectEnd",ze="render",De="showTooltip",Fe="hideTooltip",Ne="paneRender",Ge="log",Xe="category",Ye="insideEnd",qe="insideBase",Ue="outsideEnd",We="DOMMouseScroll mousewheel",Ze=150,je={INITIAL_ANIMATION_DURATION:St,FADEIN:Ct,LEGEND_ITEM_CLICK:ye,LEGEND_ITEM_HOVER:_e,LEGEND_ITEM_LEAVE:be,SERIES_CLICK:we,SERIES_HOVER:Ae,SERIES_OVER:Se,SERIES_LEAVE:Ce,GLASS:"glass",BORDER_BRIGHTNESS:kt,TOOLTIP_OFFSET:5,START_SCALE:Pt,ERROR_LOW_FIELD:Tt,ERROR_HIGH_FIELD:It,X_ERROR_LOW_FIELD:Et,X_ERROR_HIGH_FIELD:Rt,Y_ERROR_LOW_FIELD:Vt,Y_ERROR_HIGH_FIELD:Ot,LINE_MARKER_SIZE:8,INTERPOLATE:Mt,ZERO:Lt,SMOOTH:Dt,STEP:Ft,CATEGORY:Xe,FUNNEL:jt,BAR:Gt,CANDLESTICK:Ut,PIE:te,COLUMN:Wt,AREA:Nt,VERTICAL_BULLET:fe,BOX_PLOT:Xt,OHLC:Jt,WATERFALL:xe,LINE:$t,BULLET:qt,VERTICAL_LINE:ve,VERTICAL_AREA:pe,RANGE_AREA:ae,VERTICAL_RANGE_AREA:ge,RANGE_COLUMN:le,VERTICAL_BOX_PLOT:de,RANGE_BAR:he,HORIZONTAL_WATERFALL:Qt,SCATTER:ce,SCATTER_LINE:ue,BUBBLE:Yt,RADAR_AREA:se,RADAR_LINE:oe,RADAR_COLUMN:re,POLAR_LINE:ie,POLAR_AREA:ee,POLAR_SCATTER:ne,RENDER:ze,PLOT_AREA_CLICK:ke,PLOT_AREA_HOVER:Pe,PLOT_AREA_LEAVE:Te,LOGARITHMIC:Ge,DRAG:Ie,DRAG_START:Re,DRAG_END:Ee,ZOOM_START:Ve,ZOOM:Oe,ZOOM_END:Le,SELECT_START:Me,SELECT:Be,SELECT_END:He,PANE_RENDER:Ne,GAP:Bt,DONUT:Zt,INSIDE_END:Ye,INSIDE_BASE:qe,OUTSIDE_END:Ue,MOUSEWHEEL:We,MOUSEWHEEL_DELAY:Ze,MOUSEWHEEL_ZOOM_RATE:.3,SHOW_TOOLTIP:De,HIDE_TOOLTIP:Fe,EQUALLY_SPACED_SERIES:me,ABOVE:Ht,BELOW:zt,HEATMAP:Kt},Ke=S.extend({init:function(t,e,i,n,s,r){S.fn.init.call(this,r),this.low=t,this.high=e,this.isVertical=i,this.chart=n,this.series=s},reflow:function(t){var e,i=this.options.endCaps,n=this.isVertical,s=this.getAxis().getSlot(this.low,this.high),r=t.center(),o=this.getCapsWidth(t,n),a=n?r.x:r.y,h=a-o,l=a+o;n?(e=[new C(r.x,s.y1),new C(r.x,s.y2)],i&&e.push(new C(h,s.y1),new C(l,s.y1),new C(h,s.y2),new C(l,s.y2)),this.box=new k(h,s.y1,l,s.y2)):(e=[new C(s.x1,r.y),new C(s.x2,r.y)],i&&e.push(new C(s.x1,h),new C(s.x1,l),new C(s.x2,h),new C(s.x2,l)),this.box=new k(s.x1,h,s.x2,l)),this.linePoints=e},getCapsWidth:function(t,e){var i=e?t.width():t.height();return Math.min(Math.floor(i/2),4)||4},createVisual:function(){var t=this,e=this.options,i=e.visual;i?this.visual=i({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:e.endCaps,color:e.color,line:e.line},createVisual:function(){t.createDefaultVisual();var e=t.visual;return delete t.visual,e}}):this.createDefaultVisual()},createDefaultVisual:function(){var t=this.options,e=this.linePoints,i={stroke:{color:t.color,width:t.line.width,dashType:t.line.dashType}};S.fn.createVisual.call(this);for(var n=0;n<e.length;n+=2){var s=new st(i).moveTo(e[n].x,e[n].y).lineTo(e[n+1].x,e[n+1].y);P(s),this.visual.append(s)}}});T(Ke,{animation:{type:Ct,delay:St},endCaps:!0,line:{width:2},zIndex:1});var Qe=Ke.extend({getAxis:function(){return this.chart.seriesValueAxis(this.series)}});function $e(t,e,i,n){void 0===i&&(i={}),void 0===n&&(n=!1);var s=i.defaults=i.defaults||{},r=i.depth=i.depth||0,o=!1;if(i.excluded=i.excluded||[],r>5)return null;for(var a in t)if(!I(a,i.excluded)&&t.hasOwnProperty(a)){var h=t[a];E(h)?(o=!0,n||(t[a]=R(h(e),s[a]))):V(h)&&(n||(i.defaults=s[a]),i.depth++,o=$e(h,e,i,n)||o,i.depth--)}return o}function Je(t){for(var e=t.length,i=0,n=0;n<e;n++)i=Math.max(i,t[n].data.length);return i}var ti=S.extend({init:function(t,e){S.fn.init.call(this,e),this.plotArea=t,this.chartService=t.chartService,this.categoryAxis=t.seriesCategoryAxis(e.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()},render:function(){this.traverseDataPoints(this.addValue.bind(this))},pointOptions:function(t,e){var i=this.seriesOptions[e];if(!i){var n=this.pointType().prototype.defaults;this.seriesOptions[e]=i=O({},n,{vertical:!this.options.invertAxes},t)}return i},plotValue:function(t){if(!t)return 0;if(this.options.isStacked100&&n(t.value)){for(var e=t.categoryIx,i=this.categoryPoints[e],s=[],r=0,o=0;o<i.length;o++){var a=i[o];if(a){var h=t.series.stack,l=a.series.stack;if(h&&l&&h.group!==l.group)continue;n(a.value)&&(r+=Math.abs(a.value),s.push(Math.abs(a.value)))}}if(r>0)return t.value/r}return t.value},plotRange:function(t,i){void 0===i&&(i=0);var n=this.categoryPoints[t.categoryIx];if(this.options.isStacked){for(var r=this.plotValue(t),o=r>=0,a=i,h=!1,l=0;l<n.length;l++){var c=n[l];if(t===c)break;var u=t.series.stack,p=c.series.stack;if(u&&p){if(typeof u===s.STRING&&u!==p)continue;if(u.group&&u.group!==p.group)continue}var d=this.plotValue(c);(d>=0&&o||d<0&&!o)&&(a+=d,r+=d,h=!0,this.options.isStacked100&&(r=Math.min(r,1)))}return h&&(a-=i),[a,r]}var f=t.series,v=this.seriesValueAxis(f),g=this.categoryAxisCrossingValue(v);return[g,e.convertableToNumber(t.value)?t.value:g]},stackLimits:function(t,e){for(var i=r,n=o,s=0;s<this.categoryPoints.length;s++){var a=this.categoryPoints[s];if(a)for(var h=0;h<a.length;h++){var l=a[h];if(l&&(l.series.stack===e||l.series.axis===t)){var c=this.plotRange(l,0)[1];b(c)&&isFinite(c)&&(n=Math.max(n,c),i=Math.min(i,c))}}}return{min:i,max:n}},updateStackRange:function(){var t=this,i=this.options,n=i.isStacked,s=i.series,a={};if(n)for(var h=0;h<s.length;h++){var l=s[h],c=l.axis,u=c+l.stack,p=a[u];if(!p){p=t.stackLimits(c,l.stack);var d=t.errorTotals;d&&(d.negative.length&&(p.min=Math.min(p.min,e.sparseArrayLimits(d.negative).min)),d.positive.length&&(p.max=Math.max(p.max,e.sparseArrayLimits(d.positive).max))),p.min!==r||p.max!==o?a[u]=p:p=null}p&&(t.valueAxisRanges[c]=p)}},addErrorBar:function(t,e,i){var s,r=t.value,o=t.series,h=t.seriesIx,l=t.options.errorBars,c=e.fields.errorLow,u=e.fields.errorHigh;n(c)&&n(u)?s={low:c,high:u}:l&&b(l.value)&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[h]=this.seriesErrorRanges[h]||new wt(l.value,o,a),s=this.seriesErrorRanges[h].getErrorRange(r,l.value)),s&&(t.low=s.low,t.high=s.high,this.addPointErrorBar(t,i))},addPointErrorBar:function(t,e){var i=!this.options.invertAxes,n=t.options.errorBars,s=t.series,r=t.low,o=t.high;if(this.options.isStacked){var a=this.stackedErrorRange(t,e);r=a.low,o=a.high}else{var h={categoryIx:e,series:s};this.updateRange({value:r},h),this.updateRange({value:o},h)}var l=new Qe(r,o,i,this,s,n);t.errorBars=[l],t.append(l)},stackedErrorRange:function(t,e){var i=this.plotRange(t,0)[1]-t.value,n=t.low+i,s=t.high+i;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},n<0&&(this.errorTotals.negative[e]=Math.min(this.errorTotals.negative[e]||0,n)),s>0&&(this.errorTotals.positive[e]=Math.max(this.errorTotals.positive[e]||0,s)),{low:n,high:s}},addValue:function(e,i){var n=i.categoryIx,s=i.series,r=i.seriesIx,o=this.categoryPoints[n];o||(this.categoryPoints[n]=o=[]);var a=this.seriesPoints[r];a||(this.seriesPoints[r]=a=[]);var h=this.createPoint(e,i);h&&(t.extend(h,i),h.owner=this,h.noteText=e.fields.noteText,b(h.dataItem)||(h.dataItem=s.data[n]),this.addErrorBar(h,e,n)),this.points.push(h),a.push(h),o.push(h),this.updateRange(e.valueFields,i)},evalPointOptions:function(t,e,i,n,s,r){var o={defaults:s._defaults,excluded:["data","aggregate","_events","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},a=this._evalSeries[r];b(a)||(this._evalSeries[r]=a=$e(t,{},o,!0));var h=t;return a&&$e(h=O({},h),{value:e,category:i,index:n,series:s,dataItem:s.data[n]},o),h},updateRange:function(t,e){var i=e.series.axis,n=t.value,s=this.valueAxisRanges[i];isFinite(n)&&null!==n&&((s=this.valueAxisRanges[i]=s||{min:r,max:o}).min=Math.min(s.min,n),s.max=Math.max(s.max,n))},seriesValueAxis:function(t){var e=this.plotArea,i=t.axis,n=i?e.namedValueAxes[i]:e.valueAxis;if(!n)throw new Error("Unable to locate value axis with name "+i);return n},reflow:function(t){var e=this,i=this.categorySlots=[],n=this.points,s=this.categoryAxis,r=0;this.traverseDataPoints((function(t,o){var a=o.categoryIx,h=o.series,l=e.seriesValueAxis(h),c=n[r++],u=i[a];if(u||(i[a]=u=e.categorySlot(s,a,l)),c){var p=e.plotRange(c,l.startValue()),d=e.valueSlot(l,p);if(d){var f=e.pointSlot(u,d);c.aboveAxis=e.aboveAxis(c,l),c.stackValue=p[1],e.options.isStacked100&&(c.percentage=e.plotValue(c)),e.reflowPoint(c,f)}else c.visible=!1}})),this.reflowCategories(i),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=t},valueSlot:function(t,e){return t.getSlot(e[0],e[1],!this.options.clip)},limitPoints:function(){for(var t=this.categoryPoints,e=t[0].concat(L(t)),i=0;i<e.length;i++)e[i]&&this.limitPoint(e[i])},limitPoint:function(t){var e=this.categoryAxis.limitSlot(t.box);e.equals(t.box)||t.reflow(e)},aboveAxis:function(t,e){var i=this.categoryAxisCrossingValue(e),n=t.value;return e.options.reverse?n<i:n>=i},categoryAxisCrossingValue:function(t){var e=this.categoryAxis,i=t.options;return[].concat(i.axisCrossingValues||i.axisCrossingValue)[e.axisIndex||0]||0},reflowPoint:function(t,e){t.reflow(e)},reflowCategories:function(){},pointSlot:function(t,e){var i=this.options.invertAxes,n=i?e:t,s=i?t:e;return new k(n.x1,s.y1,n.x2,s.y2)},categorySlot:function(t,e){return t.getSlot(e)},traverseDataPoints:function(t){for(var e=this,i=this.options.series,n=Je(i),s=i.length,r=0;r<s;r++)e._outOfRangeCallback(i[r],"_outOfRangeMinPoint",r,t);for(var o=0;o<n;o++)for(var a=0;a<s;a++){var h=i[a],l=e.categoryAxis.categoryAt(o);t(e._bindPoint(h,a,o),{category:l,categoryIx:o,categoriesCount:n,series:h,seriesIx:a})}for(var c=0;c<s;c++)e._outOfRangeCallback(i[c],"_outOfRangeMaxPoint",c,t)},_outOfRangeCallback:function(t,e,i,n){var s=t[e];if(s){var r=s.categoryIx;n(this._bindPoint(t,i,r,s.item),{category:s.category,categoryIx:r,series:t,seriesIx:i,dataItem:s.item})}},_bindPoint:function(t,e,i,n){this._bindCache||(this._bindCache=[]);var s=this._bindCache[e];s||(s=this._bindCache[e]=[]);var r=s[i];return r||(r=s[i]=yt.current.bindPoint(t,i,n)),r},formatPointValue:function(t,e){return null===t.value?"":this.chartService.format.auto(e,t.value)},pointValue:function(t){return t.valueFields.value}});T(ti,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});var ei={click:function(t,e){return t.trigger(we,this.eventArgs(e))},hover:function(t,e){return t.trigger(Ae,this.eventArgs(e))},over:function(t,e){return t.trigger(Se,this.eventArgs(e))},out:function(t,e){return t.trigger(Ce,this.eventArgs(e))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:M(t),originalEvent:t,point:this}}},ii={createNote:function(){var t=this.options.notes,i=this.noteText||t.label.text;!1!==t.visible&&b(i)&&null!==i&&(this.note=new e.Note({value:this.value,text:i,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}},ni=S.extend({init:function(t,e){S.fn.init.call(this),this.value=t,this.options=e,this.aboveAxis=R(this.options.aboveAxis,!0),this.tooltipTracking=!0},render:function(){var t=this.options,e=t.markers,i=t.labels;if(!this._rendered){if(this._rendered=!0,e.visible&&e.size&&(this.marker=this.createMarker(),this.append(this.marker)),i.visible){var n=B(i),s=this.pointData(),r=this.value;n?r=n(s):i.format&&(r=this.formatValue(i.format)),this.label=new H(r,O({align:h,vAlign:h,margin:{left:5,right:5},zIndex:R(i.zIndex,this.series.zIndex)},i),s),this.append(this.label)}this.createNote(),this.errorBar&&this.append(this.errorBar)}},markerBorder:function(){var t=this.options.markers,e=t.background,i=O({color:this.color},t.border);return b(i.color)||(i.color=new ht(e).brightness(kt).toHex()),i},createVisual:function(){},createMarker:function(){var t=this.options.markers;return new z({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:t.background,border:this.markerBorder(),opacity:this.series.opacity||t.opacity,zIndex:R(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})},markerBox:function(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box},reflow:function(t){var e=this.options,i=this.aboveAxis,n=e.vertical;this.render(),this.box=t;var s=t.clone();if(n?i?s.y1-=s.height():s.y2+=s.height():i?s.x1+=s.width():s.x2-=s.width(),this._childBox=s,this.marker&&this.marker.reflow(s),this.reflowLabel(s),this.errorBars)for(var r=0;r<this.errorBars.length;r++)this.errorBars[r].reflow(s);if(this.note){var o=this.markerBox();if(!e.markers.visible||!e.markers.size){var a=o.center();o=new k(a.x,a.y,a.x,a.y)}this.note.reflow(o)}},reflowLabel:function(t){var e=this.options,i=this.label,n=e.labels.position;i&&(n=(n=n===Ht?l:n)===zt?c:n,i.reflow(t),i.box.alignTo(this.markerBox(),n),i.reflow(i.box))},createHighlight:function(){var t=this.options.highlight.markers,e=this.markerBorder().color,i=this.options.markers,n=i.size+(i.border.width||0)+(t.border.width||0),s=new z({type:i.type,width:n,height:n,rotation:i.rotation,background:t.color||e,border:{color:t.border.color,width:t.border.width,opacity:R(t.border.opacity,1)},opacity:R(t.opacity,1)});return s.reflow(this._childBox),s.getElement()},highlightVisual:function(){return(this.marker||{}).visual},highlightVisualArgs:function(){var t,e,i=this.marker;if(i)e=i.paddingBox.toRect(),t=i.visual;else{var n=this.options.markers.size,s=n/2,r=this.box.center();e=new lt.Rect([r.x-s,r.y-s],[n,n])}return{options:this.options,rect:e,visual:t}},tooltipAnchor:function(){var t=this.markerBox(),e=this.owner.pane.clipBox();if(!e||e.overlaps(t)){var i,n,s=t.x2+5,r=u;return this.aboveAxis?(i=t.y1,n=c):(i=t.y2,n=l),{point:new C(s,i),align:{horizontal:r,vertical:n}}}},formatValue:function(t){return this.owner.formatPointValue(this,t)},overlapsBox:function(t){return this.markerBox().overlaps(t)},unclipElements:function(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)},pointData:function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}});ni.prototype.defaults={vertical:!0,markers:{visible:!0,background:p,size:8,type:d,border:{width:2},opacity:1},labels:{visible:!1,position:Ht,margin:D(3),padding:D(4),animation:{type:Ct,delay:St}},notes:{label:{}},highlight:{markers:{border:{color:"#fff",width:2}},zIndex:s.HIGHLIGHT_ZINDEX},errorBars:{line:{width:1}}},O(ni.prototype,ei),O(ni.prototype,ii);var si=S.extend({init:function(t,e,i){S.fn.init.call(this),this.linePoints=t,this.series=e,this.seriesIx=i},points:function(){return this.toGeometryPoints(this.linePoints)},toGeometryPoints:function(t){for(var e=[],i=0,n=t.length;i<n;i++)t[i]&&!1!==t[i].visible&&e.push(t[i]._childBox.toRect().center());return e},createVisual:function(){var t=this,e=this.series.visual;e?(this.visual=e({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:function(){return t.segmentVisual(),t.visual}}),this.visual&&!b(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()},segmentVisual:function(){var t=this.options,e=this.series,i=e.color,n=e._defaults;E(i)&&n&&(i=n.color);var s=st.fromPoints(this.points(),{stroke:{color:i,width:e.width,opacity:e.opacity,dashType:e.dashType},zIndex:e.zIndex});t.closed&&s.close(),this.visual=s},aliasFor:function(t,e){return this.parent.getNearestPoint(e.x,e.y,this.seriesIx)}});T(si,{closed:!1});var ri={calculateStepPoints:function(t){for(var e=this.parent.plotArea.seriesCategoryAxis(this.series).options,i=e.justified,n=e.vertical,s=e.reverse,r=n?f:v,o=n?v:f,a=s?2:1,h=a,l=oi(t[0],r,a,o,h),c=[l],u=1;u<t.length;u++){var p=oi(t[u],r,a,o,h);if(l[r]!==p[r]){var d=new ct;d[r]=l[r],d[o]=p[o],c.push(d,p)}l=p}return i?l!==L(c)&&c.push(l):c.push(oi(L(t),r,a,o,s?1:2)),c}};function oi(t,e,i,n,s){var r=t.box,o=new ct;return o[e]=r[e+i],o[n]=r[n+s],o}var ai=si.extend({points:function(){return this.calculateStepPoints(this.linePoints)}});O(ai.prototype,ri);var hi=si.extend({segmentVisual:function(){var t=this.series,e=t._defaults,i=t.color;E(i)&&e&&(i=e.color);var n=new F(this.options.closed).process(this.points()),s=new st({stroke:{color:i,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});s.segments.push.apply(s.segments,n),this.visual=s}}),li={renderSegments:function(){var t,e=this,i=this.options,n=this.seriesPoints,s=i.series,r=n.length;this._segments=[];for(var o=0;o<r;o++){for(var a=s[o],h=e.sortPoints(n[o]),l=h.length,c=[],u=0;u<l;u++){var p=h[u];p?c.push(p):e.seriesMissingValues(a)!==Mt&&(c.length>1&&(t=e.createSegment(c,a,o,t),e._addSegment(t)),c=[])}c.length>1&&(t=e.createSegment(c,a,o,t),e._addSegment(t))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(t){this._segments.push(t),t.parent=this},sortPoints:function(t){return t},seriesMissingValues:function(t){var e=t.missingValues;return!e&&this.options.isStacked?Lt:e||Mt},getNearestPoint:function(t,e,i){for(var n,s=new C(t,e),o=this.seriesPoints[i],a=r,h=0;h<o.length;h++){var l=o[h];if(l&&b(l.value)&&null!==l.value&&!1!==l.visible){var c=l.box.center().distanceTo(s);c<a&&(n=l,a=c)}}return n}},ci=rt.extend({setup:function(){this._setEnd(this.options.box.x1)},step:function(t){var i=this.options.box;this._setEnd(e.interpolateValue(i.x1,i.x2,t))},_setEnd:function(t){var e=this.element,i=e.segments,n=i[1].anchor(),s=i[2].anchor();e.suspend(),n.setX(t),e.resume(),s.setX(t)}});function ui(t){for(var e=0;e<t.length;e++)if(b(t[e].zIndex))return!0}T(ci,{duration:St}),ot.current.register("clip",ci);var pi={createAnimation:function(){var t=this.getRoot();if(t&&!1!==(t.options||{}).transitions){var e=t.size(),i=st.fromRect(e.toRect());this.visual.clip(i),this.animation=new ci(i,{box:e}),ui(this.options.series)&&this._setChildrenAnimation(i)}},_setChildrenAnimation:function(t){for(var e=this.animationPoints(),i=0;i<e.length;i++){var n=e[i];n&&n.visual&&b(n.visual.options.zIndex)&&n.visual.clip(t)}}},di=ti.extend({render:function(){ti.fn.render.call(this),this.updateStackRange(),this.renderSegments()},pointType:function(){return ni},createPoint:function(t,e){var i=e.categoryIx,n=e.category,s=e.series,r=e.seriesIx,o=this.seriesMissingValues(s),a=t.valueFields.value;if(!b(a)||null===a){if(o!==Lt)return null;a=0}var h=this.pointOptions(s,r);h=this.evalPointOptions(h,a,n,i,s,r);var l=t.fields.color||s.color;E(s.color)&&(l=h.color);var c=new ni(a,h);return c.color=l,this.append(c),c},plotRange:function(t){var e=this.plotValue(t);if(this.options.isStacked)for(var i=t.categoryIx,n=this.categoryPoints[i],s=0;s<n.length;s++){var r=n[s];if(t===r)break;e+=this.plotValue(r),this.options.isStacked100&&(e=Math.min(e,1))}return[e,e]},createSegment:function(t,e,i){var n=e.style;return new(n===Ft?ai:n===Dt?hi:si)(t,e,i)},animationPoints:function(){for(var t=this.points,e=[],i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e.concat(this._segments)},supportsPointInactiveOpacity:function(){return!1}});O(di.prototype,li,pi);var fi=si.extend({init:function(t,e,i,n,s){si.fn.init.call(this,t,e,i),this.prevSegment=n,this.stackPoints=s},createVisual:function(){var t=this.series,e=t._defaults,i=t.line||{},n=t.color;E(n)&&e&&(n=e.color),this.visual=new at({zIndex:t.zIndex}),this.createFill({fill:{color:n,opacity:t.opacity},stroke:null}),i.width>0&&!1!==i.visible&&this.createStroke({stroke:O({color:n,opacity:t.opacity,lineCap:"butt"},i)})},strokeSegments:function(){var t=this._strokeSegments;return t||(t=this._strokeSegments=this.createStrokeSegments()),t},createStrokeSegments:function(){return this.segmentsFromPoints(this.points())},stackSegments:function(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)},createStackSegments:function(t){return this.segmentsFromPoints(this.toGeometryPoints(t)).reverse()},segmentsFromPoints:function(t){return t.map((function(t){return new lt.Segment(t)}))},createStroke:function(t){var e=new st(t);e.segments.push.apply(e.segments,this.strokeSegments()),this.visual.append(e)},hasStackSegment:function(){return this.prevSegment||this.stackPoints&&this.stackPoints.length},createFill:function(t){var e=this.strokeSegments(),i=e.slice(0),n=this.hasStackSegment();if(n){var s=this.stackSegments();N(i,s)}var r=new st(t);r.segments.push.apply(r.segments,i),!n&&e.length>1&&this.fillToAxes(r),this.visual.append(r)},fillToAxes:function(t){var e=this.parent,i=e.options.invertAxes,n=e.seriesValueAxis(this.series),s=e.categoryAxisCrossingValue(n),r=n.getSlot(s,s,!0),o=this.strokeSegments(),a=o[0].anchor(),h=L(o).anchor(),l=i?r.x1:r.y1;i?t.lineTo(l,h.y).lineTo(l,a.y):t.lineTo(h.x,l).lineTo(a.x,l)}}),vi=fi.extend({createStrokeSegments:function(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))},createStackSegments:function(t){return this.segmentsFromPoints(this.calculateStepPoints(t)).reverse()}});O(vi.prototype,ri);var gi=fi.extend({createStrokeSegments:function(){var t=new F(this.options.closed),e=this.points();return t.process(e)},createStackSegments:function(){for(var t=this.strokeSegments(),e=[],i=t.length-1;i>=0;i--){var n=t[i];e.push(new lt.Segment(n.anchor(),n.controlOut(),n.controlIn()))}return e}}),xi=di.extend({createSegment:function(t,e,i,n){var s,r,o=this.options.isStacked,a=(e.line||{}).style;o&&i>0&&n&&("gap"!==this.seriesMissingValues(e)?(r=n.linePoints,s=n):r=this._gapStackPoints(t,i,a));return new(a===Ft?vi:a===Dt?gi:fi)(t,e,i,s,r)},reflow:function(t){di.fn.reflow.call(this,t);var e=this._stackPoints;if(e)for(var i=0;i<e.length;i++){var n=e[i],s=this.categoryAxis.getSlot(n.categoryIx);n.reflow(s)}},_gapStackPoints:function(t,e,i){var n=this,s=this.seriesPoints,r=t[0].categoryIx,o=t.length;r<0&&(r=0,o--);var a=r+o,h=this.seriesOptions[0]._outOfRangeMinPoint?1:0,l=[];this._stackPoints=this._stackPoints||[];for(var c=r;c<a;c++){var u=c+h,p=e,d=void 0;do{d=s[--p][u]}while(p>0&&!d);if(d)i!==Ft&&c>r&&!s[p][u-1]&&l.push(n._previousSegmentPoint(c,u,u-1,p)),l.push(d),i!==Ft&&c+1<a&&!s[p][u+1]&&l.push(n._previousSegmentPoint(c,u,u+1,p));else{var f=n._createGapStackPoint(c);n._stackPoints.push(f),l.push(f)}}return l},_previousSegmentPoint:function(t,e,i,n){for(var s,r=this.seriesPoints,o=n;o>0&&!s;)s=r[--o][i];return s?s=r[o][e]:(s=this._createGapStackPoint(t),this._stackPoints.push(s)),s},_createGapStackPoint:function(t){var e=this.pointOptions({},0),i=new ni(0,e);return i.categoryIx=t,i.series={},i},seriesMissingValues:function(t){return t.missingValues||Lt},supportsPointInactiveOpacity:function(){return!1}}),mi=i.extend({init:function(){this.axisRanges={}},update:function(t){var e=this.axisRanges;for(var i in t){var n=t[i],s=e[i];e[i]=s=s||{min:r,max:o},s.min=Math.min(s.min,n.min),s.max=Math.max(s.max,n.max)}},reset:function(t){this.axisRanges[t]=void 0},query:function(t){return this.axisRanges[t]}}),yi=S.extend({init:function(t,e,i){S.fn.init.call(this,e),this.textBox=new H(t,this.options,i),this.append(this.textBox)},createVisual:function(){this.textBox.options.noclip=this.options.noclip},reflow:function(t){var e=this.options,i=e.vertical,n=e.aboveAxis,s=this.children[0],r=s.options,o=s.box,a=s.options.padding,p=t;r.align=i?h:u,r.vAlign=i?l:h,e.position===Ye?i?(r.vAlign=l,!n&&o.height()<t.height()&&(r.vAlign=c)):r.align=n?g:u:e.position===h?(r.vAlign=h,r.align=h):e.position===qe?i?r.vAlign=n?c:l:r.align=n?u:g:e.position===Ue&&(i?p=n?new k(t.x1,t.y1-o.height(),t.x2,t.y1):new k(t.x1,t.y2,t.x2,t.y2+o.height()):(r.align=h,p=n?new k(t.x2,t.y1,t.x2+o.width(),t.y2):new k(t.x1-o.width(),t.y1,t.x1,t.y2))),e.rotation||(i?a.left=a.right=(p.width()-s.contentBox.width())/2:a.top=a.bottom=(p.height()-s.contentBox.height())/2),s.reflow(p)},alignToClipBox:function(t){var e=this.options.vertical?v:f,i=e+"1",n=e+"2",s=this.children[0],r=this.parent.box;if(r[i]<t[i]||t[n]<r[n]){var o=s.paddingBox.clone();o[i]=Math.max(r[i],t[i]),o[n]=Math.min(r[n],t[n]),this.reflow(o)}}});function _i(t){var e=t.overlay;return e&&e.gradient&&"none"!==e.gradient}T(yi,{position:Ue,margin:D(3),padding:D(4),color:x,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:Ct,delay:St},zIndex:2});var bi=S.extend({init:function(t,e){S.fn.init.call(this),this.options=e,this.color=e.color||p,this.aboveAxis=R(this.options.aboveAxis,!0),this.value=t},render:function(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))},createLabel:function(){var t=this.options,e=t.labels;if(e.visible){var i,n=this.pointData(),s=B(e);i=s?s(n):this.formatValue(e.format),this.label=new yi(i,O({vertical:t.vertical},e),n),this.append(this.label)}},formatValue:function(t){return this.owner.formatPointValue(this,t)},reflow:function(t){this.render();var e=this.label;if(this.box=t,e&&(e.options.aboveAxis=this.aboveAxis,e.reflow(t)),this.note&&this.note.reflow(t),this.errorBars)for(var i=0;i<this.errorBars.length;i++)this.errorBars[i].reflow(t)},createVisual:function(){var t=this,e=this.box,i=this.options,n=i.visual;if(!1!==this.visible)if(S.fn.createVisual.call(this),n){var s=this.rectVisual=n({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:e.toRect(),createVisual:function(){var e=new at;return t.createRect(e),e},options:i});s&&this.visual.append(s)}else e.width()>0&&e.height()>0&&this.createRect(this.visual)},createRect:function(t){var e=this.options,i=e.border,n=b(i.opacity)?i.opacity:e.opacity,s=this.box.toRect();s.size.width=Math.round(s.size.width);var r=this.rectVisual=st.fromRect(s,{fill:{color:this.color,opacity:e.opacity},stroke:{color:this.getBorderColor(),width:i.width,opacity:n,dashType:i.dashType}}),o=this.box.width(),a=this.box.height();if((e.vertical?o:a)>6&&(P(r),(o<1||a<1)&&(r.options.stroke.lineJoin="round")),t.append(r),_i(e)){var h=this.createGradientOverlay(r,{baseColor:this.color},O({end:e.vertical?void 0:[0,1]},e.overlay));t.append(h)}},createHighlight:function(t){var e=st.fromRect(this.box.toRect(),t);return P(e)},highlightVisual:function(){return this.rectVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}},getBorderColor:function(){var t=this.color,e=this.options.border,i=e._brightness||kt,n=e.color;return b(n)||(n=new ht(t).brightness(i).toHex()),n},tooltipAnchor:function(){var t,e,i=this,n=i.options,s=i.box,r=i.aboveAxis,o=this.owner.pane.clipBox()||s,a=u,h=l;if(n.vertical)t=Math.min(s.x2,o.x2)+5,r?e=Math.max(s.y1,o.y1):(e=Math.min(s.y2,o.y2),h=c);else{var p=Math.max(s.x1,o.x1),d=Math.min(s.x2,o.x2);n.isStacked?(h=c,r?(a=g,t=d):t=p,e=Math.max(s.y1,o.y1)-5):(r?t=d+5:(t=p-5,a=g),e=Math.max(s.y1,o.y1))}return{point:new C(t,e),align:{horizontal:a,vertical:h}}},overlapsBox:function(t){return this.box.overlaps(t)},pointData:function(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}}});function wi(t,e){t.forEach(e)}function Ai(t,e){for(var i=t.length,n=i-1;n>=0;n--)e(t[n],n-i-1)}O(bi.prototype,ei),O(bi.prototype,ii),bi.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:"glass"},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}}};var Si=S.extend({init:function(t){S.fn.init.call(this,t),this.forEach=t.rtl?Ai:wi},reflow:function(t){var e=this.options,i=e.vertical,n=e.gap,s=e.spacing,r=this.children,o=r.length,a=i?v:f,h=o+n+s*(o-1),l=(i?t.height():t.width())/h,c=t[a+1]+l*(n/2);this.forEach(r,(function(e,i){var n=(e.box||t).clone();n[a+1]=c,n[a+2]=c+l,e.reflow(n),i<o-1&&(c+=l*s),c+=l}))}});T(Si,{vertical:!1,gap:0,spacing:0});var Ci=S.extend({reflow:function(t){for(var e=this.options.vertical?f:v,i=this.children,n=i.length,s=this.box=new k,r=0;r<n;r++){var o=i[r];if(!1!==o.visible){var a=o.box.clone();a.snapTo(t,e),0===r&&(s=this.box=a.clone()),o.reflow(a),s.wrap(a)}}}});T(Ci,{vertical:!0});var ki=ti.extend({render:function(){ti.fn.render.call(this),this.updateStackRange()},pointType:function(){return bi},clusterType:function(){return Si},stackType:function(){return Ci},stackLimits:function(t,e){return ti.fn.stackLimits.call(this,t,e)},createPoint:function(t,e){var i=e.categoryIx,n=e.category,s=e.series,r=e.seriesIx,o=this.options,a=this.children,h=o.isStacked,l=this.pointValue(t),c=this.pointOptions(s,r),u=c.labels;h&&u.position===Ue&&(u.position=Ye),c.isStacked=h;var p=t.fields.color||s.color;l<0&&c.negativeColor&&(p=c.negativeColor),c=this.evalPointOptions(c,l,n,i,s,r),E(s.color)&&(p=c.color);var d=new(this.pointType())(l,c);d.color=p;var f=a[i];f||(f=new(this.clusterType())({vertical:o.invertAxes,gap:o.gap,spacing:o.spacing,rtl:!o.invertAxes&&(this.chartService||{}).rtl}),this.append(f));h?this.getStackWrap(s,f).append(d):f.append(d);return d},getStackWrap:function(t,e){var i,n=t.stack,r=n&&n.group||n,o=e.children;if(typeof r===s.STRING){for(var a=0;a<o.length;a++)if(o[a]._stackGroup===r){i=o[a];break}}else i=o[0];i||((i=new(this.stackType())({vertical:!this.options.invertAxes}))._stackGroup=r,e.append(i));return i},categorySlot:function(t,e,i){var n=this.options,s=t.getSlot(e),r=i.startValue();if(n.isStacked){var o=i.getSlot(r,r,!0),a=n.invertAxes?f:v;s[a+1]=s[a+2]=o[a+1]}return s},reflowCategories:function(t){for(var e=this.children,i=e.length,n=0;n<i;n++)e[n].reflow(t[n])},createAnimation:function(){this._setAnimationOptions(),ti.fn.createAnimation.call(this),ui(this.options.series)&&this._setChildrenAnimation()},_setChildrenAnimation:function(){for(var t=this.points,e=0;e<t.length;e++){var i=t[e],n=i.visual;n&&b(n.options.zIndex)&&(i.options.animation=this.options.animation,i.createAnimation())}},_setAnimationOptions:function(){var t,e=this.options,i=e.animation||{};if(e.isStacked){var n=this.seriesValueAxis(e.series[0]);t=n.getSlot(n.startValue())}else t=this.categoryAxis.getSlot(0);i.origin=new ct(t.x1,t.y1),i.vertical=!e.invertAxes}});T(ki,{animation:{type:Gt}});var Pi=S.extend({init:function(t,e){S.fn.init.call(this,e),this.value=t},reflow:function(t){var e=this,i=e.options,n=e.value,s=e.owner.seriesValueAxis(i),r=s.getSlot(n.open,n.close),o=s.getSlot(n.low,n.high);r.x1=o.x1=t.x1,r.x2=o.x2=t.x2,this.realBody=r;var a=o.center().x,h=[];h.push([[a,o.y1],[a,r.y1]]),h.push([[a,r.y2],[a,o.y2]]),this.lines=h,this.box=o.clone().wrap(r),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()},reflowNote:function(){this.note&&this.note.reflow(this.box)},createVisual:function(){S.fn.createVisual.call(this),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()},mainVisual:function(t){var e=new at;return this.createBody(e,t),this.createLines(e,t),e},createBody:function(t,e){var i=st.fromRect(this.realBody.toRect(),{fill:{color:this.color,opacity:e.opacity},stroke:null});e.border.width>0&&i.options.set("stroke",{color:this.getBorderColor(),width:e.border.width,dashType:e.border.dashType,opacity:R(e.border.opacity,e.opacity)}),P(i),t.append(i),_i(e)&&t.append(this.createGradientOverlay(i,{baseColor:this.color},O({end:e.vertical?void 0:[0,1]},e.overlay)))},createLines:function(t,e){this.drawLines(t,e,this.lines,e.line)},drawLines:function(t,e,i,n){if(i)for(var s={stroke:{color:n.color||this.color,opacity:R(n.opacity,e.opacity),width:n.width,dashType:n.dashType,lineCap:"butt"}},r=0;r<i.length;r++){var o=st.fromPoints(i[r],s);P(o),t.append(o)}},getBorderColor:function(){var t=this.options.border,e=t.color;return b(e)||(e=new ht(this.color).brightness(t._brightness).toHex()),e},createOverlay:function(){var t=st.fromRect(this.box.toRect(),{fill:{color:p,opacity:0},stroke:null});this.visual.append(t)},createHighlight:function(){var t=this.options.highlight,e=this.color;this.color=t.color||this.color;var i=this.mainVisual(O({},this.options,{line:{color:this.getBorderColor()}},t));return this.color=e,i},highlightVisual:function(){return this._mainVisual},highlightVisualArgs:function(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}},tooltipAnchor:function(){var t=this.box,e=this.owner.pane.clipBox()||t;return{point:new C(t.x2+5,Math.max(t.y1,e.y1)+5),align:{horizontal:u,vertical:l}}},formatValue:function(t){return this.owner.formatPointValue(this,t)},overlapsBox:function(t){return this.box.overlaps(t)}});function Ti(t){return gt(t)===t.length}T(Pi,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}}}),O(Pi.prototype,ei),O(Pi.prototype,ii);var Ii=ti.extend({reflowCategories:function(t){for(var e=this.children,i=e.length,n=0;n<i;n++)e[n].reflow(t[n])},addValue:function(t,e){var i,n=e.categoryIx,s=e.category,r=e.series,o=e.seriesIx,a=this.children,h=this.options,l=t.valueFields,c=Ti(this.splitValue(l)),u=r.data[n],p=this.categoryPoints[n];p||(this.categoryPoints[n]=p=[]),c&&(i=this.createPoint(t,e));var d=a[n];d||(d=new Si({vertical:h.invertAxes,gap:h.gap,spacing:h.spacing,rtl:!h.invertAxes&&(this.chartService||{}).rtl}),this.append(d)),i&&(this.updateRange(l,e),d.append(i),i.categoryIx=n,i.category=s,i.series=r,i.seriesIx=o,i.owner=this,i.dataItem=u,i.noteText=t.fields.noteText),this.points.push(i),p.push(i)},pointType:function(){return Pi},createPoint:function(t,e){var i=e.categoryIx,n=e.category,s=e.series,r=e.seriesIx,o=this.pointType(),a=t.valueFields,h=O({},s),l=t.fields.color||s.color;h=this.evalPointOptions(h,a,n,i,s,r),s.type===Ut&&a.open>a.close&&(l=t.fields.downColor||s.downColor||s.color),E(s.color)&&(l=h.color),h.vertical=!this.options.invertAxes;var c=new o(a,h);return c.color=l,c},splitValue:function(t){return[t.low,t.open,t.close,t.high]},updateRange:function(t,e){var i=e.series.axis,n=this.splitValue(t),s=this.valueAxisRanges[i];s=this.valueAxisRanges[i]=s||{min:r,max:o},s=this.valueAxisRanges[i]={min:Math.min.apply(Math,n.concat([s.min])),max:Math.max.apply(Math,n.concat([s.max]))}},formatPointValue:function(t,e){var i=t.value;return this.chartService.format.auto(e,i.open,i.high,i.low,i.close,t.category)},animationPoints:function(){return this.points}});O(Ii.prototype,pi);var Ei=Pi.extend({init:function(t,e){Pi.fn.init.call(this,t,e),this.createNote()},reflow:function(t){var e,i,n=this,s=n.options,r=n.value,o=n.owner.seriesValueAxis(s);this.boxSlot=i=o.getSlot(r.q1,r.q3),this.realBody=i,this.reflowBoxSlot(t),this.whiskerSlot=e=o.getSlot(r.lower,r.upper),this.reflowWhiskerSlot(t);var a=o.getSlot(r.median);if(r.mean){var h=o.getSlot(r.mean);this.meanPoints=this.calcMeanPoints(t,h)}this.whiskerPoints=this.calcWhiskerPoints(i,e),this.medianPoints=this.calcMedianPoints(t,a),this.box=e.clone().wrap(i),this.reflowNote()},reflowBoxSlot:function(t){this.boxSlot.x1=t.x1,this.boxSlot.x2=t.x2},reflowWhiskerSlot:function(t){this.whiskerSlot.x1=t.x1,this.whiskerSlot.x2=t.x2},calcMeanPoints:function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},calcWhiskerPoints:function(t,e){var i=e.center().x;return[[[i-5,e.y1],[i+5,e.y1],[i,e.y1],[i,t.y1]],[[i-5,e.y2],[i+5,e.y2],[i,e.y2],[i,t.y2]]]},calcMedianPoints:function(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]},renderOutliers:function(t){for(var e=this.value,i=e.outliers||[],n=3*Math.abs(e.q3-e.q1),s=[],r=t.markers||{},o=0;o<i.length;o++){var a=i[o];r=a<e.q3+n&&a>e.q1-n?t.outliers:t.extremes;var h=O({},r.border);b(h.color)||(b(this.color)?h.color=this.color:h.color=new ht(r.background).brightness(kt).toHex());var l=new z({type:r.type,width:r.size,height:r.size,rotation:r.rotation,background:r.background,border:h,opacity:r.opacity});l.value=a,s.push(l)}return this.reflowOutliers(s),s},reflowOutliers:function(t){for(var e=this,i=this.owner.seriesValueAxis(this.options),n=this.box.center(),s=0;s<t.length;s++){var r=t[s].value,o=i.getSlot(r);e.options.vertical?o.move(n.x):o.move(void 0,n.y),e.box=e.box.wrap(o),t[s].reflow(o)}},mainVisual:function(t){for(var e=Pi.fn.mainVisual.call(this,t),i=this.renderOutliers(t),n=0;n<i.length;n++){var s=i[n].getElement();s&&e.append(s)}return e},createLines:function(t,e){this.drawLines(t,e,this.whiskerPoints,e.whiskers),this.drawLines(t,e,this.medianPoints,e.median),this.drawLines(t,e,this.meanPoints,e.mean)},getBorderColor:function(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:Pi.fn.getBorderColor.call(this)}});T(Ei,{border:{_brightness:.8},line:{width:2},median:{color:"#f6f6f6"},mean:{width:2,dashType:"dash",color:"#f6f6f6"},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:s.CROSS,background:p,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:d,background:p,border:{width:2,opacity:1},opacity:0}}),O(Ei.prototype,ei);var Ri=Ei.extend({reflowBoxSlot:function(t){this.boxSlot.y1=t.y1,this.boxSlot.y2=t.y2},reflowWhiskerSlot:function(t){this.whiskerSlot.y1=t.y1,this.whiskerSlot.y2=t.y2},calcMeanPoints:function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]},calcWhiskerPoints:function(t,e){var i=e.center().y;return[[[e.x1,i-5],[e.x1,i+5],[e.x1,i],[t.x1,i]],[[e.x2,i-5],[e.x2,i+5],[e.x2,i],[t.x2,i]]]},calcMedianPoints:function(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]}}),Vi=Ii.extend({addValue:function(t,e){var i,n=e.categoryIx,s=e.category,r=e.series,o=e.seriesIx,a=this.children,h=this.options,l=t.valueFields,c=Ti(this.splitValue(l)),u=r.data[n],p=this.categoryPoints[n];p||(this.categoryPoints[n]=p=[]),c&&(i=this.createPoint(t,e));var d=a[n];d||(d=new Si({vertical:h.invertAxes,gap:h.gap,spacing:h.spacing,rtl:!h.invertAxes&&(this.chartService||{}).rtl}),this.append(d)),i&&(this.updateRange(l,e),d.append(i),i.categoryIx=n,i.category=s,i.series=r,i.seriesIx=o,i.owner=this,i.dataItem=u),this.points.push(i),p.push(i)},pointType:function(){return this.options.invertAxes?Ri:Ei},splitValue:function(t){return[t.lower,t.q1,t.median,t.q3,t.upper]},updateRange:function(t,e){var i=e.series.axis,n=this.valueAxisRanges[i],s=this.splitValue(t).concat(this.filterOutliers(t.outliers));b(t.mean)&&(s=s.concat(t.mean)),n=this.valueAxisRanges[i]=n||{min:r,max:o},n=this.valueAxisRanges[i]={min:Math.min.apply(Math,s.concat([n.min])),max:Math.max.apply(Math,s.concat([n.max]))}},formatPointValue:function(t,e){var i=t.value;return this.chartService.format.auto(e,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,t.category)},filterOutliers:function(t){for(var e=(t||[]).length,i=[],n=0;n<e;n++){var s=t[n];b(s)&&null!==s&&i.push(s)}return i},supportsPointInactiveOpacity:function(){return!1}}),Oi=Ke.extend({getAxis:function(){var t=this.chart.seriesAxes(this.series);return this.isVertical?t.y:t.x}});function Li(t){return b(t)&&null!==t}var Mi=S.extend({init:function(t,e){S.fn.init.call(this,e),this.plotArea=t,this.chartService=t.chartService,this._initFields(),this.render()},_initFields:function(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]},render:function(){this.traverseDataPoints(this.addValue.bind(this))},addErrorBar:function(t,e,i){var s,r=t.value[e],o=e+"Value",a=e+"ErrorLow",h=e+"ErrorHigh",l=i.seriesIx,c=i.series,u=t.options.errorBars,p=i[a],d=i[h];n(r)&&(n(p)&&n(d)&&(s={low:p,high:d}),u&&b(u[o])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[e][l]=this.seriesErrorRanges[e][l]||new wt(u[o],c,e),s=this.seriesErrorRanges[e][l].getErrorRange(r,u[o])),s&&this.addPointErrorBar(s,t,e))},addPointErrorBar:function(t,e,i){var n=t.low,s=t.high,r=e.series,o=e.options.errorBars,a=i===v,h={};e[i+"Low"]=n,e[i+"High"]=s,e.errorBars=e.errorBars||[];var l=new Oi(n,s,a,this,r,o);e.errorBars.push(l),e.append(l),h[i]=n,this.updateRange(h,r),h[i]=s,this.updateRange(h,r)},addValue:function(e,i){var n,s=e.x,r=e.y,o=i.seriesIx,a=this.options.series[o],h=this.seriesMissingValues(a),l=this.seriesPoints[o],c=e;Li(s)&&Li(r)||(c=this.createMissingValue(c,h)),c&&((n=this.createPoint(c,i))&&(t.extend(n,i),this.addErrorBar(n,f,i),this.addErrorBar(n,v,i)),this.updateRange(c,i.series)),this.points.push(n),l.push(n)},seriesMissingValues:function(t){return t.missingValues},createMissingValue:function(){},updateRange:function(t,e){var i=this.chartService.intl,n=e.xAxis,s=e.yAxis,a=t.x,h=t.y,l=this.xAxisRanges[n],c=this.yAxisRanges[s];Li(a)&&(l=this.xAxisRanges[n]=l||{min:r,max:o},G(a)&&(a=X(i,a)),l.min=Math.min(l.min,a),l.max=Math.max(l.max,a)),Li(h)&&(c=this.yAxisRanges[s]=c||{min:r,max:o},G(h)&&(h=X(i,h)),c.min=Math.min(c.min,h),c.max=Math.max(c.max,h))},evalPointOptions:function(t,e,i){var n=i.series,s=i.seriesIx,r={defaults:n._defaults,excluded:["data","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint"]},o=this._evalSeries[s];b(o)||(this._evalSeries[s]=o=$e(t,{},r,!0));var a=t;return o&&$e(a=O({},t),{value:e,series:n,dataItem:i.dataItem},r),a},pointType:function(){return ni},pointOptions:function(t,e){var i=this.seriesOptions[e];if(!i){var n=this.pointType().prototype.defaults;this.seriesOptions[e]=i=O({},n,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i},createPoint:function(t,e){var i=e.series,n=this.pointOptions(i,e.seriesIx),s=e.color||i.color;n=this.evalPointOptions(n,t,e),E(i.color)&&(s=n.color);var r=new ni(t,n);return r.color=s,this.append(r),r},seriesAxes:function(t){var e=t.xAxis,i=t.yAxis,n=this.plotArea,s=e?n.namedXAxes[e]:n.axisX,r=i?n.namedYAxes[i]:n.axisY;if(!s)throw new Error("Unable to locate X axis with name "+e);if(!r)throw new Error("Unable to locate Y axis with name "+i);return{x:s,y:r}},reflow:function(t){var e=this,i=this.points,n=!this.options.clip,s=0;this.traverseDataPoints((function(t,r){var o=i[s++],a=e.seriesAxes(r.series),h=a.x.getSlot(t.x,t.x,n),l=a.y.getSlot(t.y,t.y,n);if(o)if(h&&l){var c=e.pointSlot(h,l);o.reflow(c)}else o.visible=!1})),this.box=t},pointSlot:function(t,e){return new k(t.x1,e.y1,t.x2,e.y2)},traverseDataPoints:function(t){for(var e=this.options.series,i=this.seriesPoints,n=0;n<e.length;n++){var s=e[n];i[n]||(i[n]=[]);for(var r=0;r<s.data.length;r++){var o=this._bindPoint(s,n,r),a=o.valueFields,h=o.fields;t(a,O({pointIx:r,series:s,seriesIx:n,dataItem:s.data[r],owner:this},h))}}},formatPointValue:func