amcharts.rb 3.1.1.3 → 3.2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/amcharts/chart.rb +1 -1
- data/lib/amcharts/version.rb +1 -1
- data/vendor/assets/javascripts/amcharts/amcharts.js +188 -185
- data/vendor/assets/javascripts/amcharts/changeLog.txt +37 -0
- data/vendor/assets/javascripts/amcharts/exporting/amexport.js +623 -0
- data/vendor/assets/javascripts/amcharts/exporting/canvg.js +2842 -0
- data/vendor/assets/javascripts/amcharts/exporting/filesaver.js +232 -0
- data/vendor/assets/javascripts/amcharts/exporting/jspdf.js +1943 -0
- data/vendor/assets/javascripts/amcharts/exporting/jspdf.plugin.addimage.js +230 -0
- data/vendor/assets/javascripts/amcharts/exporting/rgbcolor.js +288 -0
- data/vendor/assets/javascripts/amcharts/gauge.js +10 -8
- data/vendor/assets/javascripts/amcharts/pie.js +1 -1
- data/vendor/assets/javascripts/amcharts/serial.js +20 -20
- data/vendor/assets/javascripts/amcharts/thirdPartySoftwareList.txt +28 -5
- data/vendor/assets/javascripts/amcharts/xy.js +7 -6
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
ZDA2MzBhZjhjMzEzY2NiYTgwYjNhMGIwZGEwY2Q2NTY2YzBkNDQ1Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzBiOGNhYzY3NzZlZTZiNWE3MmJiOWJlNjU5NGYyYTNkODdjZDViMA==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
M2YzMzgyY2NmMjJkZmNhZDQ1YTI0NWE5YmFjMzEyYThiZWIyYWJiNjk1YTNj
|
10
|
+
MjcwZWQ3NzkwNGMxYzdlZTcyZWM5ZWM2ZDk0OTEwMTIyMWY3ZWIwZmEzMmUz
|
11
|
+
N2RjNmM1YzFkMGI5ZGNiOTRkNGY2MGRiODM5MWRmNjU4ZDUwMGY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZDEyNjI5NzBjZjkyNTllNGQxZjk4MDFlZTM0ZGZiMmM4OGJjZDA1YWE4NWNi
|
14
|
+
MjkyODliZGQ5YzJkZDUwNGRlNGVlOTMyZDAzM2JlMjBmZWMwNTA2NTk2NTRk
|
15
|
+
ZDI2Yjk0ZmI4ZjI3ZmVkN2UwMWI4NmRiNDc5Yzg5YWE1NWFiZWI=
|
data/lib/amcharts/chart.rb
CHANGED
data/lib/amcharts/version.rb
CHANGED
@@ -3,10 +3,11 @@ AmCharts.Class=function(a){var b=function(){arguments[0]!==AmCharts.inheriting&&
|
|
3
3
|
b.prototype.removeListener=function(a,b,c){a=a.events[b];for(b=a.length-1;0<=b;b--)a[b].handler===c&&a.splice(b,1)},b.prototype.fire=function(a,b){for(var c=this.events[a],g=0,h=c.length;g<h;g++){var k=c[g];k.handler.call(k.scope,b)}});for(var c in a)b.prototype[c]=a[c];return b};AmCharts.charts=[];AmCharts.addChart=function(a){AmCharts.charts.push(a)};AmCharts.removeChart=function(a){for(var b=AmCharts.charts,c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)};AmCharts.IEversion=0;AmCharts.isModern=!0;
|
4
4
|
AmCharts.navigator=navigator.userAgent.toLowerCase();-1!=AmCharts.navigator.indexOf("msie")&&(AmCharts.IEversion=parseInt(AmCharts.navigator.split("msie")[1]),document.documentMode&&(AmCharts.IEversion=Number(document.documentMode)),9>AmCharts.IEversion&&(AmCharts.isModern=!1));AmCharts.dx=0;AmCharts.dy=0;if(document.addEventListener||window.opera)AmCharts.isNN=!0,AmCharts.isIE=!1,AmCharts.dx=0.5,AmCharts.dy=0.5;
|
5
5
|
document.attachEvent&&(AmCharts.isNN=!1,AmCharts.isIE=!0,AmCharts.isModern||(AmCharts.dx=0,AmCharts.dy=0));window.chrome&&(AmCharts.chrome=!0);AmCharts.handleResize=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&c.div&&c.handleResize()}};AmCharts.handleMouseUp=function(a){for(var b=AmCharts.charts,c=0;c<b.length;c++){var d=b[c];d&&d.handleReleaseOutside(a)}};AmCharts.handleMouseMove=function(a){for(var b=AmCharts.charts,c=0;c<b.length;c++){var d=b[c];d&&d.handleMouseMove(a)}};
|
6
|
-
AmCharts.resetMouseOver=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};AmCharts.onReadyArray=[];AmCharts.ready=function(a){AmCharts.onReadyArray.push(a)};AmCharts.handleLoad=function(){for(var a=AmCharts.onReadyArray,b=0;b<a.length;b++)(0,a[b])()};AmCharts.useUTC=!1;AmCharts.updateRate=40;AmCharts.uid=0;AmCharts.getUniqueId=function(){AmCharts.uid++;return"AmChartsEl-"+AmCharts.uid};
|
6
|
+
AmCharts.resetMouseOver=function(){for(var a=AmCharts.charts,b=0;b<a.length;b++){var c=a[b];c&&(c.mouseIsOver=!1)}};AmCharts.onReadyArray=[];AmCharts.ready=function(a){AmCharts.onReadyArray.push(a)};AmCharts.handleLoad=function(){AmCharts.isReady=!0;for(var a=AmCharts.onReadyArray,b=0;b<a.length;b++)(0,a[b])()};AmCharts.useUTC=!1;AmCharts.updateRate=40;AmCharts.uid=0;AmCharts.getUniqueId=function(){AmCharts.uid++;return"AmChartsEl-"+AmCharts.uid};
|
7
7
|
AmCharts.isNN&&(document.addEventListener("mousemove",AmCharts.handleMouseMove,!0),window.addEventListener("resize",AmCharts.handleResize,!0),document.addEventListener("mouseup",AmCharts.handleMouseUp,!0),window.addEventListener("load",AmCharts.handleLoad,!0));AmCharts.isIE&&(document.attachEvent("onmousemove",AmCharts.handleMouseMove),window.attachEvent("onresize",AmCharts.handleResize),document.attachEvent("onmouseup",AmCharts.handleMouseUp),window.attachEvent("onload",AmCharts.handleLoad));
|
8
8
|
AmCharts.clear=function(){var a=AmCharts.charts;if(a)for(var b=0;b<a.length;b++)a[b].clear();AmCharts.charts=null;AmCharts.isNN&&(document.removeEventListener("mousemove",AmCharts.handleMouseMove,!0),window.removeEventListener("resize",AmCharts.handleResize,!0),document.removeEventListener("mouseup",AmCharts.handleMouseUp,!0),window.removeEventListener("load",AmCharts.handleLoad,!0));AmCharts.isIE&&(document.detachEvent("onmousemove",AmCharts.handleMouseMove),window.detachEvent("onresize",AmCharts.handleResize),
|
9
|
-
document.detachEvent("onmouseup",AmCharts.handleMouseUp),window.detachEvent("onload",AmCharts.handleLoad))};
|
9
|
+
document.detachEvent("onmouseup",AmCharts.handleMouseUp),window.detachEvent("onload",AmCharts.handleLoad))};
|
10
|
+
AmCharts.makeChart=function(a,b){var c;switch(b.type){case "serial":c=new AmCharts.AmSerialChart;break;case "xy":c=new AmCharts.AmXYChart;break;case "pie":c=new AmCharts.AmPieChart;break;case "radar":c=new AmCharts.AmRadarChart;break;case "gauge":c=new AmCharts.AmAngularGauge;break;case "funnel":c=new AmCharts.AmFunnelChart;break;case "map":c=new AmCharts.AmMap;break;case "stock":c=new AmCharts.AmStockChart}AmCharts.extend(c,b);AmCharts.isReady?c.write(a):AmCharts.ready(function(){c.write(a)});return c};AmCharts.toBoolean=function(a,b){if(void 0===a)return b;switch(String(a).toLowerCase()){case "true":case "yes":case "1":return!0;case "false":case "no":case "0":case null:return!1;default:return Boolean(a)}};AmCharts.removeFromArray=function(a,b){var c;for(c=a.length-1;0<=c;c--)a[c]==b&&a.splice(c,1)};
|
10
11
|
AmCharts.getStyle=function(a,b){var c="";document.defaultView&&document.defaultView.getComputedStyle?c=document.defaultView.getComputedStyle(a,"").getPropertyValue(b):a.currentStyle&&(b=b.replace(/\-(\w)/g,function(a,b){return b.toUpperCase()}),c=a.currentStyle[b]);return c};AmCharts.removePx=function(a){return Number(a.substring(0,a.length-2))};
|
11
12
|
AmCharts.getURL=function(a,b){if(a)if("_self"!=b&&b)if("_top"==b&&window.top)window.top.location.href=a;else if("_parent"==b&&window.parent)window.parent.location.href=a;else{var c=document.getElementsByName(b)[0];c?c.src=a:window.open(a)}else window.location.href=a};AmCharts.ifArray=function(a){return a&&0<a.length?!0:!1};AmCharts.callMethod=function(a,b){var c;for(c=0;c<b.length;c++){var d=b[c];if(d){if(d[a])d[a]();var e=d.length;if(0<e){var f;for(f=0;f<e;f++){var g=d[f];if(g&&g[a])g[a]()}}}}};
|
12
13
|
AmCharts.toNumber=function(a){return"number"==typeof a?a:Number(String(a).replace(/[^0-9\-.]+/g,""))};AmCharts.toColor=function(a){if(""!==a&&void 0!==a)if(-1!=a.indexOf(",")){a=a.split(",");var b;for(b=0;b<a.length;b++){var c=a[b].substring(a[b].length-6,a[b].length);a[b]="#"+c}}else a=a.substring(a.length-6,a.length),a="#"+a;return a};
|
@@ -25,8 +26,8 @@ AmCharts.formatValue=function(a,b,c,d,e,f,g,h){if(b){void 0===e&&(e="");var k;fo
|
|
25
26
|
AmCharts.massReplace=function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];void 0===d&&(d="");a=a.replace(c,d)}return a};AmCharts.cleanFromEmpty=function(a){return a.replace(/\[\[[^\]]*\]\]/g,"")};
|
26
27
|
AmCharts.addPrefix=function(a,b,c,d,e){var f=AmCharts.formatNumber(a,d),g="",h,k,l;if(0===a)return"0";0>a&&(g="-");a=Math.abs(a);if(1<a)for(h=b.length-1;-1<h;h--){if(a>=b[h].number&&(k=a/b[h].number,l=Number(d.precision),1>l&&(l=1),c=AmCharts.roundTo(k,l),l=AmCharts.formatNumber(c,{precision:-1,decimalSeparator:d.decimalSeparator,thousandsSeparator:d.thousandsSeparator}),!e||k==c)){f=g+""+l+""+b[h].prefix;break}}else for(h=0;h<c.length;h++)if(a<=c[h].number){k=a/c[h].number;l=Math.abs(Math.round(Math.log(k)*
|
27
28
|
Math.LOG10E));k=AmCharts.roundTo(k,l);f=g+""+k+""+c[h].prefix;break}return f};AmCharts.remove=function(a){a&&a.remove()};AmCharts.copyProperties=function(a,b){for(var c in a)a.hasOwnProperty(c)&&"events"!=c&&void 0!==a[c]&&"function"!=typeof a[c]&&(b[c]=a[c])};AmCharts.recommended=function(){var a="js";document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")||swfobject&&swfobject.hasFlashPlayerVersion("8")&&(a="flash");return a};
|
28
|
-
AmCharts.getEffect=function(a){">"==a&&(a="easeOutSine");"<"==a&&(a="easeInSine");"elastic"==a&&(a="easeOutElastic");return a};AmCharts.
|
29
|
-
AmCharts.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)AmCharts.deleteObject(a[c],b-1),a[c]=null;else try{for(c in a)a[c]&&("object"==typeof a[c]&&AmCharts.deleteObject(a[c],b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(d){}}};
|
29
|
+
AmCharts.getEffect=function(a){">"==a&&(a="easeOutSine");"<"==a&&(a="easeInSine");"elastic"==a&&(a="easeOutElastic");return a};AmCharts.getObjById=function(a,b){var c,d;for(d=0;d<a.length;d++){var e=a[d];e.id==b&&(c=e)}return c};AmCharts.isString=function(a){return"string"==typeof a?!0:!1};AmCharts.extend=function(a,b,c){for(var d in b)c?a.hasOwnProperty(d)||(a[d]=b[d]):a[d]=b[d];return a};AmCharts.processObject=function(a,b){!1==a instanceof b&&(a=AmCharts.extend(new b,a));return a};
|
30
|
+
AmCharts.fixNewLines=function(a){if(!AmCharts.isModern){var b=RegExp("\\n","g");a&&(a=a.replace(b,"<br />"))}return a};AmCharts.deleteObject=function(a,b){if(a){if(void 0===b||null===b)b=20;if(0!==b)if("[object Array]"===Object.prototype.toString.call(a))for(var c=0;c<a.length;c++)AmCharts.deleteObject(a[c],b-1),a[c]=null;else try{for(c in a)a[c]&&("object"==typeof a[c]&&AmCharts.deleteObject(a[c],b-1),"function"!=typeof a[c]&&(a[c]=null))}catch(d){}}};
|
30
31
|
AmCharts.bounce=function(a,b,c,d,e){return(b/=e)<1/2.75?7.5625*d*b*b+c:b<2/2.75?d*(7.5625*(b-=1.5/2.75)*b+0.75)+c:b<2.5/2.75?d*(7.5625*(b-=2.25/2.75)*b+0.9375)+c:d*(7.5625*(b-=2.625/2.75)*b+0.984375)+c};AmCharts.easeInSine=function(a,b,c,d,e){return-d*Math.cos(b/e*(Math.PI/2))+d+c};AmCharts.easeOutSine=function(a,b,c,d,e){return d*Math.sin(b/e*(Math.PI/2))+c};
|
31
32
|
AmCharts.easeOutElastic=function(a,b,c,d,e){a=1.70158;var f=0,g=d;if(0===b)return c;if(1==(b/=e))return c+d;f||(f=0.3*e);g<Math.abs(d)?(g=d,a=f/4):a=f/(2*Math.PI)*Math.asin(d/g);return g*Math.pow(2,-10*b)*Math.sin(2*(b*e-a)*Math.PI/f)+d+c};AmCharts.AxisBase=AmCharts.Class({construct:function(){this.viY=this.viX=this.y=this.x=this.dy=this.dx=0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridCount=this.tickLength=5;this.gridAlpha=0.15;this.gridThickness=1;this.gridColor="#000000";this.dashLength=0;this.labelFrequency=1;this.showLastLabel=this.showFirstLabel=!0;this.fillColor="#FFFFFF";this.fillAlpha=0;this.labelsEnabled=!0;this.labelRotation=0;this.autoGridCount=!0;this.valueRollOverColor="#CC0000";this.offset=
|
32
33
|
0;this.guides=[];this.visible=!0;this.counter=0;this.guides=[];this.ignoreAxisWidth=this.inside=!1;this.minGap=75;this.titleBold=!0;this.minorGridEnabled=!1;this.minorGridAlpha=0.07},zoom:function(a,b){this.start=a;this.end=b;this.dataChanged=!0;this.draw()},fixAxisPosition:function(){var a=this.position;"H"==this.orientation?("left"==a&&(a="bottom"),"right"==a&&(a="top")):("bottom"==a&&(a="left"),"top"==a&&(a="right"));this.position=a},draw:function(){var a=this.chart;void 0===this.titleColor&&(this.titleColor=
|
@@ -35,60 +36,60 @@ a?"H":"V"},addTitle:function(){var a=this.title;if(a){var b=this.chart;this.titl
|
|
35
36
|
2,n=this.inside;switch(this.position){case "top":b=h/2;c=f-10-m;break;case "bottom":b=h/2;c=f+e+10+m;break;case "left":b=d-10-m;n&&(b-=5);c=k/2;l=-90;break;case "right":b=d+g+10+m-3,n&&(b+=7),c=k/2,l=-90}this.marginsChanged?(a.translate(b,c),this.tx=b,this.ty=c):a.translate(this.tx,this.ty);this.marginsChanged=!1;0!==l&&a.rotate(l)}},pushAxisItem:function(a,b){var c=a.graphics();0<c.length()&&(b?this.labelsSet.push(c):this.set.push(c));(c=a.getLabel())&&this.labelsSet.push(c)},addGuide:function(a){this.guides.push(a)},
|
36
37
|
removeGuide:function(a){var b=this.guides,c;for(c=0;c<b.length;c++)b[c]==a&&b.splice(c,1)},handleGuideOver:function(a){clearTimeout(this.chart.hoverInt);var b=a.graphics.getBBox(),c=b.x+b.width/2,b=b.y+b.height/2,d=a.fillColor;void 0===d&&(d=a.lineColor);this.chart.showBalloon(a.balloonText,d,!0,c,b)},handleGuideOut:function(a){this.chart.hideBalloon()},addEventListeners:function(a,b){var c=this;a.mouseover(function(){c.handleGuideOver(b)});a.mouseout(function(){c.handleGuideOut(b)})},getBBox:function(){var a=
|
37
38
|
this.labelsSet.getBBox();AmCharts.VML||(a={x:a.x+this.x,y:a.y+this.y,width:a.width,height:a.height});return a},destroy:function(){AmCharts.remove(this.set);AmCharts.remove(this.labelsSet);var a=this.axisLine;a&&AmCharts.remove(a.set);AmCharts.remove(this.grid0)}});AmCharts.ValueAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(){this.createEvents("axisChanged","logarithmicAxisFailed","axisSelfZoomed","axisZoomed");AmCharts.ValueAxis.base.construct.call(this);this.dataChanged=!0;this.gridCount=8;this.stackType="none";this.position="left";this.unitPosition="right";this.recalculateToPercents=this.includeHidden=this.includeGuidesInMinMax=this.integersOnly=!1;this.durationUnits={DD:"d. ",hh:":",mm:":",ss:""};this.scrollbar=!1;this.baseValue=0;this.radarCategoriesEnabled=
|
38
|
-
!0;this.gridType="polygons";this.useScientificNotation=!1;this.axisTitleOffset=10;this.minMaxMultiplier=1},updateData:function(){0>=this.gridCount&&(this.gridCount=1);this.totals=[];this.data=this.chart.chartData;"xy"!=
|
39
|
-
draw:function(){AmCharts.ValueAxis.base.draw.call(this);var a=this.chart,b=this.set;"duration"==this.type&&(this.duration="ss");!0===this.dataChanged&&(this.updateData(),this.dataChanged=!1);if(this.logarithmic&&(0>=this.getMin(0,this.data.length-1)||0>=this.minimum))this.fire("logarithmicAxisFailed",{type:"logarithmicAxisFailed",
|
40
|
-
this.max)g=!0;else{var l=this.labelFrequency,m=this.showFirstLabel,n=this.showLastLabel,p=1,q=0,u=Math.round((this.max-this.min)/this.step)+1,r;!0===h?(r=Math.log(this.max)*Math.LOG10E-Math.log(this.minReal)*Math.LOG10E,this.stepWidth=this.axisWidth/r,2<r&&(u=Math.ceil(Math.log(this.max)*Math.LOG10E)+1,q=Math.round(Math.log(this.minReal)*
|
41
|
-
this.integersOnly&&(s=0);s>this.maxDecCount&&(s=this.maxDecCount);var w=this.precision;isNaN(w)||(s=w);this.max=AmCharts.roundTo(this.max,this.maxDecCount);this.min=AmCharts.roundTo(this.min,this.maxDecCount);var v={};v.precision=s;v.decimalSeparator=a.numberFormatter.decimalSeparator;v.thousandsSeparator=a.numberFormatter.thousandsSeparator;
|
42
|
-
this.getCoordinate(x.toValue),t=new this.axisItemRenderer(this,z,"",!0,NaN,NaN,x),this.pushAxisItem(t,H));var I=NaN;isNaN(x.value)||(I=this.getCoordinate(x.value),t=new this.axisItemRenderer(this,I,x.label,!0,NaN,(z-I)/2,x),this.pushAxisItem(t,H));isNaN(z-I)||(t=new this.guideFillRenderer(this,I,z,x),this.pushAxisItem(t,H),t=t.graphics(),x.graphics=
|
43
|
-
(A=!0,String(
|
44
|
-
!0);this.usePrefixes&&(A=!1);A?(t=-1==String(q).indexOf("e")?q.toExponential(15):String(q),c=t.split("e"),t=Number(c[0]),c=Number(c[1]),t=AmCharts.roundTo(t,14),10==t&&(t=1,c+=1),t=t+"e"+c,0===q&&(t="0"),1==q&&(t="1")):(h&&(t=String(q).split("."),v.precision=t[1]?t[1].length:-1),t=this.usePrefixes?AmCharts.addPrefix(q,a.prefixesOfBigNumbers,
|
45
|
-
v));this.recalculateToPercents?t+="%":(c=this.unit)&&(t="left"==this.unitPosition?c+t:t+c);Math.round(d/l)!=d/l&&(t=void 0);if(0===d&&!m||d==u-1&&!n)t=" ";c=this.getCoordinate(q);this.labelFunction&&(t=this.labelFunction(q,t,this));t=new this.axisItemRenderer(this,c,t);this.pushAxisItem(t);if(q==this.baseValue&&"radar"!=k){var
|
46
|
-
this.gridAlpha,0,1),c=AmCharts.line(a.container,
|
47
|
-
this.max);h&&d<this.minReal&&(d=this.minReal);this.baseCoord=this.getCoordinate(d);a={type:"axisChanged",target:this,chart:a};a.min=h?this.minReal:this.min;a.max=this.max;this.fire("axisChanged",a);this.axisCreated=!0}h=this.axisLine.set;a=this.labelsSet;this.positionTitle();"radar"!=k?(k=this.viX,d=this.viY,b.translate(k,d),
|
48
|
-
b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b},getMinorGridStep:function(a,b){var c=[5,4,2];60>b&&c.shift();for(var d=Math.floor(Math.log(Math.abs(a))*Math.LOG10E),e=0;e<c.length;e++){var f=a/c[e],g=Math.floor(Math.log(Math.abs(f))*Math.LOG10E);if(!(0<Math.abs(d-g)))if(1>a){if(g=Math.pow(10
|
49
|
-
b&&(b="100%");this.stackType=b;var c=[],d=[],e=[],f=[],g,h=this.chart.graphs,k,l,m,n,p=this.baseValue,q=!1;if("line"==a||"step"==a||"smoothedLine"==a)q=!0;if(q&&("regular"==b||"100%"==b))for(n=0;n<h.length;n++)m=h[n],m.hidden||(l=m.type,m.chart==this.chart&&m.valueAxis==this&&a==l&&m.stackable&&(k&&(m.stackGraph=k),k=m));
|
50
|
-
g=l.values.value,!isNaN(g)))){var r=this.getDecimals(g);u<r&&(u=r);isNaN(f[k])?f[k]=Math.abs(g):f[k]+=Math.abs(g);f[k]=AmCharts.roundTo(f[k],u);m=m.fillToGraph;q&&m&&(m=this.data[k].axes[this.id].graphs[m.id])&&(l.values.open=m.values.value);"regular"==b&&(q&&(isNaN(c[k])?(c[k]=g,l.values.close=g,l.values.open=
|
51
|
-
p:(l.values.close+=d[k],l.values.open=d[k]),d[k]=l.values.close):(l.values.close=g,isNaN(e[k])?l.values.open=p:(l.values.close+=e[k],l.values.open=e[k]),e[k]=l.values.close)))}}for(k=this.start;k<=this.end;k++)for(n=0;n<h.length;n++)m=h[n],m.hidden||(l=m.type,m.chart==this.chart&&m.valueAxis==this&&a==
|
52
|
-
0>c?(l.values.close=AmCharts.fitToBounds(c+d[k],-100,100),l.values.open=d[k],d[k]=l.values.close):(l.values.close=AmCharts.fitToBounds(c+e[k],-100,100),l.values.open=e[k],e[k]=l.values.close)))))},recalculate:function(){var a=this.chart.graphs,b;for(b=0;b<a.length;b++){var c=a[b];if(c.valueAxis==this){var d=
|
53
|
-
(f=0);for(k=f;k<=g&&(f=this.data[k].axes[this.id].graphs[c.id],e=f.values[d],isNaN(e));k++);for(d=h;d<=g;d++){f=this.data[d].axes[this.id].graphs[c.id];f.percents={};var h=f.values,l;for(l in h)f.percents[l]="percents"!=l?
|
54
|
-
(!0!==b.categoryAxis.parseDates||a||this.end<this.data.length-1&&this.end++);a=this.minMaxMultiplier;this.min=this.getMin(this.start,this.end);this.max=this.getMax();a=(this.max-this.min)*(a-1);this.min-=a;this.max+=a;a=this.guides.length;if(this.includeGuidesInMinMax&&0<a)for(b=0;b<a;b++)c=this.guides[b],
|
55
|
-
isNaN(this.maximum)||(this.max=this.maximum);this.min>this.max&&(a=this.max,this.max=this.min,this.min=a);isNaN(this.minTemp)||(this.min=this.minTemp);isNaN(this.maxTemp)||(this.max=this.maxTemp);this.minReal=this.min;this.maxReal=this.max;0===this.min&&0===this.max&&(this.max=9);this.min>this.max&&
|
56
|
-
isNaN(this.maximum)&&isNaN(this.maxTemp)&&(this.max=Math.ceil(this.max/d)*d+d);isNaN(this.minimum)&&isNaN(this.minTemp)&&(this.min=Math.floor(this.min/d)*d-d);0>this.min&&0<=a&&(this.min=0);0<this.max&&0>=b&&(this.max=0);"100%"==this.stackType&&(this.min=0>this.min?-100:0,this.max=0>this.max?0:100);
|
57
|
-
d=Math.ceil(this.step/c);5<d&&(d=10);5>=d&&2<d&&(d=5);this.step=Math.ceil(this.step/(c*d))*c*d;1>c?(this.maxDecCount=Math.abs(Math.log(Math.abs(c))*Math.LOG10E),this.maxDecCount=Math.round(this.maxDecCount),this.step=AmCharts.roundTo(this.step,this.maxDecCount+1)):this.maxDecCount=0;this.min=
|
58
|
-
c=Math.pow(10,Math.floor(Math.log(Math.abs(this.minReal))*Math.LOG10E));0===this.min&&(this.minReal=c);0===this.min&&1<this.minReal&&(this.minReal=1);0<this.min&&0<this.minReal-this.step&&(this.minReal=this.min+this.step<this.minReal?this.min+this.step:this.min);c=Math.log(b)*
|
59
|
-
Math.floor(Math.log(Math.abs(this.min))*Math.LOG10E))/10,a=Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E))/10,b<a&&(this.minReal=this.min=10*a)))},fixStepE:function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return this.generateNumber(1,
|
60
|
-
f;for(f in e)if(e.hasOwnProperty(f)){var g=this.chart.getGraphById(f);if(g.includeInMinMax&&(!g.hidden||this.includeHidden)){isNaN(c)&&(c=Infinity);this.foundGraphs=!0;g=e[f].values;this.recalculateToPercents&&(g=e[f].percents);var h;if(this.minMaxField)h=
|
61
|
-
this.chart.getGraphById(d);if(e.includeInMinMax&&(!e.hidden||this.includeHidden)){isNaN(a)&&(a=-Infinity);this.foundGraphs=!0;e=c[d].values;this.recalculateToPercents&&(e=c[d].percents);var f;if(this.minMaxField)f=e[this.minMaxField],
|
62
|
-
b){if(b<a){var c=b;b=a;a=c}a<this.min&&(a=this.min);b>this.max&&(b=this.max);c={type:"axisSelfZoomed"};c.chart=this.chart;c.valueAxis=this;c.multiplier=this.axisWidth/Math.abs(this.getCoordinate(b)-this.getCoordinate(a));c.position="V"==
|
63
|
-
f=this.min,g=this.minReal;return!0===this.logarithmic?Math.pow(10,(e?!0===d?(b-a)/c:a/c:!0===d?a/c:(b-a)/c)+Math.log(g)*Math.LOG10E):!0===d?e?f-(a-b)/c:a/c+f:e?a/c+f:f-(a-b)/c},getCoordinate:function(a){if(isNaN(a))return NaN;
|
64
|
-
this.viX):b+(this.y-this.viY);return Math.round(b)},synchronizeWithAxis:function(a){this.synchronizeWith=a;this.removeListener(this.synchronizeWith,"axisChanged",this.handleSynchronization);this.listenTo(this.synchronizeWith,
|
65
|
-
a=Math.abs(Math.log(Math.abs(a))*Math.LOG10E),this.maxDecCount=a=Math.round(a),this.draw())}});AmCharts.RecAxis=AmCharts.Class({construct:function(a){var b=a.chart,c=a.axisThickness,d=a.axisColor,e=a.axisAlpha,f=a.offset,g=a.dx,h=a.dy,k=a.viX,l=a.viY,m=a.viH,n=a.viW,p=b.container;"H"==a.orientation?(d=AmCharts.line(p,[0,n],[0,0],d,e,c),this.axisWidth=a.width,"bottom"==a.position?(a=c/2+f+m+l-1,c=k):(a=-c/2-f+l+h,c=g+k)):(this.axisWidth=a.height,"right"==a.position?(d=AmCharts.line(p,[0,0,-g],[0,m,m-h],d,e,c),a=l+h,c=c/2+f+g+n+k-1):(d=AmCharts.line(p,[0,0],[0,m],d,e,c),a=l,c=-c/2-f+k));d.translate(c,
|
66
|
-
a);b.axesSet.push(d);this.set=d}});AmCharts.RecItem=AmCharts.Class({construct:function(a,b,c,d,e,f,g,h,k,l){b=Math.round(b);void 0==c&&(c="");k||(k=0);void 0==d&&(d=!0);var m=a.chart.fontFamily,n=a.fontSize;void 0==n&&(n=a.chart.fontSize);var p=a.color;void 0==p&&(p=a.chart.color);var q=a.chart.container,u=q.set();this.set=u;var r=a.axisThickness,s=a.axisColor,w=a.axisAlpha,v=a.tickLength,t=a.gridAlpha,A=a.gridThickness,
|
67
|
-
|
68
|
-
B*Math.PI/180,ha,G=0,
|
69
|
-
0,U),ha=d-
|
70
|
-
y&&(
|
71
|
-
ca?(G
|
72
|
-
|
73
|
-
c,a.height,d,l),a.translate(b-h+e,f));this.set=k.set([a])},graphics:function(){return this.set},getLabel:function(){}});AmCharts.AmChart=AmCharts.Class({construct:function(){this.version="3.
|
74
|
-
this.percentFormatter={precision:2,decimalSeparator:".",thousandsSeparator:","};this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];var a=document.createElement("div"),b=a.style;b.overflow="hidden";b.position="relative";b.textAlign="left";this.chartDiv=a;a=document.createElement("div");b=a.style;b.overflow="hidden";b.position="relative";b.textAlign="left";this.legendDiv=a;this.balloon=new AmCharts.AmBalloon;this.
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
a.appendChild(b);break;case "
|
80
|
-
"
|
81
|
-
this.
|
82
|
-
|
83
|
-
a.set(),this.
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
39
|
+
!0;this.gridType="polygons";this.useScientificNotation=!1;this.axisTitleOffset=10;this.minMaxMultiplier=1},updateData:function(){0>=this.gridCount&&(this.gridCount=1);this.totals=[];this.data=this.chart.chartData;var a=this.chart;"xy"!=a.chartType&&(this.stackGraphs("smoothedLine"),this.stackGraphs("line"),this.stackGraphs("column"),this.stackGraphs("step"));this.recalculateToPercents&&this.recalculate();this.synchronizationMultiplier&&this.synchronizeWith?(AmCharts.isString(this.synchronizeWith)&&
|
40
|
+
(this.synchronizeWith=a.getValueAxisById(this.synchronizeWith)),this.synchronizeWith&&(this.synchronizeWithAxis(this.synchronizeWith),this.foundGraphs=!0)):(this.foundGraphs=!1,this.getMinMax())},draw:function(){AmCharts.ValueAxis.base.draw.call(this);var a=this.chart,b=this.set;"duration"==this.type&&(this.duration="ss");!0===this.dataChanged&&(this.updateData(),this.dataChanged=!1);if(this.logarithmic&&(0>=this.getMin(0,this.data.length-1)||0>=this.minimum))this.fire("logarithmicAxisFailed",{type:"logarithmicAxisFailed",
|
41
|
+
chart:a});else{this.grid0=null;var c,d,e=a.dx,f=a.dy,g=!1,h=this.logarithmic,k=a.chartType;if(isNaN(this.min)||isNaN(this.max)||!this.foundGraphs||Infinity==this.min||-Infinity==this.max)g=!0;else{var l=this.labelFrequency,m=this.showFirstLabel,n=this.showLastLabel,p=1,q=0,u=Math.round((this.max-this.min)/this.step)+1,r;!0===h?(r=Math.log(this.max)*Math.LOG10E-Math.log(this.minReal)*Math.LOG10E,this.stepWidth=this.axisWidth/r,2<r&&(u=Math.ceil(Math.log(this.max)*Math.LOG10E)+1,q=Math.round(Math.log(this.minReal)*
|
42
|
+
Math.LOG10E),u>this.gridCount&&(p=Math.ceil(u/this.gridCount)))):this.stepWidth=this.axisWidth/(this.max-this.min);var s=0;1>this.step&&-1<this.step&&(s=this.getDecimals(this.step));this.integersOnly&&(s=0);s>this.maxDecCount&&(s=this.maxDecCount);var w=this.precision;isNaN(w)||(s=w);this.max=AmCharts.roundTo(this.max,this.maxDecCount);this.min=AmCharts.roundTo(this.min,this.maxDecCount);var v={};v.precision=s;v.decimalSeparator=a.numberFormatter.decimalSeparator;v.thousandsSeparator=a.numberFormatter.thousandsSeparator;
|
43
|
+
this.numberFormatter=v;var t,A=this.guides,F=A.length;if(0<F){c=this.fillAlpha;for(d=this.fillAlpha=0;d<F;d++){var x=A[d],z=NaN,H=x.above;isNaN(x.toValue)||(z=this.getCoordinate(x.toValue),t=new this.axisItemRenderer(this,z,"",!0,NaN,NaN,x),this.pushAxisItem(t,H));var I=NaN;isNaN(x.value)||(I=this.getCoordinate(x.value),t=new this.axisItemRenderer(this,I,x.label,!0,NaN,(z-I)/2,x),this.pushAxisItem(t,H));isNaN(z-I)||(t=new this.guideFillRenderer(this,I,z,x),this.pushAxisItem(t,H),t=t.graphics(),x.graphics=
|
44
|
+
t,x.balloonText&&this.addEventListeners(t,x))}this.fillAlpha=c}A=!1;for(d=q;d<u;d+=p)F=AmCharts.roundTo(this.step*d+this.min,s),-1!=String(F).indexOf("e")&&(A=!0,String(F).split("e"));this.duration&&(this.maxInterval=AmCharts.getMaxInterval(this.max,this.duration));var s=this.step,B,F=this.minorGridAlpha;this.minorGridEnabled&&(B=this.getMinorGridStep(s,this.stepWidth*s));for(d=q;d<u;d+=p)if(q=s*d+this.min,q=AmCharts.roundTo(q,this.maxDecCount+1),!this.integersOnly||Math.round(q)==q)if(isNaN(w)||
|
45
|
+
Number(AmCharts.toFixed(q,w))==q){!0===h&&(0===q&&(q=this.minReal),2<r&&(q=Math.pow(10,d)),A=-1!=String(q).indexOf("e")?!0:!1);this.useScientificNotation&&(A=!0);this.usePrefixes&&(A=!1);A?(t=-1==String(q).indexOf("e")?q.toExponential(15):String(q),c=t.split("e"),t=Number(c[0]),c=Number(c[1]),t=AmCharts.roundTo(t,14),10==t&&(t=1,c+=1),t=t+"e"+c,0===q&&(t="0"),1==q&&(t="1")):(h&&(t=String(q).split("."),v.precision=t[1]?t[1].length:-1),t=this.usePrefixes?AmCharts.addPrefix(q,a.prefixesOfBigNumbers,
|
46
|
+
a.prefixesOfSmallNumbers,v,!0):AmCharts.formatNumber(q,v,v.precision));this.duration&&(t=AmCharts.formatDuration(q,this.duration,"",this.durationUnits,this.maxInterval,v));this.recalculateToPercents?t+="%":(c=this.unit)&&(t="left"==this.unitPosition?c+t:t+c);Math.round(d/l)!=d/l&&(t=void 0);if(0===d&&!m||d==u-1&&!n)t=" ";c=this.getCoordinate(q);this.labelFunction&&(t=this.labelFunction(q,t,this));t=new this.axisItemRenderer(this,c,t);this.pushAxisItem(t);if(q==this.baseValue&&"radar"!=k){var da,O,
|
47
|
+
H=this.viW,z=this.viH;t=this.viX;x=this.viY;"H"==this.orientation?0<=c&&c<=H+1&&(da=[c,c,c+e],O=[z,0,f]):0<=c&&c<=z+1&&(da=[0,H,H+e],O=[c,c,c+f]);da&&(c=AmCharts.fitToBounds(2*this.gridAlpha,0,1),c=AmCharts.line(a.container,da,O,this.gridColor,c,1,this.dashLength),c.translate(t,x),this.grid0=c,a.axesSet.push(c),c.toBack())}if(!isNaN(B)&&0<F&&d<u-1){t=this.gridAlpha;this.gridAlpha=this.minorGridAlpha;for(c=1;c<s/B;c++)x=this.getCoordinate(q+B*c),x=new this.axisItemRenderer(this,x,"",!1,0,0,!1,!1,0,
|
48
|
+
!0),this.pushAxisItem(x);this.gridAlpha=t}}d=this.baseValue;this.min>this.baseValue&&this.max>this.baseValue&&(d=this.min);this.min<this.baseValue&&this.max<this.baseValue&&(d=this.max);h&&d<this.minReal&&(d=this.minReal);this.baseCoord=this.getCoordinate(d);a={type:"axisChanged",target:this,chart:a};a.min=h?this.minReal:this.min;a.max=this.max;this.fire("axisChanged",a);this.axisCreated=!0}h=this.axisLine.set;a=this.labelsSet;this.positionTitle();"radar"!=k?(k=this.viX,d=this.viY,b.translate(k,d),
|
49
|
+
a.translate(k,d)):h.toFront();!this.visible||g?(b.hide(),h.hide(),a.hide()):(b.show(),h.show(),a.show())}},getDecimals:function(a){var b=0;isNaN(a)||(a=String(a),-1!=a.indexOf("e-")?b=Number(a.split("-")[1]):-1!=a.indexOf(".")&&(b=a.split(".")[1].length));return b},getMinorGridStep:function(a,b){var c=[5,4,2];60>b&&c.shift();for(var d=Math.floor(Math.log(Math.abs(a))*Math.LOG10E),e=0;e<c.length;e++){var f=a/c[e],g=Math.floor(Math.log(Math.abs(f))*Math.LOG10E);if(!(0<Math.abs(d-g)))if(1>a){if(g=Math.pow(10,
|
50
|
+
-g)*f,g==Math.round(g))return f}else if(f==Math.round(f))return f}},stackGraphs:function(a){var b=this.stackType;"stacked"==b&&(b="regular");"line"==b&&(b="none");"100% stacked"==b&&(b="100%");this.stackType=b;var c=[],d=[],e=[],f=[],g,h=this.chart.graphs,k,l,m,n,p=this.baseValue,q=!1;if("line"==a||"step"==a||"smoothedLine"==a)q=!0;if(q&&("regular"==b||"100%"==b))for(n=0;n<h.length;n++)m=h[n],m.hidden||(l=m.type,m.chart==this.chart&&m.valueAxis==this&&a==l&&m.stackable&&(k&&(m.stackGraph=k),k=m));
|
51
|
+
for(k=this.start;k<=this.end;k++){var u=0;for(n=0;n<h.length;n++)if(m=h[n],!m.hidden&&(l=m.type,m.chart==this.chart&&m.valueAxis==this&&a==l&&m.stackable&&(l=this.data[k].axes[this.id].graphs[m.id],g=l.values.value,!isNaN(g)))){var r=this.getDecimals(g);u<r&&(u=r);isNaN(f[k])?f[k]=Math.abs(g):f[k]+=Math.abs(g);f[k]=AmCharts.roundTo(f[k],u);m=m.fillToGraph;q&&m&&(m=this.data[k].axes[this.id].graphs[m.id])&&(l.values.open=m.values.value);"regular"==b&&(q&&(isNaN(c[k])?(c[k]=g,l.values.close=g,l.values.open=
|
52
|
+
this.baseValue):(isNaN(g)?l.values.close=c[k]:l.values.close=g+c[k],l.values.open=c[k],c[k]=l.values.close)),"column"!=a||isNaN(g)||(l.values.close=g,0>g?(l.values.close=g,isNaN(d[k])?l.values.open=p:(l.values.close+=d[k],l.values.open=d[k]),d[k]=l.values.close):(l.values.close=g,isNaN(e[k])?l.values.open=p:(l.values.close+=e[k],l.values.open=e[k]),e[k]=l.values.close)))}}for(k=this.start;k<=this.end;k++)for(n=0;n<h.length;n++)m=h[n],m.hidden||(l=m.type,m.chart==this.chart&&m.valueAxis==this&&a==
|
53
|
+
l&&m.stackable&&(l=this.data[k].axes[this.id].graphs[m.id],g=l.values.value,isNaN(g)||(c=g/f[k]*100,l.values.percents=c,l.values.total=f[k],"100%"==b&&(isNaN(d[k])&&(d[k]=0),isNaN(e[k])&&(e[k]=0),0>c?(l.values.close=AmCharts.fitToBounds(c+d[k],-100,100),l.values.open=d[k],d[k]=l.values.close):(l.values.close=AmCharts.fitToBounds(c+e[k],-100,100),l.values.open=e[k],e[k]=l.values.close)))))},recalculate:function(){var a=this.chart.graphs,b;for(b=0;b<a.length;b++){var c=a[b];if(c.valueAxis==this){var d=
|
54
|
+
"value";if("candlestick"==c.type||"ohlc"==c.type)d="open";var e,f,g=this.end+2,g=AmCharts.fitToBounds(this.end+1,0,this.data.length-1),h=this.start;0<h&&h--;var k;f=this.start;c.compareFromStart&&(f=0);for(k=f;k<=g&&(f=this.data[k].axes[this.id].graphs[c.id],e=f.values[d],isNaN(e));k++);for(d=h;d<=g;d++){f=this.data[d].axes[this.id].graphs[c.id];f.percents={};var h=f.values,l;for(l in h)f.percents[l]="percents"!=l?h[l]/e*100-100:h[l]}}}},getMinMax:function(){var a=!1,b=this.chart,c=b.graphs,d;for(d=
|
55
|
+
0;d<c.length;d++){var e=c[d].type;("line"==e||"step"==e||"smoothedLine"==e)&&this.expandMinMax&&(a=!0)}a&&(0<this.start&&this.start--,this.end<this.data.length-1&&this.end++);"serial"==b.chartType&&(!0!==b.categoryAxis.parseDates||a||this.end<this.data.length-1&&this.end++);a=this.minMaxMultiplier;this.min=this.getMin(this.start,this.end);this.max=this.getMax();a=(this.max-this.min)*(a-1);this.min-=a;this.max+=a;a=this.guides.length;if(this.includeGuidesInMinMax&&0<a)for(b=0;b<a;b++)c=this.guides[b],
|
56
|
+
c.toValue<this.min&&(this.min=c.toValue),c.value<this.min&&(this.min=c.value),c.toValue>this.max&&(this.max=c.toValue),c.value>this.max&&(this.max=c.value);isNaN(this.minimum)||(this.min=this.minimum);isNaN(this.maximum)||(this.max=this.maximum);this.min>this.max&&(a=this.max,this.max=this.min,this.min=a);isNaN(this.minTemp)||(this.min=this.minTemp);isNaN(this.maxTemp)||(this.max=this.maxTemp);this.minReal=this.min;this.maxReal=this.max;0===this.min&&0===this.max&&(this.max=9);this.min>this.max&&
|
57
|
+
(this.min=this.max-1);a=this.min;b=this.max;c=this.max-this.min;d=0===c?Math.pow(10,Math.floor(Math.log(Math.abs(this.max))*Math.LOG10E))/10:Math.pow(10,Math.floor(Math.log(Math.abs(c))*Math.LOG10E))/10;isNaN(this.maximum)&&isNaN(this.maxTemp)&&(this.max=Math.ceil(this.max/d)*d+d);isNaN(this.minimum)&&isNaN(this.minTemp)&&(this.min=Math.floor(this.min/d)*d-d);0>this.min&&0<=a&&(this.min=0);0<this.max&&0>=b&&(this.max=0);"100%"==this.stackType&&(this.min=0>this.min?-100:0,this.max=0>this.max?0:100);
|
58
|
+
c=this.max-this.min;d=Math.pow(10,Math.floor(Math.log(Math.abs(c))*Math.LOG10E))/10;this.step=Math.ceil(c/this.gridCount/d)*d;c=Math.pow(10,Math.floor(Math.log(Math.abs(this.step))*Math.LOG10E));c=this.fixStepE(c);d=Math.ceil(this.step/c);5<d&&(d=10);5>=d&&2<d&&(d=5);this.step=Math.ceil(this.step/(c*d))*c*d;1>c?(this.maxDecCount=Math.abs(Math.log(Math.abs(c))*Math.LOG10E),this.maxDecCount=Math.round(this.maxDecCount),this.step=AmCharts.roundTo(this.step,this.maxDecCount+1)):this.maxDecCount=0;this.min=
|
59
|
+
this.step*Math.floor(this.min/this.step);this.max=this.step*Math.ceil(this.max/this.step);0>this.min&&0<=a&&(this.min=0);0<this.max&&0>=b&&(this.max=0);1<this.minReal&&1<this.max-this.minReal&&(this.minReal=Math.floor(this.minReal));c=Math.pow(10,Math.floor(Math.log(Math.abs(this.minReal))*Math.LOG10E));0===this.min&&(this.minReal=c);0===this.min&&1<this.minReal&&(this.minReal=1);0<this.min&&0<this.minReal-this.step&&(this.minReal=this.min+this.step<this.minReal?this.min+this.step:this.min);c=Math.log(b)*
|
60
|
+
Math.LOG10E-Math.log(a)*Math.LOG10E;this.logarithmic&&(2<c?(this.minReal=this.min=Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E)),this.max=Math.pow(10,Math.ceil(Math.log(Math.abs(b))*Math.LOG10E))):(b=Math.pow(10,Math.floor(Math.log(Math.abs(this.min))*Math.LOG10E))/10,a=Math.pow(10,Math.floor(Math.log(Math.abs(a))*Math.LOG10E))/10,b<a&&(this.minReal=this.min=10*a)))},fixStepE:function(a){a=a.toExponential(0).split("e");var b=Number(a[1]);9==Number(a[0])&&b++;return this.generateNumber(1,
|
61
|
+
b)},generateNumber:function(a,b){var c="",d;d=0>b?Math.abs(b)-1:Math.abs(b);var e;for(e=0;e<d;e++)c+="0";return 0>b?Number("0."+c+String(a)):Number(String(a)+c)},getMin:function(a,b){var c,d;for(d=a;d<=b;d++){var e=this.data[d].axes[this.id].graphs,f;for(f in e)if(e.hasOwnProperty(f)){var g=this.chart.getGraphById(f);if(g.includeInMinMax&&(!g.hidden||this.includeHidden)){isNaN(c)&&(c=Infinity);this.foundGraphs=!0;g=e[f].values;this.recalculateToPercents&&(g=e[f].percents);var h;if(this.minMaxField)h=
|
62
|
+
g[this.minMaxField],h<c&&(c=h);else for(var k in g)g.hasOwnProperty(k)&&"percents"!=k&&"total"!=k&&(h=g[k],h<c&&(c=h))}}}return c},getMax:function(){var a,b;for(b=this.start;b<=this.end;b++){var c=this.data[b].axes[this.id].graphs,d;for(d in c)if(c.hasOwnProperty(d)){var e=this.chart.getGraphById(d);if(e.includeInMinMax&&(!e.hidden||this.includeHidden)){isNaN(a)&&(a=-Infinity);this.foundGraphs=!0;e=c[d].values;this.recalculateToPercents&&(e=c[d].percents);var f;if(this.minMaxField)f=e[this.minMaxField],
|
63
|
+
f>a&&(a=f);else for(var g in e)e.hasOwnProperty(g)&&"percents"!=g&&"total"!=g&&(f=e[g],f>a&&(a=f))}}}return a},dispatchZoomEvent:function(a,b){var c={type:"axisZoomed",startValue:a,endValue:b,target:this,chart:this.chart};this.fire(c.type,c)},zoomToValues:function(a,b){if(b<a){var c=b;b=a;a=c}a<this.min&&(a=this.min);b>this.max&&(b=this.max);c={type:"axisSelfZoomed"};c.chart=this.chart;c.valueAxis=this;c.multiplier=this.axisWidth/Math.abs(this.getCoordinate(b)-this.getCoordinate(a));c.position="V"==
|
64
|
+
this.orientation?this.reversed?this.getCoordinate(a):this.getCoordinate(b):this.reversed?this.getCoordinate(b):this.getCoordinate(a);this.fire(c.type,c)},coordinateToValue:function(a){if(isNaN(a))return NaN;var b=this.axisWidth,c=this.stepWidth,d=this.reversed,e=this.rotate,f=this.min,g=this.minReal;return!0===this.logarithmic?Math.pow(10,(e?!0===d?(b-a)/c:a/c:!0===d?a/c:(b-a)/c)+Math.log(g)*Math.LOG10E):!0===d?e?f-(a-b)/c:a/c+f:e?a/c+f:f-(a-b)/c},getCoordinate:function(a){if(isNaN(a))return NaN;
|
65
|
+
var b=this.rotate,c=this.reversed,d=this.axisWidth,e=this.stepWidth,f=this.min,g=this.minReal;!0===this.logarithmic?(a=Math.log(a)*Math.LOG10E-Math.log(g)*Math.LOG10E,b=b?!0===c?d-e*a:e*a:!0===c?e*a:d-e*a):b=!0===c?b?d-e*(a-f):e*(a-f):b?e*(a-f):d-e*(a-f);b=this.rotate?b+(this.x-this.viX):b+(this.y-this.viY);return Math.round(b)},synchronizeWithAxis:function(a){this.synchronizeWith=a;this.removeListener(this.synchronizeWith,"axisChanged",this.handleSynchronization);this.listenTo(this.synchronizeWith,
|
66
|
+
"axisChanged",this.handleSynchronization)},handleSynchronization:function(a){var b=this.synchronizeWith;a=b.min;var c=b.max,b=b.step,d=this.synchronizationMultiplier;d&&(this.min=a*d,this.max=c*d,this.step=b*d,a=Math.pow(10,Math.floor(Math.log(Math.abs(this.step))*Math.LOG10E)),a=Math.abs(Math.log(Math.abs(a))*Math.LOG10E),this.maxDecCount=a=Math.round(a),this.draw())}});AmCharts.RecAxis=AmCharts.Class({construct:function(a){var b=a.chart,c=a.axisThickness,d=a.axisColor,e=a.axisAlpha,f=a.offset,g=a.dx,h=a.dy,k=a.viX,l=a.viY,m=a.viH,n=a.viW,p=b.container;"H"==a.orientation?(d=AmCharts.line(p,[0,n],[0,0],d,e,c),this.axisWidth=a.width,"bottom"==a.position?(a=c/2+f+m+l-1,c=k):(a=-c/2-f+l+h,c=g+k)):(this.axisWidth=a.height,"right"==a.position?(d=AmCharts.line(p,[0,0,-g],[0,m,m-h],d,e,c),a=l+h,c=c/2+f+g+n+k-1):(d=AmCharts.line(p,[0,0],[0,m],d,e,c),a=l,c=-c/2-f+k));d.translate(c,
|
67
|
+
a);b.axesSet.push(d);this.set=d}});AmCharts.RecItem=AmCharts.Class({construct:function(a,b,c,d,e,f,g,h,k,l){b=Math.round(b);void 0==c&&(c="");k||(k=0);void 0==d&&(d=!0);var m=a.chart.fontFamily,n=a.fontSize;void 0==n&&(n=a.chart.fontSize);var p=a.color;void 0==p&&(p=a.chart.color);var q=a.chart.container,u=q.set();this.set=u;var r=a.axisThickness,s=a.axisColor,w=a.axisAlpha,v=a.tickLength,t=a.gridAlpha,A=a.gridThickness,F=a.gridColor,x=a.dashLength,z=a.fillColor,H=a.fillAlpha,I=a.labelsEnabled,B=a.labelRotation,da=a.counter,O=a.inside,
|
68
|
+
ca=a.dx,W=a.dy,Ea=a.orientation,ea=a.position,Z=a.previousCoord,K=a.viH,U=a.viW,na=a.offset,X,Y;g?(I=!0,isNaN(g.tickLength)||(v=g.tickLength),void 0!=g.lineColor&&(F=g.lineColor),void 0!=g.color&&(p=g.color),isNaN(g.lineAlpha)||(t=g.lineAlpha),isNaN(g.dashLength)||(x=g.dashLength),isNaN(g.lineThickness)||(A=g.lineThickness),!0===g.inside&&(O=!0),isNaN(g.labelRotation)||(B=g.labelRotation),isNaN(g.fontSize)||(n=g.fontSize),g.position&&(ea=g.position)):""===c&&(v=0);Y="start";e&&(Y="middle");var $=
|
69
|
+
B*Math.PI/180,ha,G=0,E=0,ia=0,V=ha=0;"V"==Ea&&(B=0);var y;I&&(y=AmCharts.text(q,c,p,m,n,Y,h),V=y.getBBox().width);if("H"==Ea){if(0<=b&&b<=U+1&&(0<v&&0<w&&b+k<=U+1&&(X=AmCharts.line(q,[b+k,b+k],[0,v],s,w,A),u.push(X)),0<t&&(Y=AmCharts.line(q,[b,b+ca,b+ca],[K,K+W,W],F,t,A,x),u.push(Y))),E=0,G=b,g&&90==B&&(G-=n),!1===d?(Y="start",E="bottom"==ea?O?E+v:E-v:O?E-v:E+v,G+=3,e&&(G+=e/2,Y="middle"),0<B&&(Y="middle")):Y="middle",1==da&&0<H&&!g&&!l&&Z<U&&(d=AmCharts.fitToBounds(b,0,U),Z=AmCharts.fitToBounds(Z,
|
70
|
+
0,U),ha=d-Z,0<ha&&(fill=AmCharts.rect(q,ha,a.height,z,H),fill.translate(d-ha+ca,W),u.push(fill))),"bottom"==ea?(E+=K+n/2+na,O?0<B?(E=K-V/2*Math.sin($)-v-3,G+=V/2*Math.cos($)):0>B?(E-=v+n+3+3-V/2*Math.sin($),G-=V/2*Math.cos($)):E-=v+n+3+3:0<B?(E=K+V/2*Math.sin($)+v+3,G-=V/2*Math.cos($)):0>B?(E=K+v+3-V/2*Math.sin($)+2,G+=V/2*Math.cos($)):E+=v+r+3+3):(E+=W+n/2-na,G+=ca,O?0<B?(E=V/2*Math.sin($)+v+3,G-=V/2*Math.cos($)):E+=v+3:0<B?(E=-(V/2)*Math.sin($)-v-6,G+=V/2*Math.cos($)):E-=v+n+3+r+3),"bottom"==ea?
|
71
|
+
ha=(O?K-v-1:K+r-1)+na:(ia=ca,ha=(O?W:W-v-r+1)-na),f&&(G+=f),W=G,0<B&&(W+=V/2*Math.cos($)),y&&(ea=0,O&&(ea=V/2*Math.cos($)),W+ea>U+2||0>W))y.remove(),y=null}else{0<=b&&b<=K+1&&(0<v&&0<w&&b+k<=K+1&&(X=AmCharts.line(q,[0,v],[b+k,b+k],s,w,A),u.push(X)),0<t&&(Y=AmCharts.line(q,[0,ca,U+ca],[b,b+W,b+W],F,t,A,x),u.push(Y)));Y="end";if(!0===O&&"left"==ea||!1===O&&"right"==ea)Y="start";E=b-n/2;1==da&&0<H&&!g&&!l&&(d=AmCharts.fitToBounds(b,0,K),Z=AmCharts.fitToBounds(Z,0,K),$=d-Z,fill=AmCharts.polygon(q,[0,
|
72
|
+
a.width,a.width,0],[0,0,$,$],z,H),fill.translate(ca,d-$+W),u.push(fill));E+=n/2;"right"==ea?(G+=ca+U+na,E+=W,O?(G-=v+4,f||(E-=n/2+3)):(G+=v+4+r,E-=2)):O?(G+=v+4-na,f||(E-=n/2+3),g&&(G+=ca,E+=W)):(G+=-v-r-4-2-na,E-=2);X&&("right"==ea?(ia+=ca+na+U,ha+=W,ia=O?ia-r:ia+r):(ia-=na,O||(ia-=v+r)));f&&(E+=f);O=-3;"right"==ea&&(O+=W);y&&(E>K+1||E<O)&&(y.remove(),y=null)}X&&X.translate(ia,ha);!1===a.visible&&(X&&X.remove(),y&&(y.remove(),y=null));y&&(y.attr({"text-anchor":Y}),y.translate(G,E),0!==B&&y.rotate(-B,
|
73
|
+
a.chart.backgroundColor),a.allLabels.push(y)," "!=c&&(this.label=y));l||(a.counter=0===da?1:0,a.previousCoord=b);0===this.set.node.childNodes.length&&this.set.remove()},graphics:function(){return this.set},getLabel:function(){return this.label}});AmCharts.RecFill=AmCharts.Class({construct:function(a,b,c,d){var e=a.dx,f=a.dy,g=a.orientation,h=0;if(c<b){var k=b;b=c;c=k}var l=d.fillAlpha;isNaN(l)&&(l=0);k=a.chart.container;d=d.fillColor;"V"==g?(b=AmCharts.fitToBounds(b,0,a.viH),c=AmCharts.fitToBounds(c,0,a.viH)):(b=AmCharts.fitToBounds(b,0,a.viW),c=AmCharts.fitToBounds(c,0,a.viW));c-=b;isNaN(c)&&(c=4,h=2,l=0);0>c&&"object"==typeof d&&(d=d.join(",").split(",").reverse());"V"==g?(a=AmCharts.rect(k,a.width,c,d,l),a.translate(e,b-h+f)):(a=AmCharts.rect(k,
|
74
|
+
c,a.height,d,l),a.translate(b-h+e,f));this.set=k.set([a])},graphics:function(){return this.set},getLabel:function(){}});AmCharts.AmChart=AmCharts.Class({construct:function(){this.version="3.2.0";AmCharts.addChart(this);this.createEvents("dataUpdated","init","rendered","drawn");this.height=this.width="100%";this.dataChanged=!0;this.chartCreated=!1;this.previousWidth=this.previousHeight=0;this.backgroundColor="#FFFFFF";this.borderAlpha=this.backgroundAlpha=0;this.color=this.borderColor="#000000";this.fontFamily="Verdana";this.fontSize=11;this.usePrefixes=!1;this.numberFormatter={precision:-1,decimalSeparator:".",thousandsSeparator:","};
|
75
|
+
this.percentFormatter={precision:2,decimalSeparator:".",thousandsSeparator:","};this.labels=[];this.allLabels=[];this.titles=[];this.marginRight=this.marginLeft=this.autoMarginOffset=0;this.timeOuts=[];var a=document.createElement("div"),b=a.style;b.overflow="hidden";b.position="relative";b.textAlign="left";this.chartDiv=a;a=document.createElement("div");b=a.style;b.overflow="hidden";b.position="relative";b.textAlign="left";this.legendDiv=a;this.balloon=new AmCharts.AmBalloon;this.titleHeight=0;this.hideBalloonTime=
|
76
|
+
150;this.handDrawScatter=2;this.handDrawThickness=1;this.prefixesOfBigNumbers=[{number:1E3,prefix:"k"},{number:1E6,prefix:"M"},{number:1E9,prefix:"G"},{number:1E12,prefix:"T"},{number:1E15,prefix:"P"},{number:1E18,prefix:"E"},{number:1E21,prefix:"Z"},{number:1E24,prefix:"Y"}];this.prefixesOfSmallNumbers=[{number:1E-24,prefix:"y"},{number:1E-21,prefix:"z"},{number:1E-18,prefix:"a"},{number:1E-15,prefix:"f"},{number:1E-12,prefix:"p"},{number:1E-9,prefix:"n"},{number:1E-6,prefix:"\u03bc"},{number:0.001,
|
77
|
+
prefix:"m"}];this.panEventsEnabled=!1;AmCharts.bezierX=3;AmCharts.bezierY=6;this.product="amcharts";this.animations=[]},drawChart:function(){this.drawBackground();this.redrawLabels();this.drawTitles()},drawBackground:function(){AmCharts.remove(this.background);var a=this.container,b=this.backgroundColor,c=this.backgroundAlpha,d=this.set;AmCharts.isModern||0!==c||(c=0.001);var e=this.updateWidth();this.realWidth=e;var f=this.updateHeight();this.realHeight=f;this.background=b=AmCharts.polygon(a,[0,
|
78
|
+
e-1,e-1,0],[0,0,f-1,f-1],b,c,1,this.borderColor,this.borderAlpha);d.push(b);if(b=this.backgroundImage)this.path&&(b=this.path+b),this.bgImg=a=a.image(b,0,0,e,f),d.push(a)},drawTitles:function(){var a=this.titles;if(AmCharts.ifArray(a)){var b=20,c;for(c=0;c<a.length;c++){var d=a[c],e=d.color;void 0===e&&(e=this.color);var f=d.size;isNaN(d.alpha);var g=this.marginLeft,e=AmCharts.text(this.container,d.text,e,this.fontFamily,f);e.translate(g+(this.realWidth-this.marginRight-g)/2,b);g=!0;void 0!==d.bold&&
|
79
|
+
(g=d.bold);g&&e.attr({"font-weight":"bold"});b+=f+6;this.freeLabelsSet.push(e)}}},write:function(a){var b=this.balloon;b&&!b.chart&&(b.chart=this);(b=this.exportConfig)&&AmCharts.AmExport&&!this.AmExport&&(this.AmExport=new AmCharts.AmExport(this,b));a="object"!=typeof a?document.getElementById(a):a;a.innerHTML="";this.div=a;a.style.overflow="hidden";a.style.textAlign="left";var b=this.chartDiv,c=this.legendDiv,d=this.legend,e=c.style,f=b.style;this.measure();var g,h;g=document.createElement("div");
|
80
|
+
h=g.style;h.position="relative";this.containerDiv=g;a.appendChild(g);if(d)switch(d=this.addLegend(d),d.position){case "bottom":g.appendChild(b);g.appendChild(c);break;case "top":g.appendChild(c);g.appendChild(b);break;case "absolute":h.width=a.style.width;h.height=a.style.height;e.position="absolute";f.position="absolute";void 0!==d.left&&(e.left=d.left+"px");void 0!==d.right&&(e.right=d.right+"px");void 0!==d.top&&(e.top=d.top+"px");void 0!==d.bottom&&(e.bottom=d.bottom+"px");d.marginLeft=0;d.marginRight=
|
81
|
+
0;g.appendChild(b);g.appendChild(c);break;case "right":h.width=a.style.width;h.height=a.style.height;e.position="relative";f.position="absolute";g.appendChild(b);g.appendChild(c);break;case "left":h.width=a.style.width;h.height=a.style.height;e.position="absolute";f.position="relative";g.appendChild(b);g.appendChild(c);break;case "outside":g.appendChild(b)}else g.appendChild(b);this.listenersAdded||(this.addListeners(),this.listenersAdded=!0);this.initChart()},createLabelsSet:function(){AmCharts.remove(this.labelsSet);
|
82
|
+
this.labelsSet=this.container.set();this.freeLabelsSet.push(this.labelsSet)},initChart:function(){this.divIsFixed=AmCharts.findIfFixed(this.chartDiv);this.previousHeight=this.divRealHeight;this.previousWidth=this.divRealWidth;this.destroy();this.startInterval();var a=0;document.attachEvent&&!window.opera&&(a=1);this.dmouseX=this.dmouseY=0;var b=document.getElementsByTagName("html")[0];b&&window.getComputedStyle&&(b=window.getComputedStyle(b,null))&&(this.dmouseY=AmCharts.removePx(b.getPropertyValue("margin-top")),
|
83
|
+
this.dmouseX=AmCharts.removePx(b.getPropertyValue("margin-left")));this.mouseMode=a;a=new AmCharts.AmDraw(this.chartDiv,this.realWidth,this.realHeight,this);a.handDrawn=this.handDrawn;a.handDrawScatter=this.handDrawScatter;a.handDrawThickness=this.handDrawThickness;this.container=a;if(AmCharts.VML||AmCharts.SVG)a=this.container,this.set=a.set(),this.gridSet=a.set(),this.graphsBehindSet=a.set(),this.bulletBehindSet=a.set(),this.columnSet=a.set(),this.graphsSet=a.set(),this.trendLinesSet=a.set(),this.axesLabelsSet=
|
84
|
+
a.set(),this.axesSet=a.set(),this.cursorSet=a.set(),this.scrollbarsSet=a.set(),this.bulletSet=a.set(),this.freeLabelsSet=a.set(),this.balloonsSet=a.set(),this.balloonsSet.setAttr("id","balloons"),this.zoomButtonSet=a.set(),this.linkSet=a.set(),this.brrr(),this.renderFix()},measure:function(){var a=this.div,b=this.chartDiv,c=a.offsetWidth,d=a.offsetHeight,e=this.container;a.clientHeight&&(c=a.clientWidth,d=a.clientHeight);var f=AmCharts.removePx(AmCharts.getStyle(a,"padding-left")),g=AmCharts.removePx(AmCharts.getStyle(a,
|
85
|
+
"padding-right")),h=AmCharts.removePx(AmCharts.getStyle(a,"padding-top")),k=AmCharts.removePx(AmCharts.getStyle(a,"padding-bottom"));isNaN(f)||(c-=f);isNaN(g)||(c-=g);isNaN(h)||(d-=h);isNaN(k)||(d-=k);f=a.style;a=f.width;f=f.height;-1!=a.indexOf("px")&&(c=AmCharts.removePx(a));-1!=f.indexOf("px")&&(d=AmCharts.removePx(f));a=AmCharts.toCoordinate(this.width,c);f=AmCharts.toCoordinate(this.height,d);this.balloon=AmCharts.processObject(this.balloon,AmCharts.AmBalloon);this.balloon.chart=this;if(a!=this.previousWidth||
|
86
|
+
f!=this.previousHeight)b.style.width=a+"px",b.style.height=f+"px",e&&e.setSize(a,f),this.balloon.setBounds(2,2,a-2,f);this.realWidth=a;this.realHeight=f;this.divRealWidth=c;this.divRealHeight=d},destroy:function(){this.chartDiv.innerHTML="";this.clearTimeOuts();this.interval&&clearInterval(this.interval);this.interval=NaN},clearTimeOuts:function(){var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]},clear:function(a){AmCharts.callMethod("clear",[this.chartScrollbar,
|
87
|
+
this.scrollbarV,this.scrollbarH,this.chartCursor]);this.chartCursor=this.scrollbarH=this.scrollbarV=this.chartScrollbar=null;this.clearTimeOuts();this.container&&(this.container.remove(this.chartDiv),this.container.remove(this.legendDiv));a||AmCharts.removeChart(this)},setMouseCursor:function(a){"auto"==a&&AmCharts.isNN&&(a="default");this.chartDiv.style.cursor=a;this.legendDiv.style.cursor=a},redrawLabels:function(){this.labels=[];var a=this.allLabels;this.createLabelsSet();var b;for(b=0;b<a.length;b++)this.drawLabel(a[b])},
|
88
|
+
drawLabel:function(a){if(this.container){var b=a.y,c=a.text,d=a.align,e=a.size,f=a.color,g=a.rotation,h=a.alpha,k=a.bold,l=AmCharts.toCoordinate(a.x,this.realWidth),b=AmCharts.toCoordinate(b,this.realHeight);l||(l=0);b||(b=0);void 0===f&&(f=this.color);isNaN(e)&&(e=this.fontSize);d||(d="start");"left"==d&&(d="start");"right"==d&&(d="end");"center"==d&&(d="middle",g?b=this.realHeight-b+b/2:l=this.realWidth/2-l);void 0===h&&(h=1);void 0===g&&(g=0);b+=e/2;c=AmCharts.text(this.container,c,f,this.fontFamily,
|
89
|
+
e,d,k,h);c.translate(l,b);0!==g&&c.rotate(g);a.url&&(c.setAttr("cursor","pointer"),c.click(function(){AmCharts.getURL(a.url)}));this.labelsSet.push(c);this.labels.push(c)}},addLabel:function(a,b,c,d,e,f,g,h,k,l){a={x:a,y:b,text:c,align:d,size:e,color:f,alpha:h,rotation:g,bold:k,url:l};this.container&&this.drawLabel(a);this.allLabels.push(a)},clearLabels:function(){var a=this.labels,b;for(b=a.length-1;0<=b;b--)a[b].remove();this.labels=[];this.allLabels=[]},updateHeight:function(){var a=this.divRealHeight,
|
90
|
+
b=this.legend;if(b){var c=this.legendDiv.offsetHeight,b=b.position;if("top"==b||"bottom"==b){a-=c;if(0>a||isNaN(a))a=0;this.chartDiv.style.height=a+"px"}}return a},updateWidth:function(){var a=this.divRealWidth,b=this.divRealHeight,c=this.legend;if(c){var d=this.legendDiv,e=d.offsetWidth,f=d.offsetHeight,d=d.style,g=this.chartDiv.style,c=c.position;if("right"==c||"left"==c){a-=e;if(0>a||isNaN(a))a=0;g.width=a+"px";"left"==c?g.left=e+"px":d.left=a+"px";d.top=(b-f)/2+"px"}}return a},getTitleHeight:function(){var a=
|
91
|
+
0,b=this.titles;if(0<b.length){var a=15,c;for(c=0;c<b.length;c++)a+=b[c].size+6}return a},addTitle:function(a,b,c,d,e){isNaN(b)&&(b=this.fontSize+2);a={text:a,size:b,color:c,alpha:d,bold:e};this.titles.push(a);return a},addMouseWheel:function(){var a=this;window.addEventListener&&(window.addEventListener("DOMMouseScroll",function(b){a.handleWheel.call(a,b)},!1),document.addEventListener("mousewheel",function(b){a.handleWheel.call(a,b)},!1))},handleWheel:function(a){if(this.mouseIsOver){var b=0;a||
|
92
|
+
(a=window.event);a.wheelDelta?b=a.wheelDelta/120:a.detail&&(b=-a.detail/3);b&&this.handleWheelReal(b);a.preventDefault&&a.preventDefault();a.returnValue=!1}},handleWheelReal:function(a){},addListeners:function(){var a=this,b=a.chartDiv;document.addEventListener?(a.panEventsEnabled&&"ontouchstart"in document.documentElement&&(b.addEventListener("touchstart",function(b){a.handleTouchMove.call(a,b);a.handleTouchStart.call(a,b)},!0),b.addEventListener("touchmove",function(b){a.handleTouchMove.call(a,
|
92
93
|
b)},!0),b.addEventListener("touchend",function(b){a.handleTouchEnd.call(a,b)},!0)),b.addEventListener("mousedown",function(b){a.handleMouseDown.call(a,b)},!0),b.addEventListener("mouseover",function(b){a.handleMouseOver.call(a,b)},!0),b.addEventListener("mouseout",function(b){a.handleMouseOut.call(a,b)},!0)):(b.attachEvent("onmousedown",function(b){a.handleMouseDown.call(a,b)}),b.attachEvent("onmouseover",function(b){a.handleMouseOver.call(a,b)}),b.attachEvent("onmouseout",function(b){a.handleMouseOut.call(a,
|
93
94
|
b)}))},dispDUpd:function(){var a;this.dispatchDataUpdated&&(this.dispatchDataUpdated=!1,a="dataUpdated",this.fire(a,{type:a,chart:this}));this.chartCreated||(a="init",this.fire(a,{type:a,chart:this}));this.chartRendered||(a="rendered",this.fire(a,{type:a,chart:this}),this.chartRendered=!0);a="drawn";this.fire(a,{type:a,chart:this})},brrr:function(){var a=this.product,b=a+".com",c=window.location.hostname.split("."),d;2<=c.length&&(d=c[c.length-2]+"."+c[c.length-1]);AmCharts.remove(this.bbset);if(d!=
|
94
95
|
b){var b=b+"/?utm_source=swf&utm_medium=demo&utm_campaign=jsDemo"+a,e="chart by ",c=145;"ammap"==a&&(e="tool by ",c=125);d=AmCharts.rect(this.container,c,20,"#FFFFFF",1);e=AmCharts.text(this.container,e+a+".com","#000000","Verdana",11,"start");e.translate(7,9);d=this.container.set([d,e]);"ammap"==a&&d.translate(this.realWidth-c,0);this.bbset=d;this.linkSet.push(d);d.setAttr("cursor","pointer");d.click(function(){window.location.href="http://"+b});for(a=0;a<d.length;a++)d[a].attr({cursor:"pointer"})}},
|
@@ -97,56 +98,56 @@ this.previousWidth=NaN;this.invalidateSizeReal()},invalidateSizeReal:function(){
|
|
97
98
|
!0;this.initChart()},hideBalloon:function(){var a=this;clearInterval(a.hoverInt);clearTimeout(a.balloonTO);a.hoverInt=setTimeout(function(){a.hideBalloonReal.call(a)},a.hideBalloonTime)},cleanChart:function(){},hideBalloonReal:function(){var a=this.balloon;a&&a.hide()},showBalloon:function(a,b,c,d,e){var f=this;clearTimeout(f.balloonTO);clearInterval(f.hoverInt);f.balloonTO=setTimeout(function(){f.showBalloonReal.call(f,a,b,c,d,e)},1)},showBalloonReal:function(a,b,c,d,e){this.handleMouseMove();var f=
|
98
99
|
this.balloon;f.enabled&&(f.followCursor(!1),f.changeColor(b),!c||f.fixedPosition?(f.setPosition(d,e),f.followCursor(!1)):f.followCursor(!0),a&&f.showBalloon(a))},handleTouchMove:function(a){this.hideBalloon();var b=this.chartDiv;a.touches&&(a=a.touches.item(0),this.mouseX=a.pageX-AmCharts.findPosX(b),this.mouseY=a.pageY-AmCharts.findPosY(b))},handleMouseOver:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0},handleMouseOut:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!1},handleMouseMove:function(a){if(this.mouseIsOver){var b=
|
99
100
|
this.chartDiv;a||(a=window.event);var c,d;if(a){this.posX=AmCharts.findPosX(b);this.posY=AmCharts.findPosY(b);switch(this.mouseMode){case 1:c=a.clientX-this.posX;d=a.clientY-this.posY;if(!this.divIsFixed){var b=document.body,e,f;b&&(e=b.scrollLeft,y1=b.scrollTop);if(b=document.documentElement)f=b.scrollLeft,y2=b.scrollTop;e=Math.max(e,f);f=Math.max(y1,y2);c+=e;d+=f}break;case 0:this.divIsFixed?(c=a.clientX-this.posX,d=a.clientY-this.posY):(c=a.pageX-this.posX,d=a.pageY-this.posY)}a.touches&&(a=a.touches.item(0),
|
100
|
-
c=a.pageX-this.posX,d=a.pageY-this.posY);this.mouseX=c-this.dmouseX;this.mouseY=d-this.dmouseY}}},handleTouchStart:function(a){this.handleMouseDown(a)},handleTouchEnd:function(a){AmCharts.resetMouseOver();this.handleReleaseOutside(a)},handleReleaseOutside:function(a){},handleMouseDown:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0;a&&a.preventDefault&&a.preventDefault()},addLegend:function(a,b){AmCharts.
|
101
|
-
b;this.legend=a;a.chart=this;c?(a.div=c,a.position="outside",a.autoMargins=!1):a.div=this.legendDiv;c=this.handleLegendEvent;this.listenTo(a,"showItem",c);this.listenTo(a,"hideItem",c);this.listenTo(a,"clickMarker",c);this.listenTo(a,"rollOverItem",c);this.listenTo(a,"rollOutItem",c);this.listenTo(a,"rollOverMarker",c);this.listenTo(a,"rollOutMarker",c);this.listenTo(a,"clickLabel",c)},removeLegend:function(){this.legend=void 0;this.legendDiv.innerHTML=""},handleResize:function(){(AmCharts.isPercents(this.width)||
|
102
|
-
AmCharts.isPercents(this.height))&&this.invalidateSizeReal();this.renderFix()},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},getSVG:function(){if(AmCharts.hasSVG)return this.container},animate:function(a,b,c,d,e,f,g){a["an_"+b]&&AmCharts.removeFromArray(this.animations,a["an_"+b]);c={obj:a,frame:0,attribute:b,from:c,to:d,time:e,effect:f,suffix:g};a["an_"+b]=c;this.animations.push(c);return c},
|
103
|
-
setInterval(function(){a.updateAnimations.call(a)},AmCharts.updateRate)},stopAnim:function(a){AmCharts.removeFromArray(this.animations,a)},updateAnimations:function(){var a;this.container&&this.container.update();for(a=this.animations.length-1;0<=a;a--){var b=this.animations[a],c=1E3*b.time/AmCharts.updateRate,d=b.frame+1,e=b.obj,f=b.attribute;if(d<=c){b.frame++;var g=Number(b.from),h=Number(b.to)-g,c=AmCharts[b.effect](0,d,g,h,c);0===h?this.animations.splice(a,
|
104
|
-
Number(b.to)+b.suffix,this.animations.splice(a,1)}}});AmCharts.Slice=AmCharts.Class({construct:function(){}});AmCharts.SerialDataItem=AmCharts.Class({construct:function(){}});AmCharts.GraphDataItem=AmCharts.Class({construct:function(){}});AmCharts.Guide=AmCharts.Class({construct:function(){}});AmCharts.AmGraph=AmCharts.Class({construct:function(){this.createEvents("rollOverGraphItem","rollOutGraphItem","clickGraphItem","doubleClickGraphItem","rightClickGraphItem","clickGraph");this.type="line";this.stackable=!0;this.columnCount=1;this.columnIndex=0;this.centerCustomBullets=this.showBalloon=!0;this.maxBulletSize=50;this.minBulletSize=0;this.balloonText="[[value]]";this.hidden=this.scrollbar=this.animationPlayed=!1;this.pointPosition="middle";this.depthCount=1;this.includeInMinMax
|
105
|
-
0;this.visibleInLegend=!0;this.showAllValueLabels=!1;this.showBalloonAt="close";this.lineThickness=1;this.dashLength=0;this.connect=!0;this.lineAlpha=1;this.bullet="none";this.bulletBorderThickness=2;this.bulletBorderAlpha=0;this.bulletAlpha=1;this.bulletSize=8;this.hideBulletsCount=this.bulletOffset=0;this.labelPosition="top";this.cornerRadiusTop=0;this.cursorBulletAlpha=1;this.gradientOrientation="vertical";this.dy=this.dx=0;this.periodValue="";this.clustered=!0;this.y=this.x=
|
106
|
-
this.chart,b=a.container;this.container=b;this.destroy();var c=b.set(),d=b.set();this.behindColumns?(a.graphsBehindSet.push(c),a.bulletBehindSet.push(d)):(a.graphsSet.push(c),a.bulletSet.push(d));this.bulletSet=d;
|
107
|
-
(c=!1,"xy"==this.chartType?this.xAxis.axisCreated&&this.yAxis.axisCreated&&(c=!0):this.valueAxis.axisCreated&&(c=!0),!this.hidden&&c&&this.createGraph())},createGraph:function(){var a=this,b=a.chart;"inside"==a.labelPosition&&(a.labelPosition="bottom");a.startAlpha=b.startAlpha;a.seqAn=b.sequencedAnimation;a.baseCoord=a.valueAxis.baseCoord;a.fillColors||(a.fillColors=a.lineColor);void 0===
|
108
|
-
void 0===a.bulletAlpha&&(a.bulletAlpha=a.lineAlpha);clearTimeout(a.playedTO);if(!isNaN(a.valueAxis.min)&&!isNaN(a.valueAxis.max)){switch(a.chartType){case "serial":a.createSerialGraph();"candlestick"==a.type&&1>a.valueAxis.minMaxMultiplier&&a.positiveClip(a.set);break;case "radar":a.createRadarGraph();break;case "xy":a.createXYGraph(),a.positiveClip(a.set)}a.playedTO=setTimeout(function(){a.setAnimationPlayed.call(a)},
|
109
|
-
|
110
|
-
createRadarGraph:function(){var a=this.valueAxis.stackType,b=[],c=[],d,e,f;for(f=this.start;f<=this.end;f++){var g=this.data[f].axes[this.valueAxis.id].graphs[this.id],h;h="none"==a||"3d"==a?g.values.value:g.values.close;if(isNaN(h))this.drawLineGraph(b,c),b=[],c=[];else{var k=this.y-(this.valueAxis.getCoordinate(h)-this.height),l=180-360/(this.end-this.start+1)*f;h=k*Math.sin(l/180*Math.PI);k*=Math.cos(l/
|
111
|
-
m&&(g=this.createLabel(g,h,k,m),this.allBullets.push(g),this.positionLabel(h,k,g,this.labelPosition,l));isNaN(d)&&(d=h);isNaN(e)&&(e=k)}}b.push(d);c.push(e);this.drawLineGraph(b,c);this.launchAnimation()},positionLabel:function(a,b,c,d,e){var f=c.getBBox();switch(d){case "left":a-=(f.width+e)/2+2;break;case "top":b-=(e+f.height)/2+1;break;case "right":a+=(f.width+e)/2+2;break;case "bottom":b+=(e+f.height)/
|
112
|
-
(a=0);return this.gradientRotation=a},createSerialGraph:function(){this.dashLengthSwitched=this.fillColorsSwitched=this.lineColorSwitched=void 0;var a=this.chart,b=this.id,c=this.index,d=this.data,e=this.chart.container,f=this.valueAxis,g=this.type,h=this.columnWidthReal;isNaN(this.columnWidth)||(h=this.columnWidth);var k=this.width,l=this.height,m=this.y,n=this.rotate,p=this.columnCount,q=AmCharts.toCoordinate(this.cornerRadiusTop,
|
113
|
-
x,z=this.dx/this.depthCount,H=this.dy/this.depthCount,I=f.stackType,B=this.labelPosition,
|
114
|
-
|
115
|
-
f.logarithmic&&(
|
116
|
-
1))/p:
|
117
|
-
y.index=P;var
|
118
|
-
ta.close,db=ta.low,
|
119
|
-
(Q=
|
120
|
-
y.fillColors,this.dashLengthSwitched=y.dashLength));break;case "smoothedLine":isNaN(R)?u||(this.drawSmoothedGraph(r,s,S,T),r=[],s=[],S=[],T=[]):(y.isNegative=R<
|
121
|
-
u||(w=v=NaN,this.drawLineGraph(r,s,S,T),r=[],s=[],S=[],T=[]):(y.isNegative=R<
|
122
|
-
(s.push(v),r.push(D-ma)),r.push(D-ma),s.push(C),r.push(D+
|
123
|
-
H*
|
124
|
-
qa=C;
|
125
|
-
I&&(n?(x=(
|
126
|
-
gb;ka=ra;void 0!=y.lineColor&&(ka=y.lineColor);if(n){if(
|
127
|
-
kb=[
|
128
|
-
nb;if(n){var ob=C-h/2,ob=AmCharts.fitToBounds(ob,0,l),wb=AmCharts.fitToBounds(C,0,l),pb=C+h/2,pb=AmCharts.fitToBounds(pb,0,l);mb=AmCharts.line(e,[Q,Q],[ob,wb],ra,U,
|
129
|
-
[xb,rb],[C,C],ra,U,
|
130
|
-
(
|
131
|
-
|
132
|
-
s,S,T):this.drawLineGraph(r,s,S,T)
|
133
|
-
e=f.fontSize);a=f.formatString(d,a,this);a=AmCharts.cleanFromEmpty(a);f=AmCharts.text(this.container,a,g,f.fontFamily,e);f.translate(b,c);this.bulletSet.push(f);return f},positiveClip:function(a){a.clipRect(this.pmx,this.pmy,this.pmw,this.pmh)},negativeClip:function(a){a.clipRect(this.nmx,this.nmy,this.nmw,this.nmh)},drawLineGraph:function(a,
|
134
|
-
p=e.negativeLineAlpha;isNaN(p)&&(p=l);var q=e.lineColorSwitched;q&&(n=q);var q=e.fillColors,u=e.fillColorsSwitched;u&&(q=u);var r=e.dashLength;(u=e.dashLengthSwitched)&&(r=u);var u=e.negativeLineColor,s=e.negativeFillColors,w=e.negativeFillAlphas,v=e.baseCoord;0!==e.negativeBase&&(v=e.valueAxis.getCoordinate(e.negativeBase));l=AmCharts.line(g,
|
135
|
-
p=b.join(";").split(";"),"serial"==e.chartType&&(0<c.length?(c.reverse(),d.reverse(),m=a.concat(c),p=b.concat(d)):e.rotate?(p.push(p[p.length-1]),m.push(v),p.push(p[0]),m.push(v),p.push(p[0]),m.push(m[0])):(m.push(m[m.length-1]),p.push(v),m.push(m[0]),p.push(v),m.push(a[0]),p.push(p[0]))),a=e.gradientRotation,0<f&&(b=AmCharts.polygon(g,
|
136
|
-
k.click(function(){e.handleGraphClick()});e.applyMask(k,h)}},applyMask:function(a,b){var c=a.length();"serial"!=this.chartType||this.scrollbar||(this.positiveClip(b),0<c&&this.negativeClip(a))},drawSmoothedGraph:function(a,b,c,d){if(1<a.length){var e=this.set,f=this.container,g=f.set(),h=f.set();e.push(h);e.push(g);var k=this.lineAlpha,
|
137
|
-
s=this.baseCoord,w=this.lineColorSwitched;w&&(n=w);(w=this.fillColorsSwitched)&&(p=w);w=this.negativeLineAlpha;isNaN(w)&&(w=k);k=new AmCharts.Bezier(f,a,b,n,k,l,p,0,e);g.push(k.path);void 0!==q&&(l=new AmCharts.Bezier(f,a,b,q,w,l,p,0,e),h.push(l.path));0<m&&(k=a.join(";").split(";"),n=b.join(";").split(";"),l="",0<c.length?(c.reverse(),
|
138
|
-
","+b[0]),c=new AmCharts.Bezier(f,k,n,NaN,0,0,p,m,e,l),c.path.pattern(this.pattern),g.push(c.path),u||void 0!==q)&&(r||(r=m),u||(u=q),a=new AmCharts.Bezier(f,a,b,NaN,0,0,u,r,e,l),a.path.pattern(this.pattern),h.push(a.path));this.applyMask(h,g)}},launchAnimation:function(){var a=this,b=a.chart.startDuration;if(0<b&&!a.animationPlayed){var c=
|
139
|
-
|
140
|
-
b=b.startDuration;a&&(this.rotate?a.animateWidth(b,c):a.animateHeight(b,c),a.set.show())},legendKeyColor:function(){var a=this.legendColor,b=this.lineAlpha;void 0===a&&(a=this.lineColor,0===b&&(b=this.fillColors)&&(a="object"==typeof b?b[0]:b));return a},legendKeyAlpha:function(){var a=this.legendAlpha;
|
141
|
-
f=this.bulletSize;isNaN(a.bulletSize)||(f=a.bulletSize);var g=a.values.value;isNaN(this.maxValue)||isNaN(g)||(f=g/this.maxValue*this.maxBulletSize);var h=f;this.bulletAxis&&(f=a.values.error,isNaN(f)||(g=f),f=this.bulletAxis.stepWidth*g);f<this.minBulletSize&&(f=this.minBulletSize);this.rotate?b+=e:c-=
|
142
|
-
void 0!==a.color&&(l=a.color);e=this.bullet;a.bullet&&(e=a.bullet);var g=this.bulletBorderThickness,m=this.bulletBorderColor,n=this.bulletBorderAlpha,p=this.bulletAlpha;m||(m=l);var q=a.alpha;isNaN(q)||(p=q);if("none"!=this.bullet||a.bullet)k=AmCharts.bullet(d,e,f,l,p,g,m,n,h);if(this.customBullet||
|
143
|
-
this.minCoord-c,k.bulletConfig=a.bulletConfig),k.write(d),k=k.set):(this.chart.path&&(h=this.chart.path+h),k=d.set(),d=d.image(h,0,0,f,f),k.push(d),this.centerCustomBullets&&d.translate(-f/2,-f/2)));k&&((a.url||this.showHandOnHover)&&k.setAttr("cursor","pointer"),"serial"==this.chartType&&(0>
|
144
|
-
this.allBullets,b;this.bulletsHidden=!1;for(b=0;b<a.length;b++)a[b].show()},hideBullets:function(){var a=this.allBullets,b;this.bulletsHidden=!0;for(b=0;b<a.length;b++)a[b].hide()},addListeners:function(a,b){var c=this;a.mouseover(function(a){c.handleRollOver(b,a)}).mouseout(function(a){c.handleRollOut(b,
|
145
|
-
a)})},handleRollOver:function(a,b){if(a){var c=this.chart,d={type:"rollOverGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("rollOverGraphItem",d);c.fire("rollOverGraphItem",d);clearTimeout(c.hoverInt);d=this.showBalloon;c.chartCursor&&
|
146
|
-
c.getBalloonColor(this,a);c.balloon.showBullet=!1;c.balloon.pointerOrientation="V";var f=a.x,g=a.y;c.rotate&&(f=a.y,g=a.x);c.showBalloon(d,e,!0,f+c.marginLeftReal,g+c.marginTopReal)}}},handleRollOut:function(a,b){this.chart.hideBalloon();if(a){var c={type:"rollOutGraphItem",item:a,
|
147
|
-
target:this,chart:this.chart,event:b};this.fire("
|
148
|
-
|
149
|
-
AmCharts.remove(this.bulletSet);var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]}});AmCharts.ChartCursor=AmCharts.Class({construct:function(){this.createEvents("changed","zoomed","onHideCursor","draw","selected");this.enabled=!0;this.cursorAlpha=1;this.selectionAlpha=0.2;this.cursorColor="#CC0000";this.categoryBalloonAlpha=1;this.color="#FFFFFF";this.type="cursor";this.zoomed=!1;this.zoomable=!0;this.pan=!1;this.categoryBalloonDateFormat="MMM DD, YYYY";this.categoryBalloonEnabled=this.valueBalloonsEnabled=!0;this.rolledOver=!1;this.cursorPosition="middle";this.bulletsEnabled=this.skipZoomDispatch=
|
101
|
+
c=a.pageX-this.posX,d=a.pageY-this.posY);this.mouseX=c-this.dmouseX;this.mouseY=d-this.dmouseY}}},handleTouchStart:function(a){this.handleMouseDown(a)},handleTouchEnd:function(a){AmCharts.resetMouseOver();this.handleReleaseOutside(a)},handleReleaseOutside:function(a){},handleMouseDown:function(a){AmCharts.resetMouseOver();this.mouseIsOver=!0;a&&a.preventDefault&&a.preventDefault()},addLegend:function(a,b){a=AmCharts.processObject(a,AmCharts.AmLegend);var c;c="object"!=typeof b?document.getElementById(b):
|
102
|
+
b;this.legend=a;a.chart=this;c?(a.div=c,a.position="outside",a.autoMargins=!1):a.div=this.legendDiv;c=this.handleLegendEvent;this.listenTo(a,"showItem",c);this.listenTo(a,"hideItem",c);this.listenTo(a,"clickMarker",c);this.listenTo(a,"rollOverItem",c);this.listenTo(a,"rollOutItem",c);this.listenTo(a,"rollOverMarker",c);this.listenTo(a,"rollOutMarker",c);this.listenTo(a,"clickLabel",c);return a},removeLegend:function(){this.legend=void 0;this.legendDiv.innerHTML=""},handleResize:function(){(AmCharts.isPercents(this.width)||
|
103
|
+
AmCharts.isPercents(this.height))&&this.invalidateSizeReal();this.renderFix()},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},getSVG:function(){if(AmCharts.hasSVG)return this.container},animate:function(a,b,c,d,e,f,g){a["an_"+b]&&AmCharts.removeFromArray(this.animations,a["an_"+b]);c={obj:a,frame:0,attribute:b,from:c,to:d,time:e,effect:f,suffix:g};a["an_"+b]=c;this.animations.push(c);return c},setLegendData:function(a){var b=this.legend;b&&b.setData(a)},startInterval:function(){var a=
|
104
|
+
this;clearInterval(a.interval);a.interval=setInterval(function(){a.updateAnimations.call(a)},AmCharts.updateRate)},stopAnim:function(a){AmCharts.removeFromArray(this.animations,a)},updateAnimations:function(){var a;this.container&&this.container.update();for(a=this.animations.length-1;0<=a;a--){var b=this.animations[a],c=1E3*b.time/AmCharts.updateRate,d=b.frame+1,e=b.obj,f=b.attribute;if(d<=c){b.frame++;var g=Number(b.from),h=Number(b.to)-g,c=AmCharts[b.effect](0,d,g,h,c);0===h?this.animations.splice(a,
|
105
|
+
1):e.node.style[f]=c+b.suffix}else e.node.style[f]=Number(b.to)+b.suffix,this.animations.splice(a,1)}}});AmCharts.Slice=AmCharts.Class({construct:function(){}});AmCharts.SerialDataItem=AmCharts.Class({construct:function(){}});AmCharts.GraphDataItem=AmCharts.Class({construct:function(){}});AmCharts.Guide=AmCharts.Class({construct:function(){}});AmCharts.AmGraph=AmCharts.Class({construct:function(){this.createEvents("rollOverGraphItem","rollOutGraphItem","clickGraphItem","doubleClickGraphItem","rightClickGraphItem","clickGraph");this.type="line";this.stackable=!0;this.columnCount=1;this.columnIndex=0;this.centerCustomBullets=this.showBalloon=!0;this.maxBulletSize=50;this.minBulletSize=0;this.balloonText="[[value]]";this.hidden=this.scrollbar=this.animationPlayed=!1;this.columnWidth=0.8;this.pointPosition="middle";this.depthCount=1;this.includeInMinMax=
|
106
|
+
!0;this.negativeBase=0;this.visibleInLegend=!0;this.showAllValueLabels=!1;this.showBalloonAt="close";this.lineThickness=1;this.dashLength=0;this.connect=!0;this.lineAlpha=1;this.bullet="none";this.bulletBorderThickness=2;this.bulletBorderAlpha=0;this.bulletAlpha=1;this.bulletSize=8;this.hideBulletsCount=this.bulletOffset=0;this.labelPosition="top";this.cornerRadiusTop=0;this.cursorBulletAlpha=1;this.gradientOrientation="vertical";this.dy=this.dx=0;this.periodValue="";this.clustered=!0;this.y=this.x=
|
107
|
+
0},draw:function(){var a=this.chart,b=a.container;this.container=b;this.destroy();var c=b.set(),d=b.set();this.behindColumns?(a.graphsBehindSet.push(c),a.bulletBehindSet.push(d)):(a.graphsSet.push(c),a.bulletSet.push(d));var e=this.bulletAxis;AmCharts.isString(e)&&(this.bulletAxis=a.getValueAxisById(e));this.bulletSet=d;this.scrollbar||(e=a.marginLeftReal,a=a.marginTopReal,c.translate(e,a),d.translate(e,a));b=b.set();AmCharts.remove(this.columnsSet);c.push(b);this.set=c;this.columnsSet=b;this.columnsArray=
|
108
|
+
[];this.ownColumns=[];this.allBullets=[];this.animationArray=[];AmCharts.ifArray(this.data)&&(c=!1,"xy"==this.chartType?this.xAxis.axisCreated&&this.yAxis.axisCreated&&(c=!0):this.valueAxis.axisCreated&&(c=!0),!this.hidden&&c&&this.createGraph())},createGraph:function(){var a=this,b=a.chart;"inside"==a.labelPosition&&"column"!=a.type&&(a.labelPosition="bottom");a.startAlpha=b.startAlpha;a.seqAn=b.sequencedAnimation;a.baseCoord=a.valueAxis.baseCoord;a.fillColors||(a.fillColors=a.lineColor);void 0===
|
109
|
+
a.fillAlphas&&(a.fillAlphas=0);void 0===a.bulletColor&&(a.bulletColor=a.lineColor,a.bulletColorNegative=a.negativeLineColor);void 0===a.bulletAlpha&&(a.bulletAlpha=a.lineAlpha);clearTimeout(a.playedTO);if(!isNaN(a.valueAxis.min)&&!isNaN(a.valueAxis.max)){switch(a.chartType){case "serial":a.createSerialGraph();"candlestick"==a.type&&1>a.valueAxis.minMaxMultiplier&&a.positiveClip(a.set);break;case "radar":a.createRadarGraph();break;case "xy":a.createXYGraph(),a.positiveClip(a.set)}a.playedTO=setTimeout(function(){a.setAnimationPlayed.call(a)},
|
110
|
+
500*a.chart.startDuration)}},setAnimationPlayed:function(){this.animationPlayed=!0},createXYGraph:function(){var a=[],b=[],c=this.xAxis,d=this.yAxis;this.pmh=d.viH+1;this.pmw=c.viW+1;this.pmy=this.pmx=0;var e;for(e=this.start;e<=this.end;e++){var f=this.data[e].axes[c.id].graphs[this.id],g=f.values,h=g.x,k=g.y,g=c.getCoordinate(h),l=d.getCoordinate(k);!isNaN(h)&&!isNaN(k)&&(a.push(g),b.push(l),(h=this.createBullet(f,g,l,e))||(h=0),k=this.labelText)&&(f=this.createLabel(f,g,l,k),this.allBullets.push(f),
|
111
|
+
this.positionLabel(g,l,f,this.labelPosition,h))}this.drawLineGraph(a,b);this.launchAnimation()},createRadarGraph:function(){var a=this.valueAxis.stackType,b=[],c=[],d,e,f;for(f=this.start;f<=this.end;f++){var g=this.data[f].axes[this.valueAxis.id].graphs[this.id],h;h="none"==a||"3d"==a?g.values.value:g.values.close;if(isNaN(h))this.drawLineGraph(b,c),b=[],c=[];else{var k=this.y-(this.valueAxis.getCoordinate(h)-this.height),l=180-360/(this.end-this.start+1)*f;h=k*Math.sin(l/180*Math.PI);k*=Math.cos(l/
|
112
|
+
180*Math.PI);b.push(h);c.push(k);(l=this.createBullet(g,h,k,f))||(l=0);var m=this.labelText;m&&(g=this.createLabel(g,h,k,m),this.allBullets.push(g),this.positionLabel(h,k,g,this.labelPosition,l));isNaN(d)&&(d=h);isNaN(e)&&(e=k)}}b.push(d);c.push(e);this.drawLineGraph(b,c);this.launchAnimation()},positionLabel:function(a,b,c,d,e){var f=c.getBBox();switch(d){case "left":a-=(f.width+e)/2+2;break;case "top":b-=(e+f.height)/2+1;break;case "right":a+=(f.width+e)/2+2;break;case "bottom":b+=(e+f.height)/
|
113
|
+
2+1}c.translate(a,b)},getGradRotation:function(){var a=270;"horizontal"==this.gradientOrientation&&(a=0);return this.gradientRotation=a},createSerialGraph:function(){this.dashLengthSwitched=this.fillColorsSwitched=this.lineColorSwitched=void 0;var a=this.chart,b=this.id,c=this.index,d=this.data,e=this.chart.container,f=this.valueAxis,g=this.type,h=this.columnWidthReal;isNaN(this.columnWidth)||(h=this.columnWidth);var k=this.width,l=this.height,m=this.y,n=this.rotate,p=this.columnCount,q=AmCharts.toCoordinate(this.cornerRadiusTop,
|
114
|
+
h/2),u=this.connect,r=[],s=[],w,v,t,A,F=this.chart.graphs.length,x,z=this.dx/this.depthCount,H=this.dy/this.depthCount,I=f.stackType,B=this.labelPosition,da=this.start,O=this.end,ca=this.scrollbar,W=this.categoryAxis,Ea=this.baseCoord,ea=this.negativeBase,Z=this.columnIndex,K=this.lineThickness,U=this.lineAlpha,na=this.lineColor,X=this.dashLength,Y=this.set,$=B,ha=this.getGradRotation(),G=this.chart.columnSpacing,E=W.cellWidth,ia=(E*h-p)/p;G>ia&&(G=ia);var V,y,Sa,Ya=l+1,Za=k+1,Ta=0,$a=0,ab,bb,Ua,
|
115
|
+
Va,Hb=this.fillColors,Ja=this.negativeFillColors,za=this.negativeLineColor,Ka=this.fillAlphas,La=this.negativeFillAlphas;"object"==typeof Ka&&(Ka=Ka[0]);"object"==typeof La&&(La=La[0]);var Wa=f.getCoordinate(f.min);f.logarithmic&&(Wa=f.getCoordinate(f.minReal));this.minCoord=Wa;this.resetBullet&&(this.bullet="none");if(!ca&&("line"==g||"smoothedLine"==g||"step"==g)&&(1==d.length&&"step"!=g&&"none"==this.bullet&&(this.bullet="round",this.resetBullet=!0),Ja||void 0!=za)){var Fa=ea;Fa>f.max&&(Fa=f.max);
|
116
|
+
Fa<f.min&&(Fa=f.min);f.logarithmic&&(Fa=f.minReal);var wa=f.getCoordinate(Fa),sb=f.getCoordinate(f.max);n?(Ya=l,Za=Math.abs(sb-wa),ab=l,bb=Math.abs(Wa-wa),Va=$a=0,f.reversed?(Ta=0,Ua=wa):(Ta=wa,Ua=0)):(Za=k,Ya=Math.abs(sb-wa),bb=k,ab=Math.abs(Wa-wa),Ua=Ta=0,f.reversed?(Va=m,$a=wa):Va=wa+1)}var xa=Math.round;this.pmx=xa(Ta);this.pmy=xa($a);this.pmh=xa(Ya);this.pmw=xa(Za);this.nmx=xa(Ua);this.nmy=xa(Va);this.nmh=xa(ab);this.nmw=xa(bb);AmCharts.isModern||(this.nmy=this.nmx=0,this.nmh=this.height);h=
|
117
|
+
"column"==g?(E*h-G*(p-1))/p:E*h;1>h&&(h=1);var P;if("line"==g||"step"==g||"smoothedLine"==g){if(0<da)for(P=da-1;-1<P;P--)if(V=d[P],y=V.axes[f.id].graphs[b],Sa=y.values.value,!isNaN(Sa)){da=P;break}if(O<d.length-1)for(P=O+1;P<d.length;P++)if(V=d[P],y=V.axes[f.id].graphs[b],Sa=y.values.value,!isNaN(Sa)){O=P;break}}O<d.length-1&&O++;var S=[],T=[],Ma=!1;if("line"==g||"step"==g||"smoothedLine"==g)if(this.stackable&&"regular"==I||"100%"==I||this.fillToGraph)Ma=!0;var tb=this.noStepRisers;for(P=da;P<=O;P++){V=
|
118
|
+
d[P];y=V.axes[f.id].graphs[b];y.index=P;var L,M,J,aa,oa=NaN,D=NaN,C=NaN,Q=NaN,N=NaN,Na=NaN,Aa=NaN,Oa=NaN,Ba=NaN,ba=NaN,ga=NaN,pa=NaN,qa=NaN,R=NaN,cb=NaN,db=NaN,ja=NaN,la=void 0,ya=Hb,Pa=Ka,ra=na,ka,sa,eb=this.pattern;void 0!=y.pattern&&(eb=y.pattern);void 0!=y.color&&(ya=y.color);y.fillColors&&(ya=y.fillColors);isNaN(y.alpha)||(Pa=y.alpha);isNaN(y.dashLength)||(X=y.dashLength);var ta=y.values;f.recalculateToPercents&&(ta=y.percents);if(ta){R=this.stackable&&"none"!=I&&"3d"!=I?ta.close:ta.value;if("candlestick"==
|
119
|
+
g||"ohlc"==g)R=ta.close,db=ta.low,Aa=f.getCoordinate(db),cb=ta.high,Ba=f.getCoordinate(cb);ja=ta.open;C=f.getCoordinate(R);isNaN(ja)||(N=f.getCoordinate(ja));if(!ca)switch(this.showBalloonAt){case "close":y.y=C;break;case "open":y.y=N;break;case "high":y.y=Ba;break;case "low":y.y=Aa}var oa=V.x[W.id],ma=Math.floor(E/2),Ca=ma;"start"==this.pointPosition&&(oa-=E/2,ma=0,Ca=E);if(tb){var fb=this.columnWidth;isNaN(fb)||(ma*=fb,Ca*=fb)}ca||(y.x=oa);-1E5>oa&&(oa=-1E5);oa>k+1E5&&(oa=k+1E5);n?(D=C,Q=N,N=C=
|
120
|
+
oa,isNaN(ja)&&!this.fillToGraph&&(Q=Ea),Na=Aa,Oa=Ba):(Q=D=oa,isNaN(ja)&&!this.fillToGraph&&(N=Ea));R<ja&&(y.isNegative=!0,Ja&&(ya=Ja),La&&(Pa=La),void 0!=za&&(ra=za));switch(g){case "line":isNaN(R)?u||(this.drawLineGraph(r,s,S,T),r=[],s=[],S=[],T=[]):(y.isNegative=R<ea?!0:!1,r.push(D),s.push(C),ba=D,ga=C,pa=D,qa=C,!Ma||isNaN(N)||isNaN(Q)||(S.push(Q),T.push(N)),void 0==y.lineColor&&void 0==y.fillColors&&isNaN(y.dashLength)||(this.drawLineGraph(r,s,S,T),r=[D],s=[C],S=[],T=[],this.lineColorSwitched=
|
121
|
+
y.lineColor,this.fillColorsSwitched=y.fillColors,this.dashLengthSwitched=y.dashLength));break;case "smoothedLine":isNaN(R)?u||(this.drawSmoothedGraph(r,s,S,T),r=[],s=[],S=[],T=[]):(y.isNegative=R<ea?!0:!1,r.push(D),s.push(C),ba=D,ga=C,pa=D,qa=C,!Ma||isNaN(N)||isNaN(Q)||(S.push(Q),T.push(N)),void 0==y.lineColor&&void 0==y.fillColors&&isNaN(y.dashLength)||(this.drawSmoothedGraph(r,s,S,T),r=[D],s=[C],S=[],T=[],this.lineColorSwitched=y.lineColor,this.fillColorsSwitched=y.fillColors,this.dashLengthSwitched=
|
122
|
+
y.dashLength));break;case "step":isNaN(R)?u||(w=v=NaN,this.drawLineGraph(r,s,S,T),r=[],s=[],S=[],T=[]):(y.isNegative=R<ea?!0:!1,void 0==y.lineColor&&void 0==y.fillColors&&isNaN(y.dashLength)||(this.drawLineGraph(r,s,S,T),r=[],s=[],S=[],T=[],this.lineColorSwitched=y.lineColor,this.fillColorsSwitched=y.fillColors,this.dashLengthSwitched=y.dashLength),n?(isNaN(w)||(r.push(w),s.push(C-ma)),s.push(C-ma),r.push(D),s.push(C+Ca),r.push(D),!Ma||isNaN(N)||isNaN(Q)||(S.push(t),T.push(N-ma),S.push(Q),T.push(N-
|
123
|
+
ma),S.push(Q),T.push(N+Ca))):(isNaN(v)||(s.push(v),r.push(w),s.push(v),r.push(D-ma)),r.push(D-ma),s.push(C),r.push(D+Ca),s.push(C),!Ma||isNaN(N)||isNaN(Q)||(S.push(Q-ma),T.push(A),S.push(Q-ma),T.push(N),S.push(Q+Ca),T.push(N))),w=D,v=C,t=Q,A=N,ba=D,ga=C,pa=D,qa=C,tb&&(w=v=NaN,this.drawLineGraph(r,s,S,T),r=[],s=[],S=[],T=[]));break;case "column":ka=ra;void 0!=y.lineColor&&(ka=y.lineColor);if(!isNaN(R)){R<ea?(y.isNegative=!0,Ja&&(ya=Ja),void 0!=za&&(ka=za)):y.isNegative=!1;var ub=f.min,vb=f.max;if(!(R<
|
124
|
+
ub&&ja<ub||R>vb&&ja>vb))if(n){"3d"==I?(M=C-0.5*(h+G)+G/2+H*Z,L=Q+z*Z):(M=C-(p/2-Z)*(h+G)+G/2,L=Q);J=h;ba=D;ga=M+h/2;pa=D;qa=M+h/2;M+J>l&&(J=l-M);0>M&&(J+=M,M=0);aa=D-Q;var Ib=L;L=AmCharts.fitToBounds(L,0,k);aa+=Ib-L;aa=AmCharts.fitToBounds(aa,-L,k-L+z*Z);if(M<l&&0<J&&(la=new AmCharts.Cuboid(e,aa,J,z-a.d3x,H-a.d3y,ya,Pa,K,ka,U,ha,q,n,X,eb),"bottom"!=B&&"inside"!=B&&"middle"!=B))if(B=f.reversed?"left":"right",0>R)B=f.reversed?"right":"left";else if("regular"==I||"100%"==I)ba+=this.dx}else{"3d"==I?(L=
|
125
|
+
D-0.5*(h+G)+G/2+z*Z,M=N+H*Z):(L=D-(p/2-Z)*(h+G)+G/2,M=N);J=h;ba=L+h/2;ga=C;pa=L+h/2;qa=C;L+J>k+Z*z&&(J=k-L+Z*z);0>L&&(J+=L,L=0);aa=C-N;var Jb=M;M=AmCharts.fitToBounds(M,this.dy,l);aa+=Jb-M;aa=AmCharts.fitToBounds(aa,-M+H*Z,l-M);if(L<k+Z*z&&0<J)if(la=new AmCharts.Cuboid(e,J,aa,z-a.d3x,H-a.d3y,ya,Pa,K,ka,this.lineAlpha,ha,q,n,X,eb),0>R&&"middle"!=B&&"inside"!=B)B="bottom";else if(B=$,"regular"==I||"100%"==I)ga+=this.dy}if(la&&(sa=la.set,sa.translate(L,M),this.columnsSet.push(sa),(y.url||this.showHandOnHover)&&
|
126
|
+
sa.setAttr("cursor","pointer"),!ca)){"none"==I&&(x=n?(this.end+1-P)*F-c:F*P+c);"3d"==I&&(n?(x=(F-c)*(this.end+1-P),ba+=z*this.columnIndex,pa+=z*this.columnIndex,y.y+=z*this.columnIndex):(x=(F-c)*(P+1),ba+=3,ga+=H*this.columnIndex+7,qa+=H*this.columnIndex,y.y+=H*this.columnIndex));if("regular"==I||"100%"==I)"inside"!=B&&(B="middle"),x=n?0<ta.value?(this.end+1-P)*F+c:(this.end+1-P)*F-c:0<ta.value?F*P+c:F*P-c;this.columnsArray.push({column:la,depth:x});y.x=n?M+J/2:L+J/2;this.ownColumns.push(la);this.animateColumns(la,
|
127
|
+
P,D,Q,C,N);this.addListeners(sa,y)}}break;case "candlestick":if(!isNaN(ja)&&!isNaN(R)){var Xa,gb;ka=ra;void 0!=y.lineColor&&(ka=y.lineColor);if(n){if(M=C-h/2,L=Q,J=h,M+J>l&&(J=l-M),0>M&&(J+=M,M=0),M<l&&0<J){var hb,ib;R>ja?(hb=[D,Oa],ib=[Q,Na]):(hb=[Q,Oa],ib=[D,Na]);!isNaN(Oa)&&!isNaN(Na)&&C<l&&0<C&&(Xa=AmCharts.line(e,hb,[C,C],ka,U,K),gb=AmCharts.line(e,ib,[C,C],ka,U,K));aa=D-Q;la=new AmCharts.Cuboid(e,aa,J,z,H,ya,Ka,K,ka,U,ha,q,n,X)}}else if(L=D-h/2,M=N+K/2,J=h,L+J>k&&(J=k-L),0>L&&(J+=L,L=0),aa=
|
128
|
+
C-N,L<k&&0<J){var la=new AmCharts.Cuboid(e,J,aa,z,H,ya,Pa,K,ka,U,ha,q,n,X),jb,kb;R>ja?(jb=[C,Ba],kb=[N,Aa]):(jb=[N,Ba],kb=[C,Aa]);!isNaN(Ba)&&!isNaN(Aa)&&D<k&&0<D&&(Xa=AmCharts.line(e,[D,D],jb,ka,U,K),gb=AmCharts.line(e,[D,D],kb,ka,U,K))}la&&(sa=la.set,Y.push(sa),sa.translate(L,M-K/2),(y.url||this.showHandOnHover)&&sa.setAttr("cursor","pointer"),Xa&&(Y.push(Xa),Y.push(gb)),ba=D,ga=C,pa=D,qa=C,ca||(y.x=n?M+J/2:L+J/2,this.animateColumns(la,P,D,Q,C,N),this.addListeners(sa,y)))}break;case "ohlc":if(!(isNaN(ja)||
|
129
|
+
isNaN(cb)||isNaN(db)||isNaN(R))){R<ja&&(y.isNegative=!0,void 0!=za&&(ra=za));var lb,mb,nb;if(n){var ob=C-h/2,ob=AmCharts.fitToBounds(ob,0,l),wb=AmCharts.fitToBounds(C,0,l),pb=C+h/2,pb=AmCharts.fitToBounds(pb,0,l);mb=AmCharts.line(e,[Q,Q],[ob,wb],ra,U,K,X);0<C&&C<l&&(lb=AmCharts.line(e,[Na,Oa],[C,C],ra,U,K,X));nb=AmCharts.line(e,[D,D],[wb,pb],ra,U,K,X)}else{var qb=D-h/2,qb=AmCharts.fitToBounds(qb,0,k),xb=AmCharts.fitToBounds(D,0,k),rb=D+h/2,rb=AmCharts.fitToBounds(rb,0,k);mb=AmCharts.line(e,[qb,xb],
|
130
|
+
[N,N],ra,U,K,X);0<D&&D<k&&(lb=AmCharts.line(e,[D,D],[Aa,Ba],ra,U,K,X));nb=AmCharts.line(e,[xb,rb],[C,C],ra,U,K,X)}Y.push(mb);Y.push(lb);Y.push(nb);ba=D;ga=C;pa=D;qa=C}}if(!ca&&!isNaN(R)){var yb=this.hideBulletsCount;if(this.end-this.start<=yb||0===yb){var Ga=this.createBullet(y,pa,qa,P);Ga||(Ga=0);var zb=this.labelText;if(zb){var fa=this.createLabel(y,0,0,zb),ua=0,va=0,Ab=fa.getBBox(),Ha=Ab.width,Da=Ab.height;switch(B){case "left":ua=-(Ha/2+Ga/2+3);break;case "top":va=-(Da/2+Ga/2+3);break;case "right":ua=
|
131
|
+
Ga/2+2+Ha/2;break;case "bottom":n&&"column"==g?(ba=Ea,0>R?(ua=-6,fa.attr({"text-anchor":"end"})):(ua=6,fa.attr({"text-anchor":"start"}))):(va=Ga/2+Da/2,fa.x=-(Ha/2+2));break;case "middle":"column"==g&&(n?(va=-(Da/2)+this.fontSize/2,ua=-(D-Q)/2-z,0>aa&&(ua+=z),Math.abs(D-Q)<Ha&&!this.showAllValueLabels&&(fa.remove(),fa=null)):(va=-(C-N)/2,0>aa&&(va-=H),Math.abs(C-N)<Da&&!this.showAllValueLabels&&(fa.remove(),fa=null)));break;case "inside":n?(va=-(Da/2)+this.fontSize/2,ua=0>aa?Ha:-Ha):va=0>aa?Da:-Da}if(fa){if(isNaN(ga)||
|
132
|
+
isNaN(ba))fa.remove(),fa=null;else if(ba+=ua,ga+=va,fa.translate(ba,ga),n){if(0>ga||ga>l)fa.remove(),fa=null}else{var Bb=0;"3d"==I&&(Bb=z*Z);if(0>ba||ba>k+Bb)fa.remove(),fa=null}fa&&this.allBullets.push(fa)}}if("column"==g&&"regular"==I||"100%"==I){var Cb=f.totalText;if(Cb){var Ia=this.createLabel(y,0,0,Cb,f.totalTextColor);this.allBullets.push(Ia);var Db=Ia.getBBox(),Eb=Db.width,Fb=Db.height,Qa,Ra,Gb=f.totals[P];Gb&&Gb.remove();n?(Ra=C,Qa=0>R?D-Eb/2-2:D+Eb/2+3):(Qa=D,Ra=0>R?C+Fb/2:C-Fb/2-3);Ia.translate(Qa,
|
133
|
+
Ra);f.totals[P]=Ia;n?(0>Ra||Ra>l)&&Ia.remove():(0>Qa||Qa>k)&&Ia.remove()}}}}}}if("line"==g||"step"==g||"smoothedLine"==g)"smoothedLine"==g?this.drawSmoothedGraph(r,s,S,T):this.drawLineGraph(r,s,S,T),ca||this.launchAnimation();this.bulletsHidden&&this.hideBullets()},animateColumns:function(a,b,c,d,e,f){var g=this;c=g.chart.startDuration;0<c&&!g.animationPlayed&&(g.seqAn?(a.set.hide(),g.animationArray.push(a),a=setTimeout(function(){g.animate.call(g)},c/(g.end-g.start+1)*(b-g.start)*1E3),g.timeOuts.push(a)):
|
134
|
+
g.animate(a))},createLabel:function(a,b,c,d,e){var f=this.chart,g=a.labelColor;g||(g=this.color);g||(g=f.color);e&&(g=e);e=this.fontSize;void 0===e&&(this.fontSize=e=f.fontSize);a=f.formatString(d,a,this);a=AmCharts.cleanFromEmpty(a);f=AmCharts.text(this.container,a,g,f.fontFamily,e);f.translate(b,c);this.bulletSet.push(f);return f},positiveClip:function(a){a.clipRect(this.pmx,this.pmy,this.pmw,this.pmh)},negativeClip:function(a){a.clipRect(this.nmx,this.nmy,this.nmw,this.nmh)},drawLineGraph:function(a,
|
135
|
+
b,c,d){var e=this;if(1<a.length){var f=e.set,g=e.container,h=g.set(),k=g.set();f.push(k);f.push(h);var l=e.lineAlpha,m=e.lineThickness,f=e.fillAlphas,n=e.lineColor,p=e.negativeLineAlpha;isNaN(p)&&(p=l);var q=e.lineColorSwitched;q&&(n=q);var q=e.fillColors,u=e.fillColorsSwitched;u&&(q=u);var r=e.dashLength;(u=e.dashLengthSwitched)&&(r=u);var u=e.negativeLineColor,s=e.negativeFillColors,w=e.negativeFillAlphas,v=e.baseCoord;0!==e.negativeBase&&(v=e.valueAxis.getCoordinate(e.negativeBase));l=AmCharts.line(g,
|
136
|
+
a,b,n,l,m,r,!1,!0);h.push(l);h.click(function(){e.handleGraphClick()});void 0!==u&&(m=AmCharts.line(g,a,b,u,p,m,r,!1,!0),k.push(m));if(0<f||0<w)if(m=a.join(";").split(";"),p=b.join(";").split(";"),"serial"==e.chartType&&(0<c.length?(c.reverse(),d.reverse(),m=a.concat(c),p=b.concat(d)):e.rotate?(p.push(p[p.length-1]),m.push(v),p.push(p[0]),m.push(v),p.push(p[0]),m.push(m[0])):(m.push(m[m.length-1]),p.push(v),m.push(m[0]),p.push(v),m.push(a[0]),p.push(p[0]))),a=e.gradientRotation,0<f&&(b=AmCharts.polygon(g,
|
137
|
+
m,p,q,f,1,"#000",0,a),b.pattern(e.pattern),h.push(b)),s||void 0!==u)isNaN(w)&&(w=f),s||(s=u),g=AmCharts.polygon(g,m,p,s,w,1,"#000",0,a),g.pattern(e.pattern),k.push(g),k.click(function(){e.handleGraphClick()});e.applyMask(k,h)}},applyMask:function(a,b){var c=a.length();"serial"!=this.chartType||this.scrollbar||(this.positiveClip(b),0<c&&this.negativeClip(a))},drawSmoothedGraph:function(a,b,c,d){if(1<a.length){var e=this.set,f=this.container,g=f.set(),h=f.set();e.push(h);e.push(g);var k=this.lineAlpha,
|
138
|
+
l=this.lineThickness,e=this.dashLength,m=this.fillAlphas,n=this.lineColor,p=this.fillColors,q=this.negativeLineColor,u=this.negativeFillColors,r=this.negativeFillAlphas,s=this.baseCoord,w=this.lineColorSwitched;w&&(n=w);(w=this.fillColorsSwitched)&&(p=w);w=this.negativeLineAlpha;isNaN(w)&&(w=k);k=new AmCharts.Bezier(f,a,b,n,k,l,p,0,e);g.push(k.path);void 0!==q&&(l=new AmCharts.Bezier(f,a,b,q,w,l,p,0,e),h.push(l.path));0<m&&(k=a.join(";").split(";"),n=b.join(";").split(";"),l="",0<c.length?(c.reverse(),
|
139
|
+
d.reverse(),k=a.concat(c),n=b.concat(d)):(this.rotate?(l+=" L"+s+","+b[b.length-1],l+=" L"+s+","+b[0]):(l+=" L"+a[a.length-1]+","+s,l+=" L"+a[0]+","+s),l+=" L"+a[0]+","+b[0]),c=new AmCharts.Bezier(f,k,n,NaN,0,0,p,m,e,l),c.path.pattern(this.pattern),g.push(c.path),u||void 0!==q)&&(r||(r=m),u||(u=q),a=new AmCharts.Bezier(f,a,b,NaN,0,0,u,r,e,l),a.path.pattern(this.pattern),h.push(a.path));this.applyMask(h,g)}},launchAnimation:function(){var a=this,b=a.chart.startDuration;if(0<b&&!a.animationPlayed){var c=
|
140
|
+
a.set,d=a.bulletSet;AmCharts.VML||(c.attr({opacity:a.startAlpha}),d.attr({opacity:a.startAlpha}));c.hide();d.hide();a.seqAn?(b=setTimeout(function(){a.animateGraphs.call(a)},a.index*b*1E3),a.timeOuts.push(b)):a.animateGraphs()}},animateGraphs:function(){var a=this.chart,b=this.set,c=this.bulletSet,d=this.x,e=this.y;b.show();c.show();var f=a.startDuration,a=a.startEffect;b&&(this.rotate?(b.translate(-1E3,e),c.translate(-1E3,e)):(b.translate(d,-1E3),c.translate(d,-1E3)),b.animate({opacity:1,translate:d+
|
141
|
+
","+e},f,a),c.animate({opacity:1,translate:d+","+e},f,a))},animate:function(a){var b=this.chart,c=this.animationArray;!a&&0<c.length&&(a=c[0],c.shift());c=AmCharts[AmCharts.getEffect(b.startEffect)];b=b.startDuration;a&&(this.rotate?a.animateWidth(b,c):a.animateHeight(b,c),a.set.show())},legendKeyColor:function(){var a=this.legendColor,b=this.lineAlpha;void 0===a&&(a=this.lineColor,0===b&&(b=this.fillColors)&&(a="object"==typeof b?b[0]:b));return a},legendKeyAlpha:function(){var a=this.legendAlpha;
|
142
|
+
void 0===a&&(a=this.lineAlpha,0===a&&this.fillAlphas&&(a=this.fillAlphas),0===a&&(a=this.bulletAlpha),0===a&&(a=1));return a},createBullet:function(a,b,c,d){d=this.container;var e=this.bulletOffset,f=this.bulletSize;isNaN(a.bulletSize)||(f=a.bulletSize);var g=a.values.value;isNaN(this.maxValue)||isNaN(g)||(f=g/this.maxValue*this.maxBulletSize);var h=f;this.bulletAxis&&(f=a.values.error,isNaN(f)||(g=f),f=this.bulletAxis.stepWidth*g);f<this.minBulletSize&&(f=this.minBulletSize);this.rotate?b+=e:c-=
|
143
|
+
e;var k,l=this.bulletColor;a.lineColor&&(this.bulletColorSwitched=a.lineColor);this.bulletColorSwitched&&(l=this.bulletColorSwitched);a.isNegative&&void 0!==this.bulletColorNegative&&(l=this.bulletColorNegative);void 0!==a.color&&(l=a.color);e=this.bullet;a.bullet&&(e=a.bullet);var g=this.bulletBorderThickness,m=this.bulletBorderColor,n=this.bulletBorderAlpha,p=this.bulletAlpha;m||(m=l);var q=a.alpha;isNaN(q)||(p=q);if("none"!=this.bullet||a.bullet)k=AmCharts.bullet(d,e,f,l,p,g,m,n,h);if(this.customBullet||
|
144
|
+
a.customBullet)h=this.customBullet,a.customBullet&&(h=a.customBullet),h&&(k&&k.remove(),"function"==typeof h?(k=new h,k.chart=this.chart,a.bulletConfig&&(k.availableSpace=c,k.graph=this,a.bulletConfig.minCoord=this.minCoord-c,k.bulletConfig=a.bulletConfig),k.write(d),k=k.set):(this.chart.path&&(h=this.chart.path+h),k=d.set(),d=d.image(h,0,0,f,f),k.push(d),this.centerCustomBullets&&d.translate(-f/2,-f/2)));k&&((a.url||this.showHandOnHover)&&k.setAttr("cursor","pointer"),"serial"==this.chartType&&(0>
|
145
|
+
b-0||b-0>this.width||c<-f/2||c-0>this.height)&&(k.remove(),k=null),k&&(this.bulletSet.push(k),k.translate(b,c),this.addListeners(k,a),this.allBullets.push(k)),a.bx=b,a.by=c);a.bulletGraphics=k;return f},showBullets:function(){var a=this.allBullets,b;this.bulletsHidden=!1;for(b=0;b<a.length;b++)a[b].show()},hideBullets:function(){var a=this.allBullets,b;this.bulletsHidden=!0;for(b=0;b<a.length;b++)a[b].hide()},addListeners:function(a,b){var c=this;a.mouseover(function(a){c.handleRollOver(b,a)}).mouseout(function(a){c.handleRollOut(b,
|
146
|
+
a)}).touchend(function(a){c.handleRollOver(b,a)}).touchstart(function(a){c.handleRollOver(b,a)}).click(function(a){c.handleClick(b,a)}).dblclick(function(a){c.handleDoubleClick(b,a)}).contextmenu(function(a){c.handleRightClick(b,a)})},handleRollOver:function(a,b){if(a){var c=this.chart,d={type:"rollOverGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("rollOverGraphItem",d);c.fire("rollOverGraphItem",d);clearTimeout(c.hoverInt);d=this.showBalloon;c.chartCursor&&
|
147
|
+
"serial"==this.chartType&&(d=!1,!c.chartCursor.valueBalloonsEnabled&&this.showBalloon&&(d=!0));if(d){var d=c.formatString(this.balloonText,a,a.graph),e=this.balloonFunction;e&&(d=e(a,a.graph));d=AmCharts.cleanFromEmpty(d);e=c.getBalloonColor(this,a);c.balloon.showBullet=!1;c.balloon.pointerOrientation="V";var f=a.x,g=a.y;c.rotate&&(f=a.y,g=a.x);c.showBalloon(d,e,!0,f+c.marginLeftReal,g+c.marginTopReal)}}},handleRollOut:function(a,b){this.chart.hideBalloon();if(a){var c={type:"rollOutGraphItem",item:a,
|
148
|
+
index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("rollOutGraphItem",c);this.chart.fire("rollOutGraphItem",c)}},handleClick:function(a,b){if(a){var c={type:"clickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("clickGraphItem",c);this.chart.fire("clickGraphItem",c);AmCharts.getURL(a.url,this.urlTarget)}this.handleGraphClick()},handleGraphClick:function(){var a={type:"clickGraph",graph:this,target:this,chart:this.chart};this.fire("clickGraph",
|
149
|
+
a);this.chart.fire("clickGraph",a)},handleRightClick:function(a,b){if(a){var c={type:"rightClickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("rightClickGraphItem",c);this.chart.fire("rightClickGraphItem",c)}},handleDoubleClick:function(a,b){if(a){var c={type:"doubleClickGraphItem",item:a,index:a.index,graph:this,target:this,chart:this.chart,event:b};this.fire("doubleClickGraphItem",c);this.chart.fire("doubleClickGraphItem",c)}},zoom:function(a,b){this.start=
|
150
|
+
a;this.end=b;this.draw()},changeOpacity:function(a){var b=this.set;b&&b.setAttr("opacity",a);if(b=this.ownColumns){var c;for(c=0;c<b.length;c++){var d=b[c].set;d&&d.setAttr("opacity",a)}}(b=this.bulletSet)&&b.setAttr("opacity",a)},destroy:function(){AmCharts.remove(this.set);AmCharts.remove(this.bulletSet);var a=this.timeOuts;if(a){var b;for(b=0;b<a.length;b++)clearTimeout(a[b])}this.timeOuts=[]}});AmCharts.ChartCursor=AmCharts.Class({construct:function(){this.createEvents("changed","zoomed","onHideCursor","draw","selected");this.enabled=!0;this.cursorAlpha=1;this.selectionAlpha=0.2;this.cursorColor="#CC0000";this.categoryBalloonAlpha=1;this.color="#FFFFFF";this.type="cursor";this.zoomed=!1;this.zoomable=!0;this.pan=!1;this.categoryBalloonDateFormat="MMM DD, YYYY";this.categoryBalloonEnabled=this.valueBalloonsEnabled=!0;this.rolledOver=!1;this.cursorPosition="middle";this.bulletsEnabled=this.skipZoomDispatch=
|
150
151
|
!1;this.bulletSize=8;this.selectWithoutZooming=this.oneBalloonOnly=!1;this.graphBulletSize=1.7;this.animationDuration=0.3},draw:function(){var a=this;a.destroy();var b=a.chart,c=b.container;a.rotate=b.rotate;a.container=c;c=c.set();c.translate(a.x,a.y);a.set=c;b.cursorSet.push(c);c=new AmCharts.AmBalloon;c.chart=b;a.categoryBalloon=c;AmCharts.copyProperties(b.balloon,c);c.cornerRadius=0;c.shadowAlpha=0;c.borderThickness=1;c.borderAlpha=1;c.showBullet=!1;var d=a.categoryBalloonColor;void 0===d&&(d=
|
151
152
|
a.cursorColor);c.fillColor=d;c.fillAlpha=a.categoryBalloonAlpha;c.borderColor=d;c.color=a.color;a.rotate&&(c.pointerOrientation="H");a.prevX=[];a.prevY=[];a.prevTX=[];a.prevTY=[];if(a.valueBalloonsEnabled)for(c=0;c<b.graphs.length;c++)d=new AmCharts.AmBalloon,d.chart=b,AmCharts.copyProperties(b.balloon,d),b.graphs[c].valueBalloon=d;"cursor"==a.type?a.createCursor():a.createCrosshair();a.interval=setInterval(function(){a.detectMovement.call(a)},40)},updateData:function(){var a=this.chart;this.data=
|
152
153
|
a.chartData;this.firstTime=a.firstTime;this.lastTime=a.lastTime},createCursor:function(){var a=this.chart,b=this.cursorAlpha,c=a.categoryAxis,d=c.position,e=c.inside,f=c.axisThickness,g=this.categoryBalloon,h,k,l=a.dx,m=a.dy,n=this.x,p=this.y,q=this.width,u=this.height,a=a.rotate,r=c.tickLength;g.pointerWidth=r;a?(h=[0,q,q+l],k=[0,0,m]):(h=[l,0,0],k=[m,0,u]);this.line=b=AmCharts.line(this.container,h,k,this.cursorColor,b,1);this.set.push(b);a?(e&&(g.pointerWidth=0),"right"==d?e?g.setBounds(n,p+m,
|
@@ -156,18 +157,18 @@ getMousePosition:function(){var a,b=this.width,c=this.height;a=this.chart;this.r
|
|
156
157
|
NaN),this.updateSelectionSize(b,c));a.mouseIsOver||this.zooming||this.hideCursor()},updateSelectionSize:function(a,b){AmCharts.remove(this.selection);var c=this.selectionPosX,d=this.selectionPosY,e=0,f=0,g=this.width,h=this.height;isNaN(a)||(c>a&&(e=a,g=c-a),c<a&&(e=c,g=a-c),c==a&&(e=a,g=0));isNaN(b)||(d>b&&(f=b,h=d-b),d<b&&(f=d,h=b-d),d==b&&(f=b,h=0));0<g&&0<h&&(c=AmCharts.rect(this.container,g,h,this.cursorColor,this.selectionAlpha),c.translate(e+this.x,f+this.y),this.selection=c)},arrangeBalloons:function(){var a=
|
157
158
|
this.valueBalloons,b=this.x,c=this.y,d=this.height+c;a.sort(this.compareY);var e;for(e=0;e<a.length;e++){var f=a[e].balloon;f.setBounds(b,c,b+this.width,d);f.prevX=this.prevX[e];f.prevY=this.prevY[e];f.prevTX=this.prevTX[e];f.prevTY=this.prevTY[e];f.draw();d=f.yPos-3}this.arrangeBalloons2()},compareY:function(a,b){return a.yy<b.yy?1:-1},arrangeBalloons2:function(){var a=this.valueBalloons;a.reverse();var b,c=this.x,d,e,f=a.length;for(e=0;e<f;e++){var g=a[e].balloon;b=g.bottom;var h=g.bottom-g.yPos,
|
158
159
|
k=f-e-1;0<e&&b-h<d+3&&(g.setBounds(c,d+3,c+this.width,d+h+3),g.prevX=this.prevX[k],g.prevY=this.prevY[k],g.prevTX=this.prevTX[k],g.prevTY=this.prevTY[k],g.draw());g.set&&g.set.show();this.prevX[k]=g.prevX;this.prevY[k]=g.prevY;this.prevTX[k]=g.prevTX;this.prevTY[k]=g.prevTY;d=g.bottom}},showBullets:function(){AmCharts.remove(this.allBullets);var a=this.container,b=a.set();this.set.push(b);this.set.show();this.allBullets=b;var b=this.chart.graphs,c;for(c=0;c<b.length;c++){var d=b[c];if(!d.hidden&&
|
159
|
-
d.balloonText){var e=this.data[this.index].axes[d.valueAxis.id].graphs[d.id],f=e.y;if(!isNaN(f)){var g,h;g=e.x;this.rotate?(h=f,f=g):h=g;d=AmCharts.circle(a,this.bulletSize/2,this.chart.getBalloonColor(d,e),d.cursorBulletAlpha);d.translate(h,f);this.allBullets.push(d)}}}},destroy:function(){this.clear();AmCharts.remove(this.selection);this.selection=null;var a=this.categoryBalloon;a&&a.destroy();this.destroyValueBalloons();AmCharts.remove(this.set)},clear:function(){clearInterval(this.interval)},
|
160
|
+
d.balloonText){var e=this.data[this.index].axes[d.valueAxis.id].graphs[d.id],f=e.y;if(!isNaN(f)){var g,h;g=e.x;this.rotate?(h=f,f=g):h=g;d=AmCharts.circle(a,this.bulletSize/2,this.chart.getBalloonColor(d,e,!0),d.cursorBulletAlpha);d.translate(h,f);this.allBullets.push(d)}}}},destroy:function(){this.clear();AmCharts.remove(this.selection);this.selection=null;var a=this.categoryBalloon;a&&a.destroy();this.destroyValueBalloons();AmCharts.remove(this.set)},clear:function(){clearInterval(this.interval)},
|
160
161
|
destroyValueBalloons:function(){var a=this.valueBalloons;if(a){var b;for(b=0;b<a.length;b++)a[b].balloon.hide()}},zoom:function(a,b,c,d){var e=this.chart;this.destroyValueBalloons();this.zooming=!1;var f;this.rotate?this.selectionPosY=f=e.mouseY:this.selectionPosX=f=e.mouseX;this.start=a;this.end=b;this.startTime=c;this.endTime=d;this.zoomed=!0;var g=e.categoryAxis,e=this.rotate;f=this.width;var h=this.height;g.parseDates&&!g.equalSpacing?(a=d-c+g.minDuration(),a=e?h/a:f/a):a=e?h/(b-a):f/(b-a);this.stepWidth=
|
161
162
|
a;this.tempVal=this.valueBalloonsEnabled;this.valueBalloonsEnabled=!1;this.setPosition();this.valueBalloonsEnabled=this.tempVal;this.hideCursor()},hideObj:function(a){a&&a.hide()},hideCursor:function(a){void 0===a&&(a=!0);this.hideObj(this.set);this.hideObj(this.categoryBalloon);this.hideObj(this.line);this.hideObj(this.vLine);this.hideObj(this.hLine);this.hideObj(this.allBullets);this.destroyValueBalloons();this.selectWithoutZooming||AmCharts.remove(this.selection);this.previousIndex=NaN;a&&this.fire("onHideCursor",
|
162
163
|
{type:"onHideCursor",chart:this.chart,target:this});this.drawing||this.chart.setMouseCursor("auto");this.normalizeBulletSize()},setPosition:function(a,b){void 0===b&&(b=!0);if("cursor"==this.type){if(AmCharts.ifArray(this.data)){isNaN(a)&&(a=this.getMousePosition());if((a!=this.previousMousePosition||!0===this.zoomed||this.oneBalloonOnly)&&!isNaN(a)){var c=this.chart.categoryAxis.xToIndex(a);if(c!=this.previousIndex||this.zoomed||"mouse"==this.cursorPosition||this.oneBalloonOnly)this.updateCursor(c,
|
163
164
|
b),this.zoomed=!1}this.previousMousePosition=a}}else this.updateCrosshair()},normalizeBulletSize:function(){var a=this.resizedBullets;if(a)for(var b=0;b<a.length;b++){var c=a[b],d=c.bulletGraphics;d&&d.translate(c.bx,c.by,1)}},updateCursor:function(a,b){var c=this.chart,d=c.mouseX-this.x,e=c.mouseY-this.y;this.drawingNow&&(AmCharts.remove(this.drawingLine),this.drawingLine=AmCharts.line(this.container,[this.x+this.drawStartX,this.x+d],[this.y+this.drawStartY,this.y+e],this.cursorColor,1,1));if(this.enabled){void 0===
|
164
|
-
b&&(b=!0);this.index=a;var f=c.categoryAxis,g=c.dx,h=c.dy,k=this.x,l=this.y,m=this.width,n=this.height,p=this.data[a];if(p){var q=p.x[f.id],u=c.rotate,r=f.inside,s=this.stepWidth,w=this.categoryBalloon,v=this.firstTime,t=this.lastTime,A=this.cursorPosition,
|
165
|
+
b&&(b=!0);this.index=a;var f=c.categoryAxis,g=c.dx,h=c.dy,k=this.x,l=this.y,m=this.width,n=this.height,p=this.data[a];if(p){var q=p.x[f.id],u=c.rotate,r=f.inside,s=this.stepWidth,w=this.categoryBalloon,v=this.firstTime,t=this.lastTime,A=this.cursorPosition,F=f.position,x=this.zooming,z=this.panning,H=c.graphs,I=f.axisThickness;if(c.mouseIsOver||x||z||this.forceShow)if(this.forceShow=!1,z){var g=this.panClickPos,c=this.panClickEndTime,x=this.panClickStartTime,B=this.panClickEnd,k=this.panClickStart,
|
165
166
|
d=(u?g-e:g-d)/s;if(!f.parseDates||f.equalSpacing)d=Math.round(d);0!==d&&(g={type:"zoomed",target:this},g.chart=this.chart,f.parseDates&&!f.equalSpacing?(c+d>t&&(d=t-c),x+d<v&&(d=v-x),g.start=x+d,g.end=c+d,this.fire(g.type,g)):B+d>=this.data.length||0>k+d||(g.start=k+d,g.end=B+d,this.fire(g.type,g)))}else{"start"==A&&(q-=f.cellWidth/2);"mouse"==A&&c.mouseIsOver&&(q=u?e-2:d-2);if(u){if(0>q)if(x)q=0;else{this.hideCursor();return}if(q>n+1)if(x)q=n+1;else{this.hideCursor();return}}else{if(0>q)if(x)q=0;
|
166
167
|
else{this.hideCursor();return}if(q>m)if(x)q=m;else{this.hideCursor();return}}0<this.cursorAlpha&&(v=this.line,u?(t=0,s=q+h):(t=q,s=0),A=this.animationDuration,0<A&&!this.zooming?isNaN(this.previousX)?v.translate(t,s):(v.translate(this.previousX,this.previousY),v.animate({translate:t+","+s},A,"easeOutSine")):v.translate(t,s),this.previousX=t,this.previousY=s,v.show());this.linePos=u?q+h:q;x&&(u?this.updateSelectionSize(NaN,q):this.updateSelectionSize(q,NaN));s=!0;x&&(s=!1);this.categoryBalloonEnabled&&
|
167
|
-
s?(u?(r&&("right"==
|
168
|
+
s?(u?(r&&("right"==F?w.setBounds(k,l+h,k+m+g,l+q+h):w.setBounds(k,l+h,k+m+g,l+q)),"right"==F?r?w.setPosition(k+m+g,l+q+h):w.setPosition(k+m+g+I,l+q+h):r?w.setPosition(k,l+q):w.setPosition(k-I,l+q)):"top"==F?r?w.setPosition(k+q+g,l+h):w.setPosition(k+q+g,l+h-I+1):r?w.setPosition(k+q,l+n):w.setPosition(k+q,l+n+I-1),(v=this.categoryBalloonFunction)?w.showBalloon(v(p.category)):f.parseDates?(f=AmCharts.formatDate(p.category,this.categoryBalloonDateFormat),-1!=f.indexOf("fff")&&(f=AmCharts.formatMilliseconds(f,
|
168
169
|
p.category)),w.showBalloon(f)):w.showBalloon(p.category)):w.hide();H&&this.bulletsEnabled&&this.showBullets();if(this.oneBalloonOnly){h=Infinity;for(t=0;t<H.length;t++)f=H[t],f.showBalloon&&!f.hidden&&f.balloonText&&(w=p.axes[f.valueAxis.id].graphs[f.id],v=w.y,isNaN(v)||(u?Math.abs(d-v)<h&&(h=Math.abs(d-v),B=f):Math.abs(e-v)<h&&(h=Math.abs(e-v),B=f)));this.mostCloseGraph&&(B=this.mostCloseGraph)}if(a!=this.previousIndex||B!=this.previousMostCloseGraph)if(this.normalizeBulletSize(),this.destroyValueBalloons(),
|
169
170
|
this.resizedBullets=[],H&&this.valueBalloonsEnabled&&s&&c.balloon.enabled){this.valueBalloons=h=[];for(t=0;t<H.length;t++)if(f=H[t],(!this.oneBalloonOnly||f==B)&&f.showBalloon&&!f.hidden&&f.balloonText&&(w=p.axes[f.valueAxis.id].graphs[f.id],v=w.y,!isNaN(v))){r=w.x;s=!0;if(u){if(q=v,0>r||r>n)s=!1}else if(q=r,r=v,0>q||q>m+g)s=!1;s&&(1!=this.graphBulletSize&&AmCharts.isModern&&(s=w.bulletGraphics)&&(s.getBBox(),s.translate(w.bx,w.by,this.graphBulletSize),this.resizedBullets.push(w)),s=f.valueBalloon,
|
170
|
-
|
171
|
+
F=c.getBalloonColor(f,w),s.setBounds(k,l,k+m,l+n),s.pointerOrientation="H",s.changeColor(F),void 0!==f.balloonAlpha&&(s.fillAlpha=f.balloonAlpha),void 0!==f.balloonTextColor&&(s.color=f.balloonTextColor),s.setPosition(q+k,r+l),q=c.formatString(f.balloonText,w,f),(r=f.balloonFunction)&&(q=r(w,f)),""!==q&&(u?s.showBalloon(q):(s.text=q,s.show=!0)),!u&&s.set&&s.set.hide(),h.push({yy:v,balloon:s}))}u||this.arrangeBalloons()}b?(g={type:"changed"},g.index=a,g.target=this,g.chart=this.chart,g.zooming=x,g.mostCloseGraph=
|
171
172
|
B,g.position=u?e:d,g.target=this,c.fire("changed",g),this.fire("changed",g),this.skipZoomDispatch=!1):(this.skipZoomDispatch=!0,c.updateLegendValues(a));this.previousIndex=a;this.previousMostCloseGraph=B}}}else this.hideCursor()},enableDrawing:function(a){this.enabled=!a;this.hideCursor();this.rolledOver=!1;this.drawing=a},isZooming:function(a){a&&a!=this.zooming&&this.handleMouseDown("fake");a||a==this.zooming||this.handleMouseUp()},handleMouseOut:function(){if(this.enabled)if(this.zooming)this.setPosition();
|
172
173
|
else{this.index=void 0;var a={type:"changed",index:void 0,target:this};a.chart=this.chart;this.fire("changed",a);this.hideCursor()}},handleReleaseOutside:function(){this.handleMouseUp()},handleMouseUp:function(){var a=this.chart,b=this.data,c;if(a){var d=a.mouseX-this.x,e=a.mouseY-this.y;if(this.drawingNow){this.drawingNow=!1;AmCharts.remove(this.drawingLine);c=this.drawStartX;var f=this.drawStartY;if(2<Math.abs(c-d)||2<Math.abs(f-e))c={type:"draw",target:this,chart:a,initialX:c,initialY:f,finalX:d,
|
173
174
|
finalY:e},this.fire(c.type,c)}if(this.enabled&&0<b.length){if(this.pan)this.rolledOver=!1;else if(this.zoomable&&this.zooming){c=this.selectWithoutZooming?{type:"selected"}:{type:"zoomed"};c.target=this;c.chart=a;if("cursor"==this.type)this.rotate?this.selectionPosY=e:this.selectionPosX=e=d,2>Math.abs(e-this.initialMouse)&&this.fromIndex==this.index||(this.index<this.fromIndex?(c.end=this.fromIndex,c.start=this.index):(c.end=this.index,c.start=this.fromIndex),e=a.categoryAxis,e.parseDates&&!e.equalSpacing&&
|
@@ -178,83 +179,84 @@ d,this.selectionPosY=e),this.zooming=!0)}}});AmCharts.SimpleChartScrollbar=AmCha
|
|
178
179
|
40);var b=a.chart.container,c=a.rotate,d=a.chart,e=b.set();a.set=e;d.scrollbarsSet.push(e);var f,g;c?(f=a.scrollbarHeight,g=d.plotAreaHeight):(g=a.scrollbarHeight,f=d.plotAreaWidth);a.width=f;if((a.height=g)&&f){var h=AmCharts.rect(b,f,g,a.backgroundColor,a.backgroundAlpha,1,a.backgroundColor,a.backgroundAlpha);a.bg=h;e.push(h);h=AmCharts.rect(b,f,g,"#000",0.005);e.push(h);a.invisibleBg=h;h.click(function(){a.handleBgClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()}).touchend(function(){a.handleBgClick()});
|
179
180
|
h=AmCharts.rect(b,f,g,a.selectedBackgroundColor,a.selectedBackgroundAlpha);a.selectedBG=h;e.push(h);f=AmCharts.rect(b,f,g,"#000",0.005);a.dragger=f;e.push(f);f.mousedown(function(b){a.handleDragStart(b)}).mouseup(function(){a.handleDragStop()}).mouseover(function(){a.handleDraggerOver()}).mouseout(function(){a.handleMouseOut()}).touchstart(function(b){a.handleDragStart(b)}).touchend(function(){a.handleDragStop()});f=d.pathToImages;c?(h=f+"dragIconH.gif",f=a.dragIconWidth,c=a.dragIconHeight):(h=f+
|
180
181
|
"dragIcon.gif",c=a.dragIconWidth,f=a.dragIconHeight);g=b.image(h,0,0,c,f);var h=b.image(h,0,0,c,f),k=10,l=20;d.panEventsEnabled&&(k=25,l=a.scrollbarHeight);var m=AmCharts.rect(b,k,l,"#000",0.005),n=AmCharts.rect(b,k,l,"#000",0.005);n.translate(-(k-c)/2,-(l-f)/2);m.translate(-(k-c)/2,-(l-f)/2);c=b.set([g,n]);b=b.set([h,m]);a.iconLeft=c;e.push(a.iconLeft);a.iconRight=b;e.push(b);c.mousedown(function(){a.leftDragStart()}).mouseup(function(){a.leftDragStop()}).mouseover(function(){a.iconRollOver()}).mouseout(function(){a.iconRollOut()}).touchstart(function(b){a.leftDragStart()}).touchend(function(){a.leftDragStop()});
|
181
|
-
b.mousedown(function(){a.rightDragStart()}).mouseup(function(){a.rightDragStop()}).mouseover(function(){a.iconRollOver()}).mouseout(function(){a.iconRollOut()}).touchstart(function(b){a.rightDragStart()}).touchend(function(){a.rightDragStop()});AmCharts.ifArray(d.chartData)?e.show():e.hide();a.hideDragIcons()}e.translate(a.x,a.y)
|
182
|
+
b.mousedown(function(){a.rightDragStart()}).mouseup(function(){a.rightDragStop()}).mouseover(function(){a.iconRollOver()}).mouseout(function(){a.iconRollOut()}).touchstart(function(b){a.rightDragStart()}).touchend(function(){a.rightDragStop()});AmCharts.ifArray(d.chartData)?e.show():e.hide();a.hideDragIcons();a.clipDragger(!1)}e.translate(a.x,a.y)},updateScrollbarSize:function(a,b){var c=this.dragger,d,e,f,g;this.rotate?(d=0,e=a,f=this.width+1,g=b-a,c.setAttr("height",b-a),c.setAttr("y",e)):(d=a,
|
182
183
|
e=0,f=b-a,g=this.height+1,c.setAttr("width",b-a),c.setAttr("x",d));this.clipAndUpdate(d,e,f,g)},updateScrollbar:function(){var a,b=!1,c,d,e=this.x,f=this.y,g=this.dragger,h=this.getDBox();c=h.x+e;d=h.y+f;var k=h.width,h=h.height,l=this.rotate,m=this.chart,n=this.width,p=this.height,q=m.mouseX,u=m.mouseY;a=this.initialMouse;m.mouseIsOver&&(this.dragging&&(m=this.initialCoord,l?(a=m+(u-a),0>a&&(a=0),m=p-h,a>m&&(a=m),g.setAttr("y",a)):(a=m+(q-a),0>a&&(a=0),m=n-k,a>m&&(a=m),g.setAttr("x",a))),this.resizingRight&&
|
183
184
|
(l?(a=u-d,a+d>p+f&&(a=p-d+f),0>a?(this.resizingRight=!1,b=this.resizingLeft=!0):(0===a&&(a=0.1),g.setAttr("height",a))):(a=q-c,a+c>n+e&&(a=n-c+e),0>a?(this.resizingRight=!1,b=this.resizingLeft=!0):(0===a&&(a=0.1),g.setAttr("width",a)))),this.resizingLeft&&(l?(c=d,d=u,d<f&&(d=f),d>p+f&&(d=p+f),a=!0===b?c-d:h+c-d,0>a?(this.resizingRight=!0,this.resizingLeft=!1,g.setAttr("y",c+h-f)):(0===a&&(a=0.1),g.setAttr("y",d-f),g.setAttr("height",a))):(d=q,d<e&&(d=e),d>n+e&&(d=n+e),a=!0===b?c-d:k+c-d,0>a?(this.resizingRight=
|
184
|
-
!0,this.resizingLeft=!1,g.setAttr("x",c+k-e)):(0===a&&(a=0.1),g.setAttr("x",d-e),g.setAttr("width",a)))),this.clipDragger(!0))},clipDragger:function(a){var b=this.getDBox()
|
185
|
-
a;this.clipY=b;this.clipW=c;this.clipH=d;this.selectedBG.clipRect(a,b,c,d);this.updateDragIconPositions();this.maskGraphs(a,b,c,d)},dispatchScrollbarEvent:function(){if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart;a.hideBalloon();var b=this.getDBox(),c=b.x,d=b.y,e=b.width,b=b.height;this.rotate?(c=d,e=this.height/b):e=this.width/e;a={type:"zoomed",position:c,chart:a,target:this,multiplier:e};this.fire(a.type,a)}},updateDragIconPositions:function(){var a=this.getDBox(),b=
|
186
|
-
e=this.iconRight,f,g,h=this.scrollbarHeight;this.rotate?(f=this.dragIconWidth,g=this.dragIconHeight,d.translate((h-g)/2,c-f/2),e.translate((h-g)/2,c+a.height-f/2)):(f=this.dragIconHeight,g=this.dragIconWidth,d.translate(b-g/2,(h-f)/2),e.translate(b+-g/2+a.width,(h-f)/2))},showDragIcons:function(){this.resizeEnabled&&(this.iconLeft.show(),this.iconRight.show())},hideDragIcons:function(){this.resizingLeft||this.resizingRight||this.dragging||(this.hideResizeGrips&&(this.iconLeft.hide(),
|
187
|
-
this.removeCursors())},removeCursors:function(){this.chart.setMouseCursor("auto")},relativeZoom:function(a,b){this.dragger.stop();this.multiplier=a;this.position=b;this.updateScrollbarSize(b,this.rotate?b+this.height/a:b+this.width/a)},destroy:function(){this.clear();AmCharts.remove(this.set)},clear:function(){clearInterval(this.interval)},handleDragStart:function(){var a=this.chart;this.dragger.stop();this.removeCursors();this.dragging=!0;var b=this.getDBox();this.rotate?(this.initialCoord=
|
188
|
-
a.mouseY):(this.initialCoord=b.x,this.initialMouse=a.mouseX)},handleDragStop:function(){this.updateOnReleaseOnly&&(this.updateScrollbar(),this.skipEvent=!1,this.dispatchScrollbarEvent());this.dragging=!1;this.mouseIsOver&&this.removeCursors();this.updateScrollbar()},handleDraggerOver:function(){this.handleMouseOver()},leftDragStart:function(){this.dragger.stop();this.resizingLeft=!0},leftDragStop:function(){this.resizingLeft=!1;this.mouseIsOver||this.removeCursors();this.updateOnRelease()},
|
189
|
-
this.resizingRight=!0},rightDragStop:function(){this.resizingRight=!1;this.mouseIsOver||this.removeCursors();this.updateOnRelease()},iconRollOut:function(){this.removeCursors()},iconRollOver:function(){this.rotate?this.chart.setMouseCursor("n-resize"):this.chart.setMouseCursor("e-resize");this.handleMouseOver()},getDBox:function(){return this.dragger.getBBox()},handleBgClick:function(){if(!this.resizingRight&&!this.resizingLeft){this.zooming
|
190
|
-
var e=a.height,f=a.width;b=this.chart;var g=this.y,h=this.x,k=this.rotate;k?(a="y",b=b.mouseY-e/2-g,b=AmCharts.fitToBounds(b,0,this.height-e)):(a="x",b=b.mouseX-f/2-h,b=AmCharts.fitToBounds(b,0,this.width-f));this.updateOnReleaseOnly?(this.skipEvent=!1,d.setAttr(a,b),this.dispatchScrollbarEvent(),this.clipDragger()):(b=Math.round(b),k?d.animate({y:b},c,">"):d.animate({x:b},c,">"))}},updateOnRelease:function(){this.updateOnReleaseOnly&&
|
191
|
-
handleReleaseOutside:function(){if(this.set){if(this.resizingLeft||this.resizingRight||this.dragging)this.updateOnRelease(),this.removeCursors();this.mouseIsOver=this.dragging=this.resizingRight=this.resizingLeft=!1;this.hideDragIcons();this.updateScrollbar()}},handleMouseOver:function(){this.mouseIsOver=!0;this.showDragIcons()},handleMouseOut:function(){this.mouseIsOver=!1;this.hideDragIcons()}});AmCharts.ChartScrollbar=AmCharts.Class({inherits:AmCharts.SimpleChartScrollbar,construct:function(){AmCharts.ChartScrollbar.base.construct.call(this);this.graphLineColor="#BBBBBB";this.graphLineAlpha=0;this.graphFillColor="#BBBBBB";this.graphFillAlpha=1;this.selectedGraphLineColor="#888888";this.selectedGraphLineAlpha=0;this.selectedGraphFillColor="#888888";this.selectedGraphFillAlpha=1;this.gridCount=0;this.gridColor="#FFFFFF";this.gridAlpha=0.7;this.skipEvent=this.autoGridCount=!1;this.color="#FFFFFF";
|
192
|
-
this.scrollbarCreated=!1},init:function(){var a=this.categoryAxis,b=this.chart;a||(this.categoryAxis=a=new AmCharts.CategoryAxis);a.chart=b;a.id="scrollbar";a.dateFormats=b.categoryAxis.dateFormats;a.boldPeriodBeginning=b.categoryAxis.boldPeriodBeginning;a.axisItemRenderer=AmCharts.RecItem;a.axisRenderer=AmCharts.RecAxis;a.guideFillRenderer=AmCharts.RecFill;a.inside=!0;a.fontSize=this.fontSize;a.tickLength=0;a.axisAlpha=0;
|
193
|
-
c.visible=!1,c.scrollbar=!0,c.axisItemRenderer=AmCharts.RecItem,c.axisRenderer=AmCharts.RecAxis,c.guideFillRenderer=AmCharts.RecFill,c.labelsEnabled=!1,c.chart=b);b=this.unselectedGraph;b||(b=new AmCharts.AmGraph,b.scrollbar=!0,this.unselectedGraph=b,b.negativeBase=a.negativeBase,b.noStepRisers=a.noStepRisers);b=this.selectedGraph;b||(b=new AmCharts.AmGraph,b.scrollbar=!0,this.selectedGraph=b,b.negativeBase=a.negativeBase,
|
194
|
-
this;AmCharts.ChartScrollbar.base.draw.call(a);a.scrollbarCreated||a.init();var b=a.chart,c=b.chartData,d=a.categoryAxis,e=a.rotate,f=a.x,g=a.y,h=a.width,k=a.height,l=b.categoryAxis,m=a.set;d.setOrientation(!e);d.parseDates=l.parseDates;d.rotate=e;d.equalSpacing=l.equalSpacing;d.minPeriod=l.minPeriod;d.startOnAxis=l.startOnAxis;d.viW=h;d.viH=k;d.width=h;d.height=k;d.gridCount=a.gridCount;d.gridColor=a.gridColor;d.gridAlpha=
|
195
|
-
|
196
|
-
s>g&&(g=s)}}Infinity!=f&&(n.minimum=f);-Infinity!=g&&(n.maximum=g+0.1*(g-f));f==g&&(n.minimum-=1,n.maximum+=1);void 0!==a.minimum&&(n.minimum=a.minimum);void 0!==a.maximum&&(n.maximum=a.maximum);n.zoom(0,c.length-1);r=a.unselectedGraph;r.id=l.id;r.rotate=e;r.chart=b;r.chartType=b.chartType;r.data=c;r.valueAxis=n;r.chart=l.chart;r.categoryAxis=a.categoryAxis;r.valueField=l.valueField;r.openField=l.openField;r.closeField=
|
197
|
-
r.lineColor=a.graphLineColor;r.fillAlphas=a.graphFillAlpha;r.fillColors=a.graphFillColor;r.connect=l.connect;r.hidden=l.hidden;r.width=h;r.height=k;p=a.selectedGraph;p.id=l.id;p.rotate=e;p.chart=b;p.chartType=b.chartType;p.data=c;p.valueAxis=n;p.chart=l.chart;p.categoryAxis=d;p.valueField=l.valueField;p.openField=l.openField;p.closeField=l.closeField;p.highField=l.highField;p.lowField=l.lowField;p.lineAlpha=a.selectedGraphLineAlpha;
|
198
|
-
p.fillColors=a.selectedGraphFillColor;p.connect=l.connect;p.hidden=l.hidden;p.width=h;p.height=k;b=a.graphType;b||(b=l.type);r.type=b;p.type=b;c=c.length-1;r.zoom(0,c);p.zoom(0,c);p.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});r.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});
|
199
|
-
a.bg.toBack();a.invisibleBg.toFront();a.dragger.toFront();a.iconLeft.toFront();a.iconRight.toFront()},timeZoom:function(a,b){this.startTime=a;this.endTime=b;this.timeDifference=b-a;this.skipEvent=!0;this.zoomScrollbar()},zoom:function(a,b){this.start=a;this.end=b;this.skipEvent=!0;this.zoomScrollbar()},dispatchScrollbarEvent:function(){if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart.chartData,b,c,d=this.dragger.getBBox();b=d.x;
|
200
|
-
c=f):c=e;e={type:"zoomed",target:this};e.chart=d;var f=this.categoryAxis,g=this.stepWidth;if(f.parseDates&&!f.equalSpacing){if(a=d.firstTime,f.minDuration(),d=Math.round(b/g)+a,a=this.dragging?d+this.timeDifference:Math.round((b+c)/g)+a,d>a&&(d=a),d!=this.startTime||a!=this.endTime)this.startTime=d,this.endTime=a,e.start=d,e.end=a,e.startDate=new Date(d),e.endDate=new Date(a),this.fire(e.type,e)}else if(f.startOnAxis||(b+=g/2),c-=this.stepWidth/
|
201
|
-
b)f.startOnAxis&&(this.resizingRight&&d==b&&b++,this.resizingLeft&&d==b&&(0<d?d--:b=1)),this.start=d,this.end=this.dragging?this.start+this.difference:b,e.start=this.start,e.end=this.end,f.parseDates&&(a[this.start]&&(e.startDate=new Date(a[this.start].time)),a[this.end]&&(e.endDate=new Date(a[this.end].time))),this.fire(e.type,e)}},zoomScrollbar:function(){var a,b;a=this.chart;var c=a.chartData,d=this.categoryAxis;d.parseDates&&!d.equalSpacing?
|
202
|
-
b=c*(this.endTime-d)):(a=c[this.start].x[d.id],b=c[this.end].x[d.id],c=d.stepWidth,d.startOnAxis||(d=c/2,a-=d,b+=d));this.stepWidth=c;this.updateScrollbarSize(a,b)},maskGraphs:function(a,b,c,d){var e=this.selectedGraph;e&&e.set.clipRect(a,b,c,d)},handleDragStart:function(){AmCharts.ChartScrollbar.base.handleDragStart.call(this);this.difference=this.end-this.start;this.timeDifference=this.endTime-this.startTime;0>this.timeDifference&&(this.timeDifference=
|
203
|
-
this.dragging||(this.difference=this.end-this.start,this.timeDifference=this.endTime-this.startTime,0>this.timeDifference&&(this.timeDifference=0))}});AmCharts.AmBalloon=AmCharts.Class({construct:function(){this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=0.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maximumWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=0.4;this.shadowColor="#000000";this.fadeOutDuration=this.animationDuration=
|
185
|
+
!0,this.resizingLeft=!1,g.setAttr("x",c+k-e)):(0===a&&(a=0.1),g.setAttr("x",d-e),g.setAttr("width",a)))),this.clipDragger(!0))},clipDragger:function(a){var b=this.getDBox();if(b){var c=b.x,d=b.y,e=b.width,b=b.height,f=!1;if(this.rotate){if(c=0,e=this.width+1,this.clipY!=d||this.clipH!=b)f=!0}else if(d=0,b=this.height+1,this.clipX!=c||this.clipW!=e)f=!0;f&&(this.clipAndUpdate(c,d,e,b),a&&(this.updateOnReleaseOnly||this.dispatchScrollbarEvent()))}},maskGraphs:function(){},clipAndUpdate:function(a,b,
|
186
|
+
c,d){this.clipX=a;this.clipY=b;this.clipW=c;this.clipH=d;this.selectedBG.clipRect(a,b,c,d);this.updateDragIconPositions();this.maskGraphs(a,b,c,d)},dispatchScrollbarEvent:function(){if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart;a.hideBalloon();var b=this.getDBox(),c=b.x,d=b.y,e=b.width,b=b.height;this.rotate?(c=d,e=this.height/b):e=this.width/e;a={type:"zoomed",position:c,chart:a,target:this,multiplier:e};this.fire(a.type,a)}},updateDragIconPositions:function(){var a=this.getDBox(),b=
|
187
|
+
a.x,c=a.y,d=this.iconLeft,e=this.iconRight,f,g,h=this.scrollbarHeight;this.rotate?(f=this.dragIconWidth,g=this.dragIconHeight,d.translate((h-g)/2,c-f/2),e.translate((h-g)/2,c+a.height-f/2)):(f=this.dragIconHeight,g=this.dragIconWidth,d.translate(b-g/2,(h-f)/2),e.translate(b+-g/2+a.width,(h-f)/2))},showDragIcons:function(){this.resizeEnabled&&(this.iconLeft.show(),this.iconRight.show())},hideDragIcons:function(){this.resizingLeft||this.resizingRight||this.dragging||(this.hideResizeGrips&&(this.iconLeft.hide(),
|
188
|
+
this.iconRight.hide()),this.removeCursors())},removeCursors:function(){this.chart.setMouseCursor("auto")},relativeZoom:function(a,b){this.dragger.stop();this.multiplier=a;this.position=b;this.updateScrollbarSize(b,this.rotate?b+this.height/a:b+this.width/a)},destroy:function(){this.clear();AmCharts.remove(this.set)},clear:function(){clearInterval(this.interval)},handleDragStart:function(){var a=this.chart;this.dragger.stop();this.removeCursors();this.dragging=!0;var b=this.getDBox();this.rotate?(this.initialCoord=
|
189
|
+
b.y,this.initialMouse=a.mouseY):(this.initialCoord=b.x,this.initialMouse=a.mouseX)},handleDragStop:function(){this.updateOnReleaseOnly&&(this.updateScrollbar(),this.skipEvent=!1,this.dispatchScrollbarEvent());this.dragging=!1;this.mouseIsOver&&this.removeCursors();this.updateScrollbar()},handleDraggerOver:function(){this.handleMouseOver()},leftDragStart:function(){this.dragger.stop();this.resizingLeft=!0},leftDragStop:function(){this.resizingLeft=!1;this.mouseIsOver||this.removeCursors();this.updateOnRelease()},
|
190
|
+
rightDragStart:function(){this.dragger.stop();this.resizingRight=!0},rightDragStop:function(){this.resizingRight=!1;this.mouseIsOver||this.removeCursors();this.updateOnRelease()},iconRollOut:function(){this.removeCursors()},iconRollOver:function(){this.rotate?this.chart.setMouseCursor("n-resize"):this.chart.setMouseCursor("e-resize");this.handleMouseOver()},getDBox:function(){if(this.dragger)return this.dragger.getBBox()},handleBgClick:function(){if(!this.resizingRight&&!this.resizingLeft){this.zooming=
|
191
|
+
!0;var a,b,c=this.scrollDuration,d=this.dragger;a=this.getDBox();var e=a.height,f=a.width;b=this.chart;var g=this.y,h=this.x,k=this.rotate;k?(a="y",b=b.mouseY-e/2-g,b=AmCharts.fitToBounds(b,0,this.height-e)):(a="x",b=b.mouseX-f/2-h,b=AmCharts.fitToBounds(b,0,this.width-f));this.updateOnReleaseOnly?(this.skipEvent=!1,d.setAttr(a,b),this.dispatchScrollbarEvent(),this.clipDragger()):(b=Math.round(b),k?d.animate({y:b},c,">"):d.animate({x:b},c,">"))}},updateOnRelease:function(){this.updateOnReleaseOnly&&
|
192
|
+
(this.updateScrollbar(),this.skipEvent=!1,this.dispatchScrollbarEvent())},handleReleaseOutside:function(){if(this.set){if(this.resizingLeft||this.resizingRight||this.dragging)this.updateOnRelease(),this.removeCursors();this.mouseIsOver=this.dragging=this.resizingRight=this.resizingLeft=!1;this.hideDragIcons();this.updateScrollbar()}},handleMouseOver:function(){this.mouseIsOver=!0;this.showDragIcons()},handleMouseOut:function(){this.mouseIsOver=!1;this.hideDragIcons()}});AmCharts.ChartScrollbar=AmCharts.Class({inherits:AmCharts.SimpleChartScrollbar,construct:function(){AmCharts.ChartScrollbar.base.construct.call(this);this.graphLineColor="#BBBBBB";this.graphLineAlpha=0;this.graphFillColor="#BBBBBB";this.graphFillAlpha=1;this.selectedGraphLineColor="#888888";this.selectedGraphLineAlpha=0;this.selectedGraphFillColor="#888888";this.selectedGraphFillAlpha=1;this.gridCount=0;this.gridColor="#FFFFFF";this.gridAlpha=0.7;this.skipEvent=this.autoGridCount=!1;this.color="#FFFFFF";
|
193
|
+
this.scrollbarCreated=!1},init:function(){var a=this.categoryAxis,b=this.chart;a||(this.categoryAxis=a=new AmCharts.CategoryAxis);a.chart=b;a.id="scrollbar";a.dateFormats=b.categoryAxis.dateFormats;a.boldPeriodBeginning=b.categoryAxis.boldPeriodBeginning;a.axisItemRenderer=AmCharts.RecItem;a.axisRenderer=AmCharts.RecAxis;a.guideFillRenderer=AmCharts.RecFill;a.inside=!0;a.fontSize=this.fontSize;a.tickLength=0;a.axisAlpha=0;AmCharts.isString(this.graph)&&(this.graph=AmCharts.getObjById(b.graphs,this.graph));
|
194
|
+
if(a=this.graph){var c=this.valueAxis;c||(this.valueAxis=c=new AmCharts.ValueAxis,c.visible=!1,c.scrollbar=!0,c.axisItemRenderer=AmCharts.RecItem,c.axisRenderer=AmCharts.RecAxis,c.guideFillRenderer=AmCharts.RecFill,c.labelsEnabled=!1,c.chart=b);b=this.unselectedGraph;b||(b=new AmCharts.AmGraph,b.scrollbar=!0,this.unselectedGraph=b,b.negativeBase=a.negativeBase,b.noStepRisers=a.noStepRisers);b=this.selectedGraph;b||(b=new AmCharts.AmGraph,b.scrollbar=!0,this.selectedGraph=b,b.negativeBase=a.negativeBase,
|
195
|
+
b.noStepRisers=a.noStepRisers)}this.scrollbarCreated=!0},draw:function(){var a=this;AmCharts.ChartScrollbar.base.draw.call(a);a.scrollbarCreated||a.init();var b=a.chart,c=b.chartData,d=a.categoryAxis,e=a.rotate,f=a.x,g=a.y,h=a.width,k=a.height,l=b.categoryAxis,m=a.set;d.setOrientation(!e);d.parseDates=l.parseDates;d.rotate=e;d.equalSpacing=l.equalSpacing;d.minPeriod=l.minPeriod;d.startOnAxis=l.startOnAxis;d.viW=h;d.viH=k;d.width=h;d.height=k;d.gridCount=a.gridCount;d.gridColor=a.gridColor;d.gridAlpha=
|
196
|
+
a.gridAlpha;d.color=a.color;d.tickLength=0;d.axisAlpha=0;d.autoGridCount=a.autoGridCount;d.parseDates&&!d.equalSpacing&&d.timeZoom(b.firstTime,b.lastTime);d.zoom(0,c.length-1);if(l=a.graph){var n=a.valueAxis,p=l.valueAxis;n.id=p.id;n.rotate=e;n.setOrientation(e);n.width=h;n.height=k;n.viW=h;n.viH=k;n.dataProvider=c;n.reversed=p.reversed;n.logarithmic=p.logarithmic;n.gridAlpha=0;n.axisAlpha=0;m.push(n.set);e?(n.y=g,n.x=0):(n.x=f,n.y=0);var f=Infinity,g=-Infinity,q;for(q=0;q<c.length;q++){var u=c[q].axes[p.id].graphs[l.id].values,
|
197
|
+
r;for(r in u)if(u.hasOwnProperty(r)&&"percents"!=r&&"total"!=r){var s=u[r];s<f&&(f=s);s>g&&(g=s)}}Infinity!=f&&(n.minimum=f);-Infinity!=g&&(n.maximum=g+0.1*(g-f));f==g&&(n.minimum-=1,n.maximum+=1);void 0!==a.minimum&&(n.minimum=a.minimum);void 0!==a.maximum&&(n.maximum=a.maximum);n.zoom(0,c.length-1);r=a.unselectedGraph;r.id=l.id;r.rotate=e;r.chart=b;r.chartType=b.chartType;r.data=c;r.valueAxis=n;r.chart=l.chart;r.categoryAxis=a.categoryAxis;r.valueField=l.valueField;r.openField=l.openField;r.closeField=
|
198
|
+
l.closeField;r.highField=l.highField;r.lowField=l.lowField;r.lineAlpha=a.graphLineAlpha;r.lineColor=a.graphLineColor;r.fillAlphas=a.graphFillAlpha;r.fillColors=a.graphFillColor;r.connect=l.connect;r.hidden=l.hidden;r.width=h;r.height=k;p=a.selectedGraph;p.id=l.id;p.rotate=e;p.chart=b;p.chartType=b.chartType;p.data=c;p.valueAxis=n;p.chart=l.chart;p.categoryAxis=d;p.valueField=l.valueField;p.openField=l.openField;p.closeField=l.closeField;p.highField=l.highField;p.lowField=l.lowField;p.lineAlpha=a.selectedGraphLineAlpha;
|
199
|
+
p.lineColor=a.selectedGraphLineColor;p.fillAlphas=a.selectedGraphFillAlpha;p.fillColors=a.selectedGraphFillColor;p.connect=l.connect;p.hidden=l.hidden;p.width=h;p.height=k;b=a.graphType;b||(b=l.type);r.type=b;p.type=b;c=c.length-1;r.zoom(0,c);p.zoom(0,c);p.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});r.set.click(function(){a.handleBackgroundClick()}).mouseover(function(){a.handleMouseOver()}).mouseout(function(){a.handleMouseOut()});
|
200
|
+
m.push(r.set);m.push(p.set)}m.push(d.set);m.push(d.labelsSet);a.bg.toBack();a.invisibleBg.toFront();a.dragger.toFront();a.iconLeft.toFront();a.iconRight.toFront()},timeZoom:function(a,b){this.startTime=a;this.endTime=b;this.timeDifference=b-a;this.skipEvent=!0;this.zoomScrollbar()},zoom:function(a,b){this.start=a;this.end=b;this.skipEvent=!0;this.zoomScrollbar()},dispatchScrollbarEvent:function(){if(this.skipEvent)this.skipEvent=!1;else{var a=this.chart.chartData,b,c,d=this.dragger.getBBox();b=d.x;
|
201
|
+
c=d.y;var e=d.width,f=d.height,d=this.chart;this.rotate?(b=c,c=f):c=e;e={type:"zoomed",target:this};e.chart=d;var f=this.categoryAxis,g=this.stepWidth;if(f.parseDates&&!f.equalSpacing){if(a=d.firstTime,f.minDuration(),d=Math.round(b/g)+a,a=this.dragging?d+this.timeDifference:Math.round((b+c)/g)+a,d>a&&(d=a),d!=this.startTime||a!=this.endTime)this.startTime=d,this.endTime=a,e.start=d,e.end=a,e.startDate=new Date(d),e.endDate=new Date(a),this.fire(e.type,e)}else if(f.startOnAxis||(b+=g/2),c-=this.stepWidth/
|
202
|
+
2,d=f.xToIndex(b),b=f.xToIndex(b+c),d!=this.start||this.end!=b)f.startOnAxis&&(this.resizingRight&&d==b&&b++,this.resizingLeft&&d==b&&(0<d?d--:b=1)),this.start=d,this.end=this.dragging?this.start+this.difference:b,e.start=this.start,e.end=this.end,f.parseDates&&(a[this.start]&&(e.startDate=new Date(a[this.start].time)),a[this.end]&&(e.endDate=new Date(a[this.end].time))),this.fire(e.type,e)}},zoomScrollbar:function(){var a,b;a=this.chart;var c=a.chartData,d=this.categoryAxis;d.parseDates&&!d.equalSpacing?
|
203
|
+
(c=d.stepWidth,d=a.firstTime,a=c*(this.startTime-d),b=c*(this.endTime-d)):(a=c[this.start].x[d.id],b=c[this.end].x[d.id],c=d.stepWidth,d.startOnAxis||(d=c/2,a-=d,b+=d));this.stepWidth=c;this.updateScrollbarSize(a,b)},maskGraphs:function(a,b,c,d){var e=this.selectedGraph;e&&e.set.clipRect(a,b,c,d)},handleDragStart:function(){AmCharts.ChartScrollbar.base.handleDragStart.call(this);this.difference=this.end-this.start;this.timeDifference=this.endTime-this.startTime;0>this.timeDifference&&(this.timeDifference=
|
204
|
+
0)},handleBackgroundClick:function(){AmCharts.ChartScrollbar.base.handleBackgroundClick.call(this);this.dragging||(this.difference=this.end-this.start,this.timeDifference=this.endTime-this.startTime,0>this.timeDifference&&(this.timeDifference=0))}});AmCharts.AmBalloon=AmCharts.Class({construct:function(){this.enabled=!0;this.fillColor="#FFFFFF";this.fillAlpha=0.8;this.borderThickness=2;this.borderColor="#FFFFFF";this.borderAlpha=1;this.cornerRadius=0;this.maximumWidth=220;this.horizontalPadding=8;this.verticalPadding=4;this.pointerWidth=6;this.pointerOrientation="V";this.color="#000000";this.adjustBorderColor=!0;this.show=this.follow=this.showBullet=!1;this.bulletSize=3;this.shadowAlpha=0.4;this.shadowColor="#000000";this.fadeOutDuration=this.animationDuration=
|
204
205
|
0.3;this.fixedPosition=!1;this.offsetY=6;this.offsetX=1;AmCharts.isModern||(this.offsetY*=1.5)},draw:function(){var a=this.pointToX,b=this.pointToY;this.deltaSignX=this.deltaSignY=1;var c=this.chart;AmCharts.VML&&(this.fadeOutDuration=0);this.xAnim&&c.stopAnim(this.xAnim);this.yAnim&&c.stopAnim(this.yAnim);if(!isNaN(a)){var d=this.follow,e=c.container,f=this.set;AmCharts.remove(f);this.removeDiv();this.set=f=e.set();c.balloonsSet.push(f);if(this.show){var g=this.l,h=this.t,k=this.r,l=this.b,m=this.balloonColor,
|
205
|
-
n=this.fillColor,p=this.borderColor,q=n;void 0!=m&&(this.adjustBorderColor?q=p=m:n=m);var u=this.horizontalPadding,r=this.verticalPadding,s=this.pointerWidth,w=this.pointerOrientation,v=this.cornerRadius,t=c.fontFamily,A=this.fontSize;void 0==A&&(A=c.fontSize);var m=document.createElement("div"),
|
206
|
+
n=this.fillColor,p=this.borderColor,q=n;void 0!=m&&(this.adjustBorderColor?q=p=m:n=m);var u=this.horizontalPadding,r=this.verticalPadding,s=this.pointerWidth,w=this.pointerOrientation,v=this.cornerRadius,t=c.fontFamily,A=this.fontSize;void 0==A&&(A=c.fontSize);var m=document.createElement("div"),F=m.style;F.position="absolute";m.innerHTML='<div style="max-width:'+this.maxWidth+"px; font-size:"+A+"px; color:"+this.color+"; font-family:"+t+'">'+this.text+"</div>";c.chartDiv.appendChild(m);this.textDiv=
|
206
207
|
m;A=m.offsetWidth;t=m.offsetHeight;m.clientHeight&&(A=m.clientWidth,t=m.clientHeight);var t=t+2*r,x=A+2*u;window.opera&&(t+=2);var z,H=!1;z=this.offsetY;c.handDrawn&&(z+=c.handDrawScatter+2);"H"!=w?(A=a-x/2,b<h+t+10&&"down"!=w?(H=!0,d&&(b+=z),z=b+s,this.deltaSignY=-1):(d&&(b-=z),z=b-t-s,this.deltaSignY=1)):(2*s>t&&(s=t/2),z=b-t/2,a<g+(k-g)/2?(A=a+s,this.deltaSignX=-1):(A=a-x-s,this.deltaSignX=1));z+t>=l&&(z=l-t);z<h&&(z=h);A<g&&(A=g);A+x>k&&(A=k-x);var h=z+r,l=A+u,r=this.shadowAlpha,I=this.shadowColor,
|
207
|
-
u=this.borderThickness,B=this.bulletSize,
|
208
|
-
t,t,0,0],q=a<g+(k-g)/2?[0,0,A<a?0:a-A,0,0,x,x,0]:[x,x,A+x>a?x:a-A,x,x,0,0,x]),0<r&&(a=AmCharts.polygon(e,q,v,n,0,u,I,r),a.translate(1,1),f.push(a)),n=AmCharts.polygon(e,q,v,n,this.fillAlpha,u,p,this.borderAlpha));this.bg=n;f.push(n);n.toFront();e=1*this.deltaSignX;
|
209
|
-
f.animate({translate:A-e+","+z},b,"easeOutSine"),m&&(
|
208
|
+
u=this.borderThickness,B=this.bulletSize,da;0<v||0===s?(0<r&&(a=AmCharts.rect(e,x,t,n,0,u+1,I,r,this.cornerRadius),AmCharts.isModern?a.translate(1,1):a.translate(4,4),f.push(a)),n=AmCharts.rect(e,x,t,n,this.fillAlpha,u,p,this.borderAlpha,this.cornerRadius),this.showBullet&&(da=AmCharts.circle(e,B,q,this.fillAlpha),f.push(da))):(q=[],v=[],"H"!=w?(g=a-A,g>x-s&&(g=x-s),g<s&&(g=s),q=[0,g-s,a-A,g+s,x,x,0,0],v=H?[0,0,b-z,0,0,t,t,0]:[t,t,b-z,t,t,0,0,t]):(q=b-z,q>t-s&&(q=t-s),q<s&&(q=s),v=[0,q-s,b-z,q+s,
|
209
|
+
t,t,0,0],q=a<g+(k-g)/2?[0,0,A<a?0:a-A,0,0,x,x,0]:[x,x,A+x>a?x:a-A,x,x,0,0,x]),0<r&&(a=AmCharts.polygon(e,q,v,n,0,u,I,r),a.translate(1,1),f.push(a)),n=AmCharts.polygon(e,q,v,n,this.fillAlpha,u,p,this.borderAlpha));this.bg=n;f.push(n);n.toFront();e=1*this.deltaSignX;F.left=l+"px";F.top=h+"px";f.translate(A-e,z);n=n.getBBox();this.bottom=z+t+1;this.yPos=n.y+z;da&&da.translate(this.pointToX-A+e,b-z);b=this.animationDuration;0<this.animationDuration&&!d&&!isNaN(this.prevX)&&(f.translate(this.prevX,this.prevY),
|
210
|
+
f.animate({translate:A-e+","+z},b,"easeOutSine"),m&&(F.left=this.prevTX+"px",F.top=this.prevTY+"px",this.xAnim=c.animate({node:m},"left",this.prevTX,l,b,"easeOutSine","px"),this.yAnim=c.animate({node:m},"top",this.prevTY,h,b,"easeOutSine","px")));this.prevX=A-e;this.prevY=z;this.prevTX=l;this.prevTY=h}}},followMouse:function(){if(this.follow&&this.show){var a=this.chart.mouseX-this.offsetX*this.deltaSignX,b=this.chart.mouseY;this.pointToX=a;this.pointToY=b;if(a!=this.previousX||b!=this.previousY)if(this.previousX=
|
210
211
|
a,this.previousY=b,0===this.cornerRadius)this.draw();else{var c=this.set;if(c){var d=c.getBBox(),a=a-d.width/2,e=b-d.height-10;a<this.l&&(a=this.l);a>this.r-d.width&&(a=this.r-d.width);e<this.t&&(e=b+10);c.translate(a,e);b=this.textDiv.style;b.left=a+this.horizontalPadding+"px";b.top=e+this.verticalPadding+"px"}}}},changeColor:function(a){this.balloonColor=a},setBounds:function(a,b,c,d){this.l=a;this.t=b;this.r=c;this.b=d;this.destroyTO&&clearTimeout(this.destroyTO)},showBalloon:function(a){this.text=
|
211
212
|
a;this.show=!0;this.destroyTO&&clearTimeout(this.destroyTO);a=this.chart;this.fadeAnim1&&a.stopAnim(this.fadeAnim1);this.fadeAnim2&&a.stopAnim(this.fadeAnim2);this.draw()},hide:function(){var a=this,b=a.fadeOutDuration,c=a.chart;if(0<b){a.destroyTO=setTimeout(function(){a.destroy.call(a)},1E3*b);a.follow=!1;a.show=!1;var d=a.set;d&&(d.setAttr("opacity",a.fillAlpha),a.fadeAnim1=d.animate({opacity:0},b,"easeInSine"));a.textDiv&&(a.fadeAnim2=c.animate({node:a.textDiv},"opacity",1,0,b,"easeInSine",""))}else a.show=
|
212
213
|
!1,a.follow=!1,a.destroy()},setPosition:function(a,b,c){this.pointToX=a;this.pointToY=b;c&&(a==this.previousX&&b==this.previousY||this.draw());this.previousX=a;this.previousY=b},followCursor:function(a){var b=this;(b.follow=a)?(b.pShowBullet=b.showBullet,b.showBullet=!1):void 0!==b.pShowBullet&&(b.showBullet=b.pShowBullet);clearInterval(b.interval);var c=b.chart.mouseX,d=b.chart.mouseY;!isNaN(c)&&a&&(b.pointToX=c-b.offsetX*b.deltaSignX,b.pointToY=d,b.followMouse(),b.interval=setInterval(function(){b.followMouse.call(b)},
|
213
214
|
40))},removeDiv:function(){if(this.textDiv){var a=this.textDiv.parentNode;a&&a.removeChild(this.textDiv)}},destroy:function(){clearInterval(this.interval);AmCharts.remove(this.set);this.removeDiv();this.set=null}});AmCharts.AmCoordinateChart=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(){AmCharts.AmCoordinateChart.base.construct.call(this);this.createEvents("rollOverGraphItem","rollOutGraphItem","clickGraphItem","doubleClickGraphItem","rightClickGraphItem","clickGraph");this.plotAreaFillColors="#FFFFFF";this.plotAreaFillAlphas=0;this.plotAreaBorderColor="#000000";this.plotAreaBorderAlpha=0;this.startAlpha=1;this.startDuration=0;this.startEffect="elastic";this.sequencedAnimation=!0;this.colors=
|
214
|
-
"#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");this.balloonDateFormat="MMM DD, YYYY";this.valueAxes=[];this.graphs=[]},initChart:function(){AmCharts.AmCoordinateChart.base.initChart.call(this);this.
|
215
|
-
this.processGraphs()},parseSerialData:function(){var a=this.graphs,b,c={},d=this.seriesIdField;d||(d=this.categoryField);this.chartData=[];var e=this.dataProvider;if(e){var f=!1,g,h=this.categoryAxis,k;h&&(f=h.parseDates,k=h.forceShowField,g=h.categoryFunction);var l,m;f&&(b=AmCharts.extractPeriod(h.minPeriod),
|
216
|
-
r[k]);n[r[d]]=u;f&&(b=h.categoryFunction?h.categoryFunction(b,r,h):b instanceof Date?"fff"==h.minPeriod?AmCharts.useUTC?new Date(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds(),b.getUTCMilliseconds()):new Date(b.getFullYear(),b.getMonth(),b.getDate(),b.getHours(),
|
217
|
-
var s=this.valueAxes;u.axes={};u.x={};var w;for(w=0;w<s.length;w++){var v=s[w].id;u.axes[v]={};u.axes[v].graphs={};var t;for(t=0;t<a.length;t++){b=a[t];var A=b.id,
|
218
|
-
b,c){var d={},e,f=!1;"candlestick"!=b.type&&"ohlc"!=b.type||""===c||(f=!0);e=Number(a[b.valueField+c]);isNaN(e)||(d.value=e);e=Number(a[b.errorField+c]);isNaN(e)||(d.error=e);f&&(c="Open");e=Number(a[b.openField+c]);isNaN(e)||(d.open=e);f&&(c="Close");e=Number(a[b.closeField+c]);isNaN(e)||(d.close=e);f&&
|
219
|
-
(c=this.seriesIdField);c||(c=this.categoryField);var d;for(d=0;d<b.length;d++){var e=b[d],f=this.lookupTable[String(e[c])],g=a.valueAxis.id;f&&(g=f.axes[g].graphs[a.id],g.serialDataItem=f,g.values=this.processValues(e,a,a.periodValue),this.processFields(a,g,e))}},addValueAxis:function(a){a.chart=this;this.valueAxes.push(a);
|
220
|
-
c;for(c=b.length-1;0<=c;c--){var d=b[c];d&&d.valueAxis==a&&this.removeGraph(d)}b=this.valueAxes;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);this.validateData()},addGraph:function(a){this.graphs.push(a);this.chooseGraphColor(a,this.graphs.length-1);this.validateData()},removeGraph:function(a){var b=this.graphs,c;for(c=
|
221
|
-
c.
|
222
|
-
|
223
|
-
|
224
|
-
(b[f]=g))}b.dataContext=c},chooseGraphColor:function(a,b){if(!a.lineColor){var c;c=this.colors.length>b?this.colors[b]:AmCharts.randomColor();a.lineColor=c}},handleLegendEvent:function(a){var b=
|
225
|
-
|
226
|
-
|
215
|
+
"#FF6600 #FCD202 #B0DE09 #0D8ECF #2A0CD0 #CD0D74 #CC0000 #00CC00 #0000CC #DDDDDD #999999 #333333 #990000".split(" ");this.balloonDateFormat="MMM DD, YYYY";this.valueAxes=[];this.graphs=[];this.gridAboveGraphs=!1},initChart:function(){AmCharts.AmCoordinateChart.base.initChart.call(this);var a=this.categoryAxis;a&&(this.categoryAxis=AmCharts.processObject(a,AmCharts.CategoryAxis));this.processValueAxes();this.createValueAxes();this.processGraphs();AmCharts.VML&&(this.startAlpha=1);this.setLegendData(this.graphs);
|
216
|
+
this.gridAboveGraphs&&this.gridSet.toFront()},createValueAxes:function(){if(0===this.valueAxes.length){var a=new AmCharts.ValueAxis;this.addValueAxis(a)}},parseData:function(){this.processValueAxes();this.processGraphs()},parseSerialData:function(){var a=this.graphs,b,c={},d=this.seriesIdField;d||(d=this.categoryField);this.chartData=[];var e=this.dataProvider;if(e){var f=!1,g,h=this.categoryAxis,k;h&&(f=h.parseDates,k=h.forceShowField,g=h.categoryFunction);var l,m;f&&(b=AmCharts.extractPeriod(h.minPeriod),
|
217
|
+
l=b.period,m=b.count);var n={};this.lookupTable=n;var p,q=this.dataDateFormat;for(p=0;p<e.length;p++){var u={},r=e[p];b=r[this.categoryField];u.category=g?g(b,r,h):String(b);k&&(u.forceShow=r[k]);n[r[d]]=u;f&&(b=h.categoryFunction?h.categoryFunction(b,r,h):b instanceof Date?"fff"==h.minPeriod?AmCharts.useUTC?new Date(b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate(),b.getUTCHours(),b.getUTCMinutes(),b.getUTCSeconds(),b.getUTCMilliseconds()):new Date(b.getFullYear(),b.getMonth(),b.getDate(),b.getHours(),
|
218
|
+
b.getMinutes(),b.getSeconds(),b.getMilliseconds()):new Date(b):q?AmCharts.stringToDate(b,q):new Date(b),b=AmCharts.resetDateToMin(b,l,m,h.firstDayOfWeek),u.category=b,u.time=b.getTime());var s=this.valueAxes;u.axes={};u.x={};var w;for(w=0;w<s.length;w++){var v=s[w].id;u.axes[v]={};u.axes[v].graphs={};var t;for(t=0;t<a.length;t++){b=a[t];var A=b.id,F=b.periodValue;if(b.valueAxis.id==v){u.axes[v].graphs[A]={};var x={};x.index=p;var z=r;b.dataProvider&&(z=c);x.values=this.processValues(z,b,F);this.processFields(b,
|
219
|
+
x,z);x.category=u.category;x.serialDataItem=u;x.graph=b;u.axes[v].graphs[A]=x}}}this.chartData[p]=u}}for(c=0;c<a.length;c++)b=a[c],b.dataProvider&&this.parseGraphData(b)},processValues:function(a,b,c){var d={},e,f=!1;"candlestick"!=b.type&&"ohlc"!=b.type||""===c||(f=!0);e=Number(a[b.valueField+c]);isNaN(e)||(d.value=e);e=Number(a[b.errorField+c]);isNaN(e)||(d.error=e);f&&(c="Open");e=Number(a[b.openField+c]);isNaN(e)||(d.open=e);f&&(c="Close");e=Number(a[b.closeField+c]);isNaN(e)||(d.close=e);f&&
|
220
|
+
(c="Low");e=Number(a[b.lowField+c]);isNaN(e)||(d.low=e);f&&(c="High");e=Number(a[b.highField+c]);isNaN(e)||(d.high=e);return d},parseGraphData:function(a){var b=a.dataProvider,c=a.seriesIdField;c||(c=this.seriesIdField);c||(c=this.categoryField);var d;for(d=0;d<b.length;d++){var e=b[d],f=this.lookupTable[String(e[c])],g=a.valueAxis.id;f&&(g=f.axes[g].graphs[a.id],g.serialDataItem=f,g.values=this.processValues(e,a,a.periodValue),this.processFields(a,g,e))}},addValueAxis:function(a){a.chart=this;this.valueAxes.push(a);
|
221
|
+
this.validateData()},removeValueAxesAndGraphs:function(){var a=this.valueAxes,b;for(b=a.length-1;-1<b;b--)this.removeValueAxis(a[b])},removeValueAxis:function(a){var b=this.graphs,c;for(c=b.length-1;0<=c;c--){var d=b[c];d&&d.valueAxis==a&&this.removeGraph(d)}b=this.valueAxes;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1);this.validateData()},addGraph:function(a){this.graphs.push(a);this.chooseGraphColor(a,this.graphs.length-1);this.validateData()},removeGraph:function(a){var b=this.graphs,c;for(c=
|
222
|
+
b.length-1;0<=c;c--)b[c]==a&&(b.splice(c,1),a.destroy());this.validateData()},processValueAxes:function(){var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b],c=AmCharts.processObject(c,AmCharts.ValueAxis);a[b]=c;c.chart=this;c.id||(c.id="valueAxis"+b+"_"+(new Date).getTime());if(!0===this.usePrefixes||!1===this.usePrefixes)c.usePrefixes=this.usePrefixes}},processGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b],c=AmCharts.processObject(c,AmCharts.AmGraph);a[b]=c;this.chooseGraphColor(c,
|
223
|
+
b);c.chart=this;AmCharts.isString(c.valueAxis)&&(c.valueAxis=this.getValueAxisById(c.valueAxis));c.valueAxis||(c.valueAxis=this.valueAxes[0]);c.id||(c.id="graph"+b+"_"+(new Date).getTime())}},formatString:function(a,b){var c=b.graph,d=c.valueAxis;d.duration&&b.values.value&&(d=AmCharts.formatDuration(b.values.value,d.duration,"",d.durationUnits,d.maxInterval,d.numberFormatter),a=a.split("[[value]]").join(d));a=AmCharts.massReplace(a,{"[[title]]":c.title,"[[description]]":b.description});a=AmCharts.fixNewLines(a);
|
224
|
+
return a=AmCharts.cleanFromEmpty(a)},getBalloonColor:function(a,b,c){var d=a.lineColor,e=a.balloonColor;c&&(e=d);c=a.fillColors;"object"==typeof c?d=c[0]:void 0!==c&&(d=c);b.isNegative&&(c=a.negativeLineColor,a=a.negativeFillColors,"object"==typeof a?c=a[0]:void 0!==a&&(c=a),void 0!==c&&(d=c));void 0!==b.color&&(d=b.color);void 0===e&&(e=d);return e},getGraphById:function(a){return AmCharts.getObjById(this.graphs,a)},getValueAxisById:function(a){return AmCharts.getObjById(this.valueAxes,a)},processFields:function(a,
|
225
|
+
b,c){if(a.itemColors){var d=a.itemColors,e=b.index;b.color=e<d.length?d[e]:AmCharts.randomColor()}d="lineColor color alpha fillColors description bullet customBullet bulletSize bulletConfig url labelColor dashLength pattern".split(" ");for(e=0;e<d.length;e++){var f=d[e],g=a[f+"Field"];g&&(g=c[g],AmCharts.isDefined(g)&&(b[f]=g))}b.dataContext=c},chooseGraphColor:function(a,b){if(!a.lineColor){var c;c=this.colors.length>b?this.colors[b]:AmCharts.randomColor();a.lineColor=c}},handleLegendEvent:function(a){var b=
|
226
|
+
a.type;a=a.dataItem;if(!this.legend.data&&a){var c=a.hidden,d=a.showBalloon;switch(b){case "clickMarker":d?this.hideGraphsBalloon(a):this.showGraphsBalloon(a);break;case "clickLabel":d?this.hideGraphsBalloon(a):this.showGraphsBalloon(a);break;case "rollOverItem":c||this.highlightGraph(a);break;case "rollOutItem":c||this.unhighlightGraph();break;case "hideItem":this.hideGraph(a);break;case "showItem":this.showGraph(a)}}},highlightGraph:function(a){var b=this.graphs,c,d=0.2;this.legend&&(d=this.legend.rollOverGraphAlpha);
|
227
|
+
if(1!=d)for(c=0;c<b.length;c++){var e=b[c];e!=a&&e.changeOpacity(d)}},unhighlightGraph:function(){var a;this.legend&&(a=this.legend.rollOverGraphAlpha);if(1!=a){a=this.graphs;var b;for(b=0;b<a.length;b++)a[b].changeOpacity(1)}},showGraph:function(a){a.hidden=!1;this.dataChanged=!0;this.marginsUpdated=!1;this.chartCreated&&this.initChart()},hideGraph:function(a){this.dataChanged=!0;this.marginsUpdated=!1;a.hidden=!0;this.chartCreated&&this.initChart()},hideGraphsBalloon:function(a){a.showBalloon=!1;
|
228
|
+
this.updateLegend()},showGraphsBalloon:function(a){a.showBalloon=!0;this.updateLegend()},updateLegend:function(){this.legend&&this.legend.invalidateSize()},resetAnimation:function(){var a=this.graphs;if(a){var b;for(b=0;b<a.length;b++)a[b].animationPlayed=!1}},animateAgain:function(){this.resetAnimation();this.validateNow()}});AmCharts.AmSlicedChart=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(){this.createEvents("rollOverSlice","rollOutSlice","clickSlice","pullOutSlice","pullInSlice","rightClickSlice");AmCharts.AmSlicedChart.base.construct.call(this);this.colors="#FF0F00 #FF6600 #FF9E01 #FCD202 #F8FF01 #B0DE09 #04D215 #0D8ECF #0D52D1 #2A0CD0 #8A0CCF #CD0D74 #754DEB #DDDDDD #999999 #333333 #000000 #57032A #CA9726 #990000 #4B0C25".split(" ");this.alpha=1;this.groupPercent=0;this.groupedTitle="Other";this.groupedPulled=
|
227
229
|
!1;this.groupedAlpha=1;this.marginLeft=0;this.marginBottom=this.marginTop=10;this.marginRight=0;this.hoverAlpha=1;this.outlineColor="#FFFFFF";this.outlineAlpha=0;this.outlineThickness=1;this.startAlpha=0;this.startDuration=1;this.startEffect="bounce";this.sequencedAnimation=!0;this.pullOutDuration=1;this.pullOutEffect="bounce";this.pullOnHover=this.pullOutOnlyOne=!1;this.labelsEnabled=!0;this.labelTickColor="#000000";this.labelTickAlpha=0.2;this.hideLabelsPercent=0;this.urlTarget="_self";this.autoMarginOffset=
|
228
|
-
10;this.gradientRatio=[]},initChart:function(){AmCharts.AmSlicedChart.base.initChart.call(this);this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,this.
|
230
|
+
10;this.gradientRatio=[]},initChart:function(){AmCharts.AmSlicedChart.base.initChart.call(this);this.dataChanged&&(this.parseData(),this.dispatchDataUpdated=!0,this.dataChanged=!1,this.setLegendData(this.chartData));this.drawChart()},handleLegendEvent:function(a){var b=a.type;a=a.dataItem;if(!this.legend.data&&a){var c=a.hidden;switch(b){case "clickMarker":c||this.clickSlice(a);break;case "clickLabel":c||this.clickSlice(a);break;case "rollOverItem":c||this.rollOverSlice(a,!1);break;case "rollOutItem":c||
|
229
231
|
this.rollOutSlice(a);break;case "hideItem":this.hideSlice(a);break;case "showItem":this.showSlice(a)}}},invalidateVisibility:function(){this.recalculatePercents();this.initChart();var a=this.legend;a&&a.invalidateSize()},addEventListeners:function(a,b){var c=this;a.mouseover(function(a){c.rollOverSlice(b,!0,a)}).mouseout(function(a){c.rollOutSlice(b,a)}).click(function(a){c.clickSlice(b,a)}).contextmenu(function(a){c.handleRightClick(b,a)})},formatString:function(a,b){a=AmCharts.formatValue(a,b,["value"],
|
230
232
|
this.numberFormatter,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=AmCharts.formatValue(a,b,["percents"],this.percentFormatter);a=AmCharts.massReplace(a,{"[[title]]":b.title,"[[description]]":b.description});-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,b.dataContext));a=AmCharts.fixNewLines(a);return a=AmCharts.cleanFromEmpty(a)},startSlices:function(){var a;for(a=0;a<this.chartData.length;a++)0<this.startDuration&&this.sequencedAnimation?this.setStartTO(a):
|
231
|
-
this.startSlice(this.chartData[a])},setStartTO:function(a){var b=this;a=setTimeout(function(){b.startSequenced.call(b)},
|
233
|
+
this.startSlice(this.chartData[a])},setStartTO:function(a){var b=this;a=setTimeout(function(){b.startSequenced.call(b)},b.startDuration/b.chartData.length*500*a);b.timeOuts.push(a)},pullSlices:function(a){var b=this.chartData,c;for(c=0;c<b.length;c++){var d=b[c];d.pulled&&this.pullSlice(d,1,a)}},startSequenced:function(){var a=this.chartData,b;for(b=0;b<a.length;b++)if(!a[b].started){this.startSlice(this.chartData[b]);break}},startSlice:function(a){a.started=!0;var b=a.wedge,c=this.startDuration;
|
232
234
|
b&&0<c&&(0<a.alpha&&b.show(),b.translate(a.startX,a.startY),b.animate({opacity:a.alpha,translate:"0,0"},c,this.startEffect))},showLabels:function(){var a=this.chartData,b;for(b=0;b<a.length;b++){var c=a[b];if(0<c.alpha){var d=c.label;d&&d.show();(c=c.tick)&&c.show()}}},showSlice:function(a){isNaN(a)?a.hidden=!1:this.chartData[a].hidden=!1;this.invalidateVisibility()},hideSlice:function(a){isNaN(a)?a.hidden=!0:this.chartData[a].hidden=!0;this.hideBalloon();this.invalidateVisibility()},rollOverSlice:function(a,
|
233
235
|
b,c){isNaN(a)||(a=this.chartData[a]);clearTimeout(this.hoverInt);this.pullOnHover&&this.pullSlice(a,1);1>this.hoverAlpha&&a.wedge&&a.wedge.attr({opacity:this.hoverAlpha});var d=a.balloonX,e=a.balloonY;a.pulled&&(d+=a.pullX,e+=a.pullY);var f=this.formatString(this.balloonText,a),g=AmCharts.adjustLuminosity(a.color,-0.15);this.showBalloon(f,g,b,d,e);a={type:"rollOverSlice",dataItem:a,chart:this,event:c};this.fire(a.type,a)},rollOutSlice:function(a,b){isNaN(a)||(a=this.chartData[a]);a.wedge&&a.wedge.attr({opacity:a.alpha});
|
234
236
|
this.hideBalloon();var c={type:"rollOutSlice",dataItem:a,chart:this,event:b};this.fire(c.type,c)},clickSlice:function(a,b){isNaN(a)||(a=this.chartData[a]);a.pulled?this.pullSlice(a,0):this.pullSlice(a,1);AmCharts.getURL(a.url,this.urlTarget);var c={type:"clickSlice",dataItem:a,chart:this,event:b};this.fire(c.type,c)},handleRightClick:function(a,b){isNaN(a)||(a=this.chartData[a]);var c={type:"rightClickSlice",dataItem:a,chart:this,event:b};this.fire(c.type,c)},drawTicks:function(){var a=this.chartData,
|
235
237
|
b;for(b=0;b<a.length;b++){var c=a[b];if(c.label){var d=c.ty,d=AmCharts.line(this.container,[c.tx0,c.tx,c.tx2],[c.ty0,d,d],this.labelTickColor,this.labelTickAlpha);c.tick=d;c.wedge.push(d)}}},initialStart:function(){var a=this,b=a.startDuration,c=setTimeout(function(){a.showLabels.call(a)},1E3*b);a.timeOuts.push(c);a.chartCreated?a.pullSlices(!0):(b=setTimeout(function(){a.pullSlices.call(a)},1200*b),a.timeOuts.push(b),a.startSlices())},pullSlice:function(a,b,c){var d=this.pullOutDuration;!0===c&&
|
236
238
|
(d=0);(c=a.wedge)&&c.animate({translate:b*a.pullX+","+b*a.pullY},d,this.pullOutEffect);1==b?(a.pulled=!0,this.pullOutOnlyOne&&this.pullInAll(a.index),a={type:"pullOutSlice",dataItem:a,chart:this}):(a.pulled=!1,a={type:"pullInSlice",dataItem:a,chart:this});this.fire(a.type,a)},pullInAll:function(a){var b=this.chartData,c;for(c=0;c<this.chartData.length;c++)c!=a&&b[c].pulled&&this.pullSlice(b[c],0)},pullOutAll:function(a){a=this.chartData;var b;for(b=0;b<a.length;b++)a[b].pulled||this.pullSlice(a[b],
|
237
239
|
1)},parseData:function(){var a=[];this.chartData=a;var b=this.dataProvider;isNaN(this.pieAlpha)||(this.alpha=this.pieAlpha);if(void 0!==b){var c=b.length,d=0,e,f,g;for(e=0;e<c;e++){f={};var h=b[e];f.dataContext=h;f.value=Number(h[this.valueField]);(g=h[this.titleField])||(g="");f.title=g;f.pulled=AmCharts.toBoolean(h[this.pulledField],!1);(g=h[this.descriptionField])||(g="");f.description=g;f.labelRadius=Number(h[this.labelRadiusField]);f.url=h[this.urlField];f.pattern=h[this.patternField];f.visibleInLegend=
|
238
|
-
AmCharts.toBoolean(h[this.visibleInLegendField],!0);g=h[this.alphaField];f.alpha=void 0!==g?Number(g):this.alpha;g=h[this.colorField];void 0!==g&&(f.color=AmCharts.toColor(g));f.labelColor=AmCharts.toColor(h[this.labelColorField]);d+=f.value;f.hidden=!1;a[e]=f}for(e=b=0;e<c;e++)f=a[e],f.percents=
|
240
|
+
AmCharts.toBoolean(h[this.visibleInLegendField],!0);g=h[this.alphaField];f.alpha=void 0!==g?Number(g):this.alpha;g=h[this.colorField];void 0!==g&&(f.color=AmCharts.toColor(g));f.labelColor=AmCharts.toColor(h[this.labelColorField]);d+=f.value;f.hidden=!1;a[e]=f}for(e=b=0;e<c;e++)f=a[e],f.percents=f.value/d*100,f.percents<this.groupPercent&&b++;1<b&&(this.groupValue=0,this.removeSmallSlices(),a.push({title:this.groupedTitle,value:this.groupValue,percents:this.groupValue/d*100,pulled:this.groupedPulled,
|
239
241
|
color:this.groupedColor,url:this.groupedUrl,description:this.groupedDescription,alpha:this.groupedAlpha,pattern:this.groupedPattern}));c=this.baseColor;c||(c=this.pieBaseColor);d=this.brightnessStep;d||(d=this.pieBrightnessStep);for(e=0;e<a.length;e++)c?g=AmCharts.adjustLuminosity(c,e*d/100):(g=this.colors[e],void 0===g&&(g=AmCharts.randomColor())),void 0===a[e].color&&(a[e].color=g);this.recalculatePercents()}},recalculatePercents:function(){var a=this.chartData,b=0,c,d;for(c=0;c<a.length;c++)d=
|
240
242
|
a[c],!d.hidden&&0<d.value&&(b+=d.value);for(c=0;c<a.length;c++)d=this.chartData[c],d.percents=!d.hidden&&0<d.value?100*d.value/b:0},removeSmallSlices:function(){var a=this.chartData,b;for(b=a.length-1;0<=b;b--)a[b].percents<this.groupPercent&&(this.groupValue+=a[b].value,a.splice(b,1))},animateAgain:function(){var a=this;a.startSlices();var b=setTimeout(function(){a.pullSlices.call(a)},1200*a.startDuration);a.timeOuts.push(b)},measureMaxLabel:function(){var a=this.chartData,b=0,c;for(c=0;c<a.length;c++){var d=
|
241
243
|
this.formatString(this.labelText,a[c]),d=AmCharts.text(this.container,d,this.color,this.fontFamily,this.fontSize),e=d.getBBox().width;e>b&&(b=e);d.remove()}return b}});AmCharts.AmRectangularChart=AmCharts.Class({inherits:AmCharts.AmCoordinateChart,construct:function(){AmCharts.AmRectangularChart.base.construct.call(this);this.createEvents("zoomed");this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=20;this.verticalPosition=this.horizontalPosition=this.depth3D=this.angle=0;this.heightMultiplier=this.widthMultiplier=1;this.zoomOutText="Show all";this.zoomOutButton={backgroundColor:"#e5e5e5",backgroundAlpha:1};this.trendLines=[];this.autoMargins=!0;
|
242
|
-
this.marginsUpdated=!1;this.autoMarginOffset=10},initChart:function(){AmCharts.AmRectangularChart.base.initChart.call(this);this.updateDxy();var a=!0;!this.marginsUpdated&&this.autoMargins&&(this.resetMargins(),a=!1);this.updateMargins();this.updatePlotArea();this.updateScrollbars();this.updateTrendLines();this.updateChartCursor();this.updateValueAxes();a&&(this.scrollbarOnly||this.updateGraphs())},drawChart:function(){AmCharts.AmRectangularChart.base.drawChart.call(this);
|
243
|
-
this.chartCursor;a&&a.draw();a=this.zoomOutText;""!==a&&a&&this.drawZoomOutButton()}},resetMargins:function(){var a={},b;if("serial"==this.chartType||"gantt"==this.chartType){var c=this.valueAxes;for(b=0;b<c.length;b++){var d=c[b];d.ignoreAxisWidth||(d.setOrientation(this.rotate),d.fixAxisPosition(),a[d.position]=!0)}(b=this.categoryAxis)&&!b.ignoreAxisWidth&&(b.setOrientation(!this.rotate),b.fixAxisPosition(),b.fixAxisPosition(),a[b.position]
|
244
|
-
d[b];e.ignoreAxisWidth||(e.setOrientation(!0),e.fixAxisPosition(),a[e.position]=!0)}for(b=0;b<c.length;b++)d=c[b],d.ignoreAxisWidth||(d.setOrientation(!1),d.fixAxisPosition(),a[d.position]=!0)}a.left&&(this.marginLeft=0);a.right&&(this.marginRight=0);a.top&&(this.marginTop=0);a.bottom&&(this.marginBottom=0);this.fixMargins=a},measureMargins:function(){var a=this.valueAxes,b,c=this.autoMarginOffset,d=this.fixMargins,e=this.realWidth,
|
245
|
-
this.getAxisBounds(a[l],g,k,h,b),g=b.l,k=b.r,h=b.t,b=b.b;if(a=this.categoryAxis)b=this.getAxisBounds(a,g,k,h,b),g=b.l,k=b.r,h=b.t,b=b.b;d.left&&g<c&&(this.marginLeft=Math.round(-g+c));d.right&&k>e-c&&(this.marginRight=Math.round(k-e+c));d.top&&h<c+this.titleHeight&&(this.marginTop=Math.round(this.marginTop-h+c+this.titleHeight));d.bottom&&b>f-c&&(this.marginBottom=Math.round(b-f+c));this.initChart()},getAxisBounds:function(a,b,c,
|
246
|
-
(g=0);if(f)switch(f=a.getBBox(),a.position){case "top":a=f.y;d>a&&(d=a);break;case "bottom":a=f.y+f.height;e<a&&(e=a);break;case "right":a=f.x+f.width+g+3;c<a&&(c=a);break;case "left":a=f.x-g,b>a&&(b=a)}}return{l:b,t:d,r:c,b:e}},drawZoomOutButton:function(){var a=this,b=a.container.set();a.zoomButtonSet.push(b);var c=a.color,d=a.fontSize,e=a.zoomOutButton;e&&(e.fontSize&&(d=e.fontSize),e.color&&(c=e.color));c=AmCharts.text(a.container,
|
247
|
-
6+d.height/2);var f=e.backgroundColor,e=e.backgroundAlpha,e=AmCharts.rect(a.container,d.width+35,d.height+15,f,e,1,f,e);b.push(e);a.zbBG=e;void 0!==a.pathToImages&&(e=a.container.image(a.pathToImages+"lens.png",0,0,17,17),e.translate(6,d.height/2-1),e.toFront(),b.push(e));c.toFront();b.push(c);c=b.getBBox();b.translate(a.marginLeftReal+a.plotAreaWidth-c.width,a.marginTopReal);b.hide();b.mouseover(function(){a.rollOverZB()}).mouseout(function(){a.rollOutZB()}).click(function(){a.clickZB()}).touchstart(function(){a.rollOverZB()}).touchend(function(){a.rollOutZB();
|
244
|
+
this.marginsUpdated=!1;this.autoMarginOffset=10},initChart:function(){AmCharts.AmRectangularChart.base.initChart.call(this);this.updateDxy();var a=!0;!this.marginsUpdated&&this.autoMargins&&(this.resetMargins(),a=!1);this.processScrollbars();this.updateMargins();this.updatePlotArea();this.updateScrollbars();this.updateTrendLines();this.updateChartCursor();this.updateValueAxes();a&&(this.scrollbarOnly||this.updateGraphs())},drawChart:function(){AmCharts.AmRectangularChart.base.drawChart.call(this);
|
245
|
+
this.drawPlotArea();if(AmCharts.ifArray(this.chartData)){var a=this.chartCursor;a&&a.draw();a=this.zoomOutText;""!==a&&a&&this.drawZoomOutButton()}},resetMargins:function(){var a={},b;if("serial"==this.chartType||"gantt"==this.chartType){var c=this.valueAxes;for(b=0;b<c.length;b++){var d=c[b];d.ignoreAxisWidth||(d.setOrientation(this.rotate),d.fixAxisPosition(),a[d.position]=!0)}(b=this.categoryAxis)&&!b.ignoreAxisWidth&&(b.setOrientation(!this.rotate),b.fixAxisPosition(),b.fixAxisPosition(),a[b.position]=
|
246
|
+
!0)}else{d=this.xAxes;c=this.yAxes;for(b=0;b<d.length;b++){var e=d[b];e.ignoreAxisWidth||(e.setOrientation(!0),e.fixAxisPosition(),a[e.position]=!0)}for(b=0;b<c.length;b++)d=c[b],d.ignoreAxisWidth||(d.setOrientation(!1),d.fixAxisPosition(),a[d.position]=!0)}a.left&&(this.marginLeft=0);a.right&&(this.marginRight=0);a.top&&(this.marginTop=0);a.bottom&&(this.marginBottom=0);this.fixMargins=a},measureMargins:function(){var a=this.valueAxes,b,c=this.autoMarginOffset,d=this.fixMargins,e=this.realWidth,
|
247
|
+
f=this.realHeight,g=c,h=c,k=e-c;b=f-c;var l;for(l=0;l<a.length;l++)b=this.getAxisBounds(a[l],g,k,h,b),g=b.l,k=b.r,h=b.t,b=b.b;if(a=this.categoryAxis)b=this.getAxisBounds(a,g,k,h,b),g=b.l,k=b.r,h=b.t,b=b.b;d.left&&g<c&&(this.marginLeft=Math.round(-g+c));d.right&&k>e-c&&(this.marginRight=Math.round(k-e+c));d.top&&h<c+this.titleHeight&&(this.marginTop=Math.round(this.marginTop-h+c+this.titleHeight));d.bottom&&b>f-c&&(this.marginBottom=Math.round(b-f+c));this.initChart()},getAxisBounds:function(a,b,c,
|
248
|
+
d,e){if(!a.ignoreAxisWidth){var f=a.labelsSet,g=a.tickLength;a.inside&&(g=0);if(f)switch(f=a.getBBox(),a.position){case "top":a=f.y;d>a&&(d=a);break;case "bottom":a=f.y+f.height;e<a&&(e=a);break;case "right":a=f.x+f.width+g+3;c<a&&(c=a);break;case "left":a=f.x-g,b>a&&(b=a)}}return{l:b,t:d,r:c,b:e}},drawZoomOutButton:function(){var a=this,b=a.container.set();a.zoomButtonSet.push(b);var c=a.color,d=a.fontSize,e=a.zoomOutButton;e&&(e.fontSize&&(d=e.fontSize),e.color&&(c=e.color));c=AmCharts.text(a.container,
|
249
|
+
a.zoomOutText,c,a.fontFamily,d,"start");d=c.getBBox();c.translate(26,6+d.height/2);var f=e.backgroundColor,e=e.backgroundAlpha,e=AmCharts.rect(a.container,d.width+35,d.height+15,f,e,1,f,e);b.push(e);a.zbBG=e;void 0!==a.pathToImages&&(e=a.container.image(a.pathToImages+"lens.png",0,0,17,17),e.translate(6,d.height/2-1),e.toFront(),b.push(e));c.toFront();b.push(c);c=b.getBBox();b.translate(a.marginLeftReal+a.plotAreaWidth-c.width,a.marginTopReal);b.hide();b.mouseover(function(){a.rollOverZB()}).mouseout(function(){a.rollOutZB()}).click(function(){a.clickZB()}).touchstart(function(){a.rollOverZB()}).touchend(function(){a.rollOutZB();
|
248
250
|
a.clickZB()});for(c=0;c<b.length;c++)b[c].attr({cursor:"pointer"});a.zbSet=b},rollOverZB:function(){this.zbBG.show()},rollOutZB:function(){this.zbBG.hide()},clickZB:function(){this.zoomOut()},zoomOut:function(){this.updateScrollbar=!0;this.zoom()},drawPlotArea:function(){var a=this.dx,b=this.dy,c=this.marginLeftReal,d=this.marginTopReal,e=this.plotAreaWidth-1,f=this.plotAreaHeight-1,g=this.plotAreaFillColors,h=this.plotAreaFillAlphas,k=this.plotAreaBorderColor,l=this.plotAreaBorderAlpha;this.trendLinesSet.clipRect(c,
|
249
251
|
d,e,f);"object"==typeof h&&(h=h[0]);g=AmCharts.polygon(this.container,[0,e,e,0],[0,0,f,f],g,h,1,k,l,this.plotAreaGradientAngle);g.translate(c+a,d+b);g.node.setAttribute("class","amChartsPlotArea");this.set.push(g);0!==a&&0!==b&&(g=this.plotAreaFillColors,"object"==typeof g&&(g=g[0]),g=AmCharts.adjustLuminosity(g,-0.15),e=AmCharts.polygon(this.container,[0,a,e+a,e,0],[0,b,b,0,0],g,h,1,k,l),e.translate(c,d+f),this.set.push(e),a=AmCharts.polygon(this.container,[0,0,a,a,0],[0,f,f+b,b,0],g,h,1,k,l),a.translate(c,
|
250
252
|
d),this.set.push(a))},updatePlotArea:function(){var a=this.updateWidth(),b=this.updateHeight(),c=this.container;this.realWidth=a;this.realWidth=b;c&&this.container.setSize(a,b);a=a-this.marginLeftReal-this.marginRightReal-this.dx;b=b-this.marginTopReal-this.marginBottomReal;1>a&&(a=1);1>b&&(b=1);this.plotAreaWidth=Math.round(a);this.plotAreaHeight=Math.round(b)},updateDxy:function(){this.dx=Math.round(this.depth3D*Math.cos(this.angle*Math.PI/180));this.dy=Math.round(-this.depth3D*Math.sin(this.angle*
|
251
253
|
Math.PI/180));this.d3x=Math.round(this.columnSpacing3D*Math.cos(this.angle*Math.PI/180));this.d3y=Math.round(-this.columnSpacing3D*Math.sin(this.angle*Math.PI/180))},updateMargins:function(){var a=this.getTitleHeight();this.titleHeight=a;this.marginTopReal=this.marginTop-this.dy+a;this.marginBottomReal=this.marginBottom;this.marginLeftReal=this.marginLeft;this.marginRightReal=this.marginRight},updateValueAxes:function(){var a=this.valueAxes,b=this.marginLeftReal,c=this.marginTopReal,d=this.plotAreaHeight,
|
252
254
|
e=this.plotAreaWidth,f;for(f=0;f<a.length;f++){var g=a[f];g.axisRenderer=AmCharts.RecAxis;g.guideFillRenderer=AmCharts.RecFill;g.axisItemRenderer=AmCharts.RecItem;g.dx=this.dx;g.dy=this.dy;g.viW=e-1;g.viH=d-1;g.marginsChanged=!0;g.viX=b;g.viY=c;this.updateObjectSize(g)}},updateObjectSize:function(a){a.width=(this.plotAreaWidth-1)*this.widthMultiplier;a.height=(this.plotAreaHeight-1)*this.heightMultiplier;a.x=this.marginLeftReal+this.horizontalPosition;a.y=this.marginTopReal+this.verticalPosition},
|
253
|
-
updateGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.x=this.marginLeftReal+this.horizontalPosition;c.y=this.marginTopReal+this.verticalPosition;c.width=this.plotAreaWidth*this.widthMultiplier;c.height=this.plotAreaHeight*this.heightMultiplier;c.index=b;c.dx=this.dx;c.dy=this.dy;c.rotate=this.rotate;c.chartType=this.chartType}},updateChartCursor:function(){var a=this.chartCursor;a&&(a
|
254
|
-
1,a.chart=this)},updateScrollbars:function(){},addChartCursor:function(a){AmCharts.callMethod("destroy",[this.chartCursor]);a&&(this.listenTo(a,"changed",this.handleCursorChange),this.listenTo(a,"zoomed",this.handleCursorZoom));this.chartCursor=a},removeChartCursor:function(){AmCharts.callMethod("destroy",
|
255
|
-
this.horizontalPosition,c.y=this.marginTopReal+this.verticalPosition,c.draw())}},addTrendLine:function(a){this.trendLines.push(a)},removeTrendLine:function(a){var b=this.trendLines,c;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)},adjustMargins:function(a,b){var c=a.scrollbarHeight;"top"==a.position?
|
256
|
-
c?"bottom":"top"},updateChartScrollbar:function(a,b){if(a){a.rotate=b;var c=this.marginTopReal,d=this.marginLeftReal,e=a.scrollbarHeight,f=this.dx,g=this.dy;"top"==a.position?b?(a.y=c,a.x=d-e):(a.y=c-e+g-1,a.x=d+f):b?(a.y=c+g,a.x=d+this.plotAreaWidth+f):(a.y=c+this.plotAreaHeight,a.x=this.marginLeftReal)}},
|
257
|
-
a.handleReleaseOutside()},handleMouseDown:function(a){AmCharts.AmRectangularChart.base.handleMouseDown.call(this,a);var b=this.chartCursor;b&&b.handleMouseDown(a)},handleCursorChange:function(a){}});AmCharts.TrendLine=AmCharts.Class({construct:function(){this.createEvents("click");this.isProtected=!1;this.dashLength=0;this.lineColor="#00CC00";this.lineThickness=this.lineAlpha=1},draw:function(){var a=this;a.destroy();var b=a.chart,c=b.container,d,e,f,g,h=a.categoryAxis,k=a.initialDate,l=a.initialCategory,m=a.finalDate,n=a.finalCategory,p=a.valueAxis,q=a.valueAxisX,u=a.initialXValue,r=a.finalXValue,s=a.initialValue,w=a.finalValue,v=p.recalculateToPercents,t=b.dataDateFormat;h&&(k&&(k instanceof
|
255
|
+
updateGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.x=this.marginLeftReal+this.horizontalPosition;c.y=this.marginTopReal+this.verticalPosition;c.width=this.plotAreaWidth*this.widthMultiplier;c.height=this.plotAreaHeight*this.heightMultiplier;c.index=b;c.dx=this.dx;c.dy=this.dy;c.rotate=this.rotate;c.chartType=this.chartType}},updateChartCursor:function(){var a=this.chartCursor;a&&(a=AmCharts.processObject(a,AmCharts.ChartCursor),this.addChartCursor(a),a.x=this.marginLeftReal,
|
256
|
+
a.y=this.marginTopReal,a.width=this.plotAreaWidth-1,a.height=this.plotAreaHeight-1,a.chart=this)},processScrollbars:function(){var a=this.chartScrollbar;a&&(a=AmCharts.processObject(a,AmCharts.ChartScrollbar),this.addChartScrollbar(a))},updateScrollbars:function(){},addChartCursor:function(a){AmCharts.callMethod("destroy",[this.chartCursor]);a&&(this.listenTo(a,"changed",this.handleCursorChange),this.listenTo(a,"zoomed",this.handleCursorZoom));this.chartCursor=a},removeChartCursor:function(){AmCharts.callMethod("destroy",
|
257
|
+
[this.chartCursor]);this.chartCursor=null},zoomTrendLines:function(){var a=this.trendLines,b;for(b=0;b<a.length;b++){var c=a[b];c.valueAxis.recalculateToPercents?c.set&&c.set.hide():(c.x=this.marginLeftReal+this.horizontalPosition,c.y=this.marginTopReal+this.verticalPosition,c.draw())}},addTrendLine:function(a){this.trendLines.push(a)},removeTrendLine:function(a){var b=this.trendLines,c;for(c=b.length-1;0<=c;c--)b[c]==a&&b.splice(c,1)},adjustMargins:function(a,b){var c=a.scrollbarHeight;"top"==a.position?
|
258
|
+
b?this.marginLeftReal+=c:this.marginTopReal+=c:b?this.marginRightReal+=c:this.marginBottomReal+=c},getScrollbarPosition:function(a,b,c){a.position=b?"bottom"==c||"left"==c?"bottom":"top":"top"==c||"right"==c?"bottom":"top"},updateChartScrollbar:function(a,b){if(a){a.rotate=b;var c=this.marginTopReal,d=this.marginLeftReal,e=a.scrollbarHeight,f=this.dx,g=this.dy;"top"==a.position?b?(a.y=c,a.x=d-e):(a.y=c-e+g-1,a.x=d+f):b?(a.y=c+g,a.x=d+this.plotAreaWidth+f):(a.y=c+this.plotAreaHeight,a.x=this.marginLeftReal)}},
|
259
|
+
showZB:function(a){var b=this.zbSet;b&&(a?b.show():b.hide(),this.zbBG.hide())},handleReleaseOutside:function(a){AmCharts.AmRectangularChart.base.handleReleaseOutside.call(this,a);(a=this.chartCursor)&&a.handleReleaseOutside()},handleMouseDown:function(a){AmCharts.AmRectangularChart.base.handleMouseDown.call(this,a);var b=this.chartCursor;b&&b.handleMouseDown(a)},handleCursorChange:function(a){}});AmCharts.TrendLine=AmCharts.Class({construct:function(){this.createEvents("click");this.isProtected=!1;this.dashLength=0;this.lineColor="#00CC00";this.lineThickness=this.lineAlpha=1},draw:function(){var a=this;a.destroy();var b=a.chart,c=b.container,d,e,f,g,h=a.categoryAxis,k=a.initialDate,l=a.initialCategory,m=a.finalDate,n=a.finalCategory,p=a.valueAxis,q=a.valueAxisX,u=a.initialXValue,r=a.finalXValue,s=a.initialValue,w=a.finalValue,v=p.recalculateToPercents,t=b.dataDateFormat;h&&(k&&(k instanceof
|
258
260
|
Date||(k=t?AmCharts.stringToDate(k,t):new Date(k)),a.initialDate=k,d=h.dateToCoordinate(k)),l&&(d=h.categoryToCoordinate(l)),m&&(m instanceof Date||(m=t?AmCharts.stringToDate(m,t):new Date(m)),a.finalDate=m,e=h.dateToCoordinate(m)),n&&(e=h.categoryToCoordinate(n)));q&&!v&&(isNaN(u)||(d=q.getCoordinate(u)),isNaN(r)||(e=q.getCoordinate(r)));p&&!v&&(isNaN(s)||(f=p.getCoordinate(s)),isNaN(w)||(g=p.getCoordinate(w)));isNaN(d)||isNaN(e)||isNaN(f)||isNaN(f)||(b.rotate?(h=[f,g],e=[d,e]):(h=[d,e],e=[f,g]),
|
259
261
|
f=a.lineColor,d=AmCharts.line(c,h,e,f,a.lineAlpha,a.lineThickness,a.dashLength),e=AmCharts.line(c,h,e,f,0.005,5),c=c.set([d,e]),c.translate(b.marginLeftReal,b.marginTopReal),b.trendLinesSet.push(c),a.line=d,a.set=c,e.mouseup(function(){a.handleLineClick()}).mouseover(function(){a.handleLineOver()}).mouseout(function(){a.handleLineOut()}),e.touchend&&e.touchend(function(){a.handleLineClick()}))},handleLineClick:function(){var a={type:"click",trendLine:this,chart:this.chart};this.fire(a.type,a)},handleLineOver:function(){var a=
|
260
262
|
this.rollOverColor;void 0!==a&&this.line.attr({stroke:a})},handleLineOut:function(){this.line.attr({stroke:this.lineColor})},destroy:function(){AmCharts.remove(this.set)}});AmCharts.circle=function(a,b,c,d,e,f,g,h){if(void 0==e||0===e)e=1;void 0===f&&(f="#000000");void 0===g&&(g=0);d={fill:c,stroke:f,"fill-opacity":d,"stroke-width":e,"stroke-opacity":g};a=a.circle(0,0,b).attr(d);h&&a.gradient("radialGradient",[c,AmCharts.adjustLuminosity(c,-0.6)]);return a};
|
@@ -268,10 +270,10 @@ AmCharts.triangle=function(a,b,c,d,e,f,g,h){if(void 0===f||0===f)f=1;void 0===g&
|
|
268
270
|
AmCharts.line=function(a,b,c,d,e,f,g,h,k,l,m){if(a.handDrawn&&!m)return AmCharts.handDrawnLine(a,b,c,d,e,f,g,h,k,l,m);f={fill:"none","stroke-width":f};void 0!==g&&0<g&&(f["stroke-dasharray"]=g);isNaN(e)||(f["stroke-opacity"]=e);d&&(f.stroke=d);d=Math.round;l&&(d=AmCharts.doNothing);l=AmCharts.dx;e=AmCharts.dy;g="M"+(d(b[0])+l)+","+(d(c[0])+e);for(h=1;h<b.length;h++)g+=" L"+(d(b[h])+l)+","+(d(c[h])+e);if(AmCharts.VML)return a.path(g,void 0,!0).attr(f);k&&(g+=" M0,0 L0,0");return a.path(g).attr(f)};
|
269
271
|
AmCharts.makeHD=function(a,b,c){for(var d=[],e=[],f=1;f<a.length;f++)for(var g=Number(a[f-1]),h=Number(b[f-1]),k=Number(a[f]),l=Number(b[f]),m=Math.sqrt(Math.pow(k-g,2)+Math.pow(l-h,2)),m=Math.round(m/50)+1,k=(k-g)/m,l=(l-h)/m,n=0;n<=m;n++){var p=g+n*k+Math.random()*c,q=h+n*l+Math.random()*c;d.push(p);e.push(q)}return[d,e]};
|
270
272
|
AmCharts.handDrawnLine=function(a,b,c,d,e,f,g,h,k,l,m){var n=a.set();for(m=1;m<b.length;m++)for(var p=[b[m-1],b[m]],q=[c[m-1],c[m]],q=AmCharts.makeHD(p,q,a.handDrawScatter),p=q[0],q=q[1],u=1;u<p.length;u++)n.push(AmCharts.line(a,[p[u-1],p[u]],[q[u-1],q[u]],d,e,f+Math.random()*a.handDrawThickness-a.handDrawThickness/2,g,h,k,l,!0));return n};AmCharts.doNothing=function(a){return a};
|
271
|
-
AmCharts.wedge=function(a,b,c,d,e,f,g,h,k,l,m,n){var p=Math.round;f=p(f);g=p(g);h=p(h);var q=p(g/f*h),u=AmCharts.VML,r=359.5+f/100;359.94<r&&(r=359.94);e>=r&&(e=r);var s=1/180*Math.PI,r=b+Math.sin(d*s)*h,w=c-Math.cos(d*s)*q,v=b+Math.sin(d*s)*f,t=c-Math.cos(d*s)*g,A=b+Math.sin((d+e)*s)*f,
|
272
|
-
A),x=p(10*x),w=p(10*w),t=p(10*t),
|
273
|
-
x+","+(s+k)),0<h&&(B+=" A"+h+","+q+",0,"+H+",0,"+r+","+(w+k))),B+=" Z",B=a.path(B,void 0,void 0,"1000,1000").attr(z),d.push(B),B=a.path(" M"+r+","+w+" L"+r+","+(w+k)+" L"+v+","+(t+k)+" L"+v+","+t+" L"+r+","+w+" Z",void 0,void 0,"1000,1000").attr(z),k=a.path(" M"+A+","+
|
274
|
-
" L"+p(v)+","+p(t)+e+" L"+p(x)+","+p(s)):f=" M"+r+","+w+" L"+v+","+t+(" A"+f+","+g+",0,"+H+",1,"+A+","+
|
273
|
+
AmCharts.wedge=function(a,b,c,d,e,f,g,h,k,l,m,n){var p=Math.round;f=p(f);g=p(g);h=p(h);var q=p(g/f*h),u=AmCharts.VML,r=359.5+f/100;359.94<r&&(r=359.94);e>=r&&(e=r);var s=1/180*Math.PI,r=b+Math.sin(d*s)*h,w=c-Math.cos(d*s)*q,v=b+Math.sin(d*s)*f,t=c-Math.cos(d*s)*g,A=b+Math.sin((d+e)*s)*f,F=c-Math.cos((d+e)*s)*g,x=b+Math.sin((d+e)*s)*h,s=c-Math.cos((d+e)*s)*q,z={fill:AmCharts.adjustLuminosity(l.fill,-0.2),"stroke-opacity":0},H=0;180<Math.abs(e)&&(H=1);d=a.set();var I;u&&(r=p(10*r),v=p(10*v),A=p(10*
|
274
|
+
A),x=p(10*x),w=p(10*w),t=p(10*t),F=p(10*F),s=p(10*s),b=p(10*b),k=p(10*k),c=p(10*c),f*=10,g*=10,h*=10,q*=10,1>Math.abs(e)&&1>=Math.abs(A-v)&&1>=Math.abs(F-t)&&(I=!0));e="";var B;0<k&&(u?(B=" M"+r+","+(w+k)+" L"+v+","+(t+k),I||(B+=" A"+(b-f)+","+(k+c-g)+","+(b+f)+","+(k+c+g)+","+v+","+(t+k)+","+A+","+(F+k)),B+=" L"+x+","+(s+k),0<h&&(I||(B+=" B"+(b-h)+","+(k+c-q)+","+(b+h)+","+(k+c+q)+","+x+","+(k+s)+","+r+","+(k+w)))):(B=" M"+r+","+(w+k)+" L"+v+","+(t+k)+(" A"+f+","+g+",0,"+H+",1,"+A+","+(F+k)+" L"+
|
275
|
+
x+","+(s+k)),0<h&&(B+=" A"+h+","+q+",0,"+H+",0,"+r+","+(w+k))),B+=" Z",B=a.path(B,void 0,void 0,"1000,1000").attr(z),d.push(B),B=a.path(" M"+r+","+w+" L"+r+","+(w+k)+" L"+v+","+(t+k)+" L"+v+","+t+" L"+r+","+w+" Z",void 0,void 0,"1000,1000").attr(z),k=a.path(" M"+A+","+F+" L"+A+","+(F+k)+" L"+x+","+(s+k)+" L"+x+","+s+" L"+A+","+F+" Z",void 0,void 0,"1000,1000").attr(z),d.push(B),d.push(k));u?(I||(e=" A"+p(b-f)+","+p(c-g)+","+p(b+f)+","+p(c+g)+","+p(v)+","+p(t)+","+p(A)+","+p(F)),f=" M"+p(r)+","+p(w)+
|
276
|
+
" L"+p(v)+","+p(t)+e+" L"+p(x)+","+p(s)):f=" M"+r+","+w+" L"+v+","+t+(" A"+f+","+g+",0,"+H+",1,"+A+","+F)+" L"+x+","+s;0<h&&(u?I||(f+=" B"+(b-h)+","+(c-q)+","+(b+h)+","+(c+q)+","+x+","+s+","+r+","+w):f+=" A"+h+","+q+",0,"+H+",0,"+r+","+w);a.handDrawn&&(b=AmCharts.line(a,[r,v],[w,t],l.stroke,l.thickness*Math.random()*a.handDrawThickness,l["stroke-opacity"]),d.push(b));a=a.path(f+" Z",void 0,void 0,"1000,1000").attr(l);if(m){b=[];for(c=0;c<m.length;c++)b.push(AmCharts.adjustLuminosity(l.fill,m[c]));
|
275
277
|
0<b.length&&a.gradient("linearGradient",b)}a.pattern(n);d.push(a);return d};AmCharts.adjustLuminosity=function(a,b){a=String(a).replace(/[^0-9a-f]/gi,"");6>a.length&&(a=String(a[0])+String(a[0])+String(a[1])+String(a[1])+String(a[2])+String(a[2]));b=b||0;var c="#",d,e;for(e=0;3>e;e++)d=parseInt(a.substr(2*e,2),16),d=Math.round(Math.min(Math.max(0,d+d*b),255)).toString(16),c+=("00"+d).substr(d.length);return c};AmCharts.Bezier=AmCharts.Class({construct:function(a,b,c,d,e,f,g,h,k,l){"object"==typeof g&&(g=g[0]);"object"==typeof h&&(h=h[0]);f={fill:g,"fill-opacity":h,"stroke-width":f};void 0!==k&&0<k&&(f["stroke-dasharray"]=k);isNaN(e)||(f["stroke-opacity"]=e);d&&(f.stroke=d);d="M"+Math.round(b[0])+","+Math.round(c[0]);e=[];for(k=0;k<b.length;k++)e.push({x:Number(b[k]),y:Number(c[k])});1<e.length&&(b=this.interpolate(e),d+=this.drawBeziers(b));l?d+=l:AmCharts.VML||(d+="M0,0 L0,0");this.path=a.path(d).attr(f)},
|
276
278
|
interpolate:function(a){var b=[];b.push({x:a[0].x,y:a[0].y});var c=a[1].x-a[0].x,d=a[1].y-a[0].y,e=AmCharts.bezierX,f=AmCharts.bezierY;b.push({x:a[0].x+c/e,y:a[0].y+d/f});var g;for(g=1;g<a.length-1;g++){var h=a[g-1],k=a[g],d=a[g+1],c=d.x-k.x,d=d.y-h.y,h=k.x-h.x;h>c&&(h=c);b.push({x:k.x-h/e,y:k.y-d/f});b.push({x:k.x,y:k.y});b.push({x:k.x+h/e,y:k.y+d/f})}d=a[a.length-1].y-a[a.length-2].y;c=a[a.length-1].x-a[a.length-2].x;b.push({x:a[a.length-1].x-c/e,y:a[a.length-1].y-d/f});b.push({x:a[a.length-1].x,
|
277
279
|
y:a[a.length-1].y});return b},drawBeziers:function(a){var b="",c;for(c=0;c<(a.length-1)/3;c++)b+=this.drawBezierMidpoint(a[3*c],a[3*c+1],a[3*c+2],a[3*c+3]);return b},drawBezierMidpoint:function(a,b,c,d){var e=Math.round,f=this.getPointOnSegment(a,b,0.75),g=this.getPointOnSegment(d,c,0.75),h=(d.x-a.x)/16,k=(d.y-a.y)/16,l=this.getPointOnSegment(a,b,0.375);a=this.getPointOnSegment(f,g,0.375);a.x-=h;a.y-=k;b=this.getPointOnSegment(g,f,0.375);b.x+=h;b.y+=k;c=this.getPointOnSegment(d,c,0.375);h=this.getMiddle(l,
|
@@ -305,22 +307,23 @@ b);f=AmCharts.getUniqueId();b.setAttribute("id",f);if(!isNaN(d)){var g=0,h=0,k=0
|
|
305
307
|
(c=window.location.href+c);e.setAttribute("fill","url("+c+f+")");a.grad=b},pattern:function(a,b,c){var d=a.node;isNaN(c)&&(c=1);var e=a.patternNode;e&&this.D.remove(e);var e=document.createElementNS(AmCharts.SVG_NS,"pattern"),f=AmCharts.getUniqueId(),g=b;b.url&&(g=b.url);var h=Number(b.width);isNaN(h)&&(h=4);var k=Number(b.height);isNaN(k)&&(k=4);h/=c;k/=c;c=b.x;isNaN(c)&&(c=0);var l=-Math.random()*Number(b.randomX);isNaN(l)||(c=l);l=b.y;isNaN(l)&&(l=0);b=-Math.random()*Number(b.randomY);isNaN(b)||
|
306
308
|
(l=b);e.setAttribute("id",f);e.setAttribute("width",h);e.setAttribute("height",k);e.setAttribute("patternUnits","userSpaceOnUse");e.setAttribute("xlink:href",g);this.D.image(g,0,0,h,k,e).translate(c,l);g="#";AmCharts.baseHref&&!AmCharts.isIE&&(g=window.location.href+g);d.setAttribute("fill","url("+g+f+")");a.patternNode=e;d.parentNode.appendChild(e)},remove:function(a){a.clipPath&&this.D.remove(a.clipPath);a.grad&&this.D.remove(a.grad);a.patternNode&&this.D.remove(a.patternNode);this.D.remove(a.node)}});AmCharts.AmDSet=AmCharts.Class({construct:function(a){this.create("g")},attr:function(a){this.R.attr(this.node,a)},move:function(a,b){this.R.move(this.node,a,b)}});AmCharts.AmLegend=AmCharts.Class({construct:function(){this.createEvents("rollOverMarker","rollOverItem","rollOutMarker","rollOutItem","showItem","hideItem","clickMarker","rollOverItem","rollOutItem","clickLabel");this.position="bottom";this.borderColor=this.color="#000000";this.borderAlpha=0;this.markerLabelGap=5;this.verticalGap=10;this.align="left";this.horizontalGap=0;this.spacing=10;this.markerDisabledColor="#AAB3B3";this.markerType="square";this.markerSize=16;this.markerBorderThickness=this.markerBorderAlpha=
|
307
309
|
1;this.marginBottom=this.marginTop=0;this.marginLeft=this.marginRight=20;this.autoMargins=!0;this.valueWidth=50;this.switchable=!0;this.switchType="x";this.switchColor="#FFFFFF";this.rollOverColor="#CC0000";this.reversedOrder=!1;this.labelText="[[title]]";this.valueText="[[value]]";this.useMarkerColorForLabels=!1;this.rollOverGraphAlpha=1;this.textClickEnabled=!1;this.equalWidths=!0;this.dateFormat="DD-MM-YYYY";this.backgroundColor="#FFFFFF";this.backgroundAlpha=0;this.useGraphSettings=!1;this.showEntries=
|
308
|
-
!0},setData:function(a){this.
|
309
|
-
a.marginLeft;var h=a.autoMarginOffset;"bottom"==b?(this.marginBottom=h,this.marginTop=0):(this.marginTop=h,this.marginBottom=0)}c=void 0!==c?AmCharts.toCoordinate(c,d):a.realWidth;"outside"==b?(c=f.offsetWidth,e=f.offsetHeight,f.clientHeight&&(c=f.clientWidth,e=f.clientHeight)):(f.style.width=c+"px",f.className="amChartsLegend");this.divWidth=c;this.container=new AmCharts.AmDraw(f,c,e,a);this.lx=0;this.ly=8;b=this.markerSize;
|
310
|
-
0;if(b=this.title)a=AmCharts.text(this.container,b,this.color,a.fontFamily,this.fontSize,"start",!0),a.translate(this.marginLeft,this.marginTop+this.verticalGap+this.ly+1),a=a.getBBox(),this.titleWidth=a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<g.length;a++)this.createEntry(g[a]);for(a=this.index=0;a<g.length;a++)this.createValue(g[a])}this.arrangeEntries();
|
311
|
-
this.titleWidth,c=this.marginRight,d=this.marginTop,e=this.marginBottom,f=this.horizontalGap,g=this.div,h=this.divWidth,k=this.maxColumns,l=this.verticalGap,m=this.spacing,n=h-c-b,p=0,q=0,u=this.container,r=u.set();this.set=r;u=u.set();r.push(u);var s=this.entries,w,v;for(v=0;v<s.length;v++){w=s[v].getBBox();var t=w.width;t>p&&(p=t);w=w.height;w>q&&(q=w)}var A=t=0,
|
312
|
-
(z=
|
313
|
-
w.width)/2:"right"==this.align&&(b=f+h-w.width);u.translate(b,l+1);this.titleHeight>k&&(k=this.titleHeight);a=k+d+e+1;0>a&&(a=0);g.style.height=Math.round(a)+"px"},createEntry:function(a){if(!1!==a.visibleInLegend){var b=this.chart,c=a.markerType;c||(c=this.markerType);var d=a.color,e=a.alpha;a.legendKeyColor&&(d=a.legendKeyColor());a.legendKeyAlpha&&(e=a.legendKeyAlpha());var f;!0===a.hidden&&(f=d=this.markerDisabledColor);
|
314
|
-
l=this.markerSize,m=0;if(this.useGraphSettings)if(c=a.type,"line"==c||"step"==c||"smoothedLine"==c||"ohlc"==c)this.switchType=void 0,g=k.set(),a.hidden||(d=a.lineColor,f=a.bulletBorderColor),m=AmCharts.line(k,[0,2*l],[l/2,l/2],d,a.lineAlpha,a.lineThickness,a.dashLength),g.push(m),a.bullet&&(a.hidden||(d=a.bulletColor),m=AmCharts.bullet(k,a.bullet,a.bulletSize,d,a.bulletAlpha,a.bulletBorderThickness,f,a.bulletBorderAlpha))&&
|
315
|
-
(g=this.createMarker("square",a.fillColors,a.fillAlphas,a.lineThickness,d,a.lineAlpha,n,g))&&g.translate(l/2,l/2)}else h?(b.path&&(h=b.path+h),g=k.image(h,0,0,l,l)):(g=this.createMarker(c,d,e,void 0,void 0,void 0,void 0,g))&&g.translate(l/2,l/2);this.addListeners(g,a);k=k.set([g]);this.switchable&&k.setAttr("cursor","pointer");if(f=this.switchType)n="x"==f?this.createX():this.createV(),n.dItem=a,!0!==a.hidden?
|
316
|
-
a),a.legendSwitch=n,k.push(n);f=this.color;a.showBalloon&&this.textClickEnabled&&void 0!==this.selectedColor&&(f=this.selectedColor);this.useMarkerColorForLabels&&(f=d);!0===a.hidden&&(f=this.markerDisabledColor);d=AmCharts.massReplace(this.labelText,{"[[title]]":a.title});n=this.fontSize;g&&l<=n&&g.translate(l/2,l/2+this.ly-n/2+(n+2-l)/2);var p;d&&(d=AmCharts.fixNewLines(d),a.legendTextReal=d,p=AmCharts.text(this.container,
|
317
|
-
this.maxLabelWidth<b&&(this.maxLabelWidth=b));this.entries[this.index]=k;a.legendEntry=this.entries[this.index];a.legendLabel=p;this.index++}},addListeners:function(a,b){var c=this;a&&a.mouseover(function(){c.rollOverMarker(b)}).mouseout(function(){c.rollOutMarker(b)}).click(function(){c.clickMarker(b)})},rollOverMarker:function(a){this.switchable&&this.dispatch("rollOverMarker",a);this.dispatch("rollOverItem",
|
318
|
-
a)},clickMarker:function(a){this.switchable?!0===a.hidden?this.dispatch("showItem",a):this.dispatch("hideItem",a):this.textClickEnabled&&this.dispatch("clickMarker",a)},rollOverLabel:function(a){a.hidden||(this.textClickEnabled&&a.legendLabel&&a.legendLabel.attr({fill:this.rollOverColor}),this.dispatch("rollOverItem",a))},rollOutLabel:function(a){if(!a.hidden){if(this.textClickEnabled&&a.legendLabel){var b=
|
319
|
-
(b=a.lineColor,void 0===b&&(b=a.color));a.legendLabel.attr({fill:b})}this.dispatch("rollOutItem",a)}},clickLabel:function(a){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a):this.switchable&&(!0===a.hidden?this.dispatch("showItem",a):this.dispatch("hideItem",a))},dispatch:function(a,b){this.fire(a,{type:a,dataItem:b,target:this,chart:this.chart})},createValue:function(a){var b=
|
320
|
-
b.valueAlign&&(d=a.legendEntry.getBBox().width);var e=d;if(b.valueText){var f=b.color;b.useMarkerColorForValues&&(f=a.color,a.legendKeyColor&&(f=a.legendKeyColor()));!0===a.hidden&&(f=b.markerDisabledColor);var g=b.valueText,d=d+b.lx+b.markerLabelGap+b.valueWidth,h="end";"left"==b.valueAlign&&(d-=b.valueWidth,h="start");f=AmCharts.text(b.container,g,f,b.chart.fontFamily,c,h);f.translate(d,
|
321
|
-
f=b.markerSize;f<c+7&&(f=c+7,AmCharts.VML&&(f+=3));c=b.container.rect(b.markerSize,0,e,f,0,0).attr({stroke:"none",fill:"#ffffff","fill-opacity":0.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(){b.rollOverLabel(a)}).mouseout(function(){b.rollOutLabel(a)}).click(function(){b.clickLabel(a)})}},createV:function(){var a=this.markerSize;return AmCharts.polygon(this.container,
|
322
|
-
"stroke-width":3},c=this.container,d=AmCharts.line(c,[3,a],[3,a]).attr(b),a=AmCharts.line(c,[3,a],[a,3]).attr(b);return this.container.set([d,a])},createMarker:function(a,b,c,d,e,f,g,h){var k=this.markerSize,l=this.container;e||(e=this.markerBorderColor);e||(e=b);isNaN(d)&&(d=this.markerBorderThickness);isNaN(f)&&(f=this.markerBorderAlpha);return AmCharts.bullet(l,a,k,
|
323
|
-
0;c<a.length;c++){var
|
310
|
+
!0},setData:function(a){this.legendData=a;this.invalidateSize()},invalidateSize:function(){this.destroy();this.entries=[];this.valueLabels=[];(AmCharts.ifArray(this.legendData)||AmCharts.ifArray(this.data))&&this.drawLegend()},drawLegend:function(){var a=this.chart,b=this.position,c=this.width,d=a.divRealWidth,e=a.divRealHeight,f=this.div,g=this.legendData;this.data&&(g=this.data);isNaN(this.fontSize)&&(this.fontSize=a.fontSize);if("right"==b||"left"==b)this.maxColumns=1,this.marginLeft=this.marginRight=
|
311
|
+
10;else if(this.autoMargins){this.marginRight=a.marginRight;this.marginLeft=a.marginLeft;var h=a.autoMarginOffset;"bottom"==b?(this.marginBottom=h,this.marginTop=0):(this.marginTop=h,this.marginBottom=0)}c=void 0!==c?AmCharts.toCoordinate(c,d):a.realWidth;"outside"==b?(c=f.offsetWidth,e=f.offsetHeight,f.clientHeight&&(c=f.clientWidth,e=f.clientHeight)):(f.style.width=c+"px",f.className="amChartsLegend");this.divWidth=c;this.container=new AmCharts.AmDraw(f,c,e,a);this.lx=0;this.ly=8;b=this.markerSize;
|
312
|
+
b>this.fontSize&&(this.ly=b/2-1);0<b&&(this.lx+=b+this.markerLabelGap);this.titleWidth=0;if(b=this.title)a=AmCharts.text(this.container,b,this.color,a.fontFamily,this.fontSize,"start",!0),a.translate(this.marginLeft,this.marginTop+this.verticalGap+this.ly+1),a=a.getBBox(),this.titleWidth=a.width+15,this.titleHeight=a.height+6;this.index=this.maxLabelWidth=0;if(this.showEntries){for(a=0;a<g.length;a++)this.createEntry(g[a]);for(a=this.index=0;a<g.length;a++)this.createValue(g[a])}this.arrangeEntries();
|
313
|
+
this.updateValues()},arrangeEntries:function(){var a=this.position,b=this.marginLeft+this.titleWidth,c=this.marginRight,d=this.marginTop,e=this.marginBottom,f=this.horizontalGap,g=this.div,h=this.divWidth,k=this.maxColumns,l=this.verticalGap,m=this.spacing,n=h-c-b,p=0,q=0,u=this.container,r=u.set();this.set=r;u=u.set();r.push(u);var s=this.entries,w,v;for(v=0;v<s.length;v++){w=s[v].getBBox();var t=w.width;t>p&&(p=t);w=w.height;w>q&&(q=w)}var A=t=0,F=f;for(v=0;v<s.length;v++){var x=s[v];this.reversedOrder&&
|
314
|
+
(x=s[s.length-v-1]);w=x.getBBox();var z;this.equalWidths?z=f+A*(p+m+this.markerLabelGap):(z=F,F=F+w.width+f+m);z+w.width>n&&0<v&&0!==A&&(t++,A=0,z=f,F=z+w.width+f+m);x.translate(z,(q+l)*t);A++;!isNaN(k)&&A>=k&&(A=0,t++);u.push(x)}w=u.getBBox();k=w.height+2*l-1;"left"==a||"right"==a?(h=w.width+2*f,g.style.width=h+b+c+"px"):h=h-b-c-1;c=AmCharts.polygon(this.container,[0,h,h,0],[0,0,k,k],this.backgroundColor,this.backgroundAlpha,1,this.borderColor,this.borderAlpha);r.push(c);r.translate(b,d);c.toBack();
|
315
|
+
b=f;if("top"==a||"bottom"==a||"absolute"==a||"outside"==a)"center"==this.align?b=f+(h-w.width)/2:"right"==this.align&&(b=f+h-w.width);u.translate(b,l+1);this.titleHeight>k&&(k=this.titleHeight);a=k+d+e+1;0>a&&(a=0);g.style.height=Math.round(a)+"px"},createEntry:function(a){if(!1!==a.visibleInLegend){var b=this.chart,c=a.markerType;c||(c=this.markerType);var d=a.color,e=a.alpha;a.legendKeyColor&&(d=a.legendKeyColor());a.legendKeyAlpha&&(e=a.legendKeyAlpha());var f;!0===a.hidden&&(f=d=this.markerDisabledColor);
|
316
|
+
var g=a.pattern,h=a.customMarker;h||(h=this.customMarker);var k=this.container,l=this.markerSize,m=0;if(this.useGraphSettings)if(c=a.type,"line"==c||"step"==c||"smoothedLine"==c||"ohlc"==c)this.switchType=void 0,g=k.set(),a.hidden||(d=a.lineColor,f=a.bulletBorderColor),m=AmCharts.line(k,[0,2*l],[l/2,l/2],d,a.lineAlpha,a.lineThickness,a.dashLength),g.push(m),a.bullet&&(a.hidden||(d=a.bulletColor),m=AmCharts.bullet(k,a.bullet,a.bulletSize,d,a.bulletAlpha,a.bulletBorderThickness,f,a.bulletBorderAlpha))&&
|
317
|
+
(m.translate(l+1,l/2),g.push(m)),m=l;else{var n;a.getGradRotation&&(n=a.getGradRotation());(g=this.createMarker("square",a.fillColors,a.fillAlphas,a.lineThickness,d,a.lineAlpha,n,g))&&g.translate(l/2,l/2)}else h?(b.path&&(h=b.path+h),g=k.image(h,0,0,l,l)):(g=this.createMarker(c,d,e,void 0,void 0,void 0,void 0,g))&&g.translate(l/2,l/2);this.addListeners(g,a);k=k.set([g]);this.switchable&&k.setAttr("cursor","pointer");if(f=this.switchType)n="x"==f?this.createX():this.createV(),n.dItem=a,!0!==a.hidden?
|
318
|
+
"x"==f?n.hide():n.show():"x"!=f&&n.hide(),this.switchable||n.hide(),this.addListeners(n,a),a.legendSwitch=n,k.push(n);f=this.color;a.showBalloon&&this.textClickEnabled&&void 0!==this.selectedColor&&(f=this.selectedColor);this.useMarkerColorForLabels&&(f=d);!0===a.hidden&&(f=this.markerDisabledColor);d=AmCharts.massReplace(this.labelText,{"[[title]]":a.title});n=this.fontSize;g&&l<=n&&g.translate(l/2,l/2+this.ly-n/2+(n+2-l)/2);var p;d&&(d=AmCharts.fixNewLines(d),a.legendTextReal=d,p=AmCharts.text(this.container,
|
319
|
+
d,f,b.fontFamily,n,"start"),p.translate(this.lx+m,this.ly),k.push(p),b=p.getBBox().width,this.maxLabelWidth<b&&(this.maxLabelWidth=b));this.entries[this.index]=k;a.legendEntry=this.entries[this.index];a.legendLabel=p;this.index++}},addListeners:function(a,b){var c=this;a&&a.mouseover(function(){c.rollOverMarker(b)}).mouseout(function(){c.rollOutMarker(b)}).click(function(){c.clickMarker(b)})},rollOverMarker:function(a){this.switchable&&this.dispatch("rollOverMarker",a);this.dispatch("rollOverItem",
|
320
|
+
a)},rollOutMarker:function(a){this.switchable&&this.dispatch("rollOutMarker",a);this.dispatch("rollOutItem",a)},clickMarker:function(a){this.switchable?!0===a.hidden?this.dispatch("showItem",a):this.dispatch("hideItem",a):this.textClickEnabled&&this.dispatch("clickMarker",a)},rollOverLabel:function(a){a.hidden||(this.textClickEnabled&&a.legendLabel&&a.legendLabel.attr({fill:this.rollOverColor}),this.dispatch("rollOverItem",a))},rollOutLabel:function(a){if(!a.hidden){if(this.textClickEnabled&&a.legendLabel){var b=
|
321
|
+
this.color;void 0!==this.selectedColor&&a.showBalloon&&(b=this.selectedColor);this.useMarkerColorForLabels&&(b=a.lineColor,void 0===b&&(b=a.color));a.legendLabel.attr({fill:b})}this.dispatch("rollOutItem",a)}},clickLabel:function(a){this.textClickEnabled?a.hidden||this.dispatch("clickLabel",a):this.switchable&&(!0===a.hidden?this.dispatch("showItem",a):this.dispatch("hideItem",a))},dispatch:function(a,b){this.fire(a,{type:a,dataItem:b,target:this,chart:this.chart})},createValue:function(a){var b=
|
322
|
+
this,c=b.fontSize;if(!1!==a.visibleInLegend){var d=b.maxLabelWidth;b.equalWidths||(b.valueAlign="left");"left"==b.valueAlign&&(d=a.legendEntry.getBBox().width);var e=d;if(b.valueText){var f=b.color;b.useMarkerColorForValues&&(f=a.color,a.legendKeyColor&&(f=a.legendKeyColor()));!0===a.hidden&&(f=b.markerDisabledColor);var g=b.valueText,d=d+b.lx+b.markerLabelGap+b.valueWidth,h="end";"left"==b.valueAlign&&(d-=b.valueWidth,h="start");f=AmCharts.text(b.container,g,f,b.chart.fontFamily,c,h);f.translate(d,
|
323
|
+
b.ly);b.entries[b.index].push(f);e+=b.valueWidth+2*b.markerLabelGap;f.dItem=a;b.valueLabels.push(f)}b.index++;f=b.markerSize;f<c+7&&(f=c+7,AmCharts.VML&&(f+=3));c=b.container.rect(b.markerSize,0,e,f,0,0).attr({stroke:"none",fill:"#ffffff","fill-opacity":0.005});c.dItem=a;b.entries[b.index-1].push(c);c.mouseover(function(){b.rollOverLabel(a)}).mouseout(function(){b.rollOutLabel(a)}).click(function(){b.clickLabel(a)})}},createV:function(){var a=this.markerSize;return AmCharts.polygon(this.container,
|
324
|
+
[a/5,a/2,a-a/5,a/2],[a/3,a-a/5,a/5,a/1.7],this.switchColor)},createX:function(){var a=this.markerSize-3,b={stroke:this.switchColor,"stroke-width":3},c=this.container,d=AmCharts.line(c,[3,a],[3,a]).attr(b),a=AmCharts.line(c,[3,a],[a,3]).attr(b);return this.container.set([d,a])},createMarker:function(a,b,c,d,e,f,g,h){var k=this.markerSize,l=this.container;e||(e=this.markerBorderColor);e||(e=b);isNaN(d)&&(d=this.markerBorderThickness);isNaN(f)&&(f=this.markerBorderAlpha);return AmCharts.bullet(l,a,k,
|
325
|
+
b,c,d,e,f,k,g,h)},validateNow:function(){this.invalidateSize()},updateValues:function(){var a=this.valueLabels,b=this.chart,c,d=this.data;for(c=0;c<a.length;c++){var e=a[c],f=e.dItem,g=" ";if(d)f.value?e.text(f.value):e.text("");else{if(void 0!==f.type){var h=f.currentDataItem,k=this.periodValueText;f.legendPeriodValueText&&(k=f.legendPeriodValueText);h?(g=this.valueText,f.legendValueText&&(g=f.legendValueText),g=b.formatString(g,h)):k&&(g=b.formatPeriodString(k,f))}else g=b.formatString(this.valueText,
|
326
|
+
f);(h=f.legendLabel)&&h.text(f.legendTextReal);e.text(g)}}},renderFix:function(){if(!AmCharts.VML){var a=this.container;a&&a.renderFix()}},destroy:function(){this.div.innerHTML="";AmCharts.remove(this.set)}});AmCharts.formatMilliseconds=function(a,b){if(-1!=a.indexOf("fff")){var c=b.getMilliseconds(),d=String(c);10>c&&(d="00"+c);10<=c&&100>c&&(d="0"+c);a=a.replace(/fff/g,d)}return a};AmCharts.extractPeriod=function(a){var b=AmCharts.stripNumbers(a),c=1;b!=a&&(c=Number(a.slice(0,a.indexOf(b))));return{period:b,count:c}};
|
324
327
|
AmCharts.resetDateToMin=function(a,b,c,d){void 0===d&&(d=1);var e,f,g,h,k,l,m;AmCharts.useUTC?(e=a.getUTCFullYear(),f=a.getUTCMonth(),g=a.getUTCDate(),h=a.getUTCHours(),k=a.getUTCMinutes(),l=a.getUTCSeconds(),m=a.getUTCMilliseconds(),a=a.getUTCDay()):(e=a.getFullYear(),f=a.getMonth(),g=a.getDate(),h=a.getHours(),k=a.getMinutes(),l=a.getSeconds(),m=a.getMilliseconds(),a=a.getDay());switch(b){case "YYYY":e=Math.floor(e/c)*c;f=0;g=1;m=l=k=h=0;break;case "MM":f=Math.floor(f/c)*c;g=1;m=l=k=h=0;break;case "WW":0===
|
325
328
|
a&&0<d&&(a=7);g=g-a+d;m=l=k=h=0;break;case "DD":m=l=k=h=0;break;case "hh":h=Math.floor(h/c)*c;m=l=k=0;break;case "mm":k=Math.floor(k/c)*c;m=l=0;break;case "ss":l=Math.floor(l/c)*c;m=0;break;case "fff":m=Math.floor(m/c)*c}AmCharts.useUTC?(a=new Date,a.setUTCFullYear(e,f,g),a.setUTCHours(h,k,l,m)):a=new Date(e,f,g,h,k,l,m);return a};
|
326
329
|
AmCharts.getPeriodDuration=function(a,b){void 0===b&&(b=1);var c;switch(a){case "YYYY":c=316224E5;break;case "MM":c=26784E5;break;case "WW":c=6048E5;break;case "DD":c=864E5;break;case "hh":c=36E5;break;case "mm":c=6E4;break;case "ss":c=1E3;break;case "fff":c=1}return c*b};AmCharts.intervals={s:{nextInterval:"ss",contains:1E3},ss:{nextInterval:"mm",contains:60,count:0},mm:{nextInterval:"hh",contains:60,count:1},hh:{nextInterval:"DD",contains:24,count:2},DD:{nextInterval:"",contains:Infinity,count:3}};
|
@@ -333,5 +336,5 @@ AmCharts.formatDate=function(a,b){var c,d,e,f,g,h,k,l,m=AmCharts.getWeekNumber(a
|
|
333
336
|
m&&(m=0);var r=m;10>r&&(r="0"+r);b=b.replace(/JJ/g,r);b=b.replace(/J/g,m);m=g;0===m&&(m=24);r=m;10>r&&(r="0"+r);b=b.replace(/HH/g,r);b=b.replace(/H/g,m);m=g;11<m&&(m-=12);r=m;10>r&&(r="0"+r);b=b.replace(/KK/g,r);b=b.replace(/K/g,m);m=g;0===m&&(m=12);12<m&&(m-=12);r=m;10>r&&(r="0"+r);b=b.replace(/LL/g,r);b=b.replace(/L/g,m);m=h;10>m&&(m="0"+m);b=b.replace(/NN/g,m);b=b.replace(/N/g,h);h=k;10>h&&(h="0"+h);b=b.replace(/SS/g,h);b=b.replace(/S/g,k);k=l;10>k&&(k="00"+k);100>k&&(k="0"+k);h=l;10>h&&(h="00"+
|
334
337
|
h);b=b.replace(/QQQ/g,k);b=b.replace(/QQ/g,h);b=b.replace(/Q/g,l);b=12>g?b.replace(/A/g,"am"):b.replace(/A/g,"pm");b=b.replace(/YYYY/g,"@IIII@");b=b.replace(/YY/g,"@II@");b=b.replace(/MMMM/g,"@XXXX@");b=b.replace(/MMM/g,"@XXX@");b=b.replace(/MM/g,"@XX@");b=b.replace(/M/g,"@X@");b=b.replace(/DD/g,"@RR@");b=b.replace(/D/g,"@R@");b=b.replace(/EEEE/g,"@PPPP@");b=b.replace(/EEE/g,"@PPP@");b=b.replace(/EE/g,"@PP@");b=b.replace(/E/g,"@P@");b=b.replace(/@IIII@/g,c);b=b.replace(/@II@/g,n);b=b.replace(/@XXXX@/g,
|
335
338
|
AmCharts.monthNames[d]);b=b.replace(/@XXX@/g,AmCharts.shortMonthNames[d]);b=b.replace(/@XX@/g,p);b=b.replace(/@X@/g,d+1);b=b.replace(/@RR@/g,q);b=b.replace(/@R@/g,e);b=b.replace(/@PPPP@/g,AmCharts.dayNames[f]);b=b.replace(/@PPP@/g,AmCharts.shortDayNames[f]);b=b.replace(/@PP@/g,u);return b=b.replace(/@P@/g,f)};
|
336
|
-
AmCharts.changeDate=function(a,b,c,d,e){var f=-1;void 0===d&&(d=!0);void 0===e&&(e=!1);!0===d&&(f=1);switch(b){case "YYYY":a.setFullYear(a.getFullYear()+c*f);d||e||a.setDate(a.getDate()+1);break;case "MM":b=a.getMonth();a.setMonth(a.getMonth()+c*f);a.getMonth()>b+c*f&&a.setDate(a.getDate()-1);d||e||a.setDate(a.getDate()+1);break;case "DD":a.setDate(a.getDate()+c*f);break;case "WW":a.setDate(a.getDate()+
|
339
|
+
AmCharts.changeDate=function(a,b,c,d,e){var f=-1;void 0===d&&(d=!0);void 0===e&&(e=!1);!0===d&&(f=1);switch(b){case "YYYY":a.setFullYear(a.getFullYear()+c*f);d||e||a.setDate(a.getDate()+1);break;case "MM":b=a.getMonth();a.setMonth(a.getMonth()+c*f);a.getMonth()>b+c*f&&a.setDate(a.getDate()-1);d||e||a.setDate(a.getDate()+1);break;case "DD":a.setDate(a.getDate()+c*f);break;case "WW":a.setDate(a.getDate()+c*f*7);break;case "hh":a.setHours(a.getHours()+c*f);break;case "mm":a.setMinutes(a.getMinutes()+
|
337
340
|
c*f);break;case "ss":a.setSeconds(a.getSeconds()+c*f);break;case "fff":a.setMilliseconds(a.getMilliseconds()+c*f)}return a};
|