9 lines
94 KiB
JavaScript
9 lines
94 KiB
JavaScript
|
/**
|
||
|
* ichartjs Library v1.2 http://www.ichartjs.com/
|
||
|
*
|
||
|
* @author wanghe
|
||
|
* @Copyright 2013 wanghetommy@gmail.com Licensed under the Apache License, Version 2.0 (the "License");
|
||
|
* you may not use this file except in compliance with the License.
|
||
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
||
|
*/
|
||
|
;(function(c){var a=navigator.userAgent.toLowerCase(),b=Object.prototype.toString,d=/opera/.test(a),e=/\bchrome\b/.test(a),f=/webkit/.test(a),g=!e&&/safari/.test(a),j=!d&&/msie/.test(a),k=!!document.createElement("canvas").getContext,l=!f&&/gecko/.test(a),p=/ipod|ipad|iphone|android/gi.test(a),m=function(a,b,d,i){return d*a/i+b},r={easeIn:function(a,b,d,i){return d*(a/=i)*a*a+b},easeOut:function(a,b,d,i){return d*((a=a/i-1)*a*a+1)+b},easeInOut:function(a,b,d,i){return 1>(a/=i/2)?d/2*a*a*a+b:d/2*((a-=2)*a*a+2)+b}},o=function(a){var c=!1,v=!1,i=[],u=function(){if(document.addEventListener)return function(){document.removeEventListener("DOMContentLoaded",u,!1);w()};if(document.attachEvent)return function(){"complete"===document.readyState&&(document.detachEvent("onreadystatechange",u),w())}}(),y=function(){if(!c){try{document.documentElement.doScroll("left")}catch(a){setTimeout(y,1);return}w()}},w=function(){if(!c){c=!0;for(var a=0;a<i.length;a++)i[a].call(document);i=[]}},x=function(){if(!v){v=!0;if("complete"===document.readyState)return setTimeout(w,1);if(document.addEventListener)document.addEventListener("DOMContentLoaded",u,!1),a.addEventListener("load",w,!1);else if(document.attachEvent){document.attachEvent("onreadystatechange",u);a.attachEvent("onload",w);var i=!1;try{i=null==a.frameElement}catch(b){}document.documentElement.doScroll&&i&&y()}}},S=function(a){x();c?a.call(document,s):i.push(function(){return a.call(this)})},s=function(a){if(!a||a.nodeType)return a;if("string"===typeof a)return-1!=a.indexOf("#")&&(a=a.substring(1)),document.getElementById(a);"function"===typeof a&&S(a)};s.apply=function(a,i){if(a&&i&&"object"==typeof i)for(var b in i)"undefined"!=typeof i[b]&&(a[b]=i[b]);if(!i&&a){var d={};for(b in a)d[b]=a[b];return d}return a};s.apply(s,{version:"1.0",email:"taylor@ichartjs.com",isEmpty:function(a,i){return null===a||void 0===a||s.isArray(a)&&!a.length||(!i?""===a:!1)},isArray:function(a){return"[object Array]"===b.apply(a)},isDate:function(a){return"[object Date]"===b.apply(a)},isObject:function(a){return!!a&&"[object Object]"===b.apply(a)},isFunction:function(a){return"[object Function]"===b.apply(a)},isNumber:function(a){return"number"===typeof a&&isFinite(a)},isString:function(a){return"string"===typeof a},isBoolean:function(a){return"boolean"===typeof a},isFalse:function(a){return"boolean"===typeof a&&!a},isElement:function(a){return a?!!a.tagName:!1},isDefined:function(a){return"undefined"!==typeof a}});s.applyIf=function(a,i){if(a&&s.isObject(i))for(var b in i)s.isDefined(i[b])&&!s.isDefined(a[b])&&(a[b]=i[b]);return!i&&a?s.apply(a):a};s.merge=function(a,i,b){if(a&&s.isObject(i)){for(var d in i)s.isDefined(i[d])&&(s.isObject(i[d])?s.isObject(a[d])?s.merge(a[d],i[d]):a[d]=s.clone(i[d],!0):a[d]=i[d]);if(s.isObject(b))return s.merge(a,b)}return a};s.clone=function(a,i,b){var d={};if(s.isArray(a)&&s.isObject(i))for(var c=0;c<a.length;c++)d[a[c]]=b&&s.isObject(i[a[c]])?s.clone(i[a[c]],b):i[a[c]];else if(s.isObject(a))for(c in a)d[c]=i&&s.isObject(a[c])&&!a[c].ICHARTJS_OBJECT?s.clone(a[c],i):a[c];return d};s.override=function(a,i){if(a&&i){var b=a.prototype;s.apply(b,i);s.isIE&&i.hasOwnProperty("toString")&&(b.toString=i.toString)}};s.extend=function(){var a=function(a){for(var i in a)this[i]=a[i]},i=Object.prototype.constructor;return function(b,d){var c=function(){b.apply(this,arguments)},u=function(){},e=b.prototype;u.prototype=e;u=c.prototype=new u;u.constructor=c;c.superclass=e;e.constructor==i&&(e.constructor=b);c.override=function(a){s.override(c,a)};u.superclass=u.supr=function(){return e};u.override=a;s.override(c,d);c.extend=function(a){return s.extend(c,a)};c.plugin_={};c.plugin=function(a,i){s.isString(a)&&s.isFunction(i)&&(c.plugin_[a]=i)};return c}}();var E=Math.sin,I=Math.cos,n=Math.atan,T=Math.sqrt,J=Math.abs,z=Math.PI,B=2*z,K=Math.ceil,C=Math.round,F=Math.floor,L=Math.max,M=Math.min,A=parseFloat,D={},G={},N=function(a,i){if(0==a)return a;var b=J(a),d=0.1;if(1<b){for(;1<b;)b/=10,d*=10;return F(a/d+i)*d}for(d=1;1>b;)b*=10,d*=10;return C(a*d+i)/d},O={white:"rgb(255,255,255)",green:"
|