|
|
|
function bool(t){return 1===t||"1"===t||t===!0||"true"===t}function e(t){return String(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}function isArray(t){return"[object Array]"===Object.prototype.toString.call(t)}function isObject(t){return"[object Object]"===Object.prototype.toString.call(t)}function regexEscape(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}!function(){"use strict";function t(){var t;for(p=!0,t=0;t<d.length;t+=1)d[t]();d=[]}function e(){var e;for(m=!0,p||t(),e=0;e<f.length;e+=1)f[e]();f=[]}function n(t,e){var n;for(n=e.length-1;n>=0;n-=1)t(e[n])}function i(t){return t.replace(/-\w/g,function(t){return t.charAt(1).toUpperCase()})}function s(t,e){return t.currentStyle?t.currentStyle[i(e)]:x.getComputedStyle?x.getComputedStyle(t,null).getPropertyValue(e):null}function r(t,e){return encodeURIComponent(t).replace(/%20/g,"+")+"="+encodeURIComponent(e).replace(/%20/g,"+")}function a(t,e,n){try{t.style[i(e)]=n}catch(s){}}function o(t){t.style.display="","none"===s(t,"display")&&(t.style.display="block")}function c(t){var e,i,s,a="";if(t.constructor===Object){for(e in t)if(t.hasOwnProperty(e))if(t[e].constructor===Array)for(i=0;i<t[e].length;i+=1)a+="&"+r(e,t[e][i]);else a+="&"+r(e,t[e])}else n(function(t){if("FORM"===t.nodeName)for(i=0;i<t.elements.length;i+=1)if(e=t.elements[i],!e.disabled)switch(e.type){case"button":case"image":case"file":case"submit":case"reset":break;case"select-one":e.length>0&&(a+="&"+r(e.name,e.value));break;case"select-multiple":for(s=0;s<e.length;s+=1)e[s].selected&&(a+="&"+r(e.name,e[s].value));break;case"checkbox":case"radio":e.checked&&(a+="&"+r(e.name,e.value));break;default:a+="&"+r(e.name,e.value)}},t);return a.length>0?a.substring(1):""}function u(t,e,i){var s,r,a,o=!1;return t&&(s=t.split(/\s+/),n(function(t){for(a=0;a<s.length;a+=1)if(r=new RegExp("\\b"+s[a]+"\\b","g"),"remove"===e)t.className=t.className.replace(r,"");else if("toggle"===e)t.className=t.className.match(r)?t.className.replace(r,""):t.className+" "+s[a];else if("has"===e&&t.className.match(r)){o=!0;break}},i)),o}function l(t,e,i){var s,r;t&&n(function(n){for(s=v.createElement("div"),s.innerHTML=t;null!==(r=s.lastChild);)try{"before"===e?n.parentNode.insertBefore(r,n):"after"===e?n.parentNode.insertBefore(r,n.nextSibling):"append"===e?n.appendChild(r):"prepend"===e&&n.insertBefore(r,n.firstChild)}catch(i){break}},i)}function h(t){var e,r,y,w=[],b=!1;if(t)if(t.nodeType&&1===t.nodeType)w=[t];else if("object"==typeof t)b="number"!=typeof t.length,w=t;else if("string"==typeof t)for(v.querySelectorAll||(v.querySelectorAll=function(t){var e,n,i,r=v.getElementsByTagName("head")[0],a=[];if(e=v.createElement("STYLE"),e.type="text/css",e.styleSheet){for(e.styleSheet.cssText=t+" {a:b}",r.appendChild(e),n=v.getElementsByTagName("*"),i=0;i<n.length;i+=1)"b"===s(n[i],"a")&&a.push(n[i]);r.removeChild(e)}return a}),r=v.querySelectorAll(t),y=0;y<r.length;y+=1)w[y]=r[y];return e=b?{}:w,e.ready=function(t){if(t){if(p)return t(),e;d.push(t)}},e.loaded=function(t){if(t){if(m)return t(),e;f.push(t)}},e.each=function(t){return"function"==typeof t&&n(function(e){return t.apply(e,arguments)},w),e},e.first=function(){return h(w.shift())},e.last=function(){return h(w.pop())},e.odd=function(){var t,e=[];for(t=0;t<w.length;t+=2)e.push(w[t]);return h(e)},e.even=function(){var t,e=[];for(t=1;t<w.length;t+=2)e.push(w[t]);return h(e)},e.hide=function(){return n(function(t){t.style.display="none"},w),e},e.show=function(){return n(function(t){o(t)},w),e},e.toggle=function(t){return"undefined"!=typeof t?t?e.show():e.hide():n(function(t){"none"===s(t,"display")?o(t):t.style.display="none"},w),e},e.remove=function(){return n(function(t){try{t.parentNode.removeChild(t)}catch(e){}},w),h()},e.css=function(t,r){if(t){if(r||""===r)return n(function(e){a(e,t,r)},w),e;if(w[0]){if(w[0].style[i(t)])return w[0].style[i(t)];if(s(w[0],t))return s(w[0],t)}}},e.getClass=function(){return w[0]&&w[0].className.length>0?w[0].className.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"").replace(/\s+
|
|
|
|
}n.FixedScaleAxis=n.Axis.extend({constructor:i,projectValue:s})}(window,document,t),function(t,e,n){"use strict";function i(t,e,i,s){n.StepAxis["super"].constructor.call(this,t,i,s.ticks,s),this.stepLength=this.axisLength/(s.ticks.length-(s.stretch?1:0))}function s(t,e){return this.stepLength*e}n.StepAxis=n.Axis.extend({constructor:i,projectValue:s})}(window,document,t),function(t,e,n){"use strict";function i(t){this.data=n.normalizeData(this.data);var e={raw:this.data,normalized:n.getDataArray(this.data,t.reverseData,!0)};this.svg=n.createSvg(this.container,t.width,t.height,t.classNames.chart);var i,s,a=this.svg.elem("g").addClass(t.classNames.gridGroup),o=this.svg.elem("g"),c=this.svg.elem("g").addClass(t.classNames.labelGroup),u=n.createChartRect(this.svg,t,r.padding);i=void 0===t.axisX.type?new n.StepAxis(n.Axis.units.x,e,u,n.extend({},t.axisX,{ticks:e.raw.labels,stretch:t.fullWidth})):t.axisX.type.call(n,n.Axis.units.x,e,u,t.axisX),s=void 0===t.axisY.type?new n.AutoScaleAxis(n.Axis.units.y,e,u,n.extend({},t.axisY,{high:n.isNum(t.high)?t.high:t.axisY.high,low:n.isNum(t.low)?t.low:t.axisY.low})):t.axisY.type.call(n,n.Axis.units.y,e,u,t.axisY),i.createGridAndLabels(a,c,this.supportsForeignObject,t,this.eventEmitter),s.createGridAndLabels(a,c,this.supportsForeignObject,t,this.eventEmitter),e.raw.series.forEach(function(r,a){var c=o.elem("g");c.attr({"ct:series-name":r.name,"ct:meta":n.serialize(r.meta)}),c.addClass([t.classNames.series,r.className||t.classNames.series+"-"+n.alphaNumerate(a)].join(" "));var l=[],h=[];e.normalized[a].forEach(function(t,o){var c={x:u.x1+i.projectValue(t,o,e.normalized[a]),y:u.y1-s.projectValue(t,o,e.normalized[a])};l.push(c.x,c.y),h.push({value:t,valueIndex:o,meta:n.getMetaData(r,o)})}.bind(this));var d={lineSmooth:n.getSeriesOption(r,t,"lineSmooth"),showPoint:n.getSeriesOption(r,t,"showPoint"),showLine:n.getSeriesOption(r,t,"showLine"),showArea:n.getSeriesOption(r,t,"showArea"),areaBase:n.getSeriesOption(r,t,"areaBase")},f="function"==typeof d.lineSmooth?d.lineSmooth:d.lineSmooth?n.Interpolation.cardinal():n.Interpolation.none(),p=f(l,h);if(d.showPoint&&p.pathElements.forEach(function(e){var o=c.elem("line",{x1:e.x,y1:e.y,x2:e.x+.01,y2:e.y},t.classNames.point).attr({"ct:value":[e.data.value.x,e.data.value.y].filter(n.isNum).join(","),"ct:meta":e.data.meta});this.eventEmitter.emit("draw",{type:"point",value:e.data.value,index:e.data.valueIndex,meta:e.data.meta,series:r,seriesIndex:a,axisX:i,axisY:s,group:c,element:o,x:e.x,y:e.y})}.bind(this)),d.showLine){var m=c.elem("path",{d:p.stringify()},t.classNames.line,!0);this.eventEmitter.emit("draw",{type:"line",values:e.normalized[a],path:p.clone(),chartRect:u,index:a,series:r,seriesIndex:a,axisX:i,axisY:s,group:c,element:m})}if(d.showArea&&s.range){var g=Math.max(Math.min(d.areaBase,s.range.max),s.range.min),v=u.y1-s.projectValue(g);p.splitByCommand("M").filter(function(t){return t.pathElements.length>1}).map(function(t){var e=t.pathElements[0],n=t.pathElements[t.pathElements.length-1];return t.clone(!0).position(0).remove(1).move(e.x,v).line(e.x,e.y).position(t.pathElements.length+1).line(n.x,v)}).forEach(function(n){var o=c.elem("path",{d:n.stringify()},t.classNames.area,!0);this.eventEmitter.emit("draw",{type:"area",values:e.normalized[a],path:n.clone(),series:r,seriesIndex:a,axisX:i,axisY:s,chartRect:u,index:a,group:c,element:o})}.bind(this))}}.bind(this)),this.eventEmitter.emit("created",{bounds:s.bounds,chartRect:u,axisX:i,axisY:s,svg:this.svg,options:t})}function s(t,e,i,s){n.Line["super"].constructor.call(this,t,e,r,n.extend({},r,i),s)}var r={axisX:{offset:30,position:"end",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0},axisY:{offset:40,position:"start",labelOffset:{x:0,y:0},showLabel:!0,showGrid:!0,labelInterpolationFnc:n.noop,type:void 0,scaleMinSpace:20,onlyInteger:!1},width:void 0,height:void 0,showLine:!0,showPoint:!0,showArea:!1,areaBase:0,lineSmooth:!0,low:void 0,high:void 0,chartPadding:{top:15,right:15,bottom:5,left:10},fullWidth:!1,reverseData:!1,classNames:{chart:"ct-chart-line",labe
|