@canvasjs/stockcharts 1.7.21 → 1.7.23
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.stock.min.js +370 -369
- package/package.json +1 -1
package/canvasjs.stock.min.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
CanvasJS StockChart - v1.7.
|
|
2
|
+
CanvasJS StockChart - v1.7.23 GA - https://canvasjs.com/
|
|
3
3
|
Copyright 2023 fenopix
|
|
4
4
|
|
|
5
5
|
--------------------- License Information --------------------
|
|
@@ -303,354 +303,355 @@ this.plotInfo.axisPlacement){if(0<=p.indexOf("line")||0<=p.indexOf("area"))t="au
|
|
|
303
303
|
c.y1),h=Math.min(n.bounds.y2,c.y2-m+r/2),b=0<=p.indexOf("range")||"error"===p?0<y?Math.max(n.bounds.y1,c.y1)+r/2+d:Math.min(n.bounds.y2,c.y2)+r/2-m+d:(Math.max(n.bounds.y1,c.y1)+Math.min(n.bounds.y2,c.y2))/2-m/2+r/2+("horizontal"===v?d:0),0<y?(k=Math.max(n.point.y,b),k<g&&("bubble"===p||"scatter"===p)&&(k=Math.max(n.point.y-m-d,c.y1+d))):(k=Math.min(n.point.y,b),k>h-m-d&&("bubble"===p||"scatter"===p)&&(k=Math.min(n.point.y+d,c.y2-m-d))),k=Math.min(k,h))}else 0<=p.indexOf("line")||0<=p.indexOf("area")||
|
|
304
304
|
0<=p.indexOf("scatter")?(t="auto",B=4):0<=p.indexOf("stacked")?"auto"===t&&(t="inside"):"bubble"===p&&(t="inside"),k=n.point.y+r/2-m/2+d,"inside"!==t?(g=c.x1,h=c.x2,0>y?(q=n.point.x-("horizontal"===v?L:L-r/2)-B-b,q<g&&(q="auto"===t?Math.max(n.point.x,g)+B:g+B,z=q+L>n.point.x)):(q=n.point.x+("horizontal"===v?0:r/2)+B+b,q>h-L-B-b&&(q="auto"===t?Math.min(n.point.x,h)-("horizontal"===v?L:L/2)-B:h-L-B,z=q<n.point.x))):(g=Math.max(n.bounds.x1,c.x1),Math.min(n.bounds.x2,c.x2),b=0<=p.indexOf("range")||"error"===
|
|
305
305
|
p?0>y?Math.max(n.bounds.x1,c.x1)+r/2+B:Math.min(n.bounds.x2,c.x2)-L/2-B+("horizontal"===v?0:r/2):(Math.max(n.bounds.x1,c.x1)+Math.min(n.bounds.x2,c.x2))/2+("horizontal"===v?0:r/2),q=0>y?Math.max(n.point.x,b)-("horizontal"===v?L/2:0):Math.min(n.point.x,b)-L/2,q=Math.max(q,g));"vertical"===v&&(k+=m-r/2);l.x=q;l.y=k;l.render(!0);A&&("inside"!==t&&(0>p.indexOf("bar")&&("error"!==p||!n.axisSwapped)&&n.point.x>c.x1&&n.point.x<c.x2||!z)&&(0>p.indexOf("column")&&("error"!==p||n.axisSwapped)&&n.point.y>c.y1&&
|
|
306
|
-
n.point.y<c.y2||!z))&&(f.lineWidth=A,f.strokeStyle=w?w:"gray",f.setLineDash&&f.setLineDash(S(ha,A)),f.beginPath(),f.moveTo(n.point.x,n.point.y),0<=p.indexOf("bar")||"error"===p&&n.axisSwapped?f.lineTo(q+(0<n.direction?-B:L+B)+("vertical"===v?-r/2:0),k+("vertical"===v?-m/2:m/2-r/2)-d):0<=p.indexOf("column")||"error"===p&&!n.axisSwapped?f.lineTo(q+L/2-("horizontal"===v?0:r/2),k+("vertical"===v?(k-m<n.point.y?0:-m)+d:(k-r/2<n.point.y?m:0)-r/2)):f.lineTo(q+L/2-("horizontal"===
|
|
307
|
-
v?k-m
|
|
308
|
-
f;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var h=[],e,d=0;d<a.dataSeriesIndexes.length;d++){var L=a.dataSeriesIndexes[d],m=this.data[L];c.lineWidth=m.lineThickness;var n=m.dataPoints,
|
|
309
|
-
dataSeriesIndex:L};r=W(r);b.strokeStyle=r;b.lineWidth=0<m.lineThickness?Math.max(m.lineThickness,4):0;var r=m._colorSet,l=r=m.lineColor=m.options.lineColor?m.options.lineColor:r[0];c.strokeStyle=r;var ha=!0,w=0,A,v;c.beginPath();if(0<n.length){for(var u=!1,w=0;w<n.length;w++)if(A=n[w].x.getTime?n[w].x.getTime():
|
|
310
|
-
u=!0;else{A=a.axisX.convertValueToPixel(A);v=a.axisY.convertValueToPixel(n[w].y);var K=m.dataPointIds[w];this._eventManager.objectMap[K]={id:K,objectType:"dataPoint",dataSeriesIndex:L,dataPointIndex:w,x1:A,y1:v};ha||u?(!ha&&m.connectNullData?(c.setLineDash&&(m.options.nullDataLineDashType||p===m.lineDashType&&m.lineDashType!==
|
|
311
|
-
s&&(b.beginPath(),b.moveTo(A,v))),u=ha=!1):(c.lineTo(A,v),s&&b.lineTo(A,v),0==w%500&&(c.stroke(),c.beginPath(),c.moveTo(A,v),s&&(b.stroke(),b.beginPath(),b.moveTo(A,v))));e={x:A,y:v};w<n.length-1&&(l!==(n[w].lineColor||r)||p!==(n[w].lineDashType||m.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(A,v),l=n[w].lineColor||r,c.strokeStyle=
|
|
312
|
-
0<m.markerSize)){var D=m.getMarkerProperties(w,A,v,c);h.push(D);K=W(K);s&&h.push({x:A,y:v,ctx:b,type:D.type,size:D.size,color:K,borderColor:K,borderThickness:D.borderThickness})}(n[w].indexLabel||m.indexLabel||n[w].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:n[w],dataSeries:m,
|
|
313
|
-
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),c.clearRect(g.x1,g.y1,g.width,g.height),b.beginPath());c.restore();c.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};
|
|
314
|
-
u.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var h=[],e,d=0;d<a.dataSeriesIndexes.length;d++){var L=a.dataSeriesIndexes[d],m=this.data[L];c.lineWidth=m.lineThickness;var n=m.dataPoints,p="solid";if(c.setLineDash){var q=S(m.nullDataLineDashType,m.lineThickness),p=m.lineDashType,
|
|
315
|
-
k=S(p,m.lineThickness);c.setLineDash(k)}var r=m.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:L};r=W(r);b.strokeStyle=r;b.lineWidth=0<m.lineThickness?Math.max(m.lineThickness,4):0;var r=m._colorSet,l=r=m.lineColor=m.options.lineColor?m.options.lineColor:r[0];c.strokeStyle=r;var ha=!0,w=0,A,v;c.beginPath();if(0<n.length){for(var u=!1,w=0;w<n.length;w++)if(A=n[w].getTime?n[w].x.getTime():n[w].x,!(A<a.axisX.dataInfo.viewPortMin||A>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||
|
|
316
|
-
!u)))if("number"!==typeof n[w].y)0<w&&!(m.connectNullData||u||ha)&&(c.stroke(),s&&b.stroke()),u=!0;else{var K=v;A=a.axisX.convertValueToPixel(A);v=a.axisY.convertValueToPixel(n[w].y);var D=m.dataPointIds[w];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:L,dataPointIndex:w,x1:A,y1:v};ha||u?(!ha&&m.connectNullData?(c.setLineDash&&(m.options.nullDataLineDashType||p===m.lineDashType&&m.lineDashType!==m.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(e.x,e.y),p=
|
|
317
|
-
m.nullDataLineDashType,c.setLineDash(q)),c.lineTo(A,K),c.lineTo(A,v),s&&(b.lineTo(A,K),b.lineTo(A,v))):(c.beginPath(),c.moveTo(A,v),s&&(b.beginPath(),b.moveTo(A,v))),u=ha=!1):(c.lineTo(A,K),s&&b.lineTo(A,K),c.lineTo(A,v),s&&b.lineTo(A,v),0==w%500&&(c.stroke(),c.beginPath(),c.moveTo(A,v),s&&(b.stroke(),b.beginPath(),b.moveTo(A,v))));e={x:A,y:v};w<n.length-1&&(l!==(n[w].lineColor||r)||p!==(n[w].lineDashType||m.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(A,v),l=n[w].lineColor||r,c.strokeStyle=
|
|
318
|
-
l,c.setLineDash&&(n[w].lineDashType?(p=n[w].lineDashType,c.setLineDash(S(p,m.lineThickness))):(p=m.lineDashType,c.setLineDash(k))));0!==n[w].markerSize&&(0<n[w].markerSize||0<m.markerSize)&&(K=m.getMarkerProperties(w,A,v,c),h.push(K),D=W(D),s&&h.push({x:A,y:v,ctx:b,type:K.type,size:K.size,color:D,borderColor:D,borderThickness:K.borderThickness}));(n[w].indexLabel||m.indexLabel||n[w].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:n[w],dataSeries:m,
|
|
306
|
+
n.point.y<c.y2||!z))&&(f.lineWidth=A,f.strokeStyle=w?w:"gray",f.setLineDash&&f.setLineDash(S(ha,A)),f.beginPath(),f.moveTo(n.point.x,n.point.y),0<=p.indexOf("bar")||"error"===p&&n.axisSwapped?f.lineTo(q+(0<n.direction?-B:L+B)+("vertical"===v?-r/2:0),k+("vertical"===v?-m/2:m/2-r/2)-d):0<=p.indexOf("column")||"error"===p&&!n.axisSwapped?f.lineTo(q+L/2-("horizontal"===v?0:r/2),k+("vertical"===v?(k-m<n.point.y?0:-m)+d:(k-r/2<n.point.y?m:0)-r/2)):0<=p.indexOf("waterfall")?f.lineTo(q+L/2-("horizontal"===
|
|
307
|
+
v?0:r/2),"vertical"===v?0<y&&k<n.point.y?k:0>y&&k-m>n.point.y?k-m:n.point.y:0<y&&k+m-r/2<n.point.y?k+m-r/2:0>y&&k-r/2>n.point.y?k-r/2-2:n.point.y):f.lineTo(q+L/2-("horizontal"===v?0:r/2),k+("vertical"===v?k-m<n.point.y?0:-m:(k+m<n.point.y?m:0)-r/2)),f.stroke())}}f={source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0,startTimePercent:0.7};for(a=0;a<this._indexLabels.length;a++)n=this._indexLabels[a],l=qa("indexLabelBackgroundColor",
|
|
308
|
+
n.dataPoint,n.dataSeries),n.dataSeries.indexLabelBackgroundColor=e(l)?s?"transparent":null:l;return f};u.prototype.renderLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var h=[],e,d=0;d<a.dataSeriesIndexes.length;d++){var L=a.dataSeriesIndexes[d],m=this.data[L];c.lineWidth=m.lineThickness;var n=m.dataPoints,
|
|
309
|
+
p="solid";if(c.setLineDash){var q=S(m.nullDataLineDashType,m.lineThickness),p=m.lineDashType,k=S(p,m.lineThickness);c.setLineDash(k)}var r=m.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:L};r=W(r);b.strokeStyle=r;b.lineWidth=0<m.lineThickness?Math.max(m.lineThickness,4):0;var r=m._colorSet,l=r=m.lineColor=m.options.lineColor?m.options.lineColor:r[0];c.strokeStyle=r;var ha=!0,w=0,A,v;c.beginPath();if(0<n.length){for(var u=!1,w=0;w<n.length;w++)if(A=n[w].x.getTime?n[w].x.getTime():
|
|
310
|
+
n[w].x,!(A<a.axisX.dataInfo.viewPortMin||A>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!u)))if("number"!==typeof n[w].y)0<w&&!(m.connectNullData||u||ha)&&(c.stroke(),s&&b.stroke()),u=!0;else{A=a.axisX.convertValueToPixel(A);v=a.axisY.convertValueToPixel(n[w].y);var K=m.dataPointIds[w];this._eventManager.objectMap[K]={id:K,objectType:"dataPoint",dataSeriesIndex:L,dataPointIndex:w,x1:A,y1:v};ha||u?(!ha&&m.connectNullData?(c.setLineDash&&(m.options.nullDataLineDashType||p===m.lineDashType&&m.lineDashType!==
|
|
311
|
+
m.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(e.x,e.y),p=m.nullDataLineDashType,c.setLineDash(q)),c.lineTo(A,v),s&&b.lineTo(A,v)):(c.beginPath(),c.moveTo(A,v),s&&(b.beginPath(),b.moveTo(A,v))),u=ha=!1):(c.lineTo(A,v),s&&b.lineTo(A,v),0==w%500&&(c.stroke(),c.beginPath(),c.moveTo(A,v),s&&(b.stroke(),b.beginPath(),b.moveTo(A,v))));e={x:A,y:v};w<n.length-1&&(l!==(n[w].lineColor||r)||p!==(n[w].lineDashType||m.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(A,v),l=n[w].lineColor||r,c.strokeStyle=
|
|
312
|
+
l,c.setLineDash&&(n[w].lineDashType?(p=n[w].lineDashType,c.setLineDash(S(p,m.lineThickness))):(p=m.lineDashType,c.setLineDash(k))));if(0!==n[w].markerSize&&(0<n[w].markerSize||0<m.markerSize)){var D=m.getMarkerProperties(w,A,v,c);h.push(D);K=W(K);s&&h.push({x:A,y:v,ctx:b,type:D.type,size:D.size,color:K,borderColor:K,borderThickness:D.borderThickness})}(n[w].indexLabel||m.indexLabel||n[w].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"line",dataPoint:n[w],dataSeries:m,
|
|
319
313
|
point:{x:A,y:v},direction:0>n[w].y===a.axisY.reversed?1:-1,color:r})}c.stroke();s&&b.stroke()}}t.drawMarkers(h);s&&(f.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),c.clearRect(g.x1,g.y1,
|
|
320
|
-
g.width,g.height),b.beginPath());c.restore();c.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.
|
|
321
|
-
|
|
322
|
-
c;if(
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
(
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
a.
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
c.
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
a.
|
|
341
|
-
|
|
342
|
-
this.
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
p,u,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
p
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
0,
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
this.
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
u
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
b
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
0,
|
|
400
|
-
D.
|
|
401
|
-
|
|
402
|
-
D.
|
|
403
|
-
(
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
h
|
|
411
|
-
u
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
b.width)
|
|
415
|
-
this.
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
this.
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
p
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
this.
|
|
444
|
-
|
|
445
|
-
b
|
|
446
|
-
(
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
1
|
|
450
|
-
|
|
451
|
-
this.
|
|
452
|
-
a.
|
|
453
|
-
|
|
454
|
-
(
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
0,0,this.width,this.height),c.clearRect(
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
(
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
(
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
d
|
|
509
|
-
y.
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
b
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
a
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
for(
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
"
|
|
554
|
-
this.
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
"
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
Math.
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
this.
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
this.
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
this.
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
(this.
|
|
623
|
-
|
|
624
|
-
(this.
|
|
625
|
-
this.
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
h
|
|
632
|
-
|
|
633
|
-
this.
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
0<
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
0:
|
|
314
|
+
g.width,g.height),b.beginPath());c.restore();c.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderStepLine=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx;c.save();var g=this.plotArea;c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();for(var h=[],e,d=0;d<a.dataSeriesIndexes.length;d++){var L=
|
|
315
|
+
a.dataSeriesIndexes[d],m=this.data[L];c.lineWidth=m.lineThickness;var n=m.dataPoints,p="solid";if(c.setLineDash){var q=S(m.nullDataLineDashType,m.lineThickness),p=m.lineDashType,k=S(p,m.lineThickness);c.setLineDash(k)}var r=m.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:L};r=W(r);b.strokeStyle=r;b.lineWidth=0<m.lineThickness?Math.max(m.lineThickness,4):0;var r=m._colorSet,l=r=m.lineColor=m.options.lineColor?m.options.lineColor:r[0];c.strokeStyle=r;var ha=!0,w=0,A,v;
|
|
316
|
+
c.beginPath();if(0<n.length){for(var u=!1,w=0;w<n.length;w++)if(A=n[w].getTime?n[w].x.getTime():n[w].x,!(A<a.axisX.dataInfo.viewPortMin||A>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!u)))if("number"!==typeof n[w].y)0<w&&!(m.connectNullData||u||ha)&&(c.stroke(),s&&b.stroke()),u=!0;else{var K=v;A=a.axisX.convertValueToPixel(A);v=a.axisY.convertValueToPixel(n[w].y);var D=m.dataPointIds[w];this._eventManager.objectMap[D]={id:D,objectType:"dataPoint",dataSeriesIndex:L,dataPointIndex:w,x1:A,y1:v};
|
|
317
|
+
ha||u?(!ha&&m.connectNullData?(c.setLineDash&&(m.options.nullDataLineDashType||p===m.lineDashType&&m.lineDashType!==m.nullDataLineDashType)&&(c.stroke(),c.beginPath(),c.moveTo(e.x,e.y),p=m.nullDataLineDashType,c.setLineDash(q)),c.lineTo(A,K),c.lineTo(A,v),s&&(b.lineTo(A,K),b.lineTo(A,v))):(c.beginPath(),c.moveTo(A,v),s&&(b.beginPath(),b.moveTo(A,v))),u=ha=!1):(c.lineTo(A,K),s&&b.lineTo(A,K),c.lineTo(A,v),s&&b.lineTo(A,v),0==w%500&&(c.stroke(),c.beginPath(),c.moveTo(A,v),s&&(b.stroke(),b.beginPath(),
|
|
318
|
+
b.moveTo(A,v))));e={x:A,y:v};w<n.length-1&&(l!==(n[w].lineColor||r)||p!==(n[w].lineDashType||m.lineDashType))&&(c.stroke(),c.beginPath(),c.moveTo(A,v),l=n[w].lineColor||r,c.strokeStyle=l,c.setLineDash&&(n[w].lineDashType?(p=n[w].lineDashType,c.setLineDash(S(p,m.lineThickness))):(p=m.lineDashType,c.setLineDash(k))));0!==n[w].markerSize&&(0<n[w].markerSize||0<m.markerSize)&&(K=m.getMarkerProperties(w,A,v,c),h.push(K),D=W(D),s&&h.push({x:A,y:v,ctx:b,type:K.type,size:K.size,color:D,borderColor:D,borderThickness:K.borderThickness}));
|
|
319
|
+
(n[w].indexLabel||m.indexLabel||n[w].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepLine",dataPoint:n[w],dataSeries:m,point:{x:A,y:v},direction:0>n[w].y===a.axisY.reversed?1:-1,color:r})}c.stroke();s&&b.stroke()}}t.drawMarkers(h);s&&(f.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,
|
|
320
|
+
0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(g.x1,g.y1,g.width,g.height),b.beginPath());c.restore();c.beginPath();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderSpline=function(a){function f(a){a=F(a,2);if(0<a.length){b.beginPath();s&&g.beginPath();b.moveTo(a[0].x,a[0].y);a[0].newStrokeStyle&&(b.strokeStyle=
|
|
321
|
+
a[0].newStrokeStyle);a[0].newLineDashArray&&b.setLineDash(a[0].newLineDashArray);s&&g.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),s&&g.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+
|
|
322
|
+
3].newLineDashArray),s&&(g.stroke(),g.beginPath(),g.moveTo(a[c+3].x,a[c+3].y));b.stroke();s&&g.stroke()}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=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 e=[],d=0;d<a.dataSeriesIndexes.length;d++){var L=a.dataSeriesIndexes[d],m=this.data[L];b.lineWidth=m.lineThickness;var n=m.dataPoints,p="solid";if(b.setLineDash){var q=
|
|
323
|
+
S(m.nullDataLineDashType,m.lineThickness),p=m.lineDashType,k=S(p,m.lineThickness);b.setLineDash(k)}var r=m.id;this._eventManager.objectMap[r]={objectType:"dataSeries",dataSeriesIndex:L};r=W(r);g.strokeStyle=r;g.lineWidth=0<m.lineThickness?Math.max(m.lineThickness,4):0;var r=m._colorSet,l=r=m.lineColor=m.options.lineColor?m.options.lineColor:r[0];b.strokeStyle=r;var ha=0,w,A,v=[];b.beginPath();if(0<n.length)for(A=!1,ha=0;ha<n.length;ha++)if(w=n[ha].getTime?n[ha].x.getTime():n[ha].x,!(w<a.axisX.dataInfo.viewPortMin||
|
|
324
|
+
w>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!A)))if("number"!==typeof n[ha].y)0<ha&&!A&&(m.connectNullData?b.setLineDash&&(0<v.length&&(m.options.nullDataLineDashType||!n[ha-1].lineDashType))&&(v[v.length-1].newLineDashArray=q,p=m.nullDataLineDashType):(f(v),v=[])),A=!0;else{w=a.axisX.convertValueToPixel(w);A=a.axisY.convertValueToPixel(n[ha].y);var u=m.dataPointIds[ha];this._eventManager.objectMap[u]={id:u,objectType:"dataPoint",dataSeriesIndex:L,dataPointIndex:ha,x1:w,y1:A};v[v.length]=
|
|
325
|
+
{x:w,y:A};ha<n.length-1&&(l!==(n[ha].lineColor||r)||p!==(n[ha].lineDashType||m.lineDashType))&&(l=n[ha].lineColor||r,v[v.length-1].newStrokeStyle=l,b.setLineDash&&(n[ha].lineDashType?(p=n[ha].lineDashType,v[v.length-1].newLineDashArray=S(p,m.lineThickness)):(p=m.lineDashType,v[v.length-1].newLineDashArray=k)));if(0!==n[ha].markerSize&&(0<n[ha].markerSize||0<m.markerSize)){var K=m.getMarkerProperties(ha,w,A,b);e.push(K);u=W(u);s&&e.push({x:w,y:A,ctx:g,type:K.type,size:K.size,color:u,borderColor:u,
|
|
326
|
+
borderThickness:K.borderThickness})}(n[ha].indexLabel||m.indexLabel||n[ha].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"spline",dataPoint:n[ha],dataSeries:m,point:{x:w,y:A},direction:0>n[ha].y===a.axisY.reversed?1:-1,color:r});A=!1}f(v)}t.drawMarkers(e);s&&(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,
|
|
327
|
+
0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(h.x1,h.y1,h.width,h.height),g.beginPath());b.restore();b.beginPath();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,
|
|
328
|
+
h=0,e,d,L,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,n=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,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.dataPointWidth=this.options.dataPointWidth?
|
|
329
|
+
this.dataPointWidth:0.9*(g.width*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>n&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n<h)&&(n=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));p<h&&(p=h);p>n&&(p=n);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);
|
|
330
|
+
c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(n=0;n<a.dataSeriesIndexes.length;n++){var q=a.dataSeriesIndexes[n],k=this.data[q],r=k.dataPoints;if(0<r.length)for(var l=5<p&&k.bevelEnabled?!0:!1,h=0;h<r.length;h++)if(r[h].getTime?L=r[h].x.getTime():L=r[h].x,!(L<a.axisX.dataInfo.viewPortMin||L>a.axisX.dataInfo.viewPortMax)&&"number"===typeof r[h].y){e=a.axisX.convertValueToPixel(L);d=a.axisY.convertValueToPixel(r[h].y);
|
|
331
|
+
e=a.axisX.reversed?e+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+n)*p<<0:e-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+n)*p<<0;var t=a.axisX.reversed?e-p<<0:e+p<<0,w;0<=r[h].y?w=m:(w=d,d=m);d>w&&(b=d,d=w,w=b);b=r[h].color?r[h].color:k._colorSet[h%k._colorSet.length];fa(c,a.axisX.reversed?t:e,d,a.axisX.reversed?e:t,w,b,0,null,l&&(a.axisY.reversed?0>r[h].y:0<=r[h].y),(a.axisY.reversed?0<=r[h].y:0>r[h].y)&&l,!1,!1,k.fillOpacity);b=k.dataPointIds[h];this._eventManager.objectMap[b]=
|
|
332
|
+
{id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:e,y1:d,x2:t,y2:w};b=W(b);s&&fa(this._eventManager.ghostCtx,a.axisX.reversed?t:e,d,a.axisX.reversed?e:t,w,b,0,null,!1,!1,!1,!1);(r[h].indexLabel||k.indexLabel||r[h].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"column",dataPoint:r[h],dataSeries:k,point:{x:e+(t-e)/2,y:0>r[h].y===a.axisY.reversed?d:w},direction:0>r[h].y===a.axisY.reversed?1:-1,bounds:{x1:e,y1:Math.min(d,w),x2:t,y2:Math.max(d,w)},color:b})}}s&&
|
|
333
|
+
(f.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),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.yScaleAnimation,
|
|
334
|
+
easingFunction:x.easing.easeOutQuart,animationBase:m<a.axisY.bounds.y1?a.axisY.bounds.y1:m>a.axisY.bounds.y2?a.axisY.bounds.y2:m}}};u.prototype.renderStackedColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=[],e=[],d=[],L=[],m=0,n,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),m=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:
|
|
335
|
+
1,k=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&m>k&&(m=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&
|
|
336
|
+
(this.dataPointMinWidth&&k<m)&&(k=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,m));r<m&&(r=m);r>k&&(r=k);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(k=0;k<a.dataSeriesIndexes.length;k++){var l=a.dataSeriesIndexes[k],t=this.data[l],w=t.dataPoints;if(0<w.length){var v=5<r&&t.bevelEnabled?
|
|
337
|
+
!0:!1;c.strokeStyle="#4572A7 ";for(m=0;m<w.length;m++)if(b=w[m].x.getTime?w[m].x.getTime():w[m].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof w[m].y){n=a.axisX.convertValueToPixel(b);n=n-a.plotType.plotUnits.length*r/2+a.index*r<<0;var u=n+r<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0<w[m].y)d[b]=w[m].y+(d[b]?d[b]:0),0<d[b]&&(p=a.axisY.convertValueToPixel(d[b]),C="undefined"!==typeof h[b]?h[b]:q,h[b]=p);
|
|
338
|
+
else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=w[m].y)L[b]=w[m].y+(L[b]?L[b]:0),C=a.axisY.convertValueToPixel(L[b]),p="undefined"!==typeof e[b]?e[b]:q,e[b]=C;else if(p=a.axisY.convertValueToPixel(w[m].y),0<=w[m].y){var K="undefined"!==typeof h[b]?h[b]:0;p-=K;C=q-K;h[b]=K+(C-p)}else K=e[b]?e[b]:0,C=p+K,p=q+K,e[b]=K+(C-p);b=w[m].color?w[m].color:t._colorSet[m%t._colorSet.length];fa(c,n,a.axisY.reversed?C:p,u,a.axisY.reversed?p:C,b,0,null,v&&(a.axisY.reversed?0>w[m].y:0<=
|
|
339
|
+
w[m].y),(a.axisY.reversed?0<=w[m].y:0>w[m].y)&&v,!1,!1,t.fillOpacity);b=t.dataPointIds[m];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:m,x1:n,y1:p,x2:u,y2:C};b=W(b);s&&fa(this._eventManager.ghostCtx,n,p,u,C,b,0,null,!1,!1,!1,!1);(w[m].indexLabel||t.indexLabel||w[m].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn",dataPoint:w[m],dataSeries:t,point:{x:n+(u-n)/2,y:0<=w[m].y?p:C},direction:0>w[m].y===a.axisY.reversed?
|
|
340
|
+
1:-1,bounds:{x1:n,y1:Math.min(p,C),x2:u,y2:Math.max(p,C)},color:b})}}}s&&(f.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),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());
|
|
341
|
+
c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.yScaleAnimation,easingFunction:x.easing.easeOutQuart,animationBase:q<a.axisY.bounds.y1?a.axisY.bounds.y1:q>a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};u.prototype.renderStackedColumn100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=[],e=[],d=[],L=[],m=0,n,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),
|
|
342
|
+
m=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,k=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.width<<0,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&
|
|
343
|
+
m>k&&(m=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k<m)&&(k=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,m));r<m&&(r=m);r>k&&(r=k);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(k=0;k<a.dataSeriesIndexes.length;k++){var t=
|
|
344
|
+
a.dataSeriesIndexes[k],l=this.data[t],w=l.dataPoints;if(0<w.length)for(var v=5<r&&l.bevelEnabled?!0:!1,m=0;m<w.length;m++)if(b=w[m].x.getTime?w[m].x.getTime():w[m].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof w[m].y){n=a.axisX.convertValueToPixel(b);p=0!==a.dataPointYSums[b]?100*(w[m].y/a.dataPointYSums[b]):0;n=n-a.plotType.plotUnits.length*r/2+a.index*r<<0;var u=n+r<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
345
|
+
0<w[m].y){d[b]=p+("undefined"!==typeof d[b]?d[b]:0);if(0>=d[b])continue;p=a.axisY.convertValueToPixel(d[b]);C=h[b]?h[b]:q;h[b]=p}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=w[m].y)L[b]=p+("undefined"!==typeof L[b]?L[b]:0),C=a.axisY.convertValueToPixel(L[b]),p=e[b]?e[b]:q,e[b]=C;else if(p=a.axisY.convertValueToPixel(p),0<=w[m].y){var K="undefined"!==typeof h[b]?h[b]:0;p-=K;C=q-K;a.dataSeriesIndexes.length-1===k&&1>=Math.abs(g.y1-p)&&(p=g.y1);h[b]=K+(C-p)}else K="undefined"!==
|
|
346
|
+
typeof e[b]?e[b]:0,C=p+K,p=q+K,a.dataSeriesIndexes.length-1===k&&1>=Math.abs(g.y2-C)&&(C=g.y2),e[b]=K+(C-p);b=w[m].color?w[m].color:l._colorSet[m%l._colorSet.length];fa(c,n,a.axisY.reversed?C:p,u,a.axisY.reversed?p:C,b,0,null,v&&(a.axisY.reversed?0>w[m].y:0<=w[m].y),(a.axisY.reversed?0<=w[m].y:0>w[m].y)&&v,!1,!1,l.fillOpacity);b=l.dataPointIds[m];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:m,x1:n,y1:p,x2:u,y2:C};b=W(b);s&&fa(this._eventManager.ghostCtx,
|
|
347
|
+
n,p,u,C,b,0,null,!1,!1,!1,!1);(w[m].indexLabel||l.indexLabel||w[m].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedColumn100",dataPoint:w[m],dataSeries:l,point:{x:n+(u-n)/2,y:0<=w[m].y?p:C},direction:0>w[m].y===a.axisY.reversed?1:-1,bounds:{x1:n,y1:Math.min(p,C),x2:u,y2:Math.max(p,C)},color:b})}}s&&(f.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,
|
|
348
|
+
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),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.yScaleAnimation,easingFunction:x.easing.easeOutQuart,animationBase:q<a.axisY.bounds.y1?a.axisY.bounds.y1:q>a.axisY.bounds.y2?a.axisY.bounds.y2:q}}};u.prototype.renderBar=
|
|
349
|
+
function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=0,e,d,L,m=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,n=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<
|
|
350
|
+
0,p=a.axisX.dataInfo.minDiff;isFinite(p)||(p=0.3*Math.abs(a.axisX.range));p=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.height*(a.axisX.logarithmic?Math.log(p)/Math.log(a.axisX.range):Math.abs(p)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>n&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,n));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&n<h)&&(n=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));p<h&&(p=
|
|
351
|
+
h);p>n&&(p=n);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(n=0;n<a.dataSeriesIndexes.length;n++){var q=a.dataSeriesIndexes[n],k=this.data[q],r=k.dataPoints;if(0<r.length){var l=5<p&&k.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(h=0;h<r.length;h++)if(r[h].getTime?L=r[h].x.getTime():L=r[h].x,!(L<
|
|
352
|
+
a.axisX.dataInfo.viewPortMin||L>a.axisX.dataInfo.viewPortMax)&&"number"===typeof r[h].y){d=a.axisX.convertValueToPixel(L);e=a.axisY.convertValueToPixel(r[h].y);d=a.axisX.reversed?d+a.plotType.totalDataSeries*p/2-(a.previousDataSeriesCount+n)*p<<0:d-a.plotType.totalDataSeries*p/2+(a.previousDataSeriesCount+n)*p<<0;var t=a.axisX.reversed?d-p<<0:d+p<<0,w;0<=r[h].y?w=m:(w=e,e=m);b=r[h].color?r[h].color:k._colorSet[h%k._colorSet.length];fa(c,a.axisY.reversed?e:w,a.axisX.reversed?t:d,a.axisY.reversed?w:
|
|
353
|
+
e,a.axisX.reversed?d:t,b,0,null,l,!1,!1,!1,k.fillOpacity);b=k.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:w,y1:d,x2:e,y2:t};b=W(b);s&&fa(this._eventManager.ghostCtx,w,a.axisX.reversed?t:d,e,a.axisX.reversed?d:t,b,0,null,!1,!1,!1,!1);(r[h].indexLabel||k.indexLabel||r[h].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"bar",dataPoint:r[h],dataSeries:k,point:{x:0<=r[h].y?e:w,y:d+(t-d)/2},direction:0>
|
|
354
|
+
r[h].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(w,e),y1:d,x2:Math.max(w,e),y2:t},color:b})}}}s&&(f.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),c.clearRect(g.x1,g.y1,g.width,g.height),
|
|
355
|
+
this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xScaleAnimation,easingFunction:x.easing.easeOutQuart,animationBase:m<a.axisY.bounds.x1?a.axisY.bounds.x1:m>a.axisY.bounds.x2?a.axisY.bounds.x2:m}}};u.prototype.renderStackedBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=[],e=[],d=[],L=[],m=0,n,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?
|
|
356
|
+
a.axisY.viewportMinimum:0),m=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,k=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.height*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<
|
|
357
|
+
0;this.dataPointMaxWidth&&m>k&&(m=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k<m)&&(k=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,m));r<m&&(r=m);r>k&&(r=k);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());
|
|
358
|
+
for(k=0;k<a.dataSeriesIndexes.length;k++){var t=a.dataSeriesIndexes[k],l=this.data[t],w=l.dataPoints;if(0<w.length){var v=5<r&&l.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(m=0;m<w.length;m++)if(b=w[m].x.getTime?w[m].x.getTime():w[m].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof w[m].y){p=a.axisX.convertValueToPixel(b);p=p-a.plotType.plotUnits.length*r/2+a.index*r<<0;var u=p+r<<0,C;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
359
|
+
0<w[m].y)d[b]=w[m].y+(d[b]?d[b]:0),0<d[b]&&(C=h[b]?h[b]:q,h[b]=n=a.axisY.convertValueToPixel(d[b]));else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=w[m].y)L[b]=w[m].y+(L[b]?L[b]:0),n=e[b]?e[b]:q,e[b]=C=a.axisY.convertValueToPixel(L[b]);else if(n=a.axisY.convertValueToPixel(w[m].y),0<=w[m].y){var K=h[b]?h[b]:0;C=q+K;n+=K;h[b]=K+(n-C)}else K=e[b]?e[b]:0,C=n-K,n=q-K,e[b]=K+(n-C);b=w[m].color?w[m].color:l._colorSet[m%l._colorSet.length];fa(c,a.axisY.reversed?n:C,p,a.axisY.reversed?
|
|
360
|
+
C:n,u,b,0,null,v,!1,!1,!1,l.fillOpacity);b=l.dataPointIds[m];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:t,dataPointIndex:m,x1:C,y1:p,x2:n,y2:u};b=W(b);s&&fa(this._eventManager.ghostCtx,C,p,n,u,b,0,null,!1,!1,!1,!1);(w[m].indexLabel||l.indexLabel||w[m].indexLabelFormatter||l.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar",dataPoint:w[m],dataSeries:l,point:{x:0<=w[m].y?n:C,y:p+(u-p)/2},direction:0>w[m].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(C,
|
|
361
|
+
n),y1:p,x2:Math.max(C,n),y2:u},color:b})}}}s&&(f.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),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());c.restore();
|
|
362
|
+
return{source:f,dest:this.plotArea.ctx,animationCallback:x.xScaleAnimation,easingFunction:x.easing.easeOutQuart,animationBase:q<a.axisY.bounds.x1?a.axisY.bounds.x1:q>a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};u.prototype.renderStackedBar100=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=[],e=[],d=[],L=[],m=0,n,p,q=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),m=this.options.dataPointMinWidth?
|
|
363
|
+
this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,k=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.15*this.height<<0,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.height*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))/a.plotType.plotUnits.length)<<0;this.dataPointMaxWidth&&m>k&&(m=Math.min(this.options.dataPointWidth?
|
|
364
|
+
this.dataPointWidth:Infinity,k));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&k<m)&&(k=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,m));r<m&&(r=m);r>k&&(r=k);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(k=0;k<a.dataSeriesIndexes.length;k++){var l=a.dataSeriesIndexes[k],
|
|
365
|
+
t=this.data[l],w=t.dataPoints;if(0<w.length){var v=5<r&&t.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(m=0;m<w.length;m++)if(b=w[m].x.getTime?w[m].x.getTime():w[m].x,!(b<a.axisX.dataInfo.viewPortMin||b>a.axisX.dataInfo.viewPortMax)&&"number"===typeof w[m].y){p=a.axisX.convertValueToPixel(b);var u;u=0!==a.dataPointYSums[b]?100*(w[m].y/a.dataPointYSums[b]):0;p=p-a.plotType.plotUnits.length*r/2+a.index*r<<0;var C=p+r<<0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&
|
|
366
|
+
0<w[m].y){d[b]=u+(d[b]?d[b]:0);if(0>=d[b])continue;u=h[b]?h[b]:q;h[b]=n=a.axisY.convertValueToPixel(d[b])}else if(a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length&&0>=w[m].y)L[b]=u+(L[b]?L[b]:0),n=e[b]?e[b]:q,e[b]=u=a.axisY.convertValueToPixel(L[b]);else if(n=a.axisY.convertValueToPixel(u),0<=w[m].y){var K=h[b]?h[b]:0;u=q+K;n+=K;a.dataSeriesIndexes.length-1===k&&1>=Math.abs(g.x2-n)&&(n=g.x2);h[b]=K+(n-u)}else K=e[b]?e[b]:0,u=n-K,n=q-K,a.dataSeriesIndexes.length-1===k&&1>=Math.abs(g.x1-
|
|
367
|
+
u)&&(u=g.x1),e[b]=K+(n-u);b=w[m].color?w[m].color:t._colorSet[m%t._colorSet.length];fa(c,a.axisY.reversed?n:u,p,a.axisY.reversed?u:n,C,b,0,null,v,!1,!1,!1,t.fillOpacity);b=t.dataPointIds[m];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:m,x1:u,y1:p,x2:n,y2:C};b=W(b);s&&fa(this._eventManager.ghostCtx,u,p,n,C,b,0,null,!1,!1,!1,!1);(w[m].indexLabel||t.indexLabel||w[m].indexLabelFormatter||t.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedBar100",
|
|
368
|
+
dataPoint:w[m],dataSeries:t,point:{x:0<=w[m].y?n:u,y:p+(C-p)/2},direction:0>w[m].y===a.axisY.reversed?1:-1,bounds:{x1:Math.min(u,n),y1:p,x2:Math.max(u,n),y2:C},color:b})}}}s&&(f.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,
|
|
369
|
+
0,0,this.width,this.height),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.xScaleAnimation,easingFunction:x.easing.easeOutQuart,animationBase:q<a.axisY.bounds.x1?a.axisY.bounds.x1:q>a.axisY.bounds.x2?a.axisY.bounds.x2:q}}};u.prototype.renderArea=function(a){var f,c;function b(){K&&(0<k.lineThickness&&h.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?C=u:0>a.axisY.viewportMaximum?
|
|
370
|
+
C=d.y1:0<a.axisY.viewportMinimum&&(C=u),h.lineTo(v,C),h.lineTo(K.x,C),h.closePath(),h.globalAlpha=k.fillOpacity,h.fill(),h.globalAlpha=1,s&&(e.lineTo(v,C),e.lineTo(K.x,C),e.closePath(),e.fill()),h.beginPath(),h.moveTo(v,w),e.beginPath(),e.moveTo(v,w),K={x:v,y:w})}var g=a.targetCanvasCtx||this.plotArea.ctx,h=s?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,d=a.axisY.lineCoordinates,L=[],m=this.plotArea,n;h.save();s&&e.save();h.beginPath();h.rect(m.x1,m.y1,
|
|
371
|
+
m.width,m.height);h.clip();s&&(e.beginPath(),e.rect(m.x1,m.y1,m.width,m.height),e.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=a.dataSeriesIndexes[p],k=this.data[q],r=k.dataPoints,L=k.id;this._eventManager.objectMap[L]={objectType:"dataSeries",dataSeriesIndex:q};L=W(L);e.fillStyle=L;L=[];f=!0;var l=0,v,w,A,u=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),C,K=null;if(0<r.length){var D=k._colorSet[l%k._colorSet.length],y=k.lineColor=k.options.lineColor||D,
|
|
372
|
+
z=y;h.fillStyle=D;h.strokeStyle=y;h.lineWidth=k.lineThickness;c="solid";if(h.setLineDash){var Z=S(k.nullDataLineDashType,k.lineThickness);c=k.lineDashType;var X=S(c,k.lineThickness);h.setLineDash(X)}for(var ja=!0;l<r.length;l++)if(A=r[l].x.getTime?r[l].x.getTime():r[l].x,!(A<a.axisX.dataInfo.viewPortMin||A>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!ja)))if("number"!==typeof r[l].y)k.connectNullData||(ja||f)||b(),ja=!0;else{v=a.axisX.convertValueToPixel(A);w=a.axisY.convertValueToPixel(r[l].y);
|
|
373
|
+
f||ja?(!f&&k.connectNullData?(h.setLineDash&&(k.options.nullDataLineDashType||c===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(f=v,c=w,v=n.x,w=n.y,b(),h.moveTo(n.x,n.y),v=f,w=c,K=n,c=k.nullDataLineDashType,h.setLineDash(Z)),h.lineTo(v,w),s&&e.lineTo(v,w)):(h.beginPath(),h.moveTo(v,w),s&&(e.beginPath(),e.moveTo(v,w)),K={x:v,y:w}),ja=f=!1):(h.lineTo(v,w),s&&e.lineTo(v,w),0==l%250&&b());n={x:v,y:w};l<r.length-1&&(z!==(r[l].lineColor||y)||c!==(r[l].lineDashType||k.lineDashType))&&(b(),z=
|
|
374
|
+
r[l].lineColor||y,h.strokeStyle=z,h.setLineDash&&(r[l].lineDashType?(c=r[l].lineDashType,h.setLineDash(S(c,k.lineThickness))):(c=k.lineDashType,h.setLineDash(X))));var da=k.dataPointIds[l];this._eventManager.objectMap[da]={id:da,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:l,x1:v,y1:w};0!==r[l].markerSize&&(0<r[l].markerSize||0<k.markerSize)&&(A=k.getMarkerProperties(l,v,w,h),L.push(A),da=W(da),s&&L.push({x:v,y:w,ctx:e,type:A.type,size:A.size,color:da,borderColor:da,borderThickness:A.borderThickness}));
|
|
375
|
+
(r[l].indexLabel||k.indexLabel||r[l].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"area",dataPoint:r[l],dataSeries:k,point:{x:v,y:w},direction:0>r[l].y===a.axisY.reversed?1:-1,color:D})}b();t.drawMarkers(L)}}s&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&h.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&h.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),
|
|
376
|
+
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.clearRect(m.x1,m.y1,m.width,m.height),this._eventManager.ghostCtx.restore());h.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderSplineArea=function(a){function f(){var c=F(A,2);if(0<c.length){if(0<n.lineThickness){b.beginPath();b.moveTo(c[0].x,c[0].y);c[0].newStrokeStyle&&(b.strokeStyle=c[0].newStrokeStyle);
|
|
377
|
+
c[0].newLineDashArray&&b.setLineDash(c[0].newLineDashArray);for(var f=0;f<c.length-3;f+=3)if(b.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),s&&g.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),c[f+3].newStrokeStyle||c[f+3].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(c[f+3].x,c[f+3].y),c[f+3].newStrokeStyle&&(b.strokeStyle=c[f+3].newStrokeStyle),c[f+3].newLineDashArray&&b.setLineDash(c[f+3].newLineDashArray);b.stroke()}b.beginPath();b.moveTo(c[0].x,
|
|
378
|
+
c[0].y);s&&(g.beginPath(),g.moveTo(c[0].x,c[0].y));for(f=0;f<c.length-3;f+=3)b.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y),s&&g.bezierCurveTo(c[f+1].x,c[f+1].y,c[f+2].x,c[f+2].y,c[f+3].x,c[f+3].y);a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?v=l:0>a.axisY.viewportMaximum?v=h.y1:0<a.axisY.viewportMinimum&&(v=l);w={x:c[0].x,y:c[0].y};b.lineTo(c[c.length-1].x,v);b.lineTo(w.x,v);b.closePath();b.globalAlpha=n.fillOpacity;b.fill();b.globalAlpha=1;
|
|
379
|
+
s&&(g.lineTo(c[c.length-1].x,v),g.lineTo(w.x,v),g.closePath(),g.fill())}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=this._eventManager.ghostCtx,h=a.axisY.lineCoordinates,e=[],d=this.plotArea;b.save();s&&g.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();s&&(g.beginPath(),g.rect(d.x1,d.y1,d.width,d.height),g.clip());for(var L=0;L<a.dataSeriesIndexes.length;L++){var m=a.dataSeriesIndexes[L],n=this.data[m],p=n.dataPoints,
|
|
380
|
+
e=n.id;this._eventManager.objectMap[e]={objectType:"dataSeries",dataSeriesIndex:m};e=W(e);g.fillStyle=e;var e=[],q=0,k,r,l=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),v,w=null,A=[];if(0<p.length){var u=n._colorSet[q%n._colorSet.length],C=n.lineColor=n.options.lineColor||u,K=C;b.fillStyle=u;b.strokeStyle=C;b.lineWidth=n.lineThickness;var D="solid";if(b.setLineDash){var y=S(n.nullDataLineDashType,n.lineThickness),D=n.lineDashType,z=S(D,n.lineThickness);b.setLineDash(z)}for(r=
|
|
381
|
+
!1;q<p.length;q++)if(k=p[q].x.getTime?p[q].x.getTime():p[q].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!r)))if("number"!==typeof p[q].y)0<q&&!r&&(n.connectNullData?b.setLineDash&&(0<A.length&&(n.options.nullDataLineDashType||!p[q-1].lineDashType))&&(A[A.length-1].newLineDashArray=y,D=n.nullDataLineDashType):(f(),A=[])),r=!0;else{k=a.axisX.convertValueToPixel(k);r=a.axisY.convertValueToPixel(p[q].y);var Z=n.dataPointIds[q];this._eventManager.objectMap[Z]=
|
|
382
|
+
{id:Z,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:q,x1:k,y1:r};A[A.length]={x:k,y:r};q<p.length-1&&(K!==(p[q].lineColor||C)||D!==(p[q].lineDashType||n.lineDashType))&&(K=p[q].lineColor||C,A[A.length-1].newStrokeStyle=K,b.setLineDash&&(p[q].lineDashType?(D=p[q].lineDashType,A[A.length-1].newLineDashArray=S(D,n.lineThickness)):(D=n.lineDashType,A[A.length-1].newLineDashArray=z)));if(0!==p[q].markerSize&&(0<p[q].markerSize||0<n.markerSize)){var X=n.getMarkerProperties(q,k,r,b);e.push(X);
|
|
383
|
+
Z=W(Z);s&&e.push({x:k,y:r,ctx:g,type:X.type,size:X.size,color:Z,borderColor:Z,borderThickness:X.borderThickness})}(p[q].indexLabel||n.indexLabel||p[q].indexLabelFormatter||n.indexLabelFormatter)&&this._indexLabels.push({chartType:"splineArea",dataPoint:p[q],dataSeries:n,point:{x:k,y:r},direction:0>p[q].y===a.axisY.reversed?1:-1,color:u});r=!1}f();t.drawMarkers(e)}}s&&(c.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.globalCompositeOperation="source-atop",a.axisX.maskCanvas&&b.drawImage(a.axisX.maskCanvas,
|
|
384
|
+
0,0,this.width,this.height),a.axisY.maskCanvas&&b.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderStepArea=function(a){var f,c;function b(){K&&(0<k.lineThickness&&
|
|
385
|
+
h.stroke(),a.axisY.logarithmic||0>=a.axisY.viewportMinimum&&0<=a.axisY.viewportMaximum?C=u:0>a.axisY.viewportMaximum?C=d.y1:0<a.axisY.viewportMinimum&&(C=u),h.lineTo(v,C),h.lineTo(K.x,C),h.closePath(),h.globalAlpha=k.fillOpacity,h.fill(),h.globalAlpha=1,s&&(e.lineTo(v,C),e.lineTo(K.x,C),e.closePath(),e.fill()),h.beginPath(),h.moveTo(v,w),e.beginPath(),e.moveTo(v,w),K={x:v,y:w})}var g=a.targetCanvasCtx||this.plotArea.ctx,h=s?this._preRenderCtx:g;if(!(0>=a.dataSeriesIndexes.length)){var e=this._eventManager.ghostCtx,
|
|
386
|
+
d=a.axisY.lineCoordinates,L=[],m=this.plotArea,n;h.save();s&&e.save();h.beginPath();h.rect(m.x1,m.y1,m.width,m.height);h.clip();s&&(e.beginPath(),e.rect(m.x1,m.y1,m.width,m.height),e.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=a.dataSeriesIndexes[p],k=this.data[q],r=k.dataPoints,L=k.id;this._eventManager.objectMap[L]={objectType:"dataSeries",dataSeriesIndex:q};L=W(L);e.fillStyle=L;L=[];f=!0;var l=0,v,w,A,u=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),
|
|
387
|
+
C,K=null;c=!1;if(0<r.length){var D=k._colorSet[l%k._colorSet.length],y=k.lineColor=k.options.lineColor||D,z=y;h.fillStyle=D;h.strokeStyle=y;h.lineWidth=k.lineThickness;var Z="solid";if(h.setLineDash){var X=S(k.nullDataLineDashType,k.lineThickness),Z=k.lineDashType,ja=S(Z,k.lineThickness);h.setLineDash(ja)}for(;l<r.length;l++)if(A=r[l].x.getTime?r[l].x.getTime():r[l].x,!(A<a.axisX.dataInfo.viewPortMin||A>a.axisX.dataInfo.viewPortMax&&(!k.connectNullData||!c))){var da=w;"number"!==typeof r[l].y?(k.connectNullData||
|
|
388
|
+
(c||f)||b(),c=!0):(v=a.axisX.convertValueToPixel(A),w=a.axisY.convertValueToPixel(r[l].y),f||c?(!f&&k.connectNullData?(h.setLineDash&&(k.options.nullDataLineDashType||Z===k.lineDashType&&k.lineDashType!==k.nullDataLineDashType)&&(f=v,c=w,v=n.x,w=n.y,b(),h.moveTo(n.x,n.y),v=f,w=c,K=n,Z=k.nullDataLineDashType,h.setLineDash(X)),h.lineTo(v,da),h.lineTo(v,w),s&&(e.lineTo(v,da),e.lineTo(v,w))):(h.beginPath(),h.moveTo(v,w),s&&(e.beginPath(),e.moveTo(v,w)),K={x:v,y:w}),c=f=!1):(h.lineTo(v,da),s&&e.lineTo(v,
|
|
389
|
+
da),h.lineTo(v,w),s&&e.lineTo(v,w),0==l%250&&b()),n={x:v,y:w},l<r.length-1&&(z!==(r[l].lineColor||y)||Z!==(r[l].lineDashType||k.lineDashType))&&(b(),z=r[l].lineColor||y,h.strokeStyle=z,h.setLineDash&&(r[l].lineDashType?(Z=r[l].lineDashType,h.setLineDash(S(Z,k.lineThickness))):(Z=k.lineDashType,h.setLineDash(ja)))),A=k.dataPointIds[l],this._eventManager.objectMap[A]={id:A,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:l,x1:v,y1:w},0!==r[l].markerSize&&(0<r[l].markerSize||0<k.markerSize)&&
|
|
390
|
+
(da=k.getMarkerProperties(l,v,w,h),L.push(da),A=W(A),s&&L.push({x:v,y:w,ctx:e,type:da.type,size:da.size,color:A,borderColor:A,borderThickness:da.borderThickness})),(r[l].indexLabel||k.indexLabel||r[l].indexLabelFormatter||k.indexLabelFormatter)&&this._indexLabels.push({chartType:"stepArea",dataPoint:r[l],dataSeries:k,point:{x:v,y:w},direction:0>r[l].y===a.axisY.reversed?1:-1,color:D}))}b();t.drawMarkers(L)}}s&&(g.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.globalCompositeOperation=
|
|
391
|
+
"source-atop",a.axisX.maskCanvas&&h.drawImage(a.axisX.maskCanvas,0,0,this.width,this.height),a.axisY.maskCanvas&&h.drawImage(a.axisY.maskCanvas,0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),h.clearRect(m.x1,m.y1,m.width,m.height),this._eventManager.ghostCtx.restore());h.restore();return{source:g,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderStackedArea=
|
|
392
|
+
function(a){function f(){if(!(1>m.length)){for(0<D.lineThickness&&b.stroke();0<m.length;){var a=m.pop();b.lineTo(a.x,a.y);s&&u.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();s&&(u.closePath(),u.fill(),u.beginPath());m=[]}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=null,h=null,e=[],d=this.plotArea,l=[],m=[],n=[],p=[],q=0,k,r,v=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:
|
|
393
|
+
0),u=this._eventManager.ghostCtx,w,A,Q;s&&u.beginPath();b.save();s&&u.save();b.beginPath();b.rect(d.x1,d.y1,d.width,d.height);b.clip();s&&(u.beginPath(),u.rect(d.x1,d.y1,d.width,d.height),u.clip());for(var g=[],C=0;C<a.dataSeriesIndexes.length;C++){var K=a.dataSeriesIndexes[C],D=this.data[K],y=D.dataPoints;D.dataPointIndexes=[];for(q=0;q<y.length;q++)K=y[q].x.getTime?y[q].x.getTime():y[q].x,D.dataPointIndexes[K]=q,g[K]||(n.push(K),g[K]=!0);n.sort(Xa)}for(C=0;C<a.dataSeriesIndexes.length;C++){K=a.dataSeriesIndexes[C];
|
|
394
|
+
D=this.data[K];y=D.dataPoints;A=!0;m=[];q=D.id;this._eventManager.objectMap[q]={objectType:"dataSeries",dataSeriesIndex:K};q=W(q);u.fillStyle=q;if(0<n.length){var g=D._colorSet[0],z=D.lineColor=D.options.lineColor||g,Z=z;b.fillStyle=g;b.strokeStyle=z;b.lineWidth=D.lineThickness;Q="solid";if(b.setLineDash){var X=S(D.nullDataLineDashType,D.lineThickness);Q=D.lineDashType;var ja=S(Q,D.lineThickness);b.setLineDash(ja)}for(var da=!0,q=0;q<n.length;q++){var h=n[q],ma=null,ma=0<=D.dataPointIndexes[h]?y[D.dataPointIndexes[h]]:
|
|
395
|
+
{x:h,y:null};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax&&(!D.connectNullData||!da)))if("number"!==typeof ma.y)D.connectNullData||(da||A)||f(),da=!0;else{k=a.axisX.convertValueToPixel(h);var va=l[h]?l[h]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){p[h]=ma.y+(p[h]?p[h]:0);if(0>=p[h]&&a.axisY.logarithmic)continue;r=a.axisY.convertValueToPixel(p[h])}else r=a.axisY.convertValueToPixel(ma.y),r-=va;m.push({x:k,y:v-va});l[h]=v-r;A||
|
|
396
|
+
da?(!A&&D.connectNullData?(b.setLineDash&&(D.options.nullDataLineDashType||Q===D.lineDashType&&D.lineDashType!==D.nullDataLineDashType)&&(A=m.pop(),Q=m[m.length-1],f(),b.moveTo(w.x,w.y),m.push(Q),m.push(A),Q=D.nullDataLineDashType,b.setLineDash(X)),b.lineTo(k,r),s&&u.lineTo(k,r)):(b.beginPath(),b.moveTo(k,r),s&&(u.beginPath(),u.moveTo(k,r))),da=A=!1):(b.lineTo(k,r),s&&u.lineTo(k,r),0==q%250&&(f(),b.moveTo(k,r),s&&u.moveTo(k,r),m.push({x:k,y:v-va})));w={x:k,y:r};q<y.length-1&&(Z!==(y[q].lineColor||
|
|
397
|
+
z)||Q!==(y[q].lineDashType||D.lineDashType))&&(f(),b.beginPath(),b.moveTo(k,r),m.push({x:k,y:v-va}),Z=y[q].lineColor||z,b.strokeStyle=Z,b.setLineDash&&(y[q].lineDashType?(Q=y[q].lineDashType,b.setLineDash(S(Q,D.lineThickness))):(Q=D.lineDashType,b.setLineDash(ja))));if(0<=D.dataPointIndexes[h]){var E=D.dataPointIds[D.dataPointIndexes[h]];this._eventManager.objectMap[E]={id:E,objectType:"dataPoint",dataSeriesIndex:K,dataPointIndex:D.dataPointIndexes[h],x1:k,y1:r}}0<=D.dataPointIndexes[h]&&0!==ma.markerSize&&
|
|
398
|
+
(0<ma.markerSize||0<D.markerSize)&&(va=D.getMarkerProperties(D.dataPointIndexes[h],k,r,b),e.push(va),h=W(E),s&&e.push({x:k,y:r,ctx:u,type:va.type,size:va.size,color:h,borderColor:h,borderThickness:va.borderThickness}));(ma.indexLabel||D.indexLabel||ma.indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea",dataPoint:ma,dataSeries:D,point:{x:k,y:r},direction:0>y[q].y===a.axisY.reversed?1:-1,color:g})}}f();b.moveTo(k,r);s&&u.moveTo(k,r)}delete D.dataPointIndexes}t.drawMarkers(e);
|
|
399
|
+
s&&(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&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(d.x1,d.y1,d.width,d.height),u.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,
|
|
400
|
+
easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderStackedArea100=function(a){function f(){for(0<D.lineThickness&&b.stroke();0<m.length;){var a=m.pop();b.lineTo(a.x,a.y);s&&Q.lineTo(a.x,a.y)}b.closePath();b.globalAlpha=D.fillOpacity;b.fill();b.globalAlpha=1;b.beginPath();s&&(Q.closePath(),Q.fill(),Q.beginPath());m=[]}var c=a.targetCanvasCtx||this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=null,h=null,e=this.plotArea,d=[],l=[],m=[],n=[],p=[],q=
|
|
401
|
+
0,k,r,v,u,w,A=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),Q=this._eventManager.ghostCtx;b.save();s&&Q.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();s&&(Q.beginPath(),Q.rect(e.x1,e.y1,e.width,e.height),Q.clip());for(var g=[],C=0;C<a.dataSeriesIndexes.length;C++){var K=a.dataSeriesIndexes[C],D=this.data[K],y=D.dataPoints;D.dataPointIndexes=[];for(q=0;q<y.length;q++)K=y[q].x.getTime?y[q].x.getTime():y[q].x,D.dataPointIndexes[K]=q,g[K]||(n.push(K),g[K]=
|
|
402
|
+
!0);n.sort(Xa)}for(C=0;C<a.dataSeriesIndexes.length;C++){K=a.dataSeriesIndexes[C];D=this.data[K];y=D.dataPoints;u=!0;g=D.id;this._eventManager.objectMap[g]={objectType:"dataSeries",dataSeriesIndex:K};g=W(g);Q.fillStyle=g;m=[];if(0<n.length){var g=D._colorSet[q%D._colorSet.length],z=D.lineColor=D.options.lineColor||g,Z=z;b.fillStyle=g;b.strokeStyle=z;b.lineWidth=D.lineThickness;w="solid";if(b.setLineDash){var X=S(D.nullDataLineDashType,D.lineThickness);w=D.lineDashType;var E=S(w,D.lineThickness);b.setLineDash(E)}for(var da=
|
|
403
|
+
!0,q=0;q<n.length;q++){var h=n[q],ma=null,ma=0<=D.dataPointIndexes[h]?y[D.dataPointIndexes[h]]:{x:h,y:null};if(!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax&&(!D.connectNullData||!da)))if("number"!==typeof ma.y)D.connectNullData||(da||u)||f(),da=!0;else{var va;va=0!==a.dataPointYSums[h]?100*(ma.y/a.dataPointYSums[h]):0;k=a.axisX.convertValueToPixel(h);var ra=l[h]?l[h]:0;if(a.axisY.logarithmic||a.axisY.scaleBreaks&&0<a.axisY.scaleBreaks._appliedBreaks.length){p[h]=va+(p[h]?p[h]:
|
|
404
|
+
0);if(0>=p[h]&&a.axisY.logarithmic)continue;r=a.axisY.convertValueToPixel(p[h])}else r=a.axisY.convertValueToPixel(va),r-=ra;m.push({x:k,y:A-ra});l[h]=A-r;u||da?(!u&&D.connectNullData?(b.setLineDash&&(D.options.nullDataLineDashType||w===D.lineDashType&&D.lineDashType!==D.nullDataLineDashType)&&(u=m.pop(),w=m[m.length-1],f(),b.moveTo(v.x,v.y),m.push(w),m.push(u),w=D.nullDataLineDashType,b.setLineDash(X)),b.lineTo(k,r),s&&Q.lineTo(k,r)):(b.beginPath(),b.moveTo(k,r),s&&(Q.beginPath(),Q.moveTo(k,r))),
|
|
405
|
+
da=u=!1):(b.lineTo(k,r),s&&Q.lineTo(k,r),0==q%250&&(f(),b.moveTo(k,r),s&&Q.moveTo(k,r),m.push({x:k,y:A-ra})));v={x:k,y:r};q<y.length-1&&(Z!==(y[q].lineColor||z)||w!==(y[q].lineDashType||D.lineDashType))&&(f(),b.beginPath(),b.moveTo(k,r),m.push({x:k,y:A-ra}),Z=y[q].lineColor||z,b.strokeStyle=Z,b.setLineDash&&(y[q].lineDashType?(w=y[q].lineDashType,b.setLineDash(S(w,D.lineThickness))):(w=D.lineDashType,b.setLineDash(E))));if(0<=D.dataPointIndexes[h]){var G=D.dataPointIds[D.dataPointIndexes[h]];this._eventManager.objectMap[G]=
|
|
406
|
+
{id:G,objectType:"dataPoint",dataSeriesIndex:K,dataPointIndex:D.dataPointIndexes[h],x1:k,y1:r}}0<=D.dataPointIndexes[h]&&0!==ma.markerSize&&(0<ma.markerSize||0<D.markerSize)&&(ra=D.getMarkerProperties(q,k,r,b),d.push(ra),h=W(G),s&&d.push({x:k,y:r,ctx:Q,type:ra.type,size:ra.size,color:h,borderColor:h,borderThickness:ra.borderThickness}));(ma.indexLabel||D.indexLabel||ma.indexLabelFormatter||D.indexLabelFormatter)&&this._indexLabels.push({chartType:"stackedArea100",dataPoint:ma,dataSeries:D,point:{x:k,
|
|
407
|
+
y:r},direction:0>y[q].y===a.axisY.reversed?1:-1,color:g})}}f();b.moveTo(k,r);s&&Q.moveTo(k,r)}delete D.dataPointIndexes}t.drawMarkers(d);s&&(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&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),
|
|
408
|
+
b.clearRect(e.x1,e.y1,e.width,e.height),Q.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderBubble=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,g=0,h,e;c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),
|
|
409
|
+
this._eventManager.ghostCtx.rect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=-Infinity,l=Infinity,m=0;m<a.dataSeriesIndexes.length;m++)for(var n=a.dataSeriesIndexes[m],p=this.data[n],q=p.dataPoints,k=0,g=0;g<q.length;g++)h=q[g].getTime?h=q[g].x.getTime():h=q[g].x,h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax||"undefined"===typeof q[g].z||(k=q[g].z,k>d&&(d=k),k<l&&(l=k));for(var r=25*Math.PI,v=Math.max(Math.pow(0.25*Math.min(b.height,b.width)/2,2)*Math.PI,
|
|
410
|
+
r),m=0;m<a.dataSeriesIndexes.length;m++)if(n=a.dataSeriesIndexes[m],p=this.data[n],q=p.dataPoints,0<q.length)for(c.strokeStyle="#4572A7 ",g=0;g<q.length;g++)if(h=q[g].getTime?h=q[g].x.getTime():h=q[g].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof q[g].y){h=a.axisX.convertValueToPixel(h);e=a.axisY.convertValueToPixel(q[g].y);var k=q[g].z,u=2*Math.max(Math.sqrt((d===l?v/2:r+(v-r)/(d-l)*(k-l))/Math.PI)<<0,1),k=p.getMarkerProperties(g,c);k.size=u;c.globalAlpha=
|
|
411
|
+
p.fillOpacity;t.drawMarker(h,e,c,k.type,k.size,k.color,k.borderColor,k.borderThickness);c.globalAlpha=1;var w=p.dataPointIds[g];this._eventManager.objectMap[w]={id:w,objectType:"dataPoint",dataSeriesIndex:n,dataPointIndex:g,x1:h,y1:e,size:u};u=W(w);s&&t.drawMarker(h,e,this._eventManager.ghostCtx,k.type,k.size,u,u,k.borderThickness);(q[g].indexLabel||p.indexLabel||q[g].indexLabelFormatter||p.indexLabelFormatter)&&this._indexLabels.push({chartType:"bubble",dataPoint:q[g],dataSeries:p,point:{x:h,y:e},
|
|
412
|
+
direction:1,bounds:{x1:h-k.size/2,y1:e-k.size/2,x2:h+k.size/2,y2:e+k.size/2},color:null})}s&&(f.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),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());
|
|
413
|
+
c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};u.prototype.renderScatter=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this.plotArea,g=0,h,e;c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(b.x1,b.y1,b.width,b.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(b.x1,b.y1,
|
|
414
|
+
b.width,b.height),this._eventManager.ghostCtx.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var l=a.dataSeriesIndexes[d],m=this.data[l],n=m.dataPoints;if(0<n.length){c.strokeStyle="#4572A7 ";Math.pow(0.3*Math.min(b.height,b.width)/2,2);for(var p=0,q=0,g=0;g<n.length;g++)if(h=n[g].getTime?h=n[g].x.getTime():h=n[g].x,!(h<a.axisX.dataInfo.viewPortMin||h>a.axisX.dataInfo.viewPortMax)&&"number"===typeof n[g].y){h=a.axisX.convertValueToPixel(h);e=a.axisY.convertValueToPixel(n[g].y);var k=m.getMarkerProperties(g,
|
|
415
|
+
h,e,c);c.globalAlpha=m.fillOpacity;t.drawMarker(k.x,k.y,k.ctx,k.type,k.size,k.color,k.borderColor,k.borderThickness);c.globalAlpha=1;Math.sqrt((p-h)*(p-h)+(q-e)*(q-e))<Math.min(k.size,5)&&n.length>Math.min(this.plotArea.width,this.plotArea.height)||(p=m.dataPointIds[g],this._eventManager.objectMap[p]={id:p,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:g,x1:h,y1:e},p=W(p),s&&t.drawMarker(k.x,k.y,this._eventManager.ghostCtx,k.type,k.size,p,p,k.borderThickness),(n[g].indexLabel||m.indexLabel||
|
|
416
|
+
n[g].indexLabelFormatter||m.indexLabelFormatter)&&this._indexLabels.push({chartType:"scatter",dataPoint:n[g],dataSeries:m,point:{x:h,y:e},direction:1,bounds:{x1:h-k.size/2,y1:e-k.size/2,x2:h+k.size/2,y2:e+k.size/2},color:null}),p=h,q=e)}}}s&&(f.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),
|
|
417
|
+
this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(b.x1,b.y1,b.width,b.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};u.prototype.renderCandlestick=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var g=
|
|
418
|
+
null,h=null,d=this.plotArea,l=0,v,m,n,p,q,k,g=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,h=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,r=a.axisX.dataInfo.minDiff;isFinite(r)||(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.7*d.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))<<0;
|
|
419
|
+
this.dataPointMaxWidth&&g>h&&(g=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,h));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&h<g)&&(h=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,g));r<g&&(r=g);r>h&&(r=h);c.save();s&&b.save();c.beginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();s&&(b.beginPath(),b.rect(d.x1,d.y1,d.width,d.height),b.clip());for(var t=0;t<a.dataSeriesIndexes.length;t++){var u=a.dataSeriesIndexes[t],w=this.data[u],A=w.dataPoints;
|
|
420
|
+
if(0<A.length)for(var Q=5<r&&w.bevelEnabled?!0:!1,l=0;l<A.length;l++)if(A[l].getTime?k=A[l].x.getTime():k=A[l].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&!e(A[l].y)&&A[l].y.length&&"number"===typeof A[l].y[0]&&"number"===typeof A[l].y[1]&&"number"===typeof A[l].y[2]&&"number"===typeof A[l].y[3]){v=a.axisX.convertValueToPixel(k);m=a.axisY.convertValueToPixel(A[l].y[0]);n=a.axisY.convertValueToPixel(A[l].y[1]);p=a.axisY.convertValueToPixel(A[l].y[2]);q=a.axisY.convertValueToPixel(A[l].y[3]);
|
|
421
|
+
var C=v-r/2<<0,K=C+r<<0,h=w.options.fallingColor?w.fallingColor:w._colorSet[0],g=A[l].color?A[l].color:w._colorSet[0],D=Math.round(Math.max(1,0.15*r)),y=0===D%2?0:0.5,z=w.dataPointIds[l];this._eventManager.objectMap[z]={id:z,objectType:"dataPoint",dataSeriesIndex:u,dataPointIndex:l,x1:C,y1:m,x2:K,y2:n,x3:v,y3:p,x4:v,y4:q,borderThickness:D,color:g};c.strokeStyle=g;c.beginPath();c.lineWidth=D;b.lineWidth=Math.max(D,4);"candlestick"===w.type?(c.moveTo(v-y,n),c.lineTo(v-y,Math.min(m,q)),c.stroke(),c.moveTo(v-
|
|
422
|
+
y,Math.max(m,q)),c.lineTo(v-y,p),c.stroke(),fa(c,C,Math.min(m,q),K,Math.max(m,q),A[l].y[0]<=A[l].y[3]?w.risingColor:h,D,g,Q,Q,!1,!1,w.fillOpacity),s&&(g=W(z),b.strokeStyle=g,b.moveTo(v-y,n),b.lineTo(v-y,Math.min(m,q)),b.stroke(),b.moveTo(v-y,Math.max(m,q)),b.lineTo(v-y,p),b.stroke(),fa(b,C,Math.min(m,q),K,Math.max(m,q),g,0,null,!1,!1,!1,!1))):"ohlc"===w.type&&(c.moveTo(v-y,n),c.lineTo(v-y,p),c.stroke(),c.beginPath(),c.moveTo(v,m),c.lineTo(C,m),c.stroke(),c.beginPath(),c.moveTo(v,q),c.lineTo(K,q),
|
|
423
|
+
c.stroke(),s&&(g=W(z),b.strokeStyle=g,b.moveTo(v-y,n),b.lineTo(v-y,p),b.stroke(),b.beginPath(),b.moveTo(v,m),b.lineTo(C,m),b.stroke(),b.beginPath(),b.moveTo(v,q),b.lineTo(K,q),b.stroke()));(A[l].indexLabel||w.indexLabel||A[l].indexLabelFormatter||w.indexLabelFormatter)&&this._indexLabels.push({chartType:w.type,dataPoint:A[l],dataSeries:w,point:{x:C+(K-C)/2,y:a.axisY.reversed?p:n},direction:1,bounds:{x1:C,y1:Math.min(n,p),x2:K,y2:Math.max(n,p)},color:g})}}s&&(f.drawImage(this._preRenderCanvas,0,0,
|
|
424
|
+
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),c.clearRect(d.x1,d.y1,d.width,d.height),b.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,
|
|
425
|
+
animationBase:0}}};u.prototype.renderBoxAndWhisker=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f,b=this._eventManager.ghostCtx;if(!(0>=a.dataSeriesIndexes.length)){var g=null,h=this.plotArea,d=0,l,v,m,n,p,q,k,g=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1,d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.015*this.width,r=a.axisX.dataInfo.minDiff;isFinite(r)||
|
|
426
|
+
(r=0.3*Math.abs(a.axisX.range));r=this.options.dataPointWidth?this.dataPointWidth:0.7*h.width*(a.axisX.logarithmic?Math.log(r)/Math.log(a.axisX.range):Math.abs(r)/Math.abs(a.axisX.range))<<0;this.dataPointMaxWidth&&g>d&&(g=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,d));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&d<g)&&(d=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,g));r<g&&(r=g);r>d&&(r=d);c.save();s&&b.save();c.beginPath();c.rect(h.x1,h.y1,h.width,
|
|
427
|
+
h.height);c.clip();s&&(b.beginPath(),b.rect(h.x1,h.y1,h.width,h.height),b.clip());for(var t=!1,t=!!a.axisY.reversed,u=0;u<a.dataSeriesIndexes.length;u++){var w=a.dataSeriesIndexes[u],A=this.data[w],Q=A.dataPoints;if(0<Q.length)for(var C=5<r&&A.bevelEnabled?!0:!1,d=0;d<Q.length;d++)if(Q[d].getTime?k=Q[d].x.getTime():k=Q[d].x,!(k<a.axisX.dataInfo.viewPortMin||k>a.axisX.dataInfo.viewPortMax)&&!e(Q[d].y)&&Q[d].y.length&&"number"===typeof Q[d].y[0]&&"number"===typeof Q[d].y[1]&&"number"===typeof Q[d].y[2]&&
|
|
428
|
+
"number"===typeof Q[d].y[3]&&"number"===typeof Q[d].y[4]&&5===Q[d].y.length){l=a.axisX.convertValueToPixel(k);v=a.axisY.convertValueToPixel(Q[d].y[0]);m=a.axisY.convertValueToPixel(Q[d].y[1]);n=a.axisY.convertValueToPixel(Q[d].y[2]);p=a.axisY.convertValueToPixel(Q[d].y[3]);q=a.axisY.convertValueToPixel(Q[d].y[4]);var y=l-r/2<<0,D=l+r/2<<0,g=Q[d].color?Q[d].color:A._colorSet[0],z=Math.round(Math.max(1,0.15*r)),E=0===z%2?0:0.5,Z=Q[d].whiskerColor?Q[d].whiskerColor:Q[d].color?A.whiskerColor?A.whiskerColor:
|
|
429
|
+
Q[d].color:A.whiskerColor?A.whiskerColor:g,X="number"===typeof Q[d].whiskerThickness?Q[d].whiskerThickness:"number"===typeof A.options.whiskerThickness?A.whiskerThickness:z,ja=Q[d].whiskerDashType?Q[d].whiskerDashType:A.whiskerDashType,da=e(Q[d].whiskerLength)?e(A.options.whiskerLength)?r:A.whiskerLength:Q[d].whiskerLength,da="number"===typeof da?0>=da?0:da>=r?r:da:"string"===typeof da?parseInt(da)*r/100>r?r:parseInt(da)*r/100:r,ma=1===Math.round(X)%2?0.5:0,va=Q[d].stemColor?Q[d].stemColor:Q[d].color?
|
|
430
|
+
A.stemColor?A.stemColor:Q[d].color:A.stemColor?A.stemColor:g,ra="number"===typeof Q[d].stemThickness?Q[d].stemThickness:"number"===typeof A.options.stemThickness?A.stemThickness:z,G=1===Math.round(ra)%2?0.5:0,F=Q[d].stemDashType?Q[d].stemDashType:A.stemDashType,I=Q[d].lineColor?Q[d].lineColor:Q[d].color?A.lineColor?A.lineColor:Q[d].color:A.lineColor?A.lineColor:g,J="number"===typeof Q[d].lineThickness?Q[d].lineThickness:"number"===typeof A.options.lineThickness?A.lineThickness:z,R=Q[d].lineDashType?
|
|
431
|
+
Q[d].lineDashType:A.lineDashType,U=1===Math.round(J)%2?0.5:0,O=A.upperBoxColor,M=A.lowerBoxColor,N=e(A.options.fillOpacity)?1:A.fillOpacity,V=A.dataPointIds[d];this._eventManager.objectMap[V]={id:V,objectType:"dataPoint",dataSeriesIndex:w,dataPointIndex:d,x1:y,y1:v,x2:D,y2:m,x3:l,y3:n,x4:l,y4:p,y5:q,borderThickness:z,color:g,stemThickness:ra,stemColor:va,whiskerThickness:X,whiskerLength:da,whiskerColor:Z,lineThickness:J,lineColor:I};c.save();0<ra&&(c.beginPath(),c.strokeStyle=va,c.lineWidth=ra,c.setLineDash&&
|
|
432
|
+
c.setLineDash(S(F,ra)),c.moveTo(l-G,m),c.lineTo(l-G,v),c.stroke(),c.moveTo(l-G,p),c.lineTo(l-G,n),c.stroke());c.restore();b.lineWidth=Math.max(z,4);c.beginPath();fa(c,y,Math.min(q,m),D,Math.max(m,q),M,0,g,t?C:!1,t?!1:C,!1,!1,N);c.beginPath();fa(c,y,Math.min(n,q),D,Math.max(q,n),O,0,g,t?!1:C,t?C:!1,!1,!1,N);c.beginPath();c.lineWidth=z;c.strokeStyle=g;c.rect(y-E,Math.min(m,n)-E,D-y+2*E,Math.max(m,n)-Math.min(m,n)+2*E);c.stroke();c.save();0<J&&(c.beginPath(),c.globalAlpha=1,c.setLineDash&&c.setLineDash(S(R,
|
|
433
|
+
J)),c.strokeStyle=I,c.lineWidth=J,c.moveTo(y,q-U),c.lineTo(D,q-U),c.stroke());c.restore();c.save();0<X&&(c.beginPath(),c.setLineDash&&c.setLineDash(S(ja,X)),c.strokeStyle=Z,c.lineWidth=X,c.moveTo(l-da/2<<0,p-ma),c.lineTo(l+da/2<<0,p-ma),c.stroke(),c.moveTo(l-da/2<<0,v+ma),c.lineTo(l+da/2<<0,v+ma),c.stroke());c.restore();s&&(g=W(V),b.strokeStyle=g,b.lineWidth=ra,0<ra&&(b.moveTo(l-E-G,m),b.lineTo(l-E-G,Math.max(v,p)),b.stroke(),b.moveTo(l-E-G,Math.min(v,p)),b.lineTo(l-E-G,n),b.stroke()),fa(b,y,Math.max(m,
|
|
434
|
+
n),D,Math.min(m,n),g,0,null,!1,!1,!1,!1),0<X&&(b.beginPath(),b.lineWidth=X,b.moveTo(l+da/2,p-ma),b.lineTo(l-da/2,p-ma),b.stroke(),b.moveTo(l+da/2,v+ma),b.lineTo(l-da/2,v+ma),b.stroke()));(Q[d].indexLabel||A.indexLabel||Q[d].indexLabelFormatter||A.indexLabelFormatter)&&this._indexLabels.push({chartType:A.type,dataPoint:Q[d],dataSeries:A,point:{x:y+(D-y)/2,y:a.axisY.reversed?v:p},direction:1,bounds:{x1:y,y1:Math.min(v,p),x2:D,y2:Math.max(v,p)},color:g})}}s&&(f.drawImage(this._preRenderCanvas,0,0,this.width,
|
|
435
|
+
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),c.clearRect(h.x1,h.y1,h.width,h.height),b.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};
|
|
436
|
+
u.prototype.renderRangeColumn=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=0,d,l,v,h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:0.03*this.width;var m=a.axisX.dataInfo.minDiff;isFinite(m)||(m=0.3*Math.abs(a.axisX.range));m=this.options.dataPointWidth?
|
|
437
|
+
this.dataPointWidth:0.9*(g.width*(a.axisX.logarithmic?Math.log(m)/Math.log(a.axisX.range):Math.abs(m)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>d&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,d));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&d<h)&&(d=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));m<h&&(m=h);m>d&&(m=d);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);
|
|
438
|
+
c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var n=0;n<a.dataSeriesIndexes.length;n++){var p=a.dataSeriesIndexes[n],q=this.data[p],k=q.dataPoints;if(0<k.length)for(var r=5<m&&q.bevelEnabled?!0:!1,h=0;h<k.length;h++)if(k[h].getTime?v=k[h].x.getTime():v=k[h].x,!(v<a.axisX.dataInfo.viewPortMin||v>a.axisX.dataInfo.viewPortMax)&&!e(k[h].y)&&k[h].y.length&&"number"===typeof k[h].y[0]&&"number"===
|
|
439
|
+
typeof k[h].y[1]){b=a.axisX.convertValueToPixel(v);d=a.axisY.convertValueToPixel(k[h].y[0]);l=a.axisY.convertValueToPixel(k[h].y[1]);var t=a.axisX.reversed?b+a.plotType.totalDataSeries*m/2-(a.previousDataSeriesCount+n)*m<<0:b-a.plotType.totalDataSeries*m/2+(a.previousDataSeriesCount+n)*m<<0,u=a.axisX.reversed?t-m<<0:t+m<<0,b=k[h].color?k[h].color:q._colorSet[h%q._colorSet.length];if(d>l){var w=d;d=l;l=w}w=q.dataPointIds[h];this._eventManager.objectMap[w]={id:w,objectType:"dataPoint",dataSeriesIndex:p,
|
|
440
|
+
dataPointIndex:h,x1:t,y1:d,x2:u,y2:l};fa(c,a.axisX.reversed?u:t,d,a.axisX.reversed?t:u,l,b,0,b,r,r,!1,!1,q.fillOpacity);b=W(w);s&&fa(this._eventManager.ghostCtx,a.axisX.reversed?u:t,d,a.axisX.reversed?t:u,l,b,0,null,!1,!1,!1,!1);if(k[h].indexLabel||q.indexLabel||k[h].indexLabelFormatter||q.indexLabelFormatter)this._indexLabels.push({chartType:"rangeColumn",dataPoint:k[h],dataSeries:q,indexKeyword:0,point:{x:t+(u-t)/2,y:k[h].y[1]>=k[h].y[0]?l:d},direction:k[h].y[1]>=k[h].y[0]?-1:1,bounds:{x1:t,y1:Math.min(d,
|
|
441
|
+
l),x2:u,y2:Math.max(d,l)},color:b}),this._indexLabels.push({chartType:"rangeColumn",dataPoint:k[h],dataSeries:q,indexKeyword:1,point:{x:t+(u-t)/2,y:k[h].y[1]>=k[h].y[0]?d:l},direction:k[h].y[1]>=k[h].y[0]?1:-1,bounds:{x1:t,y1:Math.min(d,l),x2:u,y2:Math.max(d,l)},color:b})}}s&&(f.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,
|
|
442
|
+
0,0,this.width,this.height),this._breaksCanvasCtx&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};u.prototype.renderError=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f,b=a.axisY._position?"left"===a.axisY._position||
|
|
443
|
+
"right"===a.axisY._position?!1:!0:!1;if(!(0>=a.dataSeriesIndexes.length)){var g=null,h=!1,d=this.plotArea,l=0,v,m,n,p,q,k,r,t=a.axisX.dataInfo.minDiff;isFinite(t)||(t=0.3*Math.abs(a.axisX.range));c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(d.x1,d.y1,d.width,d.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.clip());for(var u=0,w=0;w<this.data.length;w++)!this.data[w].type.match(/(bar|column)/ig)||
|
|
444
|
+
!this.data[w].visible||this.data[w].type.match(/(stacked)/ig)&&u||u++;for(var A=0;A<a.dataSeriesIndexes.length;A++){var Q=a.dataSeriesIndexes[A],C=this.data[Q],y=C.dataPoints,D=e(C._linkedSeries)?!1:C._linkedSeries.type.match(/(bar|column)/ig)&&C._linkedSeries.visible?!0:!1,z=0;if(D)for(g=C._linkedSeries.id,w=0;w<g;w++)!this.data[w].type.match(/(bar|column)/ig)||!this.data[w].visible||this.data[w].type.match(/(stacked)/ig)&&z||(this.data[w].type.match(/(range)/ig)&&(h=!0),z++);g=this.options.dataPointMinWidth?
|
|
445
|
+
this.dataPointMinWidth:this.options.dataPointWidth?this.dataPointWidth:1;l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?u:1)))<<0:0.3*this.width;h&&(l=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:b?Math.min(0.15*this.height,0.9*(this.plotArea.height/(D?u:1)))<<0:0.03*this.width);w=this.options.dataPointWidth?this.dataPointWidth:
|
|
446
|
+
0.9*((b?d.height:d.width)*(a.axisX.logarithmic?Math.log(t)/Math.log(a.axisX.range):Math.abs(t)/Math.abs(a.axisX.range))/(D?u:1))<<0;this.dataPointMaxWidth&&g>l&&(g=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<g)&&(l=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,g));w<g&&(w=g);w>l&&(w=l);if(0<y.length)for(var E=C._colorSet,l=0;l<y.length;l++){var g=C.lineColor=C.options.color?C.options.color:E[0],Z={color:y[l].whiskerColor?
|
|
447
|
+
y[l].whiskerColor:y[l].color?C.whiskerColor?C.whiskerColor:y[l].color:C.whiskerColor?C.whiskerColor:g,thickness:e(y[l].whiskerThickness)?C.whiskerThickness:y[l].whiskerThickness,dashType:y[l].whiskerDashType?y[l].whiskerDashType:C.whiskerDashType,length:e(y[l].whiskerLength)?e(C.options.whiskerLength)?w:C.options.whiskerLength:y[l].whiskerLength,trimLength:e(y[l].whiskerLength)?e(C.options.whiskerLength)?50:0:0};Z.length="number"===typeof Z.length?0>=Z.length?0:Z.length>=w?w:Z.length:"string"===typeof Z.length?
|
|
448
|
+
parseInt(Z.length)*w/100>w?w:parseInt(Z.length)*w/100>w:w;Z.thickness="number"===typeof Z.thickness?0>Z.thickness?0:Math.round(Z.thickness):2;var X={color:y[l].stemColor?y[l].stemColor:y[l].color?C.stemColor?C.stemColor:y[l].color:C.stemColor?C.stemColor:g,thickness:y[l].stemThickness?y[l].stemThickness:C.stemThickness,dashType:y[l].stemDashType?y[l].stemDashType:C.stemDashType};X.thickness="number"===typeof X.thickness?0>X.thickness?0:Math.round(X.thickness):2;y[l].getTime?r=y[l].x.getTime():r=y[l].x;
|
|
449
|
+
if(!(r<a.axisX.dataInfo.viewPortMin||r>a.axisX.dataInfo.viewPortMax)&&!e(y[l].y)&&y[l].y.length&&"number"===typeof y[l].y[0]&&"number"===typeof y[l].y[1]){var ja=a.axisX.convertValueToPixel(r);b?m=ja:v=ja;ja=a.axisY.convertValueToPixel(y[l].y[0]);b?n=ja:q=ja;ja=a.axisY.convertValueToPixel(y[l].y[1]);b?p=ja:k=ja;b?(q=a.axisX.reversed?m+(D?u:1)*w/2-(D?z-1:0)*w<<0:m-(D?u:1)*w/2+(D?z-1:0)*w<<0,k=a.axisX.reversed?q-w<<0:q+w<<0):(n=a.axisX.reversed?v+(D?u:1)*w/2-(D?z-1:0)*w<<0:v-(D?u:1)*w/2+(D?z-1:0)*w<<
|
|
450
|
+
0,p=a.axisX.reversed?n-w<<0:n+w<<0);!b&&q>k&&(ja=q,q=k,k=ja);b&&n>p&&(ja=n,n=p,p=ja);ja=C.dataPointIds[l];this._eventManager.objectMap[ja]={id:ja,objectType:"dataPoint",dataSeriesIndex:Q,dataPointIndex:l,x1:Math.min(n,p),y1:Math.min(q,k),x2:Math.max(p,n),y2:Math.max(k,q),isXYSwapped:b,stemProperties:X,whiskerProperties:Z};R(c,Math.min(n,p),Math.min(q,k),Math.max(p,n),Math.max(k,q),g,Z,X,b);s&&R(this._eventManager.ghostCtx,n,q,p,k,g,Z,X,b);if(y[l].indexLabel||C.indexLabel||y[l].indexLabelFormatter||
|
|
451
|
+
C.indexLabelFormatter)this._indexLabels.push({chartType:"error",dataPoint:y[l],dataSeries:C,indexKeyword:0,point:{x:b?y[l].y[1]>=y[l].y[0]?n:p:n+(p-n)/2,y:b?q+(k-q)/2:y[l].y[1]>=y[l].y[0]?k:q},direction:y[l].y[1]>=y[l].y[0]?-1:1,bounds:{x1:b?Math.min(n,p):n,y1:b?q:Math.min(q,k),x2:b?Math.max(n,p):p,y2:b?k:Math.max(q,k)},color:g,axisSwapped:b}),this._indexLabels.push({chartType:"error",dataPoint:y[l],dataSeries:C,indexKeyword:1,point:{x:b?y[l].y[1]>=y[l].y[0]?p:n:n+(p-n)/2,y:b?q+(k-q)/2:y[l].y[1]>=
|
|
452
|
+
y[l].y[0]?q:k},direction:y[l].y[1]>=y[l].y[0]?1:-1,bounds:{x1:b?Math.min(n,p):n,y1:b?q:Math.min(q,k),x2:b?Math.max(n,p):p,y2:b?k:Math.max(q,k)},color:g,axisSwapped:b})}}}s&&(f.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,
|
|
453
|
+
0,0,this.width,this.height),c.clearRect(d.x1,d.y1,d.width,d.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeBar=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=null,g=this.plotArea,h=0,d,l,v,m,h=this.options.dataPointMinWidth?this.dataPointMinWidth:this.options.dataPointWidth?
|
|
454
|
+
this.dataPointWidth:1;d=this.options.dataPointMaxWidth?this.dataPointMaxWidth:this.options.dataPointWidth?this.dataPointWidth:Math.min(0.15*this.height,0.9*(this.plotArea.height/a.plotType.totalDataSeries))<<0;var n=a.axisX.dataInfo.minDiff;isFinite(n)||(n=0.3*Math.abs(a.axisX.range));n=this.options.dataPointWidth?this.dataPointWidth:0.9*(g.height*(a.axisX.logarithmic?Math.log(n)/Math.log(a.axisX.range):Math.abs(n)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&h>
|
|
455
|
+
d&&(h=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,d));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&d<h)&&(d=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,h));n<h&&(n=h);n>d&&(n=d);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(g.x1,g.y1,g.width,g.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.clip());for(var p=0;p<a.dataSeriesIndexes.length;p++){var q=
|
|
456
|
+
a.dataSeriesIndexes[p],k=this.data[q],r=k.dataPoints;if(0<r.length){var t=5<n&&k.bevelEnabled?!0:!1;c.strokeStyle="#4572A7 ";for(h=0;h<r.length;h++)if(r[h].getTime?m=r[h].x.getTime():m=r[h].x,!(m<a.axisX.dataInfo.viewPortMin||m>a.axisX.dataInfo.viewPortMax)&&!e(r[h].y)&&r[h].y.length&&"number"===typeof r[h].y[0]&&"number"===typeof r[h].y[1]){d=a.axisY.convertValueToPixel(r[h].y[0]);l=a.axisY.convertValueToPixel(r[h].y[1]);v=a.axisX.convertValueToPixel(m);v=a.axisX.reversed?v+a.plotType.totalDataSeries*
|
|
457
|
+
n/2-(a.previousDataSeriesCount+p)*n<<0:v-a.plotType.totalDataSeries*n/2+(a.previousDataSeriesCount+p)*n<<0;var u=a.axisX.reversed?v-n<<0:v+n<<0;d>l&&(b=d,d=l,l=b);b=r[h].color?r[h].color:k._colorSet[h%k._colorSet.length];fa(c,d,a.axisX.reversed?u:v,l,a.axisX.reversed?v:u,b,0,null,t,!1,!1,!1,k.fillOpacity);b=k.dataPointIds[h];this._eventManager.objectMap[b]={id:b,objectType:"dataPoint",dataSeriesIndex:q,dataPointIndex:h,x1:d,y1:v,x2:l,y2:u};b=W(b);s&&fa(this._eventManager.ghostCtx,d,a.axisX.reversed?
|
|
458
|
+
u:v,l,a.axisX.reversed?v:u,b,0,null,!1,!1,!1,!1);if(r[h].indexLabel||k.indexLabel||r[h].indexLabelFormatter||k.indexLabelFormatter)this._indexLabels.push({chartType:"rangeBar",dataPoint:r[h],dataSeries:k,indexKeyword:0,point:{x:r[h].y[1]>=r[h].y[0]?d:l,y:v+(u-v)/2},direction:r[h].y[1]>=r[h].y[0]?-1:1,bounds:{x1:Math.min(d,l),y1:v,x2:Math.max(d,l),y2:u},color:b}),this._indexLabels.push({chartType:"rangeBar",dataPoint:r[h],dataSeries:k,indexKeyword:1,point:{x:r[h].y[1]>=r[h].y[0]?l:d,y:v+(u-v)/2},direction:r[h].y[1]>=
|
|
459
|
+
r[h].y[0]?1:-1,bounds:{x1:Math.min(d,l),y1:v,x2:Math.max(d,l),y2:u},color:b})}}}s&&(f.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),c.clearRect(g.x1,g.y1,g.width,g.height),this._eventManager.ghostCtx.restore());
|
|
460
|
+
c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,animationBase:0}}};u.prototype.renderRangeArea=function(a){function f(){if(A){for(var a=null,c=l.length-1;0<=c;c--)a=l[c],b.lineTo(a.x,a.y2),g.lineTo(a.x,a.y2);b.closePath();b.globalAlpha=n.fillOpacity;b.fill();b.globalAlpha=1;g.fill();if(0<n.lineThickness){b.beginPath();b.moveTo(a.x,a.y2);for(c=0;c<l.length;c++)a=l[c],b.lineTo(a.x,a.y2);b.moveTo(l[0].x,l[0].y1);for(c=0;c<l.length;c++)a=
|
|
461
|
+
l[c],b.lineTo(a.x,a.y1);b.stroke()}b.beginPath();b.moveTo(r,v);g.beginPath();g.moveTo(r,v);A={x:r,y:v};l=[];l.push({x:r,y1:v,y2:u})}}var c=a.targetCanvasCtx||this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=this._eventManager.ghostCtx,h=[],e=this.plotArea;b.save();s&&g.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();s&&(g.beginPath(),g.rect(e.x1,e.y1,e.width,e.height),g.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var l=[],m=a.dataSeriesIndexes[d],
|
|
462
|
+
n=this.data[m],p=n.dataPoints,h=n.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:m};h=W(h);g.fillStyle=h;var h=[],q=!0,k=0,r,v,u,w,A=null;if(0<p.length){var y=n._colorSet[k%n._colorSet.length],C=n.lineColor=n.options.lineColor||y,z=C;b.fillStyle=y;b.strokeStyle=C;b.lineWidth=n.lineThickness;var D="solid";if(b.setLineDash){var E=S(n.nullDataLineDashType,n.lineThickness),D=n.lineDashType,F=S(D,n.lineThickness);b.setLineDash(F)}for(var Z=!0;k<p.length;k++)if(w=p[k].x.getTime?
|
|
463
|
+
p[k].x.getTime():p[k].x,!(w<a.axisX.dataInfo.viewPortMin||w>a.axisX.dataInfo.viewPortMax&&(!n.connectNullData||!Z)))if(null!==p[k].y&&p[k].y.length&&"number"===typeof p[k].y[0]&&"number"===typeof p[k].y[1]){r=a.axisX.convertValueToPixel(w);v=a.axisY.convertValueToPixel(p[k].y[0]);u=a.axisY.convertValueToPixel(p[k].y[1]);q||Z?(n.connectNullData&&!q?(b.setLineDash&&(n.options.nullDataLineDashType||D===n.lineDashType&&n.lineDashType!==n.nullDataLineDashType)&&(l[l.length-1].newLineDashArray=F,D=n.nullDataLineDashType,
|
|
464
|
+
b.setLineDash(E)),b.lineTo(r,v),s&&g.lineTo(r,v),l.push({x:r,y1:v,y2:u})):(b.beginPath(),b.moveTo(r,v),A={x:r,y:v},l=[],l.push({x:r,y1:v,y2:u}),s&&(g.beginPath(),g.moveTo(r,v))),Z=q=!1):(b.lineTo(r,v),l.push({x:r,y1:v,y2:u}),s&&g.lineTo(r,v),0==k%250&&f());w=n.dataPointIds[k];this._eventManager.objectMap[w]={id:w,objectType:"dataPoint",dataSeriesIndex:m,dataPointIndex:k,x1:r,y1:v,y2:u};k<p.length-1&&(z!==(p[k].lineColor||C)||D!==(p[k].lineDashType||n.lineDashType))&&(f(),z=p[k].lineColor||C,l[l.length-
|
|
465
|
+
1].newStrokeStyle=z,b.strokeStyle=z,b.setLineDash&&(p[k].lineDashType?(D=p[k].lineDashType,l[l.length-1].newLineDashArray=S(D,n.lineThickness),b.setLineDash(l[l.length-1].newLineDashArray)):(D=n.lineDashType,l[l.length-1].newLineDashArray=F,b.setLineDash(F))));if(0!==p[k].markerSize&&(0<p[k].markerSize||0<n.markerSize)){var X=n.getMarkerProperties(k,r,u,b);h.push(X);var ja=W(w);s&&h.push({x:r,y:u,ctx:g,type:X.type,size:X.size,color:ja,borderColor:ja,borderThickness:X.borderThickness});X=n.getMarkerProperties(k,
|
|
466
|
+
r,v,b);h.push(X);ja=W(w);s&&h.push({x:r,y:v,ctx:g,type:X.type,size:X.size,color:ja,borderColor:ja,borderThickness:X.borderThickness})}if(p[k].indexLabel||n.indexLabel||p[k].indexLabelFormatter||n.indexLabelFormatter)this._indexLabels.push({chartType:"rangeArea",dataPoint:p[k],dataSeries:n,indexKeyword:0,point:{x:r,y:v},direction:p[k].y[0]>p[k].y[1]===a.axisY.reversed?-1:1,color:y}),this._indexLabels.push({chartType:"rangeArea",dataPoint:p[k],dataSeries:n,indexKeyword:1,point:{x:r,y:u},direction:p[k].y[0]>
|
|
467
|
+
p[k].y[1]===a.axisY.reversed?1:-1,color:y})}else Z||q||f(),Z=!0;f();t.drawMarkers(h)}}s&&(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&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),this._eventManager.ghostCtx.restore());
|
|
468
|
+
b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderRangeSplineArea=function(a){function f(a,c){var f=F(v,2);if(0<f.length){if(0<m.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineDash(a);b.beginPath();b.moveTo(f[0].x,f[0].y);for(var h=0;h<f.length-3;h+=3){if(f[h].newStrokeStyle||f[h].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[h].x,f[h].y),f[h].newStrokeStyle&&(b.strokeStyle=f[h].newStrokeStyle),
|
|
469
|
+
f[h].newLineDashArray&&b.setLineDash(f[h].newLineDashArray);b.bezierCurveTo(f[h+1].x,f[h+1].y,f[h+2].x,f[h+2].y,f[h+3].x,f[h+3].y)}}b.beginPath();b.moveTo(f[0].x,f[0].y);s&&(g.beginPath(),g.moveTo(f[0].x,f[0].y));for(h=0;h<f.length-3;h+=3)b.bezierCurveTo(f[h+1].x,f[h+1].y,f[h+2].x,f[h+2].y,f[h+3].x,f[h+3].y),s&&g.bezierCurveTo(f[h+1].x,f[h+1].y,f[h+2].x,f[h+2].y,f[h+3].x,f[h+3].y);f=F(u,2);b.lineTo(u[u.length-1].x,u[u.length-1].y);for(h=f.length-1;2<h;h-=3)b.bezierCurveTo(f[h-1].x,f[h-1].y,f[h-2].x,
|
|
470
|
+
f[h-2].y,f[h-3].x,f[h-3].y),s&&g.bezierCurveTo(f[h-1].x,f[h-1].y,f[h-2].x,f[h-2].y,f[h-3].x,f[h-3].y);b.closePath();b.globalAlpha=m.fillOpacity;b.fill();s&&(g.closePath(),g.fill());b.globalAlpha=1;if(0<m.lineThickness){b.strokeStyle=c;b.setLineDash&&b.setLineDash(a);b.beginPath();b.moveTo(f[0].x,f[0].y);for(var k=h=0;h<f.length-3;h+=3,k++){if(v[k].newStrokeStyle||v[k].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[h].x,f[h].y),v[k].newStrokeStyle&&(b.strokeStyle=v[k].newStrokeStyle),v[k].newLineDashArray&&
|
|
471
|
+
b.setLineDash(v[k].newLineDashArray);b.bezierCurveTo(f[h+1].x,f[h+1].y,f[h+2].x,f[h+2].y,f[h+3].x,f[h+3].y)}f=F(v,2);b.moveTo(f[0].x,f[0].y);for(k=h=0;h<f.length-3;h+=3,k++){if(v[k].newStrokeStyle||v[k].newLineDashArray)b.stroke(),b.beginPath(),b.moveTo(f[h].x,f[h].y),v[k].newStrokeStyle&&(b.strokeStyle=v[k].newStrokeStyle),v[k].newLineDashArray&&b.setLineDash(v[k].newLineDashArray);b.bezierCurveTo(f[h+1].x,f[h+1].y,f[h+2].x,f[h+2].y,f[h+3].x,f[h+3].y)}b.stroke()}b.beginPath()}}var c=a.targetCanvasCtx||
|
|
472
|
+
this.plotArea.ctx,b=s?this._preRenderCtx:c;if(!(0>=a.dataSeriesIndexes.length)){var g=this._eventManager.ghostCtx,h=[],e=this.plotArea;b.save();s&&g.save();b.beginPath();b.rect(e.x1,e.y1,e.width,e.height);b.clip();s&&(g.beginPath(),g.rect(e.x1,e.y1,e.width,e.height),g.clip());for(var d=0;d<a.dataSeriesIndexes.length;d++){var l=a.dataSeriesIndexes[d],m=this.data[l],n=m.dataPoints,h=m.id;this._eventManager.objectMap[h]={objectType:"dataSeries",dataSeriesIndex:l};h=W(h);g.fillStyle=h;var h=[],p=0,q,
|
|
473
|
+
k,r,v=[],u=[];if(0<n.length){var w=m._colorSet[p%m._colorSet.length],A=m.lineColor=m.options.lineColor||w,y=A;b.fillStyle=w;b.lineWidth=m.lineThickness;var C="solid",z;if(b.setLineDash){var D=S(m.nullDataLineDashType,m.lineThickness),C=m.lineDashType;z=S(C,m.lineThickness)}for(k=!1;p<n.length;p++)if(q=n[p].x.getTime?n[p].x.getTime():n[p].x,!(q<a.axisX.dataInfo.viewPortMin||q>a.axisX.dataInfo.viewPortMax&&(!m.connectNullData||!k)))if(null!==n[p].y&&n[p].y.length&&"number"===typeof n[p].y[0]&&"number"===
|
|
474
|
+
typeof n[p].y[1]){q=a.axisX.convertValueToPixel(q);k=a.axisY.convertValueToPixel(n[p].y[0]);r=a.axisY.convertValueToPixel(n[p].y[1]);var E=m.dataPointIds[p];this._eventManager.objectMap[E]={id:E,objectType:"dataPoint",dataSeriesIndex:l,dataPointIndex:p,x1:q,y1:k,y2:r};v[v.length]={x:q,y:k};u[u.length]={x:q,y:r};p<n.length-1&&(y!==(n[p].lineColor||A)||C!==(n[p].lineDashType||m.lineDashType))&&(y=n[p].lineColor||A,v[v.length-1].newStrokeStyle=y,b.setLineDash&&(n[p].lineDashType?(C=n[p].lineDashType,
|
|
475
|
+
v[v.length-1].newLineDashArray=S(C,m.lineThickness)):(C=m.lineDashType,v[v.length-1].newLineDashArray=z)));if(0!==n[p].markerSize&&(0<n[p].markerSize||0<m.markerSize)){var J=m.getMarkerProperties(p,q,k,b);h.push(J);var Z=W(E);s&&h.push({x:q,y:k,ctx:g,type:J.type,size:J.size,color:Z,borderColor:Z,borderThickness:J.borderThickness});J=m.getMarkerProperties(p,q,r,b);h.push(J);Z=W(E);s&&h.push({x:q,y:r,ctx:g,type:J.type,size:J.size,color:Z,borderColor:Z,borderThickness:J.borderThickness})}if(n[p].indexLabel||
|
|
476
|
+
m.indexLabel||n[p].indexLabelFormatter||m.indexLabelFormatter)this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:n[p],dataSeries:m,indexKeyword:0,point:{x:q,y:k},direction:n[p].y[0]<=n[p].y[1]?-1:1,color:w}),this._indexLabels.push({chartType:"rangeSplineArea",dataPoint:n[p],dataSeries:m,indexKeyword:1,point:{x:q,y:r},direction:n[p].y[0]<=n[p].y[1]?1:-1,color:w});k=!1}else 0<p&&!k&&(m.connectNullData?b.setLineDash&&(0<v.length&&(m.options.nullDataLineDashType||!n[p-1].lineDashType))&&(v[v.length-
|
|
477
|
+
1].newLineDashArray=D,C=m.nullDataLineDashType):(f(z,A),v=[],u=[])),k=!0;f(z,A);t.drawMarkers(h)}}s&&(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&&this._breaksCanvasCtx.drawImage(this._preRenderCanvas,0,0,this.width,this.height),b.clearRect(e.x1,e.y1,e.width,e.height),
|
|
478
|
+
this._eventManager.ghostCtx.restore());b.restore();return{source:c,dest:this.plotArea.ctx,animationCallback:x.xClipAnimation,easingFunction:x.easing.linear,animationBase:0}}};u.prototype.renderWaterfall=function(a){var f=a.targetCanvasCtx||this.plotArea.ctx,c=s?this._preRenderCtx:f;if(!(0>=a.dataSeriesIndexes.length)){var b=this._eventManager.ghostCtx,g=null,h=this.plotArea,e=0,d,l,m,n,p=a.axisY.convertValueToPixel(a.axisY.logarithmic?a.axisY.viewportMinimum:0),e=this.options.dataPointMinWidth?this.dataPointMinWidth:
|
|
479
|
+
this.options.dataPointWidth?this.dataPointWidth:1;l=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;var q=a.axisX.dataInfo.minDiff;isFinite(q)||(q=0.3*Math.abs(a.axisX.range));q=this.options.dataPointWidth?this.dataPointWidth:0.6*(h.width*(a.axisX.logarithmic?Math.log(q)/Math.log(a.axisX.range):Math.abs(q)/Math.abs(a.axisX.range))/a.plotType.totalDataSeries)<<0;this.dataPointMaxWidth&&
|
|
480
|
+
e>l&&(e=Math.min(this.options.dataPointWidth?this.dataPointWidth:Infinity,l));!this.dataPointMaxWidth&&(this.dataPointMinWidth&&l<e)&&(l=Math.max(this.options.dataPointWidth?this.dataPointWidth:-Infinity,e));q<e&&(q=e);q>l&&(q=l);c.save();s&&this._eventManager.ghostCtx.save();c.beginPath();c.rect(h.x1,h.y1,h.width,h.height);c.clip();s&&(this._eventManager.ghostCtx.beginPath(),this._eventManager.ghostCtx.rect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.clip());for(var k=0;k<a.dataSeriesIndexes.length;k++){var r=
|
|
481
|
+
a.dataSeriesIndexes[k],v=this.data[r],t=v.dataPoints,g=v._colorSet[0];v.risingColor=v.options.risingColor?v.options.risingColor:g;v.fallingColor=v.options.fallingColor?v.options.fallingColor:"#e40a0a";var w="number"===typeof v.options.lineThickness?Math.round(v.lineThickness):1,u=1===Math.round(w)%2?-0.5:0;if(0<t.length)for(var y=5<q&&v.bevelEnabled?!0:!1,C=!1,z=null,D=null,e=0;e<t.length;e++)if(t[e].getTime?n=t[e].x.getTime():n=t[e].x,"number"!==typeof t[e].y){if(0<e&&!C&&v.connectNullData)var E=
|
|
482
|
+
v.options.nullDataLineDashType||!t[e-1].lineDashType?v.nullDataLineDashType:t[e-1].lineDashType;C=!0}else{d=a.axisX.convertValueToPixel(n);l=0===v.dataPointEOs[e].cumulativeSum?p:a.axisY.convertValueToPixel(v.dataPointEOs[e].cumulativeSum);m=0===v.dataPointEOs[e].cumulativeSumYStartValue?p:a.axisY.convertValueToPixel(v.dataPointEOs[e].cumulativeSumYStartValue);d=a.axisX.reversed?d+a.plotType.totalDataSeries*q/2-(a.previousDataSeriesCount+k)*q<<0:d-a.plotType.totalDataSeries*q/2+(a.previousDataSeriesCount+
|
|
483
|
+
k)*q<<0;var F=a.axisX.reversed?d-q<<0:d+q<<0;l>m&&(g=l,l=m,m=g);a.axisY.reversed&&(g=l,l=m,m=g);g=v.dataPointIds[e];this._eventManager.objectMap[g]={id:g,objectType:"dataPoint",dataSeriesIndex:r,dataPointIndex:e,x1:d,y1:l,x2:F,y2:m};var Z=t[e].color?t[e].color:0<t[e].y?v.risingColor:v.fallingColor;fa(c,a.axisX.reversed?F:d,a.axisY.reversed?m:l,a.axisX.reversed?d:F,a.axisY.reversed?l:m,Z,0,Z,y,y,!1,!1,v.fillOpacity);g=W(g);s&&fa(this._eventManager.ghostCtx,a.axisX.reversed?F:d,l,a.axisX.reversed?d:
|
|
484
|
+
F,m,g,0,null,!1,!1,!1,!1);var X,Z=d;X="undefined"!==typeof t[e].isIntermediateSum&&!0===t[e].isIntermediateSum||"undefined"!==typeof t[e].isCumulativeSum&&!0===t[e].isCumulativeSum?0<t[e].y?l:m:0<t[e].y?m:l;0<e&&z&&(!C||v.connectNullData)&&(C&&c.setLineDash&&c.setLineDash(S(E,w)),c.beginPath(),c.moveTo(z,D-u),c.lineTo(Z,X-u),0<w&&c.stroke(),s&&(b.beginPath(),b.moveTo(z,D-u),b.lineTo(Z,X-u),0<w&&b.stroke()));C=!1;z=F;D=0<t[e].y?l:m;Z=t[e].lineDashType?t[e].lineDashType:v.options.lineDashType?v.options.lineDashType:
|
|
485
|
+
"shortDash";c.strokeStyle=t[e].lineColor?t[e].lineColor:v.options.lineColor?v.options.lineColor:"#9e9e9e";c.lineWidth=w;c.setLineDash&&(Z=S(Z,w),c.setLineDash(Z));(t[e].indexLabel||v.indexLabel||t[e].indexLabelFormatter||v.indexLabelFormatter)&&this._indexLabels.push({chartType:"waterfall",dataPoint:t[e],dataSeries:v,point:{x:d+(F-d)/2,y:0<=t[e].y?l:m},direction:0>t[e].y===a.axisY.reversed?1:-1,bounds:{x1:d,y1:Math.min(l,m),x2:F,y2:Math.max(l,m)},color:g})}}s&&(f.drawImage(this._preRenderCanvas,0,
|
|
486
|
+
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),c.clearRect(h.x1,h.y1,h.width,h.height),this._eventManager.ghostCtx.restore());c.restore();return{source:f,dest:this.plotArea.ctx,animationCallback:x.fadeInAnimation,easingFunction:x.easing.easeInQuad,
|
|
487
|
+
animationBase:0}}};var d=function(a,f,c,b,g,h,e,d,l){if(!(0>c)){"undefined"===typeof d&&(d=1);if(!s){var m=Number((e%(2*Math.PI)).toFixed(8));Number((h%(2*Math.PI)).toFixed(8))===m&&(e-=1E-4)}a.save();a.globalAlpha=d;"pie"===g?(a.beginPath(),a.moveTo(f.x,f.y),a.arc(f.x,f.y,c,h,e,!1),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=2,a.closePath(),a.fill()):"doughnut"===g&&(a.beginPath(),a.arc(f.x,f.y,c,h,e,!1),0<=l&&a.arc(f.x,f.y,l*c,e,h,!0),a.closePath(),a.fillStyle=b,a.strokeStyle="white",a.lineWidth=
|
|
488
|
+
2,a.fill());a.globalAlpha=1;a.restore()}};u.prototype.renderPie=function(a){function f(){if(m&&n){for(var a=0,b=0,c=0,f=0,g=0;g<n.length;g++){var h=n[g],d=m.dataPointIds[g];k[g].id=d;k[g].objectType="dataPoint";k[g].dataPointIndex=g;k[g].dataSeriesIndex=0;var p=k[g],l={percent:null,total:null},r=null,l=x.getPercentAndTotal(m,h);if(m.indexLabelFormatter||h.indexLabelFormatter)r={chart:x.options,dataSeries:m,dataPoint:h,total:l.total,percent:l.percent};l=h.indexLabelFormatter?h.indexLabelFormatter(r):
|
|
489
|
+
h.indexLabel?x.replaceKeywordsWithValue(h.indexLabel,h,m,g):m.indexLabelFormatter?m.indexLabelFormatter(r):m.indexLabel?x.replaceKeywordsWithValue(m.indexLabel,h,m,g):h.label?h.label:"";x._eventManager.objectMap[d]=p;p.center={x:y.x,y:y.y};p.y=h.y;p.radius=D;p.percentInnerRadius=F;p.indexLabelText=l;p.indexLabelPlacement=m.indexLabelPlacement;p.indexLabelLineColor=h.indexLabelLineColor?h.indexLabelLineColor:m.options.indexLabelLineColor?m.options.indexLabelLineColor:h.color?h.color:m._colorSet[g%
|
|
490
|
+
m._colorSet.length];p.indexLabelLineThickness=e(h.indexLabelLineThickness)?m.indexLabelLineThickness:h.indexLabelLineThickness;p.indexLabelLineDashType=h.indexLabelLineDashType?h.indexLabelLineDashType:m.indexLabelLineDashType;p.indexLabelFontColor=h.indexLabelFontColor?h.indexLabelFontColor:m.indexLabelFontColor;p.indexLabelFontStyle=h.indexLabelFontStyle?h.indexLabelFontStyle:m.indexLabelFontStyle;p.indexLabelFontWeight=h.indexLabelFontWeight?h.indexLabelFontWeight:m.indexLabelFontWeight;p.indexLabelFontSize=
|
|
491
|
+
e(h.indexLabelFontSize)?m.indexLabelFontSize:h.indexLabelFontSize;p.indexLabelFontFamily=h.indexLabelFontFamily?h.indexLabelFontFamily:m.indexLabelFontFamily;p.indexLabelBackgroundColor=h.indexLabelBackgroundColor?h.indexLabelBackgroundColor:m.options.indexLabelBackgroundColor?m.options.indexLabelBackgroundColor:m.indexLabelBackgroundColor;p.indexLabelMaxWidth=h.indexLabelMaxWidth?h.indexLabelMaxWidth:m.indexLabelMaxWidth?m.indexLabelMaxWidth:0.33*q.width;p.indexLabelWrap="undefined"!==typeof h.indexLabelWrap?
|
|
492
|
+
h.indexLabelWrap:m.indexLabelWrap;p.indexLabelTextAlign=h.indexLabelTextAlign?h.indexLabelTextAlign:m.indexLabelTextAlign?m.indexLabelTextAlign:"left";p.startAngle=0===g?m.startAngle?m.startAngle/180*Math.PI:0:k[g-1].endAngle;p.startAngle=(p.startAngle+2*Math.PI)%(2*Math.PI);p.endAngle=p.startAngle+2*Math.PI/C*Math.abs(h.y);h=(p.endAngle+p.startAngle)/2;h=(h+2*Math.PI)%(2*Math.PI);p.midAngle=h;if(p.midAngle>Math.PI/2-w&&p.midAngle<Math.PI/2+w){if(0===a||k[c].midAngle>p.midAngle)c=g;a++}else if(p.midAngle>
|
|
493
|
+
3*Math.PI/2-w&&p.midAngle<3*Math.PI/2+w){if(0===b||k[f].midAngle>p.midAngle)f=g;b++}p.hemisphere=h>Math.PI/2&&h<=3*Math.PI/2?"left":"right";p.indexLabelTextBlock=new na(x.plotArea.ctx,{fontSize:p.indexLabelFontSize,fontFamily:p.indexLabelFontFamily,fontColor:p.indexLabelFontColor,fontStyle:p.indexLabelFontStyle,fontWeight:p.indexLabelFontWeight,textAlign:p.indexLabelTextAlign,backgroundColor:p.indexLabelBackgroundColor,maxWidth:p.indexLabelMaxWidth,maxHeight:p.indexLabelWrap?5*p.indexLabelFontSize:
|
|
494
|
+
1.5*p.indexLabelFontSize,text:p.indexLabelText,padding:0,textBaseline:"top"});p.indexLabelTextBlock.measureText()}d=h=0;l=!1;for(g=0;g<n.length;g++)p=k[(c+g)%n.length],1<a&&(p.midAngle>Math.PI/2-w&&p.midAngle<Math.PI/2+w)&&(h<=a/2&&!l?(p.hemisphere="right",h++):(p.hemisphere="left",l=!0));l=!1;for(g=0;g<n.length;g++)p=k[(f+g)%n.length],1<b&&(p.midAngle>3*Math.PI/2-w&&p.midAngle<3*Math.PI/2+w)&&(d<=b/2&&!l?(p.hemisphere="left",d++):(p.hemisphere="right",l=!0))}}function c(a){var b=x.plotArea.ctx;b.clearRect(q.x1,
|
|
495
|
+
q.y1,q.width,q.height);b.fillStyle=x.backgroundColor;b.fillRect(q.x1,q.y1,q.width,q.height);for(b=0;b<n.length;b++){var c=k[b].startAngle,f=k[b].endAngle;if(f>c){var g=0.07*D*Math.cos(k[b].midAngle),h=0.07*D*Math.sin(k[b].midAngle),e=!1;if(n[b].exploded){if(1E-9<Math.abs(k[b].center.x-(y.x+g))||1E-9<Math.abs(k[b].center.y-(y.y+h)))k[b].center.x=y.x+g*a,k[b].center.y=y.y+h*a,e=!0}else if(0<Math.abs(k[b].center.x-y.x)||0<Math.abs(k[b].center.y-y.y))k[b].center.x=y.x+g*(1-a),k[b].center.y=y.y+h*(1-a),
|
|
496
|
+
e=!0;e&&(g={},g.dataSeries=m,g.dataPoint=m.dataPoints[b],g.index=b,x.toolTip.highlightObjects([g]));d(x.plotArea.ctx,k[b].center,k[b].radius,n[b].color?n[b].color:m._colorSet[b%m._colorSet.length],m.type,c,f,m.fillOpacity,k[b].percentInnerRadius)}}a=x.plotArea.ctx;a.save();a.fillStyle="black";a.strokeStyle="grey";a.textBaseline="middle";a.lineJoin="round";for(b=b=0;b<n.length;b++)c=k[b],c.indexLabelText&&(c.indexLabelTextBlock.y-=c.indexLabelTextBlock.height/2,f=0,f="left"===c.hemisphere?"inside"!==
|
|
497
|
+
m.indexLabelPlacement?-(c.indexLabelTextBlock.width+p):-c.indexLabelTextBlock.width/2:"inside"!==m.indexLabelPlacement?p:-c.indexLabelTextBlock.width/2,c.indexLabelTextBlock.x+=f,c.indexLabelTextBlock.render(!0),c.indexLabelTextBlock.x-=f,c.indexLabelTextBlock.y+=c.indexLabelTextBlock.height/2,"inside"!==c.indexLabelPlacement&&0<c.indexLabelLineThickness&&(f=c.center.x+D*Math.cos(c.midAngle),g=c.center.y+D*Math.sin(c.midAngle),a.strokeStyle=c.indexLabelLineColor,a.lineWidth=c.indexLabelLineThickness,
|
|
498
|
+
a.setLineDash&&a.setLineDash(S(c.indexLabelLineDashType,c.indexLabelLineThickness)),a.beginPath(),a.moveTo(f,g),a.lineTo(c.indexLabelTextBlock.x,c.indexLabelTextBlock.y),a.lineTo(c.indexLabelTextBlock.x+("left"===c.hemisphere?-p:p),c.indexLabelTextBlock.y),a.stroke()),a.lineJoin="miter");a.save()}function b(a,b){var c=0,c=a.indexLabelTextBlock.y-a.indexLabelTextBlock.height/2,f=a.indexLabelTextBlock.y+a.indexLabelTextBlock.height/2,g=b.indexLabelTextBlock.y-b.indexLabelTextBlock.height/2,h=b.indexLabelTextBlock.y+
|
|
499
|
+
b.indexLabelTextBlock.height/2;return c=b.indexLabelTextBlock.y>a.indexLabelTextBlock.y?g-f:c-h}function g(a){for(var c=null,f=1;f<n.length;f++)if(c=(a+f+k.length)%k.length,k[c].hemisphere!==k[a].hemisphere){c=null;break}else if(k[c].indexLabelText&&c!==a&&(0>b(k[c],k[a])||("right"===k[a].hemisphere?k[c].indexLabelTextBlock.y>=k[a].indexLabelTextBlock.y:k[c].indexLabelTextBlock.y<=k[a].indexLabelTextBlock.y)))break;else c=null;return c}function h(a,c,f){f=(f||0)+1;if(1E3<f)return 0;c=c||0;var e=0,
|
|
500
|
+
d=y.y-1*t,m=y.y+1*t;if(0<=a&&a<n.length){var p=k[a];if(0>c&&p.indexLabelTextBlock.y<d||0<c&&p.indexLabelTextBlock.y>m)return 0;var q=0,l=0,l=q=q=0;0>c?p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2>d&&p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2+c<d&&(c=-(d-(p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2+c))):p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2<d&&p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2+c>m&&(c=p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/
|
|
501
|
+
2+c-m);c=p.indexLabelTextBlock.y+c;d=0;d="right"===p.hemisphere?y.x+Math.sqrt(Math.pow(t,2)-Math.pow(c-y.y,2)):y.x-Math.sqrt(Math.pow(t,2)-Math.pow(c-y.y,2));l=y.x+D*Math.cos(p.midAngle);q=y.y+D*Math.sin(p.midAngle);q=Math.sqrt(Math.pow(d-l,2)+Math.pow(c-q,2));l=Math.acos(D/t);q=Math.acos((t*t+D*D-q*q)/(2*D*t));c=q<l?c-p.indexLabelTextBlock.y:0;d=null;for(m=1;m<n.length;m++)if(d=(a-m+k.length)%k.length,k[d].hemisphere!==k[a].hemisphere){d=null;break}else if(k[d].indexLabelText&&k[d].hemisphere===
|
|
502
|
+
k[a].hemisphere&&d!==a&&(0>b(k[d],k[a])||("right"===k[a].hemisphere?k[d].indexLabelTextBlock.y<=k[a].indexLabelTextBlock.y:k[d].indexLabelTextBlock.y>=k[a].indexLabelTextBlock.y)))break;else d=null;l=d;q=g(a);m=d=0;0>c?(m="right"===p.hemisphere?l:q,e=c,null!==m&&(l=-c,c=p.indexLabelTextBlock.y-p.indexLabelTextBlock.height/2-(k[m].indexLabelTextBlock.y+k[m].indexLabelTextBlock.height/2),c-l<r&&(d=-l,m=h(m,d,f+1),+m.toFixed(u)>+d.toFixed(u)&&(e=c>r?-(c-r):-(l-(m-d)))))):0<c&&(m="right"===p.hemisphere?
|
|
503
|
+
q:l,e=c,null!==m&&(l=c,c=k[m].indexLabelTextBlock.y-k[m].indexLabelTextBlock.height/2-(p.indexLabelTextBlock.y+p.indexLabelTextBlock.height/2),c-l<r&&(d=l,m=h(m,d,f+1),+m.toFixed(u)<+d.toFixed(u)&&(e=c>r?c-r:l-(d-m)))));e&&(f=p.indexLabelTextBlock.y+e,c=0,c="right"===p.hemisphere?y.x+Math.sqrt(Math.pow(t,2)-Math.pow(f-y.y,2)):y.x-Math.sqrt(Math.pow(t,2)-Math.pow(f-y.y,2)),p.midAngle>Math.PI/2-w&&p.midAngle<Math.PI/2+w?(d=(a-1+k.length)%k.length,d=k[d],a=k[(a+1+k.length)%k.length],"left"===p.hemisphere&&
|
|
504
|
+
"right"===d.hemisphere&&c>d.indexLabelTextBlock.x?c=d.indexLabelTextBlock.x-15:"right"===p.hemisphere&&("left"===a.hemisphere&&c<a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x+15)):p.midAngle>3*Math.PI/2-w&&p.midAngle<3*Math.PI/2+w&&(d=(a-1+k.length)%k.length,d=k[d],a=k[(a+1+k.length)%k.length],"right"===p.hemisphere&&"left"===d.hemisphere&&c<d.indexLabelTextBlock.x?c=d.indexLabelTextBlock.x+15:"left"===p.hemisphere&&("right"===a.hemisphere&&c>a.indexLabelTextBlock.x)&&(c=a.indexLabelTextBlock.x-
|
|
505
|
+
15)),p.indexLabelTextBlock.y=f,p.indexLabelTextBlock.x=c,p.indexLabelAngle=Math.atan2(p.indexLabelTextBlock.y-y.y,p.indexLabelTextBlock.x-y.x))}return e}function l(){var a=x.plotArea.ctx;a.fillStyle="grey";a.strokeStyle="grey";a.font="16px Arial";a.textBaseline="middle";for(var c=a=0,f=0,e=!0,c=0;10>c&&(1>c||0<f);c++){if(m.radius||!m.radius&&"undefined"!==typeof m.innerRadius&&null!==m.innerRadius&&D-f<=E)e=!1;e&&(D-=f);f=0;if("inside"!==m.indexLabelPlacement){t=D*s;for(a=0;a<n.length;a++){var d=
|
|
506
|
+
k[a];d.indexLabelTextBlock.x=y.x+t*Math.cos(d.midAngle);d.indexLabelTextBlock.y=y.y+t*Math.sin(d.midAngle);d.indexLabelAngle=d.midAngle;d.radius=D;d.percentInnerRadius=F}for(var B,v,a=0;a<n.length;a++){var d=k[a],w=g(a);if(null!==w){B=k[a];v=k[w];var C=0,C=b(B,v)-r;if(0>C){for(var ua=v=0,z=0;z<n.length;z++)z!==a&&k[z].hemisphere===d.hemisphere&&(k[z].indexLabelTextBlock.y<d.indexLabelTextBlock.y?v++:ua++);v=C/(v+ua||1)*ua;var ua=-1*(C-v),K=z=0;"right"===d.hemisphere?(z=h(a,v),ua=-1*(C-z),K=h(w,ua),
|
|
507
|
+
+K.toFixed(u)<+ua.toFixed(u)&&+z.toFixed(u)<=+v.toFixed(u)&&h(a,-(ua-K))):(z=h(w,v),ua=-1*(C-z),K=h(a,ua),+K.toFixed(u)<+ua.toFixed(u)&&+z.toFixed(u)<=+v.toFixed(u)&&h(w,-(ua-K)))}}}}else for(a=0;a<n.length;a++)d=k[a],t="pie"===m.type?0.7*D:0.85*D,w=y.x+t*Math.cos(d.midAngle),v=y.y+t*Math.sin(d.midAngle),d.indexLabelTextBlock.x=w,d.indexLabelTextBlock.y=v;for(a=0;a<n.length;a++)if(d=k[a],w=d.indexLabelTextBlock.measureText(),0!==w.height&&0!==w.width)w=w=0,"right"===d.hemisphere?(w=q.x2-(d.indexLabelTextBlock.x+
|
|
508
|
+
d.indexLabelTextBlock.width+p),w*=-1):w=q.x1-(d.indexLabelTextBlock.x-d.indexLabelTextBlock.width-p),0<w&&(!e&&d.indexLabelText&&(v="right"===d.hemisphere?q.x2-d.indexLabelTextBlock.x:d.indexLabelTextBlock.x-q.x1,0.3*d.indexLabelTextBlock.maxWidth>v?d.indexLabelText="":d.indexLabelTextBlock.maxWidth=0.85*v,0.3*d.indexLabelTextBlock.maxWidth<v&&(d.indexLabelTextBlock.x-="right"===d.hemisphere?2:-2)),Math.abs(d.indexLabelTextBlock.y-d.indexLabelTextBlock.height/2-y.y)<D||Math.abs(d.indexLabelTextBlock.y+
|
|
509
|
+
d.indexLabelTextBlock.height/2-y.y)<D)&&(w/=Math.abs(Math.cos(d.indexLabelAngle)),9<w&&(w*=0.3),w>f&&(f=w)),w=w=0,0<d.indexLabelAngle&&d.indexLabelAngle<Math.PI?(w=q.y2-(d.indexLabelTextBlock.y+d.indexLabelTextBlock.height/2+5),w*=-1):w=q.y1-(d.indexLabelTextBlock.y-d.indexLabelTextBlock.height/2-5),0<w&&(!e&&d.indexLabelText&&(v=0<d.indexLabelAngle&&d.indexLabelAngle<Math.PI?-1:1,0===h(a,w*v)&&h(a,2*v)),Math.abs(d.indexLabelTextBlock.x-y.x)<D&&(w/=Math.abs(Math.sin(d.indexLabelAngle)),9<w&&(w*=0.3),
|
|
510
|
+
w>f&&(f=w)));var I=function(a,b,c){for(var f=[],g=0;f.push(k[b]),b!==c;b=(b+1+n.length)%n.length);f.sort(function(a,b){return a.y-b.y});for(b=0;b<f.length;b++)if(c=f[b],g<0.7*a)g+=c.indexLabelTextBlock.height,c.indexLabelTextBlock.text="",c.indexLabelText="",c.indexLabelTextBlock.measureText();else break};(function(){for(var a=-1,c=-1,f=0,h=!1,e=0;e<n.length;e++)if(h=!1,B=k[e],B.indexLabelText){var d=g(e);if(null!==d){var m=k[d];C=0;C=b(B,m);var q;if(q=0>C){q=B.indexLabelTextBlock.x;var l=B.indexLabelTextBlock.y-
|
|
511
|
+
B.indexLabelTextBlock.height/2,r=B.indexLabelTextBlock.y+B.indexLabelTextBlock.height/2,v=m.indexLabelTextBlock.y-m.indexLabelTextBlock.height/2,x=m.indexLabelTextBlock.x+m.indexLabelTextBlock.width,w=m.indexLabelTextBlock.y+m.indexLabelTextBlock.height/2;q=B.indexLabelTextBlock.x+B.indexLabelTextBlock.width<m.indexLabelTextBlock.x-p||q>x+p||l>w+p||r<v-p?!1:!0}q?(0>a&&(a=e),d!==a&&(c=d,f+=-C),0===e%Math.max(n.length/10,3)&&(h=!0)):h=!0;h&&(0<f&&0<=a&&0<=c)&&(I(f,a,c),c=a=-1,f=0)}}0<f&&I(f,a,c)})()}}
|
|
512
|
+
function v(){x.plotArea.layoutManager.reset();x.title&&(x.title.dockInsidePlotArea||"center"===x.title.horizontalAlign&&"center"===x.title.verticalAlign)&&x.title.render();if(x.subtitles)for(var a=0;a<x.subtitles.length;a++){var b=x.subtitles[a];(b.dockInsidePlotArea||"center"===b.horizontalAlign&&"center"===b.verticalAlign)&&b.render()}x.legend&&(x.legend.dockInsidePlotArea||"center"===x.legend.horizontalAlign&&"center"===x.legend.verticalAlign)&&(x.legend.setLayout(),x.legend.render())}var x=this;
|
|
513
|
+
if(!(0>=a.dataSeriesIndexes.length)){var m=this.data[a.dataSeriesIndexes[0]],n=m.dataPoints,p=10,q=this.plotArea,k=m.dataPointEOs,r=2,t,s=1.3,w=20/180*Math.PI,u=6,y={x:(q.x2+q.x1)/2,y:(q.y2+q.y1)/2},C=0;a=!1;for(var z=0;z<n.length;z++)C+=Math.abs(n[z].y),!a&&("undefined"!==typeof n[z].indexLabel&&null!==n[z].indexLabel&&0<n[z].indexLabel.toString().length)&&(a=!0),!a&&("undefined"!==typeof n[z].label&&null!==n[z].label&&0<n[z].label.toString().length)&&(a=!0);if(0!==C){a=a||"undefined"!==typeof m.indexLabel&&
|
|
514
|
+
null!==m.indexLabel&&0<m.indexLabel.toString().length;var D="inside"!==m.indexLabelPlacement&&a?0.75*Math.min(q.width,q.height)/2:0.92*Math.min(q.width,q.height)/2;m.radius&&(D=Va(m.radius,D));var E="undefined"!==typeof m.innerRadius&&null!==m.innerRadius?Va(m.innerRadius,D):0.7*D;m.radius=D;"doughnut"===m.type&&(m.innerRadius=E);var F=Math.min(E/D,(D-1)/D);this.pieDoughnutClickHandler=function(a){x.isAnimating||!e(a.dataSeries.explodeOnClick)&&!a.dataSeries.explodeOnClick||(a=a.dataPoint,a.exploded=
|
|
515
|
+
a.exploded?!1:!0,1<this.dataPoints.length&&x._animator.animate(0,500,function(a){c(a);v();x.dispatchEvent("dataAnimationIterationEnd",{chart:x});x.dispatchEvent("dataAnimationEnd",{chart:x})}))};f();l();l();l();l();this.disableToolTip=!0;this._animator.animate(0,this.animatedRender?this.animationDuration:0,function(a){var b=x.plotArea.ctx;b.clearRect(q.x1,q.y1,q.width,q.height);b.fillStyle=x.backgroundColor;b.fillRect(q.x1,q.y1,q.width,q.height);for(var b=k[0].startAngle+2*Math.PI*a,c=0;c<n.length;c++){var f=
|
|
516
|
+
0===c?k[c].startAngle:g,g=f+(k[c].endAngle-k[c].startAngle),h=!1;g>b&&(g=b,h=!0);var e=n[c].color?n[c].color:m._colorSet[c%m._colorSet.length];g>f&&d(x.plotArea.ctx,k[c].center,k[c].radius,e,m.type,f,g,m.fillOpacity,k[c].percentInnerRadius);if(h)break}v();x.dispatchEvent("dataAnimationIterationEnd",{chart:x});1<=a&&x.dispatchEvent("dataAnimationEnd",{chart:x})},function(){x.disableToolTip=!1;x._animator.animate(0,x.animatedRender?500:0,function(a){c(a);v();x.dispatchEvent("dataAnimationIterationEnd",
|
|
517
|
+
{chart:x})});x.dispatchEvent("dataAnimationEnd",{chart:x})})}}};var v=function(a,f,c,b){"undefined"===typeof c&&(c=1);0>=Math.round(f.y4-f.y1)||(a.save(),a.globalAlpha=c,a.beginPath(),a.moveTo(Math.round(f.x1),Math.round(f.y1)),a.lineTo(Math.round(f.x2),Math.round(f.y2)),a.lineTo(Math.round(f.x3),Math.round(f.y3)),a.lineTo(Math.round(f.x4),Math.round(f.y4)),"undefined"!==f.x5&&(a.lineTo(Math.round(f.x5),Math.round(f.y5)),a.lineTo(Math.round(f.x6),Math.round(f.y6))),a.closePath(),a.fillStyle=b?b:f.color,
|
|
518
|
+
a.fill(),a.globalAplha=1,a.restore())};u.prototype.renderFunnel=function(a){function f(){for(var a=0,b=[],c=0;c<A.length;c++){if("undefined"===typeof A[c].y)return-1;A[c].y="number"===typeof A[c].y?A[c].y:0;a+=Math.abs(A[c].y)}if(0===a)return-1;for(c=b[0]=0;c<A.length;c++)b.push(Math.abs(A[c].y)*F/a);return b}function c(){var a=$,b=aa,c=U,f=ba,g,h;g=O;h=M-P;f=Math.abs((h-g)*(b-a+(f-c))/2);c=ba-U;g=h-g;h=c*(h-M);h=Math.abs(h);h=f+h;for(var f=[],k=0,e=0;e<A.length;e++){if("undefined"===typeof A[e].y)return-1;
|
|
519
|
+
A[e].y="number"===typeof A[e].y?A[e].y:0;k+=Math.abs(A[e].y)}if(0===k)return-1;for(var d=f[0]=0,m=0,n,p,b=b-a,d=!1,e=0;e<A.length;e++)a=Math.abs(A[e].y)*h/k,d?n=0==Number(c.toFixed(3))?0:a/c:(p=ia*ia*b*b-4*Math.abs(ia)*a,0>p?(p=c,d=(b+p)*(g-m)/2,a-=d,n=g-m,m+=g-m,n+=0==p?0:a/p,m+=a/p,d=!0):(n=(Math.abs(ia)*b-Math.sqrt(p))/2,p=b-2*n/Math.abs(ia),m+=n,m>g&&(m-=n,p=c,d=(b+p)*(g-m)/2,a-=d,n=g-m,m+=g-m,n+=a/p,m+=a/p,d=!0),b=p)),f.push(n);return f}function b(){if(w&&A){for(var a,b,c,f,g,h,d,m,p,n,q,l,B,
|
|
520
|
+
r,v,x=[],t=[],u={percent:null,total:null},L=null,z=0;z<A.length;z++)v=V[z],v="undefined"!==typeof v.x5?(v.y2+v.y4)/2:(v.y2+v.y3)/2,v=k(v).x2+1,x[z]=R-v-W;v=0.5*W;for(var z=0,C=A.length-1;z<A.length||0<=C;z++,C--){b=w.reversed?A[C]:A[z];a=b.color?b.color:w.reversed?w._colorSet[(A.length-1-z)%w._colorSet.length]:w._colorSet[z%w._colorSet.length];c=b.indexLabelPlacement||w.indexLabelPlacement||"outside";r=b.indexLabelTextAlign||w.indexLabelTextAlign||"left";f=b.indexLabelBackgroundColor||w.indexLabelBackgroundColor||
|
|
521
|
+
(s?"transparent":null);g=b.indexLabelFontColor||w.indexLabelFontColor||"#979797";h=e(b.indexLabelFontSize)?w.indexLabelFontSize:b.indexLabelFontSize;d=b.indexLabelFontStyle||w.indexLabelFontStyle||"normal";m=b.indexLabelFontFamily||w.indexLabelFontFamily||"arial";p=b.indexLabelFontWeight||w.indexLabelFontWeight||"normal";a=b.indexLabelLineColor||w.options.indexLabelLineColor||a;n="number"===typeof b.indexLabelLineThickness?b.indexLabelLineThickness:"number"===typeof w.indexLabelLineThickness?w.indexLabelLineThickness:
|
|
522
|
+
2;q=b.indexLabelLineDashType||w.indexLabelLineDashType||"solid";l="undefined"!==typeof b.indexLabelWrap?b.indexLabelWrap:"undefined"!==typeof w.indexLabelWrap?w.indexLabelWrap:!0;B=w.dataPointIds[z];y._eventManager.objectMap[B]={id:B,objectType:"dataPoint",dataPointIndex:z,dataSeriesIndex:0,funnelSection:V[w.reversed?A.length-1-z:z]};"inside"===w.indexLabelPlacement&&(x[z]=z!==ea?w.reversed?V[z].x2-V[z].x1:V[z].x3-V[z].x4:V[z].x3-V[z].x6,20>x[z]&&(x[z]=z!==ea?w.reversed?V[z].x3-V[z].x4:V[z].x2-V[z].x1:
|
|
523
|
+
V[z].x2-V[z].x1,x[z]/=2));B=b.indexLabelMaxWidth?b.indexLabelMaxWidth:w.options.indexLabelMaxWidth?w.indexLabelMaxWidth:x[z];if(B>x[z]||0>B)B=x[z];t[z]="inside"===w.indexLabelPlacement?V[z].height:!1;u=y.getPercentAndTotal(w,b);if(w.indexLabelFormatter||b.indexLabelFormatter)L={chart:y.options,dataSeries:w,dataPoint:b,total:u.total,percent:u.percent};b=b.indexLabelFormatter?b.indexLabelFormatter(L):b.indexLabel?y.replaceKeywordsWithValue(b.indexLabel,b,w,z):w.indexLabelFormatter?w.indexLabelFormatter(L):
|
|
524
|
+
w.indexLabel?y.replaceKeywordsWithValue(w.indexLabel,b,w,z):b.label?b.label:"";0>=n&&(n=0);1E3>B&&1E3-B<v&&(B+=1E3-B);N.roundRect||Ha(N);c=new na(N,{fontSize:h,fontFamily:m,fontColor:g,fontStyle:d,fontWeight:p,horizontalAlign:c,textAlign:r,backgroundColor:f,maxWidth:B,maxHeight:!1===t[z]?l?4.28571429*h:1.5*h:t[z],text:b,padding:ka});c.measureText();H.push({textBlock:c,id:w.reversed?C:z,isDirty:!1,lineColor:a,lineThickness:n,lineDashType:q,height:c.height<c.maxHeight?c.height:c.maxHeight,width:c.width<
|
|
525
|
+
c.maxWidth?c.width:c.maxWidth})}}}function g(){var a,b,c,f,g,h=[];g=!1;c=0;for(var k,e=R-aa-W/2,e=w.options.indexLabelMaxWidth?w.indexLabelMaxWidth>e?e:w.indexLabelMaxWidth:e,d=H.length-1;0<=d;d--){k=A[H[d].id];c=H[d];f=c.textBlock;b=(a=q(d)<V.length?H[q(d)]:null)?a.textBlock:null;c=c.height;a&&f.y+c+ka>b.y&&(g=!0);c=k.indexLabelMaxWidth||e;if(c>e||0>c)c=e;h.push(c)}if(g)for(d=H.length-1;0<=d;d--)a=V[d],H[d].textBlock.maxWidth=h[h.length-(d+1)],H[d].textBlock.measureText(),H[d].textBlock.x=R-e,c=
|
|
526
|
+
H[d].textBlock.height<H[d].textBlock.maxHeight?H[d].textBlock.height:H[d].textBlock.maxHeight,g=H[d].textBlock.width<H[d].textBlock.maxWidth?H[d].textBlock.width:H[d].textBlock.maxWidth,H[d].height=c,H[d].width=g,c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,H[d].textBlock.y=c-H[d].height/2,w.reversed?(H[d].textBlock.y+H[d].height>T+C&&(H[d].textBlock.y=T+C-H[d].height),H[d].textBlock.y<ca-C&&(H[d].textBlock.y=ca-C)):(H[d].textBlock.y<T-C&&(H[d].textBlock.y=T-C),H[d].textBlock.y+H[d].height>
|
|
527
|
+
ca+C&&(H[d].textBlock.y=ca+C-H[d].height))}function h(){var a,b,c,f;if("inside"!==w.indexLabelPlacement)for(var g=0;g<V.length;g++)0==H[g].textBlock.text.length?H[g].isDirty=!0:(a=V[g],c="undefined"!==typeof a.x5?(a.y2+a.y4)/2:(a.y2+a.y3)/2,b=w.reversed?"undefined"!==typeof a.x5?c>fa?k(c).x2+1:(a.x2+a.x3)/2+1:(a.x2+a.x3)/2+1:"undefined"!==typeof a.x5?c<fa?k(c).x2+1:(a.x4+a.x3)/2+1:(a.x2+a.x3)/2+1,H[g].textBlock.x=b+W,H[g].textBlock.y=c-H[g].height/2,w.reversed?(H[g].textBlock.y+H[g].height>T+C&&(H[g].textBlock.y=
|
|
528
|
+
T+C-H[g].height),H[g].textBlock.y<ca-C&&(H[g].textBlock.y=ca-C)):(H[g].textBlock.y<T-C&&(H[g].textBlock.y=T-C),H[g].textBlock.y+H[g].height>ca+C&&(H[g].textBlock.y=ca+C-H[g].height)));else for(g=0;g<V.length;g++)0==H[g].textBlock.text.length?H[g].isDirty=!0:(a=V[g],b=a.height,c=H[g].height,f=H[g].width,b>=c?(b=g!=ea?(a.x4+a.x3)/2-f/2:(a.x5+a.x4)/2-f/2,c=g!=ea?(a.y1+a.y3)/2-c/2:(a.y1+a.y4)/2-c/2,H[g].textBlock.x=b,H[g].textBlock.y=c):H[g].isDirty=!0)}function d(){function a(b,c){var f;if(0>b||b>=H.length)return 0;
|
|
529
|
+
var g,h=H[b].textBlock;if(0>c){c*=-1;g=p(b);f=l(g,b);if(f>=c)return h.y-=c,c;if(0==b)return 0<f&&(h.y-=f),f;f+=a(g,-(c-f));0<f&&(h.y-=f);return f}g=q(b);f=l(b,g);if(f>=c)return h.y+=c,c;if(b==V.length-1)return 0<f&&(h.y+=f),f;f+=a(g,c-f);0<f&&(h.y+=f);return f}function b(){var a,f,g,h,k=0,d;h=(M-O+2*C)/n;d=n;for(var e,m=1;m<d;m++){g=m*h;for(var l=H.length-1;0<=l;l--)!H[l].isDirty&&(H[l].textBlock.y<g&&H[l].textBlock.y+H[l].height>g)&&(e=q(l),!(e>=H.length-1)&&H[l].textBlock.y+H[l].height+ka>H[e].textBlock.y&&
|
|
530
|
+
(H[l].textBlock.y=H[l].textBlock.y+H[l].height-g>g-H[l].textBlock.y?g+1:g-H[l].height-1))}for(e=V.length-1;0<e;e--)if(!H[e].isDirty){g=p(e);if(0>g&&(g=0,H[g].isDirty))break;if(H[e].textBlock.y<H[g].textBlock.y+H[g].height){f=f||e;h=e;for(d=0;H[h].textBlock.y<H[g].textBlock.y+H[g].height+ka;){a=a||H[h].textBlock.y+H[h].height;d+=H[h].height;d+=ka;h=g;if(0>=h){h=0;d+=H[h].height;break}g=p(h);if(0>g){h=0;d+=H[h].height;break}}if(h!=e){k=H[h].textBlock.y;a-=k;a=d-a;k=c(a,f,h);break}}}return k}function c(a,
|
|
531
|
+
b,f){var g=[],h=0,k=0;for(a=Math.abs(a);f<=b;f++)g.push(V[f]);g.sort(function(a,b){return a.height-b.height});for(f=0;f<g.length;f++)if(b=g[f],h<a)k++,h+=H[b.id].height+ka,H[b.id].textBlock.text="",H[b.id].indexLabelText="",H[b.id].isDirty=!0,H[b.id].textBlock.measureText();else break;return k}for(var f,g,h,k,e,m,n=1,B=0;B<2*n;B++){for(var r=H.length-1;0<=r&&!(0<=p(r)&&p(r),h=H[r],k=h.textBlock,m=(e=q(r)<V.length?H[q(r)]:null)?e.textBlock:null,f=+h.height.toFixed(6),g=+k.y.toFixed(6),!h.isDirty&&
|
|
532
|
+
(e&&g+f+ka>+m.y.toFixed(6))&&(f=k.y+f+ka-m.y,g=a(r,-f),g<f&&(0<g&&(f-=g),g=a(q(r),f),g!=f)));r--);b()}}function l(a,b){return(b<V.length?H[b].textBlock.y:w.reversed?T+C:ca+C)-(0>a?w.reversed?ca-C:T-C:H[a].textBlock.y+H[a].height+ka)}function t(a,b,c){var f,g,k,d=[],e=C,p=[];-1!==b&&(0<=ga.indexOf(b)?(g=ga.indexOf(b),ga.splice(g,1)):(ga.push(b),ga=ga.sort(function(a,b){return a-b})));if(0===ga.length)d=oa;else{g=C*(1!=ga.length||0!=ga[0]&&ga[0]!=V.length-1?2:1)/m();for(var q=0;q<V.length;q++){if(1==
|
|
533
|
+
ga.length&&0==ga[0]){if(0===q){d.push(oa[q]);f=e;continue}}else 0===q&&(f=-1*e);d.push(oa[q]+f);if(0<=ga.indexOf(q)||q<V.length&&0<=ga.indexOf(q+1))f+=g}}k=function(){for(var a=[],b=0;b<V.length;b++)a.push(d[b]-V[b].y1);return a}();var l={startTime:(new Date).getTime(),duration:c||500,easingFunction:function(a,b,c,f){return x.easing.easeOutQuart(a,b,c,f)},changeSection:function(a){for(var b,c,f=0;f<V.length;f++)b=k[f],c=V[f],b*=a,"undefined"===typeof p[f]&&(p[f]=0),0>p&&(p*=-1),c.y1+=b-p[f],c.y2+=
|
|
534
|
+
b-p[f],c.y3+=b-p[f],c.y4+=b-p[f],c.y5&&(c.y5+=b-p[f],c.y6+=b-p[f]),p[f]=b}};a._animator.animate(0,c,function(c){var f=a.plotArea.ctx||a.ctx;pa=!0;f.clearRect(z.x1,z.y1,z.x2-z.x1,z.y2-z.y1);f.fillStyle=a.backgroundColor;f.fillRect(z.x1,z.y1,z.width,z.height);l.changeSection(c,b);var g={};g.dataSeries=w;g.dataPoint=w.reversed?w.dataPoints[A.length-1-b]:w.dataPoints[b];g.index=w.reversed?A.length-1-b:b;a.toolTip.highlightObjects([g]);for(g=0;g<V.length;g++)v(f,V[g],w.fillOpacity);u(f);J&&("inside"!==
|
|
535
|
+
w.indexLabelPlacement?n(f):h(),r(f));1<=c&&(pa=!1)},null,x.easing.easeOutQuart)}function m(){for(var a=0,b=0;b<V.length-1;b++)(0<=ga.indexOf(b)||0<=ga.indexOf(b+1))&&a++;return a}function n(a){for(var b,c,f,g,h=0;h<V.length;h++)g=1===H[h].lineThickness%2?0.5:0,c=((V[h].y2+V[h].y4)/2<<0)+g,b=k(c).x2-1,f=H[h].textBlock.x,g=(H[h].textBlock.y+H[h].height/2<<0)+g,H[h].isDirty||0==H[h].lineThickness||(a.strokeStyle=H[h].lineColor,a.lineWidth=H[h].lineThickness,a.setLineDash&&a.setLineDash(S(H[h].lineDashType,
|
|
536
|
+
H[h].lineThickness)),a.beginPath(),a.moveTo(b,c),a.lineTo(f,g),a.stroke())}function p(a){for(a-=1;-1<=a&&-1!=a&&H[a].isDirty;a--);return a}function q(a){for(a+=1;a<=V.length&&a!=V.length&&H[a].isDirty;a++);return a}function k(a){for(var b,c=0;c<A.length;c++)if(V[c].y1<a&&V[c].y4>a){b=V[c];break}return b?(a=b.y6?a>b.y6?b.x3+(b.x4-b.x3)/(b.y4-b.y3)*(a-b.y3):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2):b.x2+(b.x3-b.x2)/(b.y3-b.y2)*(a-b.y2),{x1:a,x2:a}):-1}function r(a){for(var b=0;b<V.length;b++)H[b].isDirty||
|
|
537
|
+
(a&&(H[b].textBlock.ctx=a),H[b].textBlock.render(!0))}function u(a){y.plotArea.layoutManager.reset();a.roundRect||Ha(a);y.title&&(y.title.dockInsidePlotArea||"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&&
|
|
538
|
+
"center"===y.legend.verticalAlign)&&(y.legend.ctx=a,y.legend.setLayout(),y.legend.render());Ca.fNg&&Ca.fNg(y)}var y=this;if(!(0>=a.dataSeriesIndexes.length)){for(var w=this.data[a.dataSeriesIndexes[0]],A=w.dataPoints,z=this.plotArea,C=0.025*z.width,E=0.01*z.width,D=0,F=z.height-2*C,I=Math.min(z.width-2*E,2.8*z.height),J=!1,X=0;X<A.length;X++)if(!J&&("undefined"!==typeof A[X].indexLabel&&null!==A[X].indexLabel&&0<A[X].indexLabel.toString().length)&&(J=!0),!J&&("undefined"!==typeof A[X].label&&null!==
|
|
539
|
+
A[X].label&&0<A[X].label.toString().length)&&(J=!0),!J&&"function"===typeof w.indexLabelFormatter||"function"===typeof A[X].indexLabelFormatter)J=!0;J=J||"undefined"!==typeof w.indexLabel&&null!==w.indexLabel&&0<w.indexLabel.toString().length;"inside"!==w.indexLabelPlacement&&J||(E=(z.width-0.75*I)/2);var X=z.x1+E,R=z.x2-E,O=z.y1+C,M=z.y2-C,N=a.targetCanvasCtx||this.plotArea.ctx||this.ctx;if(0!=w.length&&(w.dataPoints&&w.visible)&&0!==A.length){var P,G;a=75*I/100;var W=30*(R-a)/100;"funnel"===w.type?
|
|
540
|
+
(P=e(w.options.neckHeight)?0.35*F:w.neckHeight,G=e(w.options.neckWidth)?0.25*a:w.neckWidth,"string"===typeof P&&P.match(/%$/)?(P=parseInt(P),P=P*F/100):P=parseInt(P),"string"===typeof G&&G.match(/%$/)?(G=parseInt(G),G=G*a/100):G=parseInt(G),P>F?P=F:0>=P&&(P=0),G>a?G=a-0.5:0>=G&&(G=0)):"pyramid"===w.type&&(G=P=0,w.reversed=w.reversed?!1:!0);var E=X+a/2,$=X,aa=X+a,T=w.reversed?M:O,U=E-G/2,ba=E+G/2,fa=w.reversed?O+P:M-P,ca=w.reversed?O:M;a=[];var E=[],V=[],I=[],Y=O,ea,ia=(fa-T)/(U-$),la=-ia,X="area"===
|
|
541
|
+
(w.valueRepresents?w.valueRepresents:"height")?c():f();if(-1!==X){if(w.reversed)for(I.push(Y),G=X.length-1;0<G;G--)Y+=X[G],I.push(Y);else for(G=0;G<X.length;G++)Y+=X[G],I.push(Y);if(w.reversed)for(G=0;G<X.length;G++)I[G]<fa?(a.push(U),E.push(ba),ea=G):(a.push((I[G]-T+ia*$)/ia),E.push((I[G]-T+la*aa)/la));else for(G=0;G<X.length;G++)I[G]<fa?(a.push((I[G]-T+ia*$)/ia),E.push((I[G]-T+la*aa)/la),ea=G):(a.push(U),E.push(ba));for(G=0;G<X.length-1;G++)Y=w.reversed?A[A.length-1-G].color?A[A.length-1-G].color:
|
|
542
|
+
w._colorSet[(A.length-1-G)%w._colorSet.length]:A[G].color?A[G].color:w._colorSet[G%w._colorSet.length],G===ea?V.push({x1:a[G],y1:I[G],x2:E[G],y2:I[G],x3:ba,y3:fa,x4:E[G+1],y4:I[G+1],x5:a[G+1],y5:I[G+1],x6:U,y6:fa,id:G,height:I[G+1]-I[G],color:Y}):V.push({x1:a[G],y1:I[G],x2:E[G],y2:I[G],x3:E[G+1],y3:I[G+1],x4:a[G+1],y4:I[G+1],id:G,height:I[G+1]-I[G],color:Y});var ka=2,H=[],pa=!1,ga=[],oa=[],X=!1;a=a=0;Ea(ga);for(G=0;G<A.length;G++)A[G].exploded&&(X=!0,w.reversed?ga.push(A.length-1-G):ga.push(G));N.clearRect(z.x1,
|
|
543
|
+
z.y1,z.width,z.height);N.fillStyle=y.backgroundColor;N.fillRect(z.x1,z.y1,z.width,z.height);if(J&&w.visible&&(b(),h(),g(),"inside"!==w.indexLabelPlacement)){d();for(G=0;G<A.length;G++)H[G].isDirty||(a=H[G].textBlock.x+H[G].width,a=(R-a)/2,0==G&&(D=a),D>a&&(D=a));for(G=0;G<V.length;G++)V[G].x1+=D,V[G].x2+=D,V[G].x3+=D,V[G].x4+=D,V[G].x5&&(V[G].x5+=D,V[G].x6+=D),H[G].textBlock.x+=D}for(G=0;G<V.length;G++)D=V[G],v(N,D,w.fillOpacity),oa.push(D.y1);u(N);J&&w.visible&&("inside"===w.indexLabelPlacement||
|
|
544
|
+
y.animationEnabled||n(N),y.animationEnabled||r());if(!J)for(G=0;G<A.length;G++)D=w.dataPointIds[G],a={id:D,objectType:"dataPoint",dataPointIndex:G,dataSeriesIndex:0,funnelSection:V[w.reversed?A.length-1-G:G]},y._eventManager.objectMap[D]=a;!y.animationEnabled&&X?t(y,-1,0):y.animationEnabled&&!y.animatedRender&&t(y,-1,0);this.funnelPyramidClickHandler=function(a){var b=-1;if(!pa&&!y.isAnimating&&(e(a.dataSeries.explodeOnClick)||a.dataSeries.explodeOnClick)&&(b=w.reversed?A.length-1-a.dataPointIndex:
|
|
545
|
+
a.dataPointIndex,0<=b)){a=b;if("funnel"===w.type||"pyramid"===w.type)w.reversed?A[A.length-1-a].exploded=A[A.length-1-a].exploded?!1:!0:A[a].exploded=A[a].exploded?!1:!0;t(y,b,500)}};return{source:N,dest:this.plotArea.ctx,animationCallback:function(a,b){x.fadeInAnimation(a,b);1<=a&&(t(y,-1,500),u(y.plotArea.ctx||y.ctx))},easingFunction:x.easing.easeInQuad,animationBase:0}}}}};u.prototype.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||
|
|
546
|
+
window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){window.setTimeout(a,1E3/60)}}();u.prototype.cancelRequestAnimFrame=window.cancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout;u.prototype.set=function(a,f,c){c="undefined"===typeof c?!0:c;"options"===a?(this.options=f,c&&this.render()):u.base.set.call(this,a,f,c)};u.prototype.exportChart=
|
|
547
|
+
function(a){a="undefined"===typeof a?{}:a;var f=a.format?a.format:"png",c=a.fileName?a.fileName:this.exportFileName;if(a.toDataURL)return this.canvas.toDataURL("image/"+f);db(this.canvas,f,c)};u.prototype.print=function(){var a=this.exportChart({toDataURL:!0}),f=document.createElement("iframe");f.setAttribute("class","canvasjs-chart-print-frame");M(f,{position:"absolute",width:"100%",border:"0px",margin:"0px 0px 0px 0px",padding:"0px 0px 0px 0px"});f.style.height=this.height+"px";this._canvasJSContainer.appendChild(f);
|
|
548
|
+
var c=this,b=f.contentWindow||f.contentDocument.document||f.contentDocument;b.document.open();b.document.write('<!DOCTYPE HTML>\n<html><body><img src="'+a+'"/><body/></html>');b.document.body&&b.document.body.style&&(b.document.body.style.margin="0px 0px 0px 0px",b.document.body.style.padding="0px 0px 0px 0px");b.document.close();setTimeout(function(){b.focus();b.print();setTimeout(function(){c._canvasJSContainer.removeChild(f)},1E3)},500)};u.prototype.getPercentAndTotal=function(a,f){var c=null,
|
|
549
|
+
b=null,g=c=null;if(0<=a.type.indexOf("stacked"))b=0,c=f.x.getTime?f.x.getTime():f.x,c in a.plotUnit.yTotals&&(b=a.plotUnit.yTotals[c],c=a.plotUnit.yAbsTotals[c],g=isNaN(f.y)?0:0===c?0:100*(f.y/c));else if("pie"===a.type||"doughnut"===a.type||"funnel"===a.type||"pyramid"===a.type){for(c=b=0;c<a.dataPoints.length;c++)isNaN(a.dataPoints[c].y)||(b+=a.dataPoints[c].y);g=isNaN(f.y)?0:100*(f.y/b)}return{percent:g,total:b}};u.prototype.replaceKeywordsWithValue=function(a,f,c,b,g){var h=this;g="undefined"===
|
|
550
|
+
typeof g?0:g;if((0<=c.type.indexOf("stacked")||"pie"===c.type||"doughnut"===c.type||"funnel"===c.type||"pyramid"===c.type)&&(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))){var d="#percent",e="#total",l=this.getPercentAndTotal(c,f),e=isNaN(l.total)?e:l.total,d=isNaN(l.percent)?d:l.percent;do{l="";if(c.percentFormatString)l=c.percentFormatString;else{var l="#,##0.",m=Math.max(Math.ceil(Math.log(1/Math.abs(d))/Math.LN10),2);if(isNaN(m)||!isFinite(m))m=2;for(var n=0;n<m;n++)l+="#";c.percentFormatString=
|
|
551
|
+
l}a=a.replace("#percent",ca(d,l,h._cultureInfo));a=a.replace("#total",ca(e,c.yValueFormatString?c.yValueFormatString:"#,##0.########",h._cultureInfo))}while(0<=a.indexOf("#percent")||0<=a.indexOf("#total"))}return a.replace(/\{.*?\}|"[^"]*"|'[^']*'/g,function(a){if('"'===a[0]&&'"'===a[a.length-1]||"'"===a[0]&&"'"===a[a.length-1])return a.slice(1,a.length-1);a=Pa(a.slice(1,a.length-1));a=a.replace("#index",g);var d=null;try{var k=a.match(/(.*?)\s*\[\s*(.*?)\s*\]/);k&&0<k.length&&(d=Pa(k[2]),a=Pa(k[1]))}catch(e){}k=
|
|
552
|
+
null;if("color"===a)return"waterfall"===c.type?f.color?f.color:0<f.y?c.risingColor:c.fallingColor:"error"===c.type?c.color?c.color:c._colorSet[d%c._colorSet.length]:f.color?f.color:c.color?c.color:c._colorSet[b%c._colorSet.length];if(f.hasOwnProperty(a))k=f;else if(c.hasOwnProperty(a))k=c;else return"";k=k[a];null!==d&&(k=k[d]);return"x"===a?(c.axisX&&"dateTime"===c.axisX.valueType||"dateTime"===c.xValueType||f.x&&f.x.getTime)&&!c.axisX.logarithmic?ga(k,f.xValueFormatString?f.xValueFormatString:c.xValueFormatString?
|
|
553
|
+
c.xValueFormatString:c.xValueFormatString=h.axisX&&h.axisX.autoValueFormatString?h.axisX.autoValueFormatString:"DD MMM YY",h._cultureInfo):ca(k,f.xValueFormatString?f.xValueFormatString:c.xValueFormatString?c.xValueFormatString:c.xValueFormatString="#,##0.########",h._cultureInfo):"y"===a?ca(k,f.yValueFormatString?f.yValueFormatString:c.yValueFormatString?c.yValueFormatString:c.yValueFormatString="#,##0.########",h._cultureInfo):"z"===a?ca(k,f.zValueFormatString?f.zValueFormatString:c.zValueFormatString?
|
|
554
|
+
c.zValueFormatString:c.zValueFormatString="#,##0.########",h._cultureInfo):k})};ia(J,aa);J.prototype.setLayout=function(){var a=this.dockInsidePlotArea?this.chart.plotArea:this.chart,f=a.layoutManager.getFreeSpace(),c=null,b=0,g=0,h=0,d=0,l=this.markerMargin=this.chart.options.legend&&!e(this.chart.options.legend.markerMargin)?this.chart.options.legend.markerMargin:0.3*this.fontSize;this.height=0;var v=[],m=[];if("top"===this.verticalAlign||"bottom"===this.verticalAlign)this.orientation="horizontal",
|
|
555
|
+
c=this.verticalAlign,h=this.maxWidth=null!==this.maxWidth?this.maxWidth:f.width,d=this.maxHeight=null!==this.maxHeight?this.maxHeight:0.5*f.height;else if("center"===this.verticalAlign){this.orientation="vertical";if("left"===this.horizontalAlign||"center"===this.horizontalAlign||"right"===this.horizontalAlign)c=this.horizontalAlign;h=this.maxWidth=null!==this.maxWidth?this.maxWidth:0.5*f.width;d=this.maxHeight=null!==this.maxHeight?this.maxHeight:f.height}this.errorMarkerColor=[];for(var n=0;n<this.dataSeries.length;n++){var p=
|
|
556
|
+
this.dataSeries[n];if(p.dataPoints&&p.dataPoints.length)if("pie"!==p.type&&"doughnut"!==p.type&&"funnel"!==p.type&&"pyramid"!==p.type){var q=p.legendMarkerType=p.legendMarkerType?p.legendMarkerType:"line"!==p.type&&"stepLine"!==p.type&&"spline"!==p.type&&"scatter"!==p.type&&"bubble"!==p.type||!p.markerType?"error"===p.type&&p._linkedSeries?p._linkedSeries.legendMarkerType?p._linkedSeries.legendMarkerType:O.getDefaultLegendMarker(p._linkedSeries.type):O.getDefaultLegendMarker(p.type):p.markerType,
|
|
557
|
+
k=p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:p,dataPoint:null}):p.name,r=p.legendMarkerColor=p.legendMarkerColor?p.legendMarkerColor:p.markerColor?p.markerColor:"error"===p.type?e(p.whiskerColor)?p._colorSet[0]:p.whiskerColor:p._colorSet[0],x=p.markerSize||"line"!==p.type&&"stepLine"!==p.type&&"spline"!==p.type?0.75*this.lineHeight:0,t=p.legendMarkerBorderColor?p.legendMarkerBorderColor:p.markerBorderColor,w=p.legendMarkerBorderThickness?
|
|
558
|
+
p.legendMarkerBorderThickness:p.markerBorderThickness?Math.max(1,Math.round(0.2*x)):0;"error"===p.type&&this.errorMarkerColor.push(r);k=this.chart.replaceKeywordsWithValue(k,p.dataPoints[0],p,n);q={markerType:q,markerColor:r,text:k,textBlock:null,chartType:p.type,markerSize:x,lineColor:p._colorSet[0],dataSeriesIndex:p.index,dataPointIndex:null,markerBorderColor:t,markerBorderThickness:w};v.push(q)}else for(var s=0;s<p.dataPoints.length;s++){var u=p.dataPoints[s],q=u.legendMarkerType?u.legendMarkerType:
|
|
559
|
+
p.legendMarkerType?p.legendMarkerType:O.getDefaultLegendMarker(p.type),k=u.legendText?u.legendText:p.legendText?p.legendText:this.itemTextFormatter?this.itemTextFormatter({chart:this.chart,legend:this.options,dataSeries:p,dataPoint:u}):u.name?u.name:"DataPoint: "+(s+1),r=u.legendMarkerColor?u.legendMarkerColor:p.legendMarkerColor?p.legendMarkerColor:u.color?u.color:p.color?p.color:p._colorSet[s%p._colorSet.length],x=0.75*this.lineHeight,t=u.legendMarkerBorderColor?u.legendMarkerBorderColor:p.legendMarkerBorderColor?
|
|
560
|
+
p.legendMarkerBorderColor:u.markerBorderColor?u.markerBorderColor:p.markerBorderColor,w=u.legendMarkerBorderThickness?u.legendMarkerBorderThickness:p.legendMarkerBorderThickness?p.legendMarkerBorderThickness:u.markerBorderThickness||p.markerBorderThickness?Math.max(1,Math.round(0.2*x)):0,k=this.chart.replaceKeywordsWithValue(k,u,p,s),q={markerType:q,markerColor:r,text:k,textBlock:null,chartType:p.type,markerSize:x,dataSeriesIndex:n,dataPointIndex:s,markerBorderColor:t,markerBorderThickness:w};(u.showInLegend||
|
|
561
|
+
p.showInLegend&&!1!==u.showInLegend)&&v.push(q)}}!0===this.reversed&&v.reverse();if(0<v.length){p=null;r=k=u=s=0;u=null!==this.itemWidth?null!==this.itemMaxWidth?Math.min(this.itemWidth,this.itemMaxWidth,h):this.itemMaxWidth=Math.min(this.itemWidth,h):null!==this.itemMaxWidth?Math.min(this.itemMaxWidth,h):this.itemMaxWidth=h;x=0===x?0.75*this.lineHeight:x;u-=x+l;for(n=0;n<v.length;n++){q=v[n];t=u;if("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType)t-=2*0.1*this.lineHeight;if(!(0>=
|
|
562
|
+
d||"undefined"===typeof d||0>=t||"undefined"===typeof t)){if("horizontal"===this.orientation){q.textBlock=new na(this.ctx,{x:0,y:0,maxWidth:t,maxHeight:this.itemWrap?d:this.lineHeight,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"});q.textBlock.measureText();null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(x+l+("line"===q.chartType||"spline"===q.chartType||
|
|
563
|
+
"stepLine"===q.chartType?2*0.1*this.lineHeight:0)));if(!p||p.width+Math.round(q.textBlock.width+x+l+(0===p.width?0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))>h)p={items:[],width:0},m.push(p),this.height+=k,k=0;k=Math.max(k,q.textBlock.height)}else q.textBlock=new na(this.ctx,{x:0,y:0,maxWidth:u,maxHeight:!0===this.itemWrap?d:1.5*this.fontSize,angle:0,text:q.text,horizontalAlign:"left",fontSize:this.fontSize,fontFamily:this.fontFamily,
|
|
564
|
+
fontWeight:this.fontWeight,fontColor:this.fontColor,fontStyle:this.fontStyle,textBaseline:"middle"}),q.textBlock.measureText(),null!==this.itemWidth&&(q.textBlock.width=this.itemWidth-(x+l+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))),this.height<d-this.lineHeight?(p={items:[],width:0},m.push(p)):(p=m[s],s=(s+1)%m.length),this.height+=q.textBlock.height;q.textBlock.x=p.width;q.textBlock.y=0;p.width+=Math.round(q.textBlock.width+x+l+(0===p.width?
|
|
565
|
+
0:this.horizontalSpacing)+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0));p.items.push(q);this.width=Math.max(p.width,this.width);r=q.textBlock.width+(x+l+("line"===q.chartType||"spline"===q.chartType||"stepLine"===q.chartType?2*0.1*this.lineHeight:0))}}this.itemWidth=r;this.height=!1===this.itemWrap?m.length*this.lineHeight:this.height+k;this.height=Math.min(d,this.height);this.width=Math.min(h,this.width)}"top"===this.verticalAlign?(g="left"===this.horizontalAlign?
|
|
566
|
+
f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,b=f.y1):"center"===this.verticalAlign?(g="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,b=f.y1+f.height/2-this.height/2):"bottom"===this.verticalAlign&&(g="left"===this.horizontalAlign?f.x1:"right"===this.horizontalAlign?f.x2-this.width:f.x1+f.width/2-this.width/2,b=f.y2-this.height);this.items=v;for(n=0;n<this.items.length;n++)q=v[n],q.id=++this.chart._eventManager.lastObjectId,
|
|
567
|
+
this.chart._eventManager.objectMap[q.id]={id:q.id,objectType:"legendItem",legendItemIndex:n,dataSeriesIndex:q.dataSeriesIndex,dataPointIndex:q.dataPointIndex};this.markerSize=x;this.rows=m;0<v.length&&a.layoutManager.registerSpace(c,{width:this.width+2+2,height:this.height+5+5});this.bounds={x1:g,y1:b,x2:g+this.width,y2:b+this.height}};J.prototype.render=function(){var a=this.bounds.x1,f=this.bounds.y1,c=this.markerMargin,b=this.maxWidth,g=this.maxHeight,h=this.markerSize,d=this.rows;(0<this.borderThickness&&
|
|
568
|
+
this.borderColor||this.backgroundColor)&&this.ctx.roundRect(a,f,this.width,this.height,this.cornerRadius,this.borderThickness,this.backgroundColor,this.borderColor);for(var e=0,l=0;l<d.length;l++){for(var m=d[l],n=0,p=0;p<m.items.length;p++){var q=m.items[p],k=q.textBlock.x+a+(0===p?0.2*h:this.horizontalSpacing),r=f+e,v=k;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=0.5);this.ctx.save();this.ctx.beginPath();this.ctx.rect(a,f,b,Math.max(g-g%this.lineHeight,0));this.ctx.clip();
|
|
569
|
+
if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)this.ctx.strokeStyle=q.lineColor,this.ctx.lineWidth=Math.ceil(this.lineHeight/8),this.ctx.beginPath(),this.ctx.moveTo(k-0.1*this.lineHeight,r+this.lineHeight/2),this.ctx.lineTo(k+0.85*this.lineHeight,r+this.lineHeight/2),this.ctx.stroke(),v-=0.1*this.lineHeight;if("error"===q.chartType){this.ctx.strokeStyle=this.errorMarkerColor[0];this.ctx.lineWidth=h/8;this.ctx.beginPath();var x=k-0.08*this.lineHeight+0.1*this.lineHeight,
|
|
570
|
+
w=r+0.15*this.lineHeight,s=0.7*this.lineHeight,u=s+0.02*this.lineHeight;this.ctx.moveTo(x,w);this.ctx.lineTo(x+s,w);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(x+s/2,w);this.ctx.lineTo(x+s/2,w+u);this.ctx.stroke();this.ctx.beginPath();this.ctx.moveTo(x,w+u);this.ctx.lineTo(x+s,w+u);this.ctx.stroke();this.errorMarkerColor.shift()}t.drawMarker(k+h/2,r+this.lineHeight/2,this.ctx,q.markerType,"error"===q.chartType||"line"===q.chartType||"spline"===q.chartType?q.markerSize/2:q.markerSize,q.markerColor,
|
|
571
|
+
q.markerBorderColor,q.markerBorderThickness);q.textBlock.x=k+c+h;if("line"===q.chartType||"stepLine"===q.chartType||"spline"===q.chartType)q.textBlock.x+=0.1*this.lineHeight;q.textBlock.y=Math.round(r+this.lineHeight/2);q.textBlock.render(!0);this.ctx.restore();n=0<p?Math.max(n,q.textBlock.height):q.textBlock.height;this.chart.data[q.dataSeriesIndex].visible||(this.ctx.globalAlpha=1);k=W(q.id);this.ghostCtx.fillStyle=k;this.ghostCtx.beginPath();this.ghostCtx.fillRect(v,q.textBlock.y-this.lineHeight/
|
|
572
|
+
2,q.textBlock.x+q.textBlock.width-v,q.textBlock.height);q.x1=this.chart._eventManager.objectMap[q.id].x1=v;q.y1=this.chart._eventManager.objectMap[q.id].y1=q.textBlock.y-this.lineHeight/2;q.x2=this.chart._eventManager.objectMap[q.id].x2=q.textBlock.x+q.textBlock.width;q.y2=this.chart._eventManager.objectMap[q.id].y2=q.textBlock.y+q.textBlock.height-this.lineHeight/2}e+=n}};ia(O,aa);O.prototype.getDefaultAxisPlacement=function(){var a=this.type;if("column"===a||"line"===a||"stepLine"===a||"spline"===
|
|
573
|
+
a||"area"===a||"stepArea"===a||"splineArea"===a||"stackedColumn"===a||"stackedLine"===a||"bubble"===a||"scatter"===a||"stackedArea"===a||"stackedColumn100"===a||"stackedLine100"===a||"stackedArea100"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"normal";if("bar"===a||"stackedBar"===a||"stackedBar100"===a||"rangeBar"===a)return"xySwapped";if("pie"===a||"doughnut"===a||"funnel"===a||"pyramid"===a)return"none";
|
|
574
|
+
"error"!==a&&window.console.log("Unknown Chart Type: "+a);return null};O.getDefaultLegendMarker=function(a){if("column"===a||"stackedColumn"===a||"stackedLine"===a||"bar"===a||"stackedBar"===a||"stackedBar100"===a||"bubble"===a||"scatter"===a||"stackedColumn100"===a||"stackedLine100"===a||"stepArea"===a||"candlestick"===a||"ohlc"===a||"rangeColumn"===a||"rangeBar"===a||"rangeArea"===a||"rangeSplineArea"===a||"boxAndWhisker"===a||"waterfall"===a)return"square";if("line"===a||"stepLine"===a||"spline"===
|
|
575
|
+
a||"pie"===a||"doughnut"===a)return"circle";if("area"===a||"splineArea"===a||"stackedArea"===a||"stackedArea100"===a||"funnel"===a||"pyramid"===a)return"triangle";if("error"===a)return"none";window.console.log("Unknown Chart Type: "+a);return null};O.prototype.getDataPointAtX=function(a,f){if(!this.dataPoints||0===this.dataPoints.length)return null;var c={dataPoint:null,distance:Infinity,index:NaN},b=null,g=0,h=0,d=1,e=Infinity,l=0,m=0,n=0;"none"!==this.chart.plotInfo.axisPlacement&&(this.axisX.logarithmic?
|
|
576
|
+
(n=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),n=1<n?Math.min(Math.max((this.dataPoints.length-1)/n*Math.log(a/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0):(n=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,n=0<n?Math.min(Math.max((this.dataPoints.length-1)/n*(a-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0));for(;;){h=0<d?n+g:n-g;if(0<=h&&h<this.dataPoints.length){var b=this.dataPoints[h],p=this.axisX.logarithmic?b.x>a?b.x/a:a/b.x:
|
|
577
|
+
Math.abs(b.x-a);p<c.distance&&(c.dataPoint=b,c.distance=p,c.index=h);b=p;b<=e?e=b:0<d?l++:m++;if(1E3<l&&1E3<m)break}else if(0>n-g&&n+g>=this.dataPoints.length)break;-1===d?(g++,d=1):d=-1}return f||(c.dataPoint.x.getTime?c.dataPoint.x.getTime():c.dataPoint.x)!==(a.getTime?a.getTime():a)?f&&null!==c.dataPoint?c:null:c};O.prototype.getDataPointAtXY=function(a,f,c){if(!this.dataPoints||0===this.dataPoints.length||a<this.chart.plotArea.x1||a>this.chart.plotArea.x2||f<this.chart.plotArea.y1||f>this.chart.plotArea.y2)return null;
|
|
578
|
+
c=c||!1;var b=[],g=0,h=0,d=1,e=!1,l=Infinity,m=0,n=0,p=0;if("none"!==this.chart.plotInfo.axisPlacement)if(p=(this.chart.axisX[0]?this.chart.axisX[0]:this.chart.axisX2[0]).getXValueAt({x:a,y:f}),this.axisX.logarithmic)var q=Math.log(this.dataPoints[this.dataPoints.length-1].x/this.dataPoints[0].x),p=1<q?Math.min(Math.max((this.dataPoints.length-1)/q*Math.log(p/this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;else q=this.dataPoints[this.dataPoints.length-1].x-this.dataPoints[0].x,p=0<q?Math.min(Math.max((this.dataPoints.length-
|
|
579
|
+
1)/q*(p-this.dataPoints[0].x)>>0,0),this.dataPoints.length):0;for(;;){h=0<d?p+g:p-g;if(0<=h&&h<this.dataPoints.length){var q=this.chart._eventManager.objectMap[this.dataPointIds[h]],k=this.dataPoints[h],r=null;if(q){switch(this.type){case "column":case "stackedColumn":case "stackedColumn100":case "bar":case "stackedBar":case "stackedBar100":case "rangeColumn":case "rangeBar":case "waterfall":case "error":a>=q.x1&&(a<=q.x2&&f>=q.y1&&f<=q.y2)&&(b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-
|
|
580
|
+
a),Math.abs(q.x2-a),Math.abs(q.y1-f),Math.abs(q.y2-f))}),e=!0);break;case "line":case "stepLine":case "spline":case "area":case "stepArea":case "stackedArea":case "stackedArea100":case "splineArea":case "scatter":var v=qa("markerSize",k,this)||4,x=c?20:v,r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-f,2));r<=x&&b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:r});q=Math.abs(q.x1-a);q<=l?l=q:0<d?m++:n++;r<=v/2&&(e=!0);break;case "rangeArea":case "rangeSplineArea":v=qa("markerSize",k,this)||
|
|
581
|
+
4;x=c?20:v;r=Math.min(Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-f,2)),Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y2-f,2)));r<=x&&b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:r});q=Math.abs(q.x1-a);q<=l?l=q:0<d?m++:n++;r<=v/2&&(e=!0);break;case "bubble":v=q.size;r=Math.sqrt(Math.pow(q.x1-a,2)+Math.pow(q.y1-f,2));r<=v/2&&(b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:r}),e=!0);break;case "pie":case "doughnut":v=q.center;x="doughnut"===this.type?q.percentInnerRadius*q.radius:
|
|
582
|
+
0;r=Math.sqrt(Math.pow(v.x-a,2)+Math.pow(v.y-f,2));r<q.radius&&r>x&&(r=Math.atan2(f-v.y,a-v.x),0>r&&(r+=2*Math.PI),r=Number(((180*(r/Math.PI)%360+360)%360).toFixed(12)),v=Number(((180*(q.startAngle/Math.PI)%360+360)%360).toFixed(12)),x=Number(((180*(q.endAngle/Math.PI)%360+360)%360).toFixed(12)),0===x&&1<q.endAngle&&(x=360),v>=x&&0!==k.y&&(x+=360,r<v&&(r+=360)),r>v&&r<x&&(b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:0}),e=!0));break;case "funnel":case "pyramid":r=q.funnelSection;
|
|
583
|
+
f>r.y1&&f<r.y4&&(r.y6?f>r.y6?(h=r.x6+(r.x5-r.x6)/(r.y5-r.y6)*(f-r.y6),r=r.x3+(r.x4-r.x3)/(r.y4-r.y3)*(f-r.y3)):(h=r.x1+(r.x6-r.x1)/(r.y6-r.y1)*(f-r.y1),r=r.x2+(r.x3-r.x2)/(r.y3-r.y2)*(f-r.y2)):(h=r.x1+(r.x4-r.x1)/(r.y4-r.y1)*(f-r.y1),r=r.x2+(r.x3-r.x2)/(r.y3-r.y2)*(f-r.y2)),a>h&&a<r&&(b.push({dataPoint:k,dataPointIndex:q.dataPointIndex,dataSeries:this,distance:0}),e=!0));break;case "boxAndWhisker":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&f>=q.y4-q.borderThickness/2&&f<=q.y1+q.borderThickness/
|
|
584
|
+
2||Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&f>=q.y1&&f<=q.y4)b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-f),Math.abs(q.y3-f))}),e=!0;break;case "candlestick":if(a>=q.x1-q.borderThickness/2&&a<=q.x2+q.borderThickness/2&&f>=q.y2-q.borderThickness/2&&f<=q.y3+q.borderThickness/2||Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&f>=q.y1&&f<=q.y4)b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),
|
|
585
|
+
Math.abs(q.x2-a),Math.abs(q.y2-f),Math.abs(q.y3-f))}),e=!0;break;case "ohlc":if(Math.abs(q.x2-a+q.x1-a)<q.borderThickness&&f>=q.y2&&f<=q.y3||a>=q.x1&&a<=(q.x2+q.x1)/2&&f>=q.y1-q.borderThickness/2&&f<=q.y1+q.borderThickness/2||a>=(q.x1+q.x2)/2&&a<=q.x2&&f>=q.y4-q.borderThickness/2&&f<=q.y4+q.borderThickness/2)b.push({dataPoint:k,dataPointIndex:h,dataSeries:this,distance:Math.min(Math.abs(q.x1-a),Math.abs(q.x2-a),Math.abs(q.y2-f),Math.abs(q.y3-f))}),e=!0}if(e||1E3<m&&1E3<n)break}}else if(0>p-g&&p+g>=
|
|
586
|
+
this.dataPoints.length)break;-1===d?(g++,d=1):d=-1}a=null;for(f=0;f<b.length;f++)a?b[f].distance<=a.distance&&(a=b[f]):a=b[f];return a};O.prototype.getMarkerProperties=function(a,f,c,b){var g=this.dataPoints,h=g[a].markerColor?g[a].markerColor:this.markerColor?this.markerColor:g[a].color?g[a].color:this.color?this.color:this._colorSet[a%this._colorSet.length],d=g[a].markerBorderColor?g[a].markerBorderColor:this.markerBorderColor?this.markerBorderColor:null,l=e(g[a].markerBorderThickness)?this.markerBorderThickness?
|
|
587
|
+
this.markerBorderThickness:null:g[a].markerBorderThickness,v=g[a].markerType?g[a].markerType:this.markerType;a=e(g[a].markerSize)?this.markerSize:g[a].markerSize;return{x:f,y:c,ctx:b,type:v,size:a,color:h,borderColor:d,borderThickness:l}};ia(z,aa);z.prototype.createExtraLabelsForLog=function(a){a=(a||0)+1;if(!(5<a)){var f=this.logLabelValues[0]||this.intervalStartPosition;if(Math.log(this.range)/Math.log(f/this.viewportMinimum)<this.noTicks-1){for(var c=z.getNiceNumber((f-this.viewportMinimum)/Math.min(Math.max(2,
|
|
588
|
+
this.noTicks-this.logLabelValues.length),3),!0),b=Math.ceil(this.viewportMinimum/c)*c;b<f;b+=c)b<this.viewportMinimum||this.logLabelValues.push(b);this.logLabelValues.sort(Xa);this.createExtraLabelsForLog(a)}}};z.prototype.createLabels=function(){var a,f,c=0,b=0,g,h=0,d=0,b=0,b=this.interval,l=0,v,m=0.6*this.chart.height,n;a=!1;var p=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],q=p.length?e(this.scaleBreaks.firstBreakIndex)?0:this.scaleBreaks.firstBreakIndex:0;if("axisX"!==this.type||"dateTime"!==
|
|
589
|
+
this.valueType||this.logarithmic){g=this.viewportMaximum;if(this.labels){a=Math.ceil(b);for(var b=Math.ceil(this.intervalStartPosition),k=!1,c=b;c<this.viewportMaximum;c+=a)if(this.labels[c])k=!0;else{k=!1;break}k&&(this.interval=a,this.intervalStartPosition=b)}if(this.logarithmic&&!this.equidistantInterval)for(this.logLabelValues||(this.logLabelValues=[],this.createExtraLabelsForLog()),b=0,k=q;b<this.logLabelValues.length;b++)if(c=this.logLabelValues[b],c<this.viewportMinimum)b++;else{for(;k<p.length&&
|
|
590
|
+
c>p[k].endValue;k++);a=k<p.length&&c>=p[k].startValue&&c<=p[k].endValue;n=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:n,label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?this.labels[n]:ca(n,this.valueFormatString,this.chart._cultureInfo),a=new na(this.ctx,{x:0,y:0,maxWidth:h,maxHeight:d,angle:this.labelAngle,text:this.prefix+a+this.suffix,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,cornerRadius:this.labelCornerRadius,
|
|
591
|
+
textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle",borderThickness:0}),this._labels.push({position:n,textBlock:a,effectiveHeight:null}))}k=q;for(c=this.intervalStartPosition;c<=g;c=parseFloat(1E-12>this.interval?this.logarithmic&&this.equidistantInterval?c*Math.pow(this.logarithmBase,this.interval):c+this.interval:(this.logarithmic&&this.equidistantInterval?
|
|
592
|
+
c*Math.pow(this.logarithmBase,this.interval):c+this.interval).toFixed(12))){for(;k<p.length&&c>p[k].endValue;k++);a=k<p.length&&c>=p[k].startValue&&c<=p[k].endValue;n=c;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:n,label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?this.labels[n]:ca(n,this.valueFormatString,this.chart._cultureInfo),a=new na(this.ctx,{x:0,y:0,maxWidth:h,maxHeight:d,angle:this.labelAngle,text:this.prefix+a+this.suffix,
|
|
593
|
+
textAlign:this.labelTextAlign,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:n,textBlock:a,effectiveHeight:null}))}}else for(this.intervalStartPosition=this.getLabelStartPoint(new Date(this.viewportMinimum),
|
|
594
|
+
this.intervalType,this.interval),g=cb(new Date(this.viewportMaximum),this.interval,this.intervalType),k=q,c=this.intervalStartPosition;c<g;cb(c,b,this.intervalType)){for(a=c.getTime();k<p.length&&a>p[k].endValue;k++);n=a;a=k<p.length&&a>=p[k].startValue&&a<=p[k].endValue;a||(a=this.labelFormatter?this.labelFormatter({chart:this.chart,axis:this.options,value:new Date(n),label:this.labels[n]?this.labels[n]:null}):"axisX"===this.type&&this.labels[n]?this.labels[n]:ga(n,this.valueFormatString,this.chart._cultureInfo),
|
|
595
|
+
a=new na(this.ctx,{x:0,y:0,maxWidth:h,backgroundColor:this.labelBackgroundColor,borderColor:this.labelBorderColor,borderThickness:this.labelBorderThickness,cornerRadius:this.labelCornerRadius,maxHeight:d,angle:this.labelAngle,text:this.prefix+a+this.suffix,textAlign:this.labelTextAlign,fontSize:this.labelFontSize,fontFamily:this.labelFontFamily,fontWeight:this.labelFontWeight,fontColor:this.labelFontColor,fontStyle:this.labelFontStyle,textBaseline:"middle"}),this._labels.push({position:n,textBlock:a,
|
|
596
|
+
effectiveHeight:null,breaksLabelType:void 0}))}if("bottom"===this._position||"top"===this._position)l=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.width*Math.log(Math.min(this._labels[this._labels.length-1].position/this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.width/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*
|
|
597
|
+
ba[this.intervalType+"Duration"]*this.interval,h="undefined"===typeof this.options.labelMaxWidth?0.5*this.chart.width>>0:this.options.labelMaxWidth,this.chart.panEnabled||(d="undefined"===typeof this.options.labelWrap||this.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize);else if("left"===this._position||"right"===this._position)l=this.logarithmic&&!this.equidistantInterval&&2<=this._labels.length?this.lineCoordinates.height*Math.log(Math.min(this._labels[this._labels.length-1].position/
|
|
598
|
+
this._labels[this._labels.length-2].position,this._labels[1].position/this._labels[0].position))/Math.log(this.range):this.lineCoordinates.height/(this.logarithmic&&this.equidistantInterval?Math.log(this.range)/Math.log(this.logarithmBase):Math.abs(this.range))*ba[this.intervalType+"Duration"]*this.interval,this.chart.panEnabled||(h="undefined"===typeof this.options.labelMaxWidth?0.3*this.chart.width>>0:this.options.labelMaxWidth),d="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*
|
|
599
|
+
this.chart.height>>0:1.5*this.labelFontSize;for(b=0;b<this._labels.length;b++){a=this._labels[b].textBlock;a.maxWidth=h;a.maxHeight=d;var r=a.measureText();v=r.height}g=[];q=p=0;if(this.labelAutoFit||this.options.labelAutoFit)if(e(this.labelAngle)||(this.labelAngle=(this.labelAngle%360+360)%360,90<this.labelAngle&&270>this.labelAngle?this.labelAngle-=180:270<=this.labelAngle&&360>=this.labelAngle&&(this.labelAngle-=360)),"bottom"===this._position||"top"===this._position)if(h=0.9*l>>0,q=0,!this.chart.panEnabled&&
|
|
600
|
+
1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=h;this.sessionVariables.labelMaxHeight=d;this.sessionVariables.labelAngle=this.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;for(var x,k=a.text.split(" "),b=0;b<k.length;b++)n=k[b],this.ctx.font=a.fontStyle+" "+a.fontWeight+" "+a.fontSize+"px "+a.fontFamily,n=this.ctx.measureText(n),
|
|
601
|
+
n.width>q&&(x=c,q=n.width)}c=0;for(c=this.intervalStartPosition<this.viewportMinimum?1:0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;r=a.measureText();for(k=c+1;k<this._labels.length;k++)if(!this._labels[k].breaksLabelType){f=this._labels[k].textBlock;f=f.measureText();break}g.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,g);Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));b=h*Math.sin(Math.PI/
|
|
602
|
+
180*Math.abs(this.labelAngle))+(d-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));if(e(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle)if(this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:Math.min((b-h*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),n=(m-(v+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(-25)))/Math.sin(Math.PI/180*Math.abs(-25)),!e(this.options.labelWrap))this.labelWrap?e(this.options.labelMaxWidth)?
|
|
603
|
+
(this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),n),this.sessionVariables.labelWrap=this.labelWrap,f&&r.width+f.width>>0>2*h&&(this.sessionVariables.labelAngle=-25)):(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>h?-25:this.sessionVariables.labelAngle):e(this.options.labelMaxWidth)?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=
|
|
604
|
+
d,this.sessionVariables.labelMaxWidth=h,f&&r.width+f.width>>0>2*h&&(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n)):(this.sessionVariables.labelAngle=this.sessionVariables.labelMaxWidth>h?-25:this.sessionVariables.labelAngle,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelWrap=this.labelWrap);else{if(e(this.options.labelWrap))if(!e(this.options.labelMaxWidth))this.options.labelMaxWidth<h?
|
|
605
|
+
(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth,this.sessionVariables.labelMaxHeight=d);else if(!e(f))if(b=r.width+f.width>>0,k=this.labelFontSize,q<h)b-2*h>p&&(p=b-2*h,b>=2*h&&b<2.2*h?(this.sessionVariables.labelMaxWidth=h,e(this.options.labelFontSize)&&12<k&&(k=Math.floor(12/13*k),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?
|
|
606
|
+
k:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=2.2*h&&b<2.8*h?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n,this.sessionVariables.labelFontSize=k):b>=2.8*h&&b<3.2*h?(this.sessionVariables.labelMaxWidth=Math.max(h,q),this.sessionVariables.labelWrap=!0,e(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?
|
|
607
|
+
k:this.options.labelFontSize,this.sessionVariables.labelAngle=this.labelAngle):b>=3.2*h&&b<3.6*h?(this.sessionVariables.labelAngle=-25,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=n,this.sessionVariables.labelFontSize=this.labelFontSize):b>3.6*h&&b<5*h?(e(this.options.labelFontSize)&&12<k&&(k=Math.floor(12/13*k),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?k:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=
|
|
608
|
+
-25,this.sessionVariables.labelMaxWidth=n):b>5*h&&(this.sessionVariables.labelWrap=!0,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelFontSize=k,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelAngle=this.labelAngle));else if(x===c&&(0===x&&q+this._labels[x+1].textBlock.measureText().width-2*h>p||x===this._labels.length-1&&q+this._labels[x-1].textBlock.measureText().width-2*h>p||0<x&&x<this._labels.length-1&&q+this._labels[x+1].textBlock.measureText().width-2*h>p&&
|
|
609
|
+
q+this._labels[x-1].textBlock.measureText().width-2*h>p))p=0===x?q+this._labels[x+1].textBlock.measureText().width-2*h:q+this._labels[x-1].textBlock.measureText().width-2*h,this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?k:this.options.labelFontSize,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelAngle=-25,this.sessionVariables.labelMaxWidth=n;else if(0===p)for(this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?k:this.options.labelFontSize,this.sessionVariables.labelWrap=
|
|
610
|
+
!0,b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),n),r=a.measureText(),b<this._labels.length-1&&(k=b+1,f=this._labels[k].textBlock,f.maxWidth=this.sessionVariables.labelMaxWidth=Math.min(Math.max(h,q),n),f=f.measureText(),r.width+f.width>>0>2*h&&(this.sessionVariables.labelAngle=-25))}else(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:Math.min((b-h*Math.cos(Math.PI/
|
|
611
|
+
180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)),b),n=0!=this.labelAngle?(m-(v+a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)))/Math.sin(Math.PI/180*Math.abs(this.labelAngle)):h,this.sessionVariables.labelMaxHeight=this.labelWrap?(m-n*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)):1.5*this.labelFontSize,e(this.options.labelWrap))?e(this.options.labelWrap)&&(this.labelWrap&&!e(this.options.labelMaxWidth)?
|
|
612
|
+
(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:n,this.sessionVariables.labelMaxHeight=d):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=n,this.sessionVariables.labelMaxHeight=b<0.9*l?0.9*l:b,this.sessionVariables.labelWrap=this.labelWrap)):(this.options.labelWrap?(this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?
|
|
613
|
+
this.options.labelMaxWidth:n):(e(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:n,this.sessionVariables.labelWrap=this.labelWrap),this.sessionVariables.labelMaxHeight=d)}for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=this.labelWrap=this.sessionVariables.labelWrap,
|
|
614
|
+
a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=e(this.options.labelMaxWidth)?e(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=h:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=e(this.options.labelFontSize)?e(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=this.labelFontSize:this.sessionVariables.labelFontSize:
|
|
615
|
+
this.options.labelFontSize,a.angle=this.labelAngle=e(this.options.labelAngle)?e(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=e(this.options.labelWrap)?e(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=e(this.sessionVariables.labelMaxHeight)?this.sessionVariables.labelMaxHeight=d:this.sessionVariables.labelMaxHeight,
|
|
616
|
+
a.measureText();else if("left"===this._position||"right"===this._position)if(h=e(this.options.labelMaxWidth)?0.3*this.chart.width>>0:this.options.labelMaxWidth,d="undefined"===typeof this.options.labelWrap||this.labelWrap?0.3*this.chart.height>>0:1.5*this.labelFontSize,!this.chart.panEnabled&&1<=this._labels.length){this.sessionVariables.labelFontSize=this.labelFontSize;this.sessionVariables.labelMaxWidth=h;this.sessionVariables.labelMaxHeight=d;this.sessionVariables.labelAngle=e(this.sessionVariables.labelAngle)?
|
|
617
|
+
0:this.sessionVariables.labelAngle;this.sessionVariables.labelWrap=this.labelWrap;for(c=0;c<this._labels.length;c++)if(!this._labels[c].breaksLabelType){a=this._labels[c].textBlock;r=a.measureText();for(k=c+1;k<this._labels.length;k++)if(!this._labels[k].breaksLabelType){f=this._labels[k].textBlock;f=f.measureText();break}g.push(a.height);this.sessionVariables.labelMaxHeight=Math.max.apply(Math,g);b=h*Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(d-a.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));
|
|
618
|
+
Math.cos(Math.PI/180*Math.abs(this.labelAngle));Math.sin(Math.PI/180*Math.abs(this.labelAngle));e(this.options.labelAngle)&&isNaN(this.options.labelAngle)&&0!==this.options.labelAngle?e(this.options.labelWrap)?e(this.options.labelWrap)&&(e(this.options.labelMaxWidth)?e(f)||(l=r.height+f.height>>0,l-2*d>q&&(q=l-2*d,l>=2*d&&l<2.4*d?(e(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelFontSize=
|
|
619
|
+
e(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize):l>=2.4*d&&l<2.8*d?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelFontSize=this.labelFontSize,this.sessionVariables.labelWrap=!0):l>=2.8*d&&l<3.2*d?(this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelWrap=!0,e(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?
|
|
620
|
+
this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelAngle=e(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):l>=3.2*d&&l<3.6*d?(this.sessionVariables.labelMaxHeight=b,this.sessionVariables.labelWrap=!0,this.sessionVariables.labelFontSize=this.labelFontSize):l>3.6*d&&l<10*d?(e(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?
|
|
621
|
+
this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelAngle=e(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle):l>10*d&&l<50*d&&(e(this.options.labelFontSize)&&12<this.labelFontSize&&(this.labelFontSize=Math.floor(12/13*this.labelFontSize),a.measureText()),this.sessionVariables.labelFontSize=e(this.options.labelFontSize)?this.labelFontSize:this.options.labelFontSize,this.sessionVariables.labelMaxHeight=
|
|
622
|
+
d,this.sessionVariables.labelMaxWidth=h,this.sessionVariables.labelAngle=e(this.sessionVariables.labelAngle)?0:this.sessionVariables.labelAngle))):(this.sessionVariables.labelMaxHeight=d,this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth)):(this.sessionVariables.labelMaxWidth=this.labelWrap?this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:this.labelMaxWidth?this.options.labelMaxWidth?
|
|
623
|
+
this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth:h,this.sessionVariables.labelMaxHeight=d):(this.sessionVariables.labelAngle=this.labelAngle,this.sessionVariables.labelMaxWidth=0===this.labelAngle?h:Math.min((b-d*Math.sin(Math.PI/180*Math.abs(this.labelAngle)))/Math.cos(Math.PI/180*Math.abs(this.labelAngle)),d),e(this.options.labelWrap))?e(this.options.labelWrap)&&(this.labelWrap&&!e(this.options.labelMaxWidth)?(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:
|
|
624
|
+
this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxHeight=b):(this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:h,this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:b,e(this.options.labelMaxWidth)&&(this.sessionVariables.labelAngle=this.labelAngle))):this.options.labelWrap?(this.sessionVariables.labelMaxHeight=0===this.labelAngle?d:b,this.sessionVariables.labelWrap=this.labelWrap,this.sessionVariables.labelMaxWidth=
|
|
625
|
+
h):(this.sessionVariables.labelMaxHeight=d,e(this.options.labelMaxWidth),this.sessionVariables.labelMaxWidth=this.options.labelMaxWidth?this.options.labelMaxWidth:this.sessionVariables.labelMaxWidth,this.sessionVariables.labelWrap=this.labelWrap)}for(b=0;b<this._labels.length;b++)a=this._labels[b].textBlock,a.maxWidth=this.labelMaxWidth=this.sessionVariables.labelMaxWidth,a.fontSize=this.labelFontSize=this.sessionVariables.labelFontSize,a.angle=this.labelAngle=this.sessionVariables.labelAngle,a.wrap=
|
|
626
|
+
this.labelWrap=this.sessionVariables.labelWrap,a.maxHeight=this.sessionVariables.labelMaxHeight,a.measureText()}else for(c=0;c<this._labels.length;c++)a=this._labels[c].textBlock,a.maxWidth=this.labelMaxWidth=e(this.options.labelMaxWidth)?e(this.sessionVariables.labelMaxWidth)?this.sessionVariables.labelMaxWidth=h:this.sessionVariables.labelMaxWidth:this.options.labelMaxWidth,a.fontSize=this.labelFontSize=e(this.options.labelFontSize)?e(this.sessionVariables.labelFontSize)?this.sessionVariables.labelFontSize=
|
|
627
|
+
this.labelFontSize:this.sessionVariables.labelFontSize:this.options.labelFontSize,a.angle=this.labelAngle=e(this.options.labelAngle)?e(this.sessionVariables.labelAngle)?this.sessionVariables.labelAngle=this.labelAngle:this.sessionVariables.labelAngle:this.labelAngle,a.wrap=this.labelWrap=e(this.options.labelWrap)?e(this.sessionVariables.labelWrap)?this.sessionVariables.labelWrap=this.labelWrap:this.sessionVariables.labelWrap:this.options.labelWrap,a.maxHeight=e(this.sessionVariables.labelMaxHeight)?
|
|
628
|
+
this.sessionVariables.labelMaxHeight=d:this.sessionVariables.labelMaxHeight,a.measureText();for(c=0;c<this.stripLines.length;c++){var h=this.stripLines[c],t;if("outside"===h.labelPlacement){d=this.sessionVariables.labelMaxWidth;if("bottom"===this._position||"top"===this._position)e(h.options.labelWrap)&&!e(this.sessionVariables.stripLineLabelMaxHeight)?t=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=t=h.labelWrap?0.8*this.chart.height>>0:1.5*this.labelFontSize;
|
|
629
|
+
if("left"===this._position||"right"===this._position)e(h.options.labelWrap)&&!e(this.sessionVariables.stripLineLabelMaxHeight)?t=this.sessionVariables.stripLineLabelMaxHeight:this.sessionVariables.stripLineLabelMaxHeight=t=h.labelWrap?0.8*this.chart.width>>0:1.5*this.labelFontSize;e(h.labelBackgroundColor)&&(h.labelBackgroundColor="#EEEEEE")}else d="bottom"===this._position||"top"===this._position?0.9*this.chart.width>>0:0.9*this.chart.height>>0,t=e(h.options.labelWrap)||h.labelWrap?"bottom"===this._position||
|
|
630
|
+
"top"===this._position?0.8*this.chart.width>>0:0.8*this.chart.height>>0:1.5*this.labelFontSize,e(h.labelBackgroundColor)&&(e(h.startValue)&&0!==h.startValue?h.labelBackgroundColor=s?"transparent":null:h.labelBackgroundColor="#EEEEEE");a=new na(this.ctx,{x:0,y:0,backgroundColor:h.labelBackgroundColor,borderColor:h.labelBorderColor,borderThickness:h.labelBorderThickness,cornerRadius:h.labelCornerRadius,maxWidth:h.options.labelMaxWidth?h.options.labelMaxWidth:d,maxHeight:t,angle:this.labelAngle,text:h.labelFormatter?
|
|
631
|
+
h.labelFormatter({chart:this.chart,axis:this,stripLine:h}):h.label,textAlign:this.labelTextAlign,fontSize:"outside"===h.labelPlacement?h.options.labelFontSize?h.labelFontSize:this.labelFontSize:h.labelFontSize,fontFamily:"outside"===h.labelPlacement?h.options.labelFontFamily?h.labelFontFamily:this.labelFontFamily:h.labelFontFamily,fontWeight:"outside"===h.labelPlacement?h.options.labelFontWeight?h.labelFontWeight:this.labelFontWeight:h.labelFontWeight,fontColor:h.labelFontColor||h.color,fontStyle:"outside"===
|
|
632
|
+
h.labelPlacement?h.options.labelFontStyle?h.labelFontStyle:this.fontWeight:h.labelFontStyle,textBaseline:"middle"});this._stripLineLabels.push({position:h.value,textBlock:a,effectiveHeight:null,stripLine:h})}};z.prototype.createLabelsAndCalculateWidth=function(){var a=0,f=0;this._labels=[];this._stripLineLabels=[];var c=this.chart.isNavigator?0:5;if("left"===this._position||"right"===this._position){this.createLabels();if("inside"!=this.labelPlacement||"inside"===this.labelPlacement&&0<this._index)for(f=
|
|
633
|
+
0;f<this._labels.length;f++){var b=this._labels[f].textBlock,g=b.measureText(),h=0,h=0===this.labelAngle?g.width:g.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(g.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle));a<h&&(this.labelEffectiveWidth=a=h);this._labels[f].effectiveWidth=h}for(f=0;f<this._stripLineLabels.length;f++)"outside"===this._stripLineLabels[f].stripLine.labelPlacement&&(this._stripLineLabels[f].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[f].stripLine.value<=
|
|
634
|
+
this.viewportMaximum)&&(b=this._stripLineLabels[f].textBlock,g=b.measureText(),h=0===this.labelAngle?g.width:g.width*Math.cos(Math.PI/180*Math.abs(this.labelAngle))+(g.height-b.fontSize/2)*Math.sin(Math.PI/180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(h+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?h:0),a<h&&(a=h),this.stripLineLabelEffectiveWidth=this._stripLineLabels[f].effectiveWidth=h)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===
|
|
635
|
+
this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+c};z.prototype.createLabelsAndCalculateHeight=function(){var a=0;this._labels=[];this._stripLineLabels=[];var f,c=0,b=this.chart.isNavigator?0:5;if("bottom"===this._position||"top"===this._position){this.createLabels();if("inside"!=this.labelPlacement||"inside"===this.labelPlacement&&0<this._index)for(c=0;c<this._labels.length;c++){f=this._labels[c].textBlock;var g=f.measureText(),h=0,h=0===this.labelAngle?g.height:g.width*Math.sin(Math.PI/
|
|
636
|
+
180*Math.abs(this.labelAngle))+(g.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle));a<h&&(this.labelEffectiveHeight=a=h);this._labels[c].effectiveHeight=h}for(c=0;c<this._stripLineLabels.length;c++)"outside"===this._stripLineLabels[c].stripLine.labelPlacement&&(this._stripLineLabels[c].stripLine.value>=this.viewportMinimum&&this._stripLineLabels[c].stripLine.value<=this.viewportMaximum)&&(f=this._stripLineLabels[c].textBlock,g=f.measureText(),h=0===this.labelAngle?g.height:g.width*
|
|
637
|
+
Math.sin(Math.PI/180*Math.abs(this.labelAngle))+(g.height-f.fontSize/2)*Math.cos(Math.PI/180*Math.abs(this.labelAngle)),"inside"===this.tickPlacement&&(h+=this.tickLength),"inside"===this.labelPlacement&&(a+=0<this._index?h:0),a<h&&(a=h),this.stripLineLabelEffectiveHeight=this._stripLineLabels[c].effectiveHeight=h)}return(this.title?this._titleTextBlock.measureText().height+2:0)+a+("inside"===this.tickPlacement?0<this._index?this.tickLength:0:this.tickLength)+b};z.setLayout=function(a,f,c,b,g,h){var d,
|
|
638
|
+
l,v,m,n=a[0]?a[0].chart:f[0].chart,p=n.isNavigator?0:10,q=n._axes;if(a&&0<a.length)for(var k=0;k<a.length;k++)a[k]&&a[k].calculateAxisParameters();if(f&&0<f.length)for(k=0;k<f.length;k++)f[k].calculateAxisParameters();if(c&&0<c.length)for(k=0;k<c.length;k++)c[k].calculateAxisParameters();if(b&&0<b.length)for(k=0;k<b.length;k++)b[k].calculateAxisParameters();for(k=0;k<q.length;k++)if(q[k]&&q[k].scaleBreaks&&q[k].scaleBreaks._appliedBreaks.length)for(var r=q[k].scaleBreaks._appliedBreaks,x=0;x<r.length&&
|
|
639
|
+
!(r[x].startValue>q[k].viewportMaximum);x++)r[x].endValue<q[k].viewportMinimum||(e(q[k].scaleBreaks.firstBreakIndex)&&(q[k].scaleBreaks.firstBreakIndex=x),r[x].startValue>=q[k].viewPortMinimum&&(q[k].scaleBreaks.lastBreakIndex=x));for(var t=x=0,w=0,s=0,u=0,y=0,z=0,D,E,F=l=0,I,J,R,r=I=J=R=!1,k=0;k<q.length;k++)q[k]&&q[k].title&&(q[k]._titleTextBlock=new na(q[k].ctx,{text:q[k].title,horizontalAlign:"center",fontSize:q[k].titleFontSize,fontFamily:q[k].titleFontFamily,fontWeight:q[k].titleFontWeight,
|
|
640
|
+
fontColor:q[k].titleFontColor,fontStyle:q[k].titleFontStyle,borderColor:q[k].titleBorderColor,borderThickness:q[k].titleBorderThickness,backgroundColor:q[k].titleBackgroundColor,cornerRadius:q[k].titleCornerRadius,textBaseline:"top"}));for(k=0;k<q.length;k++)if(q[k].title)switch(q[k]._position){case "left":q[k]._titleTextBlock.maxWidth=q[k].titleMaxWidth||h.height;q[k]._titleTextBlock.maxHeight=q[k].titleWrap?0.8*h.width:1.5*q[k].titleFontSize;q[k]._titleTextBlock.angle=-90;break;case "right":q[k]._titleTextBlock.maxWidth=
|
|
641
|
+
q[k].titleMaxWidth||h.height;q[k]._titleTextBlock.maxHeight=q[k].titleWrap?0.8*h.width:1.5*q[k].titleFontSize;q[k]._titleTextBlock.angle=90;break;default:q[k]._titleTextBlock.maxWidth=q[k].titleMaxWidth||h.width,q[k]._titleTextBlock.maxHeight=q[k].titleWrap?0.8*h.height:1.5*q[k].titleFontSize,q[k]._titleTextBlock.angle=0}if("normal"===g){for(var s=[],u=[],y=[],z=[],N=[],O=[],M=[],P=[];4>x;){var G=0,W=0,S=0,$=0,T=g=0,U=0,ca=0,aa=0,Y=0,V=0,ba=0;if(c&&0<c.length)for(y=[],k=V=0;k<c.length;k++)y.push(Math.ceil(c[k]?
|
|
642
|
+
c[k].createLabelsAndCalculateWidth():0)),V+=y[k],U+=c[k]&&!n.isNavigator?c[k].margin:0;else y.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateWidth():0));M.push(y);if(b&&0<b.length)for(z=[],k=ba=0;k<b.length;k++)z.push(Math.ceil(b[k]?b[k].createLabelsAndCalculateWidth():0)),ba+=z[k],ca+=b[k]?b[k].margin:0;else z.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateWidth():0));P.push(z);d=Math.round(h.x1+V+U);v=Math.round(h.x2-ba-ca>n.width-p?n.width-p:h.x2-ba-ca);if(a&&0<a.length)for(s=[],k=aa=0;k<a.length;k++)a[k]&&
|
|
643
|
+
(a[k].lineCoordinates={}),a[k].lineCoordinates.width=Math.abs(v-d),a[k].title&&(a[k]._titleTextBlock.maxWidth=0<a[k].titleMaxWidth&&a[k].titleMaxWidth<a[k].lineCoordinates.width?a[k].titleMaxWidth:a[k].lineCoordinates.width),s.push(Math.ceil(a[k]?a[k].createLabelsAndCalculateHeight():0)),aa+=s[k],g+=a[k]&&!n.isNavigator?a[k].margin:0;else s.push(Math.ceil(a[0]?a[0].createLabelsAndCalculateHeight():0));N.push(s);if(f&&0<f.length)for(u=[],k=Y=0;k<f.length;k++)f[k]&&(f[k].lineCoordinates={}),f[k].lineCoordinates.width=
|
|
644
|
+
Math.abs(v-d),f[k].title&&(f[k]._titleTextBlock.maxWidth=0<f[k].titleMaxWidth&&f[k].titleMaxWidth<f[k].lineCoordinates.width?f[k].titleMaxWidth:f[k].lineCoordinates.width),u.push(Math.ceil(f[k]?f[k].createLabelsAndCalculateHeight():0)),Y+=u[k],T+=f[k]&&!n.isNavigator?f[k].margin:0;else u.push(Math.ceil(f[0]?f[0].createLabelsAndCalculateHeight():0));O.push(u);if(a&&0<a.length)for(k=0;k<a.length;k++)a[k]&&(a[k].lineCoordinates.x1=d,v=Math.round(h.x2-ba-ca>n.width-p?n.width-p:h.x2-ba-ca),a[k]._labels&&
|
|
645
|
+
1<a[k]._labels.length&&(l=m=0,m=a[k]._labels[1],l="dateTime"===a[k].valueType?a[k]._labels[a[k]._labels.length-2]:a[k]._labels[a[k]._labels.length-1],t=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),w=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),!a[k]||(!a[k].labelAutoFit||
|
|
646
|
+
e(D)||e(E)||n.isNavigator||n.stockChart)||(l=0,0<a[k].labelAngle?E+w>v&&(l+=0<a[k].labelAngle?E+w-v-ba:0):0>a[k].labelAngle?D-t<d&&D-t<a[k].viewportMinimum&&(F=d-(U+a[k].tickLength+y+D-t+a[k].labelFontSize/2)):0===a[k].labelAngle&&(E+w>v&&(l=E+w/2-v-ba),D-t<d&&D-t<a[k].viewportMinimum&&(F=d-U-a[k].tickLength-y-D+t/2)),a[k].viewportMaximum===a[k].maximum&&a[k].viewportMinimum===a[k].minimum&&0<a[k].labelAngle&&0<l?v-=l:a[k].viewportMaximum===a[k].maximum&&a[k].viewportMinimum===a[k].minimum&&0>a[k].labelAngle&&
|
|
647
|
+
0<F?d+=F:a[k].viewportMaximum===a[k].maximum&&a[k].viewportMinimum===a[k].minimum&&0===a[k].labelAngle&&(0<F&&(d+=F),0<l&&(v-=l))),n.panEnabled?aa=e(n.sessionVariables.axisX.height)?n.sessionVariables.axisX.height=aa:n.sessionVariables.axisX.height:n.sessionVariables.axisX.height=aa,l=Math.round(h.y2-aa-g+G),m=Math.round(h.y2),a[k].lineCoordinates.x2=v,a[k].lineCoordinates.width=v-d,a[k].lineCoordinates.y1=l,a[k].lineCoordinates.y2=l+a[k].lineThickness/2,"inside"===a[k].labelPlacement&&0<k&&(a[k].lineCoordinates.y1=
|
|
648
|
+
a[k-1].lineCoordinates.y2+G+(a[k].labelEffectiveHeight||0),a[k].lineCoordinates.y2=a[k].lineCoordinates.y1+a[k].lineThickness/2),"inside"===a[k].tickPlacement&&0<k&&(a[k].lineCoordinates.y1+=a[k].tickLength,a[k].lineCoordinates.y2=a[k].lineCoordinates.y1+a[k].lineThickness/2),a[k].bounds={x1:d,y1:l,x2:v,y2:m-(aa+g-s[k]-G),width:v-d},a[k].bounds.height=a[k].bounds.y2-a[k].bounds.y1),G+=s[k]+a[k].margin;if(f&&0<f.length)for(k=0;k<f.length;k++)f[k].lineCoordinates.x1=Math.round(h.x1+V+U),f[k].lineCoordinates.x2=
|
|
649
|
+
Math.round(h.x2-ba-ca>n.width-p?n.width-p:h.x2-ba-ca),f[k].lineCoordinates.width=Math.abs(v-d),f[k]._labels&&1<f[k]._labels.length&&(m=f[k]._labels[1],l="dateTime"===f[k].valueType?f[k]._labels[f[k]._labels.length-2]:f[k]._labels[f[k]._labels.length-1],t=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),w=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-
|
|
650
|
+
l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle))),n.panEnabled?Y=e(n.sessionVariables.axisX2.height)?n.sessionVariables.axisX2.height=Y:n.sessionVariables.axisX2.height:n.sessionVariables.axisX2.height=Y,l=Math.round(h.y1),m=f[k].lineCoordinates.y1=l+Y+T-W,f[k].lineCoordinates.y2=l,"inside"===f[k].labelPlacement&&0<k&&(f[k].lineCoordinates.y1=f[k-1].lineCoordinates.y1-W-(f[k].labelEffectiveHeight||0)),"inside"===f[k].tickPlacement&&0<k&&(f[k].lineCoordinates.y1-=f[k].tickLength),
|
|
651
|
+
f[k].bounds={x1:d,y1:l+(Y+T-u[k]-W),x2:v,y2:m,width:v-d},f[k].bounds.height=f[k].bounds.y2-f[k].bounds.y1,W+=u[k]+f[k].margin;if(c&&0<c.length)for(k=0;k<c.length;k++)U=n.isNavigator?0:10,c[k]&&(d=Math.round(a[0]?a[0].lineCoordinates.x1:f[0].lineCoordinates.x1),U=c[k]._labels&&0<c[k]._labels.length?c[k]._labels[c[k]._labels.length-1].textBlock.height/2:p,l=Math.round(h.y1+Y+T<Math.max(U,p)?Math.max(U,p):h.y1+Y+T),v=Math.round(a[0]?a[0].lineCoordinates.x1:f[0].lineCoordinates.x1),U=0<a.length?0:c[k]._labels&&
|
|
652
|
+
0<c[k]._labels.length?c[k]._labels[0].textBlock.height/2:p,m=Math.round(h.y2-aa-g-U),c[k].lineCoordinates={x1:d-S,y1:l,x2:v-S,y2:m,height:Math.abs(m-l)},"inside"===c[k].labelPlacement&&0<k&&(c[k].lineCoordinates.x1=c[k-1].lineCoordinates.x1-S-(c[k].labelEffectiveWidth||0),c[k].lineCoordinates.x2=c[k].lineCoordinates.x1+c[k].lineThickness/2),"inside"===c[k].tickPlacement&&0<k&&(c[k].lineCoordinates.x1-=c[k].tickLength,c[k].lineCoordinates.x2=c[k].lineCoordinates.x1+c[k].lineThickness/2),c[k].bounds=
|
|
653
|
+
{x1:d-(y[k]+S),y1:l,x2:v-S,y2:m,height:m-l},c[k].bounds.width=c[k].bounds.x2-c[k].bounds.x1,c[k].title&&(c[k]._titleTextBlock.maxWidth=0<c[k].titleMaxWidth&&c[k].titleMaxWidth<c[k].lineCoordinates.height?c[k].titleMaxWidth:c[k].lineCoordinates.height),S+=y[k]+c[k].margin);if(b&&0<b.length)for(k=0;k<b.length;k++)b[k]&&(d=Math.round(a[0]?a[0].lineCoordinates.x2:f[0].lineCoordinates.x2),v=Math.round(d),U=b[k]._labels&&0<b[k]._labels.length?b[k]._labels[b[k]._labels.length-1].textBlock.height/2:0,l=Math.round(h.y1+
|
|
654
|
+
Y+T<Math.max(U,p)?Math.max(U,p):h.y1+Y+T),U=0<a.length?0:b[k]._labels&&0<b[k]._labels.length?b[k]._labels[0].textBlock.height/2:0,m=Math.round(h.y2-(aa+g+U)),b[k].lineCoordinates={x1:d+$,y1:l,x2:d+$,y2:m,height:Math.abs(m-l)},"inside"===b[k].labelPlacement&&0<k&&(b[k].lineCoordinates.x1=b[k-1].lineCoordinates.x2+$+(b[k].labelEffectiveWidth||0),b[k].lineCoordinates.x2=b[k].lineCoordinates.x1+b[k].lineThickness/2),"inside"===b[k].tickPlacement&&0<k&&(b[k].lineCoordinates.x1+=b[k].tickLength,b[k].lineCoordinates.x2=
|
|
654
655
|
b[k].lineCoordinates.x1+b[k].lineThickness/2),b[k].bounds={x1:d+$,y1:l,x2:v+(z[k]+$),y2:m,height:m-l},b[k].bounds.width=b[k].bounds.x2-b[k].bounds.x1,b[k].title&&(b[k]._titleTextBlock.maxWidth=0<b[k].titleMaxWidth&&b[k].titleMaxWidth<b[k].lineCoordinates.height?b[k].titleMaxWidth:b[k].lineCoordinates.height),$+=z[k]+b[k].margin);if(a&&0<a.length)for(k=0;k<a.length;k++)a[k]&&(a[k].calculateValueToPixelConversionParameters(),a[k].calculateBreaksSizeInValues(),a[k]._labels&&1<a[k]._labels.length&&(D=
|
|
655
656
|
(a[k].logarithmic?Math.log(a[k]._labels[1].position/a[k].viewportMinimum)/a[k].conversionParameters.lnLogarithmBase:a[k]._labels[1].position-a[k].viewportMinimum)*Math.abs(a[k].conversionParameters.pixelPerUnit)+a[k].lineCoordinates.x1,d=a[k]._labels[a[k]._labels.length-("dateTime"===a[k].valueType?2:1)].position,d=a[k].getApparentDifference(a[k].viewportMinimum,d),E=a[k].logarithmic?(1<d?Math.log(d)/a[k].conversionParameters.lnLogarithmBase*Math.abs(a[k].conversionParameters.pixelPerUnit):0)+a[k].lineCoordinates.x1:
|
|
656
657
|
(0<d?d*Math.abs(a[k].conversionParameters.pixelPerUnit):0)+a[k].lineCoordinates.x1));if(f&&0<f.length)for(k=0;k<f.length;k++)f[k].calculateValueToPixelConversionParameters(),f[k].calculateBreaksSizeInValues(),f[k]._labels&&1<f[k]._labels.length&&(D=(f[k].logarithmic?Math.log(f[k]._labels[1].position/f[k].viewportMinimum)/f[k].conversionParameters.lnLogarithmBase:f[k]._labels[1].position-f[k].viewportMinimum)*Math.abs(f[k].conversionParameters.pixelPerUnit)+f[k].lineCoordinates.x1,d=f[k]._labels[f[k]._labels.length-
|
|
@@ -663,25 +664,25 @@ if(c&&0<c.length)for(k=0;k<c.length;k++)c[k].calculateStripLinesThicknessInValue
|
|
|
663
664
|
else p.push(Math.ceil(c[0]?c[0].createLabelsAndCalculateHeight():0));E.push(p);if(b&&0<b.length)for(D=[],k=0;k<b.length;k++)D.push(Math.ceil(b[k]?b[k].createLabelsAndCalculateHeight():0)),ca+=b[k].margin;else D.push(Math.ceil(b[0]?b[0].createLabelsAndCalculateHeight():0));w.push(D);if(c&&0<c.length)for(k=0;k<c.length;k++)0<c[k]._labels.length&&(m=c[k]._labels[0],l=c[k]._labels[c[k]._labels.length-1],s=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-l.textBlock.fontSize/
|
|
664
665
|
2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),u=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(b&&0<b.length)for(k=0;k<b.length;k++)b[k]&&0<b[k]._labels.length&&(m=b[k]._labels[0],l=b[k]._labels[b[k]._labels.length-1],y=m.textBlock.width*Math.cos(Math.PI/180*Math.abs(m.textBlock.angle))+(m.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(m.textBlock.angle)),
|
|
665
666
|
z=l.textBlock.width*Math.cos(Math.PI/180*Math.abs(l.textBlock.angle))+(l.textBlock.height-l.textBlock.fontSize/2)*Math.sin(Math.PI/180*Math.abs(l.textBlock.angle)));if(n.panEnabled)for(k=0;k<c.length;k++)p[k]=e(n.sessionVariables.axisY.height)?n.sessionVariables.axisY.height=p[k]:n.sessionVariables.axisY.height;else for(k=0;k<c.length;k++)n.sessionVariables.axisY.height=p[k];if(c&&0<c.length)for(k=c.length-1;0<=k;k--)l=Math.round(h.y2),m=Math.round(h.y2>c[k].chart.height?c[k].chart.height:h.y2),c[k].lineCoordinates.y1=
|
|
666
|
-
l-(p[k]+c[k].margin+Y),c[k].lineCoordinates.y2=l-(p[k]+c[k].margin+Y),"inside"===c[k].labelPlacement&&0<k&&(c[k].lineCoordinates.y1=c[k].lineCoordinates.y1+p[k]-(c[k]._titleTextBlock?c[k]._titleTextBlock.height:0)-c[k].tickLength-5,c[k].lineCoordinates.y2=c[k].lineCoordinates.y1+c[k].lineThickness/2),"inside"===c[k].tickPlacement&&0<k&&(c[k].lineCoordinates.y1+=c[k].tickLength,c[k].lineCoordinates.y2=c[k].lineCoordinates.y1+c[k].lineThickness/2),c[k].bounds=
|
|
667
|
-
(Y+c[k].margin),width:v-d,height:p[k]},c[k].title&&(c[k]._titleTextBlock.maxWidth=0<c[k].titleMaxWidth&&c[k].titleMaxWidth<c[k].lineCoordinates.width?c[k].titleMaxWidth:c[k].lineCoordinates.width),Y+=p[k]+c[k].margin;if(b&&0<b.length)for(k=b.length-1;0<=k;k--)b[k]&&(l=Math.round(h.y1),m=Math.round(h.y1+(D[k]+b[k].margin+G)),b[k].lineCoordinates.y1=m,b[k].lineCoordinates.y2=m,"inside"===b[k].labelPlacement&&0<k&&(b[k].lineCoordinates.y1=m-D[k]+(b[k]._titleTextBlock?
|
|
668
|
-
b[k].lineCoordinates.y2=b[k].lineCoordinates.y1-b[k].lineThickness/2),"inside"===b[k].tickPlacement&&0<k&&(b[k].lineCoordinates.y1-=b[k].tickLength,b[k].lineCoordinates.y2=b[k].lineCoordinates.y1-b[k].lineThickness/2),b[k].bounds={x1:d,y1:l+(b[k].margin+G),x2:v,y2:m,width:v-d},b[k].bounds.height=b[k].bounds.y2-b[k].bounds.y1,b[k].title&&(b[k]._titleTextBlock.maxWidth=0<b[k].titleMaxWidth&&b[k].titleMaxWidth<b[k].lineCoordinates.width?
|
|
669
|
-
if(a&&0<a.length)for(k=0;k<a.length;k++){U=a[k]._labels&&0<a[k]._labels.length?a[k]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1+g);l=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:h.y1<Math.max(U,10)?Math.max(U,10):h.y1):h.y1<Math.max(U,10)?Math.max(U,10):h.y1;v=Math.round(h.x1+$+g);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-S>n.height-Math.max(U,10)?n.height-Math.max(U,10):h.y2-S):h.y2>n.height-Math.max(U,
|
|
670
|
-
c.length;U++)c[U]&&c[U].labelAutoFit&&(v=0>c[U].labelAngle?Math.max(v,s):0===c[U].labelAngle?Math.max(v,s/2):v,d=0>c[U].labelAngle||0===c[U].labelAngle?v-$:d);if(b&&0<b.length)for(U=0;U<b.length;U++)b[U]&&b[U].labelAutoFit&&(v=b[U].lineCoordinates.x1,d=v-$);a[k].lineCoordinates={x1:v-M,y1:l,x2:v-M,y2:m,height:Math.abs(m-l)};"inside"===a[k].labelPlacement&&0<k&&(a[k].lineCoordinates.x1=a[k].lineCoordinates.x1-(F[k]-(a[k]._titleTextBlock?a[k]._titleTextBlock.height:
|
|
671
|
-
a[k].lineCoordinates.x1+a[k].lineThickness/2);"inside"===a[k].tickPlacement&&0<k&&(a[k].lineCoordinates.x1-=a[k].tickLength,a[k].lineCoordinates.x2=a[k].lineCoordinates.x1+a[k].lineThickness/2);a[k].bounds={x1:v-(F[k]+M),y1:l,x2:v-M,y2:m,height:m-l};a[k].bounds.width=a[k].bounds.x2-a[k].bounds.x1;a[k].title&&(a[k]._titleTextBlock.maxWidth=0<a[k].titleMaxWidth&&a[k].titleMaxWidth<a[k].lineCoordinates.height?a[k].titleMaxWidth:
|
|
672
|
-
a[k].calculateBreaksSizeInValues();M+=F[k]+a[k].margin}if(f&&0<f.length)for(k=0;k<f.length;k++){U=f[k]._labels&&0<f[k]._labels.length?f[k]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1-g);l=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:h.y1<Math.max(U,10)?Math.max(U,10):h.y1):h.y1<Math.max(U,10)?Math.max(U,10):h.y1;v=Math.round(h.x2-aa-T);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-S>n.height-
|
|
673
|
-
n.height-Math.max(U,10):h.y2;if(c&&0<c.length)for(U=0;U<c.length;U++)c[U]&&c[U].labelAutoFit&&(v=0>c[U].labelAngle?Math.max(v,s):0===c[U].labelAngle?Math.max(v,s/2):v,d=0>c[U].labelAngle||0===c[U].labelAngle?v-aa:d);if(b&&0<b.length)for(U=0;U<b.length;U++)b[U]&&b[U].labelAutoFit&&(v=b[U].lineCoordinates.x2,d=v-aa);f[k].lineCoordinates={x1:v+P,y1:l,x2:v+P,y2:m,height:Math.abs(m-l)};"inside"===f[k].labelPlacement&&0<k&&(f[k].lineCoordinates.x1=
|
|
674
|
-
0)-2)-f[k].tickLength,f[k].lineCoordinates.x2=f[k].lineCoordinates.x1+f[k].lineThickness/2);"inside"===f[k].tickPlacement&&0<k&&(f[k].lineCoordinates.x1+=f[k].tickLength,f[k].lineCoordinates.x2=f[k].lineCoordinates.x1+f[k].lineThickness/2);f[k].bounds={x1:f[k].lineCoordinates.x1,y1:l,x2:v+t[k]+P,y2:m,width:v-d,height:m-l};f[k].bounds.width=f[k].bounds.x2-f[k].bounds.x1;f[k].title&&
|
|
675
|
-
f[k].lineCoordinates.height);f[k].calculateValueToPixelConversionParameters();f[k].calculateBreaksSizeInValues();P+=t[k]+f[k].margin}for(k=0;k<q.length;k++)"axisY"===q[k].type&&(q[k].calculateValueToPixelConversionParameters(),q[k].calculateBreaksSizeInValues());if(0<x){if(a&&0<a.length)for(k=0;k<a.length;k++)r=N[x-1][k]===N[x][k]?!0:!1;else r=!0;if(f&&0<f.length)for(k=0;k<f.length;k++)I=
|
|
676
|
-
|
|
677
|
-
f[k].calculateBreaksInPixels()}};z.render=function(a,f,c,b,g){var h=a[0]?a[0].chart:f[0].chart;g=h.ctx;h.alignVerticalAxes&&h.alignVerticalAxes();g.save();g.beginPath();a&&a.length&&g.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[a.length-1].bounds.y2);f&&f.length&&g.rect(5,f[f.length-1].bounds.y1,f[0].chart.width-10,f[0].bounds.y2);g.clip();if(a&&0<a.length)for(var d=0;d<a.length;d++)a[d].renderLabelsTicksAndTitle();
|
|
678
|
-
if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderLabelsTicksAndTitle();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderLabelsTicksAndTitle();h.preparePlotArea();h=h.plotArea;g.save();g.beginPath();g.rect(h.x1,h.y1,Math.abs(h.x2-h.x1),Math.abs(h.y2-h.y1));g.clip();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("value");if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderStripLinesOfThicknessType("value");
|
|
679
|
-
if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("value");if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderInterlacedColors();if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderInterlacedColors();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderInterlacedColors();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderInterlacedColors();g.restore();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderGrid(),
|
|
680
|
-
0;d<f.length;d++)f[d].renderGrid(),s&&(f[d].createMask(),f[d].renderBreaksBackground());if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderGrid(),s&&(c[d].createMask(),c[d].renderBreaksBackground());if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderGrid(),s&&(b[d].createMask(),b[d].renderBreaksBackground());if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderAxisLine();if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderAxisLine();
|
|
681
|
-
0<b.length)for(d=0;d<b.length;d++)b[d].renderAxisLine();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("pixel");if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("pixel")};z.prototype.calculateStripLinesThicknessInValues=
|
|
682
|
-
this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var f=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue),c=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),f=this.getApparentDifference(f,c);this.stripLines[a].value=this.logarithmic?this.stripLines[a].value*Math.sqrt(Math.log(Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue)/Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue))/
|
|
683
|
-
(Math.abs(this.stripLines[a].endValue-this.stripLines[a].startValue)-f)/2;this.stripLines[a].thickness=f;this.stripLines[a]._thicknessType="value"}};z.prototype.calculateBreaksSizeInValues=function(){for(var a="left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,f=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],c=this.conversionParameters.pixelPerUnit||a/(this.logarithmic?
|
|
684
|
-
this.conversionParameters.minimum:this.conversionParameters.maximum-this.conversionParameters.minimum),b=this.scaleBreaks&&!e(this.scaleBreaks.options.spacing),g,d=0;d<f.length;d++)g=b||!e(f[d].options.spacing),f[d].spacing=Va(f[d].spacing,a,8,g?0.1*a:8,g?0:3)<<0,f[d].size=0>f[d].spacing?0:Math.abs(f[d].spacing/c),this.logarithmic&&(f[d].size=Math.pow(this.logarithmBase,f[d].size))};z.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreaks&&0>=this.scaleBreaks._appliedBreaks.length)){var a=
|
|
667
|
+
l-(p[k]+c[k].margin+Y),c[k].lineCoordinates.y2=l-(p[k]+c[k].margin+Y),"inside"===c[k].labelPlacement&&0<k&&(c[k].lineCoordinates.y1=c[k].lineCoordinates.y1+p[k]-(c[k]._titleTextBlock?c[k]._titleTextBlock.height:0)-c[k].tickLength-(c[k].stripLineLabelEffectiveHeight||0)-5,c[k].lineCoordinates.y2=c[k].lineCoordinates.y1+c[k].lineThickness/2),"inside"===c[k].tickPlacement&&0<k&&(c[k].lineCoordinates.y1+=c[k].tickLength,c[k].lineCoordinates.y2=c[k].lineCoordinates.y1+c[k].lineThickness/2),c[k].bounds=
|
|
668
|
+
{x1:d,y1:l-(p[k]+Y+c[k].margin),x2:v,y2:m-(Y+c[k].margin),width:v-d,height:p[k]},c[k].title&&(c[k]._titleTextBlock.maxWidth=0<c[k].titleMaxWidth&&c[k].titleMaxWidth<c[k].lineCoordinates.width?c[k].titleMaxWidth:c[k].lineCoordinates.width),Y+=p[k]+c[k].margin;if(b&&0<b.length)for(k=b.length-1;0<=k;k--)b[k]&&(l=Math.round(h.y1),m=Math.round(h.y1+(D[k]+b[k].margin+G)),b[k].lineCoordinates.y1=m,b[k].lineCoordinates.y2=m,"inside"===b[k].labelPlacement&&0<k&&(b[k].lineCoordinates.y1=m-D[k]+(b[k]._titleTextBlock?
|
|
669
|
+
b[k]._titleTextBlock.height:0)+b[k].tickLength+(b[k].stripLineLabelEffectiveHeight||0),b[k].lineCoordinates.y2=b[k].lineCoordinates.y1-b[k].lineThickness/2),"inside"===b[k].tickPlacement&&0<k&&(b[k].lineCoordinates.y1-=b[k].tickLength,b[k].lineCoordinates.y2=b[k].lineCoordinates.y1-b[k].lineThickness/2),b[k].bounds={x1:d,y1:l+(b[k].margin+G),x2:v,y2:m,width:v-d},b[k].bounds.height=b[k].bounds.y2-b[k].bounds.y1,b[k].title&&(b[k]._titleTextBlock.maxWidth=0<b[k].titleMaxWidth&&b[k].titleMaxWidth<b[k].lineCoordinates.width?
|
|
670
|
+
b[k].titleMaxWidth:b[k].lineCoordinates.width),G+=D[k]+b[k].margin);if(a&&0<a.length)for(k=0;k<a.length;k++){U=a[k]._labels&&0<a[k]._labels.length?a[k]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1+g);l=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:h.y1<Math.max(U,10)?Math.max(U,10):h.y1):h.y1<Math.max(U,10)?Math.max(U,10):h.y1;v=Math.round(h.x1+$+g);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-S>n.height-Math.max(U,10)?n.height-Math.max(U,10):h.y2-S):h.y2>n.height-Math.max(U,
|
|
671
|
+
10)?n.height-Math.max(U,10):h.y2;if(c&&0<c.length)for(U=0;U<c.length;U++)c[U]&&c[U].labelAutoFit&&(v=0>c[U].labelAngle?Math.max(v,s):0===c[U].labelAngle?Math.max(v,s/2):v,d=0>c[U].labelAngle||0===c[U].labelAngle?v-$:d);if(b&&0<b.length)for(U=0;U<b.length;U++)b[U]&&b[U].labelAutoFit&&(v=b[U].lineCoordinates.x1,d=v-$);a[k].lineCoordinates={x1:v-M,y1:l,x2:v-M,y2:m,height:Math.abs(m-l)};"inside"===a[k].labelPlacement&&0<k&&(a[k].lineCoordinates.x1=a[k].lineCoordinates.x1-(F[k]-(a[k]._titleTextBlock?a[k]._titleTextBlock.height:
|
|
672
|
+
0))+a[k].tickLength+(a[k].stripLineLabelEffectiveWidth||0),a[k].lineCoordinates.x2=a[k].lineCoordinates.x1+a[k].lineThickness/2);"inside"===a[k].tickPlacement&&0<k&&(a[k].lineCoordinates.x1-=a[k].tickLength,a[k].lineCoordinates.x2=a[k].lineCoordinates.x1+a[k].lineThickness/2);a[k].bounds={x1:v-(F[k]+M),y1:l,x2:v-M,y2:m,height:m-l};a[k].bounds.width=a[k].bounds.x2-a[k].bounds.x1;a[k].title&&(a[k]._titleTextBlock.maxWidth=0<a[k].titleMaxWidth&&a[k].titleMaxWidth<a[k].lineCoordinates.height?a[k].titleMaxWidth:
|
|
673
|
+
a[k].lineCoordinates.height);a[k].calculateValueToPixelConversionParameters();a[k].calculateBreaksSizeInValues();M+=F[k]+a[k].margin}if(f&&0<f.length)for(k=0;k<f.length;k++){U=f[k]._labels&&0<f[k]._labels.length?f[k]._labels[0].textBlock.fontSize/2:0;d=Math.round(h.x1-g);l=b&&0<b.length?Math.round(b[0]?b[0].lineCoordinates.y2:h.y1<Math.max(U,10)?Math.max(U,10):h.y1):h.y1<Math.max(U,10)?Math.max(U,10):h.y1;v=Math.round(h.x2-aa-T);m=c&&0<c.length?Math.round(c[0]?c[0].lineCoordinates.y1:h.y2-S>n.height-
|
|
674
|
+
Math.max(U,10)?n.height-Math.max(U,10):h.y2-S):h.y2>n.height-Math.max(U,10)?n.height-Math.max(U,10):h.y2;if(c&&0<c.length)for(U=0;U<c.length;U++)c[U]&&c[U].labelAutoFit&&(v=0>c[U].labelAngle?Math.max(v,s):0===c[U].labelAngle?Math.max(v,s/2):v,d=0>c[U].labelAngle||0===c[U].labelAngle?v-aa:d);if(b&&0<b.length)for(U=0;U<b.length;U++)b[U]&&b[U].labelAutoFit&&(v=b[U].lineCoordinates.x2,d=v-aa);f[k].lineCoordinates={x1:v+P,y1:l,x2:v+P,y2:m,height:Math.abs(m-l)};"inside"===f[k].labelPlacement&&0<k&&(f[k].lineCoordinates.x1=
|
|
675
|
+
f[k].lineCoordinates.x1+(t[k]-(f[k]._titleTextBlock?f[k]._titleTextBlock.height:0)-2)-f[k].tickLength-(f[k].stripLineLabelEffectiveWidth||0),f[k].lineCoordinates.x2=f[k].lineCoordinates.x1+f[k].lineThickness/2);"inside"===f[k].tickPlacement&&0<k&&(f[k].lineCoordinates.x1+=f[k].tickLength,f[k].lineCoordinates.x2=f[k].lineCoordinates.x1+f[k].lineThickness/2);f[k].bounds={x1:f[k].lineCoordinates.x1,y1:l,x2:v+t[k]+P,y2:m,width:v-d,height:m-l};f[k].bounds.width=f[k].bounds.x2-f[k].bounds.x1;f[k].title&&
|
|
676
|
+
(f[k]._titleTextBlock.maxWidth=0<f[k].titleMaxWidth&&f[k].titleMaxWidth<f[k].lineCoordinates.height?f[k].titleMaxWidth:f[k].lineCoordinates.height);f[k].calculateValueToPixelConversionParameters();f[k].calculateBreaksSizeInValues();P+=t[k]+f[k].margin}for(k=0;k<q.length;k++)"axisY"===q[k].type&&(q[k].calculateValueToPixelConversionParameters(),q[k].calculateBreaksSizeInValues());if(0<x){if(a&&0<a.length)for(k=0;k<a.length;k++)r=N[x-1][k]===N[x][k]?!0:!1;else r=!0;if(f&&0<f.length)for(k=0;k<f.length;k++)I=
|
|
677
|
+
O[x-1][k]===O[x][k]?!0:!1;else I=!0;if(c&&0<c.length)for(k=0;k<c.length;k++)J=E[x-1][k]===E[x][k]?!0:!1;else J=!0;if(b&&0<b.length)for(k=0;k<b.length;k++)R=w[x-1][k]===w[x][k]?!0:!1;else R=!0}if(r&&I&&J&&R)break;x++}if(c&&0<c.length)for(k=0;k<c.length;k++)c[k].calculateStripLinesThicknessInValues(),c[k].calculateBreaksInPixels();if(b&&0<b.length)for(k=0;k<b.length;k++)b[k].calculateStripLinesThicknessInValues(),b[k].calculateBreaksInPixels();if(a&&0<a.length)for(k=0;k<a.length;k++)a[k].calculateStripLinesThicknessInValues(),
|
|
678
|
+
a[k].calculateBreaksInPixels();if(f&&0<f.length)for(k=0;k<f.length;k++)f[k].calculateStripLinesThicknessInValues(),f[k].calculateBreaksInPixels()}};z.render=function(a,f,c,b,g){var h=a[0]?a[0].chart:f[0].chart;g=h.ctx;h.alignVerticalAxes&&h.alignVerticalAxes();g.save();g.beginPath();a&&a.length&&g.rect(5,a[0].bounds.y1,a[0].chart.width-10,a[a.length-1].bounds.y2);f&&f.length&&g.rect(5,f[f.length-1].bounds.y1,f[0].chart.width-10,f[0].bounds.y2);g.clip();if(a&&0<a.length)for(var d=0;d<a.length;d++)a[d].renderLabelsTicksAndTitle();
|
|
679
|
+
if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderLabelsTicksAndTitle();g.restore();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderLabelsTicksAndTitle();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderLabelsTicksAndTitle();h.preparePlotArea();h=h.plotArea;g.save();g.beginPath();g.rect(h.x1,h.y1,Math.abs(h.x2-h.x1),Math.abs(h.y2-h.y1));g.clip();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("value");if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderStripLinesOfThicknessType("value");
|
|
680
|
+
if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderStripLinesOfThicknessType("value");if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("value");if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderInterlacedColors();if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderInterlacedColors();if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderInterlacedColors();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderInterlacedColors();g.restore();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderGrid(),
|
|
681
|
+
s&&(a[d].createMask(),a[d].renderBreaksBackground());if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderGrid(),s&&(f[d].createMask(),f[d].renderBreaksBackground());if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderGrid(),s&&(c[d].createMask(),c[d].renderBreaksBackground());if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderGrid(),s&&(b[d].createMask(),b[d].renderBreaksBackground());if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderAxisLine();if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderAxisLine();
|
|
682
|
+
if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderAxisLine();if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderAxisLine();if(a&&0<a.length)for(d=0;d<a.length;d++)a[d].renderStripLinesOfThicknessType("pixel");if(f&&0<f.length)for(d=0;d<f.length;d++)f[d].renderStripLinesOfThicknessType("pixel");if(c&&0<c.length)for(d=0;d<c.length;d++)c[d].renderStripLinesOfThicknessType("pixel");if(b&&0<b.length)for(d=0;d<b.length;d++)b[d].renderStripLinesOfThicknessType("pixel")};z.prototype.calculateStripLinesThicknessInValues=
|
|
683
|
+
function(){for(var a=0;a<this.stripLines.length;a++)if(null!==this.stripLines[a].startValue&&null!==this.stripLines[a].endValue){var f=Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue),c=Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue),f=this.getApparentDifference(f,c);this.stripLines[a].value=this.logarithmic?this.stripLines[a].value*Math.sqrt(Math.log(Math.max(this.stripLines[a].startValue,this.stripLines[a].endValue)/Math.min(this.stripLines[a].startValue,this.stripLines[a].endValue))/
|
|
684
|
+
Math.log(f)):this.stripLines[a].value+(Math.abs(this.stripLines[a].endValue-this.stripLines[a].startValue)-f)/2;this.stripLines[a].thickness=f;this.stripLines[a]._thicknessType="value"}};z.prototype.calculateBreaksSizeInValues=function(){for(var a="left"===this._position||"right"===this._position?this.lineCoordinates.height||this.chart.height:this.lineCoordinates.width||this.chart.width,f=this.scaleBreaks?this.scaleBreaks._appliedBreaks:[],c=this.conversionParameters.pixelPerUnit||a/(this.logarithmic?
|
|
685
|
+
this.conversionParameters.maximum/this.conversionParameters.minimum:this.conversionParameters.maximum-this.conversionParameters.minimum),b=this.scaleBreaks&&!e(this.scaleBreaks.options.spacing),g,d=0;d<f.length;d++)g=b||!e(f[d].options.spacing),f[d].spacing=Va(f[d].spacing,a,8,g?0.1*a:8,g?0:3)<<0,f[d].size=0>f[d].spacing?0:Math.abs(f[d].spacing/c),this.logarithmic&&(f[d].size=Math.pow(this.logarithmBase,f[d].size))};z.prototype.calculateBreaksInPixels=function(){if(!(this.scaleBreaks&&0>=this.scaleBreaks._appliedBreaks.length)){var a=
|
|
685
686
|
this.scaleBreaks?this.scaleBreaks._appliedBreaks:[];a.length&&(this.scaleBreaks.firstBreakIndex=this.scaleBreaks.lastBreakIndex=null);for(var f=0;f<a.length&&!(a[f].startValue>this.conversionParameters.maximum);f++)a[f].endValue<this.conversionParameters.minimum||(e(this.scaleBreaks.firstBreakIndex)&&(this.scaleBreaks.firstBreakIndex=f),a[f].startValue>=this.conversionParameters.minimum&&(a[f].startPixel=this.convertValueToPixel(a[f].startValue),this.scaleBreaks.lastBreakIndex=f),a[f].endValue<=this.conversionParameters.maximum&&
|
|
686
687
|
(a[f].endPixel=this.convertValueToPixel(a[f].endValue)))}};z.prototype.renderLabelsTicksAndTitle=function(){var a=this,f=!1,c=0,b=0,g=1,d=0;0!==this.labelAngle&&360!==this.labelAngle&&(g=1.2);if("undefined"===typeof this.options.interval){if("bottom"===this._position||"top"===this._position)if(this.logarithmic&&!this.equidistantInterval&&this.labelAutoFit){for(var c=[],g=0!==this.labelAngle&&360!==this.labelAngle?1:1.2,e,l=this.viewportMaximum,v=this.lineCoordinates.width/Math.log(this.range),m=this._labels.length-
|
|
687
688
|
1;0<=m;m--){p=this._labels[m];if(p.position<this.viewportMinimum)break;p.position>this.viewportMaximum||!(m===this._labels.length-1||e<Math.log(l/p.position)*v/g)||(c.push(p),l=p.position,e=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*Math.abs(Math.sin(Math.PI/180*this.labelAngle)))}this._labels=c}else{for(m=0;m<this._labels.length;m++)p=this._labels[m],p.position<this.viewportMinimum||(e=p.textBlock.width*Math.abs(Math.cos(Math.PI/180*this.labelAngle))+p.textBlock.height*
|
|
@@ -927,7 +928,7 @@ this.chart.requestAnimFrame.call(window,function(){h.animate.call(h)}):this.char
|
|
|
927
928
|
d){if(0!==a){var c=d.dest,b=d.source.canvas,g=d.animationBase;c.drawImage(b,0,0,b.width,b.height,g-g*a,0,a*c.canvas.width/ka,c.canvas.height/ka)}},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/ka,b.height/ka);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/ka,c.canvas.height/ka);c.restore()}},easing:{linear:function(a,
|
|
928
929
|
d,c,b){return c*a/b+d},easeOutQuad:function(a,d,c,b){return-c*(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}}},t={drawMarker:function(a,d,c,b,g,h,e,l){if(c){var v=1;c.fillStyle=h?h:"#000000";c.strokeStyle=e?e:"#000000";c.lineWidth=l?l:0;c.setLineDash&&c.setLineDash(S("solid",l));"circle"===b?(c.moveTo(a,d),c.beginPath(),c.arc(a,d,g/2,0,2*Math.PI,!1),h&&c.fill(),
|
|
929
930
|
l&&(e?c.stroke():(v=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=v))):"square"===b?(c.beginPath(),c.rect(a-g/2,d-g/2,g,g),h&&c.fill(),l&&(e?c.stroke():(v=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=v))):"triangle"===b?(c.beginPath(),c.moveTo(a-g/2,d+g/2),c.lineTo(a+g/2,d+g/2),c.lineTo(a,d-g/2),c.closePath(),h&&c.fill(),l&&(e?c.stroke():(v=c.globalAlpha,c.globalAlpha=0.15,c.strokeStyle="black",c.stroke(),c.globalAlpha=v)),c.beginPath()):
|
|
930
|
-
"cross"===b&&(c.strokeStyle=h,c.lineWidth=g/4,c.beginPath(),c.moveTo(a-g/2,d-g/2),c.lineTo(a+g/2,d+g/2),c.stroke(),c.moveTo(a+g/2,d-g/2),c.lineTo(a-g/2,d+g/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];t.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return u}();Ka.version="v3.7.
|
|
931
|
+
"cross"===b&&(c.strokeStyle=h,c.lineWidth=g/4,c.beginPath(),c.moveTo(a-g/2,d-g/2),c.lineTo(a+g/2,d+g/2),c.stroke(),c.moveTo(a+g/2,d-g/2),c.lineTo(a-g/2,d+g/2),c.stroke())}},drawMarkers:function(a){for(var d=0;d<a.length;d++){var c=a[d];t.drawMarker(c.x,c.y,c.ctx,c.type,c.size,c.color,c.borderColor,c.borderThickness)}}};return u}();Ka.version="v3.7.23 GA";window.CanvasJS&&(Ka&&!window.CanvasJS.Chart)&&(window.CanvasJS.Chart=Ka);ea.StockChart={width:500,height:600,backgroundColor:"white",theme:"light1",
|
|
931
932
|
animationEnabled:!1,animationDuration:1200,culture:"en",creditHref:"",creditText:"CanvasJS",exportEnabled:!1,exportFileName:"StockChart",colorSet:"colorSet1",rangeChanging:null,rangeChanged:null,publicProperties:{title:"readWrite",subtitles:"readWrite",toolbar:"readWrite",navigator:"readWrite",rangeSelector:"readWrite",charts:"readWrite",options:"readWrite",bounds:"readOnly",container:"readOnly",selectedColorSet:"readOnly"}};ea.Navigator={enabled:!0,width:500,height:70,verticalAlign:"bottom",horizontalAlign:"center",
|
|
932
933
|
dynamicUpdate:!0,backgroundColor:"#fff",animationEnabled:!1,animationDuration:1200,theme:"light1",publicProperties:{slider:"readWrite",backgroundColor:"readWrite",animationEnabled:"readWrite",animationDuration:"readWrite",theme:"readWrite",axisX:"readWrite",axisY:"readWrite",axisX2:"readWrite",axisY2:"readWrite",data:"readWrite",options:"readWrite",bounds:"readOnly"}};ea.RangeSelector={enabled:!0,width:500,height:35,label:"Range",verticalAlign:"top",horizontalAlign:"center",selectedRangeButtonIndex:null,
|
|
933
934
|
publicProperties:{options:"readWrite",buttons:"readWrite",inputFields:"readWrite",buttonStyle:"readWrite",bounds:"readOnly"}};ea.RangeButton={range:null,rangeType:null,label:null,style:"position: inline; margin: 5px 0;text-align:center;cursor: pointer;",backgroundColorDisabled:"#ddd",publicProperties:{options:"readWrite",bounds:"readOnly"}};ea.ButtonStyle={backgroundColor:"#fff",backgroundColorOnHover:"#2196f3",backgroundColorOnSelect:"#2196f3",borderColor:"#2196f3",borderThickness:2,labelFontColor:"#000",
|
|
@@ -1113,7 +1114,7 @@ l[d]:this.label};N.prototype.render=function(){this.textBlock.render(!0)};ia(W,a
|
|
|
1113
1114
|
this.style.fontFamily,this.elements[d].style.fontWeight=this.style.fontWeight,this.elements[d].style.lineHeight=1,isNaN(this.style.padding)?(this.elements[d].style.paddingTop=this.style.padding.top+"px",this.elements[d].style.paddingRight=this.style.padding.right+"px",this.elements[d].style.paddingBottom=this.style.padding.bottom+"px",this.elements[d].style.paddingLeft=this.style.padding.left+"px"):this.elements[d].style.padding=this.style.padding+"px",this.elements[d].style.mozAppearance=this.elements[d].style.webkitAppearance=
|
|
1114
1115
|
this.elements[d].style.appearance="none",this.elements[d].style.webkitBorderRadius=0,this.elements[d].style.mozBorderRadius=0,this.elements[d].style.borderRadius=0,this.elements[d].style.boxSizing="content-box";this.parent=this.rangeSelector=this.stockChart.rangeSelector}};ia(Y,aa);Y.prototype._updateOptions=function(){this.updateOption("backgroundColor");this.updateOption("backgroundColorOnHover");this.updateOption("backgroundColorOnSelect");this.updateOption("borderColor");this.updateOption("borderThickness");
|
|
1115
1116
|
this.updateOption("labelFontColor");this.updateOption("labelFontColorOnHover");this.updateOption("labelFontSize");this.updateOption("labelFontStyle");this.updateOption("labelFontFamily");this.updateOption("labelFontWeight");this.updateOption("width");this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};ia(ba,aa);ba.prototype._updateOptions=function(){this.updateOption("backgroundColor");this.updateOption("borderColor");this.updateOption("borderThickness");
|
|
1116
|
-
this.updateOption("borderColorOnFocus");this.updateOption("fontColor");this.updateOption("fontSize");this.updateOption("fontStyle");this.updateOption("fontFamily");this.updateOption("fontWeight");this.updateOption("width");this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};return F}();T.version="v1.7.
|
|
1117
|
+
this.updateOption("borderColorOnFocus");this.updateOption("fontColor");this.updateOption("fontSize");this.updateOption("fontStyle");this.updateOption("fontFamily");this.updateOption("fontWeight");this.updateOption("width");this.updateOption("maxWidth");this.updateOption("padding");this.updateOption("spacing");this.updateOption("cursor")};return F}();T.version="v1.7.23 GA";window.CanvasJS&&(T&&(!window.CanvasJS.StockChart&&window.CanvasJS.Chart)&&(window.CanvasJS.StockChart=T),T&&!window.CanvasJS.Chart&&
|
|
1117
1118
|
(window.CanvasJS.Chart=Ka,window.CanvasJS.StockChart=T))})();
|
|
1118
1119
|
|
|
1119
1120
|
/*
|