@canvasjs/charts 3.10.15 → 3.10.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/canvasjs.min.js +75 -75
- package/package.json +1 -1
package/LICENSE
CHANGED
package/canvasjs.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS Chart - v3.10.
|
|
2
|
+
CanvasJS Chart - v3.10.16 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2024 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -269,73 +269,73 @@ this.axisY2[c].crosshair.render(null,this.sessionVariables.mouseY,this.axisY2[c]
|
|
|
269
269
|
"area"===b[c].dataSeries.type||"stepArea"===b[c].dataSeries.type)if(e=ma("markerSize",b[c].dataPoint,b[c].dataSeries)||8,b[c].distance<=e/2){d=!0;break}for(c=0;c<b.length;c++)d&&"line"!==b[c].dataSeries.type&&"stepLine"!==b[c].dataSeries.type&&"area"!==b[c].dataSeries.type&&"stepArea"!==b[c].dataSeries.type||(a?b[c].distance<=a.distance&&(a=b[c]):a=b[c]);return a};t.prototype.getObjectAtXY=function(a,d,c){var b=null;if(c=this.getDataPointAtXY(a,d,c||!1))b=c.dataSeries.dataPointIds[c.dataPointIndex];
|
|
270
270
|
else if(r)b=bb(a,d,this._eventManager.ghostCtx);else for(c=0;c<this.legend.items.length;c++){var e=this.legend.items[c];a>=e.x1&&(a<=e.x2&&d>=e.y1&&d<=e.y2)&&(b=e.id)}return b};t.prototype.getAutoFontSize=nb;t.prototype.resetOverlayedCanvas=function(){this.overlaidCanvasCtx.clearRect(0,0,this.width,this.height)};t.prototype.clearCanvas=mb;t.prototype.attachEvent=function(a){this._events.push(a)};t.prototype._touchEventHandler=function(a){if(a.changedTouches&&this.interactivityEnabled){var d=[],c=
|
|
271
271
|
a.changedTouches,b=c?c[0]:a,e=null;switch(a.type){case "touchstart":case "MSPointerDown":d=["mousemove","mousedown"];this._lastTouchData=Qa(b);this._lastTouchData.time=new Date;break;case "touchmove":case "MSPointerMove":d=["mousemove"];break;case "touchend":case "MSPointerUp":var h=this._lastTouchData&&this._lastTouchData.time?new Date-this._lastTouchData.time:0,d="touchstart"===this._lastTouchEventType||"MSPointerDown"===this._lastTouchEventType||300>h?["mouseup","click"]:["mouseup"];break;default:return}if(!(c&&
|
|
272
|
-
1<c.length)){e=Qa(b);e.time=new Date;try{var q=e.y-this._lastTouchData.y,h=e.time-this._lastTouchData.time;if(1<Math.abs(q)&&this._lastTouchData.scroll||5<Math.abs(q)&&250>h)this._lastTouchData.scroll=!0}catch(u){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(c=0;c<d.length;c++)if(e=d[c],q=document.createEvent("MouseEvent"),q.initMouseEvent(e,!0,!0,
|
|
273
|
-
|
|
274
|
-
0<this.axisY2.length&&b.push("axisY2");for(var e=0;e<b.length;e++)if(l(c[b[e]])&&(c[b[e]]=[]),"axisY"===b[e])for(var h=0;h<this.axisY.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisY2"===b[e])for(h=0;h<this.axisY2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,
|
|
275
|
-
b[e])for(h=0;h<this.axisX.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisX2"===b[e])for(h=0;h<this.axisX2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});this.dispatchEvent(a,c,this)};
|
|
276
|
-
t.capturedEventParam,q=e.bounds,"mouseup"===b&&(t.capturedEventParam=null,e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",e.chart._mouseEventHandler,!1)),e.hasOwnProperty(b)&&("mouseup"!==b||e.chart.overlaidCanvas.releaseCapture?a.target!==e.chart.overlaidCanvas&&r||e[b].call(e.context,c.x,c.y):a.target!==e.chart.overlaidCanvas&&(e.chart.isDrag
|
|
277
|
-
var c=Qa(a),b=a.type,e,h;a.which?h=3==a.which:a.button&&(h=2==a.button);if(this._ignoreNextEvent)d(),this._ignoreNextEvent=!1;else if(d(),this.interactivityEnabled){a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault();var q;Ia&&window.console&&(window.console.log(b+" --\x3e x: "+c.x+"; y:"+c.y),h&&window.console.log(a.which),"mouseup"===b&&window.console.log("mouseup"));if(!h){if(!t.capturedEventParam&&
|
|
278
|
-
this._events[h],q=e.bounds,c.x>=q.x1&&c.x<=q.x2&&c.y>=q.y1&&c.y<=q.y2){e[b].call(e.context,c.x,c.y);"mousedown"===b&&!0===e.capture?(t.capturedEventParam=e,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",
|
|
279
|
-
e&&e.cursor?e.cursor:this._defaultCursor}h=this.plotArea;if(c.x<h.x1||c.x>h.x2||c.y<h.y1||c.y>h.y2){this.toolTip&&this.toolTip.enabled?(this.toolTip.hide(),this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip)):this.resetOverlayedCanvas();for(h=0;h<this.axisX.length;h++)this.axisX[h].crosshair&&this.axisX[h].crosshair.enabled&&(this.axisX[h].crosshair.hide(),this.axisX[h].crosshair.dispatchEvent("hidden",
|
|
280
|
-
for(h=0;h<this.axisX2.length;h++)this.axisX2[h].crosshair&&this.axisX2[h].crosshair.enabled&&(this.axisX2[h].crosshair.hide(),this.axisX2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[h].options},this.axisX2[h].crosshair));for(h=0;h<this.axisY.length;h++)this.axisY[h].crosshair&&this.axisY[h].crosshair.enabled&&(this.axisY[h].crosshair.hide(),this.axisY[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[h].options},
|
|
281
|
-
this.axisY2[h].crosshair.enabled&&(this.axisY2[h].crosshair.hide(),this.axisY2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[h].options},this.axisY2[h].crosshair))}this.sessionVariables.mouseX=c.x;this.sessionVariables.mouseY=c.y;this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}}};t.prototype._plotAreaMouseDown=function(a,d){this.isDrag=!0;this.dragStartPoint=
|
|
282
|
-
"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var c=d-this.dragStartPoint.y,b=a-this.dragStartPoint.x,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),q=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var u=h,h=e,e=u;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(e=h=0;e<this._axes.length;e++)c=this._axes[e],c.logarithmic?c.viewportMinimum<
|
|
283
|
-
h,c.sessionVariables.newViewportMaximum=c.viewportMaximum*h,q=!0):c.viewportMaximum>c.maximum&&(h=c.viewportMaximum/c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum/h,c.sessionVariables.newViewportMaximum=c.viewportMaximum/h,q=!0):c.viewportMinimum<c.minimum?(h=c.minimum-c.viewportMinimum,c.sessionVariables.newViewportMinimum=c.viewportMinimum+h,c.sessionVariables.newViewportMaximum=c.viewportMaximum+
|
|
284
|
-
c.viewportMinimum-h,c.sessionVariables.newViewportMaximum=c.viewportMaximum-h,q=!0);else if((!e||2<Math.abs(b))&&(!h||2<Math.abs(c))&&this.zoomEnabled){if(!this.dragStartPoint)return;c=e?this.dragStartPoint.x:this.plotArea.x1;b=h?this.dragStartPoint.y:this.plotArea.y1;e=e?a:this.plotArea.x2;h=h?d:this.plotArea.y2;2<Math.abs(c-e)&&2<Math.abs(b-h)&&this._zoomPanToSelectedRegion(c,b,e,h)&&(q=!0)}q&&
|
|
285
|
-
(this.stockChart._rangeEventParameter={stockChart:this.stockChart,source:"chart",index:this.stockChart.charts.indexOf(this),minimum:this.stockChart.sessionVariables._axisXMin,maximum:this.stockChart.sessionVariables._axisXMax}),this.stockChart._rangeEventParameter.type="rangeChanging",this.stockChart.dispatchEvent("rangeChanging",this.stockChart._rangeEventParameter,this.stockChart)),
|
|
286
|
-
this.stockChart._rangeEventParameter.type="rangeChanged",this.stockChart.dispatchEvent("rangeChanged",this.stockChart._rangeEventParameter,this.stockChart)),q&&(this.zoomEnabled&&"none"===this._zoomButton.style.display)&&(Ma(this._zoomButton,this._resetButton),sa(this,this._zoomButton,"pan"),sa(this,this._resetButton,"reset")))}}this.isDrag=!1;if("none"!==this.plotInfo.axisPlacement){this.resetOverlayedCanvas();
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
if(this.axisY2&&0<this.axisY2.length)for(q=0;q<this.axisY2.length;q++)this.axisY2[q].crosshair&&this.axisY2[q].crosshair.enabled&&this.axisY2[q].crosshair.renderLabel()}};t.prototype._plotAreaMouseMove=function(a,d){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var c=0,b=0,e=c=null,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),q=this;"xySwapped"===this.plotInfo.axisPlacement&&
|
|
290
|
-
(this.panEnabled||this.zoomEnabled)){this.toolTip.hide();this.toolTip&&this.toolTip.enabled&&this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip);for(var u=0;u<this.axisX.length;u++)this.axisX[u].crosshair&&this.axisX[u].crosshair.enabled&&(this.axisX[u].crosshair.hide(),this.axisX[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX[u].options},this.axisX[u].crosshair));
|
|
291
|
-
(this.axisX2[u].crosshair.hide(),this.axisX2[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[u].options},this.axisX2[u].crosshair));for(u=0;u<this.axisY.length;u++)this.axisY[u].crosshair&&this.axisY[u].crosshair.enabled&&(this.axisY[u].crosshair.hide(),this.axisY[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[u].options},this.axisY[u].crosshair));for(u=0;u<this.axisY2.length;u++)this.axisY2[u].crosshair&&
|
|
292
|
-
this.axisY2[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[u].options},this.axisY2[u].crosshair))}else this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!e||2<Math.abs(c)||!h||2<Math.abs(b))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)e={x1:e?this.plotArea.x1+c:this.plotArea.x1,y1:h?this.plotArea.y1+b:this.plotArea.y1,x2:e?this.plotArea.x2+c:this.plotArea.x2,y2:h?this.plotArea.y2+
|
|
293
|
-
c,e,g){return function(){q._zoomPanToSelectedRegion(b,c,e,g,!0)&&(q._dispatchRangeEvent("rangeChanging","pan"),q.stockChart&&(q.stockChart._rangeEventParameter.type="rangeChanging",q.stockChart.dispatchEvent("rangeChanging",q.stockChart._rangeEventParameter,q.stockChart)),q.render(),q._dispatchRangeEvent("rangeChanged","pan"),q.stockChart&&(q.stockChart._rangeEventParameter.type="rangeChanged",q.stockChart.dispatchEvent("rangeChanged",
|
|
294
|
-
a,q.dragStartPoint.y=d)}}(e.x1,e.y1,e.x2,e.y2),0);else if(this.zoomEnabled){this.resetOverlayedCanvas();c=this.overlaidCanvasCtx.globalAlpha;this.overlaidCanvasCtx.fillStyle="#A89896";var b=e?this.dragStartPoint.x:this.plotArea.x1,u=h?this.dragStartPoint.y:this.plotArea.y1,l=e?a-this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,k=h?d-this.dragStartPoint.y:this.plotArea.y2-this.plotArea.y1;this.validateRegion(b,u,e?a:this.plotArea.x2-
|
|
295
|
-
this.zoomType).isValid&&(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCanvasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(b,u,l,k);this.overlaidCanvasCtx.globalAlpha=c}}else if(this.toolTip.mouseMoveHandler(a,d),"none"!==this.plotInfo.axisPlacement){this.sessionVariables.crosshairShownByPixel=!0;if(this.axisX&&0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&this.axisX[e].crosshair.enabled&&
|
|
296
|
-
if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].renderCrosshair(a,d);if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].renderCrosshair(a,d);if(this.axisY2&&0<this.axisY2.length)for(e=0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&this.axisY2[e].renderCrosshair(a,
|
|
297
|
-
0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&this.axisX[e].crosshair.enabled&&this.axisX[e].crosshair.renderLabel();if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].crosshair.renderLabel();if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].crosshair.renderLabel();if(this.axisY2&&
|
|
298
|
-
0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&this.axisY2[e].crosshair.renderLabel()}};t.prototype._zoomPanToSelectedRegion=function(a,d,c,b,e){a=this.validateRegion(a,d,c,b,e);d=a.axesWithValidRange;c=a.axesRanges;if(a.isValid)for(b=0;b<d.length;b++)e=c[b],d[b].setViewPortRange(e.val1,e.val2),this.syncCharts&&"y"!=this.zoomType&&this.syncCharts(e.val1,e.val2),this.stockChart&&(this.stockChart._rangeEventParameter={stockChart:this.stockChart,
|
|
299
|
-
index:this.stockChart.charts.indexOf(this),minimum:e.val1,maximum:e.val2});return a.isValid};t.prototype.validateRegion=function(a,d,c,b,e){e=e||!1;for(var h=0<=this.zoomType.indexOf("x"),q=0<=this.zoomType.indexOf("y"),u=!1,l=[],k=[],m=[],n=0;n<this._axes.length;n++)("axisX"===this._axes[n].type&&h||"axisY"===this._axes[n].type&&q)&&k.push(this._axes[n]);for(q=0;q<k.length;q++){var n=k[q],h=!1,p=n.convertPixelToValue({x:a,y:d}),g=n.convertPixelToValue({x:c,y:b});if(p>g)var f=g,g=p,
|
|
300
|
-
0;!h&&f<n.scaleBreaks._appliedBreaks.length;f++)h=n.scaleBreaks._appliedBreaks[f].startValue<=p&&n.scaleBreaks._appliedBreaks[f].endValue>=g;if(isFinite(n.dataInfo.minDiff))if(f=n.getApparentDifference(p,g,null,!0),!(h||!(this.panEnabled&&n.scaleBreaks&&n.scaleBreaks._appliedBreaks.length)&&(n.logarithmic&&f<Math.pow(n.dataInfo.minDiff,3)||!n.logarithmic&&f<3*Math.abs(n.dataInfo.minDiff))||p<n.minimum||g>n.maximum))l.push(n),m.push({val1:p,val2:g}),u=!0;else if(!e){u=!1;
|
|
301
|
-
axesRanges:m}};t.prototype.preparePlotArea=function(){var a=this.plotArea;!r&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1,a.y1);if((this.axisX[0]||this.axisX2[0])&&(this.axisY[0]||this.axisY2[0])){var d=this.axisX[0]?this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.length&&this.axisY[0]){var c=this.axisY[0];a.x1=d.x1<d.x2?d.x1:c.lineCoordinates.x1;a.y1=d.y1<c.lineCoordinates.y1?d.y1:c.lineCoordinates.y1;a.x2=d.x2>c.lineCoordinates.x2?
|
|
302
|
-
d.y1>c.lineCoordinates.y2?d.y1:c.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0<this.axisY2.length&&this.axisY2[0]&&(c=this.axisY2[0],a.x1=d.x1<d.x2?d.x1:c.lineCoordinates.x1,a.y1=d.y1<c.lineCoordinates.y1?d.y1:c.lineCoordinates.y1,a.x2=d.x2>c.lineCoordinates.x2?d.x2:c.lineCoordinates.x2,a.y2=d.y2>c.lineCoordinates.y2?d.y2:c.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else d=this.layoutManager.getFreeSpace(),a.x1=d.x1,a.x2=d.x2,a.y1=
|
|
303
|
-
a.height=d.height;r||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,-a.y1));a.layoutManager=new Fa(a.x1,a.y1,a.x2,a.y2,2)};t.prototype.renderIndexLabels=function(a){var d=a||this.plotArea.ctx,c=this.plotArea,b=0,e=0,h=0,q=e=h=0,u=0,f=b=0,k=0;for(a=0;a<this._indexLabels.length;a++){var m=this._indexLabels[a],n=m.chartType.toLowerCase(),p,g,u=ma("indexLabelFontColor",m.dataPoint,
|
|
304
|
-
m.dataPoint,m.dataSeries),f=ma("indexLabelFontFamily",m.dataPoint,m.dataSeries),k=ma("indexLabelFontStyle",m.dataPoint,m.dataSeries);p=ma("indexLabelFontWeight",m.dataPoint,m.dataSeries);var x=ma("indexLabelBackgroundColor",m.dataPoint,m.dataSeries);g=ma("indexLabelBorderColor",m.dataPoint,m.dataSeries);var h=ma("indexLabelBorderThickness",m.dataPoint,m.dataSeries),e=ma("indexLabelMaxWidth",m.dataPoint,m.dataSeries),q=ma("indexLabelWrap",m.dataPoint,m.dataSeries),
|
|
305
|
-
m.dataSeries),s=ma("indexLabelLineColor",m.dataPoint,m.dataSeries),C=l(m.dataPoint.indexLabelLineThickness)?l(m.dataSeries.options.indexLabelLineThickness)?0:m.dataSeries.options.indexLabelLineThickness:m.dataPoint.indexLabelLineThickness,b=0<C?Math.min(10,("normal"===this.plotInfo.axisPlacement?this.plotArea.height:this.plotArea.width)<<0):0,v={percent:null,total:null},W=null;if(0<=m.dataSeries.type.indexOf("stacked")||"pie"===m.dataSeries.type||"doughnut"===
|
|
306
|
-
m.dataPoint);if(m.dataSeries.indexLabelFormatter||m.dataPoint.indexLabelFormatter)W={chart:this,dataSeries:m.dataSeries,dataPoint:m.dataPoint,index:m.indexKeyword,total:v.total,percent:v.percent};var t=m.dataPoint.indexLabelFormatter?m.dataPoint.indexLabelFormatter(W):m.dataPoint.indexLabel?this.replaceKeywordsWithValue(m.dataPoint.indexLabel,m.dataPoint,m.dataSeries,null,m.indexKeyword):m.dataSeries.indexLabelFormatter?m.dataSeries.indexLabelFormatter(W):
|
|
307
|
-
m.dataPoint,m.dataSeries,null,m.indexKeyword):null;if(null!==t&&""!==t){var v=ma("indexLabelPlacement",m.dataPoint,m.dataSeries),W=ma("indexLabelOrientation",m.dataPoint,m.dataSeries),B=ma("indexLabelTextAlign",m.dataPoint,m.dataSeries),w=m.direction,z=m.dataSeries.axisX,K=m.dataSeries.axisY,L=!1,x=new ka(d,{x:0,y:0,maxWidth:e?e:0.5*this.width,maxHeight:q?5*D:1.5*D,angle:"horizontal"===W?0:-90,text:t,padding:0,backgroundColor:x,
|
|
308
|
-
fontColor:u,fontStyle:k,textBaseline:"middle"});x.measureText();m.dataSeries.indexLabelMaxWidth=x.maxWidth;if("stackedarea100"===n){if(m.point.x<c.x1||m.point.x>c.x2||m.point.y<c.y1-1||m.point.y>c.y2+1)continue}else if("rangearea"===n||"rangesplinearea"===n){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||Math.max.apply(null,m.dataPoint.y)<K.viewportMinimum||Math.min.apply(null,m.dataPoint.y)>K.viewportMaximum)continue}else if(0<=
|
|
309
|
-
0<=n.indexOf("scatter")){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||m.dataPoint.y<K.viewportMinimum||m.dataPoint.y>K.viewportMaximum)continue}else if(0<=n.indexOf("column")){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||(0<m.dataPoint.y.length?Math.max.apply(null,m.dataPoint.y):m.dataPoint.y)<K.viewportMinimum||(0<m.dataPoint.y.length?Math.max.apply(null,m.dataPoint.y):m.dataPoint.y)>
|
|
310
|
-
|
|
311
|
-
z.viewportMinimum||m.dataPoint.x>z.viewportMaximum)continue;q=u=2;"horizontal"===W?(f=x.width,k=x.height):(k=x.width,f=x.height);if("normal"===this.plotInfo.axisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))v="auto",u=4;else if(0<=n.indexOf("stacked"))"auto"===v&&(v="inside");else if("bubble"===n||"scatter"===n)v="inside";p=m.point.x-f/2+("horizontal"===W?0:x._lineHeight/2);if("inside"!==v)e=c.y1,h=c.y2,
|
|
312
|
-
2+u+b:e+x._lineHeight/2+u+b,L=g+("horizontal"===W?k-x._lineHeight/2:0)>m.point.y,!L||(0<=n.indexOf("line")||0<=n.indexOf("area"))||(g-=b))):(g=m.point.y+x._lineHeight/2+u+b,g>h-k+x._lineHeight/2-u&&(g="auto"===v?Math.min(m.point.y,h)+x._lineHeight/2-k-u-b:h+x._lineHeight/2-k-u-b,L=g-("horizontal"===W?x._lineHeight/2:k)<m.point.y,!L||(0<=n.indexOf("line")||0<=n.indexOf("area"))||(g+=b)));else{Math.max(m.bounds.y1,
|
|
313
|
-
n?0<w?Math.max(m.bounds.y1,c.y1)+x._lineHeight/2+u:Math.min(m.bounds.y2,c.y2)+x._lineHeight/2-k-u:(Math.max(m.bounds.y1,c.y1)+Math.min(m.bounds.y2,c.y2))/2-k/2+x._lineHeight/2;if(0<w){if(g=b,"bubble"===n||"scatter"===n)g=m.point.y-k/2+x._lineHeight/2,k>m.bounds.y2-m.bounds.y1&&(g-=k/2+u),0>g-x._lineHeight/2&&(g+=Math.abs(g-x._lineHeight/2)<=(m.bounds.y2-m.bounds.y1)/2+u?Math.abs(g-x._lineHeight/2):(m.bounds.y2-
|
|
314
|
-
(g=Math.min(m.point.y+u,c.y2-k-u));g=Math.min(g,h)}}else 0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(v="auto",q=4):0<=n.indexOf("stacked")?"auto"===v&&(v="inside"):"bubble"===n&&(v="inside"),g=m.point.y+x._lineHeight/2-k/2,"inside"!==v?(h=c.x1,e=c.x2,0>w?(p=m.point.x-f+("horizontal"===W?0:x._lineHeight/2)-q-b,("horizontal"===W?p:p-x._lineHeight/2)<h&&(p="auto"===v?Math.max(m.point.x,h)+
|
|
315
|
-
f-("horizontal"===W?0:x._lineHeight/2)>m.point.x)&&(p-=b))):(p=m.point.x+("horizontal"===W?0:x._lineHeight/2)+q+b,("horizontal"===W?p:p-x._lineHeight/2)>e-f-q-b&&(p="auto"===v?Math.min(m.point.x,e)-("horizontal"===W?f:f-x._lineHeight/2)-q-b:e-f-q+("horizontal"===W?0:x._lineHeight/2),(L=p-("horizontal"===W?0:x._lineHeight/2)<m.point.x)&&(p+=b)))):(h=Math.max(m.bounds.x1,c.x1),Math.min(m.bounds.x2,c.x2),b=0<=n.indexOf("range")||
|
|
316
|
-
q+("horizontal"===W?0:x._lineHeight/2):(Math.max(m.bounds.x1,c.x1)+Math.min(m.bounds.x2,c.x2))/2-f/2+("horizontal"===W?0:x._lineHeight/2),p=0>w?b:Math.min(m.point.x,b),p=Math.max(p,h+("horizontal"===W?0:x._lineHeight/2+u)));"vertical"===W&&(g+=k-x._lineHeight/2,0<="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(n)&&(L=0<w?g+("horizontal"===W?k-x._lineHeight/2:0)>m.point.y:
|
|
317
|
-
n)&&(p+=x._lineHeight/2-D/2);x.x=p;x.y=g;x.render(!0);C&&("inside"!==v&&(0>n.indexOf("bar")&&("error"!==n||!m.axisSwapped)&&m.point.x>c.x1&&m.point.x<c.x2||!L)&&(-1==="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(n)&&("error"!==n||m.axisSwapped)&&m.point.y>c.y1&&m.point.y<c.y2||!L))&&(d.lineWidth=C,d.strokeStyle=s?s:"gray",d.setLineDash&&d.setLineDash(I(y,C)),d.beginPath(),
|
|
318
|
-
m.axisSwapped?d.lineTo(p+(0<m.direction?0:f)+("vertical"===W?-x._lineHeight/2:0),g+("vertical"===W?-k/2:k/2-x._lineHeight/2)):0<=n.indexOf("column")||"error"===n&&!m.axisSwapped?d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),g+("vertical"===W?g-k<m.point.y?0:-k:(g-x._lineHeight/2<m.point.y?k:0)-x._lineHeight/2)):0<=n.indexOf("waterfall")?d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),"vertical"===W?0<w&&g<m.point.y?g:0>w&&g-
|
|
319
|
-
k-x._lineHeight/2:0>w&&g-x._lineHeight/2>m.point.y?g-x._lineHeight/2:m.point.y):d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),g+("vertical"===W?g-k<m.point.y?0:-k:(g+k-x._lineHeight/2<m.point.y?k:0)-x._lineHeight/2)),d.stroke())}}d={source:d,dest:this.plotArea.ctx,animationCallback:R.fadeInAnimation,easingFunction:R.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._indexLabels.length;a++)m=this._indexLabels[a],
|
|
320
|
-
m.dataSeries.indexLabelBackgroundColor=l(x)?r?"transparent":null:x;return d};t.prototype.renderLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=r?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],q,u=0;u<a.dataSeriesIndexes.length;u++){var l=a.dataSeriesIndexes[u],k=this.data[l];c.lineWidth=
|
|
321
|
-
I(k.nullDataLineDashType,k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);c.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);b.strokeStyle=f;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];c.strokeStyle=f;var y=!0,s=0,C,v;c.beginPath();if(0<m.length){for(var W=!1,s=0;s<m.length;s++)if(C=
|
|
322
|
-
C>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!W)))if("number"!==typeof m[s].y)0<s&&!(k.connectNullData||W||y)&&(c.stroke(),r&&b.stroke()),W=!0;else{C=a.axisX.convertValueToPixel(C);v=a.axisY.convertValueToPixel(m[s].y);var t=k.dataPointIds[s];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:s,x1:C,y1:v};y||W?(!y&&k.connectNullData?(c.setLineDash&&(k.options.nullDataLineDashType||
|
|
323
|
-
c.beginPath(),c.moveTo(q.x,q.y),n=k.nullDataLineDashType,c.setLineDash(p)),c.lineTo(C,v),r&&b.lineTo(C,v)):(c.beginPath(),c.moveTo(C,v),r&&(b.beginPath(),b.moveTo(C,v))),W=y=!1):(c.lineTo(C,v),r&&b.lineTo(C,v),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(C,v),r&&(b.stroke(),b.beginPath(),b.moveTo(C,v))));q={x:C,y:v};s<m.length-1&&(x!==(m[s].lineColor||f)||n!==(m[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(C,
|
|
324
|
-
(n=m[s].lineDashType,c.setLineDash(I(n,k.lineThickness))):(n=k.lineDashType,c.setLineDash(g))));if(0!==m[s].markerSize&&(0<m[s].markerSize||0<k.markerSize)){var B=k.getMarkerProperties(s,C,v,c);h.push(B);t=U(t);r&&h.push({x:C,y:v,ctx:b,type:B.type,size:B.size,color:t,borderColor:t,borderThickness:B.borderThickness})}(m[s].indexLabel||k.indexLabel||m[s].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",
|
|
325
|
-
a.axisY.reversed?1:-1,color:f})}c.stroke();r&&b.stroke()}}aa.drawMarkers(h);r&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
326
|
-
c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:R.xClipAnimation,easingFunction:R.easing.linear,animationBase:0}}};t.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=r?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],q,u=0;u<a.dataSeriesIndexes.length;u++){var l=
|
|
327
|
-
c.lineWidth=k.lineThickness;var m=k.dataPoints,n="solid";if(c.setLineDash){var p=I(k.nullDataLineDashType,k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);c.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);b.strokeStyle=f;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];c.strokeStyle=f;var y=!0,s=0,C,v;c.beginPath();
|
|
328
|
-
|
|
329
|
-
(k.options.nullDataLineDashType||n===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(q.x,q.y),n=k.nullDataLineDashType,c.setLineDash(p)),c.lineTo(C,t),c.lineTo(C,v),r&&(b.lineTo(C,t),b.lineTo(C,v))):(c.beginPath(),c.moveTo(C,v),r&&(b.beginPath(),b.moveTo(C,v))),W=y=!1):(c.lineTo(C,t),r&&b.lineTo(C,t),c.lineTo(C,v),r&&b.lineTo(C,v),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(C,v),r&&(b.stroke(),b.beginPath(),b.moveTo(C,v))));q={x:C,y:v};
|
|
330
|
-
(m[s].lineColor||f)||n!==(m[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(C,v),x=m[s].lineColor||f,c.strokeStyle=x,c.setLineDash&&(m[s].lineDashType?(n=m[s].lineDashType,c.setLineDash(I(n,k.lineThickness))):(n=k.lineDashType,c.setLineDash(g))));0!==m[s].markerSize&&(0<m[s].markerSize||0<k.markerSize)&&(t=k.getMarkerProperties(s,C,v,c),h.push(t),B=U(B),r&&h.push({x:C,y:v,ctx:b,type:t.type,size:t.size,color:B,borderColor:B,borderThickness:t.borderThickness}));
|
|
331
|
-
k.indexLabel||m[s].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:m[s],dataSeries:k,point:{x:C,y:v},direction:0>m[s].y===a.axisY.reversed?1:-1,color:f})}c.stroke();r&&b.stroke()}}aa.drawMarkers(h);r&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,
|
|
332
|
-
this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:R.xClipAnimation,easingFunction:R.easing.linear,animationBase:0}}};t.prototype.renderSpline=function(a){function d(a){a=w(a,2);if(0<a.length){b.beginPath();r&&e.beginPath();b.moveTo(a[0].x,a[0].y);a[0].newStrokeStyle&&(b.strokeStyle=
|
|
333
|
-
a[0].newLineDashArray&&b.setLineDash(a[0].newLineDashArray);r&&e.moveTo(a[0].x,a[0].y);for(var c=0;c<a.length-3;c+=3)if(b.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),r&&e.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),0<c&&0===c%3E3||a[c+3].newStrokeStyle||a[c+3].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(a[c+3].x,a[c+3].y),a[c+3].newStrokeStyle&&(b.strokeStyle=a[c+3].newStrokeStyle),a[c+3].newLineDashArray&&b.setLineDash(a[c+
|
|
334
|
-
r&&(e.stroke(),e.beginPath(),e.moveTo(a[c+3].x,a[c+3].y));b.stroke();r&&e.stroke()}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=r?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx;b.save();var h=this.plotArea;b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();for(var q=[],u=0;u<a.dataSeriesIndexes.length;u++){var l=a.dataSeriesIndexes[u],k=this.data[l];b.lineWidth=k.lineThickness;var m=k.dataPoints,n="solid";if(b.setLineDash){var p=
|
|
335
|
-
k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);b.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);e.strokeStyle=f;e.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];b.strokeStyle=f;var y=0,s,C,v=[];b.beginPath();if(0<m.length)for(C=!1,y=0;y<m.length;y++)if(s=m[y].getTime?m[y].x.getTime():m[y].x,!(s<a.axisX.dataInfo.viewPortMin||
|
|
336
|
-
(!k.connectNullData||!C)))if("number"!==typeof m[y].y)0<y&&!C&&(k.connectNullData?b.setLineDash&&(0<v.length&&(k.options.nullDataLineDashType||!m[y-1].lineDashType))&&(v[v.length-1].newLineDashArray=p,n=k.nullDataLineDashType):(d(v),v=[])),C=!0;else{s=a.axisX.convertValueToPixel(s);C=a.axisY.convertValueToPixel(m[y].y);var W=k.dataPointIds[y];this._eventManager.objectMap[W]={id:W,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:y,x1:s,y1:C};v[v.length]={x:s,
|
|
337
|
-
f)||n!==(m[y].lineDashType||k.lineDashType))&&(x=m[y].lineColor||f,v[v.length-1].newStrokeStyle=x,b.setLineDash&&(m[y].lineDashType?(n=m[y].lineDashType,v[v.length-1].newLineDashArray=I(n,k.lineThickness)):(n=k.lineDashType,v[v.length-1].newLineDashArray=g)));if(0!==m[y].markerSize&&(0<m[y].markerSize||0<k.markerSize)){var t=k.getMarkerProperties(y,s,C,b);q.push(t);W=U(W);r&&q.push({x:s,y:C,ctx:e,type:t.type,size:t.size,color:W,borderColor:W,borderThickness:t.borderThickness})}(m[y].indexLabel||
|
|
338
|
-
m[y].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:m[y],dataSeries:k,point:{x:s,y:C},direction:0>m[y].y===a.axisY.reversed?1:-1,color:f});C=!1}d(v)}aa.drawMarkers(q);r&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&
|
|
272
|
+
1<c.length)){e=Qa(b);e.time=new Date;try{var q=e.y-this._lastTouchData.y,h=e.time-this._lastTouchData.time;if(1<Math.abs(q)&&this._lastTouchData.scroll||5<Math.abs(q)&&250>h)this._lastTouchData.scroll=!0,this.stockChart&&(this.stockChart._chartScroll=!0)}catch(u){}this._lastTouchEventType=a.type;if(this._lastTouchData.scroll&&this.zoomEnabled)this.isDrag&&this.resetOverlayedCanvas(),this.isDrag=!1;else for(c=0;c<d.length;c++)if(e=d[c],q=document.createEvent("MouseEvent"),q.initMouseEvent(e,!0,!0,
|
|
273
|
+
window,1,b.screenX,b.screenY,b.clientX,b.clientY,!1,!1,!1,!1,0,null),b.target.dispatchEvent(q),!l(this._lastTouchData.scroll)&&!this._lastTouchData.scroll||!this._lastTouchData.scroll&&250<h||"click"===e)a.preventManipulation&&a.preventManipulation(),a.preventDefault&&a.cancelable&&a.preventDefault(),this.stockChart&&(this.stockChart._chartScroll=null)}}};t.prototype._dispatchRangeEvent=function(a,d){var c={chart:this};c.type=a;c.trigger=d;var b=[];this.axisX&&0<this.axisX.length&&b.push("axisX");
|
|
274
|
+
this.axisX2&&0<this.axisX2.length&&b.push("axisX2");this.axisY&&0<this.axisY.length&&b.push("axisY");this.axisY2&&0<this.axisY2.length&&b.push("axisY2");for(var e=0;e<b.length;e++)if(l(c[b[e]])&&(c[b[e]]=[]),"axisY"===b[e])for(var h=0;h<this.axisY.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisY2"===b[e])for(h=0;h<this.axisY2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,
|
|
275
|
+
viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisX"===b[e])for(h=0;h<this.axisX.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});else if("axisX2"===b[e])for(h=0;h<this.axisX2.length;h++)c[b[e]].push({viewportMinimum:this[b[e]][h].sessionVariables.newViewportMinimum,viewportMaximum:this[b[e]][h].sessionVariables.newViewportMaximum});this.dispatchEvent(a,c,this)};
|
|
276
|
+
t.prototype._mouseEventHandler=function(a){function d(){t.capturedEventParam&&(e=t.capturedEventParam,q=e.bounds,"mouseup"===b&&(t.capturedEventParam=null,e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",e.chart._mouseEventHandler,!1)),e.hasOwnProperty(b)&&("mouseup"!==b||e.chart.overlaidCanvas.releaseCapture?a.target!==e.chart.overlaidCanvas&&r||e[b].call(e.context,c.x,c.y):a.target!==e.chart.overlaidCanvas&&(e.chart.isDrag=
|
|
277
|
+
!1)))}"undefined"===typeof a.target&&a.srcElement&&(a.target=a.srcElement);var c=Qa(a),b=a.type,e,h;a.which?h=3==a.which:a.button&&(h=2==a.button);if(this._ignoreNextEvent)d(),this._ignoreNextEvent=!1;else if(d(),this.interactivityEnabled){a.preventManipulation&&a.preventManipulation();a.preventDefault&&a.preventDefault();var q;Ia&&window.console&&(window.console.log(b+" --\x3e x: "+c.x+"; y:"+c.y),h&&window.console.log(a.which),"mouseup"===b&&window.console.log("mouseup"));if(!h){if(!t.capturedEventParam&&
|
|
278
|
+
this._events){for(h=0;h<this._events.length;h++)if(this._events[h].hasOwnProperty(b))if(e=this._events[h],q=e.bounds,c.x>=q.x1&&c.x<=q.x2&&c.y>=q.y1&&c.y<=q.y2){e[b].call(e.context,c.x,c.y);"mousedown"===b&&!0===e.capture?(t.capturedEventParam=e,this.overlaidCanvas.setCapture?this.overlaidCanvas.setCapture():document.documentElement.addEventListener("mouseup",this._mouseEventHandler,!1)):"mouseup"===b&&(e.chart.overlaidCanvas.releaseCapture?e.chart.overlaidCanvas.releaseCapture():document.documentElement.removeEventListener("mouseup",
|
|
279
|
+
this._mouseEventHandler,!1));break}else e=null;a.target.style.cursor=e&&e.cursor?e.cursor:this._defaultCursor}h=this.plotArea;if(c.x<h.x1||c.x>h.x2||c.y<h.y1||c.y>h.y2){this.toolTip&&this.toolTip.enabled?(this.toolTip.hide(),this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip)):this.resetOverlayedCanvas();for(h=0;h<this.axisX.length;h++)this.axisX[h].crosshair&&this.axisX[h].crosshair.enabled&&(this.axisX[h].crosshair.hide(),this.axisX[h].crosshair.dispatchEvent("hidden",
|
|
280
|
+
{chart:this,axis:this.axisX[h].options},this.axisX[h].crosshair));for(h=0;h<this.axisX2.length;h++)this.axisX2[h].crosshair&&this.axisX2[h].crosshair.enabled&&(this.axisX2[h].crosshair.hide(),this.axisX2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[h].options},this.axisX2[h].crosshair));for(h=0;h<this.axisY.length;h++)this.axisY[h].crosshair&&this.axisY[h].crosshair.enabled&&(this.axisY[h].crosshair.hide(),this.axisY[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[h].options},
|
|
281
|
+
this.axisY[h].crosshair));for(h=0;h<this.axisY2.length;h++)this.axisY2[h].crosshair&&this.axisY2[h].crosshair.enabled&&(this.axisY2[h].crosshair.hide(),this.axisY2[h].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[h].options},this.axisY2[h].crosshair))}this.sessionVariables.mouseX=c.x;this.sessionVariables.mouseY=c.y;this.isDrag&&this.zoomEnabled||!this._eventManager||this._eventManager.mouseEventHandler(a)}}};t.prototype._plotAreaMouseDown=function(a,d){this.isDrag=!0;this.dragStartPoint=
|
|
282
|
+
{x:a,y:d}};t.prototype._plotAreaMouseUp=function(a,d){if(("normal"===this.plotInfo.axisPlacement||"xySwapped"===this.plotInfo.axisPlacement)&&this.isDrag){var c=d-this.dragStartPoint.y,b=a-this.dragStartPoint.x,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),q=!1;this.resetOverlayedCanvas();if("xySwapped"===this.plotInfo.axisPlacement)var u=h,h=e,e=u;if(this.panEnabled||this.zoomEnabled){if(this.panEnabled)for(e=h=0;e<this._axes.length;e++)c=this._axes[e],c.logarithmic?c.viewportMinimum<
|
|
283
|
+
c.minimum?(h=c.minimum/c.viewportMinimum,c.sessionVariables.newViewportMinimum=c.viewportMinimum*h,c.sessionVariables.newViewportMaximum=c.viewportMaximum*h,q=!0):c.viewportMaximum>c.maximum&&(h=c.viewportMaximum/c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum/h,c.sessionVariables.newViewportMaximum=c.viewportMaximum/h,q=!0):c.viewportMinimum<c.minimum?(h=c.minimum-c.viewportMinimum,c.sessionVariables.newViewportMinimum=c.viewportMinimum+h,c.sessionVariables.newViewportMaximum=c.viewportMaximum+
|
|
284
|
+
h,q=!0):c.viewportMaximum>c.maximum&&(h=c.viewportMaximum-c.maximum,c.sessionVariables.newViewportMinimum=c.viewportMinimum-h,c.sessionVariables.newViewportMaximum=c.viewportMaximum-h,q=!0);else if((!e||2<Math.abs(b))&&(!h||2<Math.abs(c))&&this.zoomEnabled){if(!this.dragStartPoint)return;c=e?this.dragStartPoint.x:this.plotArea.x1;b=h?this.dragStartPoint.y:this.plotArea.y1;e=e?a:this.plotArea.x2;h=h?d:this.plotArea.y2;2<Math.abs(c-e)&&2<Math.abs(b-h)&&this._zoomPanToSelectedRegion(c,b,e,h)&&(q=!0)}q&&
|
|
285
|
+
(this._ignoreNextEvent=!0,this._dispatchRangeEvent("rangeChanging","zoom"),this.stockChart&&(this.stockChart._rangeEventParameter||(this.stockChart._rangeEventParameter={stockChart:this.stockChart,source:"chart",index:this.stockChart.charts.indexOf(this),minimum:this.stockChart.sessionVariables._axisXMin,maximum:this.stockChart.sessionVariables._axisXMax}),this.stockChart._rangeEventParameter.type="rangeChanging",this.stockChart.dispatchEvent("rangeChanging",this.stockChart._rangeEventParameter,this.stockChart)),
|
|
286
|
+
this.render(),this._dispatchRangeEvent("rangeChanged","zoom"),this.stockChart&&(this.stockChart.rangeUpdatedBy="chart",this.stockChart._rangeEventParameter.type="rangeChanged",this.stockChart.dispatchEvent("rangeChanged",this.stockChart._rangeEventParameter,this.stockChart)),q&&(this.zoomEnabled&&"none"===this._zoomButton.style.display)&&(Ma(this._zoomButton,this._resetButton),sa(this,this._zoomButton,"pan"),sa(this,this._resetButton,"reset")))}}this.isDrag=!1;if("none"!==this.plotInfo.axisPlacement){this.resetOverlayedCanvas();
|
|
287
|
+
if(this.axisX&&0<this.axisX.length)for(q=0;q<this.axisX.length;q++)this.axisX[q].crosshair&&this.axisX[q].crosshair.enabled&&this.axisX[q].renderCrosshair(a,d);if(this.axisX2&&0<this.axisX2.length)for(q=0;q<this.axisX2.length;q++)this.axisX2[q].crosshair&&this.axisX2[q].crosshair.enabled&&this.axisX2[q].renderCrosshair(a,d);if(this.axisY&&0<this.axisY.length)for(q=0;q<this.axisY.length;q++)this.axisY[q].crosshair&&this.axisY[q].crosshair.enabled&&this.axisY[q].renderCrosshair(a,d);if(this.axisY2&&
|
|
288
|
+
0<this.axisY2.length)for(q=0;q<this.axisY2.length;q++)this.axisY2[q].crosshair&&this.axisY2[q].crosshair.enabled&&this.axisY2[q].renderCrosshair(a,d);if(this.axisX&&0<this.axisX.length)for(q=0;q<this.axisX.length;q++)this.axisX[q].crosshair&&this.axisX[q].crosshair.enabled&&this.axisX[q].crosshair.renderLabel();if(this.axisX2&&0<this.axisX2.length)for(q=0;q<this.axisX2.length;q++)this.axisX2[q].crosshair&&this.axisX2[q].crosshair.enabled&&this.axisX2[q].crosshair.renderLabel();if(this.axisY&&0<this.axisY.length)for(q=
|
|
289
|
+
0;q<this.axisY.length;q++)this.axisY[q].crosshair&&this.axisY[q].crosshair.enabled&&this.axisY[q].crosshair.renderLabel();if(this.axisY2&&0<this.axisY2.length)for(q=0;q<this.axisY2.length;q++)this.axisY2[q].crosshair&&this.axisY2[q].crosshair.enabled&&this.axisY2[q].crosshair.renderLabel()}};t.prototype._plotAreaMouseMove=function(a,d){if(this.isDrag&&"none"!==this.plotInfo.axisPlacement){var c=0,b=0,e=c=null,e=0<=this.zoomType.indexOf("x"),h=0<=this.zoomType.indexOf("y"),q=this;"xySwapped"===this.plotInfo.axisPlacement&&
|
|
290
|
+
(c=h,h=e,e=c);c=this.dragStartPoint.x-a;b=this.dragStartPoint.y-d;if(2<Math.abs(c)&&8>Math.abs(c)&&(this.panEnabled||this.zoomEnabled)){this.toolTip.hide();this.toolTip&&this.toolTip.enabled&&this.toolTip.dispatchEvent("hidden",{chart:this,toolTip:this.toolTip},this.toolTip);for(var u=0;u<this.axisX.length;u++)this.axisX[u].crosshair&&this.axisX[u].crosshair.enabled&&(this.axisX[u].crosshair.hide(),this.axisX[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX[u].options},this.axisX[u].crosshair));
|
|
291
|
+
for(u=0;u<this.axisX2.length;u++)this.axisX2[u].crosshair&&this.axisX2[u].crosshair.enabled&&(this.axisX2[u].crosshair.hide(),this.axisX2[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisX2[u].options},this.axisX2[u].crosshair));for(u=0;u<this.axisY.length;u++)this.axisY[u].crosshair&&this.axisY[u].crosshair.enabled&&(this.axisY[u].crosshair.hide(),this.axisY[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY[u].options},this.axisY[u].crosshair));for(u=0;u<this.axisY2.length;u++)this.axisY2[u].crosshair&&
|
|
292
|
+
this.axisY2[u].crosshair.enabled&&(this.axisY2[u].crosshair.hide(),this.axisY2[u].crosshair.dispatchEvent("hidden",{chart:this,axis:this.axisY2[u].options},this.axisY2[u].crosshair))}else this.panEnabled||this.zoomEnabled||this.toolTip.mouseMoveHandler(a,d);if((!e||2<Math.abs(c)||!h||2<Math.abs(b))&&(this.panEnabled||this.zoomEnabled))if(this.panEnabled)e={x1:e?this.plotArea.x1+c:this.plotArea.x1,y1:h?this.plotArea.y1+b:this.plotArea.y1,x2:e?this.plotArea.x2+c:this.plotArea.x2,y2:h?this.plotArea.y2+
|
|
293
|
+
b:this.plotArea.y2},clearTimeout(q._panTimerId),q._panTimerId=setTimeout(function(b,c,e,g){return function(){q._zoomPanToSelectedRegion(b,c,e,g,!0)&&(q._dispatchRangeEvent("rangeChanging","pan"),q.stockChart&&(q.stockChart._rangeEventParameter.type="rangeChanging",q.stockChart.dispatchEvent("rangeChanging",q.stockChart._rangeEventParameter,q.stockChart)),q.render(),q._dispatchRangeEvent("rangeChanged","pan"),q.stockChart&&(q.stockChart._rangeEventParameter.type="rangeChanged",q.stockChart.dispatchEvent("rangeChanged",
|
|
294
|
+
q.stockChart._rangeEventParameter,q.stockChart)),q.dragStartPoint.x=a,q.dragStartPoint.y=d)}}(e.x1,e.y1,e.x2,e.y2),0);else if(this.zoomEnabled){this.resetOverlayedCanvas();c=this.overlaidCanvasCtx.globalAlpha;this.overlaidCanvasCtx.fillStyle="#A89896";var b=e?this.dragStartPoint.x:this.plotArea.x1,u=h?this.dragStartPoint.y:this.plotArea.y1,l=e?a-this.dragStartPoint.x:this.plotArea.x2-this.plotArea.x1,k=h?d-this.dragStartPoint.y:this.plotArea.y2-this.plotArea.y1;this.validateRegion(b,u,e?a:this.plotArea.x2-
|
|
295
|
+
this.plotArea.x1,h?d:this.plotArea.y2-this.plotArea.y1,"xy"!==this.zoomType).isValid&&(this.resetOverlayedCanvas(),this.overlaidCanvasCtx.fillStyle="#99B2B5");this.overlaidCanvasCtx.globalAlpha=0.7;this.overlaidCanvasCtx.fillRect(b,u,l,k);this.overlaidCanvasCtx.globalAlpha=c}}else if(this.toolTip.mouseMoveHandler(a,d),"none"!==this.plotInfo.axisPlacement){this.sessionVariables.crosshairShownByPixel=!0;if(this.axisX&&0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&this.axisX[e].crosshair.enabled&&
|
|
296
|
+
this.axisX[e].renderCrosshair(a,d);if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].renderCrosshair(a,d);if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].renderCrosshair(a,d);if(this.axisY2&&0<this.axisY2.length)for(e=0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&this.axisY2[e].renderCrosshair(a,
|
|
297
|
+
d);if(this.axisX&&0<this.axisX.length)for(e=0;e<this.axisX.length;e++)this.axisX[e].crosshair&&this.axisX[e].crosshair.enabled&&this.axisX[e].crosshair.renderLabel();if(this.axisX2&&0<this.axisX2.length)for(e=0;e<this.axisX2.length;e++)this.axisX2[e].crosshair&&this.axisX2[e].crosshair.enabled&&this.axisX2[e].crosshair.renderLabel();if(this.axisY&&0<this.axisY.length)for(e=0;e<this.axisY.length;e++)this.axisY[e].crosshair&&this.axisY[e].crosshair.enabled&&this.axisY[e].crosshair.renderLabel();if(this.axisY2&&
|
|
298
|
+
0<this.axisY2.length)for(e=0;e<this.axisY2.length;e++)this.axisY2[e].crosshair&&this.axisY2[e].crosshair.enabled&&this.axisY2[e].crosshair.renderLabel()}};t.prototype._zoomPanToSelectedRegion=function(a,d,c,b,e){a=this.validateRegion(a,d,c,b,e);d=a.axesWithValidRange;c=a.axesRanges;if(a.isValid)for(b=0;b<d.length;b++)e=c[b],d[b].setViewPortRange(e.val1,e.val2),this.syncCharts&&"y"!=this.zoomType&&this.syncCharts(e.val1,e.val2),this.stockChart&&(this.stockChart._rangeEventParameter={stockChart:this.stockChart,
|
|
299
|
+
source:"chart",index:this.stockChart.charts.indexOf(this),minimum:e.val1,maximum:e.val2});return a.isValid};t.prototype.validateRegion=function(a,d,c,b,e){e=e||!1;for(var h=0<=this.zoomType.indexOf("x"),q=0<=this.zoomType.indexOf("y"),u=!1,l=[],k=[],m=[],n=0;n<this._axes.length;n++)("axisX"===this._axes[n].type&&h||"axisY"===this._axes[n].type&&q)&&k.push(this._axes[n]);for(q=0;q<k.length;q++){var n=k[q],h=!1,p=n.convertPixelToValue({x:a,y:d}),g=n.convertPixelToValue({x:c,y:b});if(p>g)var f=g,g=p,
|
|
300
|
+
p=f;if(n.scaleBreaks)for(f=0;!h&&f<n.scaleBreaks._appliedBreaks.length;f++)h=n.scaleBreaks._appliedBreaks[f].startValue<=p&&n.scaleBreaks._appliedBreaks[f].endValue>=g;if(isFinite(n.dataInfo.minDiff))if(f=n.getApparentDifference(p,g,null,!0),!(h||!(this.panEnabled&&n.scaleBreaks&&n.scaleBreaks._appliedBreaks.length)&&(n.logarithmic&&f<Math.pow(n.dataInfo.minDiff,3)||!n.logarithmic&&f<3*Math.abs(n.dataInfo.minDiff))||p<n.minimum||g>n.maximum))l.push(n),m.push({val1:p,val2:g}),u=!0;else if(!e){u=!1;
|
|
301
|
+
break}}return{isValid:u,axesWithValidRange:l,axesRanges:m}};t.prototype.preparePlotArea=function(){var a=this.plotArea;!r&&(0<a.x1||0<a.y1)&&a.ctx.translate(a.x1,a.y1);if((this.axisX[0]||this.axisX2[0])&&(this.axisY[0]||this.axisY2[0])){var d=this.axisX[0]?this.axisX[0].lineCoordinates:this.axisX2[0].lineCoordinates;if(this.axisY&&0<this.axisY.length&&this.axisY[0]){var c=this.axisY[0];a.x1=d.x1<d.x2?d.x1:c.lineCoordinates.x1;a.y1=d.y1<c.lineCoordinates.y1?d.y1:c.lineCoordinates.y1;a.x2=d.x2>c.lineCoordinates.x2?
|
|
302
|
+
d.x2:c.lineCoordinates.x2;a.y2=d.y1>c.lineCoordinates.y2?d.y1:c.lineCoordinates.y2;a.width=a.x2-a.x1;a.height=a.y2-a.y1}this.axisY2&&0<this.axisY2.length&&this.axisY2[0]&&(c=this.axisY2[0],a.x1=d.x1<d.x2?d.x1:c.lineCoordinates.x1,a.y1=d.y1<c.lineCoordinates.y1?d.y1:c.lineCoordinates.y1,a.x2=d.x2>c.lineCoordinates.x2?d.x2:c.lineCoordinates.x2,a.y2=d.y2>c.lineCoordinates.y2?d.y2:c.lineCoordinates.y2,a.width=a.x2-a.x1,a.height=a.y2-a.y1)}else d=this.layoutManager.getFreeSpace(),a.x1=d.x1,a.x2=d.x2,a.y1=
|
|
303
|
+
d.y1,a.y2=d.y2,a.width=d.width,a.height=d.height;r||(a.canvas.width=a.width,a.canvas.height=a.height,a.canvas.style.left=a.x1+"px",a.canvas.style.top=a.y1+"px",(0<a.x1||0<a.y1)&&a.ctx.translate(-a.x1,-a.y1));a.layoutManager=new Fa(a.x1,a.y1,a.x2,a.y2,2)};t.prototype.renderIndexLabels=function(a){var d=a||this.plotArea.ctx,c=this.plotArea,b=0,e=0,h=0,q=e=h=0,u=0,f=b=0,k=0;for(a=0;a<this._indexLabels.length;a++){var m=this._indexLabels[a],n=m.chartType.toLowerCase(),p,g,u=ma("indexLabelFontColor",m.dataPoint,
|
|
304
|
+
m.dataSeries),D=ma("indexLabelFontSize",m.dataPoint,m.dataSeries),f=ma("indexLabelFontFamily",m.dataPoint,m.dataSeries),k=ma("indexLabelFontStyle",m.dataPoint,m.dataSeries);p=ma("indexLabelFontWeight",m.dataPoint,m.dataSeries);var x=ma("indexLabelBackgroundColor",m.dataPoint,m.dataSeries);g=ma("indexLabelBorderColor",m.dataPoint,m.dataSeries);var h=ma("indexLabelBorderThickness",m.dataPoint,m.dataSeries),e=ma("indexLabelMaxWidth",m.dataPoint,m.dataSeries),q=ma("indexLabelWrap",m.dataPoint,m.dataSeries),
|
|
305
|
+
y=ma("indexLabelLineDashType",m.dataPoint,m.dataSeries),s=ma("indexLabelLineColor",m.dataPoint,m.dataSeries),C=l(m.dataPoint.indexLabelLineThickness)?l(m.dataSeries.options.indexLabelLineThickness)?0:m.dataSeries.options.indexLabelLineThickness:m.dataPoint.indexLabelLineThickness,b=0<C?Math.min(10,("normal"===this.plotInfo.axisPlacement?this.plotArea.height:this.plotArea.width)<<0):0,v={percent:null,total:null},W=null;if(0<=m.dataSeries.type.indexOf("stacked")||"pie"===m.dataSeries.type||"doughnut"===
|
|
306
|
+
m.dataSeries.type)v=this.getPercentAndTotal(m.dataSeries,m.dataPoint);if(m.dataSeries.indexLabelFormatter||m.dataPoint.indexLabelFormatter)W={chart:this,dataSeries:m.dataSeries,dataPoint:m.dataPoint,index:m.indexKeyword,total:v.total,percent:v.percent};var t=m.dataPoint.indexLabelFormatter?m.dataPoint.indexLabelFormatter(W):m.dataPoint.indexLabel?this.replaceKeywordsWithValue(m.dataPoint.indexLabel,m.dataPoint,m.dataSeries,null,m.indexKeyword):m.dataSeries.indexLabelFormatter?m.dataSeries.indexLabelFormatter(W):
|
|
307
|
+
m.dataSeries.indexLabel?this.replaceKeywordsWithValue(m.dataSeries.indexLabel,m.dataPoint,m.dataSeries,null,m.indexKeyword):null;if(null!==t&&""!==t){var v=ma("indexLabelPlacement",m.dataPoint,m.dataSeries),W=ma("indexLabelOrientation",m.dataPoint,m.dataSeries),B=ma("indexLabelTextAlign",m.dataPoint,m.dataSeries),w=m.direction,z=m.dataSeries.axisX,K=m.dataSeries.axisY,L=!1,x=new ka(d,{x:0,y:0,maxWidth:e?e:0.5*this.width,maxHeight:q?5*D:1.5*D,angle:"horizontal"===W?0:-90,text:t,padding:0,backgroundColor:x,
|
|
308
|
+
borderColor:g,borderThickness:h,textAlign:B,fontSize:D,fontFamily:f,fontWeight:p,fontColor:u,fontStyle:k,textBaseline:"middle"});x.measureText();m.dataSeries.indexLabelMaxWidth=x.maxWidth;if("stackedarea100"===n){if(m.point.x<c.x1||m.point.x>c.x2||m.point.y<c.y1-1||m.point.y>c.y2+1)continue}else if("rangearea"===n||"rangesplinearea"===n){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||Math.max.apply(null,m.dataPoint.y)<K.viewportMinimum||Math.min.apply(null,m.dataPoint.y)>K.viewportMaximum)continue}else if(0<=
|
|
309
|
+
n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("bubble")||0<=n.indexOf("scatter")){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||m.dataPoint.y<K.viewportMinimum||m.dataPoint.y>K.viewportMaximum)continue}else if(0<=n.indexOf("column")){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||(0<m.dataPoint.y.length?Math.max.apply(null,m.dataPoint.y):m.dataPoint.y)<K.viewportMinimum||(0<m.dataPoint.y.length?Math.max.apply(null,m.dataPoint.y):m.dataPoint.y)>
|
|
310
|
+
K.viewportMaximum)continue}else if("waterfall"===n||"error"===n&&!m.axisSwapped){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||m.bounds.y1>c.y2||m.bounds.y2<c.y1)continue}else if(0<=n.indexOf("bar")||"error"===n){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||m.bounds.x1>c.x2||m.bounds.x2<c.x1)continue}else if("candlestick"===n||"ohlc"===n){if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum||Math.max.apply(null,m.dataPoint.y)<K.viewportMinimum||
|
|
311
|
+
Math.min.apply(null,m.dataPoint.y)>K.viewportMaximum)continue}else if(m.dataPoint.x<z.viewportMinimum||m.dataPoint.x>z.viewportMaximum)continue;q=u=2;"horizontal"===W?(f=x.width,k=x.height):(k=x.width,f=x.height);if("normal"===this.plotInfo.axisPlacement){if(0<=n.indexOf("line")||0<=n.indexOf("area"))v="auto",u=4;else if(0<=n.indexOf("stacked"))"auto"===v&&(v="inside");else if("bubble"===n||"scatter"===n)v="inside";p=m.point.x-f/2+("horizontal"===W?0:x._lineHeight/2);if("inside"!==v)e=c.y1,h=c.y2,
|
|
312
|
+
0<w?(g=m.point.y+x._lineHeight/2-k-u-b,g<e&&(g="auto"===v?Math.max(m.point.y,e)+x._lineHeight/2+u+b:e+x._lineHeight/2+u+b,L=g+("horizontal"===W?k-x._lineHeight/2:0)>m.point.y,!L||(0<=n.indexOf("line")||0<=n.indexOf("area"))||(g-=b))):(g=m.point.y+x._lineHeight/2+u+b,g>h-k+x._lineHeight/2-u&&(g="auto"===v?Math.min(m.point.y,h)+x._lineHeight/2-k-u-b:h+x._lineHeight/2-k-u-b,L=g-("horizontal"===W?x._lineHeight/2:k)<m.point.y,!L||(0<=n.indexOf("line")||0<=n.indexOf("area"))||(g+=b)));else{Math.max(m.bounds.y1,
|
|
313
|
+
c.y1);h=Math.min(m.bounds.y2,c.y2)-k+x._lineHeight/2;b=0<=n.indexOf("range")||"error"===n?0<w?Math.max(m.bounds.y1,c.y1)+x._lineHeight/2+u:Math.min(m.bounds.y2,c.y2)+x._lineHeight/2-k-u:(Math.max(m.bounds.y1,c.y1)+Math.min(m.bounds.y2,c.y2))/2-k/2+x._lineHeight/2;if(0<w){if(g=b,"bubble"===n||"scatter"===n)g=m.point.y-k/2+x._lineHeight/2,k>m.bounds.y2-m.bounds.y1&&(g-=k/2+u),0>g-x._lineHeight/2&&(g+=Math.abs(g-x._lineHeight/2)<=(m.bounds.y2-m.bounds.y1)/2+u?Math.abs(g-x._lineHeight/2):(m.bounds.y2-
|
|
314
|
+
m.bounds.y1)/2+u)}else g=Math.min(m.point.y,b),g>h-k-u&&("bubble"===n||"scatter"===n)&&(g=Math.min(m.point.y+u,c.y2-k-u));g=Math.min(g,h)}}else 0<=n.indexOf("line")||0<=n.indexOf("area")||0<=n.indexOf("scatter")?(v="auto",q=4):0<=n.indexOf("stacked")?"auto"===v&&(v="inside"):"bubble"===n&&(v="inside"),g=m.point.y+x._lineHeight/2-k/2,"inside"!==v?(h=c.x1,e=c.x2,0>w?(p=m.point.x-f+("horizontal"===W?0:x._lineHeight/2)-q-b,("horizontal"===W?p:p-x._lineHeight/2)<h&&(p="auto"===v?Math.max(m.point.x,h)+
|
|
315
|
+
("horizontal"===W?0:x._lineHeight/2)+u+b:h+("horizontal"===W?0:x._lineHeight/2)+q,(L=p+f-("horizontal"===W?0:x._lineHeight/2)>m.point.x)&&(p-=b))):(p=m.point.x+("horizontal"===W?0:x._lineHeight/2)+q+b,("horizontal"===W?p:p-x._lineHeight/2)>e-f-q-b&&(p="auto"===v?Math.min(m.point.x,e)-("horizontal"===W?f:f-x._lineHeight/2)-q-b:e-f-q+("horizontal"===W?0:x._lineHeight/2),(L=p-("horizontal"===W?0:x._lineHeight/2)<m.point.x)&&(p+=b)))):(h=Math.max(m.bounds.x1,c.x1),Math.min(m.bounds.x2,c.x2),b=0<=n.indexOf("range")||
|
|
316
|
+
"error"===n?0>w?Math.max(m.bounds.x1,c.x1):Math.min(m.bounds.x2,c.x2)-f-q+("horizontal"===W?0:x._lineHeight/2):(Math.max(m.bounds.x1,c.x1)+Math.min(m.bounds.x2,c.x2))/2-f/2+("horizontal"===W?0:x._lineHeight/2),p=0>w?b:Math.min(m.point.x,b),p=Math.max(p,h+("horizontal"===W?0:x._lineHeight/2+u)));"vertical"===W&&(g+=k-x._lineHeight/2,0<="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(n)&&(L=0<w?g+("horizontal"===W?k-x._lineHeight/2:0)>m.point.y:
|
|
317
|
+
g-("horizontal"===W?x._lineHeight/2:k)<m.point.y),"bubble"===n||"scatter"===n)&&(p+=x._lineHeight/2-D/2);x.x=p;x.y=g;x.render(!0);C&&("inside"!==v&&(0>n.indexOf("bar")&&("error"!==n||!m.axisSwapped)&&m.point.x>c.x1&&m.point.x<c.x2||!L)&&(-1==="ohlc candlestick boxandwhisker column rangecolumn stackedcolumn stackedcolumn100 error".split(" ").indexOf(n)&&("error"!==n||m.axisSwapped)&&m.point.y>c.y1&&m.point.y<c.y2||!L))&&(d.lineWidth=C,d.strokeStyle=s?s:"gray",d.setLineDash&&d.setLineDash(I(y,C)),d.beginPath(),
|
|
318
|
+
d.moveTo(m.point.x,m.point.y),0<=n.indexOf("bar")||"error"===n&&m.axisSwapped?d.lineTo(p+(0<m.direction?0:f)+("vertical"===W?-x._lineHeight/2:0),g+("vertical"===W?-k/2:k/2-x._lineHeight/2)):0<=n.indexOf("column")||"error"===n&&!m.axisSwapped?d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),g+("vertical"===W?g-k<m.point.y?0:-k:(g-x._lineHeight/2<m.point.y?k:0)-x._lineHeight/2)):0<=n.indexOf("waterfall")?d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),"vertical"===W?0<w&&g<m.point.y?g:0>w&&g-
|
|
319
|
+
k>m.point.y?g-k:m.point.y:0<w&&g+k-x._lineHeight/2<m.point.y?g+k-x._lineHeight/2:0>w&&g-x._lineHeight/2>m.point.y?g-x._lineHeight/2:m.point.y):d.lineTo(p+f/2-("horizontal"===W?0:x._lineHeight/2),g+("vertical"===W?g-k<m.point.y?0:-k:(g+k-x._lineHeight/2<m.point.y?k:0)-x._lineHeight/2)),d.stroke())}}d={source:d,dest:this.plotArea.ctx,animationCallback:R.fadeInAnimation,easingFunction:R.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._indexLabels.length;a++)m=this._indexLabels[a],
|
|
320
|
+
x=ma("indexLabelBackgroundColor",m.dataPoint,m.dataSeries),m.dataSeries.indexLabelBackgroundColor=l(x)?r?"transparent":null:x;return d};t.prototype.renderLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=r?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],q,u=0;u<a.dataSeriesIndexes.length;u++){var l=a.dataSeriesIndexes[u],k=this.data[l];c.lineWidth=
|
|
321
|
+
k.lineThickness;var m=k.dataPoints,n="solid";if(c.setLineDash){var p=I(k.nullDataLineDashType,k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);c.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);b.strokeStyle=f;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];c.strokeStyle=f;var y=!0,s=0,C,v;c.beginPath();if(0<m.length){for(var W=!1,s=0;s<m.length;s++)if(C=
|
|
322
|
+
m[s].x.getTime?m[s].x.getTime():m[s].x,!(C<a.axisX.dataInfo.viewPortMin||C>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!W)))if("number"!==typeof m[s].y)0<s&&!(k.connectNullData||W||y)&&(c.stroke(),r&&b.stroke()),W=!0;else{C=a.axisX.convertValueToPixel(C);v=a.axisY.convertValueToPixel(m[s].y);var t=k.dataPointIds[s];this._eventManager.objectMap[t]={id:t,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:s,x1:C,y1:v};y||W?(!y&&k.connectNullData?(c.setLineDash&&(k.options.nullDataLineDashType||
|
|
323
|
+
n===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(q.x,q.y),n=k.nullDataLineDashType,c.setLineDash(p)),c.lineTo(C,v),r&&b.lineTo(C,v)):(c.beginPath(),c.moveTo(C,v),r&&(b.beginPath(),b.moveTo(C,v))),W=y=!1):(c.lineTo(C,v),r&&b.lineTo(C,v),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(C,v),r&&(b.stroke(),b.beginPath(),b.moveTo(C,v))));q={x:C,y:v};s<m.length-1&&(x!==(m[s].lineColor||f)||n!==(m[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(C,
|
|
324
|
+
v),x=m[s].lineColor||f,c.strokeStyle=x,c.setLineDash&&(m[s].lineDashType?(n=m[s].lineDashType,c.setLineDash(I(n,k.lineThickness))):(n=k.lineDashType,c.setLineDash(g))));if(0!==m[s].markerSize&&(0<m[s].markerSize||0<k.markerSize)){var B=k.getMarkerProperties(s,C,v,c);h.push(B);t=U(t);r&&h.push({x:C,y:v,ctx:b,type:B.type,size:B.size,color:t,borderColor:t,borderThickness:B.borderThickness})}(m[s].indexLabel||k.indexLabel||m[s].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",
|
|
325
|
+
dataPoint:m[s],dataSeries:k,point:{x:C,y:v},direction:0>m[s].y===a.axisY.reversed?1:-1,color:f})}c.stroke();r&&b.stroke()}}aa.drawMarkers(h);r&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
326
|
+
c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:R.xClipAnimation,easingFunction:R.easing.linear,animationBase:0}}};t.prototype.renderStepLine=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=r?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var e=this.plotArea;c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();for(var h=[],q,u=0;u<a.dataSeriesIndexes.length;u++){var l=
|
|
327
|
+
a.dataSeriesIndexes[u],k=this.data[l];c.lineWidth=k.lineThickness;var m=k.dataPoints,n="solid";if(c.setLineDash){var p=I(k.nullDataLineDashType,k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);c.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);b.strokeStyle=f;b.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];c.strokeStyle=f;var y=!0,s=0,C,v;c.beginPath();
|
|
328
|
+
if(0<m.length){for(var W=!1,s=0;s<m.length;s++)if(C=m[s].getTime?m[s].x.getTime():m[s].x,!(C<a.axisX.dataInfo.viewPortMin||C>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!W)))if("number"!==typeof m[s].y)0<s&&!(k.connectNullData||W||y)&&(c.stroke(),r&&b.stroke()),W=!0;else{var t=v;C=a.axisX.convertValueToPixel(C);v=a.axisY.convertValueToPixel(m[s].y);var B=k.dataPointIds[s];this._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:s,x1:C,y1:v};y||W?(!y&&k.connectNullData?
|
|
329
|
+
(c.setLineDash&&(k.options.nullDataLineDashType||n===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(q.x,q.y),n=k.nullDataLineDashType,c.setLineDash(p)),c.lineTo(C,t),c.lineTo(C,v),r&&(b.lineTo(C,t),b.lineTo(C,v))):(c.beginPath(),c.moveTo(C,v),r&&(b.beginPath(),b.moveTo(C,v))),W=y=!1):(c.lineTo(C,t),r&&b.lineTo(C,t),c.lineTo(C,v),r&&b.lineTo(C,v),0==s%500&&(c.stroke(),c.beginPath(),c.moveTo(C,v),r&&(b.stroke(),b.beginPath(),b.moveTo(C,v))));q={x:C,y:v};
|
|
330
|
+
s<m.length-1&&(x!==(m[s].lineColor||f)||n!==(m[s].lineDashType||k.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(C,v),x=m[s].lineColor||f,c.strokeStyle=x,c.setLineDash&&(m[s].lineDashType?(n=m[s].lineDashType,c.setLineDash(I(n,k.lineThickness))):(n=k.lineDashType,c.setLineDash(g))));0!==m[s].markerSize&&(0<m[s].markerSize||0<k.markerSize)&&(t=k.getMarkerProperties(s,C,v,c),h.push(t),B=U(B),r&&h.push({x:C,y:v,ctx:b,type:t.type,size:t.size,color:B,borderColor:B,borderThickness:t.borderThickness}));
|
|
331
|
+
(m[s].indexLabel||k.indexLabel||m[s].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:m[s],dataSeries:k,point:{x:C,y:v},direction:0>m[s].y===a.axisY.reversed?1:-1,color:f})}c.stroke();r&&b.stroke()}}aa.drawMarkers(h);r&&(d.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&c.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&c.drawImage(a.axisY.maskCanvas,
|
|
332
|
+
0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(e.x1,e.y1,e.width,e.height),b.beginPath());c.restore();c.beginPath();return{source:d,dest:this.plotArea.ctx,animationCallback:R.xClipAnimation,easingFunction:R.easing.linear,animationBase:0}}};t.prototype.renderSpline=function(a){function d(a){a=w(a,2);if(0<a.length){b.beginPath();r&&e.beginPath();b.moveTo(a[0].x,a[0].y);a[0].newStrokeStyle&&(b.strokeStyle=
|
|
333
|
+
a[0].newStrokeStyle);a[0].newLineDashArray&&b.setLineDash(a[0].newLineDashArray);r&&e.moveTo(a[0].x,a[0].y);for(var c=0;c<a.length-3;c+=3)if(b.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),r&&e.bezierCurveTo(a[c+1].x,a[c+1].y,a[c+2].x,a[c+2].y,a[c+3].x,a[c+3].y),0<c&&0===c%3E3||a[c+3].newStrokeStyle||a[c+3].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(a[c+3].x,a[c+3].y),a[c+3].newStrokeStyle&&(b.strokeStyle=a[c+3].newStrokeStyle),a[c+3].newLineDashArray&&b.setLineDash(a[c+
|
|
334
|
+
3].newLineDashArray),r&&(e.stroke(),e.beginPath(),e.moveTo(a[c+3].x,a[c+3].y));b.stroke();r&&e.stroke()}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=r?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx;b.save();var h=this.plotArea;b.beginPath();b.rect(h.x1,h.y1,h.width,h.height);b.clip();for(var q=[],u=0;u<a.dataSeriesIndexes.length;u++){var l=a.dataSeriesIndexes[u],k=this.data[l];b.lineWidth=k.lineThickness;var m=k.dataPoints,n="solid";if(b.setLineDash){var p=
|
|
335
|
+
I(k.nullDataLineDashType,k.lineThickness),n=k.lineDashType,g=I(n,k.lineThickness);b.setLineDash(g)}var f=k.id;this._eventManager.objectMap[f]={objectType:"dataSeries",dataSeriesIndex:l};f=U(f);e.strokeStyle=f;e.lineWidth=0<k.lineThickness?Math.max(k.lineThickness,4):0;var f=k._colorSet,x=f=k.lineColor=k.options.lineColor?k.options.lineColor:f[0];b.strokeStyle=f;var y=0,s,C,v=[];b.beginPath();if(0<m.length)for(C=!1,y=0;y<m.length;y++)if(s=m[y].getTime?m[y].x.getTime():m[y].x,!(s<a.axisX.dataInfo.viewPortMin||
|
|
336
|
+
s>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!C)))if("number"!==typeof m[y].y)0<y&&!C&&(k.connectNullData?b.setLineDash&&(0<v.length&&(k.options.nullDataLineDashType||!m[y-1].lineDashType))&&(v[v.length-1].newLineDashArray=p,n=k.nullDataLineDashType):(d(v),v=[])),C=!0;else{s=a.axisX.convertValueToPixel(s);C=a.axisY.convertValueToPixel(m[y].y);var W=k.dataPointIds[y];this._eventManager.objectMap[W]={id:W,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:y,x1:s,y1:C};v[v.length]={x:s,
|
|
337
|
+
y:C};y<m.length-1&&(x!==(m[y].lineColor||f)||n!==(m[y].lineDashType||k.lineDashType))&&(x=m[y].lineColor||f,v[v.length-1].newStrokeStyle=x,b.setLineDash&&(m[y].lineDashType?(n=m[y].lineDashType,v[v.length-1].newLineDashArray=I(n,k.lineThickness)):(n=k.lineDashType,v[v.length-1].newLineDashArray=g)));if(0!==m[y].markerSize&&(0<m[y].markerSize||0<k.markerSize)){var t=k.getMarkerProperties(y,s,C,b);q.push(t);W=U(W);r&&q.push({x:s,y:C,ctx:e,type:t.type,size:t.size,color:W,borderColor:W,borderThickness:t.borderThickness})}(m[y].indexLabel||
|
|
338
|
+
k.indexLabel||m[y].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:m[y],dataSeries:k,point:{x:s,y:C},direction:0>m[y].y===a.axisY.reversed?1:-1,color:f});C=!1}d(v)}aa.drawMarkers(q);r&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&
|
|
339
339
|
this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(h.x1,h.y1,h.width,h.height),e.beginPath());b.restore();b.beginPath();return{source:c,dest:this.plotArea.ctx,animationCallback:R.xClipAnimation,easingFunction:R.easing.linear,animationBase:0}}};t.prototype.renderColumn=function(a){var d=a.targetCanvasCtx||this.plotArea.ctx,c=r?this._preRenderCtx:d;if(!(0>=a.dataSeriesIndexes.length)){var b=null,e=this.plotArea,h=0,q,u,l,k=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
340
340
|
a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,m=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.width,0.9*(this.plotArea.width/a.plotType.totalDataSeries))<<0,n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.dataPointWidth=this.options.dataPointWidth?this.dataPointWidth:0.9*(e.width*(a.axisX.logarithmic?Math.log(n)/
|
|
341
341
|
Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>m&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,m));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&m<h)&&(m=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));n<h&&(n=h);n>m&&(n=m);c.save();r&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(e.x1,e.y1,e.width,e.height);c.clip();r&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(e.x1,
|
|
@@ -551,12 +551,12 @@ c=0;c<C.length;c++)if(O[c].y1<a&&O[c].y4>a){b=O[c];break}return b?(a=b.y6?a>b.y6
|
|
|
551
551
|
"center"===y.title.horizontalAlign&&"center"===y.title.verticalAlign)&&(y.title.ctx=a,y.title.render());if(y.subtitles)for(var b=0;b<y.subtitles.length;b++){var c=y.subtitles[b];if(c.dockInsidePlotArea||"center"===c.horizontalAlign&&"center"===c.verticalAlign)y.subtitles.ctx=a,c.render()}y.legend&&(y.legend.dockInsidePlotArea||"center"===y.legend.horizontalAlign&&"center"===y.legend.verticalAlign)&&(y.legend.ctx=a,y.legend.setLayout(),y.legend.render());ua.fNg&&ua.fNg(y)}var y=this;if(!(0>=a.dataSeriesIndexes.length)){for(var s=
|
|
552
552
|
this.data[a.dataSeriesIndexes[0]],C=s.dataPoints,v=this.plotArea,z=0.025*v.width,A=0.01*v.width,B=0,G=v.height-2*z,J=Math.min(v.width-2*A,2.8*v.height),K=!1,L=0;L<C.length;L++)if(!K&&("undefined"!==typeof C[L].indexLabel&&null!==C[L].indexLabel&&0<C[L].indexLabel.toString().length)&&(K=!0),!K&&("undefined"!==typeof C[L].label&&null!==C[L].label&&0<C[L].label.toString().length)&&(K=!0),!K&&"function"===typeof s.indexLabelFormatter||"function"===typeof C[L].indexLabelFormatter)K=!0;K=K||"undefined"!==
|
|
553
553
|
typeof s.indexLabel&&null!==s.indexLabel&&0<s.indexLabel.toString().length;"inside"!==s.indexLabelPlacement&&K||(A=(v.width-0.75*J)/2);var L=v.x1+A,Q=v.x2-A,S=v.y1+z,T=v.y2-z,N=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=s.length&&(s.dataPoints&&s.visible)&&0!==C.length){var M,F;a=75*J/100;var U=30*(Q-a)/100;"funnel"===s.type?(M=l(s.options.neckHeight)?0.35*G:s.neckHeight,F=l(s.options.neckWidth)?0.25*a:s.neckWidth,"string"===typeof M&&M.match(/%$/)?(M=parseInt(M),M=M*G/100):M=parseInt(M),
|
|
554
|
-
"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),F=F*a/100):F=parseInt(F),M>G?M=G:0>=M&&(M=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===s.type&&(F=M=0,s.reversed=s.reversed?!1:!0);var A=L+a/2,Y=L,$=L+a,V=s.reversed?T:S,P=A-F/2,aa=A+F/2,Da=s.reversed?S+M:T-M,ra=s.reversed?S:T;F=s.valueRepresents=s.valueRepresents?s.valueRepresents:"height";L=[];a=[];var O=[],A=[],Z=S,fa,da=(Da-V)/(P-Y),ha=-da,J="area"===F?c():d();if(-1!==J){if(s.reversed)for(A.push(Z),F=J.length-1;0<F;F--)Z+=J[F],A.push(Z);
|
|
555
|
-
0;F<J.length;F++)Z+=J[F],A.push(Z);if(s.reversed)for(F=0;F<J.length;F++)A[F]<Da?(L.push(P),a.push(aa),fa=F):(L.push((A[F]-V+da*Y)/da),a.push((A[F]-V+ha*$)/ha));else for(F=0;F<J.length;F++)A[F]<Da?(L.push((A[F]-V+da*Y)/da),a.push((A[F]-V+ha*$)/ha),fa=F):(L.push(P),a.push(aa));for(F=0;F<J.length-1;F++)Z=s.reversed?C[C.length-1-F].color?C[C.length-1-F].color:s._colorSet[(C.length-1-F)%s._colorSet.length]:C[F].color?C[F].color:s._colorSet[F%s._colorSet.length],F===fa?O.push({x1:L[F],
|
|
556
|
-
x3:aa,y3:Da,x4:a[F+1],y4:A[F+1],x5:L[F+1],y5:A[F+1],x6:P,y6:Da,id:F,height:A[F+1]-A[F],color:Z}):O.push({x1:L[F],y1:A[F],x2:a[F],y2:A[F],x3:a[F+1],y3:A[F+1],x4:L[F+1],y4:A[F+1],id:F,height:A[F+1]-A[F],color:Z}),s.dataPointEOs[F]&&O[F]&&(s.dataPointEOs[F].sectionsofFunnel=O[F]);var ga=2,H=[],ja=!1,X=[],ia=[],L=!1;a=a=0;Ea(X);for(F=0;F<C.length;F++)C[F].exploded&&(L=!0,s.reversed?X.push(C.length-1-F):X.push(F));N.clearRect(v.x1,v.y1,v.width,v.height);N.fillStyle=y.backgroundColor;
|
|
557
|
-
v.width,v.height);if(K&&s.visible&&(b(),h(),"inside"!==s.indexLabelPlacement)){e();q();for(F=0;F<C.length;F++)H[F].isDirty||(a=H[F].textBlock.x+H[F].width,a=(Q-a)/2,0==F&&(B=a),B>a&&(B=a));for(F=0;F<O.length;F++)O[F].x1+=B,O[F].x2+=B,O[F].x3+=B,O[F].x4+=B,O[F].x5&&(O[F].x5+=B,O[F].x6+=B),H[F].textBlock.x+=B}for(F=0;F<O.length;F++)B=O[F],pa(N,B,s.fillOpacity),ia.push(B.y1);x(N);K&&s.visible&&("inside"===s.indexLabelPlacement||y.animationEnabled||m(N),y.animationEnabled||w());if(!K)for(F=
|
|
558
|
-
s.dataPointIds[F],a={id:B,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:O[s.reversed?C.length-1-F:F]},y._eventManager.objectMap[B]=a;!y.animationEnabled&&L?t(y,-1,0):y.animationEnabled&&!y.animatedRender&&t(y,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ja&&!y.isAnimating&&(l(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=s.reversed?C.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===s.type||"pyramid"===
|
|
559
|
-
C[C.length-1-a].exploded=C[C.length-1-a].exploded?!1:!0:C[a].exploded=C[a].exploded?!1:!0;t(y,b,500)}};return{source:N,dest:this.plotArea.ctx,animationCallback:function(a,b){R.fadeInAnimation(a,b);1<=a&&(t(y,-1,500),x(y.plotArea.ctx||y.ctx))},easingFunction:R.easing.easeInQuad,animationBase:0}}}}};t.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||
|
|
554
|
+
"string"===typeof F&&F.match(/%$/)?(F=parseInt(F),F=F*a/100):F=parseInt(F),M>G?M=G:0>=M&&(M=0),F>a?F=a-0.5:0>=F&&(F=0)):"pyramid"===s.type&&(F=M=0,s.reversed=s.reversed?!1:!0);var A=L+a/2,Y=L,$=L+a,V=s.reversed?T:S,P=A-F/2,aa=A+F/2,Da=s.reversed?S+M:T-M,ra=s.reversed?S:T;F=s.valueRepresents=s.valueRepresents?s.valueRepresents:"height";L=[];a=[];var O=[],A=[],Z=S,fa,da=(Da-V)/(P-Y),ha=-da,J="area"===F?c():d();if(-1!==J){if(s.reversed)for(A.push(Z),F=J.length-1;0<F;F--)Z+=J[F],A.push(Math.round(Z));
|
|
555
|
+
else for(F=0;F<J.length;F++)Z+=J[F],A.push(Math.round(Z));if(s.reversed)for(F=0;F<J.length;F++)A[F]<Da?(L.push(P),a.push(aa),fa=F):(L.push((A[F]-V+da*Y)/da),a.push((A[F]-V+ha*$)/ha));else for(F=0;F<J.length;F++)A[F]<Da?(L.push((A[F]-V+da*Y)/da),a.push((A[F]-V+ha*$)/ha),fa=F):(L.push(P),a.push(aa));for(F=0;F<J.length-1;F++)Z=s.reversed?C[C.length-1-F].color?C[C.length-1-F].color:s._colorSet[(C.length-1-F)%s._colorSet.length]:C[F].color?C[F].color:s._colorSet[F%s._colorSet.length],F===fa?O.push({x1:L[F],
|
|
556
|
+
y1:A[F],x2:a[F],y2:A[F],x3:aa,y3:Da,x4:a[F+1],y4:A[F+1],x5:L[F+1],y5:A[F+1],x6:P,y6:Da,id:F,height:A[F+1]-A[F],color:Z}):O.push({x1:L[F],y1:A[F],x2:a[F],y2:A[F],x3:a[F+1],y3:A[F+1],x4:L[F+1],y4:A[F+1],id:F,height:A[F+1]-A[F],color:Z}),s.dataPointEOs[F]&&O[F]&&(s.dataPointEOs[F].sectionsofFunnel=O[F]);var ga=2,H=[],ja=!1,X=[],ia=[],L=!1;a=a=0;Ea(X);for(F=0;F<C.length;F++)C[F].exploded&&(L=!0,s.reversed?X.push(C.length-1-F):X.push(F));N.clearRect(v.x1,v.y1,v.width,v.height);N.fillStyle=y.backgroundColor;
|
|
557
|
+
N.fillRect(v.x1,v.y1,v.width,v.height);if(K&&s.visible&&(b(),h(),"inside"!==s.indexLabelPlacement)){e();q();for(F=0;F<C.length;F++)H[F].isDirty||(a=H[F].textBlock.x+H[F].width,a=(Q-a)/2,0==F&&(B=a),B>a&&(B=a));for(F=0;F<O.length;F++)O[F].x1+=B,O[F].x2+=B,O[F].x3+=B,O[F].x4+=B,O[F].x5&&(O[F].x5+=B,O[F].x6+=B),H[F].textBlock.x+=B}for(F=0;F<O.length;F++)B=O[F],pa(N,B,s.fillOpacity),ia.push(B.y1);x(N);K&&s.visible&&("inside"===s.indexLabelPlacement||y.animationEnabled||m(N),y.animationEnabled||w());if(!K)for(F=
|
|
558
|
+
0;F<C.length;F++)B=s.dataPointIds[F],a={id:B,objectType:"dataPoint",dataPointIndex:F,dataSeriesIndex:0,funnelSection:O[s.reversed?C.length-1-F:F]},y._eventManager.objectMap[B]=a;!y.animationEnabled&&L?t(y,-1,0):y.animationEnabled&&!y.animatedRender&&t(y,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!ja&&!y.isAnimating&&(l(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=s.reversed?C.length-1-a.dataPointIndex:a.dataPointIndex,0<=b)){a=b;if("funnel"===s.type||"pyramid"===
|
|
559
|
+
s.type)s.reversed?C[C.length-1-a].exploded=C[C.length-1-a].exploded?!1:!0:C[a].exploded=C[a].exploded?!1:!0;t(y,b,500)}};return{source:N,dest:this.plotArea.ctx,animationCallback:function(a,b){R.fadeInAnimation(a,b);1<=a&&(t(y,-1,500),x(y.plotArea.ctx||y.ctx))},easingFunction:R.easing.easeInQuad,animationBase:0}}}}};t.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||
|
|
560
560
|
function(a){window.setTimeout(a,1E3/60)}}();t.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;t.prototype.set=function(a,d,c){c="undefined"===typeof c?!0:c;"options"===a?(this.options=d,c&&this.render()):t.base.set.call(this,a,d,c)};t.prototype.exportChart=function(a){a="undefined"===typeof a?{}:a;var d=a.format?a.format:
|
|
561
561
|
"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+d);var b=this.canvas;if(b&&d&&c){c=c+"."+d;a="image/"+d;var b=b.toDataURL(a),e=!1,h=document.createElement("a");h.download=c;h.href=b;if("undefined"!==typeof Blob&&new Blob){for(var q=b.replace(/^data:[a-z\/]*;base64,/,""),q=atob(q),f=new ArrayBuffer(q.length),f=new Uint8Array(f),l=0;l<q.length;l++)f[l]=q.charCodeAt(l);d=new Blob([f.buffer],{type:"image/"+d});try{window.navigator.msSaveBlob(d,c),
|
|
562
562
|
e=!0}catch(k){h.dataset.downloadurl=[a,h.download,h.href].join(":"),h.href=window.URL.createObjectURL(d)}}if(!e)try{event=document.createEvent("MouseEvents"),event.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),h.dispatchEvent?h.dispatchEvent(event):h.fireEvent&&h.fireEvent("onclick")}catch(m){d=window.open(),d.document.write("<img src='"+b+"'></img><div>Please right click on the image and save it to your device</div>"),d.document.close()}}};t.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),
|
|
@@ -955,7 +955,7 @@ ja.prototype.cancelAllAnimations=function(){this.animations=[];this.animationReq
|
|
|
955
955
|
0,b.width,b.height,e-e*a,0,a*c.canvas.width/ia,c.canvas.height/ia)}},xClipAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();0<a&&c.drawImage(b,0,0,b.width*a,b.height,0,0,b.width*a/ia,b.height/ia);c.restore()}},fadeInAnimation:function(a,d){if(0!==a){var c=d.dest,b=d.source.canvas;c.save();c.globalAlpha=a;c.drawImage(b,0,0,b.width,b.height,0,0,c.canvas.width/ia,c.canvas.height/ia);c.restore()}},easing:{linear:function(a,d,c,b){return c*a/b+d},easeOutQuad:function(a,d,c,b){return-c*
|
|
956
956
|
(a/=b)*(a-2)+d},easeOutQuart:function(a,d,c,b){return-c*((a=a/b-1)*a*a*a-1)+d},easeInQuad:function(a,d,c,b){return c*(a/=b)*a+d},easeInQuart:function(a,d,c,b){return c*(a/=b)*a*a*a+d}}},aa={drawMarker:function(a,d,c,b,e,f,l,r){if(c){var t=1;c.fillStyle=f?f:"#000000";c.strokeStyle=l?l:"#000000";c.lineWidth=r?r:0;c.setLineDash&&c.setLineDash(I("solid",r));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,e/2,0,2*Math.PI,!1),f&&c.fill(),r&&(l?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle=
|
|
957
957
|
"black",c.stroke(),c.globalAlpha=t))):"square"===b?(c.beginPath(),c.rect(a-e/2,d-e/2,e,e),f&&c.fill(),r&&(l?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=t))):"triangle"===b?(c.beginPath(),c.moveTo(a-e/2,d+e/2),c.lineTo(a+e/2,d+e/2),c.lineTo(a,d-e/2),c.closePath(),f&&c.fill(),r&&(l?c.stroke():(t=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=t)),c.beginPath()):"cross"===b&&(c.strokeStyle=f,c.lineWidth=e/4,c.beginPath(),
|
|
958
|
-
c.moveTo(a-e/2,d-e/2),c.lineTo(a+e/2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];aa.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return t}();w.version="v3.10.
|
|
958
|
+
c.moveTo(a-e/2,d-e/2),c.lineTo(a+e/2,d+e/2),c.stroke(),c.moveTo(a+e/2,d-e/2),c.lineTo(a-e/2,d+e/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];aa.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return t}();w.version="v3.10.16 GA";window.CanvasJS&&(w&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=w)})();
|
|
959
959
|
|
|
960
960
|
/*
|
|
961
961
|
excanvas is used to support IE678 which do not implement HTML5 Canvas Element. You can safely remove the following excanvas code if you don't need to support older browsers.
|