Chart.js/dist/Chart.bundle.min.js

21 lines
185 KiB
JavaScript
Raw Normal View History

!function t(e,i,s){function o(n,r){if(!i[n]){if(!e[n]){var h="function"==typeof require&&require;if(!r&&h)return h(n,!0);if(a)return a(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}var c=i[n]={exports:{}};e[n][0].call(c.exports,function(t){var i=e[n][1][t];return o(i?i:t)},c,c.exports,t,e,i,s)}return i[n].exports}for(var a="function"==typeof require&&require,n=0;n<s.length;n++)o(s[n]);return o}({1:[function(t,e,i){!function s(e,i,o){function a(r,h){if(!i[r]){if(!e[r]){var l="function"==typeof t&&t;if(!h&&l)return l(r,!0);if(n)return n(r,!0);var c=new Error("Cannot find module '"+r+"'");throw c.code="MODULE_NOT_FOUND",c}var u=i[r]={exports:{}};e[r][0].call(u.exports,function(t){var i=e[r][1][t];return a(i?i:t)},u,u.exports,s,e,i,o)}return i[r].exports}for(var n="function"==typeof t&&t,r=0;r<o.length;r++)a(o[r]);return a}({1:[function(t,e,i){!function(){var i=t("color-convert"),s=t("color-string"),o=function(t){if(t instanceof o)return t;if(!(this instanceof o))return new o(t);if(this.values={rgb:[0,0,0],hsl:[0,0,0],hsv:[0,0,0],hwb:[0,0,0],cmyk:[0,0,0,0],alpha:1},"string"==typeof t){var e=s.getRgba(t);if(e)this.setValues("rgb",e);else if(e=s.getHsla(t))this.setValues("hsl",e);else{if(!(e=s.getHwb(t)))throw new Error('Unable to parse color from string "'+t+'"');this.setValues("hwb",e)}}else if("object"==typeof t){var e=t;if(void 0!==e.r||void 0!==e.red)this.setValues("rgb",e);else if(void 0!==e.l||void 0!==e.lightness)this.setValues("hsl",e);else if(void 0!==e.v||void 0!==e.value)this.setValues("hsv",e);else if(void 0!==e.w||void 0!==e.whiteness)this.setValues("hwb",e);else{if(void 0===e.c&&void 0===e.cyan)throw new Error("Unable to parse color from object "+JSON.stringify(t));this.setValues("cmyk",e)}}};o.prototype={rgb:function(t){return this.setSpace("rgb",arguments)},hsl:function(t){return this.setSpace("hsl",arguments)},hsv:function(t){return this.setSpace("hsv",arguments)},hwb:function(t){return this.setSpace("hwb",arguments)},cmyk:function(t){return this.setSpace("cmyk",arguments)},rgbArray:function(){return this.values.rgb},hslArray:function(){return this.values.hsl},hsvArray:function(){return this.values.hsv},hwbArray:function(){return 1!==this.values.alpha?this.values.hwb.concat([this.values.alpha]):this.values.hwb},cmykArray:function(){return this.values.cmyk},rgbaArray:function(){var t=this.values.rgb;return t.concat([this.values.alpha])},hslaArray:function(){var t=this.values.hsl;return t.concat([this.values.alpha])},alpha:function(t){return void 0===t?this.values.alpha:(this.setValues("alpha",t),this)},red:function(t){return this.setChannel("rgb",0,t)},green:function(t){return this.setChannel("rgb",1,t)},blue:function(t){return this.setChannel("rgb",2,t)},hue:function(t){return this.setChannel("hsl",0,t)},saturation:function(t){return this.setChannel("hsl",1,t)},lightness:function(t){return this.setChannel("hsl",2,t)},saturationv:function(t){return this.setChannel("hsv",1,t)},whiteness:function(t){return this.setChannel("hwb",1,t)},blackness:function(t){return this.setChannel("hwb",2,t)},value:function(t){return this.setChannel("hsv",2,t)},cyan:function(t){return this.setChannel("cmyk",0,t)},magenta:function(t){return this.setChannel("cmyk",1,t)},yellow:function(t){return this.setChannel("cmyk",2,t)},black:function(t){return this.setChannel("cmyk",3,t)},hexString:function(){return s.hexString(this.values.rgb)},rgbString:function(){return s.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return s.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return s.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return s.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return s.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return s.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return s.keyword(this.values.rgb,this.values.alpha)},rgbNumber:function(){return this.values.rgb[0]<<16|this.values.rgb[1]<<8|this.values.rgb[2]},luminosity:function(){for(var t=this.va
//! moment.js
//! version : 2.10.6
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
!function(t,s){"object"==typeof i&&"undefined"!=typeof e?e.exports=s():"function"==typeof define&&define.amd?define(s):t.moment=s()}(this,function(){"use strict";function i(){return Oi.apply(null,arguments)}function s(t){Oi=t}function o(t){return"[object Array]"===Object.prototype.toString.call(t)}function a(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function n(t,e){var i,s=[];for(i=0;i<t.length;++i)s.push(e(t[i],i));return s}function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function h(t,e){for(var i in e)r(e,i)&&(t[i]=e[i]);return r(e,"toString")&&(t.toString=e.toString),r(e,"valueOf")&&(t.valueOf=e.valueOf),t}function l(t,e,i,s){return It(t,e,i,s,!0).utc()}function c(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function u(t){return null==t._pf&&(t._pf=c()),t._pf}function d(t){if(null==t._isValid){var e=u(t);t._isValid=!(isNaN(t._d.getTime())||!(e.overflow<0)||e.empty||e.invalidMonth||e.invalidWeekday||e.nullInput||e.invalidFormat||e.userInvalidated),t._strict&&(t._isValid=t._isValid&&0===e.charsLeftOver&&0===e.unusedTokens.length&&void 0===e.bigHour)}return t._isValid}function f(t){var e=l(NaN);return null!=t?h(u(e),t):u(e).userInvalidated=!0,e}function m(t,e){var i,s,o;if("undefined"!=typeof e._isAMomentObject&&(t._isAMomentObject=e._isAMomentObject),"undefined"!=typeof e._i&&(t._i=e._i),"undefined"!=typeof e._f&&(t._f=e._f),"undefined"!=typeof e._l&&(t._l=e._l),"undefined"!=typeof e._strict&&(t._strict=e._strict),"undefined"!=typeof e._tzm&&(t._tzm=e._tzm),"undefined"!=typeof e._isUTC&&(t._isUTC=e._isUTC),"undefined"!=typeof e._offset&&(t._offset=e._offset),"undefined"!=typeof e._pf&&(t._pf=u(e)),"undefined"!=typeof e._locale&&(t._locale=e._locale),zi.length>0)for(i in zi)s=zi[i],o=e[s],"undefined"!=typeof o&&(t[s]=o);return t}function g(t){m(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),Vi===!1&&(Vi=!0,i.updateOffset(this),Vi=!1)}function p(t){return t instanceof g||null!=t&&null!=t._isAMomentObject}function b(t){return 0>t?Math.ceil(t):Math.floor(t)}function v(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=b(e)),i}function x(t,e,i){var s,o=Math.min(t.length,e.length),a=Math.abs(t.length-e.length),n=0;for(s=0;o>s;s++)(i&&t[s]!==e[s]||!i&&v(t[s])!==v(e[s]))&&n++;return n+a}function y(){}function k(t){return t?t.toLowerCase().replace("_","-"):t}function _(t){for(var e,i,s,o,a=0;a<t.length;){for(o=k(t[a]).split("-"),e=o.length,i=k(t[a+1]),i=i?i.split("-"):null;e>0;){if(s=D(o.slice(0,e).join("-")))return s;if(i&&i.length>=e&&x(o,i,!0)>=e-1)break;e--}a++}return null}function D(i){var s=null;if(!Bi[i]&&"undefined"!=typeof e&&e&&e.exports)try{s=Ri._abbr,t("./locale/"+i),S(s)}catch(o){}return Bi[i]}function S(t,e){var i;return t&&(i="undefined"==typeof e?C(t):w(t,e),i&&(Ri=i)),Ri._abbr}function w(t,e){return null!==e?(e.abbr=t,Bi[t]=Bi[t]||new y,Bi[t].set(e),S(t),Bi[t]):(delete Bi[t],null)}function C(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return Ri;if(!o(t)){if(e=D(t))return e;t=[t]}return _(t)}function M(t,e){var i=t.toLowerCase();Yi[i]=Yi[i+"s"]=Yi[e]=t}function A(t){return"string"==typeof t?Yi[t]||Yi[t.toLowerCase()]:void 0}function T(t){var e,i,s={};for(i in t)r(t,i)&&(e=A(i),e&&(s[e]=t[i]));return s}function I(t,e){return function(s){return null!=s?(P(this,t,s),i.updateOffset(this,e),this):F(this,t)}}function F(t,e){return t._d["get"+(t._isUTC?"UTC":"")+e]()}function P(t,e,i){return t._d["set"+(t._isUTC?"UTC":"")+e](i)}function W(t,e){var i;if("object"==typeof t)for(i in t)this.set(i,t[i]);else if(t=A(t),"function"==typeof this[t])return this[t](e);return this}function L(t,e,i){var s=""+Math.abs(t),o=e-s.length,a=t>=0;return(a?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+s}function O(t,e,i,s){var o=s;"string"==typeof s&&(o=function(){return this[s]()}),t&&(ji[t]=o),e&&(ji[e[0]]=function(){return L(o.apply(this,arguments),e[1],e[2])}),i&&(ji[i]=function(){return this.localeData().ordinal(o.apply(this,arguments
Ns.utcOffset=Nt,Ns.utc=Et,Ns.local=jt,Ns.parseZone=Ut,Ns.hasAlignedHourOffset=Gt,Ns.isDST=qt,Ns.isDSTShifted=Zt,Ns.isLocal=Qt,Ns.isUtcOffset=Jt,Ns.isUtc=Xt,Ns.isUTC=Xt,Ns.zoneAbbr=Xe,Ns.zoneName=$e,Ns.dates=it("dates accessor is deprecated. Use date instead.",Fs),Ns.months=it("months accessor is deprecated. Use month instead",$),Ns.years=it("years accessor is deprecated. Use year instead",ks),Ns.zone=it("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Ht);var Hs=Ns,Es={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},js={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Us="Invalid date",Gs="%d",qs=/\d{1,2}/,Zs={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Qs=y.prototype;Qs._calendar=Es,Qs.calendar=ei,Qs._longDateFormat=js,Qs.longDateFormat=ii,Qs._invalidDate=Us,Qs.invalidDate=si,Qs._ordinal=Gs,Qs.ordinal=oi,Qs._ordinalParse=qs,Qs.preparse=ai,Qs.postformat=ai,Qs._relativeTime=Zs,Qs.relativeTime=ni,Qs.pastFuture=ri,Qs.set=hi,Qs.months=Z,Qs._months=ms,Qs.monthsShort=Q,Qs._monthsShort=gs,Qs.monthsParse=J,Qs.week=dt,Qs._week=_s,Qs.firstDayOfYear=mt,Qs.firstDayOfWeek=ft,Qs.weekdays=Be,Qs._weekdays=Ps,Qs.weekdaysMin=Ne,Qs._weekdaysMin=Ls,Qs.weekdaysShort=Ye,Qs._weekdaysShort=Ws,Qs.weekdaysParse=He,Qs.isPM=Ze,Qs._meridiemParse=Os,Qs.meridiem=Qe,S("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,i=1===v(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+i}}),i.lang=it("moment.lang is deprecated. Use moment.locale instead.",S),i.langData=it("moment.langData is deprecated. Use moment.localeData instead.",C);var Js=Math.abs,Xs=Ci("ms"),$s=Ci("s"),Ks=Ci("m"),to=Ci("h"),eo=Ci("d"),io=Ci("w"),so=Ci("M"),oo=Ci("y"),ao=Ai("milliseconds"),no=Ai("seconds"),ro=Ai("minutes"),ho=Ai("hours"),lo=Ai("days"),co=Ai("months"),uo=Ai("years"),fo=Math.round,mo={s:45,m:45,h:22,d:26,M:11},go=Math.abs,po=Ot.prototype;po.abs=pi,po.add=vi,po.subtract=xi,po.as=Si,po.asMilliseconds=Xs,po.asSeconds=$s,po.asMinutes=Ks,po.asHours=to,po.asDays=eo,po.asWeeks=io,po.asMonths=so,po.asYears=oo,po.valueOf=wi,po._bubble=ki,po.get=Mi,po.milliseconds=ao,po.seconds=no,po.minutes=ro,po.hours=ho,po.days=lo,po.weeks=Ti,po.months=co,po.years=uo,po.humanize=Wi,po.toISOString=Li,po.toString=Li,po.toJSON=Li,po.locale=xe,po.localeData=ye,po.toIsoString=it("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Li),po.lang=Is,O("X",0,0,"unix"),O("x",0,0,"valueOf"),N("x",es),N("X",ss),j("X",function(t,e,i){i._d=new Date(1e3*parseFloat(t,10))}),j("x",function(t,e,i){i._d=new Date(v(t))}),i.version="2.10.6",s(Ft),i.fn=Hs,i.min=Wt,i.max=Lt,i.utc=l,i.unix=Ke,i.months=ui,i.isDate=a,i.locale=S,i.invalid=f,i.duration=$t,i.isMoment=p,i.weekdays=fi,i.parseZone=ti,i.localeData=C,i.isDuration=Rt,i.monthsShort=di,i.weekdaysMin=gi,i.defineLocale=w,i.weekdaysShort=mi,i.normalizeUnits=A,i.relativeTimeThreshold=Pi;var bo=i;return bo})},{}],3:[function(t,e,i){/*!
* Chart.js
* http://chartjs.org/
* Version: 2.0.0-beta2
*
* Copyright 2015 Nick Downie
* Released under the MIT license
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
*/
var s=t("./core/core.js")();t("./core/core.element")(s),t("./core/core.animation")(s),t("./core/core.controller")(s),t("./core/core.datasetController")(s),t("./core/core.layoutService")(s),t("./core/core.legend")(s),t("./core/core.scale")(s),t("./core/core.scaleService")(s),t("./core/core.title")(s),t("./core/core.tooltip")(s),t("./controllers/controller.bar")(s),t("./controllers/controller.bubble")(s),t("./controllers/controller.doughnut")(s),t("./controllers/controller.line")(s),t("./controllers/controller.polarArea")(s),t("./controllers/controller.radar")(s),t("./scales/scale.category")(s),t("./scales/scale.linear")(s),t("./scales/scale.logarithmic")(s),t("./scales/scale.radialLinear")(s),t("./scales/scale.time")(s),t("./elements/element.arc")(s),t("./elements/element.line")(s),t("./elements/element.point")(s),t("./elements/element.rectangle")(s),t("./charts/Chart.Bar")(s),t("./charts/Chart.Bubble")(s),t("./charts/Chart.Doughnut")(s),t("./charts/Chart.Line")(s),t("./charts/Chart.PolarArea")(s),t("./charts/Chart.Radar")(s),t("./charts/Chart.Scatter")(s),window.Chart=e.exports=s},{"./charts/Chart.Bar":4,"./charts/Chart.Bubble":5,"./charts/Chart.Doughnut":6,"./charts/Chart.Line":7,"./charts/Chart.PolarArea":8,"./charts/Chart.Radar":9,"./charts/Chart.Scatter":10,"./controllers/controller.bar":11,"./controllers/controller.bubble":12,"./controllers/controller.doughnut":13,"./controllers/controller.line":14,"./controllers/controller.polarArea":15,"./controllers/controller.radar":16,"./core/core.animation":17,"./core/core.controller":18,"./core/core.datasetController":19,"./core/core.element":20,"./core/core.js":22,"./core/core.layoutService":23,"./core/core.legend":24,"./core/core.scale":25,"./core/core.scaleService":26,"./core/core.title":27,"./core/core.tooltip":28,"./elements/element.arc":29,"./elements/element.line":30,"./elements/element.point":31,"./elements/element.rectangle":32,"./scales/scale.category":33,"./scales/scale.linear":34,"./scales/scale.logarithmic":35,"./scales/scale.radialLinear":36,"./scales/scale.time":37}],4:[function(t,e,i){"use strict";e.exports=function(t){t.Bar=function(e,i){return i.type="bar",new t(e,i)}}},{}],5:[function(t,e,i){"use strict";e.exports=function(t){t.Bubble=function(e,i){return i.type="bubble",new t(e,i)}}},{}],6:[function(t,e,i){"use strict";e.exports=function(t){t.Doughnut=function(e,i){return i.type="doughnut",new t(e,i)}}},{}],7:[function(t,e,i){"use strict";e.exports=function(t){t.Line=function(e,i){return i.type="line",new t(e,i)}}},{}],8:[function(t,e,i){"use strict";e.exports=function(t){t.PolarArea=function(e,i){return i.type="polarArea",new t(e,i)}}},{}],9:[function(t,e,i){"use strict";e.exports=function(t){var e={aspectRatio:1};t.Radar=function(i,s){return s.options=helpers.configMerge(e,s.options),s.type="radar",new t(i,s)}}},{}],10:[function(t,e,i){"use strict";e.exports=function(t){var e={hover:{mode:"single"},scales:{xAxes:[{type:"linear",position:"bottom",id:"x-axis-1"}],yAxes:[{type:"linear",position:"left",id:"y-axis-1"}]},tooltips:{callbacks:{title:function(t,e){return""},label:function(t,e){return"("+t.xLabel+", "+t.yLabel+")"}}}};t.defaults.scatter=e,t.controllers.scatter=t.controllers.line,t.Scatter=function(e,i){return i.type="scatter",new t(e,i)}}},{}],11:[function(t,e,i){"use strict";e.exports=function(e){var i=t("../core/core.helpers.js");e.defaults.bar={hover:{mode:"label"},scales:{xAxes:[{type:"category",categoryPercentage:.8,barPercentage:.9,gridLines:{offsetGridLines:!0}}],yAxes:[{type:"linear"}]}},e.controllers.bar=e.DatasetController.extend({initialize:function(t,i){e.DatasetController.prototype.initialize.call(this,t,i),this.getDataset().bar=!0},getBarCount:function(){var t=0;return i.each(this.chart.data.datasets,function(e){i.isDatasetVisible(e)&&e.bar&&++t}),t},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Rectangle({_chart:this.chart.chart,_datasetIndex:this.index,_index:i})},this)},addElem
};i.extend(t,{_chart:this.chart.chart,_datasetIndex:this.index,_index:e,_scale:this.chart.scale,_model:s?u:{x:a,y:n,innerRadius:0,outerRadius:this.chart.scale.getDistanceFromCenterForValue(this.getDataset().data[e]),startAngle:l,endAngle:c,backgroundColor:t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),borderWidth:t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth),borderColor:t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),label:i.getValueAtIndexOrDefault(this.chart.data.labels,e,this.chart.data.labels[e])}}),t.pivot()},draw:function(t){var e=t||1;i.each(this.getDataset().metaData,function(t,i){t.transition(e).draw()})},setHoverStyle:function(t){var e=this.chart.data.datasets[t._datasetIndex],s=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,s,i.color(t._model.backgroundColor).saturate(.5).darken(.1).rgbString()),t._model.borderColor=t.custom&&t.custom.hoverBorderColor?t.custom.hoverBorderColor:i.getValueAtIndexOrDefault(e.hoverBorderColor,s,i.color(t._model.borderColor).saturate(.5).darken(.1).rgbString()),t._model.borderWidth=t.custom&&t.custom.hoverBorderWidth?t.custom.hoverBorderWidth:i.getValueAtIndexOrDefault(e.hoverBorderWidth,s,t._model.borderWidth)},removeHoverStyle:function(t){var e=(this.chart.data.datasets[t._datasetIndex],t._index);t._model.backgroundColor=t.custom&&t.custom.backgroundColor?t.custom.backgroundColor:i.getValueAtIndexOrDefault(this.getDataset().backgroundColor,e,this.chart.options.elements.arc.backgroundColor),t._model.borderColor=t.custom&&t.custom.borderColor?t.custom.borderColor:i.getValueAtIndexOrDefault(this.getDataset().borderColor,e,this.chart.options.elements.arc.borderColor),t._model.borderWidth=t.custom&&t.custom.borderWidth?t.custom.borderWidth:i.getValueAtIndexOrDefault(this.getDataset().borderWidth,e,this.chart.options.elements.arc.borderWidth)},calculateCircumference:function(t){if(isNaN(t))return 0;var e=i.where(this.getDataset().data,function(t){return isNaN(t)}).length;return 2*Math.PI/(this.getDataset().data.length-e)}})}},{"../core/core.helpers.js":21}],16:[function(t,e,i){"use strict";e.exports=function(e){var i=t("../core/core.helpers.js");e.defaults.radar={scale:{type:"radialLinear"},elements:{line:{tension:0}}},e.controllers.radar=e.DatasetController.extend({linkScales:function(){},addElements:function(){this.getDataset().metaData=this.getDataset().metaData||[],this.getDataset().metaDataset=this.getDataset().metaDataset||new e.elements.Line({_chart:this.chart.chart,_datasetIndex:this.index,_points:this.getDataset().metaData,_loop:!0}),i.each(this.getDataset().data,function(t,i){this.getDataset().metaData[i]=this.getDataset().metaData[i]||new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:i,_model:{x:0,y:0}})},this)},addElementAndReset:function(t){this.getDataset().metaData=this.getDataset().metaData||[];var i=new e.elements.Point({_chart:this.chart.chart,_datasetIndex:this.index,_index:t});this.updateElement(i,t,!0),this.getDataset().metaData.splice(t,0,i),this.updateBezierControlPoints()},update:function(t){var e,s=this.getDataset().metaDataset,o=this.getDataset().metaData,a=this.chart.scale;e=a.min<0&&a.max<0?a.getPointPositionForValue(0,a.max):a.min>0&&a.max>0?a.getPointPositionForValue(0,a.min):a.getPointPositionForValue(0,0),i.extend(this.getDataset().metaDataset,{_datasetIndex:this.index,_children:this.getDataset().metaData,_model:{tension:s.custom&&s.custom.tension?s.custom.tension:i.getValueOrDefault(this.getDataset().tension,this.chart.options.elements.line.tension),backgroundColor:s.custom&&s.custom.backgroundColor?s.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elemen
return(i||s)&&(e=Math.min(o?parseInt(i,10):Number.POSITIVE_INFINITY,a?parseInt(s,10):Number.POSITIVE_INFINITY)),e},o.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(o.getStyle(e,"padding-left"))+parseInt(o.getStyle(e,"padding-right")),s=e.clientWidth-i,a=o.getConstraintWidth(t);return void 0!==a&&(s=Math.min(s,a)),s},o.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(o.getStyle(e,"padding-top"))+parseInt(o.getStyle(e,"padding-bottom")),s=e.clientHeight-i,a=o.getConstraintHeight(t);return void 0!==a&&(s=Math.min(s,a)),s},o.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},o.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,s=t.canvas.height,o=t.currentDevicePixelRatio=window.devicePixelRatio||1;1!==o&&(e.canvas.height=s*o,e.canvas.width=i*o,e.scale(o,o),e.canvas.style.width=i+"px",e.canvas.style.height=s+"px",t.originalDevicePixelRatio=t.originalDevicePixelRatio||o)},o.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},o.fontString=function(t,e,i){return e+" "+t+"px "+i},o.longestText=function(t,e,i,s){s=s||{},s.data=s.data||{},s.garbageCollect=s.garbageCollect||[],s.font!==e&&(s.data={},s.garbageCollect=[],s.font=e),t.font=e;var a=0;o.each(i,function(e){var i=s.data[e];i||(i=s.data[e]=t.measureText(e).width,s.garbageCollect.push(e)),i>a&&(a=i)});var n=s.garbageCollect.length/2;if(n>i.length)for(var r=0;n>r;r++){var h=s.garbageCollect.shift();delete s.data[h]}return a},o.drawRoundedRectangle=function(t,e,i,s,o,a){t.beginPath(),t.moveTo(e+a,i),t.lineTo(e+s-a,i),t.quadraticCurveTo(e+s,i,e+s,i+a),t.lineTo(e+s,i+o-a),t.quadraticCurveTo(e+s,i+o,e+s-a,i+o),t.lineTo(e+a,i+o),t.quadraticCurveTo(e,i+o,e,i+o-a),t.lineTo(e,i+a),t.quadraticCurveTo(e,i,e+a,i),t.closePath()},o.color=function(t){return s?s(t):(console.log("Color.js not found!"),t)},o.addResizeListener=function(t,e){var i=document.createElement("iframe"),s="chartjs-hidden-iframe";i.classlist?i.classlist.add(s):i.setAttribute("class",s),i.style.width="100%",i.style.display="block",i.style.border=0,i.style.height=0,i.style.margin=0,i.style.position="absolute",i.style.left=0,i.style.right=0,i.style.top=0,i.style.bottom=0,t.insertBefore(i,t.firstChild),(i.contentWindow||i).onresize=function(){e&&e()}},o.removeResizeListener=function(t){var e=t.querySelector(".chartjs-hidden-iframe");e&&e.parentNode.removeChild(e)},o.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(arg)},o.pushAllIfDefined=function(t,e){"undefined"!=typeof t&&(o.isArray(t)?e.push.apply(e,t):e.push(t))},o.isDatasetVisible=function(t){return!t.hidden},o.callCallback=function(t,e,i){t&&"function"==typeof t.call&&t.apply(i,e)},e.exports=o},{"color/dist/color.min":1}],22:[function(t,e,i){"use strict";e.exports=function(){var e=t("./core.helpers"),i=function(t,s){this.config=s,t.length&&t[0].getContext&&(t=t[0]),t.getContext&&(t=t.getContext("2d")),this.ctx=t,this.canvas=t.canvas,this.width=t.canvas.width||parseInt(e.getStyle(t.canvas,"width"))||e.getMaximumWidth(t.canvas),this.height=t.canvas.height||parseInt(e.getStyle(t.canvas,"height"))||e.getMaximumHeight(t.canvas),this.aspectRatio=this.width/this.height,(isNaN(this.aspectRatio)||isFinite(this.aspectRatio)===!1)&&(this.aspectRatio=void 0!==s.aspectRatio?s.aspectRatio:2),this.originalCanvasStyleWidth=t.canvas.style.width,this.originalCanvasStyleHeight=t.canvas.style.height,e.retinaScale(this),s&&(this.controller=new i.Controller(this));var o=this;return e.addResizeListener(t.canvas.parentNode,function(){o.controller&&o.controller.config.options.responsive&&o.controller.resize()}),this.controller?this.controller:this};return i.defaults={global:{responsive:!0,responsiveAnimationDuration:0,maintainAspectRatio:!0,events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"single",animationDuration:400},onClick:null,defaultColor:"rgba(0,0,0,0.1)",defaultFontColor:"#666",defaultFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",defaultFontSize:12,defaultFont
var n=i._yScale||i._scale;a.push({xLabel:i._xScale?i._xScale.getLabelForIndex(i._index,i._datasetIndex):"",yLabel:n?n.getLabelForIndex(i._index,i._datasetIndex):"",index:i._index,datasetIndex:i._datasetIndex}),e=this.getAveragePosition(this._active)}else s.each(this._data.datasets,function(t,e){if(s.isDatasetVisible(t)){var o=t.metaData[i._index];if(o){var n=i._yScale||i._scale;a.push({xLabel:o._xScale?o._xScale.getLabelForIndex(o._index,o._datasetIndex):"",yLabel:n?n.getLabelForIndex(o._index,o._datasetIndex):"",index:i._index,datasetIndex:e})}}}),s.each(this._active,function(t){t&&o.push({borderColor:t._view.borderColor,backgroundColor:t._view.backgroundColor})}),e=this.getAveragePosition(this._active),e.y=this._active[0]._yScale.getPixelForDecimal(.5);s.extend(this._model,{title:this.getTitle(a,this._data),beforeBody:this.getBeforeBody(a,this._data),body:this.getBody(a,this._data),afterBody:this.getAfterBody(a,this._data),footer:this.getFooter(a,this._data)}),s.extend(this._model,{x:Math.round(e.x),y:Math.round(e.y),caretPadding:s.getValueOrDefault(e.padding,2),labelColors:o});var r=this.getTooltipSize(this._model);this.determineAlignment(r),s.extend(this._model,this.getBackgroundPoint(this._model,r))}else this._model.opacity=0;return t&&this._options.tooltips.custom&&this._options.tooltips.custom.call(this,this._model),this},getTooltipSize:function(t){var e=this._chart.ctx,i={height:2*t.yPadding,width:0},o=t.body.length+t.beforeBody.length+t.afterBody.length;return i.height+=t.title.length*t.titleFontSize,i.height+=(t.title.length-1)*t.titleSpacing,i.height+=t.title.length?t.titleMarginBottom:0,i.height+=o*t.bodyFontSize,i.height+=o?(o-1)*t.bodySpacing:0,i.height+=t.footer.length?t.footerMarginTop:0,i.height+=t.footer.length*t.footerFontSize,i.height+=t.footer.length?(t.footer.length-1)*t.footerSpacing:0,e.font=s.fontString(t.titleFontSize,t._titleFontStyle,t._titleFontFamily),s.each(t.title,function(t){i.width=Math.max(i.width,e.measureText(t).width)}),e.font=s.fontString(t.bodyFontSize,t._bodyFontStyle,t._bodyFontFamily),s.each(t.beforeBody.concat(t.afterBody),function(t){i.width=Math.max(i.width,e.measureText(t).width)}),s.each(t.body,function(s){i.width=Math.max(i.width,e.measureText(s).width+("single"!==this._options.tooltips.mode?t.bodyFontSize+2:0))},this),e.font=s.fontString(t.footerFontSize,t._footerFontStyle,t._footerFontFamily),s.each(t.footer,function(t){i.width=Math.max(i.width,e.measureText(t).width)}),i.width+=2*t.xPadding,i},determineAlignment:function(t){this._model.xAlign=this._model.yAlign="center",this._model.y<t.height?this._model.yAlign="top":this._model.y>this._chart.height-t.height&&(this._model.yAlign="bottom");var e,i,s,o,a,n=this,r=(this._chartInstance.chartArea.left+this._chartInstance.chartArea.right)/2,h=(this._chartInstance.chartArea.top+this._chartInstance.chartArea.bottom)/2;"center"===this._model.yAlign?(e=function(t){return r>=t},i=function(t){return t>r}):(e=function(e){return e<=t.width/2},i=function(e){return e>=n._chart.width-t.width/2}),s=function(e){return e+t.width>n._chart.width},o=function(e){return e-t.width<0},a=function(t){return h>=t?"top":"bottom"},e(this._model.x)?(this._model.xAlign="left",s(this._model.x)&&(this._model.xAlign="center",this._model.yAlign=a(this._model.y))):i(this._model.x)&&(this._model.xAlign="right",o(this._model.x)&&(this._model.xAlign="center",this._model.yAlign=a(this._model.y)))},getBackgroundPoint:function(t,e){var i={x:t.x,y:t.y};return"right"===t.xAlign?i.x-=e.width:"center"===t.xAlign&&(i.x-=e.width/2),"top"===t.yAlign?i.y+=t.caretPadding+t.caretSize:"bottom"===t.yAlign?i.y-=e.height+t.caretPadding+t.caretSize:i.y-=e.height/2,"center"==t.yAlign?"left"===t.xAlign?i.x+=t.caretPadding+t.caretSize:"right"===t.xAlign&&(i.x-=t.caretPadding+t.caretSize):"left"===t.xAlign?i.x-=t.cornerRadius+t.caretPadding:"right"===t.xAlign&&(i.x+=t.cornerRadius+t.caretPadding),i},drawCaret:function(t,e,i,o){var a,n,r,h,l,c,u=this._view,d=this._chart.ctx;"center"===u.yAlign?("left"===u.xAlign?(a=t.x,n=a-u.caretSize,r=a):(a=t.x+e.width,n=a+u.caretSize,r=a),l=t.y+e
},this),this.options.time.displayFormat&&(this.displayFormat=this.options.time.displayFormat),this.ticks.push(this.firstTick.clone());for(var c=1;c<this.tickRange;++c){var u=l.clone().add(c,this.tickUnit);if(this.options.time.max&&u.diff(this.lastTick,this.tickUnit,!0)>=0)break;c%this.unitScale===0&&this.ticks.push(u)}this.options.time.max?this.ticks.push(this.lastTick.clone()):0!==this.ticks[this.ticks.length-1].diff(this.lastTick,this.tickUnit,!0)&&(this.tickRange=Math.ceil(this.tickRange/this.unitScale)*this.unitScale,this.ticks.push(this.firstTick.clone().add(this.tickRange,this.tickUnit)),this.lastTick=this.ticks[this.ticks.length-1].clone())},getLabelForIndex:function(t,e){var i=this.chart.data.labels&&t<this.chart.data.labels.length?this.chart.data.labels[t]:"";return"object"==typeof this.chart.data.datasets[e].data[0]&&(i=this.getRightValue(this.chart.data.datasets[e].data[t])),this.options.time.tooltipFormat&&(i=this.parseTime(i).format(this.options.time.tooltipFormat)),i},convertTicksToLabels:function(){this.ticks=this.ticks.map(function(t,e,i){var s=t.format(this.displayFormat);return this.options.ticks.userCallback?this.options.ticks.userCallback(s,e,i):s},this)},getPixelForValue:function(t,e,i,s){var o=this.getLabelMoment(i,e),a=o.diff(this.firstTick,this.tickUnit,!0),n=a/this.tickRange;if(this.isHorizontal()){var r=this.width-(this.paddingLeft+this.paddingRight),h=(r/Math.max(this.ticks.length-1,1),r*n+this.paddingLeft);return this.left+Math.round(h)}var l=this.height-(this.paddingTop+this.paddingBottom),c=(l/Math.max(this.ticks.length-1,1),l*n+this.paddingTop);return this.top+Math.round(c)},parseTime:function(t){return"function"==typeof t.getMonth||"number"==typeof t?s(t):t.isValid&&t.isValid()?t:"string"!=typeof this.options.time.format&&this.options.time.format.call?this.options.time.format(t):s(t,this.options.time.format)}});e.scaleService.registerScaleType("time",n,a)}},{"../core/core.helpers.js":21,moment:2}]},{},[3]);