Chart.js/dist/Chart.min.js

14 lines
151 KiB
JavaScript
Raw Normal View History

!function t(e,i,o){function s(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 s(i?i:t)},c,c.exports,t,e,i,o)}return i[n].exports}for(var a="function"==typeof require&&require,n=0;n<o.length;n++)s(o[n]);return s}({1:[function(t,e,i){},{}],2:[function(t,e,i){!function o(e,i,s){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 d=i[r]={exports:{}};e[r][0].call(d.exports,function(t){var i=e[r][1][t];return a(i?i:t)},d,d.exports,o,e,i,s)}return i[r].exports}for(var n="function"==typeof t&&t,r=0;r<s.length;r++)a(s[r]);return a}({1:[function(t,e,i){!function(){var i=t("color-convert"),o=t("color-string"),s=function(t){if(t instanceof s)return t;if(!(this instanceof s))return new s(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=o.getRgba(t);if(e)this.setValues("rgb",e);else if(e=o.getHsla(t))this.setValues("hsl",e);else{if(!(e=o.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)}}};s.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 o.hexString(this.values.rgb)},rgbString:function(){return o.rgbString(this.values.rgb,this.values.alpha)},rgbaString:function(){return o.rgbaString(this.values.rgb,this.values.alpha)},percentString:function(){return o.percentString(this.values.rgb,this.values.alpha)},hslString:function(){return o.hslString(this.values.hsl,this.values.alpha)},hslaString:function(){return o.hslaString(this.values.hsl,this.values.alpha)},hwbString:function(){return o.hwbString(this.values.hwb,this.values.alpha)},keyword:function(){return o.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:fun
* 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 o=t("./core/core.js")();t("./core/core.element")(o),t("./core/core.animation")(o),t("./core/core.controller")(o),t("./core/core.datasetController")(o),t("./core/core.layoutService")(o),t("./core/core.legend")(o),t("./core/core.scale")(o),t("./core/core.scaleService")(o),t("./core/core.title")(o),t("./core/core.tooltip")(o),t("./controllers/controller.bar")(o),t("./controllers/controller.bubble")(o),t("./controllers/controller.doughnut")(o),t("./controllers/controller.line")(o),t("./controllers/controller.polarArea")(o),t("./controllers/controller.radar")(o),t("./scales/scale.category")(o),t("./scales/scale.linear")(o),t("./scales/scale.logarithmic")(o),t("./scales/scale.radialLinear")(o),t("./scales/scale.time")(o),t("./elements/element.arc")(o),t("./elements/element.line")(o),t("./elements/element.point")(o),t("./elements/element.rectangle")(o),t("./charts/Chart.Bar")(o),t("./charts/Chart.Bubble")(o),t("./charts/Chart.Doughnut")(o),t("./charts/Chart.Line")(o),t("./charts/Chart.PolarArea")(o),t("./charts/Chart.Radar")(o),t("./charts/Chart.Scatter")(o),window.Chart=e.exports=o},{"./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,o){return o.options=helpers.configMerge(e,o.options),o.type="radar",new t(i,o)}}},{}],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:o?d:{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],o=t._index;t._model.backgroundColor=t.custom&&t.custom.hoverBackgroundColor?t.custom.hoverBackgroundColor:i.getValueAtIndexOrDefault(e.hoverBackgroundColor,o,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,o,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,o,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,o=this.getDataset().metaDataset,s=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:o.custom&&o.custom.tension?o.custom.tension:i.getValueOrDefault(this.getDataset().tension,this.chart.options.elements.line.tension),backgroundColor:o.custom&&o.custom.backgroundColor?o.custom.backgroundColor:this.getDataset().backgroundColor||this.chart.options.elemen
return(i||o)&&(e=Math.min(s?parseInt(i,10):Number.POSITIVE_INFINITY,a?parseInt(o,10):Number.POSITIVE_INFINITY)),e},s.getMaximumWidth=function(t){var e=t.parentNode,i=parseInt(s.getStyle(e,"padding-left"))+parseInt(s.getStyle(e,"padding-right")),o=e.clientWidth-i,a=s.getConstraintWidth(t);return void 0!==a&&(o=Math.min(o,a)),o},s.getMaximumHeight=function(t){var e=t.parentNode,i=parseInt(s.getStyle(e,"padding-top"))+parseInt(s.getStyle(e,"padding-bottom")),o=e.clientHeight-i,a=s.getConstraintHeight(t);return void 0!==a&&(o=Math.min(o,a)),o},s.getStyle=function(t,e){return t.currentStyle?t.currentStyle[e]:document.defaultView.getComputedStyle(t,null).getPropertyValue(e)},s.retinaScale=function(t){var e=t.ctx,i=t.canvas.width,o=t.canvas.height,s=t.currentDevicePixelRatio=window.devicePixelRatio||1;1!==s&&(e.canvas.height=o*s,e.canvas.width=i*s,e.scale(s,s),e.canvas.style.width=i+"px",e.canvas.style.height=o+"px",t.originalDevicePixelRatio=t.originalDevicePixelRatio||s)},s.clear=function(t){t.ctx.clearRect(0,0,t.width,t.height)},s.fontString=function(t,e,i){return e+" "+t+"px "+i},s.longestText=function(t,e,i,o){o=o||{},o.data=o.data||{},o.garbageCollect=o.garbageCollect||[],o.font!==e&&(o.data={},o.garbageCollect=[],o.font=e),t.font=e;var a=0;s.each(i,function(e){var i=o.data[e];i||(i=o.data[e]=t.measureText(e).width,o.garbageCollect.push(e)),i>a&&(a=i)});var n=o.garbageCollect.length/2;if(n>i.length)for(var r=0;n>r;r++){var h=o.garbageCollect.shift();delete o.data[h]}return a},s.drawRoundedRectangle=function(t,e,i,o,s,a){t.beginPath(),t.moveTo(e+a,i),t.lineTo(e+o-a,i),t.quadraticCurveTo(e+o,i,e+o,i+a),t.lineTo(e+o,i+s-a),t.quadraticCurveTo(e+o,i+s,e+o-a,i+s),t.lineTo(e+a,i+s),t.quadraticCurveTo(e,i+s,e,i+s-a),t.lineTo(e,i+a),t.quadraticCurveTo(e,i,e+a,i),t.closePath()},s.color=function(t){return o?o(t):(console.log("Color.js not found!"),t)},s.addResizeListener=function(t,e){var i=document.createElement("iframe"),o="chartjs-hidden-iframe";i.classlist?i.classlist.add(o):i.setAttribute("class",o),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()}},s.removeResizeListener=function(t){var e=t.querySelector(".chartjs-hidden-iframe");e&&e.parentNode.removeChild(e)},s.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(arg)},s.pushAllIfDefined=function(t,e){"undefined"!=typeof t&&(s.isArray(t)?e.push.apply(e,t):e.push(t))},s.isDatasetVisible=function(t){return!t.hidden},s.callCallback=function(t,e,i){t&&"function"==typeof t.call&&t.apply(i,e)},e.exports=s},{"color/dist/color.min":2}],22:[function(t,e,i){"use strict";e.exports=function(){var e=t("./core.helpers"),i=function(t,o){this.config=o,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!==o.aspectRatio?o.aspectRatio:2),this.originalCanvasStyleWidth=t.canvas.style.width,this.originalCanvasStyleHeight=t.canvas.style.height,e.retinaScale(this),o&&(this.controller=new i.Controller(this));var s=this;return e.addResizeListener(t.canvas.parentNode,function(){s.controller&&s.controller.config.options.responsive&&s.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 o.each(this._data.datasets,function(t,e){if(o.isDatasetVisible(t)){var s=t.metaData[i._index];if(s){var n=i._yScale||i._scale;a.push({xLabel:s._xScale?s._xScale.getLabelForIndex(s._index,s._datasetIndex):"",yLabel:n?n.getLabelForIndex(s._index,s._datasetIndex):"",index:i._index,datasetIndex:e})}}}),o.each(this._active,function(t){t&&s.push({borderColor:t._view.borderColor,backgroundColor:t._view.backgroundColor})}),e=this.getAveragePosition(this._active),e.y=this._active[0]._yScale.getPixelForDecimal(.5);o.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)}),o.extend(this._model,{x:Math.round(e.x),y:Math.round(e.y),caretPadding:o.getValueOrDefault(e.padding,2),labelColors:s});var r=this.getTooltipSize(this._model);this.determineAlignment(r),o.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},s=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+=s*t.bodyFontSize,i.height+=s?(s-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=o.fontString(t.titleFontSize,t._titleFontStyle,t._titleFontFamily),o.each(t.title,function(t){i.width=Math.max(i.width,e.measureText(t).width)}),e.font=o.fontString(t.bodyFontSize,t._bodyFontStyle,t._bodyFontFamily),o.each(t.beforeBody.concat(t.afterBody),function(t){i.width=Math.max(i.width,e.measureText(t).width)}),o.each(t.body,function(o){i.width=Math.max(i.width,e.measureText(o).width+("single"!==this._options.tooltips.mode?t.bodyFontSize+2:0))},this),e.font=o.fontString(t.footerFontSize,t._footerFontStyle,t._footerFontFamily),o.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,o,s,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}),o=function(e){return e+t.width>n._chart.width},s=function(e){return e-t.width<0},a=function(t){return h>=t?"top":"bottom"},e(this._model.x)?(this._model.xAlign="left",o(this._model.x)&&(this._model.xAlign="center",this._model.yAlign=a(this._model.y))):i(this._model.x)&&(this._model.xAlign="right",s(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,s){var a,n,r,h,l,c,d=this._view,u=this._chart.ctx;"center"===d.yAlign?("left"===d.xAlign?(a=t.x,n=a-d.caretSize,r=a):(a=t.x+e.width,n=a+d.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 d=l.clone().add(c,this.tickUnit);if(this.options.time.max&&d.diff(this.lastTick,this.tickUnit,!0)>=0)break;c%this.unitScale===0&&this.ticks.push(d)}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 o=t.format(this.displayFormat);return this.options.ticks.userCallback?this.options.ticks.userCallback(o,e,i):o},this)},getPixelForValue:function(t,e,i,o){var s=this.getLabelMoment(i,e),a=s.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?o(t):t.isValid&&t.isValid()?t:"string"!=typeof this.options.time.format&&this.options.time.format.call?this.options.time.format(t):o(t,this.options.time.format)}});e.scaleService.registerScaleType("time",n,a)}},{"../core/core.helpers.js":21,moment:1}]},{},[3]);