amcharts.rb 3.2.0.1 → 3.2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +1 -1
- data/amcharts.rb.gemspec +4 -0
- data/lib/amcharts/chart_builder.rb +1 -0
- data/lib/amcharts/version.rb +1 -1
- data/lib/tasks/amcharts.thor +87 -0
- data/vendor/assets/javascripts/amcharts/amcharts.js +311 -305
- data/vendor/assets/javascripts/amcharts/changeLog.txt +149 -99
- data/vendor/assets/javascripts/amcharts/exporting/amexport.js +330 -288
- data/vendor/assets/javascripts/amcharts/funnel.js +7 -7
- data/vendor/assets/javascripts/amcharts/gauge.js +17 -17
- data/vendor/assets/javascripts/amcharts/pie.js +9 -9
- data/vendor/assets/javascripts/amcharts/radar.js +5 -5
- data/vendor/assets/javascripts/amcharts/serial.js +41 -41
- data/vendor/assets/javascripts/amcharts/xy.js +17 -17
- metadata +59 -2
@@ -1,7 +1,7 @@
|
|
1
|
-
AmCharts.AmFunnelChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(){AmCharts.AmFunnelChart.base.construct.call(this);this.startX=this.startY=0;this.baseWidth="100%";this.neckHeight=this.neckWidth=0;this.rotate=!1;this.valueRepresents="height";this.pullDistance=30;this.labelPosition="center";this.labelText="[[title]]: [[value]]";this.balloonText="[[title]]: [[value]]\n[[description]]"},drawChart:function(){AmCharts.AmFunnelChart.base.drawChart.call(this);
|
2
|
-
if(AmCharts.ifArray(
|
3
|
-
f-n,
|
4
|
-
|
5
|
-
0<q.length&&l.gradient("linearGradient",q);c.pattern&&l.pattern(c.pattern)}0<A&&(l=this.startAlpha,this.chartCreated&&(l=c.alpha),d.setAttr("opacity",l));this.addEventListeners(d,c);this.labelsEnabled&&this.labelText&&c.percents>=this.hideLabelsPercent&&(h=this.formatString(this.labelText,c),q=c.labelColor,q||(q=this.color),l=this.labelPosition,e="left","center"==l&&(e="middle"),"left"==l&&(e="right"),h=AmCharts.text(
|
6
|
-
2,c.ty0=e,e<
|
7
|
-
c.ty0}}this.arrangeLabels();this.initialStart();(
|
1
|
+
AmCharts.AmFunnelChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(r){this.chartType="funnel";AmCharts.AmFunnelChart.base.construct.call(this,r);this.startX=this.startY=0;this.baseWidth="100%";this.neckHeight=this.neckWidth=0;this.rotate=!1;this.valueRepresents="height";this.pullDistance=30;this.labelPosition="center";this.labelText="[[title]]: [[value]]";this.balloonText="[[title]]: [[value]]\n[[description]]";AmCharts.applyTheme(this,r,"AmFunnelChart")},drawChart:function(){AmCharts.AmFunnelChart.base.drawChart.call(this);
|
2
|
+
var r=this.chartData;if(AmCharts.ifArray(r))if(0<this.realWidth&&0<this.realHeight){var s=this.container,A=this.startDuration,k=this.rotate,v=this.updateWidth();this.realWidth=v;var f=this.updateHeight();this.realHeight=f;var n=AmCharts.toCoordinate,B=n(this.marginLeft,v),u=n(this.marginRight,v),a=n(this.marginTop,f)+this.getTitleHeight(),n=n(this.marginBottom,f),u=v-B-u,w=AmCharts.toCoordinate(this.baseWidth,u),p=AmCharts.toCoordinate(this.neckWidth,u),C=f-n-a,x=AmCharts.toCoordinate(this.neckHeight,
|
3
|
+
C),t=a+C-x;k&&(a=f-n,t=a-C+x);this.firstSliceY=a;AmCharts.VML&&(this.startAlpha=1);for(var g=u/2+B,D=(C-x)/((w-p)/2),y=w/2,w=(C-x)*(w+p)/2+p*x,x=a,F=0,E=0;E<r.length;E++){var c=r[E];if(!0!==c.hidden){var l=[],h=[],b;if("height"==this.valueRepresents)b=C*c.percents/100;else{var m=-w*c.percents/100/2,z=y,d=-1/(2*D);b=Math.pow(z,2)-4*d*m;0>b&&(b=0);b=(Math.sqrt(b)-z)/(2*d);if(!k&&a>=t||k&&a<=t)b=2*-m/p;else if(!k&&a+b>t||k&&a-b<t)d=k?Math.round(b+(a-b-t)):Math.round(b-(a+b-t)),b=d/D,b=d+2*(-m-(z-b/2)*
|
4
|
+
d)/p}m=y-b/D;z=!1;!k&&a+b>t||k&&a-b<t?(m=p/2,l.push(g-y,g+y,g+m,g+m,g-m,g-m),k?(d=b+(a-b-t),h.push(a,a,a-d,a-b,a-b,a-d,a)):(d=b-(a+b-t),h.push(a,a,a+d,a+b,a+b,a+d,a)),z=!0):(l.push(g-y,g+y,g+m,g-m),k?h.push(a,a,a-b,a-b):h.push(a,a,a+b,a+b));s.set();d=s.set();l=AmCharts.polygon(s,l,h,c.color,c.alpha,this.outlineThickness,this.outlineColor,this.outlineAlpha);d.push(l);this.graphsSet.push(d);c.wedge=d;c.index=E;if(h=this.gradientRatio){var q=[],e;for(e=0;e<h.length;e++)q.push(AmCharts.adjustLuminosity(c.color,
|
5
|
+
h[e]));0<q.length&&l.gradient("linearGradient",q);c.pattern&&l.pattern(c.pattern)}0<A&&(l=this.startAlpha,this.chartCreated&&(l=c.alpha),d.setAttr("opacity",l));this.addEventListeners(d,c);this.labelsEnabled&&this.labelText&&c.percents>=this.hideLabelsPercent&&(h=this.formatString(this.labelText,c),q=c.labelColor,q||(q=this.color),l=this.labelPosition,e="left","center"==l&&(e="middle"),"left"==l&&(e="right"),h=AmCharts.text(s,h,q,this.fontFamily,this.fontSize,e),d.push(h),q=g,k?(e=a-b/2,c.ty0=e):
|
6
|
+
(e=a+b/2,c.ty0=e,e<x+F+5&&(e=x+F+5),e>f-n&&(e=f-n)),"right"==l&&(q=u+10+B,c.tx0=g+(y-b/2/D),z&&(c.tx0=g+m)),"left"==l&&(c.tx0=g-(y-b/2/D),z&&(c.tx0=g-m),q=B),c.label=h,c.labelX=q,c.labelY=e,c.labelHeight=h.getBBox().height,h.translate(q,e),(0===c.alpha||0<A&&!this.chartCreated)&&d.hide(),a=k?a-b:a+b,y=m,F=h.getBBox().height,x=e);c.startX=AmCharts.toCoordinate(this.startX,v);c.startY=AmCharts.toCoordinate(this.startY,f);c.pullX=AmCharts.toCoordinate(this.pullDistance,v);c.pullY=0;c.balloonX=g;c.balloonY=
|
7
|
+
c.ty0}}this.arrangeLabels();this.initialStart();(r=this.legend)&&r.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},arrangeLabels:function(){var r=this.rotate,s;s=r?0:this.realHeight;for(var A=0,k=this.chartData,v=k.length,f,n=0;n<v;n++){f=k[v-n-1];var B=f.label,u=f.labelY,a=f.labelX,w=f.labelHeight,p=u;r?s+A+5>u&&(p=s+A+5):u+w+5>s&&(p=s-5-w);s=p;A=w;B.translate(a,p);f.labelY=p;f.tx=a;f.ty=p;f.tx2=a}"center"!=this.labelPosition&&this.drawTicks()}});
|
@@ -1,17 +1,17 @@
|
|
1
|
-
AmCharts.GaugeAxis=AmCharts.Class({construct:function(){this.radius="95%";this.startAngle=-120;this.endAngle=120;this.startValue=0;this.endValue=200;this.valueInterval=20;this.minorTickInterval=5;this.tickLength=10;this.minorTickLength=5;this.tickColor="#555555";this.labelFrequency=this.tickThickness=this.tickAlpha=1;this.inside=!0;this.labelOffset=15;this.showLastLabel=this.showFirstLabel=!0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridInside=!0;this.topText="";this.topTextYOffset=
|
2
|
-
0;this.topTextBold=!0;this.bottomText="";this.bottomTextYOffset=0;this.bottomTextBold=!0;this.centerY=this.centerX="0%";this.bandOutlineAlpha=this.bandOutlineThickness=0;this.bandOutlineColor="#000000";this.bandAlpha=1},value2angle:function(a){return this.startAngle+this.singleValueAngle*a},setTopText:function(a){this.topText=a;var b=this.chart;if(this.axisCreated){this.topTF&&this.topTF.remove();var d=this.topTextFontSize;d||(d=b.fontSize);var c=this.topTextColor;
|
3
|
-
a,c,b.fontFamily,d,void 0,this.topTextBold);a.translate(this.centerXReal,this.centerYReal-this.radiusReal/2+this.topTextYOffset);this.chart.graphsSet.push(a);this.topTF=a}},setBottomText:function(a){this.bottomText=a;var b=this.chart;if(this.axisCreated){this.bottomTF&&this.bottomTF.remove();var d=this.bottomTextFontSize;d||(d=b.fontSize);var c=this.bottomTextColor;c||(c=b.color);b=this.chart;a=AmCharts.text(b.container,a,c,b.fontFamily,d,void 0,
|
4
|
-
this.radiusReal/2+this.bottomTextYOffset);this.bottomTF=a;this.chart.graphsSet.push(a)}},draw:function(){var a=this.chart,b=a.graphsSet,d=this.startValue,c=this.valueInterval,
|
5
|
-
AmCharts.toCoordinate(this.centerX,a.realWidth),x=a.centerY+AmCharts.toCoordinate(this.centerY,a.realHeight);this.centerXReal=w;this.centerYReal=x;var
|
6
|
-
180*Math.PI)),A=g(w+(q-h)*Math.sin(
|
7
|
-
Math.sin(y/180*Math.PI)),t=g(x-z*Math.cos(y/180*Math.PI)),A=g(w+(z-E)*Math.sin(y/180*Math.PI)),y=g(x-(z-E)*Math.cos(y/180*Math.PI)),v=AmCharts.line(e,[v,A],[t,y],p,u,B,0,!1,!1,!0),b.push(v)}if(b=this.bands)for(d=0;d<b.length;d++)if(c=b[d])p=c.startValue,u=c.endValue,h=AmCharts.toCoordinate(c.radius,q),isNaN(h)&&(h=z),k=AmCharts.toCoordinate(c.innerRadius,q),isNaN(k)&&(k=h-E),f=
|
8
|
-
D=c.outlineAlpha,isNaN(D)&&(D=this.bandOutlineAlpha),p=c.alpha,isNaN(p)&&(p=this.bandAlpha),c=AmCharts.wedge(e,w,x,f,u,h,h,k,0,{fill:c.color,stroke:B,"stroke-width":C,"stroke-opacity":D}),c.setAttr("opacity",p),a.gridSet.push(c);this.axisCreated=!0;this.setTopText(this.topText);this.setBottomText(this.bottomText);a=a.graphsSet.getBBox();this.width=a.width;this.height=a.height}});AmCharts.GaugeArrow=AmCharts.Class({construct:function(){this.color="#000000";this.nailAlpha=this.alpha=1;this.startWidth=this.nailRadius=8;this.borderAlpha=1;this.radius="90%";this.nailBorderAlpha=this.innerRadius=0;this.nailBorderThickness=1;this.frame=0},setValue:function(a){var b=this.chart;b?b.setValue(this,a):this.previousValue=this.value=a}});AmCharts.GaugeBand=AmCharts.Class({construct:function(){}});AmCharts.AmAngularGauge=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(){AmCharts.AmAngularGauge.base.construct.call(this);this.minRadius=this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=10;this.faceColor="#FAFAFA";this.faceAlpha=0;this.faceBorderWidth=1;this.faceBorderColor="#555555";this.faceBorderAlpha=0;this.arrows=[];this.axes=[];this.startDuration=1;this.startEffect=">";this.adjustSize=!0;this.extraHeight=this.extraWidth=
|
9
|
-
formatString:function(a,b){return a=AmCharts.formatValue(a,b,["value"],this.numberFormatter,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers)},initChart:function(){AmCharts.AmAngularGauge.base.initChart.call(this);
|
10
|
-
AmCharts.GaugeArrow);a.chart=this;d[b]=a;var c=a.axis;AmCharts.isString(c)&&(a.axis=AmCharts.getObjById(this.axes,c));a.axis||(a.axis=this.axes[0]);isNaN(a.value)&&a.setValue(a.axis.startValue);isNaN(a.previousValue)&&(a.previousValue=a.axis.startValue)}this.setLegendData(d);this.drawChart();this.totalFrames=1E3*this.startDuration/AmCharts.updateRate},drawChart:function(){AmCharts.AmAngularGauge.base.drawChart.call(this);
|
11
|
-
this.realHeight=d;var c=AmCharts.toCoordinate,
|
12
|
-
e;if(0<b||0<d)e=AmCharts.circle(a,f,this.faceColor,b,this.faceBorderWidth,this.faceBorderColor,d,!1),e.translate(this.centerX,this.centerY),e.toBack();for(b=f=a=0;b<this.axes.length;b++)d=this.axes[b],d.radiusReal=AmCharts.toCoordinate(d.radius,this.radiusReal),d.draw(),d.width>a&&(a=d.width),d.height>f&&(f=d.height);(b=this.legend)&&b.invalidateSize();if(this.adjustSize&&!this.chartCreated){e&&(e=e.getBBox(),e.width>a&&(a=e.width),
|
13
|
-
(this.extraHeight=
|
14
|
-
a.set=d.set();if(!a.hidden){var c=a.axis,
|
15
|
-
90)/180*Math.PI),d=AmCharts.polygon(d,[g-k/2*e+f*c,g+
|
16
|
-
a.hidden=!0},showArrow:function(a){a.set.show();a.hidden=!1},updateAnimations:function(){AmCharts.AmAngularGauge.base.updateAnimations.call(this);for(var a=this.arrows.length,b,d=0;d<a;d++){b=this.arrows[d];var c;b.frame>=this.totalFrames?c=b.value:(b.frame++,b.clockWiseOnly&&b.value<b.previousValue&&(c=b.axis,b.previousValue-=c.endValue-c.startValue),c=AmCharts.getEffect(this.startEffect),
|
17
|
-
this.drawArrow(b,c)}}});
|
1
|
+
AmCharts.GaugeAxis=AmCharts.Class({construct:function(a){this.radius="95%";this.startAngle=-120;this.endAngle=120;this.startValue=0;this.endValue=200;this.valueInterval=20;this.minorTickInterval=5;this.tickLength=10;this.minorTickLength=5;this.tickColor="#555555";this.labelFrequency=this.tickThickness=this.tickAlpha=1;this.inside=!0;this.labelOffset=15;this.showLastLabel=this.showFirstLabel=!0;this.axisThickness=1;this.axisColor="#000000";this.axisAlpha=1;this.gridInside=!0;this.topText="";this.topTextYOffset=
|
2
|
+
0;this.topTextBold=!0;this.bottomText="";this.bottomTextYOffset=0;this.bottomTextBold=!0;this.centerY=this.centerX="0%";this.bandOutlineAlpha=this.bandOutlineThickness=0;this.bandOutlineColor="#000000";this.bandAlpha=1;AmCharts.applyTheme(this,a,"GaugeAxis")},value2angle:function(a){return this.startAngle+this.singleValueAngle*a},setTopText:function(a){this.topText=a;var b=this.chart;if(this.axisCreated){this.topTF&&this.topTF.remove();var d=this.topTextFontSize;d||(d=b.fontSize);var c=this.topTextColor;
|
3
|
+
c||(c=b.color);b=this.chart;a=AmCharts.text(b.container,a,c,b.fontFamily,d,void 0,this.topTextBold);a.translate(this.centerXReal,this.centerYReal-this.radiusReal/2+this.topTextYOffset);this.chart.graphsSet.push(a);this.topTF=a}},setBottomText:function(a){this.bottomText=a;var b=this.chart;if(this.axisCreated){this.bottomTF&&this.bottomTF.remove();var d=this.bottomTextFontSize;d||(d=b.fontSize);var c=this.bottomTextColor;c||(c=b.color);b=this.chart;a=AmCharts.text(b.container,a,c,b.fontFamily,d,void 0,
|
4
|
+
this.bottomTextBold);a.translate(this.centerXReal,this.centerYReal+this.radiusReal/2+this.bottomTextYOffset);this.bottomTF=a;this.chart.graphsSet.push(a)}},draw:function(){var a=this.chart,b=a.graphsSet,d=this.startValue,c=this.valueInterval,m=this.startAngle,g=this.endAngle,h=this.tickLength,k=(this.endValue-d)/c+1,f=(g-m)/(k-1),n=f/c;this.singleValueAngle=n;var e=a.container,p=this.tickColor,u=this.tickAlpha,B=this.tickThickness,C=c/this.minorTickInterval,D=f/C,E=this.minorTickLength,F=this.labelFrequency,
|
5
|
+
q=this.radiusReal;this.inside||(q-=15);var w=a.centerX+AmCharts.toCoordinate(this.centerX,a.realWidth),x=a.centerY+AmCharts.toCoordinate(this.centerY,a.realHeight);this.centerXReal=w;this.centerYReal=x;var G={fill:this.axisColor,"fill-opacity":this.axisAlpha,"stroke-width":0,"stroke-opacity":0},l,z;this.gridInside?z=l=q:(l=q-h,z=l+E);var r=this.axisThickness/2,g=AmCharts.wedge(e,w,x,m,g-m,l+r,l+r,l-r,0,G);b.push(g);g=AmCharts.doNothing;AmCharts.isModern||(g=Math.round);G=AmCharts.getDecimals(c);for(l=
|
6
|
+
0;l<k;l++){var s=d+l*c,r=m+l*f,v=g(w+q*Math.sin(r/180*Math.PI)),t=g(x-q*Math.cos(r/180*Math.PI)),A=g(w+(q-h)*Math.sin(r/180*Math.PI)),y=g(x-(q-h)*Math.cos(r/180*Math.PI)),v=AmCharts.line(e,[v,A],[t,y],p,u,B,0,!1,!1,!0);b.push(v);t=this.labelOffset;this.inside||(t=-t-h);v=w+(q-h-t)*Math.sin(r/180*Math.PI);t=x-(q-h-t)*Math.cos(r/180*Math.PI);A=this.fontSize;isNaN(A)&&(A=a.fontSize);0<F&&l/F==Math.round(l/F)&&(this.showLastLabel||l!=k-1)&&(this.showFirstLabel||0!==l)&&(s=AmCharts.formatNumber(s,a.numberFormatter,
|
7
|
+
G),s=AmCharts.text(e,s,a.color,a.fontFamily,A),s.translate(v,t),b.push(s));if(l<k-1)for(s=1;s<C;s++)y=r+D*s,v=g(w+z*Math.sin(y/180*Math.PI)),t=g(x-z*Math.cos(y/180*Math.PI)),A=g(w+(z-E)*Math.sin(y/180*Math.PI)),y=g(x-(z-E)*Math.cos(y/180*Math.PI)),v=AmCharts.line(e,[v,A],[t,y],p,u,B,0,!1,!1,!0),b.push(v)}if(b=this.bands)for(d=0;d<b.length;d++)if(c=b[d])p=c.startValue,u=c.endValue,h=AmCharts.toCoordinate(c.radius,q),isNaN(h)&&(h=z),k=AmCharts.toCoordinate(c.innerRadius,q),isNaN(k)&&(k=h-E),f=m+n*p,
|
8
|
+
u=n*(u-p),B=c.outlineColor,void 0==B&&(B=this.bandOutlineColor),C=c.outlineThickness,isNaN(C)&&(C=this.bandOutlineThickness),D=c.outlineAlpha,isNaN(D)&&(D=this.bandOutlineAlpha),p=c.alpha,isNaN(p)&&(p=this.bandAlpha),c=AmCharts.wedge(e,w,x,f,u,h,h,k,0,{fill:c.color,stroke:B,"stroke-width":C,"stroke-opacity":D}),c.setAttr("opacity",p),a.gridSet.push(c);this.axisCreated=!0;this.setTopText(this.topText);this.setBottomText(this.bottomText);a=a.graphsSet.getBBox();this.width=a.width;this.height=a.height}});AmCharts.GaugeArrow=AmCharts.Class({construct:function(a){this.color="#000000";this.nailAlpha=this.alpha=1;this.startWidth=this.nailRadius=8;this.borderAlpha=1;this.radius="90%";this.nailBorderAlpha=this.innerRadius=0;this.nailBorderThickness=1;this.frame=0;AmCharts.applyTheme(this,a,"GaugeArrow")},setValue:function(a){var b=this.chart;b?b.setValue(this,a):this.previousValue=this.value=a}});AmCharts.GaugeBand=AmCharts.Class({construct:function(){}});AmCharts.AmAngularGauge=AmCharts.Class({inherits:AmCharts.AmChart,construct:function(a){this.theme=a;this.chartType="gauge";AmCharts.AmAngularGauge.base.construct.call(this,a);this.minRadius=this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=10;this.faceColor="#FAFAFA";this.faceAlpha=0;this.faceBorderWidth=1;this.faceBorderColor="#555555";this.faceBorderAlpha=0;this.arrows=[];this.axes=[];this.startDuration=1;this.startEffect=">";this.adjustSize=!0;this.extraHeight=this.extraWidth=
|
9
|
+
0;this.clockWiseOnly=!1;AmCharts.applyTheme(this,a,"AmAngularGauge")},addAxis:function(a){this.axes.push(a)},formatString:function(a,b){return a=AmCharts.formatValue(a,b,["value"],this.numberFormatter,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers)},initChart:function(){AmCharts.AmAngularGauge.base.initChart.call(this);var a;0===this.axes.length&&(a=new AmCharts.GaugeAxis(this.theme),this.addAxis(a));var b;for(b=0;b<this.axes.length;b++)a=this.axes[b],a=AmCharts.processObject(a,
|
10
|
+
AmCharts.GaugeAxis,this.theme),a.chart=this,this.axes[b]=a;var d=this.arrows;for(b=0;b<d.length;b++){a=d[b];a=AmCharts.processObject(a,AmCharts.GaugeArrow,this.theme);a.chart=this;d[b]=a;var c=a.axis;AmCharts.isString(c)&&(a.axis=AmCharts.getObjById(this.axes,c));a.axis||(a.axis=this.axes[0]);isNaN(a.value)&&a.setValue(a.axis.startValue);isNaN(a.previousValue)&&(a.previousValue=a.axis.startValue)}this.setLegendData(d);this.drawChart();this.totalFrames=1E3*this.startDuration/AmCharts.updateRate},drawChart:function(){AmCharts.AmAngularGauge.base.drawChart.call(this);
|
11
|
+
var a=this.container,b=this.updateWidth();this.realWidth=b;var d=this.updateHeight();this.realHeight=d;var c=AmCharts.toCoordinate,m=c(this.marginLeft,b),g=c(this.marginRight,b),h=c(this.marginTop,d)+this.getTitleHeight(),k=c(this.marginBottom,d),f=c(this.radius,b,d),c=b-m-g,n=d-h-k+this.extraHeight;f||(f=Math.min(c,n)/2);f<this.minRadius&&(f=this.minRadius);this.radiusReal=f;this.centerX=(b-m-g)/2+m;this.centerY=(d-h-k)/2+h+this.extraHeight/2;isNaN(this.gaugeX)||(this.centerX=this.gaugeX);isNaN(this.gaugeY)||
|
12
|
+
(this.centerY=this.gaugeY);var b=this.faceAlpha,d=this.faceBorderAlpha,e;if(0<b||0<d)e=AmCharts.circle(a,f,this.faceColor,b,this.faceBorderWidth,this.faceBorderColor,d,!1),e.translate(this.centerX,this.centerY),e.toBack();for(b=f=a=0;b<this.axes.length;b++)d=this.axes[b],d.radiusReal=AmCharts.toCoordinate(d.radius,this.radiusReal),d.draw(),d.width>a&&(a=d.width),d.height>f&&(f=d.height);(b=this.legend)&&b.invalidateSize();if(this.adjustSize&&!this.chartCreated){e&&(e=e.getBBox(),e.width>a&&(a=e.width),
|
13
|
+
e.height>f&&(f=e.height));e=0;if(n>f||c>a)e=Math.min(n-f,c-a);0<e&&(this.extraHeight=n-f,this.chartCreated=!0,this.validateNow())}this.dispDUpd();this.chartCreated=!0},validateSize:function(){this.extraHeight=this.extraWidth=0;this.chartCreated=!1;AmCharts.AmAngularGauge.base.validateSize.call(this)},addArrow:function(a){this.arrows.push(a)},removeArrow:function(a){AmCharts.removeFromArray(this.arrows,a);this.validateNow()},removeAxis:function(a){AmCharts.removeFromArray(this.axes,a);this.validateNow()},
|
14
|
+
drawArrow:function(a,b){a.set&&a.set.remove();var d=this.container;a.set=d.set();if(!a.hidden){var c=a.axis,m=c.radiusReal,g=c.centerXReal,h=c.centerYReal,k=a.startWidth,f=AmCharts.toCoordinate(a.innerRadius,c.radiusReal),n=AmCharts.toCoordinate(a.radius,c.radiusReal);c.inside||(n-=15);var e=a.nailColor;e||(e=a.color);var p=a.nailColor;p||(p=a.color);e=AmCharts.circle(d,a.nailRadius,e,a.nailAlpha,a.nailBorderThickness,e,a.nailBorderAlpha);a.set.push(e);e.translate(g,h);isNaN(n)&&(n=m-c.tickLength);
|
15
|
+
var c=Math.sin(b/180*Math.PI),m=Math.cos(b/180*Math.PI),e=Math.sin((b+90)/180*Math.PI),u=Math.cos((b+90)/180*Math.PI),d=AmCharts.polygon(d,[g-k/2*e+f*c,g+n*c,g+k/2*e+f*c],[h+k/2*u-f*m,h-n*m,h-k/2*u-f*m],a.color,a.alpha,1,p,a.borderAlpha,void 0,!0);a.set.push(d);this.graphsSet.push(a.set)}},setValue:function(a,b){a.axis&&(a.axis.value2angle(b),a.frame=0,a.previousValue=a.value);a.value=b;var d=this.legend;d&&d.updateValues()},handleLegendEvent:function(a){var b=a.type;a=a.dataItem;if(!this.legend.data&&
|
16
|
+
a)switch(b){case "hideItem":this.hideArrow(a);break;case "showItem":this.showArrow(a)}},hideArrow:function(a){a.set.hide();a.hidden=!0},showArrow:function(a){a.set.show();a.hidden=!1},updateAnimations:function(){AmCharts.AmAngularGauge.base.updateAnimations.call(this);for(var a=this.arrows.length,b,d=0;d<a;d++){b=this.arrows[d];var c;b.frame>=this.totalFrames?c=b.value:(b.frame++,b.clockWiseOnly&&b.value<b.previousValue&&(c=b.axis,b.previousValue-=c.endValue-c.startValue),c=AmCharts.getEffect(this.startEffect),
|
17
|
+
c=AmCharts[c](0,b.frame,b.previousValue,b.value-b.previousValue,this.totalFrames),isNaN(c)&&(c=b.value));c=b.axis.value2angle(c);this.drawArrow(b,c)}}});
|
@@ -1,9 +1,9 @@
|
|
1
|
-
AmCharts.AmPieChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(){AmCharts.AmPieChart.base.construct.call(this);this.pieBrightnessStep=30;this.minRadius=10;this.depth3D=0;this.startAngle=90;this.angle=this.innerRadius=0;this.startRadius="500%";this.pullOutRadius="20%";this.labelRadius=30;this.labelText="[[title]]: [[percents]]%";this.balloonText="[[title]]: [[percents]]% ([[value]])\n[[description]]";this.previousScale=1
|
2
|
-
var e=this.chartData;if(AmCharts.ifArray(e)){if(0<this.realWidth&&0<this.realHeight){AmCharts.VML&&(this.startAlpha=1);var g=this.startDuration,c=this.container,a=this.updateWidth();this.realWidth=a;var h=this.updateHeight();this.realHeight=h;var d=AmCharts.toCoordinate,k=d(this.marginLeft,a),b=d(this.marginRight,a),q=d(this.marginTop,h)+this.getTitleHeight(),l=d(this.marginBottom,h),w,
|
3
|
-
void 0===this.pieX?(a-k-b)/2+k:d(this.pieX,this.realWidth);
|
4
|
-
(l=270<=l?270:90);l-=90;a=f-f*this.angle/90;for(k=0;k<e.length;k++)if(b=e[k],!0!==b.hidden&&0<b.percents){var
|
5
|
-
this.
|
6
|
-
m=AmCharts.text(c,m,B,this.fontFamily,this.fontSize,
|
7
|
-
this.pieXReal=
|
8
|
-
c,0,!0,0);for(a=0;a<g;a++)c=e[a],1!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,1,!1,0);for(a=g-1;0<=a;a--)c=e[a],2!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,2,!0,0);for(a=0;a<g;a++)c=e[a],3!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,3,!1,0)},checkOverlapping:function(e,g,c,a,h){var d,k,b=this.chartData,q=b.length,l=g.label;if(l){if(!0===a)for(k=e+1;k<q;k++)b[k].labelQuarter==c&&(d=this.checkOverlappingReal(g,
|
9
|
-
c&&(d=this.checkOverlappingReal(g,b[k],c))&&(k=0);!0===d&&100>h&&(d=g.ty+3*g.iy,g.ty=d,l.translate(g.tx2,d),this.checkOverlapping(e,g,c,a,h+1))}},checkOverlappingReal:function(e,g,c){var a=!1,h=e.label,d=g.label;e.labelQuarter!=c||e.hidden||g.hidden||!d||(h=h.getBBox(),c={},c.width=h.width,c.height=h.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},d.width=e.width,d.height=e.height,d.y=g.ty,d.x=g.tx,AmCharts.hitTest(c,d)&&(a=!0));return a}});
|
1
|
+
AmCharts.AmPieChart=AmCharts.Class({inherits:AmCharts.AmSlicedChart,construct:function(e){this.className="AmPieChart";this.chartType="pie";AmCharts.AmPieChart.base.construct.call(this,e);this.pieBrightnessStep=30;this.minRadius=10;this.depth3D=0;this.startAngle=90;this.angle=this.innerRadius=0;this.startRadius="500%";this.pullOutRadius="20%";this.labelRadius=30;this.labelText="[[title]]: [[percents]]%";this.balloonText="[[title]]: [[percents]]% ([[value]])\n[[description]]";this.previousScale=1;AmCharts.applyTheme(this,
|
2
|
+
e,"AmPieChart")},drawChart:function(){AmCharts.AmPieChart.base.drawChart.call(this);var e=this.chartData;if(AmCharts.ifArray(e)){if(0<this.realWidth&&0<this.realHeight){AmCharts.VML&&(this.startAlpha=1);var g=this.startDuration,c=this.container,a=this.updateWidth();this.realWidth=a;var h=this.updateHeight();this.realHeight=h;var d=AmCharts.toCoordinate,k=d(this.marginLeft,a),b=d(this.marginRight,a),q=d(this.marginTop,h)+this.getTitleHeight(),l=d(this.marginBottom,h),v,w,f,s=AmCharts.toNumber(this.labelRadius),
|
3
|
+
r=this.measureMaxLabel();this.labelText&&this.labelsEnabled||(s=r=0);v=void 0===this.pieX?(a-k-b)/2+k:d(this.pieX,this.realWidth);w=void 0===this.pieY?(h-q-l)/2+q:d(this.pieY,h);f=d(this.radius,a,h);f||(a=0<=s?a-k-b-2*r:a-k-b,h=h-q-l,f=Math.min(a,h),h<a&&(f/=1-this.angle/90,f>a&&(f=a)),h=AmCharts.toCoordinate(this.pullOutRadius,f),f=(0<=s?f-1.8*(s+h):f-1.8*h)/2);f<this.minRadius&&(f=this.minRadius);h=d(this.pullOutRadius,f);q=AmCharts.toCoordinate(this.startRadius,f);d=d(this.innerRadius,f);d>=f&&
|
4
|
+
(d=f-1);l=AmCharts.fitToBounds(this.startAngle,0,360);0<this.depth3D&&(l=270<=l?270:90);l-=90;a=f-f*this.angle/90;for(k=0;k<e.length;k++)if(b=e[k],!0!==b.hidden&&0<b.percents){var p=360*b.percents/100,r=Math.sin((l+p/2)/180*Math.PI),x=-Math.cos((l+p/2)/180*Math.PI)*(a/f),n=this.outlineColor;n||(n=b.color);n={fill:b.color,stroke:n,"stroke-width":this.outlineThickness,"stroke-opacity":this.outlineAlpha,"fill-opacity":this.alpha};b.url&&(n.cursor="pointer");n=AmCharts.wedge(c,v,w,l,p,f,a,d,this.depth3D,
|
5
|
+
n,this.gradientRatio,b.pattern);this.addEventListeners(n,b);b.startAngle=l;e[k].wedge=n;b.ix=r;b.iy=x;b.wedge=n;b.index=k;if(this.labelsEnabled&&this.labelText&&b.percents>=this.hideLabelsPercent){var m=l+p/2,p=s;isNaN(b.labelRadius)||(p=b.labelRadius);var A=v+r*(f+p),t=w+x*(f+p),y,u=0;if(0<=p){var z;90>=m&&0<=m?(z=0,y="start",u=8):90<=m&&180>m?(z=1,y="start",u=8):180<=m&&270>m?(z=2,y="end",u=-8):270<=m&&360>m&&(z=3,y="end",u=-8);b.labelQuarter=z}else y="middle";var m=this.formatString(this.labelText,
|
6
|
+
b),B=b.labelColor;B||(B=this.color);m=AmCharts.text(c,m,B,this.fontFamily,this.fontSize,y);m.translate(A+1.5*u,t);b.tx=A+1.5*u;b.ty=t;t=d+(f-d)/2;b.pulled&&(t+=this.pullOutRadiusReal);b.balloonX=r*t+v;b.balloonY=x*t+w;0<=p?n.push(m):this.freeLabelsSet.push(m);b.label=m;b.tx=A;b.tx2=A+u;b.tx0=v+r*f;b.ty0=w+x*f}b.startX=Math.round(r*q);b.startY=Math.round(x*q);b.pullX=Math.round(r*h);b.pullY=Math.round(x*h);this.graphsSet.push(n);(0===b.alpha||0<g&&!this.chartCreated)&&n.hide();l+=360*b.percents/100}0<
|
7
|
+
s&&!this.labelRadiusField&&this.arrangeLabels();this.pieXReal=v;this.pieYReal=w;this.radiusReal=f;this.innerRadiusReal=d;0<s&&this.drawTicks();this.initialStart();this.setDepths()}(e=this.legend)&&e.invalidateSize()}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},setDepths:function(){var e=this.chartData,g;for(g=0;g<e.length;g++){var c=e[g],a=c.wedge,c=c.startAngle;0<=c&&180>c?a.toFront():180<=c&&a.toBack()}},arrangeLabels:function(){var e=this.chartData,g=e.length,c,a;for(a=g-1;0<=a;a--)c=
|
8
|
+
e[a],0!==c.labelQuarter||c.hidden||this.checkOverlapping(a,c,0,!0,0);for(a=0;a<g;a++)c=e[a],1!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,1,!1,0);for(a=g-1;0<=a;a--)c=e[a],2!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,2,!0,0);for(a=0;a<g;a++)c=e[a],3!=c.labelQuarter||c.hidden||this.checkOverlapping(a,c,3,!1,0)},checkOverlapping:function(e,g,c,a,h){var d,k,b=this.chartData,q=b.length,l=g.label;if(l){if(!0===a)for(k=e+1;k<q;k++)b[k].labelQuarter==c&&(d=this.checkOverlappingReal(g,
|
9
|
+
b[k],c))&&(k=q);else for(k=e-1;0<=k;k--)b[k].labelQuarter==c&&(d=this.checkOverlappingReal(g,b[k],c))&&(k=0);!0===d&&100>h&&(d=g.ty+3*g.iy,g.ty=d,l.translate(g.tx2,d),this.checkOverlapping(e,g,c,a,h+1))}},checkOverlappingReal:function(e,g,c){var a=!1,h=e.label,d=g.label;e.labelQuarter!=c||e.hidden||g.hidden||!d||(h=h.getBBox(),c={},c.width=h.width,c.height=h.height,c.y=e.ty,c.x=e.tx,e=d.getBBox(),d={},d.width=e.width,d.height=e.height,d.y=g.ty,d.x=g.tx,AmCharts.hitTest(c,d)&&(a=!0));return a}});
|
@@ -1,8 +1,8 @@
|
|
1
|
-
AmCharts.AmRadarChart=AmCharts.Class({inherits:AmCharts.AmCoordinateChart,construct:function(){AmCharts.AmRadarChart.base.construct.call(this);this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=0;this.
|
2
|
-
this.chartData},updateGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.index=b;c.width=this.realRadius;c.height=this.realRadius;c.x=this.marginLeftReal;c.y=this.marginTopReal;c.chartType=this.chartType}},parseData:function(){AmCharts.AmRadarChart.base.parseData.call(this);this.parseSerialData()},updateValueAxes:function(){var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b];c.axisRenderer=AmCharts.RadAxis;c.guideFillRenderer=
|
3
|
-
c.autoGridCount=!1;c.x=this.marginLeftReal;c.y=this.marginTopReal;c.width=this.realRadius;c.height=this.realRadius}},drawChart:function(){AmCharts.AmRadarChart.base.drawChart.call(this);var a=this.updateWidth(),b=this.updateHeight(),c=this.marginTop+this.getTitleHeight(),d=this.marginLeft,b=b-c-this.marginBottom;this.marginLeftReal=d+(a-d-this.marginRight)/2;this.marginTopReal=c+b/2;this.realRadius=AmCharts.toCoordinate(this.radius,a,b);this.updateValueAxes();
|
4
|
-
if(AmCharts.ifArray(a)){if(0<this.realWidth&&0<this.realHeight){a=a.length-1;d=this.valueAxes;for(c=0;c<d.length;c++)d[c].zoom(0,a);d=this.graphs;for(c=0;c<d.length;c++)d[c].zoom(0,a);(a=this.legend)&&a.invalidateSize()}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},formatString:function(a,b){var c=b.graph;-1!=a.indexOf("[[category]]")&&(a=a.replace(/\[\[category\]\]/g,String(b.serialDataItem.category)));c=c.numberFormatter;c||(c=this.numberFormatter);
|
5
|
-
["value"],c,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,b.dataContext));return a=AmCharts.AmRadarChart.base.formatString.call(this,a,b)},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs])}});AmCharts.RadAxis=AmCharts.Class({construct:function(a){var b=a.chart,c=a.axisThickness,d=a.axisColor,m=a.axisAlpha,n=a.x,e=a.y;this.set=b.container.set();b.axesSet.push(this.set);var f=a.axisTitleOffset,k=a.radarCategoriesEnabled,l=a.chart.fontFamily,h=a.fontSize;void 0===h&&(h=a.chart.fontSize);var q=a.color;void 0===q&&(q=a.chart.color);if(b){this.axisWidth=a.height;a=b.chartData;var w=a.length,r;for(r=0;r<w;r++){var g=180-360/w*r,p=n+this.axisWidth*Math.sin(g/180*Math.PI),s=e+this.axisWidth*Math.cos(g/
|
1
|
+
AmCharts.AmRadarChart=AmCharts.Class({inherits:AmCharts.AmCoordinateChart,construct:function(a){this.chartType="radar";AmCharts.AmRadarChart.base.construct.call(this,a);this.marginRight=this.marginBottom=this.marginTop=this.marginLeft=0;this.radius="35%";AmCharts.applyTheme(this,a,"AmRadarChart")},initChart:function(){AmCharts.AmRadarChart.base.initChart.call(this);this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);this.drawChart()},updateData:function(){this.parseData();
|
2
|
+
var a=this.graphs,b;for(b=0;b<a.length;b++)a[b].data=this.chartData},updateGraphs:function(){var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.index=b;c.width=this.realRadius;c.height=this.realRadius;c.x=this.marginLeftReal;c.y=this.marginTopReal;c.chartType=this.chartType}},parseData:function(){AmCharts.AmRadarChart.base.parseData.call(this);this.parseSerialData()},updateValueAxes:function(){var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=a[b];c.axisRenderer=AmCharts.RadAxis;c.guideFillRenderer=
|
3
|
+
AmCharts.RadarFill;c.axisItemRenderer=AmCharts.RadItem;c.autoGridCount=!1;c.x=this.marginLeftReal;c.y=this.marginTopReal;c.width=this.realRadius;c.height=this.realRadius}},drawChart:function(){AmCharts.AmRadarChart.base.drawChart.call(this);var a=this.updateWidth(),b=this.updateHeight(),c=this.marginTop+this.getTitleHeight(),d=this.marginLeft,b=b-c-this.marginBottom;this.marginLeftReal=d+(a-d-this.marginRight)/2;this.marginTopReal=c+b/2;this.realRadius=AmCharts.toCoordinate(this.radius,a,b);this.updateValueAxes();
|
4
|
+
this.updateGraphs();a=this.chartData;if(AmCharts.ifArray(a)){if(0<this.realWidth&&0<this.realHeight){a=a.length-1;d=this.valueAxes;for(c=0;c<d.length;c++)d[c].zoom(0,a);d=this.graphs;for(c=0;c<d.length;c++)d[c].zoom(0,a);(a=this.legend)&&a.invalidateSize()}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},formatString:function(a,b){var c=b.graph;-1!=a.indexOf("[[category]]")&&(a=a.replace(/\[\[category\]\]/g,String(b.serialDataItem.category)));c=c.numberFormatter;c||(c=this.numberFormatter);
|
5
|
+
a=AmCharts.formatValue(a,b.values,["value"],c,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,b.dataContext));return a=AmCharts.AmRadarChart.base.formatString.call(this,a,b)},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs])}});AmCharts.RadAxis=AmCharts.Class({construct:function(a){var b=a.chart,c=a.axisThickness,d=a.axisColor,m=a.axisAlpha,n=a.x,e=a.y;this.set=b.container.set();b.axesSet.push(this.set);var f=a.axisTitleOffset,k=a.radarCategoriesEnabled,l=a.chart.fontFamily,h=a.fontSize;void 0===h&&(h=a.chart.fontSize);var q=a.color;void 0===q&&(q=a.chart.color);if(b){this.axisWidth=a.height;a=b.chartData;var w=a.length,r;for(r=0;r<w;r++){var g=180-360/w*r,p=n+this.axisWidth*Math.sin(g/180*Math.PI),s=e+this.axisWidth*Math.cos(g/
|
6
6
|
180*Math.PI);0<m&&(p=AmCharts.line(b.container,[n,p],[e,s],d,m,c),this.set.push(p));if(k){var u="start",p=n+(this.axisWidth+f)*Math.sin(g/180*Math.PI),s=e+(this.axisWidth+f)*Math.cos(g/180*Math.PI);if(180==g||0===g)u="middle",p-=5;0>g&&(u="end",p-=10);180==g&&(s-=5);0===g&&(s+=5);g=AmCharts.text(b.container,a[r].category,q,l,h,u);g.translate(p+5,s);this.set.push(g);g.getBBox()}}}}});AmCharts.RadItem=AmCharts.Class({construct:function(a,b,c,d,m,n,e){void 0===c&&(c="");var f=a.chart.fontFamily,k=a.fontSize;void 0===k&&(k=a.chart.fontSize);var l=a.color;void 0===l&&(l=a.chart.color);var h=a.chart.container;this.set=d=h.set();var q=a.axisColor,w=a.axisAlpha,r=a.tickLength,g=a.gridAlpha,p=a.gridThickness,s=a.gridColor,u=a.dashLength,A=a.fillColor,y=a.fillAlpha,B=a.labelsEnabled;m=a.counter;var C=a.inside,D=a.gridType,t;b-=a.height;var x;n=a.x;var E=a.y;e?(B=!0,isNaN(e.tickLength)||
|
7
7
|
(r=e.tickLength),void 0!=e.lineColor&&(s=e.lineColor),isNaN(e.lineAlpha)||(g=e.lineAlpha),isNaN(e.dashLength)||(u=e.dashLength),isNaN(e.lineThickness)||(p=e.lineThickness),!0===e.inside&&(C=!0)):c||(g/=3,r/=2);var F="end",z=-1;C&&(F="start",z=1);var v;B&&(v=AmCharts.text(h,c,l,f,k,F),v.translate(n+(r+3)*z,b),d.push(v),this.label=v,x=AmCharts.line(h,[n,n+r*z],[b,b],q,w,p),d.push(x));b=Math.round(a.y-b);f=[];k=[];if(0<g){if("polygons"==D){t=a.data.length;for(l=0;l<t;l++)q=180-360/t*l,f.push(b*Math.sin(q/
|
8
8
|
180*Math.PI)),k.push(b*Math.cos(q/180*Math.PI));f.push(f[0]);k.push(k[0]);g=AmCharts.line(h,f,k,s,g,p,u)}else g=AmCharts.circle(h,b,"#FFFFFF",0,p,s,g);g.translate(n,E);d.push(g)}if(1==m&&0<y&&!e&&""!==c){e=a.previousCoord;if("polygons"==D){for(l=t;0<=l;l--)q=180-360/t*l,f.push(e*Math.sin(q/180*Math.PI)),k.push(e*Math.cos(q/180*Math.PI));t=AmCharts.polygon(h,f,k,A,y)}else t=AmCharts.wedge(h,0,0,0,360,b,b,e,0,{fill:A,"fill-opacity":y,stroke:"#000","stroke-opacity":0,"stroke-width":1});d.push(t);t.translate(n,
|
@@ -1,46 +1,46 @@
|
|
1
|
-
AmCharts.AmSerialChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(){AmCharts.AmSerialChart.base.construct.call(this);this.createEvents("changed");this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=0.8;this.updateScrollbar=!0;var
|
2
|
-
this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);var a=this.chartCursor;a&&a.updateData();var a=this.countColumns(),b=this.graphs,c;for(c=0;c<b.length;c++)b[c].columnCount=a;this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=!0,
|
3
|
-
|
4
|
-
this.start,c=this.end,isNaN(b)||isNaN(c))b=0,c=a;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(b,c)}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor])},updateCategoryAxis:function(a,b,c){a.chart=this;a.id=c;a.rotate=b;a.axisRenderer=
|
5
|
-
a.x=this.marginLeftReal;a.y=this.marginTopReal;a.dx=this.dx;a.dy=this.dy;a.width=this.plotAreaWidth-1;a.height=this.plotAreaHeight-1;a.viW=this.plotAreaWidth-1;a.viH=this.plotAreaHeight-1;a.viX=this.marginLeftReal;a.viY=this.marginTopReal;a.marginsChanged=!0},updateValueAxes:function(){AmCharts.AmSerialChart.base.updateValueAxes.call(this);var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=
|
6
|
-
!0}},updateData:function(){this.parseData();var a=this.graphs,b,c=this.chartData;for(b=0;b<a.length;b++)a[b].data=c;0<c.length&&(this.firstTime=this.getStartTime(c[0].time),this.lastTime=this.getEndTime(c[c.length-1].time))},getStartTime:function(a){var b=this.categoryAxis;return AmCharts.resetDateToMin(new Date(a),b.minPeriod,1,b.firstDayOfWeek).getTime()},getEndTime:function(a){var b=
|
7
|
-
1},updateMargins:function(){AmCharts.AmSerialChart.base.updateMargins.call(this);var a=this.chartScrollbar;a&&(this.getScrollbarPosition(a,this.rotate,this.categoryAxis.position),this.adjustMargins(a,this.rotate))},updateScrollbars:function(){AmCharts.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate)},zoom:function(a,b){var c=
|
8
|
-
this.maxSelectedTime;isNaN(c)||(b!=this.endTime&&b-a>c&&(a=b-c,this.updateScrollbar=!0),a!=this.startTime&&b-a>c&&(b=a+c,this.updateScrollbar=!0));var d=this.minSelectedTime;if(0<d&&b-a<d){var e=Math.round(a+(b-a)/2),d=Math.round(d/2);a=e-d;b=e+d}var g=this.chartData,e=this.categoryAxis;if(AmCharts.ifArray(g)&&(a!=this.startTime||b!=this.endTime)){var k=e.minDuration(),
|
9
|
-
k/5&&(b<
|
10
|
-
|
11
|
-
var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.columnWidthReal=this.columnWidth;c.categoryAxis=this.categoryAxis}},updateColumnsDepth:function(){var a,b=this.graphs,c;AmCharts.remove(this.columnsSet);this.columnsArray=[];for(a=0;a<b.length;a++){c=b[a];var d=c.columnsArray;if(d){var e;for(e=0;e<d.length;e++)this.columnsArray.push(d[e])}}this.columnsArray.sort(this.compareDepth);
|
12
|
-
c&&b.translate(c.x,c.y);this.columnsSet=b}},compareDepth:function(a,b){return a.depth>b.depth?1:-1},zoomScrollbar:function(){var a=this.chartScrollbar,b=this.categoryAxis;a&&this.updateScrollbar&&(b.parseDates&&!b.equalSpacing?a.timeZoom(this.startTime,this.endTime):a.zoom(this.start,this.end),this.updateScrollbar=!0)},updateTrendLines:function(){var a=
|
13
|
-
(c.valueAxis=this.getValueAxisById(c.valueAxis));c.valueAxis||(c.valueAxis=this.valueAxes[0]);c.categoryAxis=this.categoryAxis}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var a=this.valueAxes,b;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);a=this.graphs;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);this.zoomTrendLines();
|
14
|
-
d,e,g=!1,k,
|
15
|
-
this.parseSerialData()},getCategoryIndexByValue:function(a){var b=this.chartData,c,d;for(d=0;d<b.length;d++)b[d].category==a&&(c=d);return c},handleCursorChange:function(a){this.updateLegendValues(a.index)},handleCursorZoom:function(a){this.updateScrollbar=!0;this.zoom(a.start,a.end)},handleScrollbarZoom:function(a){this.updateScrollbar
|
16
|
-
new Date(this.startTime);a.endDate=new Date(this.endTime);a.startIndex=this.start;a.endIndex=this.end;this.startIndex=this.start;this.endIndex=this.end;this.startDate=a.startDate;this.endDate=a.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var b=this.categoryAxis,c=AmCharts.extractPeriod(b.minPeriod).period,
|
17
|
-
dispatchIndexZoomEvent:function(){if(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end){this.startIndex=this.start;this.endIndex=this.end;var a=this.chartData;if(AmCharts.ifArray(a)&&!isNaN(this.start)&&!isNaN(this.end)){var b={chart:this,target:this,type:"zoomed"};b.startIndex=this.start;b.endIndex=this.end;b.startValue=a[this.start].category;
|
18
|
-
b.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(b.type,b)}}},updateLegendValues:function(a){var b=this.graphs,c;for(c=0;c<b.length;c++){var d=b[c];isNaN(a)?d.currentDataItem=void 0:d.currentDataItem=this.chartData[a].axes[d.valueAxis.id].graphs[d.id]}this.legend&&this.legend.updateValues()},
|
19
|
-
c)<Math.abs(d-c)?e:g}return c==
|
20
|
-
|
21
|
-
c[
|
22
|
-
k,l+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=AmCharts.formatValue(a,w,d,this.percentFormatter,"percents\\."+l+"\\.")}}return a},formatString:function(a,b){var c=b.graph;if(-1!=a.indexOf("[[category]]")){var d=b.serialDataItem.category;if(this.categoryAxis.parseDates){var e=this.balloonDateFormat,
|
23
|
-
d)),d=e)}a=a.replace(/\[\[category\]\]/g,String(d))}c=c.numberFormatter;c||(c=this.numberFormatter);d=b.graph.valueAxis;(e=d.duration)&&!isNaN(b.values.value)&&(d=AmCharts.formatDuration(b.values.value,e,"",d.durationUnits,d.maxInterval,c),a=a.replace(RegExp("\\[\\[value\\]\\]","g"),d));d="value open low high close total".split(" ");
|
24
|
-
a=AmCharts.formatValue(a,b.values,["percents"],e);-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,b.dataContext));return a=AmCharts.AmSerialChart.base.formatString.call(this,a,b)},addChartScrollbar:function(a){AmCharts.callMethod("destroy",[this.chartScrollbar]);a&&(a.chart=this,this.listenTo(a,"zoomed",
|
25
|
-
[this.chartScrollbar]);this.chartScrollbar=null},handleReleaseOutside:function(a){AmCharts.AmSerialChart.base.handleReleaseOutside.call(this,a);AmCharts.callMethod("handleReleaseOutside",[this.chartScrollbar])}});AmCharts.Cuboid=AmCharts.Class({construct:function(a,b,c,d,e,g,k,
|
26
|
-
this.dy,k=this.colors,
|
27
|
-
g),0<f&&(t=AmCharts.line(b,[e,e],[g,g+d],h,1,l,p)),v=AmCharts.polygon(b,[0,0,e,e,0],[0,d,d+g,g,0],w,
|
28
|
-
0],[0,d],h,f,l,p):0<u?AmCharts.rect(b,c,d,k,
|
1
|
+
AmCharts.AmSerialChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(a){this.className="AmSerialChart";this.chartType="serial";AmCharts.AmSerialChart.base.construct.call(this,a);this.theme=a;this.createEvents("changed");this.columnSpacing=5;this.columnSpacing3D=0;this.columnWidth=0.8;this.updateScrollbar=!0;var b=new AmCharts.CategoryAxis(a);b.chart=this;this.categoryAxis=b;this.zoomOutOnDataUpdate=!0;this.mouseWheelScrollEnabled=this.rotate=this.skipZoom=!1;this.minSelectedTime=
|
2
|
+
0;AmCharts.applyTheme(this,a,"AmSerialChart")},initChart:function(){AmCharts.AmSerialChart.base.initChart.call(this);this.updateCategoryAxis(this.categoryAxis,this.rotate,"categoryAxis");this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);var a=this.chartCursor;a&&a.updateData();var a=this.countColumns(),b=this.graphs,c;for(c=0;c<b.length;c++)b[c].columnCount=a;this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=!0,
|
3
|
+
this.measureMargins());this.mouseWheelScrollEnabled&&this.addMouseWheel()},validateData:function(a){this.marginsUpdated=!1;this.zoomOutOnDataUpdate&&!a&&(this.endTime=this.end=this.startTime=this.start=NaN);AmCharts.AmSerialChart.base.validateData.call(this)},drawChart:function(){AmCharts.AmSerialChart.base.drawChart.call(this);var a=this.chartData;if(AmCharts.ifArray(a)){var b=this.chartScrollbar;b&&b.draw();if(0<this.realWidth&&0<this.realHeight){var a=a.length-1,c,b=this.categoryAxis;if(b.parseDates&&
|
4
|
+
!b.equalSpacing){if(b=this.startTime,c=this.endTime,isNaN(b)||isNaN(c))b=this.firstTime,c=this.lastTime}else if(b=this.start,c=this.end,isNaN(b)||isNaN(c))b=0,c=a;this.endTime=this.startTime=this.end=this.start=void 0;this.zoom(b,c)}}else this.cleanChart();this.dispDUpd();this.chartCreated=!0},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.categoryAxis,this.chartScrollbar,this.chartCursor])},updateCategoryAxis:function(a,b,c){a.chart=this;a.id=c;a.rotate=b;a.axisRenderer=
|
5
|
+
AmCharts.RecAxis;a.guideFillRenderer=AmCharts.RecFill;a.axisItemRenderer=AmCharts.RecItem;a.setOrientation(!this.rotate);a.x=this.marginLeftReal;a.y=this.marginTopReal;a.dx=this.dx;a.dy=this.dy;a.width=this.plotAreaWidth-1;a.height=this.plotAreaHeight-1;a.viW=this.plotAreaWidth-1;a.viH=this.plotAreaHeight-1;a.viX=this.marginLeftReal;a.viY=this.marginTopReal;a.marginsChanged=!0},updateValueAxes:function(){AmCharts.AmSerialChart.base.updateValueAxes.call(this);var a=this.valueAxes,b;for(b=0;b<a.length;b++){var c=
|
6
|
+
a[b],d=this.rotate;c.rotate=d;c.setOrientation(d);d=this.categoryAxis;if(!d.startOnAxis||d.parseDates)c.expandMinMax=!0}},updateData:function(){this.parseData();var a=this.graphs,b,c=this.chartData;for(b=0;b<a.length;b++)a[b].data=c;0<c.length&&(this.firstTime=this.getStartTime(c[0].time),this.lastTime=this.getEndTime(c[c.length-1].time))},getStartTime:function(a){var b=this.categoryAxis;return AmCharts.resetDateToMin(new Date(a),b.minPeriod,1,b.firstDayOfWeek).getTime()},getEndTime:function(a){var b=
|
7
|
+
AmCharts.extractPeriod(this.categoryAxis.minPeriod);return AmCharts.changeDate(new Date(a),b.period,b.count,!0).getTime()-1},updateMargins:function(){AmCharts.AmSerialChart.base.updateMargins.call(this);var a=this.chartScrollbar;a&&(this.getScrollbarPosition(a,this.rotate,this.categoryAxis.position),this.adjustMargins(a,this.rotate))},updateScrollbars:function(){AmCharts.AmSerialChart.base.updateScrollbars.call(this);this.updateChartScrollbar(this.chartScrollbar,this.rotate)},zoom:function(a,b){var c=
|
8
|
+
this.categoryAxis;c.parseDates&&!c.equalSpacing?this.timeZoom(a,b):this.indexZoom(a,b);this.updateLegendValues()},timeZoom:function(a,b){var c=this.maxSelectedTime;isNaN(c)||(b!=this.endTime&&b-a>c&&(a=b-c,this.updateScrollbar=!0),a!=this.startTime&&b-a>c&&(b=a+c,this.updateScrollbar=!0));var d=this.minSelectedTime;if(0<d&&b-a<d){var e=Math.round(a+(b-a)/2),d=Math.round(d/2);a=e-d;b=e+d}var g=this.chartData,e=this.categoryAxis;if(AmCharts.ifArray(g)&&(a!=this.startTime||b!=this.endTime)){var k=e.minDuration(),
|
9
|
+
d=this.firstTime,n=this.lastTime;a||(a=d,isNaN(c)||(a=n-c));b||(b=n);a>n&&(a=n);b<d&&(b=d);a<d&&(a=d);b>n&&(b=n);b<a&&(b=a+k);b-a<k/5&&(b<n?b=a+k/5:a=b-k/5);this.startTime=a;this.endTime=b;c=g.length-1;k=this.getClosestIndex(g,"time",a,!0,0,c);g=this.getClosestIndex(g,"time",b,!1,k,c);e.timeZoom(a,b);e.zoom(k,g);this.start=AmCharts.fitToBounds(k,0,c);this.end=AmCharts.fitToBounds(g,0,c);this.zoomAxesAndGraphs();this.zoomScrollbar();a!=d||b!=n?this.showZB(!0):this.showZB(!1);this.updateColumnsDepth();
|
10
|
+
this.dispatchTimeZoomEvent()}},indexZoom:function(a,b){var c=this.maxSelectedSeries;isNaN(c)||(b!=this.end&&b-a>c&&(a=b-c,this.updateScrollbar=!0),a!=this.start&&b-a>c&&(b=a+c,this.updateScrollbar=!0));if(a!=this.start||b!=this.end){var d=this.chartData.length-1;isNaN(a)&&(a=0,isNaN(c)||(a=d-c));isNaN(b)&&(b=d);b<a&&(b=a);b>d&&(b=d);a>d&&(a=d-1);0>a&&(a=0);this.start=a;this.end=b;this.categoryAxis.zoom(a,b);this.zoomAxesAndGraphs();this.zoomScrollbar();0!==a||b!=this.chartData.length-1?this.showZB(!0):
|
11
|
+
this.showZB(!1);this.updateColumnsDepth();this.dispatchIndexZoomEvent()}},updateGraphs:function(){AmCharts.AmSerialChart.base.updateGraphs.call(this);var a=this.graphs,b;for(b=0;b<a.length;b++){var c=a[b];c.columnWidthReal=this.columnWidth;c.categoryAxis=this.categoryAxis}},updateColumnsDepth:function(){var a,b=this.graphs,c;AmCharts.remove(this.columnsSet);this.columnsArray=[];for(a=0;a<b.length;a++){c=b[a];var d=c.columnsArray;if(d){var e;for(e=0;e<d.length;e++)this.columnsArray.push(d[e])}}this.columnsArray.sort(this.compareDepth);
|
12
|
+
if(0<this.columnsArray.length){b=this.container.set();this.columnSet.push(b);for(a=0;a<this.columnsArray.length;a++)b.push(this.columnsArray[a].column.set);c&&b.translate(c.x,c.y);this.columnsSet=b}},compareDepth:function(a,b){return a.depth>b.depth?1:-1},zoomScrollbar:function(){var a=this.chartScrollbar,b=this.categoryAxis;a&&this.updateScrollbar&&(b.parseDates&&!b.equalSpacing?a.timeZoom(this.startTime,this.endTime):a.zoom(this.start,this.end),this.updateScrollbar=!0)},updateTrendLines:function(){var a=
|
13
|
+
this.trendLines,b;for(b=0;b<a.length;b++){var c=a[b],c=AmCharts.processObject(c,AmCharts.TrendLine,this.theme);a[b]=c;c.chart=this;AmCharts.isString(c.valueAxis)&&(c.valueAxis=this.getValueAxisById(c.valueAxis));c.valueAxis||(c.valueAxis=this.valueAxes[0]);c.categoryAxis=this.categoryAxis}},zoomAxesAndGraphs:function(){if(!this.scrollbarOnly){var a=this.valueAxes,b;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);a=this.graphs;for(b=0;b<a.length;b++)a[b].zoom(this.start,this.end);this.zoomTrendLines();
|
14
|
+
(b=this.chartCursor)&&b.zoom(this.start,this.end,this.startTime,this.endTime)}},countColumns:function(){var a=0,b=this.valueAxes.length,c=this.graphs.length,d,e,g=!1,k,n;for(n=0;n<b;n++){e=this.valueAxes[n];var l=e.stackType;if("100%"==l||"regular"==l)for(g=!1,k=0;k<c;k++)d=this.graphs[k],d.hidden||d.valueAxis!=e||"column"!=d.type||(!g&&d.stackable&&(a++,g=!0),!d.stackable&&d.clustered&&a++,d.columnIndex=a-1,d.clustered||(d.columnIndex=0));if("none"==l||"3d"==l)for(k=0;k<c;k++)d=this.graphs[k],!d.hidden&&
|
15
|
+
d.valueAxis==e&&"column"==d.type&&d.clustered&&(d.columnIndex=a,a++);if("3d"==l){for(n=0;n<c;n++)d=this.graphs[n],d.depthCount=a;a=1}}return a},parseData:function(){AmCharts.AmSerialChart.base.parseData.call(this);this.parseSerialData()},getCategoryIndexByValue:function(a){var b=this.chartData,c,d;for(d=0;d<b.length;d++)b[d].category==a&&(c=d);return c},handleCursorChange:function(a){this.updateLegendValues(a.index)},handleCursorZoom:function(a){this.updateScrollbar=!0;this.zoom(a.start,a.end)},handleScrollbarZoom:function(a){this.updateScrollbar=
|
16
|
+
!1;this.zoom(a.start,a.end)},dispatchTimeZoomEvent:function(){if(this.prevStartTime!=this.startTime||this.prevEndTime!=this.endTime){var a={type:"zoomed"};a.startDate=new Date(this.startTime);a.endDate=new Date(this.endTime);a.startIndex=this.start;a.endIndex=this.end;this.startIndex=this.start;this.endIndex=this.end;this.startDate=a.startDate;this.endDate=a.endDate;this.prevStartTime=this.startTime;this.prevEndTime=this.endTime;var b=this.categoryAxis,c=AmCharts.extractPeriod(b.minPeriod).period,
|
17
|
+
b=b.dateFormatsObject[c];a.startValue=AmCharts.formatDate(a.startDate,b);a.endValue=AmCharts.formatDate(a.endDate,b);a.chart=this;a.target=this;this.fire(a.type,a)}},dispatchIndexZoomEvent:function(){if(this.prevStartIndex!=this.start||this.prevEndIndex!=this.end){this.startIndex=this.start;this.endIndex=this.end;var a=this.chartData;if(AmCharts.ifArray(a)&&!isNaN(this.start)&&!isNaN(this.end)){var b={chart:this,target:this,type:"zoomed"};b.startIndex=this.start;b.endIndex=this.end;b.startValue=a[this.start].category;
|
18
|
+
b.endValue=a[this.end].category;this.categoryAxis.parseDates&&(this.startTime=a[this.start].time,this.endTime=a[this.end].time,b.startDate=new Date(this.startTime),b.endDate=new Date(this.endTime));this.prevStartIndex=this.start;this.prevEndIndex=this.end;this.fire(b.type,b)}}},updateLegendValues:function(a){var b=this.graphs,c;for(c=0;c<b.length;c++){var d=b[c];isNaN(a)?d.currentDataItem=void 0:d.currentDataItem=this.chartData[a].axes[d.valueAxis.id].graphs[d.id]}this.legend&&this.legend.updateValues()},
|
19
|
+
getClosestIndex:function(a,b,c,d,e,g){0>e&&(e=0);g>a.length-1&&(g=a.length-1);var k=e+Math.round((g-e)/2),n=a[k][b];if(1>=g-e){if(d)return e;d=a[g][b];return Math.abs(a[e][b]-c)<Math.abs(d-c)?e:g}return c==n?k:c<n?this.getClosestIndex(a,b,c,d,e,k):this.getClosestIndex(a,b,c,d,k,g)},zoomToIndexes:function(a,b){this.updateScrollbar=!0;var c=this.chartData;if(c){var d=c.length;0<d&&(0>a&&(a=0),b>d-1&&(b=d-1),d=this.categoryAxis,d.parseDates&&!d.equalSpacing?this.zoom(c[a].time,this.getEndTime(c[b].time)):
|
20
|
+
this.zoom(a,b))}},zoomToDates:function(a,b){this.updateScrollbar=!0;var c=this.chartData;if(this.categoryAxis.equalSpacing){var d=this.getClosestIndex(c,"time",a.getTime(),!0,0,c.length),c=this.getClosestIndex(c,"time",b.getTime(),!1,0,c.length);this.zoom(d,c)}else this.zoom(a.getTime(),b.getTime())},zoomToCategoryValues:function(a,b){this.updateScrollbar=!0;this.zoom(this.getCategoryIndexByValue(a),this.getCategoryIndexByValue(b))},formatPeriodString:function(a,b){if(b){var c=["value","open","low",
|
21
|
+
"high","close"],d="value open low high close average sum count".split(" "),e=b.valueAxis,g=this.chartData,k=b.numberFormatter;k||(k=this.numberFormatter);for(var n=0;n<c.length;n++){for(var l=c[n],h=0,f=0,m,u,p,s,y,w=0,r=0,q,t,v,z,B,A=this.start;A<=this.end;A++){var x=g[A];if(x&&(x=x.axes[e.id].graphs[b.id])){if(x.values){var C=x.values[l];if(!isNaN(C)){isNaN(m)&&(m=C);u=C;if(isNaN(p)||p>C)p=C;if(isNaN(s)||s<C)s=C;h+=C;f++;y=h/f}}if(x.percents&&(x=x.percents[l],!isNaN(x))){isNaN(q)&&(q=x);t=x;if(isNaN(v)||
|
22
|
+
v>x)v=x;if(isNaN(z)||z<x)z=x;w+=x;r++;B=w/r}}}w={open:q,close:t,high:z,low:v,average:B,sum:w,count:r};a=AmCharts.formatValue(a,{open:m,close:u,high:s,low:p,average:y,sum:h,count:f},d,k,l+"\\.",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=AmCharts.formatValue(a,w,d,this.percentFormatter,"percents\\."+l+"\\.")}}return a},formatString:function(a,b){var c=b.graph;if(-1!=a.indexOf("[[category]]")){var d=b.serialDataItem.category;if(this.categoryAxis.parseDates){var e=this.balloonDateFormat,
|
23
|
+
g=this.chartCursor;g&&(e=g.categoryBalloonDateFormat);-1!=a.indexOf("[[category]]")&&(e=AmCharts.formatDate(d,e),-1!=e.indexOf("fff")&&(e=AmCharts.formatMilliseconds(e,d)),d=e)}a=a.replace(/\[\[category\]\]/g,String(d))}c=c.numberFormatter;c||(c=this.numberFormatter);d=b.graph.valueAxis;(e=d.duration)&&!isNaN(b.values.value)&&(d=AmCharts.formatDuration(b.values.value,e,"",d.durationUnits,d.maxInterval,c),a=a.replace(RegExp("\\[\\[value\\]\\]","g"),d));d="value open low high close total".split(" ");
|
24
|
+
e=this.percentFormatter;a=AmCharts.formatValue(a,b.percents,d,e,"percents\\.");a=AmCharts.formatValue(a,b.values,d,c,"",this.usePrefixes,this.prefixesOfSmallNumbers,this.prefixesOfBigNumbers);a=AmCharts.formatValue(a,b.values,["percents"],e);-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,b.dataContext));return a=AmCharts.AmSerialChart.base.formatString.call(this,a,b)},addChartScrollbar:function(a){AmCharts.callMethod("destroy",[this.chartScrollbar]);a&&(a.chart=this,this.listenTo(a,"zoomed",
|
25
|
+
this.handleScrollbarZoom));this.rotate?void 0===a.width&&(a.width=a.scrollbarHeight):void 0===a.height&&(a.height=a.scrollbarHeight);this.chartScrollbar=a},removeChartScrollbar:function(){AmCharts.callMethod("destroy",[this.chartScrollbar]);this.chartScrollbar=null},handleReleaseOutside:function(a){AmCharts.AmSerialChart.base.handleReleaseOutside.call(this,a);AmCharts.callMethod("handleReleaseOutside",[this.chartScrollbar])}});AmCharts.Cuboid=AmCharts.Class({construct:function(a,b,c,d,e,g,k,n,l,h,f,m,u,p,s){this.set=a.set();this.container=a;this.h=Math.round(c);this.w=Math.round(b);this.dx=d;this.dy=e;this.colors=g;this.alpha=k;this.bwidth=n;this.bcolor=l;this.balpha=h;this.colors=g;this.dashLength=p;this.pattern=s;u?0>b&&0===f&&(f=180):0>c&&270==f&&(f=90);this.gradientRotation=f;0===d&&0===e&&(this.cornerRadius=m);this.draw()},draw:function(){var a=this.set;a.clear();var b=this.container,c=this.w,d=this.h,e=this.dx,g=
|
26
|
+
this.dy,k=this.colors,n=this.alpha,l=this.bwidth,h=this.bcolor,f=this.balpha,m=this.gradientRotation,u=this.cornerRadius,p=this.dashLength,s=this.pattern,y=k,w=k;"object"==typeof k&&(y=k[0],w=k[k.length-1]);var r,q,t,v,z,B,A,x,C;if(0<e||0<g)A=w,w=AmCharts.adjustLuminosity(y,-0.2),w=AmCharts.adjustLuminosity(y,-0.2),r=AmCharts.polygon(b,[0,e,c+e,c,0],[0,g,g,0,0],w,n,1,h,0,m),0<f&&(C=AmCharts.line(b,[0,e,c+e],[0,g,g],h,f,l,p)),q=AmCharts.polygon(b,[0,0,c,c,0],[0,d,d,0,0],w,n,1,h,0,m),q.translate(e,
|
27
|
+
g),0<f&&(t=AmCharts.line(b,[e,e],[g,g+d],h,1,l,p)),v=AmCharts.polygon(b,[0,0,e,e,0],[0,d,d+g,g,0],w,n,1,h,0,m),z=AmCharts.polygon(b,[c,c,c+e,c+e,c],[0,d,d+g,g,0],w,n,1,h,0,m),0<f&&(B=AmCharts.line(b,[c,c+e,c+e,c],[0,g,d+g,d],h,f,l,p)),w=AmCharts.adjustLuminosity(A,0.2),A=AmCharts.polygon(b,[0,e,c+e,c,0],[d,d+g,d+g,d,d],w,n,1,h,0,m),0<f&&(x=AmCharts.line(b,[0,e,c+e],[d,d+g,d+g],h,f,l,p));1>Math.abs(d)&&(d=0);1>Math.abs(c)&&(c=0);b=0===d?AmCharts.line(b,[0,c],[0,0],h,f,l,p):0===c?AmCharts.line(b,[0,
|
28
|
+
0],[0,d],h,f,l,p):0<u?AmCharts.rect(b,c,d,k,n,l,h,f,u,m,p):AmCharts.polygon(b,[0,0,c,c,0],[0,d,d,0,0],k,n,l,h,f,m,!1,p);d=0>d?[r,C,q,t,v,z,B,A,x,b]:[A,x,q,t,v,z,r,C,B,b];for(r=0;r<d.length;r++)(q=d[r])&&a.push(q);s&&b.pattern(s)},width:function(a){this.w=a;this.draw()},height:function(a){this.h=a;this.draw()},animateHeight:function(a,b){var c=this;c.easing=b;c.totalFrames=1E3*a/AmCharts.updateRate;c.rh=c.h;c.frame=0;c.height(1);setTimeout(function(){c.updateHeight.call(c)},AmCharts.updateRate)},updateHeight:function(){var a=
|
29
29
|
this;a.frame++;var b=a.totalFrames;a.frame<=b&&(b=a.easing(0,a.frame,1,a.rh-1,b),a.height(b),setTimeout(function(){a.updateHeight.call(a)},AmCharts.updateRate))},animateWidth:function(a,b){var c=this;c.easing=b;c.totalFrames=1E3*a/AmCharts.updateRate;c.rw=c.w;c.frame=0;c.width(1);setTimeout(function(){c.updateWidth.call(c)},AmCharts.updateRate)},updateWidth:function(){var a=this;a.frame++;var b=a.totalFrames;a.frame<=b&&(b=a.easing(0,a.frame,1,a.rw-1,b),a.width(b),setTimeout(function(){a.updateWidth.call(a)},
|
30
|
-
AmCharts.updateRate))}});AmCharts.CategoryAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(){AmCharts.CategoryAxis.base.construct.call(this);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.firstDayOfWeek=1;this.gridPosition="middle";this.markPeriodChange=this.boldPeriodBeginning=!0;this.safeDistance=30;this.centerLabelOnFullPeriod=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},{period:"ss",count:10},{period:"ss",count:30},{period:"mm",
|
30
|
+
AmCharts.updateRate))}});AmCharts.CategoryAxis=AmCharts.Class({inherits:AmCharts.AxisBase,construct:function(a){AmCharts.CategoryAxis.base.construct.call(this,a);this.minPeriod="DD";this.equalSpacing=this.parseDates=!1;this.position="bottom";this.startOnAxis=!1;this.firstDayOfWeek=1;this.gridPosition="middle";this.markPeriodChange=this.boldPeriodBeginning=!0;this.safeDistance=30;this.centerLabelOnFullPeriod=!0;this.periods=[{period:"ss",count:1},{period:"ss",count:5},{period:"ss",count:10},{period:"ss",count:30},{period:"mm",
|
31
31
|
count:1},{period:"mm",count:5},{period:"mm",count:10},{period:"mm",count:30},{period:"hh",count:1},{period:"hh",count:3},{period:"hh",count:6},{period:"hh",count:12},{period:"DD",count:1},{period:"DD",count:2},{period:"DD",count:3},{period:"DD",count:4},{period:"DD",count:5},{period:"WW",count:1},{period:"MM",count:1},{period:"MM",count:2},{period:"MM",count:3},{period:"MM",count:6},{period:"YYYY",count:1},{period:"YYYY",count:2},{period:"YYYY",count:5},{period:"YYYY",count:10},{period:"YYYY",count:50},
|
32
|
-
{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={};this.nextPeriod.fff="ss";this.nextPeriod.ss="mm";this.nextPeriod.mm="hh";this.nextPeriod.hh="DD";this.nextPeriod.DD="MM";this.nextPeriod.MM="YYYY"},draw:function(){AmCharts.CategoryAxis.base.draw.call(this);
|
33
|
-
this.generateDFObject();var a=this.chart.chartData;this.data=a;if(AmCharts.ifArray(a)){var b,c=this.chart,d=this.start,e=this.labelFrequency,g=0;b=this.end-d+1;var k=this.gridCount,
|
34
|
-
a&&(this.endTime=a);t=this.minorGridEnabled;var v,a=this.gridAlpha,z;if(this.parseDates&&!this.equalSpacing){this.timeDifference=this.endTime-this.startTime;d=this.choosePeriod(0);e=d.period;u=d.count;p=AmCharts.getPeriodDuration(e,u);p<h&&(e=
|
35
|
-
p*this.stepWidth);this.cellWidth=h*this.stepWidth;b=Math.round(f/p);d=-1;b/2==Math.round(b/2)&&(d=-2,f-=p);var A=c.firstTime,x=0;t&&1<u&&(v=this.chooseMinorFrequency(u),z=AmCharts.getPeriodDuration(e,v));if(0<this.gridCount)for(b=d;b<=k;b++){
|
36
|
-
w&&this.markPeriodChange?(f=this.dateFormatsObject[this.nextPeriod[s]],t=!0):f=this.dateFormatsObject[s];q||(t=!1);f=AmCharts.formatDate(new Date(
|
37
|
-
this.pushAxisItem(t);this.gridAlpha=a}}else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(b),b<k&&(k=b),g+=this.start,this.stepWidth=this.getStepWidth(b),0<k)for(q=Math.floor(b/k),v=this.chooseMinorFrequency(q),h=g,h/2==Math.round(h/2)&&h--,0>h&&(h=0),k=0,b=h;b<=this.end+2;b++){r=!1;0<=b&&b<this.data.length?(s=this.data[b],f=s.category,r=s.forceShow):f="";if(t&&!isNaN(v))if(b/v==Math.round(b/v)||r)b/q==Math.round(b/q)||r||(this.gridAlpha=this.minorGridAlpha,f=void 0);else continue;
|
38
|
-
q!=Math.round(b/q)&&!r)continue;h=this.getCoordinate(b-g);r=0;"start"==this.gridPosition&&(h-=this.cellWidth/2,r=this.cellWidth/2);if(b==d&&!
|
39
|
-
this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;d=this.choosePeriod(0);e=d.period;u=d.count;p=AmCharts.getPeriodDuration(e,u);p<h&&(e=
|
40
|
-
0);y=this.end+2;y>=this.data.length&&(y=this.data.length);z=!1;z=!
|
41
|
-
this.start);w=!1;this.nextPeriod[s]&&(w=this.checkPeriodChange(this.nextPeriod[s],1,
|
42
|
-
this.pushAxisItem(f),r=r.getBBox().width,AmCharts.isModern||(r-=h),this.previousPos=h+r));f=
|
43
|
-
for(b=0;b<
|
32
|
+
{period:"YYYY",count:100}];this.dateFormats=[{period:"fff",format:"JJ:NN:SS"},{period:"ss",format:"JJ:NN:SS"},{period:"mm",format:"JJ:NN"},{period:"hh",format:"JJ:NN"},{period:"DD",format:"MMM DD"},{period:"WW",format:"MMM DD"},{period:"MM",format:"MMM"},{period:"YYYY",format:"YYYY"}];this.nextPeriod={};this.nextPeriod.fff="ss";this.nextPeriod.ss="mm";this.nextPeriod.mm="hh";this.nextPeriod.hh="DD";this.nextPeriod.DD="MM";this.nextPeriod.MM="YYYY";AmCharts.applyTheme(this,a,"CategoryAxis")},draw:function(){AmCharts.CategoryAxis.base.draw.call(this);
|
33
|
+
this.generateDFObject();var a=this.chart.chartData;this.data=a;if(AmCharts.ifArray(a)){var b,c=this.chart,d=this.start,e=this.labelFrequency,g=0;b=this.end-d+1;var k=this.gridCount,n=this.showFirstLabel,l=this.showLastLabel,h,f="",m=AmCharts.extractPeriod(this.minPeriod);h=AmCharts.getPeriodDuration(m.period,m.count);var u,p,s,y,w;u=this.rotate;var r=this.firstDayOfWeek,q=this.boldPeriodBeginning,a=AmCharts.resetDateToMin(new Date(a[a.length-1].time+1.05*h),this.minPeriod,1,r).getTime(),t;this.endTime>
|
34
|
+
a&&(this.endTime=a);t=this.minorGridEnabled;var v,a=this.gridAlpha,z;if(this.parseDates&&!this.equalSpacing){this.timeDifference=this.endTime-this.startTime;d=this.choosePeriod(0);e=d.period;u=d.count;p=AmCharts.getPeriodDuration(e,u);p<h&&(e=m.period,u=m.count,p=h);s=e;"WW"==s&&(s="DD");this.stepWidth=this.getStepWidth(this.timeDifference);var k=Math.ceil(this.timeDifference/p)+5,B=f=AmCharts.resetDateToMin(new Date(this.startTime-p),e,u,r).getTime();s==e&&1==u&&this.centerLabelOnFullPeriod&&(y=
|
35
|
+
p*this.stepWidth);this.cellWidth=h*this.stepWidth;b=Math.round(f/p);d=-1;b/2==Math.round(b/2)&&(d=-2,f-=p);var A=c.firstTime,x=0;t&&1<u&&(v=this.chooseMinorFrequency(u),z=AmCharts.getPeriodDuration(e,v));if(0<this.gridCount)for(b=d;b<=k;b++){m=A+p*(b+Math.floor((B-A)/p))-x;"DD"==e&&(m+=36E5);m=AmCharts.resetDateToMin(new Date(m),e,u,r).getTime();"MM"==e&&(t=(m-f)/p,1.5<=(m-f)/p&&(m-=(t-1)*p,x+=p));h=(m-this.startTime)*this.stepWidth;w=!1;this.nextPeriod[s]&&(w=this.checkPeriodChange(this.nextPeriod[s],
|
36
|
+
1,m,f));t=!1;w&&this.markPeriodChange?(f=this.dateFormatsObject[this.nextPeriod[s]],t=!0):f=this.dateFormatsObject[s];q||(t=!1);f=AmCharts.formatDate(new Date(m),f);if(b==d&&!n||b==k&&!l)f=" ";this.labelFunction&&(f=this.labelFunction(f,new Date(m),this));f=new this.axisItemRenderer(this,h,f,!1,y,0,!1,t);this.pushAxisItem(f);f=m;if(!isNaN(v))for(h=1;h<u;h+=v)this.gridAlpha=this.minorGridAlpha,t=m+z*h,t=AmCharts.resetDateToMin(new Date(t),e,v,r).getTime(),t=new this.axisItemRenderer(this,(t-this.startTime)*
|
37
|
+
this.stepWidth),this.pushAxisItem(t);this.gridAlpha=a}}else if(!this.parseDates){if(this.cellWidth=this.getStepWidth(b),b<k&&(k=b),g+=this.start,this.stepWidth=this.getStepWidth(b),0<k)for(q=Math.floor(b/k),v=this.chooseMinorFrequency(q),h=g,h/2==Math.round(h/2)&&h--,0>h&&(h=0),k=0,b=h;b<=this.end+2;b++){r=!1;0<=b&&b<this.data.length?(s=this.data[b],f=s.category,r=s.forceShow):f="";if(t&&!isNaN(v))if(b/v==Math.round(b/v)||r)b/q==Math.round(b/q)||r||(this.gridAlpha=this.minorGridAlpha,f=void 0);else continue;
|
38
|
+
else if(b/q!=Math.round(b/q)&&!r)continue;h=this.getCoordinate(b-g);r=0;"start"==this.gridPosition&&(h-=this.cellWidth/2,r=this.cellWidth/2);if(b==d&&!n||b==this.end&&!l)f=void 0;Math.round(k/e)!=k/e&&(f=void 0);k++;B=this.cellWidth;u&&(B=NaN);this.labelFunction&&s&&(f=this.labelFunction(f,s,this));f=AmCharts.fixBrakes(f);f=new this.axisItemRenderer(this,h,f,!0,B,r,void 0,!1,r);this.pushAxisItem(f);this.gridAlpha=a}}else if(this.parseDates&&this.equalSpacing){g=this.start;this.startTime=this.data[this.start].time;
|
39
|
+
this.endTime=this.data[this.end].time;this.timeDifference=this.endTime-this.startTime;d=this.choosePeriod(0);e=d.period;u=d.count;p=AmCharts.getPeriodDuration(e,u);p<h&&(e=m.period,u=m.count,p=h);s=e;"WW"==s&&(s="DD");this.stepWidth=this.getStepWidth(b);k=Math.ceil(this.timeDifference/p)+1;f=AmCharts.resetDateToMin(new Date(this.startTime-p),e,u,r).getTime();this.cellWidth=this.getStepWidth(b);b=Math.round(f/p);d=-1;b/2==Math.round(b/2)&&(d=-2,f-=p);h=this.start;h/2==Math.round(h/2)&&h--;0>h&&(h=
|
40
|
+
0);y=this.end+2;y>=this.data.length&&(y=this.data.length);z=!1;z=!n;this.previousPos=-1E3;20<this.labelRotation&&(this.safeDistance=5);p=h;if(this.data[h].time!=AmCharts.resetDateToMin(new Date(this.data[h].time),e,u,r).getTime())for(r=0,A=f,b=h;b<y;b++)m=this.data[b].time,this.checkPeriodChange(e,u,m,A)&&(r++,2<=r&&(p=b,b=y),A=m);t&&1<u&&(v=this.chooseMinorFrequency(u),AmCharts.getPeriodDuration(e,v));for(b=h;b<y;b++)if(m=this.data[b].time,this.checkPeriodChange(e,u,m,f)&&b>=p){h=this.getCoordinate(b-
|
41
|
+
this.start);w=!1;this.nextPeriod[s]&&(w=this.checkPeriodChange(this.nextPeriod[s],1,m,f));t=!1;w&&this.markPeriodChange?(f=this.dateFormatsObject[this.nextPeriod[s]],t=!0):f=this.dateFormatsObject[s];f=AmCharts.formatDate(new Date(m),f);if(b==d&&!n||b==k&&!l)f=" ";z?z=!1:(q||(t=!1),h-this.previousPos>this.safeDistance*Math.cos(this.labelRotation*Math.PI/180)&&(this.labelFunction&&(f=this.labelFunction(f,new Date(m),this)),f=new this.axisItemRenderer(this,h,f,void 0,void 0,void 0,void 0,t),r=f.graphics(),
|
42
|
+
this.pushAxisItem(f),r=r.getBBox().width,AmCharts.isModern||(r-=h),this.previousPos=h+r));f=m}else isNaN(v)||(this.checkPeriodChange(e,v,m,B)&&(this.gridAlpha=this.minorGridAlpha,h=this.getCoordinate(b-this.start),t=new this.axisItemRenderer(this,h),this.pushAxisItem(t),B=m),this.gridAlpha=a)}for(b=0;b<this.data.length;b++)if(n=this.data[b])l=this.parseDates&&!this.equalSpacing?Math.round((n.time-this.startTime)*this.stepWidth+this.cellWidth/2):this.getCoordinate(b-g),n.x[this.id]=l;n=this.guides.length;
|
43
|
+
for(b=0;b<n;b++)l=this.guides[b],q=q=q=a=d=NaN,v=l.above,l.toCategory&&(q=c.getCategoryIndexByValue(l.toCategory),isNaN(q)||(d=this.getCoordinate(q-g),f=new this.axisItemRenderer(this,d,"",!0,NaN,NaN,l),this.pushAxisItem(f,v))),l.category&&(q=c.getCategoryIndexByValue(l.category),isNaN(q)||(a=this.getCoordinate(q-g),q=(d-a)/2,f=new this.axisItemRenderer(this,a,l.label,!0,NaN,q,l),this.pushAxisItem(f,v))),l.toDate&&(this.equalSpacing?(q=c.getClosestIndex(this.data,"time",l.toDate.getTime(),!1,0,this.data.length-
|
44
44
|
1),isNaN(q)||(d=this.getCoordinate(q-g))):d=(l.toDate.getTime()-this.startTime)*this.stepWidth,f=new this.axisItemRenderer(this,d,"",!0,NaN,NaN,l),this.pushAxisItem(f,v)),l.date&&(this.equalSpacing?(q=c.getClosestIndex(this.data,"time",l.date.getTime(),!1,0,this.data.length-1),isNaN(q)||(a=this.getCoordinate(q-g))):a=(l.date.getTime()-this.startTime)*this.stepWidth,q=(d-a)/2,f="H"==this.orientation?new this.axisItemRenderer(this,a,l.label,!1,2*q,NaN,l):new this.axisItemRenderer(this,a,l.label,!1,
|
45
45
|
NaN,q,l),this.pushAxisItem(f,v)),d=new this.guideFillRenderer(this,a,d,l),a=d.graphics(),this.pushAxisItem(d,v),l.graphics=a,a.index=b,l.balloonText&&this.addEventListeners(a,l)}this.axisCreated=!0;c=this.x;g=this.y;this.set.translate(c,g);this.labelsSet.translate(c,g);this.positionTitle();(c=this.axisLine.set)&&c.toFront()},chooseMinorFrequency:function(a){for(var b=10;0<b;b--)if(a/b==Math.round(a/b))return a/b},choosePeriod:function(a){var b=AmCharts.getPeriodDuration(this.periods[a].period,this.periods[a].count),
|
46
46
|
c=Math.ceil(this.timeDifference/b),d=this.periods;return this.timeDifference<b&&0<a?d[a-1]:c<=this.gridCount?d[a]:a+1<d.length?this.choosePeriod(a+1):d[a]},getStepWidth:function(a){var b;this.startOnAxis?(b=this.axisWidth/(a-1),1==a&&(b=this.axisWidth)):b=this.axisWidth/a;return b},getCoordinate:function(a){a*=this.stepWidth;this.startOnAxis||(a+=this.stepWidth/2);return Math.round(a)},timeZoom:function(a,b){this.startTime=a;this.endTime=b},minDuration:function(){var a=AmCharts.extractPeriod(this.minPeriod);
|
@@ -1,17 +1,17 @@
|
|
1
|
-
AmCharts.AmXYChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(){AmCharts.AmXYChart.base.construct.call(this);this.createEvents("zoomed");this.maxZoomFactor=20;this
|
2
|
-
c=this.marginTopReal,b=this.plotAreaWidth,d=this.plotAreaHeight;this.graphsSet.clipRect(a,c,b,d);this.bulletSet.clipRect(a,c,b,d);this.trendLinesSet.clipRect(a,c,b,d)},createValueAxes:function(){var a=[],c=[];this.xAxes=a;this.yAxes=c;var b=this.valueAxes,d,e;for(e=0;e<b.length;e++){d=b[e];var f=d.position;if("top"==f||"bottom"==f)d.rotate=!0;d.setOrientation(d.rotate);f=d.orientation;"V"==f&&c.push(d);"H"==f&&a.push(d)}0===c.length&&(d=new AmCharts.ValueAxis
|
3
|
-
c.push(d));0===a.length&&(d=new AmCharts.ValueAxis,d.rotate=!0,d.setOrientation(!0),b.push(d),a.push(d));for(e=0;e<b.length;e++)this.processValueAxis(b[e],e);a=this.graphs;for(e=0;e<a.length;e++)this.processGraph(a[e],e)},drawChart:function(){AmCharts.AmXYChart.base.drawChart.call(this);AmCharts.ifArray(this.chartData)?(this.chartScrollbar&&this.updateScrollbars(),this.zoomChart()):this.cleanChart();if(this.hideXScrollbar){var a=this.scrollbarH;
|
4
|
-
a.destroy());this.scrollbarH=null}if(this.hideYScrollbar){if(a=this.scrollbarV)this.removeListener(a,"zoomed",this.handleVSBZoom),a.destroy();this.scrollbarV=null}if(!this.autoMargins||this.marginsUpdated)this.dispDUpd(),this.chartCreated=!0,this.zoomScrollbars()},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.scrollbarV,this.scrollbarH,this.chartCursor])},zoomChart:function(){this.toggleZoomOutButton();this.zoomObjects(this.valueAxes);
|
5
|
-
this.zoomTrendLines();this.dispatchAxisZoom()},toggleZoomOutButton:function(){1==this.heightMultiplier&&1==this.widthMultiplier?this.showZB(!1):this.showZB(!0)},dispatchAxisZoom:function(){var a=this.valueAxes,c;for(c=0;c<a.length;c++){var b=a[c];if(!isNaN(b.min)&&!isNaN(b.max)){var d,e;"V"==b.orientation?(d=b.coordinateToValue(-this.verticalPosition),e=b.coordinateToValue(-this.verticalPosition+this.plotAreaHeight)):(d=b.coordinateToValue(-this.horizontalPosition),e=
|
6
|
-
this.plotAreaWidth));if(!isNaN(d)&&!isNaN(e)){if(d>e){var f=e;e=d;d=f}b.dispatchZoomEvent(d,e)}}}},zoomObjects:function(a){var c=a.length,b;for(b=0;b<c;b++){var d=a[b];this.updateObjectSize(d);d.zoom(0,this.chartData.length-1)}},updateData:function(){this.parseData();var a=this.chartData,c=a.length-1,b=this.graphs,d=this.dataProvider,e=0,f,g;for(f=0;f<b.length;f++)if(g=b[f],g.data=a,g.zoom(0,c),g=g.valueField){var k;for(k=0;k<d.length;k++){var m=d[k][g];
|
7
|
-
e;if(a=this.chartCursor)a.updateData(),a.type="crosshair",a.valueBalloonsEnabled=!1},zoomOut:function(){this.verticalPosition=this.horizontalPosition=0;this.heightMultiplier=this.widthMultiplier=1;this.zoomChart();this.zoomScrollbars()},processValueAxis:function(a){a.chart=this;a.minMaxField="H"==a.orientation?"x":"y";a.minTemp=NaN;a.maxTemp=NaN;this.listenTo(a,"axisSelfZoomed",this.handleAxisSelfZoom)},processGraph:function(a){AmCharts.isString(a.xAxis)&&
|
8
|
-
AmCharts.isString(a.yAxis)&&(a.yAxis=this.getValueAxisById(a.yAxis));a.xAxis||(a.xAxis=this.xAxes[0]);a.yAxis||(a.yAxis=this.yAxes[0]);a.valueAxis=a.yAxis},parseData:function(){AmCharts.AmXYChart.base.parseData.call(this);this.chartData=[];var a=this.dataProvider,c=this.valueAxes,b=this.graphs,d;for(d=0;d<a.length;d++){var e={axes:{},x:{},y:{}},f=a[d],g;for(g=0;g<c.length;g++){var k=c[g].id;e.axes[k]={};e.axes[k].graphs={};var m;for(m=0;m<b.length;m++){var l=
|
9
|
-
k){var n={};n.serialDataItem=e;n.index=d;var p={},h=Number(f[l.valueField]);isNaN(h)||(p.value=h);h=Number(f[l.xField]);isNaN(h)||(p.x=h);h=Number(f[l.yField]);isNaN(h)||(p.y=h);h=Number(f[l.errorField]);isNaN(h)||(p.error=h);n.values=p;this.processFields(l,n,f);n.serialDataItem=e;n.graph=l;e.axes[k].graphs[q]=n}}}this.chartData[d]=e}},formatString:function(a,c){var b=c.graph.numberFormatter;b||(b=this.numberFormatter);a=AmCharts.formatValue(a,c.values,["value",
|
10
|
-
AmCharts.formatDataContextValue(a,c.dataContext));return a=AmCharts.AmXYChart.base.formatString.call(this,a,c)},addChartScrollbar:function(a){AmCharts.callMethod("destroy",[this.chartScrollbar,this.scrollbarH,this.scrollbarV]);if(a){this.chartScrollbar=a;this.scrollbarHeight=a.scrollbarHeight;var c="backgroundColor backgroundAlpha selectedBackgroundColor selectedBackgroundAlpha scrollDuration resizeEnabled hideResizeGrips scrollbarHeight updateOnReleaseOnly".split(" ");
|
11
|
-
new AmCharts.SimpleChartScrollbar;b.skipEvent=!0;b.chart=this;this.listenTo(b,"zoomed",this.handleVSBZoom);AmCharts.copyProperties(a,b,c);b.rotate=!0;this.scrollbarV=b}this.hideXScrollbar||(b=new AmCharts.SimpleChartScrollbar,b.skipEvent=!0,b.chart=this,this.listenTo(b,"zoomed",this.handleHSBZoom),AmCharts.copyProperties(a,b,c),b.rotate=!1,this.scrollbarH=b)}},updateTrendLines:function(){var a=this.trendLines,c;for(c=0;c<a.length;c++){var b=a[c],
|
12
|
-
b;b.chart=this;var d=b.valueAxis;AmCharts.isString(d)&&(b.valueAxis=this.getValueAxisById(d));d=b.valueAxisX;AmCharts.isString(d)&&(b.valueAxisX=this.getValueAxisById(d));b.valueAxis||(b.valueAxis=this.yAxes[0]);b.valueAxisX||(b.valueAxisX=this.xAxes[0])}},updateMargins:function(){AmCharts.AmXYChart.base.updateMargins.call(this);var a=this.scrollbarV;a&&(this.getScrollbarPosition(a,!0,this.yAxes[0].position),this.adjustMargins(a,!0));
|
13
|
-
this.adjustMargins(a,!1)},updateScrollbars:function(){AmCharts.AmXYChart.base.updateScrollbars.call(this);var a=this.scrollbarV;a&&(this.updateChartScrollbar(a,!0),a.draw());if(a=this.scrollbarH)this.updateChartScrollbar(a,!1),a.draw()},zoomScrollbars:function(){var a=this.scrollbarH;a&&a.relativeZoom(this.widthMultiplier,-this.horizontalPosition/this.widthMultiplier);(a=this.scrollbarV)&&a.relativeZoom(this.heightMultiplier
|
14
|
-
this.maxZoomFactor&&(a=this.maxZoomFactor);return a},handleHSBZoom:function(a){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaWidth*c-this.plotAreaWidth);a<b&&(a=b);this.widthMultiplier=c;this.horizontalPosition=a;this.zoomChart()},handleVSBZoom:function(a){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaHeight*c-this.plotAreaHeight);a<b&&(a=b);this.heightMultiplier=
|
15
|
-
a.valueAxis.orientation){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaWidth*c-this.plotAreaWidth);a<b&&(a=b);this.horizontalPosition=a;this.widthMultiplier=c}else c=this.fitMultiplier(a.multiplier),a=-a.position*c,b=-(this.plotAreaHeight*c-this.plotAreaHeight),a<b&&(a=b),this.verticalPosition=a,this.heightMultiplier=c;this.zoomChart();c=this.graphs;for(a=0;a<c.length;a++)c[a].setAnimationPlayed();
|
16
|
-
this.plotAreaWidth/a.selectionWidth,b=this.heightMultiplier*this.plotAreaHeight/a.selectionHeight,c=this.fitMultiplier(c),b=this.fitMultiplier(b);this.horizontalPosition=(this.horizontalPosition-a.selectionX)*c/this.widthMultiplier;this.verticalPosition=(this.verticalPosition-a.selectionY)*b/this.heightMultiplier;this.widthMultiplier=c;this.heightMultiplier=b;this.zoomChart();this.zoomScrollbars()},removeChartScrollbar:function(){AmCharts.callMethod("destroy",
|
17
|
-
this.scrollbarH=null},handleReleaseOutside:function(a){AmCharts.AmXYChart.base.handleReleaseOutside.call(this,a);AmCharts.callMethod("handleReleaseOutside",[this.scrollbarH,this.scrollbarV])}});
|
1
|
+
AmCharts.AmXYChart=AmCharts.Class({inherits:AmCharts.AmRectangularChart,construct:function(a){this.chartType="xy";AmCharts.AmXYChart.base.construct.call(this,a);this.theme=a;this.createEvents("zoomed");this.maxZoomFactor=20;AmCharts.applyTheme(this,a,"AmXYChart")},initChart:function(){AmCharts.AmXYChart.base.initChart.call(this);this.dataChanged&&(this.updateData(),this.dataChanged=!1,this.dispatchDataUpdated=!0);this.updateScrollbar=!0;this.drawChart();this.autoMargins&&!this.marginsUpdated&&(this.marginsUpdated=
|
2
|
+
!0,this.measureMargins());var a=this.marginLeftReal,c=this.marginTopReal,b=this.plotAreaWidth,d=this.plotAreaHeight;this.graphsSet.clipRect(a,c,b,d);this.bulletSet.clipRect(a,c,b,d);this.trendLinesSet.clipRect(a,c,b,d)},createValueAxes:function(){var a=[],c=[];this.xAxes=a;this.yAxes=c;var b=this.valueAxes,d,e;for(e=0;e<b.length;e++){d=b[e];var f=d.position;if("top"==f||"bottom"==f)d.rotate=!0;d.setOrientation(d.rotate);f=d.orientation;"V"==f&&c.push(d);"H"==f&&a.push(d)}0===c.length&&(d=new AmCharts.ValueAxis(this.theme),
|
3
|
+
d.rotate=!1,d.setOrientation(!1),b.push(d),c.push(d));0===a.length&&(d=new AmCharts.ValueAxis(this.theme),d.rotate=!0,d.setOrientation(!0),b.push(d),a.push(d));for(e=0;e<b.length;e++)this.processValueAxis(b[e],e);a=this.graphs;for(e=0;e<a.length;e++)this.processGraph(a[e],e)},drawChart:function(){AmCharts.AmXYChart.base.drawChart.call(this);AmCharts.ifArray(this.chartData)?(this.chartScrollbar&&this.updateScrollbars(),this.zoomChart()):this.cleanChart();if(this.hideXScrollbar){var a=this.scrollbarH;
|
4
|
+
a&&(this.removeListener(a,"zoomed",this.handleHSBZoom),a.destroy());this.scrollbarH=null}if(this.hideYScrollbar){if(a=this.scrollbarV)this.removeListener(a,"zoomed",this.handleVSBZoom),a.destroy();this.scrollbarV=null}if(!this.autoMargins||this.marginsUpdated)this.dispDUpd(),this.chartCreated=!0,this.zoomScrollbars()},cleanChart:function(){AmCharts.callMethod("destroy",[this.valueAxes,this.graphs,this.scrollbarV,this.scrollbarH,this.chartCursor])},zoomChart:function(){this.toggleZoomOutButton();this.zoomObjects(this.valueAxes);
|
5
|
+
this.zoomObjects(this.graphs);this.zoomTrendLines();this.dispatchAxisZoom()},toggleZoomOutButton:function(){1==this.heightMultiplier&&1==this.widthMultiplier?this.showZB(!1):this.showZB(!0)},dispatchAxisZoom:function(){var a=this.valueAxes,c;for(c=0;c<a.length;c++){var b=a[c];if(!isNaN(b.min)&&!isNaN(b.max)){var d,e;"V"==b.orientation?(d=b.coordinateToValue(-this.verticalPosition),e=b.coordinateToValue(-this.verticalPosition+this.plotAreaHeight)):(d=b.coordinateToValue(-this.horizontalPosition),e=
|
6
|
+
b.coordinateToValue(-this.horizontalPosition+this.plotAreaWidth));if(!isNaN(d)&&!isNaN(e)){if(d>e){var f=e;e=d;d=f}b.dispatchZoomEvent(d,e)}}}},zoomObjects:function(a){var c=a.length,b;for(b=0;b<c;b++){var d=a[b];this.updateObjectSize(d);d.zoom(0,this.chartData.length-1)}},updateData:function(){this.parseData();var a=this.chartData,c=a.length-1,b=this.graphs,d=this.dataProvider,e=0,f,g;for(f=0;f<b.length;f++)if(g=b[f],g.data=a,g.zoom(0,c),g=g.valueField){var k;for(k=0;k<d.length;k++){var m=d[k][g];
|
7
|
+
m>e&&(e=m)}}for(f=0;f<b.length;f++)g=b[f],g.maxValue=e;if(a=this.chartCursor)a.updateData(),a.type="crosshair",a.valueBalloonsEnabled=!1},zoomOut:function(){this.verticalPosition=this.horizontalPosition=0;this.heightMultiplier=this.widthMultiplier=1;this.zoomChart();this.zoomScrollbars()},processValueAxis:function(a){a.chart=this;a.minMaxField="H"==a.orientation?"x":"y";a.minTemp=NaN;a.maxTemp=NaN;this.listenTo(a,"axisSelfZoomed",this.handleAxisSelfZoom)},processGraph:function(a){AmCharts.isString(a.xAxis)&&
|
8
|
+
(a.xAxis=this.getValueAxisById(a.xAxis));AmCharts.isString(a.yAxis)&&(a.yAxis=this.getValueAxisById(a.yAxis));a.xAxis||(a.xAxis=this.xAxes[0]);a.yAxis||(a.yAxis=this.yAxes[0]);a.valueAxis=a.yAxis},parseData:function(){AmCharts.AmXYChart.base.parseData.call(this);this.chartData=[];var a=this.dataProvider,c=this.valueAxes,b=this.graphs,d;for(d=0;d<a.length;d++){var e={axes:{},x:{},y:{}},f=a[d],g;for(g=0;g<c.length;g++){var k=c[g].id;e.axes[k]={};e.axes[k].graphs={};var m;for(m=0;m<b.length;m++){var l=
|
9
|
+
b[m],q=l.id;if(l.xAxis.id==k||l.yAxis.id==k){var n={};n.serialDataItem=e;n.index=d;var p={},h=Number(f[l.valueField]);isNaN(h)||(p.value=h);h=Number(f[l.xField]);isNaN(h)||(p.x=h);h=Number(f[l.yField]);isNaN(h)||(p.y=h);h=Number(f[l.errorField]);isNaN(h)||(p.error=h);n.values=p;this.processFields(l,n,f);n.serialDataItem=e;n.graph=l;e.axes[k].graphs[q]=n}}}this.chartData[d]=e}},formatString:function(a,c){var b=c.graph.numberFormatter;b||(b=this.numberFormatter);a=AmCharts.formatValue(a,c.values,["value",
|
10
|
+
"x","y"],b);-1!=a.indexOf("[[")&&(a=AmCharts.formatDataContextValue(a,c.dataContext));return a=AmCharts.AmXYChart.base.formatString.call(this,a,c)},addChartScrollbar:function(a){AmCharts.callMethod("destroy",[this.chartScrollbar,this.scrollbarH,this.scrollbarV]);if(a){this.chartScrollbar=a;this.scrollbarHeight=a.scrollbarHeight;var c="backgroundColor backgroundAlpha selectedBackgroundColor selectedBackgroundAlpha scrollDuration resizeEnabled hideResizeGrips scrollbarHeight updateOnReleaseOnly".split(" ");
|
11
|
+
if(!this.hideYScrollbar){var b=new AmCharts.SimpleChartScrollbar(this.theme);b.skipEvent=!0;b.chart=this;this.listenTo(b,"zoomed",this.handleVSBZoom);AmCharts.copyProperties(a,b,c);b.rotate=!0;this.scrollbarV=b}this.hideXScrollbar||(b=new AmCharts.SimpleChartScrollbar(this.theme),b.skipEvent=!0,b.chart=this,this.listenTo(b,"zoomed",this.handleHSBZoom),AmCharts.copyProperties(a,b,c),b.rotate=!1,this.scrollbarH=b)}},updateTrendLines:function(){var a=this.trendLines,c;for(c=0;c<a.length;c++){var b=a[c],
|
12
|
+
b=AmCharts.processObject(b,AmCharts.TrendLine,this.theme);a[c]=b;b.chart=this;var d=b.valueAxis;AmCharts.isString(d)&&(b.valueAxis=this.getValueAxisById(d));d=b.valueAxisX;AmCharts.isString(d)&&(b.valueAxisX=this.getValueAxisById(d));b.valueAxis||(b.valueAxis=this.yAxes[0]);b.valueAxisX||(b.valueAxisX=this.xAxes[0])}},updateMargins:function(){AmCharts.AmXYChart.base.updateMargins.call(this);var a=this.scrollbarV;a&&(this.getScrollbarPosition(a,!0,this.yAxes[0].position),this.adjustMargins(a,!0));
|
13
|
+
if(a=this.scrollbarH)this.getScrollbarPosition(a,!1,this.xAxes[0].position),this.adjustMargins(a,!1)},updateScrollbars:function(){AmCharts.AmXYChart.base.updateScrollbars.call(this);var a=this.scrollbarV;a&&(this.updateChartScrollbar(a,!0),a.draw());if(a=this.scrollbarH)this.updateChartScrollbar(a,!1),a.draw()},zoomScrollbars:function(){var a=this.scrollbarH;a&&a.relativeZoom(this.widthMultiplier,-this.horizontalPosition/this.widthMultiplier);(a=this.scrollbarV)&&a.relativeZoom(this.heightMultiplier,
|
14
|
+
-this.verticalPosition/this.heightMultiplier)},fitMultiplier:function(a){a>this.maxZoomFactor&&(a=this.maxZoomFactor);return a},handleHSBZoom:function(a){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaWidth*c-this.plotAreaWidth);a<b&&(a=b);this.widthMultiplier=c;this.horizontalPosition=a;this.zoomChart()},handleVSBZoom:function(a){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaHeight*c-this.plotAreaHeight);a<b&&(a=b);this.heightMultiplier=
|
15
|
+
c;this.verticalPosition=a;this.zoomChart()},handleAxisSelfZoom:function(a){if("H"==a.valueAxis.orientation){var c=this.fitMultiplier(a.multiplier);a=-a.position*c;var b=-(this.plotAreaWidth*c-this.plotAreaWidth);a<b&&(a=b);this.horizontalPosition=a;this.widthMultiplier=c}else c=this.fitMultiplier(a.multiplier),a=-a.position*c,b=-(this.plotAreaHeight*c-this.plotAreaHeight),a<b&&(a=b),this.verticalPosition=a,this.heightMultiplier=c;this.zoomChart();c=this.graphs;for(a=0;a<c.length;a++)c[a].setAnimationPlayed();
|
16
|
+
this.zoomScrollbars()},handleCursorZoom:function(a){var c=this.widthMultiplier*this.plotAreaWidth/a.selectionWidth,b=this.heightMultiplier*this.plotAreaHeight/a.selectionHeight,c=this.fitMultiplier(c),b=this.fitMultiplier(b);this.horizontalPosition=(this.horizontalPosition-a.selectionX)*c/this.widthMultiplier;this.verticalPosition=(this.verticalPosition-a.selectionY)*b/this.heightMultiplier;this.widthMultiplier=c;this.heightMultiplier=b;this.zoomChart();this.zoomScrollbars()},removeChartScrollbar:function(){AmCharts.callMethod("destroy",
|
17
|
+
[this.scrollbarH,this.scrollbarV]);this.scrollbarV=this.scrollbarH=null},handleReleaseOutside:function(a){AmCharts.AmXYChart.base.handleReleaseOutside.call(this,a);AmCharts.callMethod("handleReleaseOutside",[this.scrollbarH,this.scrollbarV])}});
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amcharts.rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.0.
|
4
|
+
version: 3.2.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Vandersluis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
type: :runtime
|
@@ -66,6 +66,62 @@ dependencies:
|
|
66
66
|
- - ! '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
name: thor
|
73
|
+
requirement: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ! '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
type: :development
|
85
|
+
prerelease: false
|
86
|
+
name: mechanize
|
87
|
+
requirement: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ! '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
type: :development
|
99
|
+
prerelease: false
|
100
|
+
name: rubyzip
|
101
|
+
requirement: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - '='
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: 1.1.0
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 1.1.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
type: :development
|
113
|
+
prerelease: false
|
114
|
+
name: pry
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ! '>='
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ! '>='
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
69
125
|
description: Ruby wrapper for Amcharts
|
70
126
|
email:
|
71
127
|
- dvandersluis@selfmgmt.com
|
@@ -114,6 +170,7 @@ files:
|
|
114
170
|
- lib/amcharts/settings.rb
|
115
171
|
- lib/amcharts/uses_settings.rb
|
116
172
|
- lib/amcharts/version.rb
|
173
|
+
- lib/tasks/amcharts.thor
|
117
174
|
- spec/chart/serial_spec.rb
|
118
175
|
- spec/chart_builder/function_spec.rb
|
119
176
|
- spec/chart_builder/literal_spec.rb
|