10 lines
26 KiB
JavaScript
10 lines
26 KiB
JavaScript
|
/*!
|
||
|
* Chart.js
|
||
|
* http://chartjs.org/
|
||
|
* Version: {{ version }}
|
||
|
*
|
||
|
* Copyright 2014 Nick Downie
|
||
|
* Released under the MIT license
|
||
|
* https://github.com/nnnick/Chart.js/blob/master/LICENSE.md
|
||
|
*/
|
||
|
(function(){"use strict";var t=this,i=t.Chart,e=function(t){this.canvas=t.canvas,this.ctx=t;this.width=t.canvas.width,this.height=t.canvas.height;return this.aspectRatio=this.width/this.height,n.retinaScale(this),this};e.defaults={global:{animation:!0,animationSteps:60,animationEasing:"easeOutQuart",showScale:!0,scaleOverride:!1,scaleSteps:null,scaleStepWidth:null,scaleStartValue:null,scaleLineColor:"rgba(0,0,0,.1)",scaleLineWidth:1,scaleShowLabels:!0,scaleLabel:"<%=value%>",scaleIntegersOnly:!0,scaleBeginAtZero:!1,scaleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",scaleFontSize:12,scaleFontStyle:"normal",scaleFontColor:"#666",responsive:!1,maintainAspectRatio:!0,showTooltips:!0,tooltipEvents:["mousemove","touchstart","touchmove","mouseout"],tooltipFillColor:"rgba(0,0,0,0.8)",tooltipFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipFontSize:14,tooltipFontStyle:"normal",tooltipFontColor:"#fff",tooltipTitleFontFamily:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",tooltipTitleFontSize:14,tooltipTitleFontStyle:"bold",tooltipTitleFontColor:"#fff",tooltipYPadding:6,tooltipXPadding:6,tooltipCaretSize:8,tooltipCornerRadius:6,tooltipXOffset:10,tooltipTemplate:"<%if (label){%><%=label%>: <%}%><%= value %>",multiTooltipTemplate:"<%= value %>",multiTooltipKeyBackground:"#fff",onAnimationProgress:function(){},onAnimationComplete:function(){}}},e.types={};var n=e.helpers={},s=n.each=function(t,i,e){var n=Array.prototype.slice.call(arguments,3);if(t)if(t.length===+t.length){var s;for(s=0;s<t.length;s++)i.apply(e,[t[s],s].concat(n))}else for(var o in t)i.apply(e,[t[o],o].concat(n))},o=n.clone=function(t){var i={};return s(t,function(e,n){t.hasOwnProperty(n)&&(i[n]=e)}),i},a=n.extend=function(t){return s(Array.prototype.slice.call(arguments,1),function(i){s(i,function(e,n){i.hasOwnProperty(n)&&(t[n]=e)})}),t},h=n.merge=function(){var t=Array.prototype.slice.call(arguments,0);return t.unshift({}),a.apply(null,t)},l=n.indexOf=function(t,i){if(Array.prototype.indexOf)return t.indexOf(i);for(var e=0;e<t.length;e++)if(t[e]===i)return e;return-1},r=(n.where=function(t,i){var e=[];return n.each(t,function(t){i(t)&&e.push(t)}),e},n.findNextWhere=function(t,i,e){e||(e=-1);for(var n=e+1;n<t.length;n++){var s=t[n];if(i(s))return s}},n.findPreviousWhere=function(t,i,e){e||(e=t.length);for(var n=e-1;n>=0;n--){var s=t[n];if(i(s))return s}},n.inherits=function(t){var i=this,e=t&&t.hasOwnProperty("constructor")?t.constructor:function(){return i.apply(this,arguments)},n=function(){this.constructor=e};return n.prototype=i.prototype,e.prototype=new n,e.extend=r,t&&a(e.prototype,t),e.__super__=i.prototype,e}),u=n.noop=function(){},c=n.uid=function(){var t=0;return function(){return"chart-"+t++}}(),d=n.warn=function(t){window.console&&"function"==typeof window.console.warn&&console.warn(t)},f=n.amd="function"==typeof define&&define.amd,p=n.isNumber=function(t){return!isNaN(parseFloat(t))&&isFinite(t)},g=n.max=function(t){return Math.max.apply(Math,t)},x=n.min=function(t){return Math.min.apply(Math,t)},y=(n.cap=function(t,i,e){if(p(i)){if(t>i)return i}else if(p(e)&&e>t)return e;return t},n.getDecimalPlaces=function(t){return t%1!==0&&p(t)?t.toString().split(".")[1].length:0}),v=n.radians=function(t){return t*(Math.PI/180)},m=(n.getAngleFromPoint=function(t,i){var e=i.x-t.x,n=i.y-t.y,s=Math.sqrt(e*e+n*n),o=2*Math.PI+Math.atan2(n,e);return 0>e&&0>n&&(o+=2*Math.PI),{angle:o,distance:s}},n.aliasPixel=function(t){return t%2===0?0:.5}),w=(n.splineCurve=function(t,i,e,n){var s=Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2)),o=Math.sqrt(Math.pow(e.x-i.x,2)+Math.pow(e.y-i.y,2)),a=n*s/(s+o),h=n*o/(s+o);return{inner:{x:i.x-a*(e.x-t.x),y:i.y-a*(e.y-t.y)},outer:{x:i.x+h*(e.x-t.x),y:i.y+h*(e.y-t.y)}}},n.calculateOrderOfMagnitude=function(t){return Math.floor(Math.log(t)/Math.LN10)}),b=(n.calculateScaleRange=function(t,i,e,n,s){var o=2,a=Math.floor(i/(1.5*e)),h=o>=a,l=g(t),r=x(t);l===r&&(l+=.5,r>=.5&&!n?r-=.5:l+=.5);for(var u=Math.abs(l-r),c=w(u),d=Math.ceil(l/(1*Math.pow(10,c)))*Math.pow(10,c),f=n?0:Math.floor(r/(1*Math.pow(
|