perfmonger 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/.dir-locals.el +2 -0
- data/.gitignore +4 -0
- data/.rspec +1 -0
- data/.travis.yml +12 -0
- data/COPYING +674 -0
- data/Gemfile +5 -0
- data/HOWTO.md +15 -0
- data/NEWS +115 -0
- data/README.md +61 -0
- data/Rakefile +8 -0
- data/bin/perfmonger +6 -0
- data/data/NOTICE +8 -0
- data/data/Twitter_Bootstrap_LICENSE.txt +176 -0
- data/data/assets/css/bootstrap-responsive.css +1109 -0
- data/data/assets/css/bootstrap.css +6167 -0
- data/data/assets/css/perfmonger.css +17 -0
- data/data/assets/dashboard.erb +319 -0
- data/data/assets/img/glyphicons-halflings-white.png +0 -0
- data/data/assets/img/glyphicons-halflings.png +0 -0
- data/data/assets/js/bootstrap.js +2280 -0
- data/data/assets/js/bootstrap.min.js +6 -0
- data/data/assets/js/canvasjs.js +9042 -0
- data/data/assets/js/canvasjs.min.js +271 -0
- data/data/sysstat.ioconf +268 -0
- data/ext/perfmonger/extconf.rb +19 -0
- data/ext/perfmonger/perfmonger.h +58 -0
- data/ext/perfmonger/perfmonger_record.c +754 -0
- data/ext/perfmonger/sysstat/common.c +627 -0
- data/ext/perfmonger/sysstat/common.h +207 -0
- data/ext/perfmonger/sysstat/ioconf.c +515 -0
- data/ext/perfmonger/sysstat/ioconf.h +84 -0
- data/ext/perfmonger/sysstat/iostat.c +1100 -0
- data/ext/perfmonger/sysstat/iostat.h +121 -0
- data/ext/perfmonger/sysstat/libsysstat.h +19 -0
- data/ext/perfmonger/sysstat/mpstat.c +953 -0
- data/ext/perfmonger/sysstat/mpstat.h +79 -0
- data/ext/perfmonger/sysstat/rd_stats.c +2388 -0
- data/ext/perfmonger/sysstat/rd_stats.h +651 -0
- data/ext/perfmonger/sysstat/sysconfig.h +13 -0
- data/lib/perfmonger/cli.rb +115 -0
- data/lib/perfmonger/command/base_command.rb +39 -0
- data/lib/perfmonger/command/fingerprint.rb +453 -0
- data/lib/perfmonger/command/plot.rb +429 -0
- data/lib/perfmonger/command/record.rb +32 -0
- data/lib/perfmonger/command/record_option.rb +149 -0
- data/lib/perfmonger/command/server.rb +294 -0
- data/lib/perfmonger/command/stat.rb +60 -0
- data/lib/perfmonger/command/stat_option.rb +29 -0
- data/lib/perfmonger/command/summary.rb +402 -0
- data/lib/perfmonger/config.rb +6 -0
- data/lib/perfmonger/version.rb +5 -0
- data/lib/perfmonger.rb +12 -0
- data/misc/release-howto.txt +17 -0
- data/misc/sample-cpu.png +0 -0
- data/misc/sample-read-iops.png +0 -0
- data/perfmonger.gemspec +44 -0
- data/test/run-test.sh +39 -0
- data/test/spec/bin_spec.rb +37 -0
- data/test/spec/data/2devices.expected +42 -0
- data/test/spec/data/2devices.output +42 -0
- data/test/spec/spec_helper.rb +20 -0
- data/test/spec/summary_spec.rb +193 -0
- data/test/test-perfmonger.c +145 -0
- data/test/test.h +9 -0
- metadata +154 -0
@@ -0,0 +1,271 @@
|
|
1
|
+
/*
|
2
|
+
* CanvasJS v1.2.1 - http://canvasjs.com/
|
3
|
+
* Copyright 2013 fenopix
|
4
|
+
*/
|
5
|
+
(function(){function I(a,c){var b;b=function(){};b.prototype=c.prototype;b=new b;a.prototype=b;a.prototype.constructor=a;a.parent=c.prototype}function Y(a,c,b){"millisecond"===b?a.setMilliseconds(a.getMilliseconds()+1*c):"second"===b?a.setSeconds(a.getSeconds()+1*c):"minute"===b?a.setMinutes(a.getMinutes()+1*c):"hour"===b?a.setHours(a.getHours()+1*c):"day"===b?a.setDate(a.getDate()+1*c):"week"===b?a.setDate(a.getDate()+7*c):"month"===b?a.setMonth(a.getMonth()+1*c):"year"===b&&a.setFullYear(a.getFullYear()+
|
6
|
+
1*c);return a}function L(a,c){return y[c+"Duration"]*a}function B(a,c){var b=!1;0>a&&(b=!0,a*=-1);a=""+a;for(c=!c?1:c;a.length<c;)a="0"+a;return b?"-"+a:a}function M(a){a=a.replace(/^\s\s*/,"");for(var c=/\s/,b=a.length;c.test(a.charAt(--b)););return a.slice(0,b+1)}function Z(a,c){return a-c}function fa(a,c){return a.x-c.x}function z(a){var c=((a&16711680)>>16).toString(16),b=((a&65280)>>8).toString(16);a=((a&255)>>0).toString(16);c=2>c.length?"0"+c:c;b=2>b.length?"0"+b:b;a=2>a.length?"0"+a:a;return"#"+
|
7
|
+
c+b+a}function S(a){var c=[];c[0]=(a&16711680)>>16;c[1]=(a&65280)>>8;c[2]=(a&255)>>0;return c}function E(a,c,b){this._defaultsKey=a;currentTheme={};b&&(T[b]&&T[b][a])&&(currentTheme=T[b][a]);this._options=c?c:{};this.setOptions(this._options,currentTheme)}function s(a,c,b){s.parent.constructor.call(this,"Chart",c,c.theme?c.theme:"theme1");s.externalReference=b;var d=this;this._containerId=a;this._objectsInitialized=!1;this.overlaidCanvasCtx=this.ctx=null;this._indexLabels=[];this._panTimerId=0;this._lastTouchEventType=
|
8
|
+
"";this.panEnabled=!1;this._defaultCursor="default";if(this._container=document.getElementById(this._containerId))c=a=0,a=this._options.width?this.width:0<this._container.clientWidth?this._container.clientWidth:this.width,c=this._options.height?this.height:0<this._container.clientHeight?this._container.clientHeight:this.height,this.width=a,this.height=c,this._canvasJSContainer=document.createElement("div"),this._canvasJSContainer.style.position="relative",this._container.appendChild(this._canvasJSContainer),
|
9
|
+
this.canvas=document.createElement("canvas"),this.canvas.width=a,this.canvas.height=c,this.canvas.style.background=this.backgroundColor,this.canvas.style.position="absolute",this._canvasJSContainer.appendChild(this.canvas),this.overlaidCanvas=document.createElement("canvas"),this.overlaidCanvas.width=a,this.overlaidCanvas.height=c,this.overlaidCanvas.style.position="absolute",this._canvasJSContainer.appendChild(this.overlaidCanvas),this._eventManager=new Q(this),this._toolBar=document.createElement("div"),
|
10
|
+
this._toolBar.style.position="absolute",this._toolBar.style.top="0px",this._toolBar.style.right="0px",this._canvasJSContainer.appendChild(this._toolBar),this.zoomEnabled&&(this._zoomButton=document.createElement("button"),this._zoomButton.appendChild(document.createTextNode("Pan")),this._toolBar.appendChild(this._zoomButton),this._zoomButton.addEventListener("click",function(){d.zoomEnabled?(d.zoomEnabled=!1,d.panEnabled=!0,d._zoomButton.innerHTML=d._cultureInfo.zoomText,d._defaultCursor="move"):
|
11
|
+
(d.zoomEnabled=!0,d.panEnabled=!1,d._zoomButton.innerHTML=d._cultureInfo.panText,d._defaultCursor="default");d.overlaidCanvas.style.cursor=d._defaultCursor;d.render()},!1)),this.zoomEnabled&&(this._resetButton=document.createElement("button"),this._resetButton.appendChild(document.createTextNode("Reset")),this._toolBar.appendChild(this._resetButton),this.zoomEnabled=this._options.zoomEnabled?!0:!1,this.panEnabled=!1,this.overlaidCanvas.style.cursor=d._defaultCursor,this._resetButton.addEventListener("click",
|
12
|
+
function(){d._toolTip.hide();d.zoomEnabled||d.panEnabled?(d.zoomEnabled=!0,d.panEnabled=!1,d._zoomButton.innerHTML=d._cultureInfo.panText,d._defaultCursor="default",d.overlaidCanvas.style.cursor=d._defaultCursor):(d.zoomEnabled=!1,d.panEnabled=!1);d.sessionVariables.axisX.internalMinimum=d._options.axisX&&d._options.axisX.minimum?d._options.axisX.minimum:null;d.sessionVariables.axisX.internalMaximum=d._options.axisX&&d._options.axisX.maximum?d._options.axisX.maximum:null;d.resetOverlayedCanvas();
|
13
|
+
d.render()},!1)),window.addEventListener("resize",function(){var a=0,b=0,a=d._options.width?d.width:0<d._container.clientWidth?d._container.clientWidth:d.width,b=d._options.height?d.height:0<d._container.clientHeight?d._container.clientHeight:d.height;if(d.canvas.width!==a||d.canvas.height!==b)d.renderCount--,d.canvas.width=a,d.canvas.height=b,d.overlaidCanvas.width=a,d.overlaidCanvas.height=b,d.render()}),this._toolBar.style.display="none",this.bounds={x1:0,y1:0,x2:this.canvas.width,y2:this.canvas.height},
|
14
|
+
d=this,this.canvas.getContext&&(this.ctx=this.canvas.getContext("2d"),this.ctx.textBaseline="top",this.overlaidCanvasCtx=this.overlaidCanvas.getContext("2d"),this.overlaidCanvasCtx.textBaseline="top",this.ctx.roundRect=function(a,b,c,d,k,h,l,n){l&&(this.fillStyle=l);n&&(this.strokeStyle=n);"undefined"==typeof stroke&&(stroke=!0);"undefined"===typeof k&&(k=5);this.lineWidth=h;this.beginPath();this.moveTo(a+k,b);this.lineTo(a+c-k,b);this.quadraticCurveTo(a+c,b,a+c,b+k);this.lineTo(a+c,b+d-k);this.quadraticCurveTo(a+
|
15
|
+
c,b+d,a+c-k,b+d);this.lineTo(a+k,b+d);this.quadraticCurveTo(a,b+d,a,b+d-k);this.lineTo(a,b+k);this.quadraticCurveTo(a,b,a+k,b);this.closePath();l&&this.fill();n&&0<h&&this.stroke()},this.overlaidCanvas.addEventListener("click",function(a){d._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mousemove",function(a){d._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mouseup",function(a){d._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener("mousedown",function(a){d._mouseEventHandler(a)},
|
16
|
+
!1),this.overlaidCanvas.addEventListener("mouseout",function(a){d._mouseEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",function(a){d._touchEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",function(a){d._touchEventHandler(a)},!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerUp":"touchend",function(a){d._touchEventHandler(a)},
|
17
|
+
!1),this.overlaidCanvas.addEventListener(window.navigator.msPointerEnabled?"MSPointerCancel":"touchcancel",function(a){d._touchEventHandler(a)},!1)),this._toolTip=new H(this,this._options.toolTip,this.theme),this.layoutManager=new N(this.canvas),this.axisY2=this.axisY=this.axisX=this.data=null,this.renderCount=0,this.creditText&&this.creditHref&&(this._creditLink=document.createElement("a"),this._creditLink.setAttribute("style","outline:none;margin:0px;position:absolute;right:3px;top:"+(c-14)+"px;color:dimgrey;text-decoration:none;font-size:10px;font-family:Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"),
|
18
|
+
this._creditLink.setAttribute("tabIndex",-1),this._creditLink.setAttribute("href",this.creditHref),this._creditLink.innerHTML=this.creditText,this._creditLink.setAttribute("target","_blank"),this._canvasJSContainer.appendChild(this._creditLink)),this.sessionVariables={axisX:{internalMinimum:null,internalMaximum:null},axisY:{internalMinimum:null,internalMaximum:null},axisY2:{internalMinimum:null,internalMaximum:null}}}function $(a,c){for(var b=[],d=0;d<a.length;d++)if(0==d)b.push(a[0]);else{var e,
|
19
|
+
f,g;g=d-1;e=0===g?0:g-1;f=g===a.length-1?g:g+1;b[b.length]={x:a[g].x+(a[f].x-a[e].x)/c/3,y:a[g].y+(a[f].y-a[e].y)/c/3};g=d;e=0===g?0:g-1;f=g===a.length-1?g:g+1;b[b.length]={x:a[g].x-(a[f].x-a[e].x)/c/3,y:a[g].y-(a[f].y-a[e].y)/c/3};b[b.length]=a[d]}return b}function N(a){this._rightOccupied=this._leftOccupied=this._bottomOccupied=this._topOccupied=0;this.canvas=a}function C(a,c){C.parent.constructor.call(this,"TextBlock",c);this.ctx=a;this._isDirty=!0;this._wrappedText=null}function O(a,c){O.parent.constructor.call(this,
|
20
|
+
"Title",c,a.theme);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;"undefined"===typeof this._options.fontSize&&(this.fontSize=this.chart.getAutoFontSize(this.fontSize));this.height=this.width=null;this.bounds={x1:null,y1:null,x2:null,y2:null}}function R(a,c,b){R.parent.constructor.call(this,"Legend",c,b);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.height=this.width=0;this.orientation=null;this.horizontalSpacing=10;this.dataSeries=[];this.bounds={x1:null,y1:null,x2:null,
|
21
|
+
y2:null}}function U(a,c){U.parent.constructor.call(this,c);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx}function J(a,c,b,d,e){J.parent.constructor.call(this,"DataSeries",c,b);this.chart=a;this.canvas=a.canvas;this._ctx=a.canvas.ctx;this.index=d;this.noDataPointsInPlotArea=0;this.id=e;this.dataPointIds=[];this.axisY=this.axisX=null;this.axisPlacement=this.getDefaultAxisPlacement()}function x(a,c,b,d){x.parent.constructor.call(this,"Axis",c,a.theme);this.chart=a;this.canvas=a.canvas;this.ctx=
|
22
|
+
a.ctx;this.intervalStartPosition=this.maxHeight=this.maxWidth=0;this.labels=[];this.dataInfo={min:Infinity,max:-Infinity,viewPortMin:Infinity,viewPortMax:-Infinity,minDiff:Infinity};"axisX"===b?(this.sessionVariables=this.chart.sessionVariables[b],this._options.interval||(this.intervalType=null)):this.sessionVariables="left"===d||"top"===d?this.chart.sessionVariables.axisY:this.chart.sessionVariables.axisY2;"undefined"===typeof this._options.titleFontSize&&(this.titleFontSize=fontSize=this.chart.getAutoFontSize(this.titleFontSize));
|
23
|
+
"undefined"===typeof this._options.labelFontSize&&(this.labelFontSize=this.chart.getAutoFontSize(this.labelFontSize));this.type=b;if(!c||"undefined"===typeof c.gridThickness)this.gridThickness="axisX"===b?0:1;this._labels=null;this._position=d;this.lineCoordinates={x1:null,y1:null,x2:null,y2:null,width:null};this.labelAngle=(this.labelAngle%360+360)%360;90<this.labelAngle&&270>=this.labelAngle?this.labelAngle-=180:180<this.labelAngle&&270>=this.labelAngle?this.labelAngle-=180:270<this.labelAngle&&
|
24
|
+
360>=this.labelAngle&&(this.labelAngle-=360);this._absoluteMaximum=this._absoluteMinimum=this._titleTextBlock=null;this.hasOptionChanged("minimum")&&(this.sessionVariables.internalMinimum=this.minimum);this.hasOptionChanged("maximum")&&(this.sessionVariables.internalMaximum=this.maximum);this.trackChanges("minimum");this.trackChanges("maximum")}function H(a,c,b){H.parent.constructor.call(this,"ToolTip",c,b);this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx;this.currentDataPointIndex=this.currentSeriesIndex=
|
25
|
+
-1;this._timerId=0;this._prevY=this._prevX=NaN;this._initialize()}function Q(a){this.chart=a;this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previousDataPointEventObject=null;this.ghostCanvas=document.createElement("canvas");this.ghostCanvas.width=this.chart.canvas.width;this.ghostCanvas.height=this.chart.canvas.height;this.ghostCtx=this.ghostCanvas.getContext("2d")}function aa(a,c){var b;c&&V[c]&&(b=V[c]);O.parent.constructor.call(this,"CultureInfo",b,a.theme);
|
26
|
+
this.chart=a;this.canvas=a.canvas;this.ctx=this.chart.ctx}var ba={Chart:{width:500,height:400,zoomEnabled:!1,backgroundColor:"white",backgroundColor:"white",theme:"theme1",animationEnabled:!0,colorSet:"colorSet1",culture:"en",creditHref:"http://canvasjs.com/",creditText:"CanvasJS.com"},CultureInfo:{decimalSeparator:".",digitGroupSeparator:",",zoomText:"Zoom",panText:"Pan",resetText:"Reset",days:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),shortDays:"Sun Mon Tue Wed Thu Fri Sat".split(" "),
|
27
|
+
months:"January February March April May June July August September October November December".split(" "),shortMonths:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ")},Title:{padding:0,text:null,verticalAlign:"top",horizontalAlign:"center",fontSize:20,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,margin:5},DataSeries:{name:null,dataPoints:null,label:"",bevelEnabled:!1,cursor:null,
|
28
|
+
indexLabel:"",indexLabelPlacement:"outside",indexLabelOrientation:"horizontal",indexLabelFontColor:"black",indexLabelFontSize:12,indexLabelFontStyle:"normal",indexLabelFontFamily:"Arial",indexLabelFontWeight:"normal",indexLabelBackgroundColor:null,indexLabelLineColor:"#808080",indexLabelLineThickness:1,lineThickness:2,color:null,startAngle:0,type:"column",xValueType:"number",axisYType:"primary",xValueFormatString:null,yValueFormatString:null,showInLegend:null,legendMarkerType:null,legendMarkerColor:null,
|
29
|
+
legendText:null,markerType:"circle",markerColor:null,markerSize:null,markerBorderColor:null,markerBorderThickness:null,mouseover:null,mouseout:null,mousemove:null,click:null,toolTipContent:null},Axis:{minimum:null,maximum:null,interval:null,intervalType:null,title:null,titleFontColor:"black",titleFontSize:20,titleFontFamily:"arial",titleFontWeight:"normal",titleFontStyle:"normal",labelAngle:0,labelFontFamily:"arial",labelFontColor:"black",labelFontSize:12,labelFontWeight:"normal",labelFontStyle:"normal",
|
30
|
+
prefix:"",suffix:"",includeZero:!0,tickLength:5,tickColor:"black",tickThickness:1,lineColor:"black",lineThickness:1,gridColor:"A0A0A0",gridThickness:0,interlacedColor:null,valueFormatString:null,margin:2},Legend:{name:null,borderThickness:0,borderColor:"black",cornerRadius:0,verticalAlign:"center",horizontalAlign:"right",fontSize:14,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal"},ToolTip:{enabled:!0,borderColor:null,shared:!1,animationEnabled:!0,content:null},TextBlock:{x:0,
|
31
|
+
y:0,width:null,height:null,maxWidth:null,maxHeight:null,padding:0,angle:0,text:"",horizontalAlign:"center",fontSize:12,fontFamily:"Calibri",fontWeight:"normal",fontColor:"black",fontStyle:"normal",borderThickness:0,borderColor:"black",cornerRadius:0,backgroundColor:null,textBaseline:"top"}},V={en:{}},P={colorSet1:"#369EAD #C24642 #7F6084 #86B402 #A2D1CF #C8B631 #6DBCEB #52514E #4F81BC #A064A1 #F79647".split(" "),colorSet2:"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647".split(" "),colorSet3:"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7 #008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split(" ")},
|
32
|
+
T={theme1:{Chart:{colorSet:P[0]},Title:{fontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",fontSize:33,fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",margin:10},Axis:{titleFontSize:26,titleFontColor:"#666666",titleFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",labelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",labelFontSize:18,labelFontColor:"grey",tickColor:"#BBBBBB",tickThickness:2,gridThickness:2,gridColor:"#BBBBBB",lineThickness:2,
|
33
|
+
lineColor:"#BBBBBB"},Legend:{verticalAlign:"bottom",horizontalAlign:"center",fontFamily:"monospace, sans-serif,arial black"},DataSeries:{indexLabelFontColor:"grey",indexLabelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}},theme2:{Chart:{colorSet:"colorSet2"},Title:{fontFamily:"impact, charcoal, arial black, sans-serif",fontSize:32,fontColor:"#333333",verticalAlign:"top",margin:10},Axis:{titleFontSize:22,
|
34
|
+
titleFontColor:"rgb(98,98,98)",titleFontFamily:"monospace, sans-serif,arial black",titleFontWeight:"bold",labelFontFamily:"monospace, Courier New, Courier",labelFontSize:16,labelFontColor:"grey",labelFontWeight:"bold",tickColor:"grey",tickThickness:2,gridThickness:2,gridColor:"grey",lineThickness:0},Legend:{verticalAlign:"bottom",horizontalAlign:"center",fontFamily:"monospace, sans-serif,arial black"},DataSeries:{indexLabelFontColor:"grey",indexLabelFontFamily:"Courier New, Courier, monospace",indexLabelFontWeight:"bold",
|
35
|
+
indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}},theme3:{Chart:{colorSet:"colorSet1"},Title:{fontFamily:"Candara, Optima, Trebuchet MS, Helvetica Neue, Helvetica, Trebuchet MS, serif",fontSize:32,fontColor:"rgb(68,78,58)",fontColor:"#3A3A3A",fontWeight:"bold",verticalAlign:"top",margin:10},Axis:{titleFontSize:22,titleFontColor:"rgb(98,98,98)",titleFontFamily:"Verdana, Geneva, Calibri, sans-serif",labelFontFamily:"Calibri, Optima, Candara, Verdana, Geneva, sans-serif",
|
36
|
+
labelFontSize:18,labelFontColor:"grey",tickColor:"grey",tickThickness:2,gridThickness:2,gridColor:"grey",lineThickness:2,lineColor:"grey"},Legend:{verticalAlign:"bottom",horizontalAlign:"center",fontFamily:"monospace, sans-serif,arial black"},DataSeries:{bevelEnabled:!0,indexLabelFontColor:"grey",indexLabelFontFamily:"Candara, Optima, Calibri, Verdana, Geneva, sans-serif",indexLabelFontSize:18,indexLabelLineColor:"lightgrey",indexLabelLineThickness:2}}},y={numberDuration:1,yearDuration:314496E5,monthDuration:2592E6,
|
37
|
+
weekDuration:6048E5,dayDuration:864E5,hourDuration:36E5,minuteDuration:6E4,secondDuration:1E3,millisecondDuration:1,dayOfWeekFromInt:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" ")},W,ga=/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*"|'[^']*'/g,ha="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ia="Sun Mon Tue Wed Thu Fri Sat".split(" "),ja="January February March April May June July August September October November December".split(" "),
|
38
|
+
ka="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),la=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,ma=/[^-+\dA-Z]/g;W=function(a,c,b){var d=b?b.days:ha,e=b?b.months:ja,f=b?b.shortDays:ia,g=b?b.shortMonths:ka;b="";var j=!1;a=a&&a.getTime?a:a?new Date(a):new Date;if(isNaN(a))throw SyntaxError("invalid date");"UTC:"==c.slice(0,4)&&(c=c.slice(4),j=!0);b=j?"getUTC":"get";var k=a[b+"Date"](),h=a[b+"Day"](),
|
39
|
+
l=a[b+"Month"](),n=a[b+"FullYear"](),p=a[b+"Hours"](),m=a[b+"Minutes"](),r=a[b+"Seconds"](),q=a[b+"Milliseconds"](),t=j?0:a.getTimezoneOffset();return b=c.replace(ga,function(b){switch(b){case "D":return k;case "DD":return B(k,2);case "DDD":return f[h];case "DDDD":return d[h];case "M":return l+1;case "MM":return B(l+1,2);case "MMM":return g[l];case "MMMM":return e[l];case "Y":return parseInt(String(n).slice(-2));case "YY":return B(String(n).slice(-2),2);case "YYY":return B(String(n).slice(-3),3);
|
40
|
+
case "YYYY":return B(n,4);case "h":return p%12||12;case "hh":return B(p%12||12,2);case "H":return p;case "HH":return B(p,2);case "m":return m;case "mm":return B(m,2);case "s":return r;case "ss":return B(r,2);case "f":return String(q).slice(0,1);case "ff":return B(String(q).slice(0,2),2);case "fff":return B(String(q).slice(0,3),3);case "t":return 12>p?"a":"p";case "tt":return 12>p?"am":"pm";case "T":return 12>p?"A":"P";case "TT":return 12>p?"AM":"PM";case "K":return j?"UTC":(String(a).match(la)||[""]).pop().replace(ma,
|
41
|
+
"");case "z":return(0<t?"-":"+")+Math.floor(Math.abs(t)/60);case "zz":return(0<t?"-":"+")+B(Math.floor(Math.abs(t)/60),2);case "zzz":return(0<t?"-":"+")+B(Math.floor(Math.abs(t)/60),2)+B(Math.abs(t)%60,2);default:return b.slice(1,b.length-1)}})};var X=function(a,c,b){a=Number(a);var d=0>a?!0:!1;d&&(a*=-1);decimalSeparator=b?b.decimalSeparator:".";digitGroupSeparator=b?b.digitGroupSeparator:",";var e="";c=String(c);for(var e=1,f=b="",g=-1,j=[],k=[],h=0,l=0,n=0,e=1,p=!1,m=0,f=c.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g),
|
42
|
+
r=0;f&&r<f.length;r++)if(c=f[r],"."===c&&0>g)g=r;else{if("%"===c)e*=100;else if("\u2030"===c){e*=1E3;continue}else if(","===c[0]&&"."===c[c.length-1]){e/=Math.pow(1E3,c.length-1);g=r+c.length-1;continue}else if(("E"===c[0]||"e"===c[0])&&"0"===c[c.length-1])p=!0;0>g?(j.push(c),"#"===c||"0"===c?h++:","===c&&n++):(k.push(c),("#"===c||"0"===c)&&l++)}p&&(c=Math.floor(a),m=(0===c?"":String(c)).length-h,e/=Math.pow(10,m));0>g&&(g=r);e=(a*e).toFixed(l);c=e.split(".");a=(c[0]+"").split("");e=(c[1]+"").split("");
|
43
|
+
a&&"0"===a[0]&&a.shift();for(r=p=f=l=g=0;0<j.length;)if(c=j.pop(),"#"===c||"0"===c)if(g++,g===h){var q=a;a=[];if("0"===c)for(c=h-l-(q?q.length:0);0<c;)q.unshift("0"),c--;for(;0<q.length;)b=q.pop()+b,r++,0===r%p&&(f===n&&0<q.length)&&(b=digitGroupSeparator+b);d&&(b="-"+b)}else 0<a.length?(b=a.pop()+b,l++,r++):"0"===c&&(b="0"+b,l++,r++),0===r%p&&(f===n&&0<a.length)&&(b=digitGroupSeparator+b);else("E"===c[0]||"e"===c[0])&&"0"===c[c.length-1]&&/[eE][+-]*[0]+/.test(c)?(c=0>m?c.replace("+","").replace("-",
|
44
|
+
""):c.replace("-",""),b+=c.replace(/[0]+/,function(a){return B(m,a.length)})):","===c?(f++,p=r,r=0,0<a.length&&(b=digitGroupSeparator+b)):b=1<c.length&&('"'===c[0]&&'"'===c[c.length-1]||"'"===c[0]&&"'"===c[c.length-1])?c.slice(1,c.length-1)+b:c+b;for(d=0;0<k.length;)c=k.shift(),"#"===c||"0"===c?0<e.length&&0!==Number(e.join(""))?b+=(0===d++?decimalSeparator:"")+e.shift():"0"===c&&(b+=(0===d++?decimalSeparator:"")+"0"):1<c.length&&('"'===c[0]&&'"'===c[c.length-1]||"'"===c[0]&&"'"===c[c.length-1])?
|
45
|
+
b+=(0===d++?decimalSeparator:"")+c.slice(1,c.length-1):("E"===c[0]||"e"===c[0])&&"0"===c[c.length-1]&&/[eE][+-]*[0]+/.test(c)?(c=0>m?c.replace("+","").replace("-",""):c.replace("-",""),b+=c.replace(/[0]+/,function(a){return B(m,a.length)})):b+=(0===d++?decimalSeparator:"")+c;return b},ca=function(a){var c=0,b=0;a||(a=window.event);a.offsetX||0===a.offsetX?(c=a.offsetX,b=a.offsetY):a.layerX||0==a.layerX?(c=a.layerX,b=a.layerY):(c=a.pageX-a.target.offsetLeft,b=a.pageY-a.target.offsetTop);return{x:c,
|
46
|
+
y:b}};E.prototype.setOptions=function(a,c){if(ba[this._defaultsKey]){var b=ba[this._defaultsKey];for(prop in b)this[prop]=a&&prop in a?a[prop]:c&&prop in c?c[prop]:b[prop]}};E.prototype.trackChanges=function(a){this._options._oldOptions||(this._options._oldOptions={});this._options._oldOptions[a]=this._options[a]};E.prototype.isBeingTracked=function(a){this._options._oldOptions||(this._options._oldOptions={});return this._options._oldOptions[a]?!0:!1};E.prototype.hasOptionChanged=function(a){this._options._oldOptions||
|
47
|
+
(this._options._oldOptions={});return this._options._oldOptions[a]!==this._options[a]};I(s,E);s.prototype._initialize=function(){this._selectedColorSet="undefined"!==typeof P[this.colorSet]?P[this.colorSet]:P.colorSet1;this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height);this.ctx.beginPath();this.axisY2=this.axisY=this.axisX=null;this._indexLabels=[];this._events=[];this._eventManager&&this._eventManager.reset();this.plotInfo={axisPlacement:null,axisXValueType:null,plotTypes:[]};this.layoutManager.reset();
|
48
|
+
this._cultureInfo=new aa(this,this._options.culture);this.data=[];for(var a=0,c=0;c<this._options.data.length;c++)if(a++,!this._options.data[c].type||0<=s._supportedChartTypes.indexOf(this._options.data[c].type)){var b=new J(this,this._options.data[c],this.theme,a-1,++this._eventManager.lastObjectId);null===b.name&&(b.name="DataSeries "+a);null===b.color?1<this._options.data.length?(b._colorSet=[this._selectedColorSet[b.index%this._selectedColorSet.length]],b.color=this._selectedColorSet[b.index%
|
49
|
+
this._selectedColorSet.length]):b._colorSet="line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"splineArea"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type?[this._selectedColorSet[0]]:this._selectedColorSet:b._colorSet=[b.color];if(null===b.markerSize&&(("line"===b.type||"stepLine"===b.type||"spline"===b.type)&&b.dataPoints.length<this.canvas.width/16||"scatter"===b.type))b.markerSize=8;("bubble"===b.type||"scatter"===b.type)&&b.dataPoints.sort(fa);this.data.push(b);
|
50
|
+
var d=b.axisPlacement,e;"normal"===d?"xySwapped"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with bar chart':"none"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with pie chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="normal"):"xySwapped"===d?"normal"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with line, area, column or pie chart':"none"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with pie chart':
|
51
|
+
null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="xySwapped"):"none"==d&&("normal"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with line, area, column or bar chart':"xySwapped"===this.plotInfo.axisPlacement?e='You cannot combine "'+b.type+'" with bar chart':null===this.plotInfo.axisPlacement&&(this.plotInfo.axisPlacement="none"));if(e&&window.console){window.console.log(e);return}}this._objectsInitialized=!0};s._supportedChartTypes="line stepLine spline column area splineArea bar bubble scatter stackedColumn stackedColumn100 stackedBar stackedBar100 stackedArea stackedArea100 pie doughnut".split(" ");
|
52
|
+
s.prototype.render=function(){this._initialize();for(var a=0;a<this.data.length;a++)if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)!this.data[a].axisYType||"primary"===this.data[a].axisYType?(this.axisY||("normal"===this.plotInfo.axisPlacement?this.axisY=new x(this,this._options.axisY,"axisY","left"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisY=new x(this,this._options.axisY,"axisY","bottom"))),this.data[a].axisY=this.axisY):"secondary"===this.data[a].axisYType&&
|
53
|
+
(this.axisY2||("normal"===this.plotInfo.axisPlacement?this.axisY2=new x(this,this._options.axisY2,"axisY","right"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisY2=new x(this,this._options.axisY2,"axisY","top"))),this.data[a].axisY=this.axisY2),this.axisX||("normal"===this.plotInfo.axisPlacement?this.axisX=new x(this,this._options.axisX,"axisX","bottom"):"xySwapped"===this.plotInfo.axisPlacement&&(this.axisX=new x(this,this._options.axisX,"axisX","left"))),this.data[a].axisX=this.axisX;this._processData();
|
54
|
+
this._options.title&&(this._title=new O(this,this._options.title),this._title.render());this.legend=new R(this,this._options.legend,this.theme);for(a=0;a<this.data.length;a++)this.data[a].showInLegend&&this.legend.dataSeries.push(this.data[a]);this.legend.render();if("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)x.setLayoutAndRender(this.axisX,this.axisY,this.axisY2,this.plotInfo.axisPlacement,this.layoutManager.getFreeSpace());else if("none"!==this.plotInfo.axisPlacement)return;
|
55
|
+
for(a=0;a<this.plotInfo.plotTypes.length;a++)for(var c=this.plotInfo.plotTypes[a],b=0;b<c.plotUnits.length;b++){var d=c.plotUnits[b];"line"===d.type?this.renderLine(d):"stepLine"===d.type?this.renderStepLine(d):"spline"===d.type?this.renderSpline(d):"column"===d.type?this.renderColumn(d):"bar"===d.type?this.renderBar(d):"area"===d.type?this.renderArea(d):"splineArea"===d.type?this.renderSplineArea(d):"stackedColumn"===d.type?this.renderStackedColumn(d):"stackedColumn100"===d.type?this.renderStackedColumn100(d):
|
56
|
+
"stackedBar"===d.type?this.renderStackedBar(d):"stackedBar100"===d.type?this.renderStackedBar100(d):"stackedArea"===d.type?this.renderStackedArea(d):"stackedArea100"===d.type?this.renderStackedArea100(d):"bubble"===d.type?this.renderBubble(d):"scatter"===d.type?this.renderScatter(d):"pie"===d.type?this.renderPie(d):"doughnut"===d.type&&this.renderPie(d)}0<this._indexLabels.length&&this.renderIndexLabels();this.attachPlotAreaEventHandlers();!this.zoomEnabled&&(!this.panEnabled&&"none"!==this._toolBar.style.display)&&
|
57
|
+
(this._toolBar.style.display="none");this._toolTip._updateToolTip();this.renderCount++};s.prototype.attachPlotAreaEventHandlers=function(){this.attachEvent({context:this,chart:this,mousedown:this._plotAreaMouseDown,mouseup:this._plotAreaMouseUp,mousemove:this._plotAreaMouseMove,capture:!0,bounds:this.getPlotArea()})};s.prototype.categoriseDataSeries=function(){for(var a="",c=0;c<this.data.length;c++)if(a=this.data[c],a.dataPoints&&0!==a.dataPoints.length&&0<=s._supportedChartTypes.indexOf(a.type)){for(var b=
|
58
|
+
null,d=!1,e=null,f=!1,g=0;g<this.plotInfo.plotTypes.length;g++)if(this.plotInfo.plotTypes[g].type===a.type){d=!0;b=this.plotInfo.plotTypes[g];break}d||(b={type:a.type,totalDataSeries:0,plotUnits:[]},this.plotInfo.plotTypes.push(b));for(g=0;g<b.plotUnits.length;g++)if(b.plotUnits[g].axisYType===a.axisYType){f=!0;e=b.plotUnits[g];break}f||(e={type:a.type,previousDataSeriesCount:0,index:b.plotUnits.length,plotType:b,axisYType:a.axisYType,axisY:"primary"===a.axisYType?this.axisY:this.axisY2,axisX:this.axisX,
|
59
|
+
dataSeriesIndexes:[]},b.plotUnits.push(e));b.totalDataSeries++;e.dataSeriesIndexes.push(c)}for(c=0;c<this.plotInfo.plotTypes.length;c++){b=this.plotInfo.plotTypes[c];for(g=a=0;g<b.plotUnits.length;g++)b.plotUnits[g].previousDataSeriesCount=a,a+=b.plotUnits[g].dataSeriesIndexes.length}};s.prototype.assignIdToDataPoints=function(){for(var a=0;a<this.data.length;a++)for(var c=this.data[a],b=c.dataPoints.length,d=0;d<b;d++)c.dataPointIds[d]=++this._eventManager.lastObjectId};s.prototype._processData=
|
60
|
+
function(){this.assignIdToDataPoints();this.categoriseDataSeries();for(var a=0;a<this.plotInfo.plotTypes.length;a++)for(var c=this.plotInfo.plotTypes[a],b=0;b<c.plotUnits.length;b++){var d=c.plotUnits[b];"line"===d.type||"stepLine"===d.type||"spline"===d.type||"column"===d.type||"area"===d.type||"splineArea"===d.type||"bar"===d.type||"bubble"===d.type||"scatter"===d.type?this._processMultiseriesPlotUnit(d):"stackedColumn"===d.type||"stackedBar"===d.type||"stackedArea"===d.type?this._processStackedPlotUnit(d):
|
61
|
+
("stackedColumn100"===d.type||"stackedBar100"===d.type||"stackedArea100"===d.type)&&this._processStacked100PlotUnit(d)}};s.prototype._processMultiseriesPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length))for(var c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,e,f=!1,g=0;g<a.dataSeriesIndexes.length;g++){var j=this.data[a.dataSeriesIndexes[g]],k=0,h=!1,l=!1;if("normal"===j.axisPlacement||"xySwapped"===j.axisPlacement)var n=this.sessionVariables.axisX.internalMinimum?this.sessionVariables.axisX.internalMinimum:
|
62
|
+
this._options.axisX&&this._options.axisX.minimum?this._options.axisX.minimum:-Infinity,p=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:Infinity;if(j.dataPoints[k].x&&j.dataPoints[k].x.getTime||"dateTime"===j.xValueType)f=!0;for(k=0;k<j.dataPoints.length;k++){"undefined"===typeof j.dataPoints[k].x&&(j.dataPoints[k].x=k);j.dataPoints[k].x.getTime?(f=!0,d=j.dataPoints[k].x.getTime()):
|
63
|
+
d=j.dataPoints[k].x;e=j.dataPoints[k].y;d<b.min&&(b.min=d);d>b.max&&(b.max=d);e<c.min&&(c.min=e);e>c.max&&(c.max=e);if(0<k){var m=d-j.dataPoints[k-1].x;0>m&&(m*=-1);b.minDiff>m&&0!==m&&(b.minDiff=m)}if(!(d<n)||h){if(!h&&(h=!0,0<k)){k-=2;continue}if(d>p&&!l)l=!0;else if(d>p&&l)continue;j.dataPoints[k].label&&(a.axisX.labels[d]=j.dataPoints[k].label);d<b.viewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&(b.viewPortMax=d);e<c.viewPortMin&&(c.viewPortMin=e);e>c.viewPortMax&&(c.viewPortMax=e)}}this.plotInfo.axisXValueType=
|
64
|
+
j.xValueType=f?"dateTime":"number"}};s.prototype._processStackedPlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,e,f=!1,g=[],j=[],k=0;k<a.dataSeriesIndexes.length;k++){var h=this.data[a.dataSeriesIndexes[k]],l=0,n=!1,p=!1;if("normal"===h.axisPlacement||"xySwapped"===h.axisPlacement)var m=this.sessionVariables.axisX.internalMinimum?this.sessionVariables.axisX.internalMinimum:this._options.axisX&&this._options.axisX.minimum?
|
65
|
+
this._options.axisX.minimum:-Infinity,r=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:Infinity;if(h.dataPoints[l].x&&h.dataPoints[l].x.getTime||"dateTime"===h.xValueType)f=!0;for(l=0;l<h.dataPoints.length;l++){"undefined"===typeof h.dataPoints[l].x&&(h.dataPoints[l].x=l);h.dataPoints[l].x.getTime?(f=!0,d=h.dataPoints[l].x.getTime()):d=h.dataPoints[l].x;e=h.dataPoints[l].y;d<b.min&&
|
66
|
+
(b.min=d);d>b.max&&(b.max=d);if(0<l){var q=d-h.dataPoints[l-1].x;0>q&&(q*=-1);b.minDiff>q&&0!==q&&(b.minDiff=q)}if(!(d<m)||n){if(!n&&(n=!0,0<l)){l-=2;continue}if(d>r&&!p)p=!0;else if(d>r&&p)continue;h.dataPoints[l].label&&(a.axisX.labels[d]=h.dataPoints[l].label);d<b.viewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&(b.viewPortMax=d);0<=e?g[d]=g[d]?g[d]+e:e:j[d]=j[d]?j[d]+e:e}}this.plotInfo.axisXValueType=h.xValueType=f?"dateTime":"number"}for(l in g)isNaN(l)||(a=g[l],a<c.min&&(c.min=a),a>c.max&&(c.max=
|
67
|
+
a),l<b.viewPortMin||l>b.viewPortMax||(a<c.viewPortMin&&(c.viewPortMin=a),a>c.viewPortMax&&(c.viewPortMax=a)));for(l in j)isNaN(l)||(a=j[l],a<c.min&&(c.min=a),a>c.max&&(c.max=a),l<b.viewPortMin||l>b.viewPortMax||(a<c.viewPortMin&&(c.viewPortMin=a),a>c.viewPortMax&&(c.viewPortMax=a)))}};s.prototype._processStacked100PlotUnit=function(a){if(a.dataSeriesIndexes&&!(1>a.dataSeriesIndexes.length)){for(var c=a.axisY.dataInfo,b=a.axisX.dataInfo,d,e,f=!1,g=!1,j=!1,k=[],h=0;h<a.dataSeriesIndexes.length;h++){var l=
|
68
|
+
this.data[a.dataSeriesIndexes[h]],n=0,p=!1,m=!1;if("normal"===l.axisPlacement||"xySwapped"===l.axisPlacement)var r=this.sessionVariables.axisX.internalMinimum?this.sessionVariables.axisX.internalMinimum:this._options.axisX&&this._options.axisX.minimum?this._options.axisX.minimum:-Infinity,q=this.sessionVariables.axisX.internalMaximum?this.sessionVariables.axisX.internalMaximum:this._options.axisX&&this._options.axisX.maximum?this._options.axisX.maximum:Infinity;if(l.dataPoints[n].x&&l.dataPoints[n].x.getTime||
|
69
|
+
"dateTime"===l.xValueType)f=!0;for(n=0;n<l.dataPoints.length;n++){"undefined"===typeof l.dataPoints[n].x&&(l.dataPoints[n].x=n);l.dataPoints[n].x.getTime?(f=!0,d=l.dataPoints[n].x.getTime()):d=l.dataPoints[n].x;e=l.dataPoints[n].y;d<b.min&&(b.min=d);d>b.max&&(b.max=d);if(0<n){var t=d-l.dataPoints[n-1].x;0>t&&(t*=-1);b.minDiff>t&&0!==t&&(b.minDiff=t)}if(!(d<r)||p){if(!p&&(p=!0,0<n)){n-=2;continue}if(d>q&&!m)m=!0;else if(d>q&&m)continue;l.dataPoints[n].label&&(a.axisX.labels[d]=l.dataPoints[n].label);
|
70
|
+
d<b.viewPortMin&&(b.viewPortMin=d);d>b.viewPortMax&&(b.viewPortMax=d);0<=e?g=!0:j=!0;k[d]=k[d]?k[d]+Math.abs(e):Math.abs(e)}}this.plotInfo.axisXValueType=l.xValueType=f?"dateTime":"number"}g&&!j?(c.max=99,c.min=1):g&&j?(c.max=99,c.min=-99):!g&&j&&(c.max=-1,c.min=-99);c.viewPortMin=c.min;c.viewPortMax=c.max;a.dataPointYSums=k}};s.prototype.getAutoFontSize=function(a){return Math.min(this.canvas.width,this.canvas.height)*(a/400)};s.prototype.resetOverlayedCanvas=function(){var a=this.overlaidCanvas.width;
|
71
|
+
this.overlaidCanvas.width=0;this.overlaidCanvas.width=a};s.prototype.attachEvent=function(a){this._events.push(a)};s.prototype._touchEventHandler=function(a){if(a.changedTouches){var c=[];first=(c=a.changedTouches)?c[0]:a;switch(a.type){case "touchstart":case "MSPointerDown":c=["mousemove","mousedown"];break;case "touchmove":case "MSPointerMove":c=["mousemove"];break;case "touchend":case "MSPointerUp":c="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType?["mouseup",
|
72
|
+
"click"]:["mouseup"];break;default:return}this._lastTouchEventType=a.type;for(var b=0;b<c.length;b++){var d=c[b],e=document.createEvent("MouseEvent");e.initMouseEvent(d,!0,!0,window,1,first.screenX,first.screenY,first.clientX,first.clientY,!1,!1,!1,!1,0,null);first.target.dispatchEvent(e);a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault()}}};s.prototype._mouseEventHandler=function(a){a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault();
|
73
|
+
var c=ca(a),b=a.type,d;a.which?d=3==a.which:a.button&&(d=2==a.button);if(!d){if(s.capturedEventParam)d=s.capturedEventParam,"mouseup"===b&&(s.capturedEventParam=null,d.chart.overlaidCanvas.releaseCapture?d.chart.overlaidCanvas.releaseCapture():document.body.removeEventListener("mouseup",d.chart._mouseEventHandler,!1)),d.hasOwnProperty(b)&&d[b].call(d.context,c.x,c.y);else if(this._events)for(var e=0;e<this._events.length;e++)if(this._events[e].hasOwnProperty(b)){d=this._events[e];var f=d.bounds;if(c.x>=
|
74
|
+
f.x1&&c.x<=f.x2&&c.y>=f.y1&&c.y<=f.y2){d[b].call(d.context,c.x,c.y);"mousedown"===b&&!0===d.capture?(s.capturedEventParam=d,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.body.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(d.chart.overlaidCanvas.releaseCapture?d.chart.overlaidCanvas.releaseCapture():document.body.removeEventListener("mouseup",this._mouseEventHandler,!1));break}}this._toolTip&&this._toolTip.enabled&&(b=this.getPlotArea(),(c.x<b.x1||
|
75
|
+
c.x>b.x2||c.y<b.y1||c.y>b.y2)&&this._toolTip.hide());(!this.isDrag||!this.zoomEnabled)&&this._eventManager&&this._eventManager.mouseEventHandler(a)}};s.prototype._plotAreaMouseDown=function(a,c){this.isDrag=!0;this.dragStartPoint="none"!==this.plotInfo.axisPlacement?{x:a,y:c,xMinimum:this.axisX.minimum,xMaximum:this.axisX.maximum}:{x:a,y:c}};s.prototype._plotAreaMouseUp=function(a,c){var b,d;if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var e=
|
76
|
+
0,e=this.axisX.lineCoordinates,e="xySwapped"===this.plotInfo.axisPlacement?c-this.dragStartPoint.y:this.dragStartPoint.x-a;Math.abs(this.axisX.maximum-this.axisX.minimum);if(2<Math.abs(e)){if(this.panEnabled)e=!1,d=0,this.axisX.sessionVariables.internalMinimum<this.axisX._absoluteMinimum?(d=this.axisX._absoluteMinimum-this.axisX.sessionVariables.internalMinimum,this.axisX.sessionVariables.internalMinimum+=d,this.axisX.sessionVariables.internalMaximum+=d,e=!0):this.axisX.sessionVariables.internalMaximum>
|
77
|
+
this.axisX._absoluteMaximum&&(d=this.axisX.sessionVariables.internalMaximum-this.axisX._absoluteMaximum,this.axisX.sessionVariables.internalMaximum-=d,this.axisX.sessionVariables.internalMinimum-=d,e=!0),this.overlaidCanvas.style.cursor=this._defaultCursor,e&&this.render();else if(this.zoomEnabled){this.resetOverlayedCanvas();if(!this.dragStartPoint)return;"xySwapped"===this.plotInfo.axisPlacement?(b=Math.min(this.dragStartPoint.y,c),d=Math.max(this.dragStartPoint.y,c),1<Math.abs(b-d)&&(e=this.axisX.lineCoordinates,
|
78
|
+
d=this.axisX.maximum-(this.axisX.maximum-this.axisX.minimum)/e.height*(d-e.y1),e=this.axisX.maximum-(this.axisX.maximum-this.axisX.minimum)/e.height*(b-e.y1),d=Math.max(d,this.axisX.dataInfo.min),e=Math.min(e,this.axisX.dataInfo.max),Math.abs((e-d)/this.axisX.dataInfo.minDiff)>=0.008*this.canvas.height&&(this.axisX.sessionVariables.internalMinimum=d,this.axisX.sessionVariables.internalMaximum=e,this.render()))):"normal"===this.plotInfo.axisPlacement&&(d=Math.min(this.dragStartPoint.x,a),b=Math.max(this.dragStartPoint.x,
|
79
|
+
a),1<Math.abs(d-b)&&(e=this.axisX.lineCoordinates,d=(this.axisX.maximum-this.axisX.minimum)/e.width*(d-e.x1)+this.axisX.minimum,e=(this.axisX.maximum-this.axisX.minimum)/e.width*(b-e.x1)+this.axisX.minimum,d=Math.max(d,this.axisX.dataInfo.min),e=Math.min(e,this.axisX.dataInfo.max),Math.abs((e-d)/this.axisX.dataInfo.minDiff)>=0.01*this.canvas.width&&(this.axisX.sessionVariables.internalMinimum=d,this.axisX.sessionVariables.internalMaximum=e,this.render())))}this.zoomEnabled&&"none"===this._toolBar.style.display&&
|
80
|
+
(this._toolBar.style.display="inline",this._zoomButton.innerHTML=this._cultureInfo.panText,this._resetButton.innerHTML=this._cultureInfo.resetText)}}this.isDrag=!1};s.prototype._plotAreaMouseMove=function(a,c){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var b=0,d=0,d=this.axisX.lineCoordinates;"xySwapped"===this.plotInfo.axisPlacement?(b=c-this.dragStartPoint.y,d=Math.abs(this.axisX.maximum-this.axisX.minimum)/d.height*b):(b=this.dragStartPoint.x-a,d=Math.abs(this.axisX.maximum-this.axisX.minimum)/
|
81
|
+
d.width*b);2<Math.abs(b)&&8>Math.abs(b)&&(this.panEnabled||this.zoomEnabled)?this._toolTip.hide():this._toolTip.enabled&&(!this.panEnabled&&!this.zoomEnabled)&&this._toolTip.mouseMoveHandler(a,c);if(2<Math.abs(b)&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled){this.axisX.sessionVariables.internalMinimum=this.dragStartPoint.xMinimum+d;this.axisX.sessionVariables.internalMaximum=this.dragStartPoint.xMaximum+d;b=0;this.axisX.sessionVariables.internalMinimum<this.axisX._absoluteMinimum-L(this.axisX.interval,
|
82
|
+
this.axisX.intervalType)?(b=this.axisX._absoluteMinimum-L(this.axisX.interval,this.axisX.intervalType)-this.axisX.sessionVariables.internalMinimum,this.axisX.sessionVariables.internalMinimum+=b,this.axisX.sessionVariables.internalMaximum+=b):this.axisX.sessionVariables.internalMaximum>this.axisX._absoluteMaximum+L(this.axisX.interval,this.axisX.intervalType)&&(b=this.axisX.sessionVariables.internalMaximum-(this.axisX._absoluteMaximum+L(this.axisX.interval,this.axisX.intervalType)),this.axisX.sessionVariables.internalMaximum-=
|
83
|
+
b,this.axisX.sessionVariables.internalMinimum-=b);var e=this;clearTimeout(this._panTimerId);this._panTimerId=setTimeout(function(){e.render()},0)}else this.zoomEnabled&&(b=this.getPlotArea(),this.resetOverlayedCanvas(),d=this.overlaidCanvasCtx.globalAlpha,this.overlaidCanvasCtx.globalAlpha=0.7,this.overlaidCanvasCtx.fillStyle="#A0ABB8","xySwapped"===this.plotInfo.axisPlacement?this.overlaidCanvasCtx.fillRect(b.x1,this.dragStartPoint.y,b.x2-b.x1,c-this.dragStartPoint.y):"normal"===this.plotInfo.axisPlacement&&
|
84
|
+
this.overlaidCanvasCtx.fillRect(this.dragStartPoint.x,b.y1,a-this.dragStartPoint.x,b.y2-b.y1),this.overlaidCanvasCtx.globalAlpha=d)}else this._toolTip.enabled&&this._toolTip.mouseMoveHandler(a,c)};s.prototype.getPlotArea=function(){var a,c,b,d;d=this.axisY?this.axisY:this.axisY2;if(this.axisX&&d)a=this.axisX.lineCoordinates.x1<this.axisX.lineCoordinates.x2?this.axisX.lineCoordinates.x1:d.lineCoordinates.x1,b=this.axisX.lineCoordinates.y1<d.lineCoordinates.y1?this.axisX.lineCoordinates.y1:d.lineCoordinates.y1,
|
85
|
+
c=this.axisX.lineCoordinates.x2>d.lineCoordinates.x2?this.axisX.lineCoordinates.x2:d.lineCoordinates.x2,d=this.axisX.lineCoordinates.y2>this.axisX.lineCoordinates.y1?this.axisX.lineCoordinates.y2:d.lineCoordinates.y2;else return this.layoutManager.getFreeSpace();return{x1:a,y1:b,x2:c,y2:d,width:c-a,height:d-b}};s.prototype.getPixelCoordinatesOnPlotArea=function(a,c){return{x:this.axisX.getPixelCoordinatesOnAxis(a).x,y:this.axisY.getPixelCoordinatesOnAxis(c).y}};s.prototype.renderIndexLabels=function(){this.ctx.textBaseline=
|
86
|
+
"middle";for(var a=this.getPlotArea(),c=0;c<this._indexLabels.length;c++){var b=this._indexLabels[c],d,e,f;this.ctx.fillStyle="indexLabelFontColor"in b.dataPoint?b.dataPoint.indexLabelFontColor:b.dataSeries.indexLabelFontColor;f=this.ctx;var g=b.dataPoint,j=b.dataSeries,k="",k=k+(g.indexLabelFontStyle?g.indexLabelFontStyle+" ":j&&j.indexLabelFontStyle?j.indexLabelFontStyle+" ":""),k=k+(g.indexLabelFontWeight?g.indexLabelFontWeight+" ":j&&j.indexLabelFontWeight?j.indexLabelFontWeight+" ":""),k=k+(g.indexLabelFontSize?
|
87
|
+
g.indexLabelFontSize+"px ":j&&j.indexLabelFontSize?j.indexLabelFontSize+"px ":""),k=k+(g.indexLabelFontFamily?g.indexLabelFontFamily+" ":j&&j.indexLabelFontFamily?j.indexLabelFontFamily+" ":"");f.font=k;var g=this.replaceKeywordsWithValue("indexLabel"in b.dataPoint?b.dataPoint.indexLabel:b.dataSeries.indexLabel,b.dataPoint,b.dataSeries),j=this.ctx.measureText(g).width,k="indexLabelFontSize"in b.dataPoint?b.dataPoint.indexLabelFontSize:b.dataSeries.indexLabelFontSize,h="indexLabelPlacement"in b.dataPoint?
|
88
|
+
b.dataPoint.indexLabelPlacement:b.dataSeries.indexLabelPlacement,l="indexLabelOrientation"in b.dataPoint?b.dataPoint.indexLabelOrientation:b.dataSeries.indexLabelOrientation,n=f=0,p=0,m=0,r=0;b.point.x<a.x1||(b.point.x>a.x2||b.point.y<a.y1||b.point.y>a.y2)||("column"===b.chartType||"stackedColumn"===b.chartType||"stackedColumn100"===b.chartType||"bar"===b.chartType||"stackedBar"===b.chartType||"stackedBar100"===b.chartType?(Math.abs(b.bounds.x1,b.bounds.x2),Math.abs(b.bounds.y1,b.bounds.y2),"normal"===
|
89
|
+
this.plotInfo.axisPlacement?("outside"===h?(n=a.y1,p=a.y2):"inside"===h&&(n=b.bounds.y1,p=b.bounds.y2),"horizontal"===l?(d=b.point.x-j/2,e=0<=b.dataPoint.y?Math.min(Math.max(b.point.y-k/2-5,n+k/2+5),p-k/2-5):Math.max(Math.min(b.point.y+k/2+5,p-k/2),n+k/2+5)):"vertical"===l&&(d=b.point.x,e=0<=b.dataPoint.y?Math.min(Math.max(b.point.y-5,n+j+5),p):Math.max(Math.min(b.point.y+j+5,p-5),n),f=-90)):"xySwapped"===this.plotInfo.axisPlacement&&("outside"===h?(m=a.x1,r=a.x2):"inside"===h&&(m=b.bounds.x1,r=b.bounds.x2),
|
90
|
+
"horizontal"===l?(e=b.point.y,d=0<=b.dataPoint.y?Math.max(Math.min(b.point.x+5,r-j),m):Math.min(Math.max(b.point.x-j-5,m),r)):"vertical"===l&&(e=b.point.y+j/2,d=0<=b.dataPoint.y?Math.max(Math.min(b.point.x+k/2+5,r-k/2),m):Math.min(Math.max(b.point.x-k/2-5,m+k/2),r+k/2),f=-90))):"horizontal"===l?(d=b.point.x-j/2,e=0<=b.dataPoint.y?Math.max(b.point.y-k/2-5,a.y1+k/2):Math.min(b.point.y+k/2+5,a.y2-k/2)):"vertical"===l&&(d=b.point.x,e=0<=b.dataPoint.y?Math.max(b.point.y-5,a.y1+j):Math.min(b.point.y+j+
|
91
|
+
5,a.y2),f=-90),this.ctx.save(),this.ctx.translate(d,e),this.ctx.rotate(Math.PI/180*f),this.ctx.fillText(g,0,0),this.ctx.restore())}};s.prototype.renderLine=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;this.ctx.save();var b=this.getPlotArea();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();for(var b=[],d=0;d<a.dataSeriesIndexes.length;d++){var e=a.dataSeriesIndexes[d],f=this.data[e];this.ctx.lineWidth=f.lineThickness;var g=f.dataPoints,
|
92
|
+
j=f.id;this._eventManager.objectMap[j]={objectType:"dataSeries",dataSeriesIndex:e};j=z(j);c.strokeStyle=j;c.lineWidth=0<f.lineThickness?Math.max(f.lineThickness,4):0;colorSet=f._colorSet;color=colorSet[0];this.ctx.strokeStyle=color;var j=!0,k=0,h,l;if(0<g.length){for(k=0;k<g.length;k++)if(h=g[k].getTime?g[k].x.getTime():g[k].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof g[k].y){h=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*
|
93
|
+
(h-a.axisX.convertionParameters.minimum)+0.5<<0;l=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(g[k].y-a.axisY.convertionParameters.minimum)+0.5<<0;var n=f.dataPointIds[k];this._eventManager.objectMap[n]={objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:k,x1:h,y1:l};j?(this.ctx.beginPath(),this.ctx.moveTo(h,l),c.beginPath(),c.moveTo(h,l),j=!1):(this.ctx.lineTo(h,l),c.lineTo(h,l),0==k%500&&(this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(h,l),c.stroke(),
|
94
|
+
c.beginPath(),c.moveTo(h,l)));if(0<g[k].markerSize||0<f.markerSize){var p=f.getMarkerProperties(k,h,l,this.ctx);b.push(p);n=z(n);b.push({x:h,y:l,ctx:c,type:p.type,size:p.size,color:n,borderColor:n,borderThickness:p.borderThickness})}(g[k].indexLabel||f.indexLabel)&&this._indexLabels.push({chartType:"line",dataPoint:g[k],dataSeries:f,point:{x:h,y:l},color:color})}this.ctx.stroke();c.stroke()}}F.drawMarkers(b);this.ctx.restore();this.ctx.beginPath();c.beginPath()}};s.prototype.renderStepLine=function(a){if(!(0>=
|
95
|
+
a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;this.ctx.save();var b=this.getPlotArea();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();for(var b=[],d=0;d<a.dataSeriesIndexes.length;d++){var e=a.dataSeriesIndexes[d],f=this.data[e];this.ctx.lineWidth=f.lineThickness;var g=f.dataPoints,j=f.id;this._eventManager.objectMap[j]={objectType:"dataSeries",dataSeriesIndex:e};j=z(j);c.strokeStyle=j;c.lineWidth=0<f.lineThickness?Math.max(f.lineThickness,4):0;colorSet=
|
96
|
+
f._colorSet;color=colorSet[0];this.ctx.strokeStyle=color;var j=!0,k=0,h,l;if(0<g.length){for(k=0;k<g.length;k++)if(h=g[k].getTime?g[k].x.getTime():g[k].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof g[k].y){var n=l;h=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(h-a.axisX.convertionParameters.minimum)+0.5<<0;l=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(g[k].y-a.axisY.convertionParameters.minimum)+
|
97
|
+
0.5<<0;var p=f.dataPointIds[k];this._eventManager.objectMap[p]={objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:k,x1:h,y1:l};j?(this.ctx.beginPath(),this.ctx.moveTo(h,l),c.beginPath(),c.moveTo(h,l),j=!1):(this.ctx.lineTo(h,n),c.lineTo(h,n),this.ctx.lineTo(h,l),c.lineTo(h,l),0==k%500&&(this.ctx.stroke(),this.ctx.beginPath(),this.ctx.moveTo(h,l),c.stroke(),c.beginPath(),c.moveTo(h,l)));if(0<g[k].markerSize||0<f.markerSize)n=f.getMarkerProperties(k,h,l,this.ctx),b.push(n),p=z(p),b.push({x:h,
|
98
|
+
y:l,ctx:c,type:n.type,size:n.size,color:p,borderColor:p,borderThickness:n.borderThickness});(g[k].indexLabel||f.indexLabel)&&this._indexLabels.push({chartType:"stepLine",dataPoint:g[k],dataSeries:f,point:{x:h,y:l},color:color})}this.ctx.stroke();c.stroke()}}F.drawMarkers(b);this.ctx.restore();this.ctx.beginPath();c.beginPath()}};s.prototype.renderSpline=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx;this.ctx.save();var b=this.getPlotArea();this.ctx.beginPath();
|
99
|
+
this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();for(var b=[],d=0;d<a.dataSeriesIndexes.length;d++){var e=a.dataSeriesIndexes[d],f=this.data[e];this.ctx.lineWidth=f.lineThickness;var g=f.dataPoints,j=f.id;this._eventManager.objectMap[j]={objectType:"dataSeries",dataSeriesIndex:e};j=z(j);c.strokeStyle=j;c.lineWidth=0<f.lineThickness?Math.max(f.lineThickness,4):0;colorSet=f._colorSet;color=colorSet[0];this.ctx.strokeStyle=color;var j=0,k,h,l=[];if(0<g.length)for(j=0;j<g.length;j++)if(k=g[j].getTime?
|
100
|
+
g[j].x.getTime():g[j].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&"number"===typeof g[j].y){k=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(k-a.axisX.convertionParameters.minimum)+0.5<<0;h=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(g[j].y-a.axisY.convertionParameters.minimum)+0.5<<0;var n=f.dataPointIds[j];this._eventManager.objectMap[n]={objectType:"dataPoint",dataSeriesIndex:e,dataPointIndex:j,x1:k,
|
101
|
+
y1:h};l[l.length]={x:k,y:h};if(0<g[j].markerSize||0<f.markerSize){var p=f.getMarkerProperties(j,k,h,this.ctx);b.push(p);n=z(n);b.push({x:k,y:h,ctx:c,type:p.type,size:p.size,color:n,borderColor:n,borderThickness:p.borderThickness})}(g[j].indexLabel||f.indexLabel)&&this._indexLabels.push({chartType:"spline",dataPoint:g[j],dataSeries:f,point:{x:k,y:h},color:color})}e=$(l,2);if(0<e.length){this.ctx.beginPath();c.beginPath();this.ctx.moveTo(e[0].x,e[0].y);c.moveTo(e[0].x,e[0].y);for(j=0;j<e.length-3;j+=
|
102
|
+
3)this.ctx.bezierCurveTo(e[j+1].x,e[j+1].y,e[j+2].x,e[j+2].y,e[j+3].x,e[j+3].y),c.bezierCurveTo(e[j+1].x,e[j+1].y,e[j+2].x,e[j+2].y,e[j+3].x,e[j+3].y);this.ctx.stroke();c.stroke()}}F.drawMarkers(b);this.ctx.restore();this.ctx.beginPath();c.beginPath()}};var G=function(a,c,b,d,e,f,g,j,k,h){var l=15<d-c&&15<e-b?8:0.35*Math.min(d-c,e-b);color2="rgba(255, 255, 255, .4)";color3="rgba(255, 255, 255, 0.1)";color1=f;a.beginPath();a.moveTo(c,b);a.save();a.fillStyle=color1;a.fillRect(c,b,d-c,e-b);a.restore();
|
103
|
+
!0===g&&(a.save(),a.beginPath(),a.moveTo(c,b),a.lineTo(c+l,b+l),a.lineTo(d-l,b+l),a.lineTo(d,b),a.closePath(),f=a.createLinearGradient((d+c)/2,b+l,(d+c)/2,b),f.addColorStop(0,color1),f.addColorStop(1,color2),a.fillStyle=f,a.fill(),a.restore());!0===j&&(a.save(),a.beginPath(),a.moveTo(c,e),a.lineTo(c+l,e-l),a.lineTo(d-l,e-l),a.lineTo(d,e),a.closePath(),f=a.createLinearGradient((d+c)/2,e-l,(d+c)/2,e),f.addColorStop(0,color1),f.addColorStop(1,color2),a.fillStyle=f,a.fill(),a.restore());!0===k&&(a.save(),
|
104
|
+
a.beginPath(),a.moveTo(c,b),a.lineTo(c+l,b+l),a.lineTo(c+l,e-l),a.lineTo(c,e),a.closePath(),f=a.createLinearGradient(c+l,(e+b)/2,c,(e+b)/2),f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,a.fill(),a.restore());!0===h&&(a.save(),a.beginPath(),a.moveTo(d,b),a.lineTo(d-l,b+l),a.lineTo(d-l,e-l),a.lineTo(d,e),f=a.createLinearGradient(d-l,(e+b)/2,d,(e+b)/2),f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,f.addColorStop(0,color1),f.addColorStop(1,color3),a.fillStyle=f,a.fill(),
|
105
|
+
a.closePath(),a.restore())};s.prototype.renderColumn=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=0,e,f,g,j=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,d=a.axisX.dataInfo.minDiff,h=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(d)/a.plotType.totalDataSeries)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,
|
106
|
+
b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(b=0;b<a.dataSeriesIndexes.length;b++){var l=a.dataSeriesIndexes[b],n=this.data[l],p=n.dataPoints;1==p.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<p.length)for(var m=5<h&&n.bevelEnabled?!0:!1,d=0;d<p.length;d++)if(p[d].getTime?g=p[d].x.getTime():g=p[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[d].y){e=a.axisX.convertionParameters.reference+
|
107
|
+
a.axisX.convertionParameters.pixelPerUnit*(g-a.axisX.convertionParameters.minimum)+0.5<<0;f=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(p[d].y-a.axisY.convertionParameters.minimum)+0.5<<0;e=e-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+b)*h<<0;var r=e+h<<0,q;0<=p[d].y?q=j:(q=f,f=j);f>q&&(q=f=q);c=p[d].color?p[d].color:n._colorSet[d%n._colorSet.length];G(this.ctx,e,f,r,q,c,m&&0<=p[d].y,0>p[d].y&&m,!1,!1);c=n.dataPointIds[d];this._eventManager.objectMap[c]=
|
108
|
+
{objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:d,x1:e,y1:f,x2:r,y2:q};c=z(c);G(this._eventManager.ghostCtx,e,f,r,q,c,!1,!1,!1,!1);if(p[d].indexLabel||n.indexLabel)this._indexLabels.push({chartType:"column",dataPoint:p[d],dataSeries:n,point:{x:e+(r-e)/2,y:0<=p[d].y?f:q},bounds:{x1:e,y1:Math.min(f,q),x2:r,y2:Math.max(f,q)},color:c})}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderStackedColumn=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),
|
109
|
+
d=[],e=[],f=0,g,j=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,h=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();
|
110
|
+
for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],p=this.data[n],m=p.dataPoints;1==m.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<m.length){var r=5<h&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(f=0;f<m.length;f++)if(c=m[f].x.getTime?m[f].x.getTime():m[f].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(c-a.axisX.convertionParameters.minimum)+
|
111
|
+
0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(m[f].y-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*h/2+a.index*h<<0,t=q+h<<0,v;if(0<=m[f].y){var u=d[c]?d[c]:0;g-=u;v=j-u;d[c]=u+(v-g)}else u=e[c]?e[c]:0,v=g+u,g=j+u,e[c]=u+(v-g);c=m[f].color?m[f].color:p._colorSet[f%p._colorSet.length];G(this.ctx,q,g,t,v,c,r&&0<=m[f].y,0>m[f].y&&r,!1,!1);c=p.dataPointIds[f];this._eventManager.objectMap[c]={objectType:"dataPoint",dataSeriesIndex:n,
|
112
|
+
dataPointIndex:f,x1:q,y1:g,x2:t,y2:v};c=z(c);G(this._eventManager.ghostCtx,q,g,t,v,c,!1,!1,!1,!1);if(m[f].indexLabel||p.indexLabel)this._indexLabels.push({chartType:"stackedColumn",dataPoint:m[f],dataSeries:p,point:{x:b,y:0<=m[f].y?g:v},bounds:{x1:q,y1:Math.min(g,v),x2:t,y2:Math.max(g,v)},color:c})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderStackedColumn100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=[],e=[],f=0,g,j=a.axisY.convertionParameters.reference+
|
113
|
+
a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,h=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=
|
114
|
+
a.dataSeriesIndexes[l],p=this.data[n],m=p.dataPoints;1==m.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<m.length)for(var r=5<h&&p.bevelEnabled?!0:!1,f=0;f<m.length;f++)if(c=m[f].x.getTime?m[f].x.getTime():m[f].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(c-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
|
115
|
+
((0!==a.dataPointYSums[c]?100*(m[f].y/a.dataPointYSums[c]):0)-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*h/2+a.index*h<<0,t=q+h<<0,v;if(0<=m[f].y){var u=d[c]?d[c]:0;g-=u;v=j-u;d[c]=u+(v-g)}else u=e[c]?e[c]:0,v=g+u,g=j+u,e[c]=u+(v-g);c=m[f].color?m[f].color:p._colorSet[f%p._colorSet.length];G(this.ctx,q,g,t,v,c,r&&0<=m[f].y,0>m[f].y&&r,!1,!1);c=p.dataPointIds[f];this._eventManager.objectMap[c]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:q,y1:g,
|
116
|
+
x2:t,y2:v};c=z(c);G(this._eventManager.ghostCtx,q,g,t,v,c,!1,!1,!1,!1);if(m[f].indexLabel||p.indexLabel)this._indexLabels.push({chartType:"stackedColumn100",dataPoint:m[f],dataSeries:p,point:{x:b,y:0<=m[f].y?g:v},bounds:{x1:q,y1:Math.min(g,v),x2:t,y2:Math.max(g,v)},color:c})}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderBar=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=0,e,f,g,j=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
|
117
|
+
(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.height,d=a.axisX.dataInfo.minDiff,h=0.9*(b.height/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(d)/a.plotType.totalDataSeries)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(b=0;b<a.dataSeriesIndexes.length;b++){var l=a.dataSeriesIndexes[b],n=this.data[l],
|
118
|
+
p=n.dataPoints;1==p.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<p.length){var m=5<h&&n.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(d=0;d<p.length;d++)if(p[d].getTime?g=p[d].x.getTime():g=p[d].x,!(g<a.axisX.dataInfo.viewPortMin||g>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[d].y){f=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(g-a.axisX.convertionParameters.minimum)+0.5<<0;e=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
|
119
|
+
(p[d].y-a.axisY.convertionParameters.minimum)+0.5<<0;f=f-a.plotType.totalDataSeries*h/2+(a.previousDataSeriesCount+b)*h<<0;var r=f+h<<0,q;0<=p[d].y?q=j:(q=e,e=j);c=p[d].color?p[d].color:n._colorSet[d%n._colorSet.length];G(this.ctx,q,f,e,r,c,m,!1,!1,!1);c=n.dataPointIds[d];this._eventManager.objectMap[c]={objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:d,x1:q,y1:f,x2:e,y2:r};c=z(c);G(this._eventManager.ghostCtx,q,f,e,r,c,!1,!1,!1,!1);this._indexLabels.push({chartType:"bar",dataPoint:p[d],dataSeries:n,
|
120
|
+
point:{x:0<=p[d].y?e:q,y:f+(r-f)/2},bounds:{x1:Math.min(q,e),y1:f,x2:Math.max(q,e),y2:r},color:c})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderStackedBar=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=[],e=[],f=0,g,j=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,h=0.9*(b.height/Math.abs(a.axisX.maximum-
|
121
|
+
a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],p=this.data[n],m=p.dataPoints;1==m.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<m.length){var r=5<h&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";
|
122
|
+
for(f=0;f<m.length;f++)if(c=m[f].x.getTime?m[f].x.getTime():m[f].x,!(c<a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(c-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(m[f].y-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*h/2+a.index*h<<0,t=q+h<<0,v;if(0<=m[f].y){var u=
|
123
|
+
d[c]?d[c]:0;v=j+u;g+=u;d[c]=u+(g-v)}else u=e[c]?e[c]:0,v=g-u,g=j-u,e[c]=u+(g-v);c=m[f].color?m[f].color:p._colorSet[f%p._colorSet.length];G(this.ctx,v,q,g,t,c,r,!1,!1,!1);c=p.dataPointIds[f];this._eventManager.objectMap[c]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:v,y1:q,x2:g,y2:t};c=z(c);G(this._eventManager.ghostCtx,v,q,g,t,c,!1,!1,!1,!1);this._indexLabels.push({chartType:"stackedBar",dataPoint:m[f],dataSeries:p,point:{x:0<=m[f].y?g:v,y:b},bounds:{x1:Math.min(v,g),y1:q,x2:Math.max(v,
|
124
|
+
g),y2:t},color:c})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderStackedBar100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=[],e=[],f=0,g,j=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,k=0.15*this.canvas.width,f=a.axisX.dataInfo.minDiff,h=0.9*(b.height/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(f)/a.plotType.plotUnits.length)<<0;this.ctx.save();
|
125
|
+
this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var l=0;l<a.dataSeriesIndexes.length;l++){var n=a.dataSeriesIndexes[l],p=this.data[n],m=p.dataPoints;1==m.length&&(h=k);1>h?h=1:h>k&&(h=k);if(0<m.length){var r=5<h&&p.bevelEnabled?!0:!1;this.ctx.strokeStyle="#4572A7 ";for(f=0;f<m.length;f++)if(c=m[f].x.getTime?m[f].x.getTime():m[f].x,!(c<
|
126
|
+
a.axisX.dataInfo.viewPortMin||c>a.axisX.dataInfo.viewPortMax)&&"number"===typeof m[f].y){b=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(c-a.axisX.convertionParameters.minimum)+0.5<<0;g=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*((0!==a.dataPointYSums[c]?100*(m[f].y/a.dataPointYSums[c]):0)-a.axisY.convertionParameters.minimum)+0.5<<0;var q=b-a.plotType.plotUnits.length*h/2+a.index*h<<0,t=q+h<<0,v;if(0<=m[f].y){var u=d[c]?d[c]:
|
127
|
+
0;v=j+u;g+=u;d[c]=u+(g-v)}else u=e[c]?e[c]:0,v=g-u,g=j-u,e[c]=u+(g-v);c=m[f].color?m[f].color:p._colorSet[f%p._colorSet.length];G(this.ctx,v,q,g,t,c,r,!1,!1,!1);c=p.dataPointIds[f];this._eventManager.objectMap[c]={objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:f,x1:v,y1:q,x2:g,y2:t};c=z(c);G(this._eventManager.ghostCtx,v,q,g,t,c,!1,!1,!1,!1);this._indexLabels.push({chartType:"stackedBar100",dataPoint:m[f],dataSeries:p,point:{x:0<=m[f].y?g:v,y:b},bounds:{x1:Math.min(v,g),y1:q,x2:Math.max(v,
|
128
|
+
g),y2:t},color:c})}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderArea=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,b=a.axisX.lineCoordinates,d=a.axisY.lineCoordinates,e=[],f=this.getPlotArea();this.ctx.save();c.save();this.ctx.beginPath();this.ctx.rect(f.x1,f.y1,f.width,f.height);this.ctx.clip();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();for(f=0;f<a.dataSeriesIndexes.length;f++){var g=a.dataSeriesIndexes[f],j=this.data[g],
|
129
|
+
k=j.dataPoints,e=j.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:g};e=z(e);c.fillStyle=e;var e=[],h=!0,l=0,n,p,m=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)+0.5<<0,r,q=null;if(0<k.length){color=j._colorSet[l%j._colorSet.length];for(this.ctx.fillStyle=color;l<k.length;l++)if(p=k[l].x.getTime?k[l].x.getTime():k[l].x,!(p<a.axisX.dataInfo.viewPortMin||p>a.axisX.dataInfo.viewPortMax))if(n=a.axisX.convertionParameters.reference+
|
130
|
+
a.axisX.convertionParameters.pixelPerUnit*(p-a.axisX.convertionParameters.minimum)+0.5<<0,p=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(k[l].y-a.axisY.convertionParameters.minimum)+0.5<<0,"number"===typeof k[l].y){h?(this.ctx.beginPath(),this.ctx.moveTo(n,p),q={x:n,y:p},c.beginPath(),c.moveTo(n,p),h=!1):(this.ctx.lineTo(n,p),c.lineTo(n,p),0==l%250&&(0>=a.axisY.minimum&&0<=a.axisY.maximum?r=m:0>a.axisY.maximum?r=d.y1:0<a.axisY.minimum&&(r=b.y2),this.ctx.lineTo(n,
|
131
|
+
r),this.ctx.lineTo(q.x,r),this.ctx.closePath(),this.ctx.fill(),this.ctx.beginPath(),this.ctx.moveTo(n,p),c.lineTo(n,r),c.lineTo(q.x,r),c.closePath(),c.fill(),c.beginPath(),c.moveTo(n,p),q={x:n,y:p}));var t=j.dataPointIds[l];this._eventManager.objectMap[t]={objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:l,x1:n,y1:p};if(0!==k[l].markerSize&&(0<k[l].markerSize||0<j.markerSize)){var v=j.getMarkerProperties(l,n,p,this.ctx);e.push(v);markerColor=z(t);e.push({x:n,y:p,ctx:c,type:v.type,size:v.size,
|
132
|
+
color:markerColor,borderColor:markerColor,borderThickness:v.borderThickness})}(k[l].indexLabel||j.indexLabel)&&this._indexLabels.push({chartType:"area",dataPoint:k[l],dataSeries:j,point:{x:n,y:p},color:color})}0>=a.axisY.minimum&&0<=a.axisY.maximum?r=m:0>a.axisY.maximum?r=d.y1:0<a.axisY.minimum&&(r=b.y2);this.ctx.lineTo(n,r);this.ctx.lineTo(q.x,r);this.ctx.closePath();this.ctx.fill();c.lineTo(n,r);c.lineTo(q.x,r);c.closePath();c.fill();F.drawMarkers(e)}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};
|
133
|
+
s.prototype.renderSplineArea=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=this._eventManager.ghostCtx,b=a.axisX.lineCoordinates,d=a.axisY.lineCoordinates,e=[],f=this.getPlotArea();this.ctx.save();c.save();this.ctx.beginPath();this.ctx.rect(f.x1,f.y1,f.width,f.height);this.ctx.clip();c.beginPath();c.rect(f.x1,f.y1,f.width,f.height);c.clip();for(f=0;f<a.dataSeriesIndexes.length;f++){var g=a.dataSeriesIndexes[f],j=this.data[g],k=j.dataPoints,e=j.id;this._eventManager.objectMap[e]={objectType:"dataSeries",
|
134
|
+
dataSeriesIndex:g};e=z(e);c.fillStyle=e;var e=[],h=0,l,n,p=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)+0.5<<0,m,r=null,r=[];if(0<k.length){color=j._colorSet[h%j._colorSet.length];for(this.ctx.fillStyle=color;h<k.length;h++)if(l=k[h].x.getTime?k[h].x.getTime():k[h].x,!(l<a.axisX.dataInfo.viewPortMin||l>a.axisX.dataInfo.viewPortMax))if(l=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(l-a.axisX.convertionParameters.minimum)+
|
135
|
+
0.5<<0,n=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(k[h].y-a.axisY.convertionParameters.minimum)+0.5<<0,"number"===typeof k[h].y){var q=j.dataPointIds[h];this._eventManager.objectMap[q]={objectType:"dataPoint",dataSeriesIndex:g,dataPointIndex:h,x1:l,y1:n};r[r.length]={x:l,y:n};if(0!==k[h].markerSize&&(0<k[h].markerSize||0<j.markerSize)){var t=j.getMarkerProperties(h,l,n,this.ctx);e.push(t);markerColor=z(q);e.push({x:l,y:n,ctx:c,type:t.type,size:t.size,color:markerColor,
|
136
|
+
borderColor:markerColor,borderThickness:t.borderThickness})}(k[h].indexLabel||j.indexLabel)&&this._indexLabels.push({chartType:"splineArea",dataPoint:k[h],dataSeries:j,point:{x:l,y:n},color:color})}g=$(r,2);if(0<g.length){this.ctx.beginPath();c.beginPath();this.ctx.moveTo(g[0].x,g[0].y);c.moveTo(g[0].x,g[0].y);for(h=0;h<g.length-3;h+=3)this.ctx.bezierCurveTo(g[h+1].x,g[h+1].y,g[h+2].x,g[h+2].y,g[h+3].x,g[h+3].y),c.bezierCurveTo(g[h+1].x,g[h+1].y,g[h+2].x,g[h+2].y,g[h+3].x,g[h+3].y);0>=a.axisY.minimum&&
|
137
|
+
0<=a.axisY.maximum?m=p:0>a.axisY.maximum?m=d.y1:0<a.axisY.minimum&&(m=b.y2);r={x:g[0].x,y:g[0].y};this.ctx.lineTo(g[g.length-1].x,m);this.ctx.lineTo(r.x,m);this.ctx.closePath();this.ctx.fill();c.lineTo(g[g.length-1].x,m);c.lineTo(r.x,m);c.closePath();c.fill()}F.drawMarkers(e)}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderStackedArea=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=[],d=this.getPlotArea(),e=[],f=[],g=0,j,k,h,l=a.axisY.convertionParameters.reference+
|
138
|
+
a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,n=this._eventManager.ghostCtx;n.beginPath();this.ctx.save();n.save();this.ctx.beginPath();this.ctx.rect(d.x1,d.y1,d.width,d.height);this.ctx.clip();n.beginPath();n.rect(d.x1,d.y1,d.width,d.height);n.clip();xValuePresent=[];for(d=0;d<a.dataSeriesIndexes.length;d++){var p=a.dataSeriesIndexes[d],m=this.data[p],r=m.dataPoints;m.dataPointIndexes=[];for(g=0;g<r.length;g++)p=r[g].x.getTime?r[g].x.getTime():r[g].x,m.dataPointIndexes[p]=
|
139
|
+
g,xValuePresent[p]||(f.push(p),xValuePresent[p]=!0);f.sort(Z)}for(d=0;d<a.dataSeriesIndexes.length;d++){var p=a.dataSeriesIndexes[d],m=this.data[p],r=m.dataPoints,q=!0,t=[],g=m.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:p};g=z(g);n.fillStyle=g;if(0<f.length){c=m._colorSet[0];this.ctx.fillStyle=c;for(g=0;g<f.length;g++){h=f[g];var v=null,v=0<=m.dataPointIndexes[h]?r[m.dataPointIndexes[h]]:{x:h,y:0};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&
|
140
|
+
"number"===typeof v.y){j=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(h-a.axisX.convertionParameters.minimum)+0.5<<0;k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(v.y-a.axisY.convertionParameters.minimum)+0.5<<0;var u=e[h]?e[h]:0;k-=u;t.push({x:j,y:l-u});e[h]=l-k;if(q)this.ctx.beginPath(),this.ctx.moveTo(j,k),n.beginPath(),n.moveTo(j,k),q=!1;else if(this.ctx.lineTo(j,k),n.lineTo(j,k),0==g%250){for(;0<t.length;){var s=t.pop();
|
141
|
+
this.ctx.lineTo(s.x,s.y);n.lineTo(s.x,s.y)}this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(j,k);n.closePath();n.fill();n.beginPath();n.moveTo(j,k);t.push({x:j,y:l-u})}if(0<=m.dataPointIndexes[h]){var y=m.dataPointIds[m.dataPointIndexes[h]];this._eventManager.objectMap[y]={objectType:"dataPoint",dataSeriesIndex:p,dataPointIndex:m.dataPointIndexes[h],x1:j,y1:k}}if(0<=m.dataPointIndexes[h]&&0!==v.markerSize&&(0<v.markerSize||0<m.markerSize))h=m.getMarkerProperties(g,j,k,this.ctx),
|
142
|
+
b.push(h),markerColor=z(y),b.push({x:j,y:k,ctx:n,type:h.type,size:h.size,color:markerColor,borderColor:markerColor,borderThickness:h.borderThickness});(v.indexLabel||m.indexLabel)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:v,dataSeries:m,point:{x:j,y:k},color:c})}}for(;0<t.length;)s=t.pop(),this.ctx.lineTo(s.x,s.y),n.lineTo(s.x,s.y);this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(j,k);n.closePath();n.fill();n.beginPath();n.moveTo(j,k)}delete m.dataPointIndexes}F.drawMarkers(b);
|
143
|
+
this.ctx.restore();n.restore()}};s.prototype.renderStackedArea100=function(a){if(!(0>=a.dataSeriesIndexes.length)){var c=null,b=this.getPlotArea(),d=[],e=[],f=[],g=0,j,k,h,l=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(0-a.axisY.convertionParameters.minimum)<<0,n=0.15*this.canvas.width,p=a.axisX.dataInfo.minDiff,p=0.9*b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(p)<<0,m=this._eventManager.ghostCtx;this.ctx.save();m.save();this.ctx.beginPath();this.ctx.rect(b.x1,
|
144
|
+
b.y1,b.width,b.height);this.ctx.clip();m.beginPath();m.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();xValuePresent=[];for(b=0;b<a.dataSeriesIndexes.length;b++){var r=a.dataSeriesIndexes[b],q=this.data[r],t=q.dataPoints;q.dataPointIndexes=[];for(g=0;g<t.length;g++)r=t[g].x.getTime?t[g].x.getTime():t[g].x,q.dataPointIndexes[r]=g,xValuePresent[r]||(f.push(r),xValuePresent[r]=!0);f.sort(Z)}for(b=0;b<a.dataSeriesIndexes.length;b++){var r=a.dataSeriesIndexes[b],q=this.data[r],t=q.dataPoints,
|
145
|
+
v=!0,c=q.id;this._eventManager.objectMap[c]={objectType:"dataSeries",dataSeriesIndex:r};c=z(c);m.fillStyle=c;1==t.length&&(p=n);1>p?p=1:p>n&&(p=n);var u=[];if(0<f.length){c=q._colorSet[g%q._colorSet.length];this.ctx.fillStyle=c;for(g=0;g<f.length;g++){h=f[g];var s=null,s=0<=q.dataPointIndexes[h]?t[q.dataPointIndexes[h]]:{x:h,y:0};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof s.y){k=0!==a.dataPointYSums[h]?100*(s.y/a.dataPointYSums[h]):0;j=a.axisX.convertionParameters.reference+
|
146
|
+
a.axisX.convertionParameters.pixelPerUnit*(h-a.axisX.convertionParameters.minimum)+0.5<<0;k=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(k-a.axisY.convertionParameters.minimum)+0.5<<0;var y=e[h]?e[h]:0;k-=y;u.push({x:j,y:l-y});e[h]=l-k;if(v)this.ctx.beginPath(),this.ctx.moveTo(j,k),m.beginPath(),m.moveTo(j,k),v=!1;else if(this.ctx.lineTo(j,k),m.lineTo(j,k),0==g%250){for(;0<u.length;){var x=u.pop();this.ctx.lineTo(x.x,x.y);m.lineTo(x.x,x.y)}this.ctx.closePath();
|
147
|
+
this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(j,k);m.closePath();m.fill();m.beginPath();m.moveTo(j,k);u.push({x:j,y:l-y})}if(0<=q.dataPointIndexes[h]){var da=q.dataPointIds[q.dataPointIndexes[h]];this._eventManager.objectMap[da]={objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:q.dataPointIndexes[h],x1:j,y1:k}}if(0<=q.dataPointIndexes[h]&&0!==s.markerSize&&(0<s.markerSize||0<q.markerSize))h=q.getMarkerProperties(g,j,k,this.ctx),d.push(h),markerColor=z(da),d.push({x:j,y:k,ctx:m,type:h.type,
|
148
|
+
size:h.size,color:markerColor,borderColor:markerColor,borderThickness:h.borderThickness});(s.indexLabel||q.indexLabel)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:s,dataSeries:q,point:{x:j,y:k},color:c})}}for(;0<u.length;)x=u.pop(),this.ctx.lineTo(x.x,x.y),m.lineTo(x.x,x.y);this.ctx.closePath();this.ctx.fill();this.ctx.beginPath();this.ctx.moveTo(j,k);m.closePath();m.fill();m.beginPath();m.moveTo(j,k)}delete q.dataPointIndexes}F.drawMarkers(d);this.ctx.restore();m.restore()}};s.prototype.renderBubble=
|
149
|
+
function(a){var c=a.dataSeriesIndexes.length;if(!(0>=c)){var b=this.getPlotArea(),d=0,e,f,g=0.15*this.canvas.width,d=a.axisX.dataInfo.minDiff,c=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(d)/c)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var j=-Infinity,k=Infinity,h=0;h<a.dataSeriesIndexes.length;h++)for(var l=
|
150
|
+
a.dataSeriesIndexes[h],n=this.data[l],p=n.dataPoints,m=0,d=0;d<p.length;d++)if(e=p[d].getTime?e=p[d].x.getTime():e=p[d].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"undefined"!==typeof p[d].z)m=p[d].z,m>j&&(j=m),m<k&&(k=m);for(var r=25*Math.PI,b=Math.max(Math.pow(0.25*Math.min(b.height,b.width)/2,2)*Math.PI,r),h=0;h<a.dataSeriesIndexes.length;h++)if(l=a.dataSeriesIndexes[h],n=this.data[l],p=n.dataPoints,1==p.length&&(c=g),1>c?c=1:c>g&&(c=g),0<p.length){this.ctx.strokeStyle=
|
151
|
+
"#4572A7 ";for(d=0;d<p.length;d++)if(e=p[d].getTime?e=p[d].x.getTime():e=p[d].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof p[d].y){e=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(e-a.axisX.convertionParameters.minimum)+0.5<<0;f=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*(p[d].y-a.axisY.convertionParameters.minimum)+0.5<<0;var m=p[d].z,q=2*Math.max(Math.sqrt((r+(b-r)/(j-k)*(m-k))/Math.PI)<<
|
152
|
+
0,1),m=n.getMarkerProperties(d,this.ctx);m.size=q;F.drawMarker(e,f,this.ctx,m.type,m.size,m.color,m.borderColor,m.borderThickness);var t=n.dataPointIds[d];this._eventManager.objectMap[t]={objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:d,x1:e,y1:f,size:q};q=z(t);F.drawMarker(e,f,this._eventManager.ghostCtx,m.type,m.size,q,q,m.borderThickness)}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};s.prototype.renderScatter=function(a){var c=a.dataSeriesIndexes.length;if(!(0>=c)){var b=
|
153
|
+
this.getPlotArea(),d=0,e,f,g=0.15*this.canvas.width,d=a.axisX.dataInfo.minDiff,c=0.9*(b.width/Math.abs(a.axisX.maximum-a.axisX.minimum)*Math.abs(d)/c)<<0;this.ctx.save();this._eventManager.ghostCtx.save();this.ctx.beginPath();this.ctx.rect(b.x1,b.y1,b.width,b.height);this.ctx.clip();this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height);this._eventManager.ghostCtx.clip();for(var j=0;j<a.dataSeriesIndexes.length;j++){var k=a.dataSeriesIndexes[j],h=this.data[k],l=h.dataPoints;1==l.length&&(c=
|
154
|
+
g);1>c?c=1:c>g&&(c=g);if(0<l.length){this.ctx.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var n=0,p=0,d=0;d<l.length;d++)if(e=l[d].getTime?e=l[d].x.getTime():e=l[d].x,!(e<a.axisX.dataInfo.viewPortMin||e>a.axisX.dataInfo.viewPortMax)&&"number"===typeof l[d].y){e=a.axisX.convertionParameters.reference+a.axisX.convertionParameters.pixelPerUnit*(e-a.axisX.convertionParameters.minimum)+0.5<<0;f=a.axisY.convertionParameters.reference+a.axisY.convertionParameters.pixelPerUnit*
|
155
|
+
(l[d].y-a.axisY.convertionParameters.minimum)+0.5<<0;var m=h.getMarkerProperties(d,e,f,this.ctx);F.drawMarker(m.x,m.y,m.ctx,m.type,m.size,m.color,m.color,m.thickness);Math.sqrt((n-e)*(n-e)+(p-f)*(p-f))<Math.min(m.size,5)||(n=h.dataPointIds[d],this._eventManager.objectMap[n]={objectType:"dataPoint",dataSeriesIndex:k,dataPointIndex:d,x1:e,y1:f},n=z(n),F.drawMarker(m.x,m.y,this._eventManager.ghostCtx,m.type,m.size,n,n,m.borderThickness),n=e,p=f)}}}this.ctx.restore();this._eventManager.ghostCtx.restore()}};
|
156
|
+
var K=function(a,c,b,d,e,f,g){a.save();"pie"===e?(a.beginPath(),a.moveTo(c.x,c.y),a.arc(c.x,c.y,b,f,g,!1),a.fillStyle=d,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.stroke(),a.fill()):"doughnut"===e&&(a.beginPath(),a.arc(c.x,c.y,b,f,g,!1),a.arc(c.x,c.y,0.6*b,g,f,!0),a.closePath(),a.fillStyle=d,a.strokeStyle="white",a.lineWidth=2,a.stroke(),a.fill());a.restore()};s.prototype.renderPie=function(a){function c(){w.ctx.save();w._eventManager.ghostCtx.save();w.ctx.translate(s.x,s.y);w._eventManager.ghostCtx.translate(s.x,
|
157
|
+
s.y);w.ctx.clearRect(-u.width/2,-u.height/2,u.width,u.height);var a=!0===w.animationEnabled?60:1;if(null!=A&&A.frame<=a){A.isAnimating--;for(var d=k[0],h=A.maxAngle+2*Math.PI/a,j=!1,l=0;l<v;l++){var m=f.dataPoints[l].exploded,q=f.dataPoints[l].color?f.dataPoints[l].color:f.color?f.color:y[l%y.length],r=d,t=d=r+2*Math.PI/n*Math.abs(f.dataPoints[l].y);t>h&&(t=h);type=f.type;"outside"===f.indexLabelPlacement?(indexLineMinLength=Math.min(u.width,u.height)/14,p=indexLineMinLength<x?x-indexLineMinLength:
|
158
|
+
x-25):"inside"===f.indexLabelPlacement&&(p=(1-g)*0.5*Math.min(u.width,u.height));var z={x:0,y:0};j||K(w.ctx,z,p,q,type,r,t);r=f.dataPointIds[l];w._eventManager.objectMap[r]={objectType:"dataPoint",dataSeriesIndex:0,dataPointIndex:l,center:{x:s.x,y:s.y},radius:p,color:q,startAngle:k[l],endAngle:k[l+1],currentlyExploded:!0===f.dataPoints[l].exploded?!0:!1,userSetExploded:m,pastExploded:!1};m=S(r);w._eventManager.ghostCtx.save();q="rgb("+m[0]+","+m[1]+","+m[2]+")";K(w._eventManager.ghostCtx,z,p,q,type,
|
159
|
+
k[l],k[l+1]);w._eventManager.ghostCtx.restore();t===h&&(j=!0)}A.maxAngle=h;A.frame++;A.frame<=a?w.requestAnimFrame.call(window,c):(e(0,a),w.ctx.restore(),w._eventManager.ghostCtx.restore(),setTimeout(function(){A.frame=0;A.isAnimating=20;b()},200))}w.renderCount++;w.ctx.restore();w._eventManager.ghostCtx.restore()}function b(){w.ctx.save();w._eventManager.ghostCtx.save();w.ctx.translate(s.x,s.y);w._eventManager.ghostCtx.translate(s.x,s.y);if(null!==A&&20>A.frame){A.isAnimating--;w.ctx.fillStyle=w.backgroundColor?
|
160
|
+
w.backgroundColor:"white";w.ctx.clearRect(-u.width/2,-u.height/2,u.width,u.height);for(var a=0;a<v;a++){var c=f.dataPoints[a].color?f.dataPoints[a].color:f.color?f.color:y[a%y.length],d={x:0,y:0},j=p*g*Math.cos(h[a]),l=p*g*Math.sin(h[a]),m=f.type,n=f.dataPointIds[a],q=w._eventManager.objectMap[n].currentlyExploded,r=w._eventManager.objectMap[n].pastExploded;!0===q&&!1===r?(d.x+=j/20*(A.frame+1),d.y+=l/20*(A.frame+1),20===A.frame+1&&(w._eventManager.objectMap[n].pastExploded=!0)):!0===q&&!0===r&&(d.x+=
|
161
|
+
j,d.y+=l);w._eventManager.objectMap[n].center.x=d.x+s.x;w._eventManager.objectMap[n].center.y=d.y+s.y;r!==q&&(j={},j.dataSeries=f,j.dataPoint=f.dataPoints[a],j.index=a,w._toolTip.highlightObjects([j]));K(w.ctx,d,p,c,m,k[a],k[a+1]);19===A.frame&&(n=f.dataPointIds[a],c=S(n),w._eventManager.ghostCtx.save(),c="rgb("+c[0]+","+c[1]+","+c[2]+")",K(w._eventManager.ghostCtx,d,p,c,m,k[a],k[a+1]),w._eventManager.ghostCtx.restore())}A.frame++;20>A.frame&&w.requestAnimFrame.call(window,b)}e(A.frame,20);w.ctx.restore();
|
162
|
+
w._eventManager.ghostCtx.restore()}function d(){w.ctx.save();w._eventManager.ghostCtx.save();w.ctx.translate(s.x,s.y);w._eventManager.ghostCtx.translate(s.x,s.y);if(null!==A&&0<A.frame){A.isAnimating--;w.ctx.clearRect(-u.width/2,-u.height/2,u.width,u.height);for(var a=0;a<v;a++){var b=f.dataPointIds[a],c=w._eventManager.objectMap[b].currentlyExploded,j=w._eventManager.objectMap[b].pastExploded,l=f.dataPoints[a].color?f.dataPoints[a].color:f.color?f.color:y[a%y.length],m={x:0,y:0},n=f.type,c=w._eventManager.objectMap[b].currentlyExploded,
|
163
|
+
q=p*g*Math.cos(h[a]),r=p*g*Math.sin(h[a]);!1===c&&!0===j?(m.x+=q/20*A.frame,m.y+=r/20*A.frame,1===A.frame&&(w._eventManager.objectMap[b].pastExploded=!1)):!0===c&&!0===j&&(m.x+=q,m.y+=r);w._eventManager.objectMap[b].center.x=m.x+s.x;w._eventManager.objectMap[b].center.y=m.y+s.y;j!==c&&(b={},b.dataSeries=f,b.dataPoint=f.dataPoints[a],b.index=a,w._toolTip.highlightObjects([b]));K(w.ctx,m,p,l,n,k[a],k[a+1]);1===A.frame&&(b=f.dataPointIds[a],l=S(b),w._eventManager.ghostCtx.save(),l="rgb("+l[0]+","+l[1]+
|
164
|
+
","+l[2]+")",K(w._eventManager.ghostCtx,m,p,l,n,k[a],k[a+1]),w._eventManager.ghostCtx.restore())}A.frame--;0<A.frame&&w.requestAnimFrame.call(window,d)}e(A.frame,20);w.ctx.restore();w._eventManager.ghostCtx.restore()}function e(a,b){for(var c=0;c<f.dataPoints.length;c++){var d=f.dataPointIds[c],e=w.ctx,k=m[c],n=r[c],s=q[c],u=t[c],v=w._eventManager.objectMap[d].currentlyExploded,x=l[c],y=p,z=h[c],A=f.dataPoints[c].indexLabelFontColor?f.dataPoints[c].indexLabelFontColor:f.indexLabelFontColor,B=f.indexLabelPlacement,
|
165
|
+
C=f.dataPoints[c].indexLabelLineColor?f.dataPoints[c].indexLabelLineColor:f.indexLabelLineColor,D=f.dataPoints[c].indexLabelLineThickness?f.dataPoints[c].indexLabelLineThickness:f.indexLabelLineThickness,E=a,F=b,d=w._eventManager.objectMap[d].pastExploded,G=j[c],H=f.dataPoints[c].indexLabelFontStyle?f.dataPoints[c].indexLabelFontStyle:f.indexLabelFontStyle,I=f.dataPoints[c].indexLabelFontWeight?f.dataPoints[c].indexLabelFontWeight:f.indexLabelFontWeight,J=f.dataPoints[c].indexLabelFontSize?f.dataPoints[c].indexLabelFontSize:
|
166
|
+
f.indexLabelFontSize,K=f.dataPoints[c].indexLabelFontFamily?f.dataPoints[c].indexLabelFontFamily:f.indexLabelFontFamily,L=f.dataPoints[c].indexLabelBackgroundColor?f.dataPoints[c].indexLabelBackgroundColor:f.indexLabelBackgroundColor?f.indexLabelBackgroundColor:null,M=c;e.save();e.lineWidth=D;e.font=H+" "+I+" "+J+"px "+K;D="left";0>k&&"outside"===B?D="right":0<=k&&"outside"===B?D="left":"inside"===B&&(D="center");e.textAlign=D;e.textBaseline="middle";e.beginPath();L&&(e.fillStyle=L,"outside"===B?
|
167
|
+
0<=k?e.fillRect(k-2.5,s-2.5,n-k+5,u-s+5):e.fillRect(k+2.5,s-2.5,n-k-5,u-s+5):"inside"===B&&(0<=k?e.fillRect(k-G/2-2.5,s-2.5,n-k+5,u-s+5):e.fillRect(k+G/2+2.5,s-2.5,n-k-5,u-s+5)));e.fillStyle=A;e.fillText(x,k,(s+u)/2);"outside"===B&&j[M]&&(n=y*Math.cos(z),x=y*Math.sin(z),!0===v&&!0!==d?(n+=y*g*Math.cos(z)/F*E,x+=y*g*Math.sin(z)/F*E):!0===v&&!0===d?(n+=y*g*Math.cos(z),x+=y*g*Math.sin(z)):!0!==v&&!0===d&&(n+=y*g*Math.cos(z)/F*E,x+=y*g*Math.sin(z)/F*E),e.moveTo(n,x),0<k?(e.lineTo(k-10,(s+u)/2),e.lineTo(k-
|
168
|
+
2,(s+u)/2)):0>k&&(e.lineTo(k+10,(s+u)/2),e.lineTo(k+2,(s+u)/2)),e.strokeStyle=C,e.stroke());e.restore()}}if(!(0>=a.dataSeriesIndexes.length)){var f=this.data[a.dataSeriesIndexes[0]],g=0.07;ctx=this.ctx;var j=[],k=[],h=[],l=[],n=0,p=0,m=[],r=[],q=[],t=[],v=f.dataPoints.length,u=this.getPlotArea();u.width=u.x2-u.x1;u.height=u.y2-u.y1;var s={x:(u.x2+u.x1)/2,y:(u.y2+u.y1)/2};a=f.startAngle?f.startAngle:0;a=(a%360+360)%360*Math.PI/180;k.push(a);var y=this._selectedColorSet,x=0.5*Math.min(u.width,u.height);
|
169
|
+
for(a=0;a<v;a++){var z=f.dataPoints[a].indexLabel?f.dataPoints[a].indexLabel:f.indexLabel?f.indexLabel:f.dataPoints[a].label?f.dataPoints[a].label:f.label?f.label:"",z=this.replaceKeywordsWithValue(z,f.dataPoints[a],f,a);l.push(z);var z=f.dataPoints[a].indexLabelFontStyle?f.dataPoints[a].indexLabelFontStyle:f.indexLabelFontStyle,B=f.dataPoints[a].indexLabelFontWeight?f.dataPoints[a].indexLabelFontWeight:f.indexLabelFontWeight,D=f.dataPoints[a].indexLabelFontSize?f.dataPoints[a].indexLabelFontSize:
|
170
|
+
f.indexLabelFontSize,C=f.dataPoints[a].indexLabelFontFamily?f.dataPoints[a].indexLabelFontFamily:f.indexLabelFontFamily;ctx.save();ctx.font=z+" "+B+" "+D+"px "+C;z=ctx.measureText(l[a]).width;ctx.restore();j.push(z);n+=Math.abs(f.dataPoints[a].y)}for(a=z=0;a<v;a++)B=Math.abs(f.dataPoints[a].y),B=2*Math.PI*(B/n),k.push(k[a]+B),B=B/2+k[a],h.push(B%(2*Math.PI)),z+=j[a];0===z&&(f.indexLabelPlacement="inside");z=0;if("inside"===f.indexLabelPlacement){x*=0.8*(1-g);for(a=0;a<v;a++)D=x*Math.cos(h[a]),C=x*
|
171
|
+
Math.sin(h[a]),m.push(D),0<D?r.push(m[a]+j[a]):r.push(m[a]-j[a]),q.push(C-f.indexLabelFontSize/2),t.push(C+f.indexLabelFontSize/2)}else if("outside"===f.indexLabelPlacement)for(B=0;3>B;B++){for(a=0;a<v;a++)D=x*Math.cos(h[a]),C=x*Math.sin(h[a]),m.push(D),0<D?r.push(m[a]+j[a]):r.push(m[a]-j[a]),q.push(C-f.indexLabelFontSize/2),t.push(C+f.indexLabelFontSize/2);for(a=0;a<v;a++)h[a]<Math.PI/2&&(1<=a&&q[a]<t[a-1])&&(D=t[a-1]-q[a],q[a]+=D+2,t[a]+=D+2,20>v&&(q[a]+=3,t[a]+=3)),h[a]<3*Math.PI/2&&h[a]>=Math.PI&&
|
172
|
+
t[a]>q[a-1]&&(D=t[a]-q[a-1],q[a]-=D+2,t[a]-=D+2,20>v&&(q[a]-=3,t[a]-=3));for(a=v;0<=a;a--)h[a]<Math.PI&&h[a]>=Math.PI/2&&q[a]<t[a+1]&&(D=t[a+1]-q[a],q[a]+=D+2,t[a]+=D+2,20>v&&(q[a]+=3,t[a]+=3)),h[a]>=3*Math.PI/2&&t[a]>q[a+1]&&(D=t[a]-q[a+1],q[a]-=D,t[a]-=D,20>v&&(q[a]+=-3,t[a]+=-3));if(2>z){a=Math.min.apply(Math,q.concat(t));var D=Math.max.apply(Math,q.concat(t)),C=Math.max.apply(Math,r.concat(m)),F=Math.min.apply(Math,r.concat(m)),E=[];Math.abs(a)>u.height/2&&E.push(Math.abs(a)-u.height/2);Math.abs(D)>
|
173
|
+
u.height/2&&E.push(Math.abs(D)-u.height/2);Math.abs(C)>u.width/2&&E.push(Math.abs(C)-u.width/2);Math.abs(F)>u.width/2&&E.push(Math.abs(F)-u.width/2);m=[];r=[];q=[];t=[];E.length&&(x-=Math.max.apply(Math,E)+f.indexLabelFontSize/2+2,40>x&&(x=40));z++}}var w=this,A={frame:0,maxAngle:k[0],count:0};0!==w.renderCount&&(this.animationEnabled=!1);A.isAnimating=60;c();this.pieDoughnutClickHandler=function(a){if(0===A.isAnimating){a=a.dataPointIndex;var c=f.dataPointIds[a];!0===w._eventManager.objectMap[c].currentlyExploded?
|
174
|
+
(!0===w._eventManager.objectMap[c].userSetExploded&&(f.dataPoints[a].exploded=!1),w._eventManager.objectMap[c].currentlyExploded=!1,A.frame=20,A.isAnimating=20,d()):!1===w._eventManager.objectMap[c].currentlyExploded&&(!0===w._eventManager.objectMap[c].userSetExploded&&(f.dataPoints[a].exploded=!0),w._eventManager.objectMap[c].currentlyExploded=!0,A.isAnimating=20,A.frame=0,b())}}}};s.prototype.requestAnimFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
|
175
|
+
window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)};N.prototype.registerSpace=function(a,c){"top"===a?this._topOccupied+=c.height:"bottom"===a?this._bottomOccupied+=c.height:"left"===a?this._leftOccupied+=c.width:"right"===a&&(this._rightOccupied+=c.width)};N.prototype.unRegisterSpace=function(a,c){"top"===a?this._topOccupied-=c.height:"bottom"===a?this._bottomOccupied-=c.height:"left"===a?this._leftOccupied-=c.width:"right"===a&&(this._rightOccupied-=
|
176
|
+
c.width)};N.prototype.getFreeSpace=function(){return{x1:this._leftOccupied,y1:this._topOccupied,x2:this.canvas.width-this._rightOccupied,y2:this.canvas.height-this._bottomOccupied,width:this.canvas.width-this._rightOccupied-this._leftOccupied,height:this.canvas.height-this._bottomOccupied-this._topOccupied}};N.prototype.reset=function(){this._topOccupied=0;this._bottomOccupied=3;this._rightOccupied=this._leftOccupied=0};I(C,E);C.prototype.render=function(a){a&&this.ctx.save();var c=this.ctx.font;
|
177
|
+
this.ctx.textBaseline=this.textBaseline;this._isDirty&&this.measureText(this.ctx);this.ctx.translate(this.x,this.y);this.ctx.font=this._getFontString();this.ctx.rotate(Math.PI/180*this.angle);var b=0,d=this.padding,e=null;if(0<this.borderThickness&&this.borderColor||this.backgroundColor)this.ctx.roundRect(0,0,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor),"middle"===this.textBaseline&&(d+=this.fontSize/2);this.ctx.fillStyle=this.fontColor;for(var f=
|
178
|
+
0;f<this._wrappedText.lines.length;f++)e=this._wrappedText.lines[f],"right"===this.horizontalAlign?b=this.width-e.width-this.padding:"left"===this.horizontalAlign?b=this.padding:"center"===this.horizontalAlign&&(b=(this.width-2*this.padding)/2-e.width/2+this.padding),this.ctx.fillText(e.text,b,d),d+=e.height;this.ctx.font=c;a&&this.ctx.restore()};C.prototype.setText=function(a){this.text=a;this._isDirty=!0;this._wrappedText=null};C.prototype.measureText=function(){if(null===this.maxWidth)throw"Please set maxWidth and height for TextBlock";
|
179
|
+
this._wrapText(this.ctx);this._isDirty=!1;return{width:this.width,height:this.height}};C.prototype._wrapText=function(){text=new String(M(this.text));var a=[],c=this.ctx.font,b=0,d=0;for(this.ctx.font=this._getFontString();0<text.length;){for(var e=text,f=0,g=0,j=this.maxWidth-2*this.padding,k=this.maxHeight-2*this.padding;;)if(f=this.ctx.measureText(e).width,g=0,f>j)g=e.length/f*j,f=Math.max(Math.min(Math.ceil(g),e.length-1),0),g=e.lastIndexOf(" ",f,e.length-1),e=0<=g?M(text.slice(0,g)):M(text.slice(0,
|
180
|
+
f-1));else{a.push({text:e,width:f,height:this.fontSize});d=Math.max(d,f);b+=this.fontSize;text=M(text.slice(e.length,text.length));break}if(k&&b>k-this.fontSize&&0<text.length){e=a.pop();Math.min(e.text.length,3);a.push(e);break}}this._wrappedText={lines:a,width:d,height:b};this.width=d+2*this.padding;this.height=b+2*this.padding;this.ctx.font=c};C.prototype._getFontString=function(){return this.fontStyle+" "+this.fontWeight+" "+this.fontSize+"px "+this.fontFamily};I(O,E);O.prototype.render=function(){if(this.text){var a=
|
181
|
+
this.chart.layoutManager.getFreeSpace(),c=0,b=0,d=0,e=0,f=0,g,j;"top"===this.verticalAlign||"bottom"===this.verticalAlign?(e=a.width-2*this.margin,f=0.5*a.height-2*this.margin,d=0):"center"===this.verticalAlign&&("left"===this.horizontalAlign||"right"===this.horizontalAlign?(e=a.height-2*this.margin,f=0.5*a.width-2*this.margin):"center"===this.horizontalAlign&&(e=a.width-2*this.margin,f=0.5*a.height-2*this.margin));var f=new C(this.ctx,{fontSize:this.fontSize,fontFamily:this.fontFamily,fontColor:this.fontColor,
|
182
|
+
fontStyle:this.fontStyle,fontWeight:this.fontWeight,horizontalAlign:this.horizontalAlign,verticalAlign:this.verticalAlign,borderColor:this.borderColor,borderThickness:this.borderThickness,backgroundColor:this.backgroundColor,maxWidth:e,maxHeight:f,cornerRadius:this.cornerRadius,text:this.text,padding:this.padding,textBaseline:this.borderColor&&0<this.borderThickness?"middle":"top"}),k=f.measureText();"top"===this.verticalAlign||"bottom"===this.verticalAlign?("top"===this.verticalAlign?(b=this.margin,
|
183
|
+
j="top"):"bottom"===this.verticalAlign&&(b=a.y2-this.margin-k.height,j="bottom"),"left"===this.horizontalAlign?c=a.x1+this.margin:"center"===this.horizontalAlign?c=a.x1+(e/2-k.width/2)+this.margin:"right"===this.horizontalAlign&&(c=a.x2-this.margin-k.width),g=this.horizontalAlign,this.width=k.width,this.height=k.height):"center"===this.verticalAlign&&("left"===this.horizontalAlign?(c=a.x1+this.margin,b=a.y2-this.margin-(e/2-k.width/2),d=-90,j="left",this.width=k.height,this.height=k.width):"right"===
|
184
|
+
this.horizontalAlign?(c=a.x2-this.margin,b=a.y1+this.margin+(e/2-k.width/2),d=90,j="right",this.width=k.height,this.height=k.width):"center"===this.horizontalAlign&&(b=a.y1+(a.height/2-k.height/2),c=a.x1+(a.width/2-k.width/2),j="center",this.width=k.width,this.height=k.height),g="center");f.x=c;f.y=b;f.angle=d;f.horizontalAlign=g;f.render(!0);this.chart.layoutManager.registerSpace(j,{width:this.width+2*this.margin,height:this.height+2*this.margin});this.bounds={x1:c,y1:b,x2:c+this.width,y2:b+this.height};
|
185
|
+
this.ctx.textBaseline="top"}};I(R,E);R.prototype.render=function(){var a=this.chart.layoutManager.getFreeSpace(),c=null,b=0,d=0,e=0,f=0,g=[],j=[];"undefined"===typeof this._options.fontSize&&(this.fontSize=fontSize=this.chart.getAutoFontSize(this.fontSize));"top"===this.verticalAlign||"bottom"===this.verticalAlign?(this.orientation="horizontal",c=this.verticalAlign,e=0.9*a.width,f=0.5*a.height):"center"===this.verticalAlign&&(this.orientation="vertical",c=this.horizontalAlign,e=0.5*a.width,f=0.9*
|
186
|
+
a.height);for(var k=0;k<this.dataSeries.length;k++){var h=this.dataSeries[k],l=h.legendMarkerType?h.legendMarkerType:("line"===h.type||"stepLine"===h.type||"spline"===h.type||"scatter"===h.type||"bubble"===h.type)&&h.markerType?h.markerType:J.getDefaultLegendMarker(h.type),n=h.legendText?h.legendText:h.name,p=h.legendMarkerColor?h.legendMarkerColor:h.markerColor?h.markerColor:h._colorSet[0],m=!h.markerSize&&("line"===h.type||"stepLine"===h.type||"spline"===h.type)?0:0.7*this.fontSize;if("pie"!==h.type&&
|
187
|
+
"doughnut"!==h.type)l={markerType:l,markerColor:p,text:n,textBlock:null,chartType:h.type,markerSize:m,lineColor:h._colorSet[0]},g.push(l);else for(var r=0;r<h.dataPoints.length;r++)m=h.dataPoints[r],l=m.legendMarkerType?m.legendMarkerType:h.legendMarkerType?h.legendMarkerType:J.getDefaultLegendMarker(h.type),n=m.legendText?m.legendText:h.legendText?h.legendText:m.name?m.name:"DataPoint: "+(r+1),p=m.markerColor?m.markerColor:h.markerColor?h.markerColor:m.color?m.color:h.color?h.color:h._colorSet[r%
|
188
|
+
h._colorSet.length],m=(0===m.markerSize||0===h.markerSize&&!m.markerSize)&&("line"===h.type||"stepLine"===h.type||"spline"===h.type)?0:0.7*this.fontSize,l={markerType:l,markerColor:p,text:n,textBlock:null,chartType:h.type,markerSize:m},g.push(l)}if(0<g.length){h=null;for(k=r=0;k<g.length;k++){l=g[k];if("horizontal"===this.orientation){if(l.textBlock=new C(this.ctx,{x:0,y:0,maxWidth:e,maxHeight:this.fontSize,angle:0,text:l.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,
|
189
|
+
fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"top"}),l.textBlock.measureText(),!h||h.width+l.textBlock.width+(0===h.width?0:this.horizontalSpacing)>e)h={entries:[],width:0},j.push(h),this.height=j.length*(this.fontSize+5)}else this.height+this.fontSize<f?(h={entries:[],width:0},j.push(h),this.height=j.length*this.fontSize):(h=j[r],r=(r+1)%j.length),l.textBlock=new C(this.ctx,{x:0,y:0,maxWidth:e,maxHeight:this.fontSize,angle:0,text:l.text,horizontalAlign:"left",
|
190
|
+
fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"top"}),l.textBlock.measureText();l.textBlock.x=h.width+(0===h.width?0:this.horizontalSpacing);l.textBlock.y=0;h.width+=l.textBlock.width+(this.fontSize+5)+(0===h.width?0:this.horizontalSpacing);h.entries.push(l);this.width=Math.max(h.width,this.width)}this.height=j.length*this.fontSize}"top"===this.verticalAlign?(d="left"===this.horizontalAlign?a.x1+2:"right"===
|
191
|
+
this.horizontalAlign?a.x2-this.width-2:a.x1+a.width/2-this.width/2,b=a.y1):"center"===this.verticalAlign?(d="left"===this.horizontalAlign?a.x1+2:"right"===this.horizontalAlign?a.x2-this.width-2:a.x1+a.width/2-this.width/2,b=a.y1+a.height/2-this.height/2):"bottom"===this.verticalAlign&&(d="left"===this.horizontalAlign?a.x1+2:"right"===this.horizontalAlign?a.x2-this.width-2:a.x1+a.width/2-this.width/2,b=a.y2-this.height-5);for(k=0;k<j.length;k++){h=j[k];for(a=0;a<h.entries.length;a++){l=h.entries[a];
|
192
|
+
e=l.textBlock.x+d;f=b+k*this.fontSize;if("line"===l.chartType||"stepLine"===l.chartType||"spline"===l.chartType)this.ctx.strokeStyle=l.lineColor,this.ctx.lineWidth=Math.ceil(this.fontSize/8),this.ctx.beginPath(),this.ctx.moveTo(e-2,f+this.fontSize/2),this.ctx.lineTo(e+2+this.fontSize,f+this.fontSize/2),this.ctx.stroke();F.drawMarker(e+this.fontSize/2,f+this.fontSize/2,this.ctx,l.markerType,m,l.markerColor,null,0);l.textBlock.x=e+this.fontSize+5;l.textBlock.y=f;l.textBlock.render(!0)}}this.chart.layoutManager.registerSpace(c,
|
193
|
+
{width:this.width,height:this.height+5+5});this.bounds={x1:d,y1:b,x2:d+this.width,y2:b+this.height}};I(U,E);U.prototype.render=function(){var a=this.chart.layoutManager.getFreeSpace();this.ctx.fillStyle="red";this.ctx.fillRect(a.x1,a.y1,a.x2,a.y2)};I(J,E);J.prototype.getDefaultAxisPlacement=function(){type=this.type;if("column"===type||"line"===type||"stepLine"===type||"spline"===type||"area"===type||"splineArea"===type||"stackedColumn"===type||"stackedLine"===type||"bubble"===type||"scatter"===type||
|
194
|
+
"stackedArea"===type||"stackedColumn100"===type||"stackedLine100"===type||"stackedArea100"===type)return"normal";if("bar"===type||"stackedBar"===type||"stackedBar100"===type)return"xySwapped";if("pie"===type||"doughnut"===type)return"none";window.console.log("Unknown Chart Type: "+type);return null};J.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===
|
195
|
+
a)return"square";if("line"===a||"stepLine"===a||"spline"===a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a)return"triangle";window.console.log("Unknown Chart Type: "+a);return null};J.prototype.findDataPointByX=function(a,c){for(var b=0,d=this.dataPoints.length,e,f={dataPoint:null,distance:Infinity,index:NaN},g=0,j=null;b<d;){g++;e=(b+d)/2<<0;var j=this.dataPoints[e],k=Math.abs(j.x-a);k<f.distance&&(f.dataPoint=j,f.distance=k,f.index=
|
196
|
+
e);if(j.x<a)b=e+1;else if(j.x>a)d=e;else{f.dataPoint=j;f.distance=k;f.index=e;break}}return!c&&f.dataPoint.x===a?f:c&&null!==f.dataPoint?f:null};J.prototype.getMarkerProperties=function(a,c,b,d){var e=this.dataPoints,f=e[a].markerColor?e[a].markerColor:this.markerColor?this.markerColor:e[a].color?e[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length];return{x:c,y:b,ctx:d,type:e[a].markerType?e[a].markerType:this.markerType,size:e[a].markerSize?e[a].markerSize:this.markerSize,color:f,
|
197
|
+
borderColor:e[a].markerBorderColor?e[a].markerBorderColor:this.markerBorderColor?this.markerBorderColor:f,borderThickness:e[a].markerBorderThickness?e[a].markerBorderThickness:this.markerBorderThickness?this.markerBorderThickness:1}};I(x,E);x.prototype.createLabels=function(){var a,c=0,b;if("axisX"===this.type&&"dateTime"===this.chart.plotInfo.axisXValueType){b=Y(new Date(this.maximum),this.interval,this.intervalType);for(c=this.intervalStartPosition;c<b;Y(c,this.interval,this.intervalType))a="axisX"===
|
198
|
+
this.type&&this.labels[c]?this.labels[c]:W(c,this.valueFormatString,this.chart._cultureInfo),a=new C(this.ctx,{x:0,y:0,maxWidth:this.maxHeight,maxHeight:this.labelFontSize,angle:this.labelAngle,text:this.prefix+a+this.suffix,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:c.getTime(),textBlock:a,effectiveHeight:null})}else{b=
|
199
|
+
this.maximum;if(this.labels&&this.labels.length){a=Math.ceil(this.interval);for(var d=Math.ceil(this.intervalStartPosition),e=!1,c=d;c<this.maximum;c+=a)if(this.labels[c])e=!0;else{e=!1;break}e&&(this.interval=a,this.intervalStartPosition=d)}for(c=this.intervalStartPosition;c<=b;c+=this.interval)a="axisX"===this.type&&this.labels[c]?this.labels[c]:X(c,this.valueFormatString,this.chart._cultureInfo),a=new C(this.ctx,{x:0,y:0,maxWidth:this.maxHeight,maxHeight:this.labelFontSize,angle:this.labelAngle,
|
200
|
+
text:this.prefix+a+this.suffix,horizontalAlign:"left",fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:c,textBlock:a,effectiveHeight:null})}};x.prototype.createLabelsAndCalculateWidth=function(){var a=0;this._labels=[];if("left"===this._position||"right"===this._position){this.createLabels();for(i=0;i<this._labels.length;i++){textBlock=
|
201
|
+
this._labels[i].textBlock;var c=textBlock.measureText();labelEffectiveWidth=0===this.labelAngle?c.width:c.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+c.height/2*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<labelEffectiveWidth&&(a=labelEffectiveWidth);this._labels[i].effectiveWidth=labelEffectiveWidth}}return(this.title?this.titleFontSize+5:0)+a+this.tickLength+10};x.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];var c,b=0;this.createLabels();if("bottom"===
|
202
|
+
this._position||"top"===this._position)for(b=0;b<this._labels.length;b++){c=this._labels[b].textBlock;c=c.measureText();var d=0,d=0===this.labelAngle?c.height:c.width*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+c.height/2*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<d&&(a=d);this._labels[b].effectiveHeight=d}return(this.title?this.titleFontSize+5:0)+a+this.tickLength};x.setLayoutAndRender=function(a,c,b,d,e){var f,g,j,k=a.chart.ctx;a.calculateAxisParameters();c&&c.calculateAxisParameters();
|
203
|
+
b&&b.calculateAxisParameters();if(c&&b&&"undefined"===typeof c._options.maximum&&"undefined"===typeof c._options.minimum&&"undefined"===typeof c._options.interval&&"undefined"===typeof b._options.maximum&&"undefined"===typeof b._options.minimum&&"undefined"===typeof b._options.interval){var h=(c.maximum-c.minimum)/c.interval,l=(b.maximum-b.minimum)/b.interval;h>l?b.maximum=b.interval*h+b.minimum:l>h&&(c.maximum=c.interval*l+c.minimum)}var n=c?c.lineThickness?c.lineThickness:0:0,p=b?b.lineThickness?
|
204
|
+
b.lineThickness:0:0,h=c?c.gridThickness?c.gridThickness:0:0,l=b?b.gridThickness?b.gridThickness:0:0,m=c?c.margin:0;if("normal"===d){var n=c?c.createLabelsAndCalculateWidth():0,p=b?b.createLabelsAndCalculateWidth():0,r=a.createLabelsAndCalculateHeight();d=e.x1+n+m;f=e.y2-r-a.margin;g=e.x2-p>a.chart.canvas.width-10?a.chart.canvas.width-10:e.x2-p;j=e.y2-a.margin;a.lineCoordinates={x1:d,y1:f,x2:g,y2:f,width:Math.abs(g-d)};a.boundingRect={x1:d,y1:f,x2:g,y2:j,width:g-d,height:j-f};c&&(d=e.x1+c.margin,f=
|
205
|
+
10>e.y1?10:e.y1,g=e.x1+n+c.margin,j=e.y2-r-a.margin,c.lineCoordinates={x1:g,y1:f,x2:g,y2:j,height:Math.abs(j-f)},c.boundingRect={x1:d,y1:f,x2:g,y2:j,width:g-d,height:j-f});b&&(d=a.lineCoordinates.x2,f=10>e.y1?10:e.y1,g=d+p+b.margin,j=e.y2-r-a.margin,b.lineCoordinates={x1:d,y1:f,x2:d,y2:j,height:Math.abs(j-f)},b.boundingRect={x1:d,y1:f,x2:g,y2:j,width:g-d,height:j-f});k.save();k.rect(a.boundingRect.x1-40,a.boundingRect.y1,a.boundingRect.width+80,a.boundingRect.height);k.clip();a.renderLabelsTicksAndTitle();
|
206
|
+
k.restore();c&&c.renderLabelsTicksAndTitle();b&&b.renderLabelsTicksAndTitle();e=a.chart.getPlotArea();k.save();k.rect(e.x1,e.y1-Math.max(l,h)/2,Math.abs(e.x2-e.x1),Math.abs(e.y2-e.y1+Math.max(l,h)/2+Math.max(l,h,a.lineThickness)/2))}else{var r=c?c.createLabelsAndCalculateHeight():0,q=b?b.createLabelsAndCalculateHeight():0,s=a.createLabelsAndCalculateWidth();c&&(d=e.x1+s+a.margin+a.lineThickness/2,f=e.y2-r-c.margin,g=e.x2>c.chart.canvas.width-10?c.chart.canvas.width-10:e.x2,j=e.y2-c.margin,c.lineCoordinates=
|
207
|
+
{x1:d,y1:f,x2:g,y2:f,width:Math.abs(g-d)},c.boundingRect={x1:d,y1:f,x2:g,y2:j,width:g-d,height:r});b&&(d=e.x1+s+a.margin+a.lineThickness/2,f=e.y1+b.margin,g=e.x2>b.chart.canvas.width-10?b.chart.canvas.width-10:e.x2,j=e.y1+b.margin+q,b.lineCoordinates={x1:d,y1:j,x2:g,y2:j,width:Math.abs(g-d)},b.boundingRect={x1:d,y1:f,x2:g,y2:j,width:g-d,height:q});d=e.x1+a.margin;f=10>e.y1+q+p/2?10:e.y1+q+p/2;g=e.x1+s+a.margin;j=e.y2-r-m-n/2;a.lineCoordinates={x1:g,y1:f,x2:g,y2:j,height:Math.abs(j-f)};a.boundingRect=
|
208
|
+
{x1:d,y1:f,x2:g,y2:j,width:g-d,height:j-f};k.save();c&&c.renderLabelsTicksAndTitle();b&&b.renderLabelsTicksAndTitle();a.renderLabelsTicksAndTitle();e=a.chart.getPlotArea();k.save();k.rect(e.x1-Math.max(a.lineThickness,h,l)/2,e.y1,Math.abs(e.x2-e.x1+Math.max(a.lineThickness,h,l)/2+Math.max(h,l)/2),Math.abs(e.y2-e.y1))}k.clip();a.calculateValueToPixelConvertionParameters();c&&c.calculateValueToPixelConvertionParameters();b&&b.calculateValueToPixelConvertionParameters();a.renderInterlacedColors();c&&
|
209
|
+
c.renderInterlacedColors();b&&b.renderInterlacedColors();k.restore();a.renderGrid();c&&c.renderGrid();b&&b.renderGrid();a.renderAxisLine();c&&c.renderAxisLine();b&&b.renderAxisLine()};x.prototype.renderLabelsTicksAndTitle=function(){var a=!1,c=0,b=0.9,d=0;0!==this.labelAngle&&360!==this.labelAngle&&(b=1.2);if("bottom"===this._position||"top"===this._position){for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||(f=f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)+f.textBlock.height*
|
210
|
+
Math.sin(Math.PI/180*this.labelAngle),c+=f);c>this.lineCoordinates.width*b&&(a=!0)}if("left"===this._position||"right"===this._position){for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||(f=f.textBlock.height*Math.cos(Math.PI/180*this.labelAngle)+f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle),c+=f);c>this.lineCoordinates.height*b&&(a=!0)}if("bottom"===this._position){var e=0;this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(var f,e=0;e<
|
211
|
+
this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(c=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(c.x<<0,c.y<<0),this.ctx.lineTo(c.x<<0,c.y+this.tickLength<<0),this.ctx.stroke()),a&&0!==d++%2||(0===f.textBlock.angle?(c.x-=f.textBlock.width/2,c.y+=this.tickLength+f.textBlock.height/2):(c.x-=0>this.labelAngle?f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,c.y+=this.tickLength+Math.abs(0>this.labelAngle?
|
212
|
+
f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle):0)),f.textBlock.x=c.x,f.textBlock.y=c.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new C(this.ctx,{x:this.lineCoordinates.x1,y:this.boundingRect.y2-this.titleFontSize-5,maxWidth:this.lineCoordinates.width,maxHeight:this.titleFontSize,angle:0,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,
|
213
|
+
textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.render(!0))}else if("top"===this._position){this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(c=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(c.x<<
|
214
|
+
0,c.y<<0),this.ctx.lineTo(c.x<<0,c.y-this.tickLength<<0),this.ctx.stroke()),a&&0!==d++%2||(0===f.textBlock.angle?(c.x-=f.textBlock.width/2,c.y-=this.tickLength+f.textBlock.height/2):(c.x-=0<this.labelAngle?f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle):0,c.y-=this.tickLength+Math.abs(0<this.labelAngle?f.textBlock.width*Math.sin(Math.PI/180*this.labelAngle)+5:5)),f.textBlock.x=c.x,f.textBlock.y=c.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new C(this.ctx,{x:this.lineCoordinates.x1,
|
215
|
+
y:this.boundingRect.y1,maxWidth:this.lineCoordinates.width,maxHeight:this.titleFontSize,angle:0,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.x=this.lineCoordinates.x1+this.lineCoordinates.width/2-this._titleTextBlock.width/2,this._titleTextBlock.render(!0))}else if("left"===this._position){this.ctx.lineWidth=
|
216
|
+
this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(c=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(c.x<<0,c.y<<0),this.ctx.lineTo(c.x-this.tickLength<<0,c.y<<0),this.ctx.stroke()),a&&0!==d++%2||(f.textBlock.x=c.x-f.textBlock.width*Math.cos(Math.PI/180*this.labelAngle)-this.tickLength-5,f.textBlock.y=c.y-f.textBlock.width*Math.sin(Math.PI/
|
217
|
+
180*this.labelAngle),f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new C(this.ctx,{x:this.boundingRect.x1+5,y:this.lineCoordinates.y2,maxWidth:this.lineCoordinates.height,maxHeight:this.titleFontSize,angle:-90,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.y=this.lineCoordinates.height/
|
218
|
+
2+this._titleTextBlock.width/2+this.lineCoordinates.y1,this._titleTextBlock.render(!0))}else if("right"===this._position){this.ctx.lineWidth=this.tickThickness;this.ctx.strokeStyle=this.tickColor;for(e=0;e<this._labels.length;e++)f=this._labels[e],f.position<this.minimum||f.position>this.maximum||(c=this.getPixelCoordinatesOnAxis(f.position),this.tickThickness&&(this.ctx.beginPath(),this.ctx.moveTo(c.x<<0,c.y<<0),this.ctx.lineTo(c.x+this.tickLength<<0,c.y<<0),this.ctx.stroke()),a&&0!==d++%2||(f.textBlock.x=
|
219
|
+
c.x+this.tickLength+5,f.textBlock.y=c.y,f.textBlock.render(!0)));this.title&&(this._titleTextBlock=new C(this.ctx,{x:this.boundingRect.x2-5,y:this.lineCoordinates.y2,maxWidth:this.lineCoordinates.height,maxHeight:this.titleFontSize,angle:90,text:this.title,horizontalAlign:"center",fontSize:this.titleFontSize,fontFamily:this.titleFontFamily,fontWeight:this.titleFontWeight,fontColor:this.titleFontColor,fontStyle:this.titleFontStyle,textBaseline:"top"}),this._titleTextBlock.measureText(),this._titleTextBlock.y=
|
220
|
+
this.lineCoordinates.height/2-this._titleTextBlock.width/2+this.lineCoordinates.y1,this._titleTextBlock.render(!0))}};x.prototype.renderInterlacedColors=function(){var a,c,b=this.chart.getPlotArea();if(("bottom"===this._position||"top"===this._position)&&this.interlacedColor){var d=0;this.ctx.fillStyle=this.interlacedColor;for(d=0;d<this._labels.length;d+=2)a=this.getPixelCoordinatesOnAxis(this._labels[d].position),c=d+1>=this._labels.length?this.getPixelCoordinatesOnAxis(this.maximum):this.getPixelCoordinatesOnAxis(this._labels[d+
|
221
|
+
1].position),this.ctx.fillRect(a.x,b.y1,Math.abs(c.x-a.x),Math.abs(b.y1-b.y2))}else if(("left"===this._position||"right"===this._position)&&this.interlacedColor){this.ctx.fillStyle=this.interlacedColor;for(d=0;d<this._labels.length;d+=2)c=this.getPixelCoordinatesOnAxis(this._labels[d].position),a=d+1>=this._labels.length?this.getPixelCoordinatesOnAxis(this.maximum):this.getPixelCoordinatesOnAxis(this._labels[d+1].position),this.ctx.fillRect(b.x1,a.y,Math.abs(b.x1-b.x2),Math.abs(a.y-c.y))}};x.prototype.renderGrid=
|
222
|
+
function(){var a,c=this.chart.getPlotArea();if("bottom"===this._position||"top"===this._position){if(this.gridThickness&&0<this.gridThickness){this.ctx.lineWidth=this.gridThickness;this.ctx.strokeStyle=this.gridColor;this.ctx.beginPath();for(b=0;b<this._labels.length;b++)this._labels[b].position<this.minimum||this._labels[b].position>this.maximum||(a=this.getPixelCoordinatesOnAxis(this._labels[b].position),this.ctx.moveTo(a.x<<0,c.y1<<0),this.ctx.lineTo(a.x<<0,c.y2<<0),this.ctx.stroke())}}else if(("left"===
|
223
|
+
this._position||"right"===this._position)&&this.gridThickness&&0<this.gridThickness){this.ctx.lineWidth=this.gridThickness;this.ctx.strokeStyle=this.gridColor;this.ctx.beginPath();for(var b=0;b<this._labels.length;b++)this._labels[b].position<this.minimum||this._labels[b].position>this.maximum||(a=this.getPixelCoordinatesOnAxis(this._labels[b].position),this.ctx.moveTo(c.x1<<0,a.y<<0),this.ctx.lineTo(c.x2<<0,a.y<<0),this.ctx.stroke())}};x.prototype.renderAxisLine=function(){if("bottom"===this._position||
|
224
|
+
"top"===this._position)this.lineThickness&&(this.ctx.lineWidth=this.lineThickness,this.ctx.strokeStyle=this.lineColor?this.lineColor:"black",this.ctx.beginPath(),this.ctx.moveTo(this.lineCoordinates.x1,this.lineCoordinates.y1),this.ctx.lineTo(this.lineCoordinates.x2,this.lineCoordinates.y2),this.ctx.stroke());else if(("left"===this._position||"right"===this._position)&&this.lineThickness)this.ctx.lineWidth=this.lineThickness,this.ctx.strokeStyle=this.lineColor,this.ctx.beginPath(),this.ctx.moveTo(this.lineCoordinates.x1,
|
225
|
+
this.lineCoordinates.y1),this.ctx.lineTo(this.lineCoordinates.x2,this.lineCoordinates.y2),this.ctx.stroke()};x.prototype.getPixelCoordinatesOnAxis=function(a){var c={},b=this.lineCoordinates.width,d=this.lineCoordinates.height;if("bottom"===this._position||"top"===this._position)b/=Math.abs(this.maximum-this.minimum),c.x=this.lineCoordinates.x1+b*(a-this.minimum),c.y=this.lineCoordinates.y1;if("left"===this._position||"right"===this._position)b=d/Math.abs(this.maximum-this.minimum),c.y=this.lineCoordinates.y2-
|
226
|
+
b*(a-this.minimum),c.x=this.lineCoordinates.x2;return c};x.prototype.calculateValueToPixelConvertionParameters=function(){var a={pixelPerUnit:null,minimum:null,reference:null},c=this.lineCoordinates.width,b=this.lineCoordinates.height;a.minimum=this.minimum;if("bottom"===this._position||"top"===this._position)a.pixelPerUnit=c/Math.abs(this.maximum-this.minimum),a.reference=this.lineCoordinates.x1;if("left"===this._position||"right"===this._position)a.pixelPerUnit=-1*b/Math.abs(this.maximum-this.minimum),
|
227
|
+
a.reference=this.lineCoordinates.y2;this.convertionParameters=a};x.prototype.calculateAxisParameters=function(){var a=this.chart.layoutManager.getFreeSpace();"bottom"===this._position||"top"===this._position?(this.maxWidth=a.width,this.maxHeight=a.height):(this.maxWidth=a.height,this.maxHeight=a.width);var a="axisX"===this.type?500>this.maxWidth?8:Math.max(6,Math.floor(this.maxWidth/62)):Math.floor(this.maxWidth/40),c,b,d,e;"axisX"===this.type?(c=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:
|
228
|
+
this.dataInfo.viewPortMin,b=null!==this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:this.dataInfo.viewPortMax,0===b-c&&(b+=0.5,c-=0.5),d=Infinity!==this.dataInfo.minDiff?this.dataInfo.minDiff:1):"axisY"===this.type&&(c="undefined"===typeof this._options.minimum?this.dataInfo.viewPortMin:this._options.minimum,b="undefined"===typeof this._options.maximum?this.dataInfo.viewPortMax:this._options.maximum,0===b-c?(b+=5,c-=5):(0!==b&&(b+=Math.abs(0.05)),0!==c&&(c-=Math.abs(0.05))),
|
229
|
+
this.includeZero&&"undefined"===typeof this._options.minimum&&0<c&&(c=0),this.includeZero&&"undefined"===typeof this._options.maximum&&0>b&&(b=0));"axisX"===this.type&&"dateTime"===this.chart.plotInfo.axisXValueType?(e=b-c,this.intervalType||(e/1<=a?(this.interval=1,this.intervalType="millisecond"):e/2<=a?(this.interval=2,this.intervalType="millisecond"):e/5<=a?(this.interval=5,this.intervalType="millisecond"):e/10<=a?(this.interval=10,this.intervalType="millisecond"):e/20<=a?(this.interval=20,this.intervalType=
|
230
|
+
"millisecond"):e/50<=a?(this.interval=50,this.intervalType="millisecond"):e/100<=a?(this.interval=100,this.intervalType="millisecond"):e/200<=a?(this.interval=200,this.intervalType="millisecond"):e/250<=a?(this.interval=250,this.intervalType="millisecond"):e/300<=a?(this.interval=300,this.intervalType="millisecond"):e/400<=a?(this.interval=400,this.intervalType="millisecond"):e/500<=a?(this.interval=500,this.intervalType="millisecond"):e/(1*y.secondDuration)<=a?(this.interval=1,this.intervalType=
|
231
|
+
"second"):e/(2*y.secondDuration)<=a?(this.interval=2,this.intervalType="second"):e/(5*y.secondDuration)<=a?(this.interval=5,this.intervalType="second"):e/(10*y.secondDuration)<=a?(this.interval=10,this.intervalType="second"):e/(15*y.secondDuration)<=a?(this.interval=15,this.intervalType="second"):e/(20*y.secondDuration)<=a?(this.interval=20,this.intervalType="second"):e/(30*y.secondDuration)<=a?(this.interval=30,this.intervalType="second"):e/(1*y.minuteDuration)<=a?(this.interval=1,this.intervalType=
|
232
|
+
"minute"):e/(2*y.minuteDuration)<=a?(this.interval=2,this.intervalType="minute"):e/(5*y.minuteDuration)<=a?(this.interval=5,this.intervalType="minute"):e/(10*y.minuteDuration)<=a?(this.interval=10,this.intervalType="minute"):e/(15*y.minuteDuration)<=a?(this.interval=15,this.intervalType="minute"):e/(20*y.minuteDuration)<=a?(this.interval=20,this.intervalType="minute"):e/(30*y.minuteDuration)<=a?(this.interval=30,this.intervalType="minute"):e/(1*y.hourDuration)<=a?(this.interval=1,this.intervalType=
|
233
|
+
"hour"):e/(2*y.hourDuration)<=a?(this.interval=2,this.intervalType="hour"):e/(3*y.hourDuration)<=a?(this.interval=3,this.intervalType="hour"):e/(6*y.hourDuration)<=a?(this.interval=6,this.intervalType="hour"):e/(1*y.dayDuration)<=a?(this.interval=1,this.intervalType="day"):e/(2*y.dayDuration)<=a?(this.interval=2,this.intervalType="day"):e/(4*y.dayDuration)<=a?(this.interval=4,this.intervalType="day"):e/(1*y.weekDuration)<=a?(this.interval=1,this.intervalType="week"):e/(2*y.weekDuration)<=a?(this.interval=
|
234
|
+
2,this.intervalType="week"):e/(3*y.weekDuration)<=a?(this.interval=3,this.intervalType="week"):e/(1*y.monthDuration)<=a?(this.interval=1,this.intervalType="month"):e/(2*y.monthDuration)<=a?(this.interval=2,this.intervalType="month"):e/(3*y.monthDuration)<=a?(this.interval=3,this.intervalType="month"):e/(6*y.monthDuration)<=a?(this.interval=6,this.intervalType="month"):(this.interval=e/(1*y.yearDuration)<=a?1:e/(2*y.yearDuration)<=a?2:e/(4*y.yearDuration)<=a?4:Math.floor(x.getNiceNumber(e/(a-1),!0)/
|
235
|
+
y.yearDuration),this.intervalType="year")),this.minimum=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:c-d/2,this.maximum=this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:b+d/2,this.valueFormatString||("year"===this.intervalType?this.valueFormatString="YYYY":"month"===this.intervalType?this.valueFormatString="MMM YYYY":"week"===this.intervalType?this.valueFormatString="MMM DD YYYY":"day"===this.intervalType?this.valueFormatString="MMM DD YYYY":
|
236
|
+
"hour"===this.intervalType?this.valueFormatString="hh:mm TT":"minute"===this.intervalType?this.valueFormatString="hh:mm TT":"second"===this.intervalType?this.valueFormatString="hh:mm:ss TT":"millisecond"===this.intervalType&&(this.valueFormatString="fff'ms'")),this.intervalStartPosition=this.getLabelStartPoint(new Date(this.minimum),this.intervalType,this.interval)):(this.intervalType="number",e=x.getNiceNumber(b-c,!1),this.interval=this._options&&this._options.interval?this._options.interval:x.getNiceNumber(e/
|
237
|
+
(a-1),!0),this.minimum=null!==this.sessionVariables.internalMinimum?this.sessionVariables.internalMinimum:Math.floor(c/this.interval)*this.interval,this.maximum=null!==this.sessionVariables.internalMaximum?this.sessionVariables.internalMaximum:Math.ceil(b/this.interval)*this.interval,"axisX"===this.type?(null===this.sessionVariables.internalMinimum&&(this.minimum=c-d/2),this.sessionVariables.internalMaximum||(this.maximum=b+d/2),this.intervalStartPosition=Math.floor((this.minimum+this.interval)/this.interval)*
|
238
|
+
this.interval):"axisY"===this.type&&(this.intervalStartPosition=this.minimum));"axisX"===this.type&&(this._absoluteMinimum=this._options&&"undefined"!==typeof this._options.minimum?this._options.minimum:this.dataInfo.min-d/2,this._absoluteMaximum=this._options&&"undefined"!==typeof this._options.maximum?this._options.maximum:this.dataInfo.max+d/2);if(!this.valueFormatString&&(this.valueFormatString="#,##0.##",e=Math.abs(this.maximum-this.minimum),1>e&&(c=Math.floor(Math.abs(Math.log(e)/Math.LN10))+
|
239
|
+
2,2<c)))for(b=0;b<c-2;b++)this.valueFormatString+="#"};x.prototype._getFontString=function(){return this.labelFontStyle+" "+this.labelFontWeight+" "+this.labelFontSize+"px "+this.labelFontFamily};x.getNiceNumber=function(a,c){var b=Math.floor(Math.log(a)/Math.LN10),d=a/Math.pow(10,b);return(c?1.5>d?1:3>d?2:7>d?5:10:1>=d?1:2>=d?2:5>=d?5:10)*Math.pow(10,b)};x.prototype.getLabelStartPoint=function(){var a=L(this.interval,this.intervalType),a=new Date(Math.floor(this.minimum/a)*a);if("millisecond"!==
|
240
|
+
this.intervalType)if("second"===this.intervalType)0<a.getMilliseconds()&&(a.setSeconds(a.getSeconds()+1),a.setMilliseconds(0));else if("minute"===this.intervalType){if(0<a.getSeconds()||0<a.getMilliseconds())a.setMinutes(a.getMinutes()+1),a.setSeconds(0),a.setMilliseconds(0)}else if("hour"===this.intervalType){if(0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setHours(a.getHours()+1),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("day"===this.intervalType){if(0<a.getHours()||
|
241
|
+
0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("week"===this.intervalType){if(0<a.getDay()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setDate(a.getDate()+(7-a.getDay())),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("month"===this.intervalType){if(1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds())a.setMonth(a.getMonth()+
|
242
|
+
1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0)}else if("year"===this.intervalType&&(0<a.getMonth()||1<a.getDate()||0<a.getHours()||0<a.getMinutes()||0<a.getSeconds()||0<a.getMilliseconds()))a.setFullYear(a.getFullYear()+1),a.setMonth(0),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0);return a};I(H,E);H.prototype._initialize=function(){if(this.enabled){this.container=document.createElement("div");this.container.style.height="auto";
|
243
|
+
this.container.style.position="absolute";this.container.style.boxShadow="1px 1px 2px 2px rgba(0,0,0,0.1)";this.container.style.zIndex="1000";this.container.style.display="none";var a;a='<div style=" width: auto;height: auto;min-width: 50px;';a+="line-height: 20px;";a+="padding: 5px;";a+="font-family: Calibri, Arial, Georgia, serif;";a+="font-weight: 400;";a+="font-style: italic;";a+="font-size: 14px;";a+="color: #000000;";a+="text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1);";a+="text-align: left;";a+=
|
244
|
+
"border: 2px solid gray;";a+="background: rgba(255,255,255,.9);";a+="text-indent: 0px;";a+="white-space: nowrap;";a+="border-radius: 10px;";a+='} "> Sample Tooltip</div>';this.container.innerHTML=a;this.contentDiv=this.container.firstChild;this.container.style.borderRadius=this.contentDiv.style.borderRadius;this.chart._canvasJSContainer.appendChild(this.container)}};H.prototype.mouseMoveHandler=function(a,c){var b=this;clearTimeout(this._timerId);this._timerId=setTimeout(function(){b._updateToolTip(a,
|
245
|
+
c)},5)};H.prototype._updateToolTip=function(a,c){if(this.enabled){if("undefined"===typeof a||"undefined"===typeof c){if(isNaN(this._prevX)||isNaN(this._prevY))return;a=this._prevX;c=this._prevY}else this._prevX=a,this._prevY=c;var b=null,d=null,e=[],f=0;if(this.shared&&"none"!==this.chart.plotInfo.axisPlacement){f="xySwapped"===this.chart.plotInfo.axisPlacement?(this.chart.axisX.maximum-this.chart.axisX.minimum)/this.chart.axisX.lineCoordinates.height*(this.chart.axisX.lineCoordinates.y2-c)+this.chart.axisX.minimum:
|
246
|
+
(this.chart.axisX.maximum-this.chart.axisX.minimum)/this.chart.axisX.lineCoordinates.width*(a-this.chart.axisX.lineCoordinates.x1)+this.chart.axisX.minimum;b=[];for(d=0;d<this.chart.data.length;d++)if(g={},(g=this.chart.data[d].findDataPointByX(f,!0))&&0<=g.index)g.dataSeries=this.chart.data[d],b.push(g);if(0===b.length)return;b.sort(function(a,b){return a.distance-b.distance});f=b[0];for(d=0;d<b.length;d++)b[d].dataPoint.x.valueOf()===f.dataPoint.x.valueOf()&&e.push(b[d]);b=null}else{g=this.chart._eventManager.ghostCtx.getImageData(a,
|
247
|
+
c,2,2).data;b=!0;for(d=0;4>d;d++)if(g[d]!==g[d+4]|g[d]!==g[d+8]|g[d]!==g[d+12]){b=!1;break}g=b?g[0]<<16|g[1]<<8|g[2]:0;0<g&&"undefined"!==typeof this.chart._eventManager.objectMap[g]?(eventObject=this.chart._eventManager.objectMap[g],this.currentSeriesIndex=eventObject.dataSeriesIndex,this.currentDataPointIndex=0<=eventObject.dataPointIndex?eventObject.dataPointIndex:-1):this.currentDataPointIndex=-1;if(0<=this.currentSeriesIndex){var d=this.chart.data[this.currentSeriesIndex],g={};if(0<=this.currentDataPointIndex)b=
|
248
|
+
d.dataPoints[this.currentDataPointIndex],g.dataSeries=d,g.dataPoint=b,g.index=this.currentDataPointIndex,g.distance=Math.abs(b.x-f);else if("line"===d.type||"stepLine"===d.type||"spline"===d.type||"area"===d.type||"splineArea"===d.type||"stackedArea"===d.type||"stackedArea100"===d.type)f=(this.chart.axisX.maximum-this.chart.axisX.minimum)/this.chart.axisX.lineCoordinates.width*(a-this.chart.axisX.lineCoordinates.x1)+this.chart.axisX.minimum.valueOf(),g=d.findDataPointByX(f,!0),g.dataSeries=d,this.currentDataPointIndex=
|
249
|
+
g.index,b=g.dataPoint;else return;e.push(g)}}0<e.length&&(this.highlightObjects(e),f="",f=this.getToolTipInnerHTML({entries:e}),this.contentDiv.innerHTML=f,this.contentDiv.innerHTML=f,f=!1,"none"===this.container.style.display&&(f=!0,this.container.style.display="block"),this.contentDiv.style.borderRightColor=this.contentDiv.style.borderLeftColor=this.contentDiv.style.borderColor=this.borderColor?this.borderColor:e[0].dataPoint.color?e[0].dataPoint.color:e[0].dataSeries.color?e[0].dataSeries.color:
|
250
|
+
e[0].dataSeries._colorSet[e[0].index%e[0].dataSeries._colorSet.length],toolTipLeft="pie"===e[0].dataSeries.type||"doughnut"===e[0].dataSeries.type||"bar"===e[0].dataSeries.type||"stackedBar"===e[0].dataSeries.type||"stackedBar100"===e[0].dataSeries.type?a-10-this.container.clientWidth:this.chart.axisX.lineCoordinates.width/Math.abs(this.chart.axisX.maximum-this.chart.axisX.minimum)*Math.abs(e[0].dataPoint.x-this.chart.axisX.minimum)+this.chart.axisX.lineCoordinates.x1+0.5-this.container.clientWidth<<
|
251
|
+
0,toolTipLeft=0<toolTipLeft?toolTipLeft+"px":toolTipLeft+this.container.clientWidth+20+"px",e=1===e.length&&!this.shared&&("line"===e[0].dataSeries.type||"stepLine"===e[0].dataSeries.type||"spline"===e[0].dataSeries.type||"area"===e[0].dataSeries.type||"splineArea"===e[0].dataSeries.type||"stackedArea"===e[0].dataSeries.type||"stackedArea100"===e[0].dataSeries.type)?e[0].dataSeries.axisY.lineCoordinates.y2-e[0].dataSeries.axisY.lineCoordinates.height/Math.abs(e[0].dataSeries.axisY.maximum-e[0].dataSeries.axisY.minimum)*
|
252
|
+
Math.abs(e[0].dataPoint.y-e[0].dataSeries.axisY.minimum)+0.5<<0:"bar"===e[0].dataSeries.type||"stackedBar"===e[0].dataSeries.type||"stackedBar100"===e[0].dataSeries.type?e[0].dataSeries.axisX.lineCoordinates.y2-e[0].dataSeries.axisX.lineCoordinates.height/Math.abs(e[0].dataSeries.axisX.maximum-e[0].dataSeries.axisX.minimum)*Math.abs(e[0].dataPoint.x-e[0].dataSeries.axisX.minimum)+0.5<<0:c,e=-e+10,0<e+this.container.clientHeight+5&&(e-=e+this.container.clientHeight+5-0),this.container.style.left=toolTipLeft,
|
253
|
+
this.container.style.bottom=e+"px",!this.animationEnabled||f?this.disableAnimation():this.enableAnimation())}};H.prototype.highlightObjects=function(a){if(this.enabled){var c=this.chart.overlaidCanvasCtx;this.chart.resetOverlayedCanvas();var b=this.chart.getPlotArea();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();for(b=0;b<a.length;b++){var d=a[b];if((d=this.chart._eventManager.objectMap[d.dataSeries.dataPointIds[d.index]])&&d.objectType&&"dataPoint"===d.objectType){var e=this.chart.data[d.dataSeriesIndex],
|
254
|
+
f=d.dataPointIndex;if("line"===e.type||"stepLine"===e.type||"spline"===e.type||"scatter"===e.type||"area"===e.type||"splineArea"===e.type||"stackedArea"===e.type||"stackedArea100"===e.type)e=e.getMarkerProperties(f,d.x1,d.y1,this.chart.overlaidCanvasCtx),e.size=Math.max(1.5*e.size<<0,10),F.drawMarkers([e]);else if("bubble"===e.type)e=e.getMarkerProperties(f,d.x1,d.y1,this.chart.overlaidCanvasCtx),e.size=d.size,e.color="white",e.borderColor="white",c.globalAlpha=0.3,F.drawMarkers([e]),c.globalAlpha=
|
255
|
+
1;else if("column"===e.type||"stackedColumn"===e.type||"stackedColumn100"===e.type||"bar"===e.type||"stackedBar"===e.type||"stackedBar100"===e.type)c.globalAlpha=0.3,G(c,d.x1,d.y1,d.x2,d.y2,"white",!1,!1,!1,!1),c.globalAlpha=1;else if("pie"===e.type||"doughnut"===e.type)c.globalAlpha=0.3,K(c,d.center,d.radius,"white",e.type,d.startAngle,d.endAngle),c.globalAlpha=1}}c.globalAlpha=1;c.restore()}};H.prototype.getToolTipInnerHTML=function(a){a=a.entries;for(var c="",b=null,d=null,e=0,f="",g=!0,j=0;j<
|
256
|
+
a.length;j++)if(a[j].dataSeries.toolTipContent||a[j].dataPoint.toolTipContent){g=!1;break}if(g&&this.content&&"function"===typeof this.content)c=this.content({entries:a});else if(1<a.length)for(j=0;j<a.length;j++){b=a[j].dataSeries;d=a[j].dataPoint;e=a[j].index;f="";0===j&&(g&&!this.content)&&(f+="undefined"!==typeof this.chart.axisX.labels[d.x]?this.chart.axisX.labels[d.x]:"{x}",f+="</br>");if("line"===b.type||"stepLine"===b.type||"spline"===b.type||"area"===b.type||"splineArea"===b.type||"column"===
|
257
|
+
b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type)f+=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>{name}:</span> {y}";else if("bubble"===b.type)f+=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&
|
258
|
+
"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>{name}:</span> {y}, {z}";else if("pie"===b.type||"doughnut"===b.type)f+=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:" {y}";c+=this.chart.replaceKeywordsWithValue(f,d,b,e);j<a.length-1&&(c+="</br>")}else{b=a[0].dataSeries;d=a[0].dataPoint;e=a[0].index;if("line"===b.type||"stepLine"===b.type||"spline"===
|
259
|
+
b.type||"area"===b.type||"splineArea"===b.type||"column"===b.type||"bar"===b.type||"scatter"===b.type||"stackedColumn"===b.type||"stackedColumn100"===b.type||"stackedBar"===b.type||"stackedBar100"===b.type||"stackedArea"===b.type||"stackedArea100"===b.type)f=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>"+(d.label?"{label}":"{x}")+" :</span> {y}";else if("bubble"===b.type)f=
|
260
|
+
d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:"<span style='\"'color:{color};'\"'>"+(d.label?"{label}":"{x}")+":</span> {y}, {z}";else if("pie"===b.type||"doughnut"===b.type)f=d.toolTipContent?d.toolTipContent:b.toolTipContent?b.toolTipContent:this.content&&"function"!==typeof this.content?this.content:(d.name?"{name}: ":d.label?"{label}: ":"")+"{y}";c+=this.chart.replaceKeywordsWithValue(f,
|
261
|
+
d,b,e)}return c};H.prototype.enableAnimation=function(){this.container.style.WebkitTransition||(this.container.style.WebkitTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.MozTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.MsTransition="left .2s ease-out, bottom .2s ease-out",this.container.style.transition="left .2s ease-out, bottom .2s ease-out")};H.prototype.disableAnimation=function(){this.container.style.WebkitTransition&&(this.container.style.WebkitTransition=
|
262
|
+
"",this.container.style.MozTransition="",this.container.style.MsTransition="",this.container.style.transition="")};H.prototype.hide=function(){this.enabled&&(this.container.style.display="none",this.currentSeriesIndex=-1,this._prevY=this._prevX=NaN,this.chart.resetOverlayedCanvas())};s.prototype.replaceKeywordsWithValue=function(a,c,b,d){var e=this;return a.replace(/\{\s*[a-zA-Z]+\s*\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,
|
263
|
+
a.length-1);a=M(a.slice(1,a.length-1));var g=null;if("color"===a)return c.color?c.color:b.color?b.color:b._colorSet[d%b._colorSet.length];if(c.hasOwnProperty(a))g=c;else if(b.hasOwnProperty(a))g=b;else return"";return"x"===a?e.axisX&&"dateTime"===e.plotInfo.axisXValueType?W(g[a],c.xValueFormatString?c.xValueFormatString:b.xValueFormatString?b.xValueFormatString:e.axisX&&e.axisX.valueFormatString?e.axisX.valueFormatString:"DD MMM YY",e._cultureInfo):X(g[a],c.xValueFormatString?c.xValueFormatString:
|
264
|
+
b.xValueFormatString?b.xValueFormatString:"#,##0.########",e._cultureInfo):"y"===a?X(g[a],c.yValueFormatString?c.yValueFormatString:b.yValueFormatString?b.yValueFormatString:"#,##0.########",e._cultureInfo):g[a]})};Q.prototype.reset=function(){this.lastObjectId=0;this.objectMap=[];this.rectangularRegionEventSubscriptions=[];this.previousDataPointEventObject=null;this.ghostCtx.clearRect(0,0,this.ghostCanvas.width,this.ghostCanvas.height);this.ghostCtx.beginPath()};Q.prototype.getNewObjectTrackingId=
|
265
|
+
function(){return++this.lastObjectId};Q.prototype.mouseEventHandler=function(a){if(!("mousemove"!==a.type&&"click"!==a.type)){var c=null,b=null,d=null,e=-1,f=!1,g=!1,j=ca(a),b=this.ghostCtx.getImageData(j.x,j.y,1,1).data;if(240<b[3])if(b=b[0]<<16|b[1]<<8|b[2],"undefined"!==typeof this.objectMap[b]&&"dataPoint"===this.objectMap[b].objectType){c=this.objectMap[b];b=this.chart.data[c.dataSeriesIndex];d=b.dataPoints[c.dataPointIndex];e=c.dataPointIndex;if(null===this.previousDataPointEventObject||this.previousDataPointEventObject.dataSeriesIndex!==
|
266
|
+
c.dataSeriesIndex||this.previousDataPointEventObject.dataPointIndex!==c.dataPointIndex)if(this.previousDataPointEventObject&&(f=!0),d.mouseover&&d.mouseover.call(d,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e}),b.mouseover&&(null===this.previousDataPointEventObject||this.previousDataPointEventObject.dataSeriesIndex!==c.dataSeriesIndex))b.mouseover&&b.mouseover.call(b,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e}),this.previousDataPointEventObject&&(g=!0);"mousemove"===a.type?(d.cursor?
|
267
|
+
a.target.style.cursor=d.cursor:b.cursor&&(a.target.style.cursor=b.cursor),d.mousemove&&d.mousemove.call(d,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e}),b.mousemove&&b.mousemove.call(b,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e})):"click"===a.type&&5>Math.sqrt(Math.pow(this.chart.dragStartPoint.x-j.x,2)+Math.pow(this.chart.dragStartPoint.y-j.y,2))&&(d.click&&d.click.call(d,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e}),b.click&&b.click.call(b,{x:j.x,y:j.y,dataPoint:d,
|
268
|
+
dataSeries:b,dataPointIndex:e}),this.chart.pieDoughnutClickHandler&&this.chart.pieDoughnutClickHandler.call(b,{x:j.x,y:j.y,dataPoint:d,dataSeries:b,dataPointIndex:e}))}else this.previousDataPointEventObject&&(g=f=!0);else this.previousDataPointEventObject&&(g=f=!0);if(f||g)a.target.style.cursor=this.chart._defaultCursor,a=this.chart.data[this.previousDataPointEventObject.dataSeriesIndex],b=a.dataPoints[this.previousDataPointEventObject.dataPointIndex],d=this.previousDataPointEventObject.dataPointIndex,
|
269
|
+
f&&b.mouseout&&b.mouseout.call(b,{x:j.x,y:j.y,dataPoint:b,dataSeries:a,dataPointIndex:d}),g&&a.mouseout&&a.mouseout.call(a,{x:j.x,y:j.y,dataPoint:b,dataSeries:a,dataPointIndex:d});this.previousDataPointEventObject=c}};I(aa,E);var F={drawMarker:function(a,c,b,d,e,f,g,j){if(b){var k=1;b.fillStyle=f?f:"#000000";b.strokeStyle=g?g:"#000000";b.lineWidth=j?j:0;"circle"===d?(b.beginPath(),b.arc(a,c,e/2,0,360,!1),f&&b.fill(),j&&(g?b.stroke():(k=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),
|
270
|
+
b.globalAlpha=k))):"square"===d?(b.beginPath(),b.rect(a-e/2,c-e/2,e,e),f&&b.fill(),j&&(g?b.stroke():(k=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=k))):"triangle"===d?(b.beginPath(),b.moveTo(a-e/2,c+e/2),b.lineTo(a+e/2,c+e/2),b.lineTo(a,c-e/2),b.closePath(),f&&b.fill(),j&&(g?b.stroke():(k=b.globalAlpha,b.globalAlpha=0.15,b.strokeStyle="black",b.stroke(),b.globalAlpha=k))):"cross"===d&&(b.strokeStyle=f,b.lineWidth=e/4,b.beginPath(),b.moveTo(a-e/2,c-e/2),b.lineTo(a+
|
271
|
+
e/2,c+e/2),b.stroke(),b.moveTo(a+e/2,c-e/2),b.lineTo(a-e/2,c+e/2),b.stroke())}},drawMarkers:function(a){for(var c=0;c<a.length;c++){var b=a[c];F.drawMarker(b.x,b.y,b.ctx,b.type,b.size,b.color,b.borderColor,b.borderThickness)}}},ea={Chart:function(a,c){var b=new s(a,c,this);this.render=function(){b.render()};this.options=b._options},addColorSet:function(a,c){P[a]=c},addCultureInfo:function(a,c){V[a]=c}};ea.Chart.version="1.2.1";window.CanvasJS=ea})();
|