/*
CanvasJS HTML5 & JavaScript Charts - v2.3.1 GA - https://canvasjs.com/
Copyright 2018 fenopix
--------------------- License Information --------------------
CanvasJS is a commercial product which requires purchase of license. Without a commercial license you can use it for evaluation purposes for upto 30 days. Please refer to the following link for further details.
https://canvasjs.com/license/
*/
/*eslint-disable*/
/*jshint ignore:start*/
(function () {
function qa(k, p) {
k.prototype = eb(p.prototype);
k.prototype.constructor = k;
k.base = p.prototype;
}
function eb(k) {
function p() {}
p.prototype = k;
return new p();
}
function Ya(k, p, D) {
"millisecond" === D
? k.setMilliseconds(k.getMilliseconds() + 1 * p)
: "second" === D
? k.setSeconds(k.getSeconds() + 1 * p)
: "minute" === D
? k.setMinutes(k.getMinutes() + 1 * p)
: "hour" === D
? k.setHours(k.getHours() + 1 * p)
: "day" === D
? k.setDate(k.getDate() + 1 * p)
: "week" === D
? k.setDate(k.getDate() + 7 * p)
: "month" === D
? k.setMonth(k.getMonth() + 1 * p)
: "year" === D && k.setFullYear(k.getFullYear() + 1 * p);
return k;
}
function $(k, p) {
var D = !1;
0 > k && ((D = !0), (k *= -1));
k = "" + k;
for (p = p ? p : 1; k.length < p; ) k = "0" + k;
return D ? "-" + k : k;
}
function Ia(k) {
if (!k) return k;
k = k.replace(/^\s\s*/, "");
for (var p = /\s/, D = k.length; p.test(k.charAt(--D)); );
return k.slice(0, D + 1);
}
function Ea(k) {
k.roundRect = function (k, D, r, u, H, F, z, v) {
z && (this.fillStyle = z);
v && (this.strokeStyle = v);
"undefined" === typeof H && (H = 5);
this.lineWidth = F;
this.beginPath();
this.moveTo(k + H, D);
this.lineTo(k + r - H, D);
this.quadraticCurveTo(k + r, D, k + r, D + H);
this.lineTo(k + r, D + u - H);
this.quadraticCurveTo(k + r, D + u, k + r - H, D + u);
this.lineTo(k + H, D + u);
this.quadraticCurveTo(k, D + u, k, D + u - H);
this.lineTo(k, D + H);
this.quadraticCurveTo(k, D, k + H, D);
this.closePath();
z && this.fill();
v && 0 < F && this.stroke();
};
}
function Sa(k, p) {
return k - p;
}
function Ta(k, p, D) {
if (k && p && D) {
D = D + "." + p;
var r = "image/" + p;
k = k.toDataURL(r);
var u = !1,
H = document.createElement("a");
H.download = D;
H.href = k;
if ("undefined" !== typeof Blob && new Blob()) {
for (
var F = k.replace(/^data:[a-z\/]*;base64,/, ""),
F = atob(F),
z = new ArrayBuffer(F.length),
z = new Uint8Array(z),
v = 0;
v < F.length;
v++
)
z[v] = F.charCodeAt(v);
p = new Blob([z.buffer], { type: "image/" + p });
try {
window.navigator.msSaveBlob(p, D), (u = !0);
} catch (L) {
(H.dataset.downloadurl = [r, H.download, H.href].join(":")),
(H.href = window.URL.createObjectURL(p));
}
}
if (!u)
try {
(event = document.createEvent("MouseEvents")),
event.initMouseEvent(
"click",
!0,
!1,
window,
0,
0,
0,
0,
0,
!1,
!1,
!1,
!1,
0,
null
),
H.dispatchEvent
? H.dispatchEvent(event)
: H.fireEvent && H.fireEvent("onclick");
} catch (E) {
(p = window.open()),
p.document.write(
"
Please right click on the image and save it to your device
"
),
p.document.close();
}
}
}
function N(k) {
var p = ((k & 16711680) >> 16).toString(16),
D = ((k & 65280) >> 8).toString(16);
k = ((k & 255) >> 0).toString(16);
p = 2 > p.length ? "0" + p : p;
D = 2 > D.length ? "0" + D : D;
k = 2 > k.length ? "0" + k : k;
return "#" + p + D + k;
}
function fb(k, p) {
var D = this.length >>> 0,
r = Number(p) || 0,
r = 0 > r ? Math.ceil(r) : Math.floor(r);
for (0 > r && (r += D); r < D; r++)
if (r in this && this[r] === k) return r;
return -1;
}
function u(k) {
return null === k || "undefined" === typeof k;
}
function Fa(k) {
k.indexOf || (k.indexOf = fb);
return k;
}
function gb(k) {
if (U.fSDec)
k[ja("`eeDwdouMhrudods")](ja("e`u`@ohl`uhnoHuds`uhnoDoe"), function () {
U._fTWm && U._fTWm(k);
});
}
function Za(k, p, D) {
D = D || "normal";
var r = k + "_" + p + "_" + D,
u = $a[r];
if (isNaN(u)) {
try {
k =
"position:absolute; left:0px; top:-20000px; padding:0px;margin:0px;border:none;white-space:pre;line-height:normal;font-family:" +
k +
"; font-size:" +
p +
"px; font-weight:" +
D +
";";
if (!xa) {
var H = document.body;
xa = document.createElement("span");
xa.innerHTML = "";
var F = document.createTextNode("Mpgyi");
xa.appendChild(F);
H.appendChild(xa);
}
xa.style.display = "";
xa.setAttribute("style", k);
u = Math.round(xa.offsetHeight);
xa.style.display = "none";
} catch (z) {
u = Math.ceil(1.1 * p);
}
u = Math.max(u, p);
$a[r] = u;
}
return u;
}
function R(k, p) {
var D = [];
if (
(D = {
solid: [],
shortDash: [3, 1],
shortDot: [1, 1],
shortDashDot: [3, 1, 1, 1],
shortDashDotDot: [3, 1, 1, 1, 1, 1],
dot: [1, 2],
dash: [4, 2],
dashDot: [4, 2, 1, 2],
longDash: [8, 2],
longDashDot: [8, 2, 1, 2],
longDashDotDot: [8, 2, 1, 2, 1, 2],
}[k || "solid"])
)
for (var r = 0; r < D.length; r++) D[r] *= p;
else D = [];
return D;
}
function O(k, p, D, r, u) {
r = r || [];
u = u || !1;
r.push([k, p, D, u]);
return k.addEventListener
? (k.addEventListener(p, D, u), D)
: k.attachEvent
? ((r = function (p) {
p = p || window.event;
p.preventDefault =
p.preventDefault ||
function () {
p.returnValue = !1;
};
p.stopPropagation =
p.stopPropagation ||
function () {
p.cancelBubble = !0;
};
D.call(k, p);
}),
k.attachEvent("on" + p, r),
r)
: !1;
}
function ab(k, p, D) {
k *= W;
p *= W;
k = D.getImageData(k, p, 2, 2).data;
p = !0;
for (D = 0; 4 > D; D++)
if ((k[D] !== k[D + 4]) | (k[D] !== k[D + 8]) | (k[D] !== k[D + 12])) {
p = !1;
break;
}
return p ? (k[0] << 16) | (k[1] << 8) | k[2] : 0;
}
function na(k, p, D) {
return k in p ? p[k] : D[k];
}
function Oa(k, p, D) {
if (r && bb) {
var u = k.getContext("2d");
Pa =
u.webkitBackingStorePixelRatio ||
u.mozBackingStorePixelRatio ||
u.msBackingStorePixelRatio ||
u.oBackingStorePixelRatio ||
u.backingStorePixelRatio ||
1;
W = Ua / Pa;
k.width = p * W;
k.height = D * W;
Ua !== Pa &&
((k.style.width = p + "px"),
(k.style.height = D + "px"),
u.scale(W, W));
} else (k.width = p), (k.height = D);
}
function hb(k) {
if (!ib) {
var p = !1,
D = !1;
"undefined" === typeof ra.Chart.creditHref
? ((k.creditHref = ja("iuuqr;..b`ow`rkr/bnl.")),
(k.creditText = ja("B`ow`rKR/bnl")))
: ((p = k.updateOption("creditText")),
(D = k.updateOption("creditHref")));
if (k.creditHref && k.creditText) {
k._creditLink ||
((k._creditLink = document.createElement("a")),
k._creditLink.setAttribute("class", "canvasjs-chart-credit"),
k._creditLink.setAttribute("title", "JavaScript Charts"),
k._creditLink.setAttribute(
"style",
"outline:none;margin:0px;position:absolute;right:2px;top:" +
(k.height - 14) +
"px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"
),
k._creditLink.setAttribute("tabIndex", -1),
k._creditLink.setAttribute("target", "_blank"));
if (0 === k.renderCount || p || D)
k._creditLink.setAttribute("href", k.creditHref),
(k._creditLink.innerHTML = k.creditText);
k._creditLink && k.creditHref && k.creditText
? (k._creditLink.parentElement ||
k._canvasJSContainer.appendChild(k._creditLink),
(k._creditLink.style.top = k.height - 14 + "px"))
: k._creditLink.parentElement &&
k._canvasJSContainer.removeChild(k._creditLink);
}
}
}
function ta(k, p) {
Ja && ((this.canvasCount |= 0), window.console.log(++this.canvasCount));
var D = document.createElement("canvas");
D.setAttribute("class", "canvasjs-chart-canvas");
Oa(D, k, p);
r ||
"undefined" === typeof G_vmlCanvasManager ||
G_vmlCanvasManager.initElement(D);
return D;
}
function sa(k, p, D) {
for (var r in D) p.style[r] = D[r];
}
function ua(k, p, D) {
p.getAttribute("state") ||
((p.style.backgroundColor = k.toolbar.backgroundColor),
(p.style.color = k.toolbar.fontColor),
(p.style.border = "none"),
sa(k, p, {
WebkitUserSelect: "none",
MozUserSelect: "none",
msUserSelect: "none",
userSelect: "none",
}));
p.getAttribute("state") !== D &&
(p.setAttribute("state", D),
p.setAttribute("type", "button"),
sa(k, p, {
padding: "5px 12px",
cursor: "pointer",
float: "left",
width: "40px",
height: "25px",
outline: "0px",
verticalAlign: "baseline",
lineHeight: "0",
}),
p.setAttribute("title", k._cultureInfo[D + "Text"]),
(p.innerHTML =
"
"));
}
function Qa() {
for (var k = null, p = 0; p < arguments.length; p++)
(k = arguments[p]), k.style && (k.style.display = "inline");
}
function va() {
for (var k = null, p = 0; p < arguments.length; p++)
(k = arguments[p]) && k.style && (k.style.display = "none");
}
function V(k, p, D, r, v) {
this._defaultsKey = k;
this._themeOptionsKey = p;
this._index = r;
this.parent = v;
this._eventListeners = [];
k = {};
this.theme && u(p) && u(r)
? (k = u(ya[this.theme]) ? ya.light1 : ya[this.theme])
: this.parent &&
this.parent.themeOptions &&
this.parent.themeOptions[p] &&
(null === r
? (k = this.parent.themeOptions[p])
: 0 < this.parent.themeOptions[p].length &&
((r = Math.min(this.parent.themeOptions[p].length - 1, r)),
(k = this.parent.themeOptions[p][r])));
this.themeOptions = k;
this.options = D ? D : { _isPlaceholder: !0 };
this.setOptions(this.options, k);
}
function Ga(k, p, r, u, v) {
"undefined" === typeof v && (v = 0);
this._padding = v;
this._x1 = k;
this._y1 = p;
this._x2 = r;
this._y2 = u;
this._rightOccupied =
this._leftOccupied =
this._bottomOccupied =
this._topOccupied =
this._padding;
}
function ka(k, p) {
ka.base.constructor.call(this, "TextBlock", null, p, null, null);
this.ctx = k;
this._isDirty = !0;
this._wrappedText = null;
this._initialize();
}
function Va(k, p) {
Va.base.constructor.call(this, "Toolbar", "toolbar", p, null, k);
this.chart = k;
this.canvas = k.canvas;
this.ctx = this.chart.ctx;
this.optionsName = "toolbar";
}
function Aa(k, p) {
Aa.base.constructor.call(this, "Title", "title", p, null, k);
this.chart = k;
this.canvas = k.canvas;
this.ctx = this.chart.ctx;
this.optionsName = "title";
if (u(this.options.margin) && k.options.subtitles)
for (var r = k.options.subtitles, za = 0; za < r.length; za++)
if (
((u(r[za].horizontalAlign) && "center" === this.horizontalAlign) ||
r[za].horizontalAlign === this.horizontalAlign) &&
((u(r[za].verticalAlign) && "top" === this.verticalAlign) ||
r[za].verticalAlign === this.verticalAlign) &&
!r[za].dockInsidePlotArea === !this.dockInsidePlotArea
) {
this.margin = 0;
break;
}
"undefined" === typeof this.options.fontSize &&
(this.fontSize = this.chart.getAutoFontSize(this.fontSize));
this.height = this.width = null;
this.bounds = { x1: null, y1: null, x2: null, y2: null };
}
function Ka(k, p, r) {
Ka.base.constructor.call(this, "Subtitle", "subtitles", p, r, k);
this.chart = k;
this.canvas = k.canvas;
this.ctx = this.chart.ctx;
this.optionsName = "subtitles";
this.isOptionsInArray = !0;
"undefined" === typeof this.options.fontSize &&
(this.fontSize = this.chart.getAutoFontSize(this.fontSize));
this.height = this.width = null;
this.bounds = { x1: null, y1: null, x2: null, y2: null };
}
function Wa() {
this.pool = [];
}
function La(k) {
var p;
k && Ma[k] && (p = Ma[k]);
La.base.constructor.call(this, "CultureInfo", null, p, null, null);
}
var Ja = !1,
U = {},
r = !!document.createElement("canvas").getContext,
ra = {
Chart: {
width: 500,
height: 400,
zoomEnabled: !1,
zoomType: "x",
backgroundColor: "white",
theme: "light1",
animationEnabled: !1,
animationDuration: 1200,
dataPointWidth: null,
dataPointMinWidth: null,
dataPointMaxWidth: null,
colorSet: "colorSet1",
culture: "en",
creditHref: "",
creditText: "CanvasJS",
interactivityEnabled: !0,
exportEnabled: !1,
exportFileName: "Chart",
rangeChanging: null,
rangeChanged: null,
publicProperties: {
title: "readWrite",
subtitles: "readWrite",
toolbar: "readWrite",
toolTip: "readWrite",
legend: "readWrite",
axisX: "readWrite",
axisY: "readWrite",
axisX2: "readWrite",
axisY2: "readWrite",
data: "readWrite",
options: "readWrite",
bounds: "readOnly",
container: "readOnly",
},
},
Title: {
padding: 0,
text: null,
verticalAlign: "top",
horizontalAlign: "center",
fontSize: 20,
fontFamily: "Calibri",
fontWeight: "normal",
fontColor: "black",
fontStyle: "normal",
borderThickness: 0,
borderColor: "black",
cornerRadius: 0,
backgroundColor: r ? "transparent" : null,
margin: 5,
wrap: !0,
maxWidth: null,
dockInsidePlotArea: !1,
publicProperties: {
options: "readWrite",
bounds: "readOnly",
chart: "readOnly",
},
},
Subtitle: {
padding: 0,
text: null,
verticalAlign: "top",
horizontalAlign: "center",
fontSize: 14,
fontFamily: "Calibri",
fontWeight: "normal",
fontColor: "black",
fontStyle: "normal",
borderThickness: 0,
borderColor: "black",
cornerRadius: 0,
backgroundColor: null,
margin: 2,
wrap: !0,
maxWidth: null,
dockInsidePlotArea: !1,
publicProperties: {
options: "readWrite",
bounds: "readOnly",
chart: "readOnly",
},
},
Toolbar: {
backgroundColor: "white",
backgroundColorOnHover: "#2196f3",
borderColor: "#2196f3",
borderThickness: 1,
fontColor: "black",
fontColorOnHover: "white",
publicProperties: { options: "readWrite", chart: "readOnly" },
},
Legend: {
name: null,
verticalAlign: "center",
horizontalAlign: "right",
fontSize: 14,
fontFamily: "calibri",
fontWeight: "normal",
fontColor: "black",
fontStyle: "normal",
cursor: null,
itemmouseover: null,
itemmouseout: null,
itemmousemove: null,
itemclick: null,
dockInsidePlotArea: !1,
reversed: !1,
backgroundColor: r ? "transparent" : null,
borderColor: r ? "transparent" : null,
borderThickness: 0,
cornerRadius: 0,
maxWidth: null,
maxHeight: null,
markerMargin: null,
itemMaxWidth: null,
itemWidth: null,
itemWrap: !0,
itemTextFormatter: null,
publicProperties: {
options: "readWrite",
bounds: "readOnly",
chart: "readOnly",
},
},
ToolTip: {
enabled: !0,
shared: !1,
animationEnabled: !0,
content: null,
contentFormatter: null,
reversed: !1,
backgroundColor: r ? "rgba(255,255,255,.9)" : "rgb(255,255,255)",
borderColor: null,
borderThickness: 2,
cornerRadius: 5,
fontSize: 14,
fontColor: "black",
fontFamily: "Calibri, Arial, Georgia, serif;",
fontWeight: "normal",
fontStyle: "italic",
publicProperties: { options: "readWrite", chart: "readOnly" },
},
Axis: {
minimum: null,
maximum: null,
viewportMinimum: null,
viewportMaximum: null,
interval: null,
intervalType: null,
reversed: !1,
logarithmic: !1,
logarithmBase: 10,
title: null,
titleFontColor: "black",
titleFontSize: 20,
titleFontFamily: "arial",
titleFontWeight: "normal",
titleFontStyle: "normal",
titleWrap: !0,
titleMaxWidth: null,
titleBackgroundColor: r ? "transparent" : null,
titleBorderColor: r ? "transparent" : null,
titleBorderThickness: 0,
titleCornerRadius: 0,
labelAngle: 0,
labelFontFamily: "arial",
labelFontColor: "black",
labelFontSize: 12,
labelFontWeight: "normal",
labelFontStyle: "normal",
labelAutoFit: !0,
labelWrap: !0,
labelMaxWidth: null,
labelFormatter: null,
labelBackgroundColor: r ? "transparent" : null,
labelBorderColor: r ? "transparent" : null,
labelBorderThickness: 0,
labelCornerRadius: 0,
labelPlacement: "outside",
prefix: "",
suffix: "",
includeZero: !0,
tickLength: 5,
tickColor: "black",
tickThickness: 1,
lineColor: "black",
lineThickness: 1,
lineDashType: "solid",
gridColor: "A0A0A0",
gridThickness: 0,
gridDashType: "solid",
interlacedColor: r ? "transparent" : null,
valueFormatString: null,
margin: 2,
publicProperties: {
options: "readWrite",
stripLines: "readWrite",
scaleBreaks: "readWrite",
crosshair: "readWrite",
bounds: "readOnly",
chart: "readOnly",
},
},
StripLine: {
value: null,
startValue: null,
endValue: null,
color: "orange",
opacity: null,
thickness: 2,
lineDashType: "solid",
label: "",
labelPlacement: "inside",
labelAlign: "far",
labelWrap: !0,
labelMaxWidth: null,
labelBackgroundColor: null,
labelBorderColor: r ? "transparent" : null,
labelBorderThickness: 0,
labelCornerRadius: 0,
labelFontFamily: "arial",
labelFontColor: "orange",
labelFontSize: 12,
labelFontWeight: "normal",
labelFontStyle: "normal",
labelFormatter: null,
showOnTop: !1,
publicProperties: {
options: "readWrite",
axis: "readOnly",
bounds: "readOnly",
chart: "readOnly",
},
},
ScaleBreaks: {
autoCalculate: !1,
collapsibleThreshold: "25%",
maxNumberOfAutoBreaks: 2,
spacing: 8,
type: "straight",
color: "#FFFFFF",
fillOpacity: 0.9,
lineThickness: 2,
lineColor: "#E16E6E",
lineDashType: "solid",
publicProperties: {
options: "readWrite",
customBreaks: "readWrite",
axis: "readOnly",
autoBreaks: "readOnly",
bounds: "readOnly",
chart: "readOnly",
},
},
Break: {
startValue: null,
endValue: null,
spacing: 8,
type: "straight",
color: "#FFFFFF",
fillOpacity: 0.9,
lineThickness: 2,
lineColor: "#E16E6E",
lineDashType: "solid",
publicProperties: {
options: "readWrite",
scaleBreaks: "readOnly",
bounds: "readOnly",
chart: "readOnly",
},
},
Crosshair: {
enabled: !1,
snapToDataPoint: !1,
color: "grey",
opacity: null,
thickness: 2,
lineDashType: "solid",
label: "",
labelWrap: !0,
labelMaxWidth: null,
labelBackgroundColor: r ? "grey" : null,
labelBorderColor: r ? "grey" : null,
labelBorderThickness: 0,
labelCornerRadius: 0,
labelFontFamily: r
? "Calibri, Optima, Candara, Verdana, Geneva, sans-serif"
: "calibri",
labelFontSize: 12,
labelFontColor: "#fff",
labelFontWeight: "normal",
labelFontStyle: "normal",
labelFormatter: null,
valueFormatString: null,
publicProperties: {
options: "readWrite",
axis: "readOnly",
bounds: "readOnly",
chart: "readOnly",
},
},
DataSeries: {
name: null,
dataPoints: null,
label: "",
bevelEnabled: !1,
highlightEnabled: !0,
cursor: "default",
indexLabel: "",
indexLabelPlacement: "auto",
indexLabelOrientation: "horizontal",
indexLabelFontColor: "black",
indexLabelFontSize: 12,
indexLabelFontStyle: "normal",
indexLabelFontFamily: "Arial",
indexLabelFontWeight: "normal",
indexLabelBackgroundColor: null,
indexLabelLineColor: "gray",
indexLabelLineThickness: 1,
indexLabelLineDashType: "solid",
indexLabelMaxWidth: null,
indexLabelWrap: !0,
indexLabelFormatter: null,
lineThickness: 2,
lineDashType: "solid",
connectNullData: !1,
nullDataLineDashType: "dash",
color: null,
lineColor: null,
risingColor: "white",
fallingColor: "red",
fillOpacity: null,
startAngle: 0,
radius: null,
innerRadius: null,
neckHeight: null,
neckWidth: null,
reversed: !1,
valueRepresents: null,
linkedDataSeriesIndex: null,
whiskerThickness: 2,
whiskerDashType: "solid",
whiskerColor: null,
whiskerLength: null,
stemThickness: 2,
stemColor: null,
stemDashType: "solid",
upperBoxColor: "white",
lowerBoxColor: "white",
type: "column",
xValueType: "number",
axisXType: "primary",
axisYType: "primary",
axisXIndex: 0,
axisYIndex: 0,
xValueFormatString: null,
yValueFormatString: null,
zValueFormatString: null,
percentFormatString: null,
showInLegend: null,
legendMarkerType: null,
legendMarkerColor: null,
legendText: null,
legendMarkerBorderColor: r ? "transparent" : null,
legendMarkerBorderThickness: 0,
markerType: "circle",
markerColor: null,
markerSize: null,
markerBorderColor: r ? "transparent" : null,
markerBorderThickness: 0,
mouseover: null,
mouseout: null,
mousemove: null,
click: null,
toolTipContent: null,
visible: !0,
publicProperties: {
options: "readWrite",
axisX: "readWrite",
axisY: "readWrite",
chart: "readOnly",
},
},
TextBlock: {
x: 0,
y: 0,
width: null,
height: null,
maxWidth: null,
maxHeight: null,
padding: 0,
angle: 0,
text: "",
horizontalAlign: "center",
fontSize: 12,
fontFamily: "calibri",
fontWeight: "normal",
fontColor: "black",
fontStyle: "normal",
borderThickness: 0,
borderColor: "black",
cornerRadius: 0,
backgroundColor: null,
textBaseline: "top",
},
CultureInfo: {
decimalSeparator: ".",
digitGroupSeparator: ",",
zoomText: "Zoom",
panText: "Pan",
resetText: "Reset",
menuText: "More Options",
saveJPGText: "Save as JPEG",
savePNGText: "Save as PNG",
printText: "Print",
days: "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(
" "
),
shortDays: "Sun Mon Tue Wed Thu Fri Sat".split(" "),
months:
"January February March April May June July August September October November December".split(
" "
),
shortMonths: "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(
" "
),
},
},
Ma = { en: {} },
v = r ? "Trebuchet MS, Helvetica, sans-serif" : "Arial",
Ha = r ? "Impact, Charcoal, sans-serif" : "Arial",
Ba = {
colorSet1:
"#4F81BC #C0504E #9BBB58 #23BFAA #8064A1 #4AACC5 #F79647 #7F6084 #77A033 #33558B #E59566".split(
" "
),
colorSet2:
"#6D78AD #51CDA0 #DF7970 #4C9CA0 #AE7D99 #C9D45C #5592AD #DF874D #52BCA8 #8E7AA3 #E3CB64 #C77B85 #C39762 #8DD17E #B57952 #FCC26C".split(
" "
),
colorSet3:
"#8CA1BC #36845C #017E82 #8CB9D0 #708C98 #94838D #F08891 #0366A7 #008276 #EE7757 #E5BA3A #F2990B #03557B #782970".split(
" "
),
},
I,
fa,
Q,
ha,
ga;
fa = "#333333";
Q = "#000000";
I = "#666666";
ga = ha = "#000000";
var X = 20,
E = 14,
Xa = {
colorSet: "colorSet1",
backgroundColor: "#FFFFFF",
title: {
fontFamily: Ha,
fontSize: 32,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
subtitles: [
{
fontFamily: Ha,
fontSize: E,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
],
data: [
{
indexLabelFontFamily: v,
indexLabelFontSize: E,
indexLabelFontColor: fa,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1,
},
],
axisX: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: fa,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisX2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: fa,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisY: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: fa,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisY2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: fa,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
legend: {
fontFamily: v,
fontSize: 14,
fontColor: fa,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center",
},
toolTip: {
fontFamily: v,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
},
};
Q = fa = "#F5F5F5";
I = "#FFFFFF";
ha = "#40BAF1";
ga = "#F5F5F5";
var X = 20,
E = 14,
cb = {
colorSet: "colorSet2",
title: {
fontFamily: v,
fontSize: 33,
fontColor: "#3A3A3A",
fontWeight: "bold",
verticalAlign: "top",
margin: 5,
},
subtitles: [
{
fontFamily: v,
fontSize: E,
fontColor: "#3A3A3A",
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
],
data: [
{
indexLabelFontFamily: v,
indexLabelFontSize: E,
indexLabelFontColor: "#666666",
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1,
},
],
axisX: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 1,
lineColor: "#BBBBBB",
tickThickness: 1,
tickColor: "#BBBBBB",
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: "black",
color: "black",
thickness: 1,
lineDashType: "dot",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisX2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 1,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: "black",
color: "black",
thickness: 1,
lineDashType: "dot",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisY: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 0,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: "black",
color: "black",
thickness: 1,
lineDashType: "dot",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
axisY2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 0,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: "black",
color: "black",
thickness: 1,
lineDashType: "dot",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid",
},
},
],
legend: {
fontFamily: v,
fontSize: 14,
fontColor: "#3A3A3A",
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center",
},
toolTip: {
fontFamily: v,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
},
};
Q = fa = "#F5F5F5";
I = "#FFFFFF";
ha = "#40BAF1";
ga = "#F5F5F5";
X = 20;
E = 14;
Ha = {
colorSet: "colorSet12",
backgroundColor: "#2A2A2A",
title: {
fontFamily: Ha,
fontSize: 32,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
subtitles: [
{
fontFamily: Ha,
fontSize: E,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
],
toolbar: {
backgroundColor: "#666666",
backgroundColorOnHover: "#FF7372",
borderColor: "#FF7372",
borderThickness: 1,
fontColor: "#F5F5F5",
fontColorOnHover: "#F5F5F5",
},
data: [
{
indexLabelFontFamily: v,
indexLabelFontSize: E,
indexLabelFontColor: Q,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1,
},
],
axisX: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisX2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisY: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisY2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
legend: {
fontFamily: v,
fontSize: 14,
fontColor: fa,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center",
},
toolTip: {
fontFamily: v,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
fontColor: Q,
backgroundColor: "rgba(0, 0, 0, .7)",
},
};
I = "#FFFFFF";
Q = fa = "#FAFAFA";
ha = "#40BAF1";
ga = "#F5F5F5";
var X = 20,
E = 14,
ya = {
light1: Xa,
light2: cb,
dark1: Ha,
dark2: {
colorSet: "colorSet2",
backgroundColor: "#32373A",
title: {
fontFamily: v,
fontSize: 32,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
subtitles: [
{
fontFamily: v,
fontSize: E,
fontColor: fa,
fontWeight: "normal",
verticalAlign: "top",
margin: 5,
},
],
toolbar: {
backgroundColor: "#666666",
backgroundColorOnHover: "#FF7372",
borderColor: "#FF7372",
borderThickness: 1,
fontColor: "#F5F5F5",
fontColorOnHover: "#F5F5F5",
},
data: [
{
indexLabelFontFamily: v,
indexLabelFontSize: E,
indexLabelFontColor: Q,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1,
},
],
axisX: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisX2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 0,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisY: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 0,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
axisY2: [
{
titleFontFamily: v,
titleFontSize: X,
titleFontColor: Q,
titleFontWeight: "normal",
labelFontFamily: v,
labelFontSize: E,
labelFontColor: Q,
labelFontWeight: "normal",
lineThickness: 0,
lineColor: I,
tickThickness: 1,
tickColor: I,
gridThickness: 1,
gridColor: I,
stripLines: [
{
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1,
},
],
crosshair: {
labelFontFamily: v,
labelFontSize: E,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: ga,
color: ha,
thickness: 1,
lineDashType: "dash",
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111",
},
},
],
legend: {
fontFamily: v,
fontSize: 14,
fontColor: fa,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center",
},
toolTip: {
fontFamily: v,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
fontColor: Q,
backgroundColor: "rgba(0, 0, 0, .7)",
},
},
theme1: Xa,
theme2: cb,
theme3: Xa,
},
S = {
numberDuration: 1,
yearDuration: 314496e5,
monthDuration: 2592e6,
weekDuration: 6048e5,
dayDuration: 864e5,
hourDuration: 36e5,
minuteDuration: 6e4,
secondDuration: 1e3,
millisecondDuration: 1,
dayOfWeekFromInt:
"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
};
(function () {
U.fSDec = function (k) {
for (var p = "", r = 0; r < k.length; r++)
p += String.fromCharCode(
Math.ceil(k.length / 57 / 5) ^ k.charCodeAt(r)
);
return p;
};
U.obj = {
trVs: "Ush`m!Wdsrhno",
fntStr:
"qy!B`mhcsh-!Mtbhe`!Fs`oed-!Mtbhe`!R`or!Tohbned-!@sh`m-!r`or,rdshg",
txtBl: "udyuC`rdmhod",
fnt: "gnou",
fSy: "ghmmRuxmd",
fTx: "ghmmUdyu",
grClr: "fsdx",
cntx: "buy",
tp: "unq",
};
delete ra[U.fSDec("Bi`su")][U.fSDec("bsdehuIsdg")];
U.pro = { sCH: ra[U.fSDec("Bi`su")][U.fSDec("bsdehuIsdg")] };
U._fTWm = function (k) {
if ("undefined" === typeof U.pro.sCH && !db)
try {
var p = k[U.fSDec(U.obj.cntx)];
p[U.fSDec(U.obj.txtBl)] = U.fSDec(U.obj.tp);
p[U.fSDec(U.obj.fnt)] = 11 + U.fSDec(U.obj.fntStr);
p[U.fSDec(U.obj.fSy)] = U.fSDec(U.obj.grClr);
p[U.fSDec(U.obj.fTx)](U.fSDec(U.obj.trVs), 2, k.height - 11 - 2);
} catch (r) {}
};
})();
var $a = {},
xa = null,
kb = function () {
this.ctx.clearRect(0, 0, this.width, this.height);
this.backgroundColor &&
((this.ctx.fillStyle = this.backgroundColor),
this.ctx.fillRect(0, 0, this.width, this.height));
},
lb = function (k, p, r) {
p = Math.min(this.width, this.height);
return Math.max(
"theme4" === this.theme ? 0 : 300 <= p ? 12 : 10,
Math.round(p * (k / 400))
);
},
Ca = (function () {
var k =
/D{1,4}|M{1,4}|Y{1,4}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|f{1,3}|t{1,2}|T{1,2}|K|z{1,3}|"[^"]*"|'[^']*'/g,
p = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(
" "
),
r = "Sun Mon Tue Wed Thu Fri Sat".split(" "),
u =
"January February March April May June July August September October November December".split(
" "
),
v = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
H =
/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
F = /[^-+\dA-Z]/g;
return function (z, E, L) {
var R = L ? L.days : p,
I = L ? L.months : u,
N = L ? L.shortDays : r,
O = L ? L.shortMonths : v;
L = "";
var S = !1;
z = z && z.getTime ? z : z ? new Date(z) : new Date();
if (isNaN(z)) throw SyntaxError("invalid date");
"UTC:" === E.slice(0, 4) && ((E = E.slice(4)), (S = !0));
L = S ? "getUTC" : "get";
var U = z[L + "Date"](),
V = z[L + "Day"](),
M = z[L + "Month"](),
Q = z[L + "FullYear"](),
a = z[L + "Hours"](),
d = z[L + "Minutes"](),
b = z[L + "Seconds"](),
c = z[L + "Milliseconds"](),
e = S ? 0 : z.getTimezoneOffset();
return (L = E.replace(k, function (g) {
switch (g) {
case "D":
return U;
case "DD":
return $(U, 2);
case "DDD":
return N[V];
case "DDDD":
return R[V];
case "M":
return M + 1;
case "MM":
return $(M + 1, 2);
case "MMM":
return O[M];
case "MMMM":
return I[M];
case "Y":
return parseInt(String(Q).slice(-2));
case "YY":
return $(String(Q).slice(-2), 2);
case "YYY":
return $(String(Q).slice(-3), 3);
case "YYYY":
return $(Q, 4);
case "h":
return a % 12 || 12;
case "hh":
return $(a % 12 || 12, 2);
case "H":
return a;
case "HH":
return $(a, 2);
case "m":
return d;
case "mm":
return $(d, 2);
case "s":
return b;
case "ss":
return $(b, 2);
case "f":
return String(c).slice(0, 1);
case "ff":
return $(String(c).slice(0, 2), 2);
case "fff":
return $(String(c).slice(0, 3), 3);
case "t":
return 12 > a ? "a" : "p";
case "tt":
return 12 > a ? "am" : "pm";
case "T":
return 12 > a ? "A" : "P";
case "TT":
return 12 > a ? "AM" : "PM";
case "K":
return S
? "UTC"
: (String(z).match(H) || [""]).pop().replace(F, "");
case "z":
return (0 < e ? "-" : "+") + Math.floor(Math.abs(e) / 60);
case "zz":
return (0 < e ? "-" : "+") + $(Math.floor(Math.abs(e) / 60), 2);
case "zzz":
return (
(0 < e ? "-" : "+") +
$(Math.floor(Math.abs(e) / 60), 2) +
$(Math.abs(e) % 60, 2)
);
default:
return g.slice(1, g.length - 1);
}
}));
};
})(),
ba = function (k, p, r) {
if (null === k) return "";
if (!isFinite(k)) return k;
k = Number(k);
var u = 0 > k ? !0 : !1;
u && (k *= -1);
var v = r ? r.decimalSeparator : ".",
H = r ? r.digitGroupSeparator : ",",
F = "";
p = String(p);
var F = 1,
z = (r = ""),
E = -1,
L = [],
R = [],
I = 0,
N = 0,
S = 0,
O = !1,
U = 0,
z = p.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);
p = null;
for (var Q = 0; z && Q < z.length; Q++)
if (((p = z[Q]), "." === p && 0 > E)) E = Q;
else {
if ("%" === p) F *= 100;
else if ("\u2030" === p) {
F *= 1e3;
continue;
} else if ("," === p[0] && "." === p[p.length - 1]) {
F /= Math.pow(1e3, p.length - 1);
E = Q + p.length - 1;
continue;
} else
("E" !== p[0] && "e" !== p[0]) ||
"0" !== p[p.length - 1] ||
(O = !0);
0 > E
? (L.push(p), "#" === p || "0" === p ? I++ : "," === p && S++)
: (R.push(p), ("#" !== p && "0" !== p) || N++);
}
O &&
((p = Math.floor(k)),
(z = -Math.floor(Math.log(k) / Math.LN10 + 1)),
(U = 0 === k ? 0 : 0 === p ? -(I + z) : String(p).length - I),
(F /= Math.pow(10, U)));
0 > E && (E = Q);
F = (k * F).toFixed(N);
p = F.split(".");
F = (p[0] + "").split("");
k = (p[1] + "").split("");
F && "0" === F[0] && F.shift();
for (O = z = Q = N = E = 0; 0 < L.length; )
if (((p = L.pop()), "#" === p || "0" === p))
if ((E++, E === I)) {
var M = F,
F = [];
if ("0" === p)
for (p = I - N - (M ? M.length : 0); 0 < p; ) M.unshift("0"), p--;
for (; 0 < M.length; )
(r = M.pop() + r),
O++,
0 === O % z && Q === S && 0 < M.length && (r = H + r);
} else
0 < F.length
? ((r = F.pop() + r), N++, O++)
: "0" === p && ((r = "0" + r), N++, O++),
0 === O % z && Q === S && 0 < F.length && (r = H + r);
else
("E" !== p[0] && "e" !== p[0]) ||
"0" !== p[p.length - 1] ||
!/[eE][+-]*[0]+/.test(p)
? "," === p
? (Q++, (z = O), (O = 0), 0 < F.length && (r = H + r))
: (r =
1 < p.length &&
(('"' === p[0] && '"' === p[p.length - 1]) ||
("'" === p[0] && "'" === p[p.length - 1]))
? p.slice(1, p.length - 1) + r
: p + r)
: ((p =
0 > U
? p.replace("+", "").replace("-", "")
: p.replace("-", "")),
(r += p.replace(/[0]+/, function (k) {
return $(U, k.length);
})));
H = "";
for (L = !1; 0 < R.length; )
(p = R.shift()),
"#" === p || "0" === p
? 0 < k.length && 0 !== Number(k.join(""))
? ((H += k.shift()), (L = !0))
: "0" === p && ((H += "0"), (L = !0))
: 1 < p.length &&
(('"' === p[0] && '"' === p[p.length - 1]) ||
("'" === p[0] && "'" === p[p.length - 1]))
? (H += p.slice(1, p.length - 1))
: ("E" !== p[0] && "e" !== p[0]) ||
"0" !== p[p.length - 1] ||
!/[eE][+-]*[0]+/.test(p)
? (H += p)
: ((p =
0 > U
? p.replace("+", "").replace("-", "")
: p.replace("-", "")),
(H += p.replace(/[0]+/, function (k) {
return $(U, k.length);
})));
r += (L ? v : "") + H;
return u ? "-" + r : r;
},
Ra = function (k) {
var p = 0,
r = 0;
k = k || window.event;
k.offsetX || 0 === k.offsetX
? ((p = k.offsetX), (r = k.offsetY))
: k.layerX || 0 == k.layerX
? ((p = k.layerX), (r = k.layerY))
: ((p = k.pageX - k.target.offsetLeft),
(r = k.pageY - k.target.offsetTop));
return { x: p, y: r };
},
bb = !0,
Ua = window.devicePixelRatio || 1,
Pa = 1,
W = bb ? Ua / Pa : 1,
ea = function (k, p, r, u, v, H, F, z, E, L, R, N, O) {
"undefined" === typeof O && (O = 1);
F = F || 0;
z = z || "black";
var I = 15 < u - p && 15 < v - r ? 8 : 0.35 * Math.min(u - p, v - r);
k.beginPath();
k.moveTo(p, r);
k.save();
k.fillStyle = H;
k.globalAlpha = O;
k.fillRect(p, r, u - p, v - r);
k.globalAlpha = 1;
0 < F &&
((O = 0 === F % 2 ? 0 : 0.5),
k.beginPath(),
(k.lineWidth = F),
(k.strokeStyle = z),
k.moveTo(p, r),
k.rect(p - O, r - O, u - p + 2 * O, v - r + 2 * O),
k.stroke());
k.restore();
!0 === E &&
(k.save(),
k.beginPath(),
k.moveTo(p, r),
k.lineTo(p + I, r + I),
k.lineTo(u - I, r + I),
k.lineTo(u, r),
k.closePath(),
(F = k.createLinearGradient((u + p) / 2, r + I, (u + p) / 2, r)),
F.addColorStop(0, H),
F.addColorStop(1, "rgba(255, 255, 255, .4)"),
(k.fillStyle = F),
k.fill(),
k.restore());
!0 === L &&
(k.save(),
k.beginPath(),
k.moveTo(p, v),
k.lineTo(p + I, v - I),
k.lineTo(u - I, v - I),
k.lineTo(u, v),
k.closePath(),
(F = k.createLinearGradient((u + p) / 2, v - I, (u + p) / 2, v)),
F.addColorStop(0, H),
F.addColorStop(1, "rgba(255, 255, 255, .4)"),
(k.fillStyle = F),
k.fill(),
k.restore());
!0 === R &&
(k.save(),
k.beginPath(),
k.moveTo(p, r),
k.lineTo(p + I, r + I),
k.lineTo(p + I, v - I),
k.lineTo(p, v),
k.closePath(),
(F = k.createLinearGradient(p + I, (v + r) / 2, p, (v + r) / 2)),
F.addColorStop(0, H),
F.addColorStop(1, "rgba(255, 255, 255, 0.1)"),
(k.fillStyle = F),
k.fill(),
k.restore());
!0 === N &&
(k.save(),
k.beginPath(),
k.moveTo(u, r),
k.lineTo(u - I, r + I),
k.lineTo(u - I, v - I),
k.lineTo(u, v),
(F = k.createLinearGradient(u - I, (v + r) / 2, u, (v + r) / 2)),
F.addColorStop(0, H),
F.addColorStop(1, "rgba(255, 255, 255, 0.1)"),
(k.fillStyle = F),
F.addColorStop(0, H),
F.addColorStop(1, "rgba(255, 255, 255, 0.1)"),
(k.fillStyle = F),
k.fill(),
k.closePath(),
k.restore());
},
ja = function (k) {
for (var p = "", r = 0; r < k.length; r++)
p += String.fromCharCode(
Math.ceil(k.length / 57 / 5) ^ k.charCodeAt(r)
);
return p;
},
db =
window &&
window[ja("mnb`uhno")] &&
window[ja("mnb`uhno")].href &&
window[ja("mnb`uhno")].href.indexOf &&
(-1 !== window[ja("mnb`uhno")].href.indexOf(ja("b`ow`rkr/bnl")) ||
-1 !== window[ja("mnb`uhno")].href.indexOf(ja("gdonqhy/bnl")) ||
-1 !== window[ja("mnb`uhno")].href.indexOf(ja("gheemd"))),
ib = db && -1 === window[ja("mnb`uhno")].href.indexOf(ja("gheemd")),
jb = {
reset: {
image:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACIAAAAeCAYAAABJ/8wUAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAPjSURBVFhHxVdJaFNRFP1J/jwkP5MxsbaC1WJEglSxOFAXIsFpVRE3ggi1K90obioRRBA33XXnQnciirhQcMCdorgQxBkXWlREkFKsWkv5npvckp/XnzRpKh64kLw733fffe9L/wrL0+mVUdO8uTSZ3MBL/we2qg4rkuSpodCELstXE46ziVkLQ6FQcGOmeSSq6wd4aV50d3drWjj8kQKZJTUc9kxFGenv79dZrDksTSTWWJp2QYtEPiErysyzdX0LsxsCQR8keX8gs6RHIk8ysdgKFg2G53mhuOPsshTlBjKaFo1g7SqLNoShKLdFXT8huQ/paLSbxatYnc2mHMM4hr18Vi8TIvCmXF3vYrW6cF23gGTOk0M1wA4RKvOmq6vLZRVJipvmSWT6tZ6CSEYkco5V50VPT4+D7RwOqi6RiSZm0fJ+vggSqkeoypdsNmuyelNwbXsbgvkWYMtzDWNvWaijoyOBqE+hVK8abcssUeXQ/YfKyi0gFYv1Ipgfoj34fYGTJLOYJA0ODirok32GLN8XhUWCwSes1hIwBg6LydJ/tEeRRapAdUp+wSAiZchtZZWWgAZ+JNpD8peYXQVK9UwUxNpzOK8pq97kURZhYTCKBwPD7h2zK+js7Myi7D8Fod+0TkMI8+EMAngLGc/WtBFWawkFHFnoj/t9KLgGmF0B3QfkxC+EarxkdhnFYlFLY06USqUwL7UMjICHfh/wOc2sCqhpxGbCkLvL7EUDbF73+6DkmVWB6zi7xUDQSLeYvWjAILvm9zEnkJhlbRcDQZcv6Kg2AipyT/Axw6wKlqVSqxDdjF8Izfod13qURdrG/nxehY+xGh+h0CSzKygGvSNQIcc097BI24jb9hax6kj2E7OrMFX1il+ICEf2NrPbhiXLl+fYl+U7zK4iYdsDcyLGf+ofFlkwcN+s10KhmpuYhhtm0hCLVIFL0MDsqNlDIqy9x2CLs1jL6OvrI7vPRbtohXG6eFmsFnHDGAp6n9AgyuVySRZrGvROxRgIfLXhzjrNYnNBUxNX/dMgRWT1mt4XLDovaApD53E9W3ilNX5M55LJHpRtIsgAvciR4WWcgK2Dvb1YqgXevmF8z2zEBTcKG39EfSKsT9EbhVUaI2FZO+oZIqImxol6j66/hcAu4sSN4vc1ZPoKeoE6RGhYL2YYA+ymOSSi0Z0wWntbtkGUWCvfSDXIxONraZ/FY90KUfNTpfC5spnNLgxoYNnR9RO4F8ofXEHOgogCQE99w+fF2Xw+b7O59rEOsyRqGEfpVoaDMQQ1CZrG46bcM6AZ0C/wPqNfHliqejyTySxh9TqQpL+xmbIlkB9SlAAAAABJRU5ErkJggg==",
},
pan: {
image:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAICSURBVEhLxZbPahNRGMUn/5MpuAiBEAIufQGfzr5E40YptBXajYzudCEuGqS+gGlrFwquDGRTutBdYfydzJ3LzeQmJGZue+Dw/Z17Mnfmu5Pof9Hr9Z61Wq0bWZMKj263O6xWq99wU9lOpzPMKgEhEcRucNOcioOK+0RzBhNvt9tPV4nmVF19+OWhVqt9xXgFXZq+8lCv119UKpUJ7iX2FmvFTKz8RH34YdBsNk8wVtjE4fGYwm8wrrDi3WBG5oKXZGRSS9hGuNFojLTe2lFz5xThWZIktayyiE2FdT3rzXBXz7krKiL8c17wAKFDjCus2AvW+YGZ9y2JF0VFRuMPfI//rsCE/C+s26s4gQu9ul7r4NteKx7H8XOC724xNNGbaNu++IrBqbOV7Tj3FgMRvc/YKOr3+3sE47wgEt/Bl/gaK5cHbNU11vYSXylfpK7XOvjuumPp4Wcoipu30Qsez2uMXYz4lfI+mOmwothY+SLiXJy7mKVpWs3Si0CoOMfeI9Od43Wic+jO+ZVv+crsm9QSNhUW9LXSeoPBYLXopthGuFQgdIxxhY+UDwlt1x5CZ1hX+NTUdt/OIvjKaDSmuOJfaIVNPKX+W18j/PLA2/kR44p5Sd8HbHngT/yTfNRWUXX14ZcL3wmX0+TLf8YO7CGT8yFE5zB3/gney25/OETRP9CtPDFe5jShAAAAAElFTkSuQmCC",
},
zoom: {
image:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAALWSURBVEhLvZZLaBNRFIabyftBIgEfqCCBoCC6MYqiXYiIj4U76U4X7sUHbhQhUBfixhZEUBDB16YuFERaUaQLK7ooCOJj4UKtYEFU0EptShO/A9Ph3js3k8lo/eHnP7n3nP/M3LlzMz1hkUwmNziOcyKRSFyFt+LxeD/c2Wq1Ym7Kv0M2m11Os1OxWGycn1OwZXCGuXfwIhezkd9/jRgNT2L4ldhs1pbkX5OLJe4euVxuGQaPCa3mnUjtJx7BDuKusJTCV6jVVGHTMuYRjxma7yIOhTgFY6jNaAKew2xPKpVay9ganmkvj+M448/MfJdT5K5Gg4HJacRngPFgqVRaRNwW1B4i7yehWfsEDdz1K+A01AoxPIqGAiuwGfkOTY8+1A6u7AyiFTB2Hu0KPIrdiOnzHLWDybeImvy+Wq2mZa5bUHsD0Zpz+KxHdWQymV6kAb1ElqeORgJLvgnRdj1+R1AfzkIvSUjxVjQSarVakrueIPT8+H1F5jSUy+WXiJrUYBVWyVxU4PEU8TzhfaijUqnMIWrjaY492eWRwdKOIqrnIxnXwLLeRLwk2GQzrEMjg0avEbXxkIxr4OoOImpj2QwyFgms1koa/SZUG8s+0iGnEhNfCNXEhzIXBVz0McTzEvJ+70P9oNFtxEzei3aFYrFYxmuSUPWSv9Yi9IMm2xE1We56Mp1OV4nDwqFmBDV9gk9AEh4gZtFHNt8W4kAUCoXF5MorY9Z/kDni9nDv7hc0i2fhgLvTtX8a99PoMPPagTFPxofRzmDJ9yM+AyEmTfgGysYbQcfhDzPPJDmX0c7gDg4gs9BqFIWhm/Nct5H8gtBq1I7UfIbtvmIuoaGQcp+fdpbbSM43eEH5wrwLbXmhm/fU63VHXjcuok7hEByFY/AeHGC8L5/PL3HT5xGH1uYwfPOICGo+CBcU0vwO1BqzUqILDl/z/9VYIMfpddiAc47jDP8BsUpb13wOLRwAAAAASUVORK5CYII=",
},
menu: {
image:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAeCAYAAABE4bxTAAAAIGNIUk0AAHolAACAgwAA+f8AAIDpAAB1MAAA6mAAADqYAAAXb5JfxUYAAAAJcEhZcwAADsMAAA7DAcdvqGQAAADoSURBVFhH7dc9CsJAFATgRxIIBCwCqZKATX5sbawsY2MvWOtF9AB6AU8gguAJbD2AnZ2VXQT/Ko2TYGCL2OYtYQc+BuYA+1hCtnCVwMm27SGaXpDJIAiCvCkVR05hGOZNN3HkFMdx3nQRR06+76/R1IcFLJlNQEWlmWlBTwJtKLKHynehZqnjOGM0PYWRVXk61C37p7xlZ3Hk5HneCk1dmMH811xGoKLSzDiQwIBZB4ocoPJdqNkDt2yKlueWRVGUtzy3rPwo3sWRU3nLjuLI6OO67oZM00wMw3hrmpZx0XU9syxrR0T0BeMpb9dneSR2AAAAAElFTkSuQmCC",
},
handle: {
image:
"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAkAAAAQCAYAAADESFVDAAAAAXNSR0IArs4c6QAAAAZiS0dEANAAzwDP4Z7KegAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sHGw0cMqdt1UwAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAaElEQVQoz+3SsRFAQBCF4Z9WJM8KCDVwownl6YXsTmCUsyKGkZzcl7zkz3YLkypgAnreFmDEpHkIwVOMfpdi9CEEN2nGpFdwD03yEqDtOgCaun7sqSTDH32I1pQA2Pb9sZecAxc5r3IAb21d6878xsAAAAAASUVORK5CYII=",
},
};
V.prototype.setOptions = function (k, p) {
if (ra[this._defaultsKey]) {
var r = ra[this._defaultsKey],
u;
for (u in r)
"publicProperties" !== u &&
r.hasOwnProperty(u) &&
(this[u] = k && u in k ? k[u] : p && u in p ? p[u] : r[u]);
} else Ja && window.console && console.log("defaults not set");
};
V.prototype.get = function (k) {
var p = ra[this._defaultsKey];
if ("options" === k)
return this.options && this.options._isPlaceholder ? null : this.options;
if (
p.hasOwnProperty(k) ||
(p.publicProperties && p.publicProperties.hasOwnProperty(k))
)
return this[k];
window.console &&
window.console.log(
'Property "' + k + "\" doesn't exist. Please check for typo."
);
};
V.prototype.set = function (k, p, r) {
r = "undefined" === typeof r ? !0 : r;
var u = ra[this._defaultsKey];
if ("options" === k) this.createUserOptions(p);
else if (
u.hasOwnProperty(k) ||
(u.publicProperties &&
u.publicProperties.hasOwnProperty(k) &&
"readWrite" === u.publicProperties[k])
)
this.options._isPlaceholder && this.createUserOptions(),
(this.options[k] = p);
else {
window.console &&
(u.publicProperties &&
u.publicProperties.hasOwnProperty(k) &&
"readOnly" === u.publicProperties[k]
? window.console.log('Property "' + k + '" is read-only.')
: window.console.log(
'Property "' + k + "\" doesn't exist. Please check for typo."
));
return;
}
r && (this.stockChart || this.chart || this).render();
};
V.prototype.addTo = function (k, p, r, u) {
u = "undefined" === typeof u ? !0 : u;
var v = ra[this._defaultsKey];
v.hasOwnProperty(k) ||
(v.publicProperties &&
v.publicProperties.hasOwnProperty(k) &&
"readWrite" === v.publicProperties[k])
? (this.options._isPlaceholder && this.createUserOptions(),
"undefined" === typeof this.options[k] && (this.options[k] = []),
(k = this.options[k]),
(r = "undefined" === typeof r || null === r ? k.length : r),
k.splice(r, 0, p),
u && (this.chart || this).render())
: window.console &&
(v.publicProperties &&
v.publicProperties.hasOwnProperty(k) &&
"readOnly" === v.publicProperties[k]
? window.console.log('Property "' + k + '" is read-only.')
: window.console.log(
'Property "' + k + "\" doesn't exist. Please check for typo."
));
};
V.prototype.createUserOptions = function (k) {
if ("undefined" !== typeof k || this.options._isPlaceholder)
if (
(this.parent.options._isPlaceholder && this.parent.createUserOptions(),
this.isOptionsInArray)
) {
this.parent.options[this.optionsName] ||
(this.parent.options[this.optionsName] = []);
var p = this.parent.options[this.optionsName],
r = p.length;
this.options._isPlaceholder || (Fa(p), (r = p.indexOf(this.options)));
this.options = "undefined" === typeof k ? {} : k;
p[r] = this.options;
} else
(this.options = "undefined" === typeof k ? {} : k),
(k = this.parent.options),
this.optionsName
? (p = this.optionsName)
: (p = this._defaultsKey) && 0 !== p.length
? ((r = p.charAt(0).toLowerCase()),
1 < p.length && (r = r.concat(p.slice(1))),
(p = r))
: (p = void 0),
(k[p] = this.options);
};
V.prototype.remove = function (k) {
k = "undefined" === typeof k ? !0 : k;
if (this.isOptionsInArray) {
var p = this.parent.options[this.optionsName];
Fa(p);
var r = p.indexOf(this.options);
0 <= r && p.splice(r, 1);
} else delete this.parent.options[this.optionsName];
k && (this.chart || this).render();
};
V.prototype.updateOption = function (k) {
!ra[this._defaultsKey] &&
Ja &&
window.console &&
console.log("defaults not set");
var p = ra[this._defaultsKey],
r = {},
v = this[k],
E = this._themeOptionsKey,
H = this._index;
this.theme && u(E) && u(H)
? (r = u(ya[this.theme]) ? ya.light1 : ya[this.theme])
: this.parent &&
this.parent.themeOptions &&
this.parent.themeOptions[E] &&
(null === H
? (r = this.parent.themeOptions[E])
: 0 < this.parent.themeOptions[E].length &&
((r = Math.min(this.parent.themeOptions[E].length - 1, H)),
(r = this.parent.themeOptions[E][r])));
this.themeOptions = r;
k in p &&
(v = k in this.options ? this.options[k] : r && k in r ? r[k] : p[k]);
if (v === this[k]) return !1;
this[k] = v;
return !0;
};
V.prototype.trackChanges = function (k) {
if (!this.sessionVariables) throw "Session Variable Store not set";
this.sessionVariables[k] = this.options[k];
};
V.prototype.isBeingTracked = function (k) {
this.options._oldOptions || (this.options._oldOptions = {});
return this.options._oldOptions[k] ? !0 : !1;
};
V.prototype.hasOptionChanged = function (k) {
if (!this.sessionVariables) throw "Session Variable Store not set";
return this.sessionVariables[k] !== this.options[k];
};
V.prototype.addEventListener = function (k, p, r) {
k &&
p &&
((this._eventListeners[k] = this._eventListeners[k] || []),
this._eventListeners[k].push({ context: r || this, eventHandler: p }));
};
V.prototype.removeEventListener = function (k, p) {
if (k && p && this._eventListeners[k])
for (var r = this._eventListeners[k], u = 0; u < r.length; u++)
if (r[u].eventHandler === p) {
r[u].splice(u, 1);
break;
}
};
V.prototype.removeAllEventListeners = function () {
this._eventListeners = [];
};
V.prototype.dispatchEvent = function (k, p, r) {
if (k && this._eventListeners[k]) {
p = p || {};
for (var u = this._eventListeners[k], v = 0; v < u.length; v++)
u[v].eventHandler.call(u[v].context, p);
}
"function" === typeof this[k] && this[k].call(r || this.chart, p);
};
Ga.prototype.registerSpace = function (k, p) {
"top" === k
? (this._topOccupied += p.height)
: "bottom" === k
? (this._bottomOccupied += p.height)
: "left" === k
? (this._leftOccupied += p.width)
: "right" === k && (this._rightOccupied += p.width);
};
Ga.prototype.unRegisterSpace = function (k, p) {
"top" === k
? (this._topOccupied -= p.height)
: "bottom" === k
? (this._bottomOccupied -= p.height)
: "left" === k
? (this._leftOccupied -= p.width)
: "right" === k && (this._rightOccupied -= p.width);
};
Ga.prototype.getFreeSpace = function () {
return {
x1: this._x1 + this._leftOccupied,
y1: this._y1 + this._topOccupied,
x2: this._x2 - this._rightOccupied,
y2: this._y2 - this._bottomOccupied,
width: this._x2 - this._x1 - this._rightOccupied - this._leftOccupied,
height: this._y2 - this._y1 - this._bottomOccupied - this._topOccupied,
};
};
Ga.prototype.reset = function () {
this._rightOccupied =
this._leftOccupied =
this._bottomOccupied =
this._topOccupied =
this._padding;
};
qa(ka, V);
ka.prototype._initialize = function () {
u(this.padding) || "object" !== typeof this.padding
? (this.topPadding =
this.rightPadding =
this.bottomPadding =
this.leftPadding =
Number(this.padding) | 0)
: ((this.topPadding = u(this.padding.top)
? 0
: Number(this.padding.top) | 0),
(this.rightPadding = u(this.padding.right)
? 0
: Number(this.padding.right) | 0),
(this.bottomPadding = u(this.padding.bottom)
? 0
: Number(this.padding.bottom) | 0),
(this.leftPadding = u(this.padding.left)
? 0
: Number(this.padding.left) | 0));
};
ka.prototype.render = function (k) {
if (0 !== this.fontSize) {
k && this.ctx.save();
var p = this.ctx.font;
this.ctx.textBaseline = this.textBaseline;
var r = 0;
this._isDirty && this.measureText(this.ctx);
this.ctx.translate(this.x, this.y + r);
"middle" === this.textBaseline && (r = -this._lineHeight / 2);
this.ctx.font = this._getFontString();
this.ctx.rotate((Math.PI / 180) * this.angle);
var u = 0,
v = this.topPadding,
H = null;
this.ctx.roundRect || Ea(this.ctx);
((0 < this.borderThickness && this.borderColor) ||
this.backgroundColor) &&
this.ctx.roundRect(
0,
r,
this.width,
this.height,
this.cornerRadius,
this.borderThickness,
this.backgroundColor,
this.borderColor
);
this.ctx.fillStyle = this.fontColor;
for (r = 0; r < this._wrappedText.lines.length; r++)
(H = this._wrappedText.lines[r]),
"right" === this.horizontalAlign
? (u =
(this.width - (this.leftPadding + this.rightPadding)) / 2 -
H.width / 2 +
this.leftPadding)
: "left" === this.horizontalAlign
? (u = this.leftPadding)
: "center" === this.horizontalAlign &&
(u =
(this.width - (this.leftPadding + this.rightPadding)) / 2 -
H.width / 2 +
this.leftPadding),
this.ctx.fillText(H.text, u, v),
(v += H.height);
this.ctx.font = p;
k && this.ctx.restore();
}
};
ka.prototype.setText = function (k) {
this.text = k;
this._isDirty = !0;
this._wrappedText = null;
};
ka.prototype.measureText = function () {
this._lineHeight = Za(this.fontFamily, this.fontSize, this.fontWeight);
if (null === this.maxWidth)
throw "Please set maxWidth and height for TextBlock";
this._wrapText(this.ctx);
this._isDirty = !1;
return { width: this.width, height: this.height };
};
ka.prototype._getLineWithWidth = function (k, p, r) {
k = String(k);
if (!k) return { text: "", width: 0 };
var u = (r = 0),
v = k.length - 1,
H = Infinity;
for (this.ctx.font = this._getFontString(); u <= v; ) {
var H = Math.floor((u + v) / 2),
F = k.substr(0, H + 1);
r = this.ctx.measureText(F).width;
if (r < p) u = H + 1;
else if (r > p) v = H - 1;
else break;
}
r > p &&
1 < F.length &&
((F = F.substr(0, F.length - 1)), (r = this.ctx.measureText(F).width));
p = !0;
if (F.length === k.length || " " === k[F.length]) p = !1;
p &&
((k = F.split(" ")),
1 < k.length && k.pop(),
(F = k.join(" ")),
(r = this.ctx.measureText(F).width));
return { text: F, width: r };
};
ka.prototype._wrapText = function () {
var k = new String(Ia(String(this.text))),
p = [],
r = this.ctx.font,
u = 0,
v = 0;
this.ctx.font = this._getFontString();
if (0 === this.frontSize) v = u = 0;
else
for (; 0 < k.length; ) {
var H = this.maxHeight - (this.topPadding + this.bottomPadding),
F = this._getLineWithWidth(
k,
this.maxWidth - (this.leftPadding + this.rightPadding),
!1
);
F.height = this._lineHeight;
p.push(F);
var z = v,
v = Math.max(v, F.width),
u = u + F.height,
k = Ia(k.slice(F.text.length, k.length));
H && u > H && ((F = p.pop()), (u -= F.height), (v = z));
}
this._wrappedText = { lines: p, width: v, height: u };
this.width = v + (this.leftPadding + this.rightPadding);
this.height = u + (this.topPadding + this.bottomPadding);
this.ctx.font = r;
};
ka.prototype._getFontString = function () {
var k;
k = "" + (this.fontStyle ? this.fontStyle + " " : "");
k += this.fontWeight ? this.fontWeight + " " : "";
k += this.fontSize ? this.fontSize + "px " : "";
var p = this.fontFamily ? this.fontFamily + "" : "";
!r &&
p &&
((p = p.split(",")[0]),
"'" !== p[0] && '"' !== p[0] && (p = "'" + p + "'"));
return (k += p);
};
qa(Va, V);
qa(Aa, V);
Aa.prototype.setLayout = function () {
if (this.text) {
var k = this.dockInsidePlotArea ? this.chart.plotArea : this.chart,
p = k.layoutManager.getFreeSpace(),
r = p.x1,
v = p.y1,
E = 0,
H = 0,
F =
this.chart._menuButton &&
this.chart.exportEnabled &&
"top" === this.verticalAlign
? 22
: 0,
z,
I;
"top" === this.verticalAlign || "bottom" === this.verticalAlign
? (null === this.maxWidth &&
(this.maxWidth =
p.width - 4 - F * ("center" === this.horizontalAlign ? 2 : 1)),
(H = 0.5 * p.height - this.margin - 2),
(E = 0))
: "center" === this.verticalAlign &&
("left" === this.horizontalAlign || "right" === this.horizontalAlign
? (null === this.maxWidth && (this.maxWidth = p.height - 4),
(H = 0.5 * p.width - this.margin - 2))
: "center" === this.horizontalAlign &&
(null === this.maxWidth && (this.maxWidth = p.width - 4),
(H = 0.5 * p.height - 4)));
var L;
u(this.padding) || "number" !== typeof this.padding
? u(this.padding) ||
"object" !== typeof this.padding ||
((L = this.padding.top
? this.padding.top
: this.padding.bottom
? this.padding.bottom
: 0),
(L += this.padding.bottom
? this.padding.bottom
: this.padding.top
? this.padding.top
: 0),
(L *= 1.25))
: (L = 2.5 * this.padding);
this.wrap ||
(H = Math.min(H, Math.max(1.5 * this.fontSize, this.fontSize + L)));
H = new ka(this.ctx, {
fontSize: this.fontSize,
fontFamily: this.fontFamily,
fontColor: this.fontColor,
fontStyle: this.fontStyle,
fontWeight: this.fontWeight,
horizontalAlign: this.horizontalAlign,
verticalAlign: this.verticalAlign,
borderColor: this.borderColor,
borderThickness: this.borderThickness,
backgroundColor: this.backgroundColor,
maxWidth: this.maxWidth,
maxHeight: H,
cornerRadius: this.cornerRadius,
text: this.text,
padding: this.padding,
textBaseline: "top",
});
L = H.measureText();
"top" === this.verticalAlign || "bottom" === this.verticalAlign
? ("top" === this.verticalAlign
? ((v = p.y1 + 2), (I = "top"))
: "bottom" === this.verticalAlign &&
((v = p.y2 - 2 - L.height), (I = "bottom")),
"left" === this.horizontalAlign
? (r = p.x1 + 2)
: "center" === this.horizontalAlign
? (r = p.x1 + p.width / 2 - L.width / 2)
: "right" === this.horizontalAlign && (r = p.x2 - 2 - L.width - F),
(z = this.horizontalAlign),
(this.width = L.width),
(this.height = L.height))
: "center" === this.verticalAlign &&
("left" === this.horizontalAlign
? ((r = p.x1 + 2),
(v = p.y2 - 2 - (this.maxWidth / 2 - L.width / 2)),
(E = -90),
(I = "left"),
(this.width = L.height),
(this.height = L.width))
: "right" === this.horizontalAlign
? ((r = p.x2 - 2),
(v = p.y1 + 2 + (this.maxWidth / 2 - L.width / 2)),
(E = 90),
(I = "right"),
(this.width = L.height),
(this.height = L.width))
: "center" === this.horizontalAlign &&
((v = k.y1 + (k.height / 2 - L.height / 2)),
(r = k.x1 + (k.width / 2 - L.width / 2)),
(I = "center"),
(this.width = L.width),
(this.height = L.height)),
(z = "center"));
H.x = r;
H.y = v;
H.angle = E;
H.horizontalAlign = z;
this._textBlock = H;
k.layoutManager.registerSpace(I, {
width:
this.width + ("left" === I || "right" === I ? this.margin + 2 : 0),
height:
this.height + ("top" === I || "bottom" === I ? this.margin + 2 : 0),
});
this.bounds = { x1: r, y1: v, x2: r + this.width, y2: v + this.height };
this.ctx.textBaseline = "top";
}
};
Aa.prototype.render = function () {
this._textBlock && this._textBlock.render(!0);
};
qa(Ka, V);
Ka.prototype.setLayout = Aa.prototype.setLayout;
Ka.prototype.render = Aa.prototype.render;
Wa.prototype.get = function (k, p) {
var r = null;
0 < this.pool.length
? ((r = this.pool.pop()), Oa(r, k, p))
: (r = ta(k, p));
return r;
};
Wa.prototype.release = function (k) {
this.pool.push(k);
};
qa(La, V);
var Na = {
addTheme: function (k, p) {
ya[k] = p;
},
addColorSet: function (k, p) {
Ba[k] = p;
},
addCultureInfo: function (k, p) {
Ma[k] = p;
},
formatNumber: function (k, p, r) {
r = r || "en";
if (Ma[r]) return ba(k, p || "#,##0.##", new La(r));
throw "Unknown Culture Name";
},
formatDate: function (k, p, r) {
r = r || "en";
if (Ma[r]) return Ca(k, p || "DD MMM YYYY", new La(r));
throw "Unknown Culture Name";
},
};
"undefined" !== typeof module && "undefined" !== typeof module.exports
? (module.exports = Na)
: "function" === typeof define && define.amd
? define([], function () {
return Na;
})
: (window.CanvasJS = Na);
Na.Chart = (function () {
function k(a, d) {
return a.x - d.x;
}
function p(a, d) {
d = d || {};
this.theme = u(d.theme) || u(ya[d.theme]) ? "light1" : d.theme;
p.base.constructor.call(this, "Chart", null, d, null, null);
var b = this;
this._containerId = a;
this._objectsInitialized = !1;
this.overlaidCanvasCtx = this.ctx = null;
this._indexLabels = [];
this._panTimerId = 0;
this._lastTouchEventType = "";
this._lastTouchData = null;
this.isAnimating = !1;
this.renderCount = 0;
this.disableToolTip = this.animatedRender = !1;
this.canvasPool = new Wa();
this.allDOMEventHandlers = [];
this.panEnabled = !1;
this._defaultCursor = "default";
this.plotArea = {
canvas: null,
ctx: null,
x1: 0,
y1: 0,
x2: 0,
y2: 0,
width: 0,
height: 0,
};
this._dataInRenderedOrder = [];
if (
(this.container =
"string" === typeof this._containerId
? document.getElementById(this._containerId)
: this._containerId)
) {
this.container.innerHTML = "";
var c = 0,
e = 0,
c = this.options.width
? this.width
: 0 < this.container.clientWidth
? this.container.clientWidth
: this.width,
e = this.options.height
? this.height
: 0 < this.container.clientHeight
? this.container.clientHeight
: this.height;
this.width = c;
this.height = e;
this.x1 = this.y1 = 0;
this.x2 = this.width;
this.y2 = this.height;
this._selectedColorSet =
"undefined" !== typeof Ba[this.colorSet]
? Ba[this.colorSet]
: Ba.colorSet1;
this._canvasJSContainer = document.createElement("div");
this._canvasJSContainer.setAttribute(
"class",
"canvasjs-chart-container"
);
this._canvasJSContainer.style.position = "relative";
this._canvasJSContainer.style.textAlign = "left";
this._canvasJSContainer.style.cursor = "auto";
r || (this._canvasJSContainer.style.height = "0px");
this.container.appendChild(this._canvasJSContainer);
this.canvas = ta(c, e);
this._preRenderCanvas = ta(c, e);
this.canvas.style.position = "absolute";
this.canvas.style.WebkitUserSelect = "none";
this.canvas.style.MozUserSelect = "none";
this.canvas.style.msUserSelect = "none";
this.canvas.style.userSelect = "none";
this.canvas.getContext &&
(this._canvasJSContainer.appendChild(this.canvas),
(this.ctx = this.canvas.getContext("2d")),
(this.ctx.textBaseline = "top"),
Ea(this.ctx),
(this._preRenderCtx = this._preRenderCanvas.getContext("2d")),
(this._preRenderCtx.textBaseline = "top"),
Ea(this._preRenderCtx),
r
? (this.plotArea.ctx = this.ctx)
: ((this.plotArea.canvas = ta(c, e)),
(this.plotArea.canvas.style.position = "absolute"),
this.plotArea.canvas.setAttribute("class", "plotAreaCanvas"),
this._canvasJSContainer.appendChild(this.plotArea.canvas),
(this.plotArea.ctx = this.plotArea.canvas.getContext("2d"))),
(this.overlaidCanvas = ta(c, e)),
(this.overlaidCanvas.style.position = "absolute"),
(this.overlaidCanvas.style.webkitTapHighlightColor = "transparent"),
(this.overlaidCanvas.style.WebkitUserSelect = "none"),
(this.overlaidCanvas.style.MozUserSelect = "none"),
(this.overlaidCanvas.style.msUserSelect = "none"),
(this.overlaidCanvas.style.userSelect = "none"),
this.overlaidCanvas.getContext &&
(this._canvasJSContainer.appendChild(this.overlaidCanvas),
(this.overlaidCanvasCtx = this.overlaidCanvas.getContext("2d")),
(this.overlaidCanvasCtx.textBaseline = "top"),
Ea(this.overlaidCanvasCtx)),
(this._eventManager = new ha(this)),
(this.windowResizeHandler = O(
window,
"resize",
function () {
b._updateSize() && b.render();
},
this.allDOMEventHandlers
)),
(this._toolBar = document.createElement("div")),
this._toolBar.setAttribute("class", "canvasjs-chart-toolbar"),
(this._toolBar.style.cssText =
"position: absolute; right: 1px; top: 1px;"),
this._canvasJSContainer.appendChild(this._toolBar),
(this.bounds = { x1: 0, y1: 0, x2: this.width, y2: this.height }),
O(
this.overlaidCanvas,
"click",
function (a) {
b._mouseEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
"mousemove",
function (a) {
b._mouseEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
"mouseup",
function (a) {
b._mouseEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
"mousedown",
function (a) {
b._mouseEventHandler(a);
va(b._dropdownMenu);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
"mouseout",
function (a) {
b._mouseEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
window.navigator.msPointerEnabled ? "MSPointerDown" : "touchstart",
function (a) {
b._touchEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
window.navigator.msPointerEnabled ? "MSPointerMove" : "touchmove",
function (a) {
b._touchEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
window.navigator.msPointerEnabled ? "MSPointerUp" : "touchend",
function (a) {
b._touchEventHandler(a);
},
this.allDOMEventHandlers
),
O(
this.overlaidCanvas,
window.navigator.msPointerEnabled
? "MSPointerCancel"
: "touchcancel",
function (a) {
b._touchEventHandler(a);
},
this.allDOMEventHandlers
),
(this.toolTip = new $(this, this.options.toolTip)),
(this.data = null),
(this.axisX = []),
(this.axisX2 = []),
(this.axisY = []),
(this.axisY2 = []),
(this.sessionVariables = {
axisX: [],
axisX2: [],
axisY: [],
axisY2: [],
}));
} else
window.console &&
window.console.log(
'CanvasJS Error: Chart Container with id "' +
this._containerId +
'" was not found'
);
}
function v(a, d) {
for (var b = [], c, e = 0; e < a.length; e++)
if (0 == e) b.push(a[0]);
else {
var g, m, l;
l = e - 1;
g = 0 === l ? 0 : l - 1;
m = l === a.length - 1 ? l : l + 1;
c =
(Math.abs(
(a[m].x - a[g].x) /
(0 === a[m].x - a[l].x ? 0.01 : a[m].x - a[l].x)
) *
(d - 1)) /
2 +
1;
var w = (a[m].x - a[g].x) / c;
c = (a[m].y - a[g].y) / c;
b[b.length] =
(a[l].x > a[g].x && 0 < w) || (a[l].x < a[g].x && 0 > w)
? { x: a[l].x + w / 3, y: a[l].y + c / 3 }
: { x: a[l].x, y: a[l].y + c / 9 };
l = e;
g = 0 === l ? 0 : l - 1;
m = l === a.length - 1 ? l : l + 1;
c =
(Math.abs(
(a[m].x - a[g].x) /
(0 === a[l].x - a[g].x ? 0.01 : a[l].x - a[g].x)
) *
(d - 1)) /
2 +
1;
w = (a[m].x - a[g].x) / c;
c = (a[m].y - a[g].y) / c;
b[b.length] =
(a[l].x > a[g].x && 0 < w) || (a[l].x < a[g].x && 0 > w)
? { x: a[l].x - w / 3, y: a[l].y - c / 3 }
: { x: a[l].x, y: a[l].y - c / 9 };
b[b.length] = a[e];
}
return b;
}
function E(a, d, b, c, e, g, m, l, w, h) {
var s = 0;
h ? ((m.color = g), (l.color = g)) : (h = 1);
s = w ? Math.abs(e - b) : Math.abs(c - d);
s =
0 < m.trimLength
? Math.abs((s * m.trimLength) / 100)
: Math.abs(s - m.length);
w ? ((b += s / 2), (e -= s / 2)) : ((d += s / 2), (c -= s / 2));
var s = 1 === Math.round(m.thickness) % 2 ? 0.5 : 0,
q = 1 === Math.round(l.thickness) % 2 ? 0.5 : 0;
a.save();
a.globalAlpha = h;
a.strokeStyle = l.color || g;
a.lineWidth = l.thickness || 2;
a.setLineDash && a.setLineDash(R(l.dashType, l.thickness));
a.beginPath();
w && 0 < l.thickness
? (a.moveTo(c - m.thickness / 2, Math.round((b + e) / 2) - q),
a.lineTo(d + m.thickness / 2, Math.round((b + e) / 2) - q))
: 0 < l.thickness &&
(a.moveTo(Math.round((d + c) / 2) - q, b + m.thickness / 2),
a.lineTo(Math.round((d + c) / 2) - q, e - m.thickness / 2));
a.stroke();
a.strokeStyle = m.color || g;
a.lineWidth = m.thickness || 2;
a.setLineDash && a.setLineDash(R(m.dashType, m.thickness));
a.beginPath();
w && 0 < m.thickness
? (a.moveTo(c - s, b),
a.lineTo(c - s, e),
a.moveTo(d + s, b),
a.lineTo(d + s, e))
: 0 < m.thickness &&
(a.moveTo(d, b + s),
a.lineTo(c, b + s),
a.moveTo(d, e - s),
a.lineTo(c, e - s));
a.stroke();
a.restore();
}
function I(a, d, b, c, e) {
if (null === a || "undefined" === typeof a)
return "undefined" === typeof b ? d : b;
a =
parseFloat(a.toString()) *
(0 <= a.toString().indexOf("%") ? d / 100 : 1);
"undefined" !== typeof c &&
((a = Math.min(c, a)),
"undefined" !== typeof e && (a = Math.max(e, a)));
return !isNaN(a) && a <= d && 0 <= a
? a
: "undefined" === typeof b
? d
: b;
}
function H(a, d) {
H.base.constructor.call(this, "Legend", "legend", d, null, a);
this.chart = a;
this.canvas = a.canvas;
this.ctx = this.chart.ctx;
this.ghostCtx = this.chart._eventManager.ghostCtx;
this.items = [];
this.optionsName = "legend";
this.height = this.width = 0;
this.orientation = null;
this.dataSeries = [];
this.bounds = { x1: null, y1: null, x2: null, y2: null };
"undefined" === typeof this.options.fontSize &&
(this.fontSize = this.chart.getAutoFontSize(this.fontSize));
this.lineHeight = Za(this.fontFamily, this.fontSize, this.fontWeight);
this.horizontalSpacing = this.fontSize;
}
function F(a, d, b, c) {
F.base.constructor.call(this, "DataSeries", "data", d, b, a);
this.chart = a;
this.canvas = a.canvas;
this._ctx = a.canvas.ctx;
this.index = b;
this.noDataPointsInPlotArea = 0;
this.id = c;
this.chart._eventManager.objectMap[c] = {
id: c,
objectType: "dataSeries",
dataSeriesIndex: b,
};
a = d.dataPoints ? d.dataPoints.length : 0;
this.dataPointEOs = [];
for (d = 0; d < a; d++) this.dataPointEOs[d] = {};
this.dataPointIds = [];
this.plotUnit = [];
this.axisY = this.axisX = null;
this.optionsName = "data";
this.isOptionsInArray = !0;
null === this.fillOpacity &&
(this.type.match(/area/i)
? (this.fillOpacity = 0.7)
: (this.fillOpacity = 1));
this.axisPlacement = this.getDefaultAxisPlacement();
"undefined" === typeof this.options.indexLabelFontSize &&
(this.indexLabelFontSize = this.chart.getAutoFontSize(
this.indexLabelFontSize
));
}
function z(a, d, b, c, e, g) {
z.base.constructor.call(this, "Axis", d, b, c, a);
this.chart = a;
this.canvas = a.canvas;
this.ctx = a.ctx;
this.intervalStartPosition = this.maxHeight = this.maxWidth = 0;
this.labels = [];
this.dataSeries = [];
this._stripLineLabels = this._ticks = this._labels = null;
this.dataInfo = {
min: Infinity,
max: -Infinity,
viewPortMin: Infinity,
viewPortMax: -Infinity,
minDiff: Infinity,
};
this.isOptionsInArray = !0;
"axisX" === e
? ("left" === g || "bottom" === g
? ((this.optionsName = "axisX"),
u(this.chart.sessionVariables.axisX[c]) &&
(this.chart.sessionVariables.axisX[c] = {}),
(this.sessionVariables = this.chart.sessionVariables.axisX[c]))
: ((this.optionsName = "axisX2"),
u(this.chart.sessionVariables.axisX2[c]) &&
(this.chart.sessionVariables.axisX2[c] = {}),
(this.sessionVariables = this.chart.sessionVariables.axisX2[c])),
this.options.interval || (this.intervalType = null))
: "left" === g || "bottom" === g
? ((this.optionsName = "axisY"),
u(this.chart.sessionVariables.axisY[c]) &&
(this.chart.sessionVariables.axisY[c] = {}),
(this.sessionVariables = this.chart.sessionVariables.axisY[c]))
: ((this.optionsName = "axisY2"),
u(this.chart.sessionVariables.axisY2[c]) &&
(this.chart.sessionVariables.axisY2[c] = {}),
(this.sessionVariables = this.chart.sessionVariables.axisY2[c]));
"undefined" === typeof this.options.titleFontSize &&
(this.titleFontSize = this.chart.getAutoFontSize(this.titleFontSize));
"undefined" === typeof this.options.labelFontSize &&
(this.labelFontSize = this.chart.getAutoFontSize(this.labelFontSize));
this.type = e;
"axisX" !== e ||
(b && "undefined" !== typeof b.gridThickness) ||
(this.gridThickness = 0);
this._position = g;
this.lineCoordinates = {
x1: null,
y1: null,
x2: null,
y2: null,
width: null,
};
this.labelAngle = ((this.labelAngle % 360) + 360) % 360;
90 < this.labelAngle && 270 > this.labelAngle
? (this.labelAngle -= 180)
: 270 <= this.labelAngle &&
360 >= this.labelAngle &&
(this.labelAngle -= 360);
this.options.scaleBreaks &&
(this.scaleBreaks = new Q(
this.chart,
this.options.scaleBreaks,
++this.chart._eventManager.lastObjectId,
this
));
this.stripLines = [];
if (this.options.stripLines && 0 < this.options.stripLines.length)
for (a = 0; a < this.options.stripLines.length; a++)
this.stripLines.push(
new X(
this.chart,
this.options.stripLines[a],
a,
++this.chart._eventManager.lastObjectId,
this
)
);
this.options.crosshair &&
(this.crosshair = new fa(this.chart, this.options.crosshair, this));
this._titleTextBlock = null;
this.hasOptionChanged("viewportMinimum") &&
null === this.viewportMinimum &&
((this.options.viewportMinimum = void 0),
(this.sessionVariables.viewportMinimum = null));
this.hasOptionChanged("viewportMinimum") ||
isNaN(this.sessionVariables.newViewportMinimum) ||
null === this.sessionVariables.newViewportMinimum
? (this.sessionVariables.newViewportMinimum = null)
: (this.viewportMinimum = this.sessionVariables.newViewportMinimum);
this.hasOptionChanged("viewportMaximum") &&
null === this.viewportMaximum &&
((this.options.viewportMaximum = void 0),
(this.sessionVariables.viewportMaximum = null));
this.hasOptionChanged("viewportMaximum") ||
isNaN(this.sessionVariables.newViewportMaximum) ||
null === this.sessionVariables.newViewportMaximum
? (this.sessionVariables.newViewportMaximum = null)
: (this.viewportMaximum = this.sessionVariables.newViewportMaximum);
null !== this.minimum &&
null !== this.viewportMinimum &&
(this.viewportMinimum = Math.max(this.viewportMinimum, this.minimum));
null !== this.maximum &&
null !== this.viewportMaximum &&
(this.viewportMaximum = Math.min(this.viewportMaximum, this.maximum));
this.trackChanges("viewportMinimum");
this.trackChanges("viewportMaximum");
}
function Q(a, d, b, c) {
Q.base.constructor.call(this, "ScaleBreaks", "scaleBreaks", d, null, c);
this.id = b;
this.chart = a;
this.ctx = this.chart.ctx;
this.axis = c;
this.optionsName = "scaleBreaks";
this.isOptionsInArray = !1;
this._appliedBreaks = [];
this.customBreaks = [];
this.autoBreaks = [];
"string" === typeof this.spacing
? ((this.spacing = parseFloat(this.spacing)),
(this.spacing = isNaN(this.spacing)
? 8
: (10 < this.spacing ? 10 : this.spacing) + "%"))
: "number" !== typeof this.spacing && (this.spacing = 8);
this.autoCalculate &&
(this.maxNumberOfAutoBreaks = Math.min(this.maxNumberOfAutoBreaks, 5));
if (this.options.customBreaks && 0 < this.options.customBreaks.length) {
for (a = 0; a < this.options.customBreaks.length; a++)
this.customBreaks.push(
new L(
this.chart,
"customBreaks",
this.options.customBreaks[a],
a,
++this.chart._eventManager.lastObjectId,
this
)
),
"number" === typeof this.customBreaks[a].startValue &&
"number" === typeof this.customBreaks[a].endValue &&
this.customBreaks[a].endValue !==
this.customBreaks[a].startValue &&
this._appliedBreaks.push(this.customBreaks[a]);
this._appliedBreaks.sort(function (a, c) {
return a.startValue - c.startValue;
});
for (a = 0; a < this._appliedBreaks.length - 1; a++)
this._appliedBreaks[a].endValue >=
this._appliedBreaks[a + 1].startValue &&
((this._appliedBreaks[a].endValue = Math.max(
this._appliedBreaks[a].endValue,
this._appliedBreaks[a + 1].endValue
)),
window.console &&
window.console.log(
"CanvasJS Error: Breaks " +
a +
" and " +
(a + 1) +
" are overlapping."
),
this._appliedBreaks.splice(a, 2),
a--);
}
}
function L(a, d, b, c, e, g) {
L.base.constructor.call(this, "Break", d, b, c, g);
this.id = e;
this.chart = a;
this.ctx = this.chart.ctx;
this.scaleBreaks = g;
this.optionsName = d;
this.isOptionsInArray = !0;
this.type = b.type ? this.type : g.type;
this.fillOpacity = u(b.fillOpacity) ? g.fillOpacity : this.fillOpacity;
this.lineThickness = u(b.lineThickness)
? g.lineThickness
: this.lineThickness;
this.color = b.color ? this.color : g.color;
this.lineColor = b.lineColor ? this.lineColor : g.lineColor;
this.lineDashType = b.lineDashType ? this.lineDashType : g.lineDashType;
!u(this.startValue) &&
this.startValue.getTime &&
(this.startValue = this.startValue.getTime());
!u(this.endValue) &&
this.endValue.getTime &&
(this.endValue = this.endValue.getTime());
"number" === typeof this.startValue &&
"number" === typeof this.endValue &&
this.endValue < this.startValue &&
((a = this.startValue),
(this.startValue = this.endValue),
(this.endValue = a));
this.spacing = "undefined" === typeof b.spacing ? g.spacing : b.spacing;
"string" === typeof this.options.spacing
? ((this.spacing = parseFloat(this.spacing)),
(this.spacing = isNaN(this.spacing)
? 0
: (10 < this.spacing ? 10 : this.spacing) + "%"))
: "number" !== typeof this.options.spacing &&
(this.spacing = g.spacing);
this.size = g.parent.logarithmic ? 1 : 0;
}
function X(a, d, b, c, e) {
X.base.constructor.call(this, "StripLine", "stripLines", d, b, e);
this.id = c;
this.chart = a;
this.ctx = this.chart.ctx;
this.label = this.label;
this.axis = e;
this.optionsName = "stripLines";
this.isOptionsInArray = !0;
this._thicknessType = "pixel";
null !== this.startValue &&
null !== this.endValue &&
((this.value = e.logarithmic
? Math.sqrt(
(this.startValue.getTime
? this.startValue.getTime()
: this.startValue) *
(this.endValue.getTime
? this.endValue.getTime()
: this.endValue)
)
: ((this.startValue.getTime
? this.startValue.getTime()
: this.startValue) +
(this.endValue.getTime
? this.endValue.getTime()
: this.endValue)) /
2),
(this._thicknessType = null));
}
function fa(a, d, b) {
fa.base.constructor.call(this, "Crosshair", "crosshair", d, null, b);
this.chart = a;
this.ctx = this.chart.ctx;
this.axis = b;
this.optionsName = "crosshair";
this._thicknessType = "pixel";
}
function $(a, d) {
$.base.constructor.call(this, "ToolTip", "toolTip", d, null, a);
this.chart = a;
this.canvas = a.canvas;
this.ctx = this.chart.ctx;
this.currentDataPointIndex = this.currentSeriesIndex = -1;
this._prevY = this._prevX = NaN;
this.containerTransitionDuration = 0.1;
this.mozContainerTransition = this.getContainerTransition(
this.containerTransitionDuration
);
this.optionsName = "toolTip";
this._initialize();
}
function ha(a) {
this.chart = a;
this.lastObjectId = 0;
this.objectMap = [];
this.rectangularRegionEventSubscriptions = [];
this.previousDataPointEventObject = null;
this.ghostCanvas = ta(this.chart.width, this.chart.height);
this.ghostCtx = this.ghostCanvas.getContext("2d");
this.mouseoveredObjectMaps = [];
}
function ga(a) {
this.chart = a;
this.ctx = this.chart.plotArea.ctx;
this.animations = [];
this.animationRequestId = null;
}
qa(p, V);
p.prototype.destroy = function () {
var a = this.allDOMEventHandlers;
this._animator && this._animator.cancelAllAnimations();
this._panTimerId && clearTimeout(this._panTimerId);
for (var d = 0; d < a.length; d++) {
var b = a[d][0],
c = a[d][1],
e = a[d][2],
g = a[d][3],
g = g || !1;
b.removeEventListener
? b.removeEventListener(c, e, g)
: b.detachEvent && b.detachEvent("on" + c, e);
}
this.allDOMEventHandlers = [];
for (
this.removeAllEventListeners();
this._canvasJSContainer && this._canvasJSContainer.hasChildNodes();
)
this._canvasJSContainer.removeChild(this._canvasJSContainer.lastChild);
for (; this.container && this.container.hasChildNodes(); )
this.container.removeChild(this.container.lastChild);
for (; this._dropdownMenu && this._dropdownMenu.hasChildNodes(); )
this._dropdownMenu.removeChild(this._dropdownMenu.lastChild);
this.overlaidCanvas =
this.canvas =
this.container =
this._canvasJSContainer =
null;
this._toolBar =
this._dropdownMenu =
this._menuButton =
this._resetButton =
this._zoomButton =
this._breaksCanvas =
this._preRenderCanvas =
this.toolTip.container =
null;
};
p.prototype._updateOptions = function () {
var a = this;
this.updateOption("width");
this.updateOption("height");
this.updateOption("dataPointWidth");
this.updateOption("dataPointMinWidth");
this.updateOption("dataPointMaxWidth");
this.updateOption("interactivityEnabled");
this.updateOption("theme");
this.updateOption("colorSet") &&
(this._selectedColorSet =
"undefined" !== typeof Ba[this.colorSet]
? Ba[this.colorSet]
: Ba.colorSet1);
this.updateOption("backgroundColor");
this.backgroundColor || (this.backgroundColor = "rgba(0,0,0,0)");
this.updateOption("culture");
this._cultureInfo = new La(this.options.culture);
this.updateOption("animationEnabled");
this.animationEnabled = this.animationEnabled && r;
this.updateOption("animationDuration");
this.updateOption("rangeChanging");
this.updateOption("rangeChanged");
this.updateOption("exportEnabled");
this.updateOption("exportFileName");
this.updateOption("zoomType");
if (this.options.zoomEnabled) {
if (!this._zoomButton) {
var d = !1;
va((this._zoomButton = document.createElement("button")));
ua(this, this._zoomButton, "pan");
this._toolBar.appendChild(this._zoomButton);
this._zoomButton.style.borderRight =
this.toolbar.borderThickness +
"px solid " +
this.toolbar.borderColor;
O(
this._zoomButton,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
);
O(
this._zoomButton,
"click",
function () {
a.zoomEnabled
? ((a.zoomEnabled = !1),
(a.panEnabled = !0),
ua(a, a._zoomButton, "zoom"))
: ((a.zoomEnabled = !0),
(a.panEnabled = !1),
ua(a, a._zoomButton, "pan"));
a.render();
},
this.allDOMEventHandlers
);
O(
this._zoomButton,
"mouseover",
function () {
d
? (d = !1)
: (sa(a, a._zoomButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.fontColorOnHover,
transition: "0.4s",
WebkitTransition: "0.4s",
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._zoomButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)",
}));
},
this.allDOMEventHandlers
);
O(
this._zoomButton,
"mouseout",
function () {
d ||
(sa(a, a._zoomButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor,
transition: "0.4s",
WebkitTransition: "0.4s",
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._zoomButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)",
}));
},
this.allDOMEventHandlers
);
}
this._resetButton ||
((d = !1),
va((this._resetButton = document.createElement("button"))),
ua(this, this._resetButton, "reset"),
(this._resetButton.style.borderRight =
(this.exportEnabled ? this.toolbar.borderThickness : 0) +
"px solid " +
this.toolbar.borderColor),
this._toolBar.appendChild(this._resetButton),
O(
this._resetButton,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
),
O(
this._resetButton,
"click",
function () {
a.toolTip.hide();
a.zoomEnabled || a.panEnabled
? ((a.zoomEnabled = !0),
(a.panEnabled = !1),
ua(a, a._zoomButton, "pan"),
(a._defaultCursor = "default"),
(a.overlaidCanvas.style.cursor = a._defaultCursor))
: ((a.zoomEnabled = !1), (a.panEnabled = !1));
if (a.sessionVariables.axisX)
for (var c = 0; c < a.sessionVariables.axisX.length; c++)
(a.sessionVariables.axisX[c].newViewportMinimum = null),
(a.sessionVariables.axisX[c].newViewportMaximum = null);
if (a.sessionVariables.axisX2)
for (c = 0; c < a.sessionVariables.axisX2.length; c++)
(a.sessionVariables.axisX2[c].newViewportMinimum = null),
(a.sessionVariables.axisX2[c].newViewportMaximum = null);
if (a.sessionVariables.axisY)
for (c = 0; c < a.sessionVariables.axisY.length; c++)
(a.sessionVariables.axisY[c].newViewportMinimum = null),
(a.sessionVariables.axisY[c].newViewportMaximum = null);
if (a.sessionVariables.axisY2)
for (c = 0; c < a.sessionVariables.axisY2.length; c++)
(a.sessionVariables.axisY2[c].newViewportMinimum = null),
(a.sessionVariables.axisY2[c].newViewportMaximum = null);
a.resetOverlayedCanvas();
va(a._zoomButton, a._resetButton);
a._dispatchRangeEvent("rangeChanging", "reset");
a.render();
a._dispatchRangeEvent("rangeChanged", "reset");
a.syncCharts && a.syncCharts(null, null);
},
this.allDOMEventHandlers
),
O(
this._resetButton,
"mouseover",
function () {
d ||
(sa(a, a._resetButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.hoverFfontColorOnHoverontColor,
transition: "0.4s",
WebkitTransition: "0.4s",
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._resetButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)",
}));
},
this.allDOMEventHandlers
),
O(
this._resetButton,
"mouseout",
function () {
d ||
(sa(a, a._resetButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor,
transition: "0.4s",
WebkitTransition: "0.4s",
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._resetButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)",
}));
},
this.allDOMEventHandlers
),
(this.overlaidCanvas.style.cursor = a._defaultCursor));
this.zoomEnabled ||
this.panEnabled ||
(this._zoomButton
? (a._zoomButton.getAttribute("state") === a._cultureInfo.zoomText
? ((this.panEnabled = !0), (this.zoomEnabled = !1))
: ((this.zoomEnabled = !0), (this.panEnabled = !1)),
Qa(a._zoomButton, a._resetButton))
: ((this.zoomEnabled = !0), (this.panEnabled = !1)));
} else this.panEnabled = this.zoomEnabled = !1;
this._menuButton
? this.exportEnabled
? Qa(this._menuButton)
: va(this._menuButton)
: this.exportEnabled &&
r &&
((d = !1),
(this._menuButton = document.createElement("button")),
ua(this, this._menuButton, "menu"),
this._toolBar.appendChild(this._menuButton),
O(
this._menuButton,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
),
O(
this._menuButton,
"click",
function () {
"none" !== a._dropdownMenu.style.display ||
(a._dropDownCloseTime &&
500 >=
new Date().getTime() - a._dropDownCloseTime.getTime()) ||
((a._dropdownMenu.style.display = "block"),
a._menuButton.blur(),
a._dropdownMenu.focus());
},
this.allDOMEventHandlers,
!0
),
O(
this._menuButton,
"mouseover",
function () {
d ||
(sa(a, a._menuButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.fontColorOnHover,
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._menuButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)",
}));
},
this.allDOMEventHandlers,
!0
),
O(
this._menuButton,
"mouseout",
function () {
d ||
(sa(a, a._menuButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor,
}),
0 >= navigator.userAgent.search("MSIE") &&
sa(a, a._menuButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)",
}));
},
this.allDOMEventHandlers,
!0
));
if (!this._dropdownMenu && this.exportEnabled && r) {
d = !1;
this._dropdownMenu = document.createElement("div");
this._dropdownMenu.setAttribute("tabindex", -1);
var b = -1 !== this.theme.indexOf("dark") ? "black" : "#888888";
this._dropdownMenu.style.cssText =
"position: absolute; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer;right: 0px;top: 25px;min-width: 120px;outline: 0;font-size: 14px; font-family: Arial, Helvetica, sans-serif;padding: 5px 0px 5px 0px;text-align: left;line-height: 10px;background-color:" +
this.toolbar.backgroundColor +
";box-shadow: 2px 2px 10px " +
b;
a._dropdownMenu.style.display = "none";
this._toolBar.appendChild(this._dropdownMenu);
O(
this._dropdownMenu,
"blur",
function () {
va(a._dropdownMenu);
a._dropDownCloseTime = new Date();
},
this.allDOMEventHandlers,
!0
);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
b.innerHTML = this._cultureInfo.printText;
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
O(
b,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
);
O(
b,
"mouseover",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColorOnHover),
(this.style.color = a.toolbar.fontColorOnHover));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"mouseout",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColor),
(this.style.color = a.toolbar.fontColor));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"click",
function () {
a.print();
va(a._dropdownMenu);
},
this.allDOMEventHandlers,
!0
);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
b.innerHTML = this._cultureInfo.saveJPGText;
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
O(
b,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
);
O(
b,
"mouseover",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColorOnHover),
(this.style.color = a.toolbar.fontColorOnHover));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"mouseout",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColor),
(this.style.color = a.toolbar.fontColor));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"click",
function () {
Ta(a.canvas, "jpeg", a.exportFileName);
va(a._dropdownMenu);
},
this.allDOMEventHandlers,
!0
);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
b.innerHTML = this._cultureInfo.savePNGText;
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
O(
b,
"touchstart",
function (a) {
d = !0;
},
this.allDOMEventHandlers
);
O(
b,
"mouseover",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColorOnHover),
(this.style.color = a.toolbar.fontColorOnHover));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"mouseout",
function () {
d ||
((this.style.backgroundColor = a.toolbar.backgroundColor),
(this.style.color = a.toolbar.fontColor));
},
this.allDOMEventHandlers,
!0
);
O(
b,
"click",
function () {
Ta(a.canvas, "png", a.exportFileName);
va(a._dropdownMenu);
},
this.allDOMEventHandlers,
!0
);
}
"none" !== this._toolBar.style.display &&
this._zoomButton &&
(this.panEnabled
? ua(a, a._zoomButton, "zoom")
: ua(a, a._zoomButton, "pan"),
a._resetButton.getAttribute("state") !== a._cultureInfo.resetText &&
ua(a, a._resetButton, "reset"));
this.options.toolTip &&
this.toolTip.options !== this.options.toolTip &&
(this.toolTip.options = this.options.toolTip);
for (var c in this.toolTip.options)
this.toolTip.options.hasOwnProperty(c) && this.toolTip.updateOption(c);
};
p.prototype._updateSize = function () {
var a;
a = [
this.canvas,
this._preRenderCanvas,
this.overlaidCanvas,
this._eventManager.ghostCanvas,
];
var d = 0,
b = 0;
this.options.width
? (d = this.width)
: (this.width = d =
0 < this.container.clientWidth
? this.container.clientWidth
: this.width);
this.options.height
? (b = this.height)
: (this.height = b =
0 < this.container.clientHeight
? this.container.clientHeight
: this.height);
if (this.canvas.width !== d * W || this.canvas.height !== b * W) {
for (var c = 0; c < a.length; c++) Oa(a[c], d, b);
a = !0;
} else a = !1;
return a;
};
p.prototype._initialize = function () {
this.isNavigator =
u(this.parent) ||
u(this.parent._defaultsKey) ||
"Navigator" !== this.parent._defaultsKey
? !1
: !0;
this.toolbar = new Va(this, this.options.toolbar);
this._animator
? this._animator.cancelAllAnimations()
: (this._animator = new ga(this));
this.removeAllEventListeners();
this.disableToolTip = !1;
this._axes = [];
this.funnelPyramidClickHandler = this.pieDoughnutClickHandler = null;
this._updateOptions();
this.animatedRender =
r && this.animationEnabled && 0 === this.renderCount;
this._updateSize();
this.clearCanvas();
this.ctx.beginPath();
this.axisX = [];
this.axisX2 = [];
this.axisY = [];
this.axisY2 = [];
this._indexLabels = [];
this._dataInRenderedOrder = [];
this._events = [];
this._eventManager && this._eventManager.reset();
this.plotInfo = { axisPlacement: null, plotTypes: [] };
this.layoutManager = new Ga(
0,
0,
this.width,
this.height,
this.isNavigator ? 0 : 2
);
this.plotArea.layoutManager && this.plotArea.layoutManager.reset();
this.data = [];
var a = 0,
d = null;
if (this.options.data) {
for (var b = 0; b < this.options.data.length; b++)
if (
(a++,
!this.options.data[b].type ||
0 <= p._supportedChartTypes.indexOf(this.options.data[b].type))
) {
var c = new F(
this,
this.options.data[b],
a - 1,
++this._eventManager.lastObjectId
);
"error" === c.type &&
((c.linkedDataSeriesIndex = u(
this.options.data[b].linkedDataSeriesIndex
)
? b - 1
: this.options.data[b].linkedDataSeriesIndex),
0 > c.linkedDataSeriesIndex ||
c.linkedDataSeriesIndex >= this.options.data.length ||
"number" !== typeof c.linkedDataSeriesIndex ||
"error" === this.options.data[c.linkedDataSeriesIndex].type) &&
(c.linkedDataSeriesIndex = null);
null === c.name && (c.name = "DataSeries " + a);
null === c.color
? 1 < this.options.data.length
? ((c._colorSet = [
this._selectedColorSet[
c.index % this._selectedColorSet.length
],
]),
(c.color =
this._selectedColorSet[
c.index % this._selectedColorSet.length
]))
: (c._colorSet =
"line" === c.type ||
"stepLine" === c.type ||
"spline" === c.type ||
"area" === c.type ||
"stepArea" === c.type ||
"splineArea" === c.type ||
"stackedArea" === c.type ||
"stackedArea100" === c.type ||
"rangeArea" === c.type ||
"rangeSplineArea" === c.type ||
"candlestick" === c.type ||
"ohlc" === c.type ||
"waterfall" === c.type ||
"boxAndWhisker" === c.type
? [this._selectedColorSet[0]]
: this._selectedColorSet)
: (c._colorSet = [c.color]);
null === c.markerSize &&
((("line" === c.type ||
"stepLine" === c.type ||
"spline" === c.type ||
0 <= c.type.toLowerCase().indexOf("area")) &&
c.dataPoints &&
c.dataPoints.length < this.width / 16) ||
"scatter" === c.type) &&
(c.markerSize = 8);
("bubble" !== c.type && "scatter" !== c.type) ||
!c.dataPoints ||
(c.dataPoints.some
? c.dataPoints.some(function (a) {
return a.x;
}) && c.dataPoints.sort(k)
: c.dataPoints.sort(k));
this.data.push(c);
var e = c.axisPlacement,
d = d || e,
g;
"normal" === e
? "xySwapped" === this.plotInfo.axisPlacement
? (g = 'You cannot combine "' + c.type + '" with bar chart')
: "none" === this.plotInfo.axisPlacement
? (g = 'You cannot combine "' + c.type + '" with pie chart')
: null === this.plotInfo.axisPlacement &&
(this.plotInfo.axisPlacement = "normal")
: "xySwapped" === e
? "normal" === this.plotInfo.axisPlacement
? (g =
'You cannot combine "' +
c.type +
'" with line, area, column or pie chart')
: "none" === this.plotInfo.axisPlacement
? (g = 'You cannot combine "' + c.type + '" with pie chart')
: null === this.plotInfo.axisPlacement &&
(this.plotInfo.axisPlacement = "xySwapped")
: "none" === e
? "normal" === this.plotInfo.axisPlacement
? (g =
'You cannot combine "' +
c.type +
'" with line, area, column or bar chart')
: "xySwapped" === this.plotInfo.axisPlacement
? (g = 'You cannot combine "' + c.type + '" with bar chart')
: null === this.plotInfo.axisPlacement &&
(this.plotInfo.axisPlacement = "none")
: null === e &&
"none" === this.plotInfo.axisPlacement &&
(g = 'You cannot combine "' + c.type + '" with pie chart');
if (g && window.console) {
window.console.log(g);
return;
}
}
for (b = 0; b < this.data.length; b++) {
if ("none" == d && "error" === this.data[b].type && window.console) {
window.console.log(
'You cannot combine "' + c.type + '" with error chart'
);
return;
}
"error" === this.data[b].type &&
((this.data[b].axisPlacement = this.plotInfo.axisPlacement =
d || "normal"),
(this.data[b]._linkedSeries =
null === this.data[b].linkedDataSeriesIndex
? null
: this.data[this.data[b].linkedDataSeriesIndex]));
}
}
this._objectsInitialized = !0;
this._plotAreaElements = [];
};
p._supportedChartTypes = Fa(
"line stepLine spline column area stepArea splineArea bar bubble scatter stackedColumn stackedColumn100 stackedBar stackedBar100 stackedArea stackedArea100 candlestick ohlc boxAndWhisker rangeColumn error rangeBar rangeArea rangeSplineArea pie doughnut funnel pyramid waterfall".split(
" "
)
);
p.prototype.setLayout = function () {
for (var a = this._plotAreaElements, d = 0; d < this.data.length; d++)
if (
"normal" === this.plotInfo.axisPlacement ||
"xySwapped" === this.plotInfo.axisPlacement
) {
if (!this.data[d].axisYType || "primary" === this.data[d].axisYType)
if (this.options.axisY && 0 < this.options.axisY.length) {
if (!this.axisY.length)
for (var b = 0; b < this.options.axisY.length; b++)
"normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisY[b] = new z(
this,
"axisY",
this.options.axisY[b],
b,
"axisY",
"left"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisY[b] = new z(
this,
"axisY",
this.options.axisY[b],
b,
"axisY",
"bottom"
))
);
this.data[d].axisY =
this.axisY[
0 <= this.data[d].axisYIndex &&
this.data[d].axisYIndex < this.axisY.length
? this.data[d].axisYIndex
: 0
];
this.axisY[
0 <= this.data[d].axisYIndex &&
this.data[d].axisYIndex < this.axisY.length
? this.data[d].axisYIndex
: 0
].dataSeries.push(this.data[d]);
} else
this.axisY.length ||
("normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisY[0] = new z(
this,
"axisY",
this.options.axisY,
0,
"axisY",
"left"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisY[0] = new z(
this,
"axisY",
this.options.axisY,
0,
"axisY",
"bottom"
))
)),
(this.data[d].axisY = this.axisY[0]),
this.axisY[0].dataSeries.push(this.data[d]);
if ("secondary" === this.data[d].axisYType)
if (this.options.axisY2 && 0 < this.options.axisY2.length) {
if (!this.axisY2.length)
for (b = 0; b < this.options.axisY2.length; b++)
"normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisY2[b] = new z(
this,
"axisY2",
this.options.axisY2[b],
b,
"axisY",
"right"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisY2[b] = new z(
this,
"axisY2",
this.options.axisY2[b],
b,
"axisY",
"top"
))
);
this.data[d].axisY =
this.axisY2[
0 <= this.data[d].axisYIndex &&
this.data[d].axisYIndex < this.axisY2.length
? this.data[d].axisYIndex
: 0
];
this.axisY2[
0 <= this.data[d].axisYIndex &&
this.data[d].axisYIndex < this.axisY2.length
? this.data[d].axisYIndex
: 0
].dataSeries.push(this.data[d]);
} else
this.axisY2.length ||
("normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisY2[0] = new z(
this,
"axisY2",
this.options.axisY2,
0,
"axisY",
"right"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisY2[0] = new z(
this,
"axisY2",
this.options.axisY2,
0,
"axisY",
"top"
))
)),
(this.data[d].axisY = this.axisY2[0]),
this.axisY2[0].dataSeries.push(this.data[d]);
if (!this.data[d].axisXType || "primary" === this.data[d].axisXType)
if (this.options.axisX && 0 < this.options.axisX.length) {
if (!this.axisX.length)
for (b = 0; b < this.options.axisX.length; b++)
"normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisX[b] = new z(
this,
"axisX",
this.options.axisX[b],
b,
"axisX",
"bottom"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisX[b] = new z(
this,
"axisX",
this.options.axisX[b],
b,
"axisX",
"left"
))
);
this.data[d].axisX =
this.axisX[
0 <= this.data[d].axisXIndex &&
this.data[d].axisXIndex < this.axisX.length
? this.data[d].axisXIndex
: 0
];
this.axisX[
0 <= this.data[d].axisXIndex &&
this.data[d].axisXIndex < this.axisX.length
? this.data[d].axisXIndex
: 0
].dataSeries.push(this.data[d]);
} else
this.axisX.length ||
("normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisX[0] = new z(
this,
"axisX",
this.options.axisX,
0,
"axisX",
"bottom"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisX[0] = new z(
this,
"axisX",
this.options.axisX,
0,
"axisX",
"left"
))
)),
(this.data[d].axisX = this.axisX[0]),
this.axisX[0].dataSeries.push(this.data[d]);
if ("secondary" === this.data[d].axisXType)
if (this.options.axisX2 && 0 < this.options.axisX2.length) {
if (!this.axisX2.length)
for (b = 0; b < this.options.axisX2.length; b++)
"normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisX2[b] = new z(
this,
"axisX2",
this.options.axisX2[b],
b,
"axisX",
"top"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisX2[b] = new z(
this,
"axisX2",
this.options.axisX2[b],
b,
"axisX",
"right"
))
);
this.data[d].axisX =
this.axisX2[
0 <= this.data[d].axisXIndex &&
this.data[d].axisXIndex < this.axisX2.length
? this.data[d].axisXIndex
: 0
];
this.axisX2[
0 <= this.data[d].axisXIndex &&
this.data[d].axisXIndex < this.axisX2.length
? this.data[d].axisXIndex
: 0
].dataSeries.push(this.data[d]);
} else
this.axisX2.length ||
("normal" === this.plotInfo.axisPlacement
? this._axes.push(
(this.axisX2[0] = new z(
this,
"axisX2",
this.options.axisX2,
0,
"axisX",
"top"
))
)
: "xySwapped" === this.plotInfo.axisPlacement &&
this._axes.push(
(this.axisX2[0] = new z(
this,
"axisX2",
this.options.axisX2,
0,
"axisX",
"right"
))
)),
(this.data[d].axisX = this.axisX2[0]),
this.axisX2[0].dataSeries.push(this.data[d]);
}
if (this.axisY) {
for (b = 1; b < this.axisY.length; b++)
"undefined" === typeof this.axisY[b].options.gridThickness &&
(this.axisY[b].gridThickness = 0);
for (b = 0; b < this.axisY.length - 1; b++)
"undefined" === typeof this.axisY[b].options.margin &&
(this.axisY[b].margin = 10);
}
if (this.axisY2) {
for (b = 1; b < this.axisY2.length; b++)
"undefined" === typeof this.axisY2[b].options.gridThickness &&
(this.axisY2[b].gridThickness = 0);
for (b = 0; b < this.axisY2.length - 1; b++)
"undefined" === typeof this.axisY2[b].options.margin &&
(this.axisY2[b].margin = 10);
}
this.axisY &&
0 < this.axisY.length &&
this.axisY2 &&
0 < this.axisY2.length &&
(0 < this.axisY[0].gridThickness &&
"undefined" === typeof this.axisY2[0].options.gridThickness
? (this.axisY2[0].gridThickness = 0)
: 0 < this.axisY2[0].gridThickness &&
"undefined" === typeof this.axisY[0].options.gridThickness &&
(this.axisY[0].gridThickness = 0));
if (this.axisX)
for (b = 0; b < this.axisX.length; b++)
"undefined" === typeof this.axisX[b].options.gridThickness &&
(this.axisX[b].gridThickness = 0);
if (this.axisX2)
for (b = 0; b < this.axisX2.length; b++)
"undefined" === typeof this.axisX2[b].options.gridThickness &&
(this.axisX2[b].gridThickness = 0);
this.axisX &&
0 < this.axisX.length &&
this.axisX2 &&
0 < this.axisX2.length &&
(0 < this.axisX[0].gridThickness &&
"undefined" === typeof this.axisX2[0].options.gridThickness
? (this.axisX2[0].gridThickness = 0)
: 0 < this.axisX2[0].gridThickness &&
"undefined" === typeof this.axisX[0].options.gridThickness &&
(this.axisX[0].gridThickness = 0));
b = !1;
if (0 < this._axes.length && (this.zoomEnabled || this.panEnabled))
for (d = 0; d < this._axes.length; d++)
if (
null !== this._axes[d].viewportMinimum ||
null !== this._axes[d].viewportMaximum
) {
b = !0;
break;
}
b
? (Qa(this._zoomButton, this._resetButton),
(this._toolBar.style.border =
this.toolbar.borderThickness +
"px solid " +
this.toolbar.borderColor),
(this._zoomButton.style.borderRight =
this.toolbar.borderThickness +
"px solid " +
this.toolbar.borderColor),
(this._resetButton.style.borderRight =
(this.exportEnabled ? this.toolbar.borderThickness : 0) +
"px solid " +
this.toolbar.borderColor))
: (va(this._zoomButton, this._resetButton),
(this._toolBar.style.border =
this.toolbar.borderThickness + "px solid transparent"),
this.options.zoomEnabled &&
((this.zoomEnabled = !0), (this.panEnabled = !1)));
gb(this);
this._processData();
this.options.title &&
((this.title = new Aa(this, this.options.title)),
this.title.dockInsidePlotArea
? a.push(this.title)
: this.title.setLayout());
this.subtitles = [];
if (this.options.subtitles)
for (d = 0; d < this.options.subtitles.length; d++)
(b = new Ka(this, this.options.subtitles[d], d)),
this.subtitles.push(b),
b.dockInsidePlotArea ? a.push(b) : b.setLayout();
this.legend = new H(this, this.options.legend);
for (d = 0; d < this.data.length; d++)
(this.data[d].showInLegend ||
"pie" === this.data[d].type ||
"doughnut" === this.data[d].type ||
"funnel" === this.data[d].type ||
"pyramid" === this.data[d].type) &&
this.legend.dataSeries.push(this.data[d]);
this.legend.dockInsidePlotArea
? a.push(this.legend)
: this.legend.setLayout();
for (d = 0; d < this._axes.length; d++)
if (
this._axes[d].scaleBreaks &&
this._axes[d].scaleBreaks._appliedBreaks.length
) {
r
? ((this._breaksCanvas = ta(this.width, this.height, !0)),
(this._breaksCanvasCtx = this._breaksCanvas.getContext("2d")))
: ((this._breaksCanvas = this.canvas),
(this._breaksCanvasCtx = this.ctx));
break;
}
this._preRenderCanvas = u(this._preRenderCanvas)
? ta(this.width, this.height)
: this._preRenderCanvas;
this._preRenderCtx = this._preRenderCanvas.getContext("2d");
("normal" !== this.plotInfo.axisPlacement &&
"xySwapped" !== this.plotInfo.axisPlacement) ||
z.setLayout(
this.axisX,
this.axisX2,
this.axisY,
this.axisY2,
this.plotInfo.axisPlacement,
this.layoutManager.getFreeSpace()
);
};
p.prototype.renderElements = function () {
var a = this._plotAreaElements;
this.title && !this.title.dockInsidePlotArea && this.title.render();
for (var d = 0; d < this.subtitles.length; d++)
this.subtitles[d].dockInsidePlotArea || this.subtitles[d].render();
this.legend.dockInsidePlotArea || this.legend.render();
if (
"normal" === this.plotInfo.axisPlacement ||
"xySwapped" === this.plotInfo.axisPlacement
)
z.render(
this.axisX,
this.axisX2,
this.axisY,
this.axisY2,
this.plotInfo.axisPlacement
);
else if ("none" === this.plotInfo.axisPlacement) this.preparePlotArea();
else return;
for (d = 0; d < a.length; d++) a[d].setLayout(), a[d].render();
var b = [];
if (this.animatedRender) {
var c = ta(this.width, this.height);
c.getContext("2d").drawImage(
this.canvas,
0,
0,
this.width,
this.height
);
}
hb(this);
var a = this.ctx.miterLimit,
e;
this.ctx.miterLimit = 3;
r &&
this._breaksCanvas &&
(this._preRenderCtx.drawImage(
this.canvas,
0,
0,
this.width,
this.height
),
this._preRenderCtx.drawImage(
this._breaksCanvas,
0,
0,
this.width,
this.height
),
(this._breaksCanvasCtx.globalCompositeOperation = "source-atop"),
this._breaksCanvasCtx.drawImage(
this._preRenderCanvas,
0,
0,
this.width,
this.height
),
this._preRenderCtx.clearRect(0, 0, this.width, this.height));
for (d = 0; d < this.plotInfo.plotTypes.length; d++)
for (
var g = this.plotInfo.plotTypes[d], m = 0;
m < g.plotUnits.length;
m++
) {
var l = g.plotUnits[m],
w = null;
l.targetCanvas = null;
this.animatedRender &&
((l.targetCanvas = ta(this.width, this.height)),
(l.targetCanvasCtx = l.targetCanvas.getContext("2d")),
(e = l.targetCanvasCtx.miterLimit),
(l.targetCanvasCtx.miterLimit = 3));
"line" === l.type
? (w = this.renderLine(l))
: "stepLine" === l.type
? (w = this.renderStepLine(l))
: "spline" === l.type
? (w = this.renderSpline(l))
: "column" === l.type
? (w = this.renderColumn(l))
: "bar" === l.type
? (w = this.renderBar(l))
: "area" === l.type
? (w = this.renderArea(l))
: "stepArea" === l.type
? (w = this.renderStepArea(l))
: "splineArea" === l.type
? (w = this.renderSplineArea(l))
: "stackedColumn" === l.type
? (w = this.renderStackedColumn(l))
: "stackedColumn100" === l.type
? (w = this.renderStackedColumn100(l))
: "stackedBar" === l.type
? (w = this.renderStackedBar(l))
: "stackedBar100" === l.type
? (w = this.renderStackedBar100(l))
: "stackedArea" === l.type
? (w = this.renderStackedArea(l))
: "stackedArea100" === l.type
? (w = this.renderStackedArea100(l))
: "bubble" === l.type
? (w = w = this.renderBubble(l))
: "scatter" === l.type
? (w = this.renderScatter(l))
: "pie" === l.type
? this.renderPie(l)
: "doughnut" === l.type
? this.renderPie(l)
: "funnel" === l.type
? (w = this.renderFunnel(l))
: "pyramid" === l.type
? (w = this.renderFunnel(l))
: "candlestick" === l.type
? (w = this.renderCandlestick(l))
: "ohlc" === l.type
? (w = this.renderCandlestick(l))
: "rangeColumn" === l.type
? (w = this.renderRangeColumn(l))
: "error" === l.type
? (w = this.renderError(l))
: "rangeBar" === l.type
? (w = this.renderRangeBar(l))
: "rangeArea" === l.type
? (w = this.renderRangeArea(l))
: "rangeSplineArea" === l.type
? (w = this.renderRangeSplineArea(l))
: "waterfall" === l.type
? (w = this.renderWaterfall(l))
: "boxAndWhisker" === l.type && (w = this.renderBoxAndWhisker(l));
for (var h = 0; h < l.dataSeriesIndexes.length; h++)
this._dataInRenderedOrder.push(this.data[l.dataSeriesIndexes[h]]);
this.animatedRender &&
((l.targetCanvasCtx.miterLimit = e), w && b.push(w));
}
this.ctx.miterLimit = a;
this.animatedRender &&
this._breaksCanvasCtx &&
b.push({
source: this._breaksCanvasCtx,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
startTimePercent: 0.7,
});
this.animatedRender &&
0 < this._indexLabels.length &&
((e = ta(this.width, this.height).getContext("2d")),
b.push(this.renderIndexLabels(e)));
var s = this;
if (0 < b.length)
(s.disableToolTip = !0),
s._animator.animate(
200,
s.animationDuration,
function (a) {
s.ctx.clearRect(0, 0, s.width, s.height);
s.ctx.drawImage(
c,
0,
0,
Math.floor(s.width * W),
Math.floor(s.height * W),
0,
0,
s.width,
s.height
);
for (var e = 0; e < b.length; e++)
(w = b[e]),
1 > a && "undefined" !== typeof w.startTimePercent
? a >= w.startTimePercent &&
w.animationCallback(
w.easingFunction(
a - w.startTimePercent,
0,
1,
1 - w.startTimePercent
),
w
)
: w.animationCallback(w.easingFunction(a, 0, 1, 1), w);
s.dispatchEvent("dataAnimationIterationEnd", { chart: s });
},
function () {
b = [];
for (var a = 0; a < s.plotInfo.plotTypes.length; a++)
for (
var e = s.plotInfo.plotTypes[a], d = 0;
d < e.plotUnits.length;
d++
)
e.plotUnits[d].targetCanvas = null;
c = null;
s.disableToolTip = !1;
}
);
else {
if (s._breaksCanvas)
if (r)
s.plotArea.ctx.drawImage(
s._breaksCanvas,
0,
0,
this.width,
this.height
);
else for (h = 0; h < s._axes.length; h++) s._axes[h].createMask();
0 < s._indexLabels.length && s.renderIndexLabels();
s.dispatchEvent("dataAnimationIterationEnd", { chart: s });
}
this.attachPlotAreaEventHandlers();
this.zoomEnabled ||
this.panEnabled ||
!this._zoomButton ||
"none" === this._zoomButton.style.display ||
va(this._zoomButton, this._resetButton);
this.toolTip._updateToolTip();
this.renderCount++;
Ja &&
((s = this),
setTimeout(function () {
var a = document.getElementById("ghostCanvasCopy");
a &&
(Oa(a, s.width, s.height),
a.getContext("2d").drawImage(s._eventManager.ghostCanvas, 0, 0));
}, 2e3));
this._breaksCanvas &&
(delete this._breaksCanvas, delete this._breaksCanvasCtx);
for (h = 0; h < this._axes.length; h++)
this._axes[h].maskCanvas &&
(delete this._axes[h].maskCanvas, delete this._axes[h].maskCtx);
};
p.prototype.render = function (a) {
a && (this.options = a);
this._initialize();
this.setLayout();
this.renderElements();
};
p.prototype.attachPlotAreaEventHandlers = function () {
this.attachEvent({
context: this,
chart: this,
mousedown: this._plotAreaMouseDown,
mouseup: this._plotAreaMouseUp,
mousemove: this._plotAreaMouseMove,
cursor: this.panEnabled ? "move" : "default",
capture: !0,
bounds: this.plotArea,
});
};
p.prototype.categoriseDataSeries = function () {
for (var a = "", d = 0; d < this.data.length; d++)
if (
((a = this.data[d]),
a.dataPoints &&
0 !== a.dataPoints.length &&
a.visible &&
0 <= p._supportedChartTypes.indexOf(a.type))
) {
for (
var b = null, c = !1, e = null, g = !1, m = 0;
m < this.plotInfo.plotTypes.length;
m++
)
if (this.plotInfo.plotTypes[m].type === a.type) {
c = !0;
b = this.plotInfo.plotTypes[m];
break;
}
c ||
((b = { type: a.type, totalDataSeries: 0, plotUnits: [] }),
this.plotInfo.plotTypes.push(b));
for (m = 0; m < b.plotUnits.length; m++)
if (
b.plotUnits[m].axisYType === a.axisYType &&
b.plotUnits[m].axisXType === a.axisXType &&
b.plotUnits[m].axisYIndex === a.axisYIndex &&
b.plotUnits[m].axisXIndex === a.axisXIndex
) {
g = !0;
e = b.plotUnits[m];
break;
}
g ||
((e = {
type: a.type,
previousDataSeriesCount: 0,
index: b.plotUnits.length,
plotType: b,
axisXType: a.axisXType,
axisYType: a.axisYType,
axisYIndex: a.axisYIndex,
axisXIndex: a.axisXIndex,
axisY:
"primary" === a.axisYType
? this.axisY[
0 <= a.axisYIndex && a.axisYIndex < this.axisY.length
? a.axisYIndex
: 0
]
: this.axisY2[
0 <= a.axisYIndex && a.axisYIndex < this.axisY2.length
? a.axisYIndex
: 0
],
axisX:
"primary" === a.axisXType
? this.axisX[
0 <= a.axisXIndex && a.axisXIndex < this.axisX.length
? a.axisXIndex
: 0
]
: this.axisX2[
0 <= a.axisXIndex && a.axisXIndex < this.axisX2.length
? a.axisXIndex
: 0
],
dataSeriesIndexes: [],
yTotals: [],
}),
b.plotUnits.push(e));
b.totalDataSeries++;
e.dataSeriesIndexes.push(d);
a.plotUnit = e;
}
for (d = 0; d < this.plotInfo.plotTypes.length; d++)
for (
b = this.plotInfo.plotTypes[d], m = a = 0;
m < b.plotUnits.length;
m++
)
(b.plotUnits[m].previousDataSeriesCount = a),
(a += b.plotUnits[m].dataSeriesIndexes.length);
};
p.prototype.assignIdToDataPoints = function () {
for (var a = 0; a < this.data.length; a++) {
var d = this.data[a];
if (d.dataPoints)
for (var b = d.dataPoints.length, c = 0; c < b; c++)
d.dataPointIds[c] = ++this._eventManager.lastObjectId;
}
};
p.prototype._processData = function () {
this.assignIdToDataPoints();
this.categoriseDataSeries();
for (var a = 0; a < this.plotInfo.plotTypes.length; a++)
for (
var d = this.plotInfo.plotTypes[a], b = 0;
b < d.plotUnits.length;
b++
) {
var c = d.plotUnits[b];
"line" === c.type ||
"stepLine" === c.type ||
"spline" === c.type ||
"column" === c.type ||
"area" === c.type ||
"stepArea" === c.type ||
"splineArea" === c.type ||
"bar" === c.type ||
"bubble" === c.type ||
"scatter" === c.type
? this._processMultiseriesPlotUnit(c)
: "stackedColumn" === c.type ||
"stackedBar" === c.type ||
"stackedArea" === c.type
? this._processStackedPlotUnit(c)
: "stackedColumn100" === c.type ||
"stackedBar100" === c.type ||
"stackedArea100" === c.type
? this._processStacked100PlotUnit(c)
: "candlestick" === c.type ||
"ohlc" === c.type ||
"rangeColumn" === c.type ||
"rangeBar" === c.type ||
"rangeArea" === c.type ||
"rangeSplineArea" === c.type ||
"error" === c.type ||
"boxAndWhisker" === c.type
? this._processMultiYPlotUnit(c)
: "waterfall" === c.type && this._processSpecificPlotUnit(c);
}
this.calculateAutoBreaks();
};
p.prototype._processMultiseriesPlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length))
for (
var d = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, m = 0;
m < a.dataSeriesIndexes.length;
m++
) {
var l = this.data[a.dataSeriesIndexes[m]],
w = 0,
h = !1,
s = !1,
q;
if ("normal" === l.axisPlacement || "xySwapped" === l.axisPlacement)
var n = a.axisX.sessionVariables.newViewportMinimum
? a.axisX.sessionVariables.newViewportMinimum
: this.options.axisX && this.options.axisX.viewportMinimum
? this.options.axisX.viewportMinimum
: this.options.axisX && this.options.axisX.minimum
? this.options.axisX.minimum
: a.axisX.logarithmic
? 0
: -Infinity,
f = a.axisX.sessionVariables.newViewportMaximum
? a.axisX.sessionVariables.newViewportMaximum
: this.options.axisX && this.options.axisX.viewportMaximum
? this.options.axisX.viewportMaximum
: this.options.axisX && this.options.axisX.maximum
? this.options.axisX.maximum
: Infinity;
if (
(l.dataPoints[w].x && l.dataPoints[w].x.getTime) ||
"dateTime" === l.xValueType
)
g = !0;
for (w = 0; w < l.dataPoints.length; w++) {
"undefined" === typeof l.dataPoints[w].x &&
(l.dataPoints[w].x = w + (a.axisX.logarithmic ? 1 : 0));
l.dataPoints[w].x.getTime
? ((g = !0), (c = l.dataPoints[w].x.getTime()))
: (c = l.dataPoints[w].x);
e = l.dataPoints[w].y;
c < b.min && (b.min = c);
c > b.max && (b.max = c);
e < d.min && "number" === typeof e && (d.min = e);
e > d.max && "number" === typeof e && (d.max = e);
if (0 < w) {
if (a.axisX.logarithmic) {
var B = c / l.dataPoints[w - 1].x;
1 > B && (B = 1 / B);
b.minDiff > B && 1 !== B && (b.minDiff = B);
} else
(B = c - l.dataPoints[w - 1].x),
0 > B && (B *= -1),
b.minDiff > B && 0 !== B && (b.minDiff = B);
null !== e &&
null !== l.dataPoints[w - 1].y &&
(a.axisY.logarithmic
? ((B = e / l.dataPoints[w - 1].y),
1 > B && (B = 1 / B),
d.minDiff > B && 1 !== B && (d.minDiff = B))
: ((B = e - l.dataPoints[w - 1].y),
0 > B && (B *= -1),
d.minDiff > B && 0 !== B && (d.minDiff = B)));
}
if (c < n && !h) null !== e && (q = c);
else {
if (!h && ((h = !0), 0 < w)) {
w -= 2;
continue;
}
if (c > f && !s) s = !0;
else if (c > f && s) continue;
l.dataPoints[w].label &&
(a.axisX.labels[c] = l.dataPoints[w].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === e
? b.viewPortMin === c && q < c && (b.viewPortMin = q)
: (e < d.viewPortMin &&
"number" === typeof e &&
(d.viewPortMin = e),
e > d.viewPortMax &&
"number" === typeof e &&
(d.viewPortMax = e));
}
}
l.axisX.valueType = l.xValueType = g ? "dateTime" : "number";
}
};
p.prototype._processStackedPlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length)) {
for (
var d = a.axisY.dataInfo,
b = a.axisX.dataInfo,
c,
e,
g = !1,
m = [],
l = [],
w = Infinity,
h = -Infinity,
s = 0;
s < a.dataSeriesIndexes.length;
s++
) {
var q = this.data[a.dataSeriesIndexes[s]],
n = 0,
f = !1,
B = !1,
k;
if ("normal" === q.axisPlacement || "xySwapped" === q.axisPlacement)
var p = a.axisX.sessionVariables.newViewportMinimum
? a.axisX.sessionVariables.newViewportMinimum
: this.options.axisX && this.options.axisX.viewportMinimum
? this.options.axisX.viewportMinimum
: this.options.axisX && this.options.axisX.minimum
? this.options.axisX.minimum
: -Infinity,
t = a.axisX.sessionVariables.newViewportMaximum
? a.axisX.sessionVariables.newViewportMaximum
: this.options.axisX && this.options.axisX.viewportMaximum
? this.options.axisX.viewportMaximum
: this.options.axisX && this.options.axisX.maximum
? this.options.axisX.maximum
: Infinity;
if (
(q.dataPoints[n].x && q.dataPoints[n].x.getTime) ||
"dateTime" === q.xValueType
)
g = !0;
for (n = 0; n < q.dataPoints.length; n++) {
"undefined" === typeof q.dataPoints[n].x &&
(q.dataPoints[n].x = n + (a.axisX.logarithmic ? 1 : 0));
q.dataPoints[n].x.getTime
? ((g = !0), (c = q.dataPoints[n].x.getTime()))
: (c = q.dataPoints[n].x);
e = u(q.dataPoints[n].y) ? 0 : q.dataPoints[n].y;
c < b.min && (b.min = c);
c > b.max && (b.max = c);
if (0 < n) {
if (a.axisX.logarithmic) {
var r = c / q.dataPoints[n - 1].x;
1 > r && (r = 1 / r);
b.minDiff > r && 1 !== r && (b.minDiff = r);
} else
(r = c - q.dataPoints[n - 1].x),
0 > r && (r *= -1),
b.minDiff > r && 0 !== r && (b.minDiff = r);
null !== e &&
null !== q.dataPoints[n - 1].y &&
(a.axisY.logarithmic
? 0 < e &&
((r = e / q.dataPoints[n - 1].y),
1 > r && (r = 1 / r),
d.minDiff > r && 1 !== r && (d.minDiff = r))
: ((r = e - q.dataPoints[n - 1].y),
0 > r && (r *= -1),
d.minDiff > r && 0 !== r && (d.minDiff = r)));
}
if (c < p && !f) null !== q.dataPoints[n].y && (k = c);
else {
if (!f && ((f = !0), 0 < n)) {
n -= 2;
continue;
}
if (c > t && !B) B = !0;
else if (c > t && B) continue;
q.dataPoints[n].label &&
(a.axisX.labels[c] = q.dataPoints[n].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === q.dataPoints[n].y
? b.viewPortMin === c && k < c && (b.viewPortMin = k)
: ((a.yTotals[c] = (a.yTotals[c] ? a.yTotals[c] : 0) + e),
0 <= e
? m[c]
? (m[c] += e)
: ((m[c] = e), (w = Math.min(e, w)))
: l[c]
? (l[c] += e)
: ((l[c] = e), (h = Math.max(e, h))));
}
}
a.axisY.scaleBreaks &&
a.axisY.scaleBreaks.autoCalculate &&
1 <= a.axisY.scaleBreaks.maxNumberOfAutoBreaks &&
(d.dataPointYPositiveSums
? (d.dataPointYPositiveSums.push.apply(
d.dataPointYPositiveSums,
m
),
d.dataPointYNegativeSums.push.apply(
d.dataPointYPositiveSums,
l
))
: ((d.dataPointYPositiveSums = m),
(d.dataPointYNegativeSums = l)));
q.axisX.valueType = q.xValueType = g ? "dateTime" : "number";
}
for (n in m)
m.hasOwnProperty(n) &&
!isNaN(n) &&
((a = m[n]),
a < d.min && (d.min = Math.min(a, w)),
a > d.max && (d.max = a),
n < b.viewPortMin ||
n > b.viewPortMax ||
(a < d.viewPortMin && (d.viewPortMin = Math.min(a, w)),
a > d.viewPortMax && (d.viewPortMax = a)));
for (n in l)
l.hasOwnProperty(n) &&
!isNaN(n) &&
((a = l[n]),
a < d.min && (d.min = a),
a > d.max && (d.max = Math.max(a, h)),
n < b.viewPortMin ||
n > b.viewPortMax ||
(a < d.viewPortMin && (d.viewPortMin = a),
a > d.viewPortMax && (d.viewPortMax = Math.max(a, h))));
}
};
p.prototype._processStacked100PlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length)) {
for (
var d = a.axisY.dataInfo,
b = a.axisX.dataInfo,
c,
e,
g = !1,
m = !1,
l = !1,
w = [],
h = 0;
h < a.dataSeriesIndexes.length;
h++
) {
var s = this.data[a.dataSeriesIndexes[h]],
q = 0,
n = !1,
f = !1,
B;
if ("normal" === s.axisPlacement || "xySwapped" === s.axisPlacement)
var k = a.axisX.sessionVariables.newViewportMinimum
? a.axisX.sessionVariables.newViewportMinimum
: this.options.axisX && this.options.axisX.viewportMinimum
? this.options.axisX.viewportMinimum
: this.options.axisX && this.options.axisX.minimum
? this.options.axisX.minimum
: -Infinity,
r = a.axisX.sessionVariables.newViewportMaximum
? a.axisX.sessionVariables.newViewportMaximum
: this.options.axisX && this.options.axisX.viewportMaximum
? this.options.axisX.viewportMaximum
: this.options.axisX && this.options.axisX.maximum
? this.options.axisX.maximum
: Infinity;
if (
(s.dataPoints[q].x && s.dataPoints[q].x.getTime) ||
"dateTime" === s.xValueType
)
g = !0;
for (q = 0; q < s.dataPoints.length; q++) {
"undefined" === typeof s.dataPoints[q].x &&
(s.dataPoints[q].x = q + (a.axisX.logarithmic ? 1 : 0));
s.dataPoints[q].x.getTime
? ((g = !0), (c = s.dataPoints[q].x.getTime()))
: (c = s.dataPoints[q].x);
e = u(s.dataPoints[q].y) ? null : s.dataPoints[q].y;
c < b.min && (b.min = c);
c > b.max && (b.max = c);
if (0 < q) {
if (a.axisX.logarithmic) {
var t = c / s.dataPoints[q - 1].x;
1 > t && (t = 1 / t);
b.minDiff > t && 1 !== t && (b.minDiff = t);
} else
(t = c - s.dataPoints[q - 1].x),
0 > t && (t *= -1),
b.minDiff > t && 0 !== t && (b.minDiff = t);
u(e) ||
null === s.dataPoints[q - 1].y ||
(a.axisY.logarithmic
? 0 < e &&
((t = e / s.dataPoints[q - 1].y),
1 > t && (t = 1 / t),
d.minDiff > t && 1 !== t && (d.minDiff = t))
: ((t = e - s.dataPoints[q - 1].y),
0 > t && (t *= -1),
d.minDiff > t && 0 !== t && (d.minDiff = t)));
}
if (c < k && !n) null !== e && (B = c);
else {
if (!n && ((n = !0), 0 < q)) {
q -= 2;
continue;
}
if (c > r && !f) f = !0;
else if (c > r && f) continue;
s.dataPoints[q].label &&
(a.axisX.labels[c] = s.dataPoints[q].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === e
? b.viewPortMin === c && B < c && (b.viewPortMin = B)
: ((a.yTotals[c] = (a.yTotals[c] ? a.yTotals[c] : 0) + e),
0 <= e ? (m = !0) : 0 > e && (l = !0),
(w[c] = w[c] ? w[c] + Math.abs(e) : Math.abs(e)));
}
}
s.axisX.valueType = s.xValueType = g ? "dateTime" : "number";
}
a.axisY.logarithmic
? ((d.max = u(d.viewPortMax)
? 99 * Math.pow(a.axisY.logarithmBase, -0.05)
: Math.max(
d.viewPortMax,
99 * Math.pow(a.axisY.logarithmBase, -0.05)
)),
(d.min = u(d.viewPortMin) ? 1 : Math.min(d.viewPortMin, 1)))
: m && !l
? ((d.max = u(d.viewPortMax) ? 99 : Math.max(d.viewPortMax, 99)),
(d.min = u(d.viewPortMin) ? 1 : Math.min(d.viewPortMin, 1)))
: m && l
? ((d.max = u(d.viewPortMax) ? 99 : Math.max(d.viewPortMax, 99)),
(d.min = u(d.viewPortMin) ? -99 : Math.min(d.viewPortMin, -99)))
: !m &&
l &&
((d.max = u(d.viewPortMax) ? -1 : Math.max(d.viewPortMax, -1)),
(d.min = u(d.viewPortMin) ? -99 : Math.min(d.viewPortMin, -99)));
d.viewPortMin = d.min;
d.viewPortMax = d.max;
a.dataPointYSums = w;
}
};
p.prototype._processMultiYPlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length))
for (
var d = a.axisY.dataInfo,
b = a.axisX.dataInfo,
c,
e,
g,
m,
l = !1,
w = 0;
w < a.dataSeriesIndexes.length;
w++
) {
var h = this.data[a.dataSeriesIndexes[w]],
s = 0,
q = !1,
n = !1,
f,
B,
k;
if ("normal" === h.axisPlacement || "xySwapped" === h.axisPlacement)
var r = a.axisX.sessionVariables.newViewportMinimum
? a.axisX.sessionVariables.newViewportMinimum
: this.options.axisX && this.options.axisX.viewportMinimum
? this.options.axisX.viewportMinimum
: this.options.axisX && this.options.axisX.minimum
? this.options.axisX.minimum
: a.axisX.logarithmic
? 0
: -Infinity,
t = a.axisX.sessionVariables.newViewportMaximum
? a.axisX.sessionVariables.newViewportMaximum
: this.options.axisX && this.options.axisX.viewportMaximum
? this.options.axisX.viewportMaximum
: this.options.axisX && this.options.axisX.maximum
? this.options.axisX.maximum
: Infinity;
if (
(h.dataPoints[s].x && h.dataPoints[s].x.getTime) ||
"dateTime" === h.xValueType
)
l = !0;
for (s = 0; s < h.dataPoints.length; s++) {
"undefined" === typeof h.dataPoints[s].x &&
(h.dataPoints[s].x = s + (a.axisX.logarithmic ? 1 : 0));
h.dataPoints[s].x.getTime
? ((l = !0), (c = h.dataPoints[s].x.getTime()))
: (c = h.dataPoints[s].x);
if ((e = h.dataPoints[s].y) && e.length) {
g = Math.min.apply(null, e);
m = Math.max.apply(null, e);
B = !0;
for (var p = 0; p < e.length; p++) null === e.k && (B = !1);
B && (q || (k = f), (f = c));
}
c < b.min && (b.min = c);
c > b.max && (b.max = c);
g < d.min && (d.min = g);
m > d.max && (d.max = m);
0 < s &&
(a.axisX.logarithmic
? ((B = c / h.dataPoints[s - 1].x),
1 > B && (B = 1 / B),
b.minDiff > B && 1 !== B && (b.minDiff = B))
: ((B = c - h.dataPoints[s - 1].x),
0 > B && (B *= -1),
b.minDiff > B && 0 !== B && (b.minDiff = B)),
e &&
null !== e[0] &&
h.dataPoints[s - 1].y &&
null !== h.dataPoints[s - 1].y[0] &&
(a.axisY.logarithmic
? ((B = e[0] / h.dataPoints[s - 1].y[0]),
1 > B && (B = 1 / B),
d.minDiff > B && 1 !== B && (d.minDiff = B))
: ((B = e[0] - h.dataPoints[s - 1].y[0]),
0 > B && (B *= -1),
d.minDiff > B && 0 !== B && (d.minDiff = B))));
if (!(c < r) || q) {
if (!q && ((q = !0), 0 < s)) {
s -= 2;
f = k;
continue;
}
if (c > t && !n) n = !0;
else if (c > t && n) continue;
h.dataPoints[s].label &&
(a.axisX.labels[c] = h.dataPoints[s].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
if (b.viewPortMin === c && e)
for (p = 0; p < e.length; p++)
if (null === e[p] && f < c) {
b.viewPortMin = f;
break;
}
null === e
? b.viewPortMin === c && f < c && (b.viewPortMin = f)
: (g < d.viewPortMin && (d.viewPortMin = g),
m > d.viewPortMax && (d.viewPortMax = m));
}
}
h.axisX.valueType = h.xValueType = l ? "dateTime" : "number";
}
};
p.prototype._processSpecificPlotUnit = function (a) {
if (
"waterfall" === a.type &&
a.dataSeriesIndexes &&
!(1 > a.dataSeriesIndexes.length)
)
for (
var d = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, m = 0;
m < a.dataSeriesIndexes.length;
m++
) {
var l = this.data[a.dataSeriesIndexes[m]],
w = 0,
h = !1,
s = !1,
q = (c = 0);
if ("normal" === l.axisPlacement || "xySwapped" === l.axisPlacement)
var n = a.axisX.sessionVariables.newViewportMinimum
? a.axisX.sessionVariables.newViewportMinimum
: this.options.axisX && this.options.axisX.viewportMinimum
? this.options.axisX.viewportMinimum
: this.options.axisX && this.options.axisX.minimum
? this.options.axisX.minimum
: a.axisX.logarithmic
? 0
: -Infinity,
f = a.axisX.sessionVariables.newViewportMaximum
? a.axisX.sessionVariables.newViewportMaximum
: this.options.axisX && this.options.axisX.viewportMaximum
? this.options.axisX.viewportMaximum
: this.options.axisX && this.options.axisX.maximum
? this.options.axisX.maximum
: Infinity;
if (
(l.dataPoints[w].x && l.dataPoints[w].x.getTime) ||
"dateTime" === l.xValueType
)
g = !0;
for (w = 0; w < l.dataPoints.length; w++)
"undefined" !== typeof l.dataPoints[w].isCumulativeSum &&
!0 === l.dataPoints[w].isCumulativeSum
? ((l.dataPointEOs[w].cumulativeSumYStartValue = 0),
(l.dataPointEOs[w].cumulativeSum =
0 === w ? 0 : l.dataPointEOs[w - 1].cumulativeSum),
(l.dataPoints[w].y =
0 === w ? 0 : l.dataPointEOs[w - 1].cumulativeSum))
: "undefined" !== typeof l.dataPoints[w].isIntermediateSum &&
!0 === l.dataPoints[w].isIntermediateSum
? ((l.dataPointEOs[w].cumulativeSumYStartValue = q),
(l.dataPointEOs[w].cumulativeSum =
0 === w ? 0 : l.dataPointEOs[w - 1].cumulativeSum),
(l.dataPoints[w].y = 0 === w ? 0 : c),
(q = 0 === w ? 0 : l.dataPointEOs[w - 1].cumulativeSum),
(c = 0))
: ((e =
"number" !== typeof l.dataPoints[w].y
? 0
: l.dataPoints[w].y),
(l.dataPointEOs[w].cumulativeSumYStartValue =
0 === w ? 0 : l.dataPointEOs[w - 1].cumulativeSum),
(l.dataPointEOs[w].cumulativeSum =
0 === w ? e : l.dataPointEOs[w - 1].cumulativeSum + e),
(c += e));
for (w = 0; w < l.dataPoints.length; w++)
if (
("undefined" === typeof l.dataPoints[w].x &&
(l.dataPoints[w].x = w + (a.axisX.logarithmic ? 1 : 0)),
l.dataPoints[w].x.getTime
? ((g = !0), (c = l.dataPoints[w].x.getTime()))
: (c = l.dataPoints[w].x),
(e = l.dataPoints[w].y),
c < b.min && (b.min = c),
c > b.max && (b.max = c),
l.dataPointEOs[w].cumulativeSum < d.min &&
(d.min = l.dataPointEOs[w].cumulativeSum),
l.dataPointEOs[w].cumulativeSum > d.max &&
(d.max = l.dataPointEOs[w].cumulativeSum),
0 < w &&
(a.axisX.logarithmic
? ((q = c / l.dataPoints[w - 1].x),
1 > q && (q = 1 / q),
b.minDiff > q && 1 !== q && (b.minDiff = q))
: ((q = c - l.dataPoints[w - 1].x),
0 > q && (q *= -1),
b.minDiff > q && 0 !== q && (b.minDiff = q)),
null !== e &&
null !== l.dataPoints[w - 1].y &&
(a.axisY.logarithmic
? ((e =
l.dataPointEOs[w].cumulativeSum /
l.dataPointEOs[w - 1].cumulativeSum),
1 > e && (e = 1 / e),
d.minDiff > e && 1 !== e && (d.minDiff = e))
: ((e =
l.dataPointEOs[w].cumulativeSum -
l.dataPointEOs[w - 1].cumulativeSum),
0 > e && (e *= -1),
d.minDiff > e && 0 !== e && (d.minDiff = e)))),
!(c < n) || h)
) {
if (!h && ((h = !0), 0 < w)) {
w -= 2;
continue;
}
if (c > f && !s) s = !0;
else if (c > f && s) continue;
l.dataPoints[w].label &&
(a.axisX.labels[c] = l.dataPoints[w].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
0 < w &&
(l.dataPointEOs[w - 1].cumulativeSum < d.viewPortMin &&
(d.viewPortMin = l.dataPointEOs[w - 1].cumulativeSum),
l.dataPointEOs[w - 1].cumulativeSum > d.viewPortMax &&
(d.viewPortMax = l.dataPointEOs[w - 1].cumulativeSum));
l.dataPointEOs[w].cumulativeSum < d.viewPortMin &&
(d.viewPortMin = l.dataPointEOs[w].cumulativeSum);
l.dataPointEOs[w].cumulativeSum > d.viewPortMax &&
(d.viewPortMax = l.dataPointEOs[w].cumulativeSum);
}
l.axisX.valueType = l.xValueType = g ? "dateTime" : "number";
}
};
p.prototype.calculateAutoBreaks = function () {
function a(a, c, b, e) {
if (e)
return (
(b = Math.pow(Math.min((b * a) / c, c / a), 0.2)),
1 >= b && (b = Math.pow(1 > a ? 1 / a : Math.min(c / a, a), 0.25)),
{ startValue: a * b, endValue: c / b }
);
b = 0.2 * Math.min(b - c + a, c - a);
0 >= b && (b = 0.25 * Math.min(c - a, Math.abs(a)));
return { startValue: a + b, endValue: c - b };
}
function d(a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length)) {
var c =
a.axisX.scaleBreaks &&
a.axisX.scaleBreaks.autoCalculate &&
1 <= a.axisX.scaleBreaks.maxNumberOfAutoBreaks,
b =
a.axisY.scaleBreaks &&
a.axisY.scaleBreaks.autoCalculate &&
1 <= a.axisY.scaleBreaks.maxNumberOfAutoBreaks;
if (c || b)
for (
var d = a.axisY.dataInfo,
f = a.axisX.dataInfo,
g,
h = f.min,
l = f.max,
m = d.min,
n = d.max,
f = f._dataRanges,
d = d._dataRanges,
q,
w = 0,
s = 0;
s < a.dataSeriesIndexes.length;
s++
) {
var k = e.data[a.dataSeriesIndexes[s]];
if (!(4 > k.dataPoints.length))
for (w = 0; w < k.dataPoints.length; w++)
if (
(c &&
((q =
((l + 1 - h) *
Math.max(
parseFloat(
a.axisX.scaleBreaks.collapsibleThreshold
) || 10,
10
)) /
100),
(g = k.dataPoints[w].x.getTime
? k.dataPoints[w].x.getTime()
: k.dataPoints[w].x),
(q = Math.floor((g - h) / q)),
g < f[q].min && (f[q].min = g),
g > f[q].max && (f[q].max = g)),
b)
) {
var r =
((n + 1 - m) *
Math.max(
parseFloat(
a.axisY.scaleBreaks.collapsibleThreshold
) || 10,
10
)) /
100;
if (
(g =
"waterfall" === a.type
? k.dataPointEOs[w].cumulativeSum
: k.dataPoints[w].y) &&
g.length
)
for (var p = 0; p < g.length; p++)
(q = Math.floor((g[p] - m) / r)),
g[p] < d[q].min && (d[q].min = g[p]),
g[p] > d[q].max && (d[q].max = g[p]);
else
u(g) ||
((q = Math.floor((g - m) / r)),
g < d[q].min && (d[q].min = g),
g > d[q].max && (d[q].max = g));
}
}
}
}
function b(a) {
if (
a.dataSeriesIndexes &&
!(1 > a.dataSeriesIndexes.length) &&
a.axisX.scaleBreaks &&
a.axisX.scaleBreaks.autoCalculate &&
1 <= a.axisX.scaleBreaks.maxNumberOfAutoBreaks
)
for (
var c = a.axisX.dataInfo,
b = c.min,
d = c.max,
f = c._dataRanges,
g,
h = 0,
l = 0;
l < a.dataSeriesIndexes.length;
l++
) {
var m = e.data[a.dataSeriesIndexes[l]];
if (!(4 > m.dataPoints.length))
for (h = 0; h < m.dataPoints.length; h++)
(g =
((d + 1 - b) *
Math.max(
parseFloat(a.axisX.scaleBreaks.collapsibleThreshold) ||
10,
10
)) /
100),
(c = m.dataPoints[h].x.getTime
? m.dataPoints[h].x.getTime()
: m.dataPoints[h].x),
(g = Math.floor((c - b) / g)),
c < f[g].min && (f[g].min = c),
c > f[g].max && (f[g].max = c);
}
}
for (var c, e = this, g = !1, m = 0; m < this._axes.length; m++)
if (
this._axes[m].scaleBreaks &&
this._axes[m].scaleBreaks.autoCalculate &&
1 <= this._axes[m].scaleBreaks.maxNumberOfAutoBreaks
) {
g = !0;
this._axes[m].dataInfo._dataRanges = [];
for (
var l = 0;
l <
100 /
Math.max(
parseFloat(this._axes[m].scaleBreaks.collapsibleThreshold) ||
10,
10
);
l++
)
this._axes[m].dataInfo._dataRanges.push({
min: Infinity,
max: -Infinity,
});
}
if (g) {
for (m = 0; m < this.plotInfo.plotTypes.length; m++)
for (
g = this.plotInfo.plotTypes[m], l = 0;
l < g.plotUnits.length;
l++
)
(c = g.plotUnits[l]),
"line" === c.type ||
"stepLine" === c.type ||
"spline" === c.type ||
"column" === c.type ||
"area" === c.type ||
"stepArea" === c.type ||
"splineArea" === c.type ||
"bar" === c.type ||
"bubble" === c.type ||
"scatter" === c.type ||
"candlestick" === c.type ||
"ohlc" === c.type ||
"rangeColumn" === c.type ||
"rangeBar" === c.type ||
"rangeArea" === c.type ||
"rangeSplineArea" === c.type ||
"waterfall" === c.type ||
"error" === c.type ||
"boxAndWhisker" === c.type
? d(c)
: 0 <= c.type.indexOf("stacked") && b(c);
for (m = 0; m < this._axes.length; m++)
if (this._axes[m].dataInfo._dataRanges) {
var w = this._axes[m].dataInfo.min;
c =
((this._axes[m].dataInfo.max + 1 - w) *
Math.max(
parseFloat(this._axes[m].scaleBreaks.collapsibleThreshold) ||
10,
10
)) /
100;
var h = this._axes[m].dataInfo._dataRanges,
s,
q,
g = [];
if (this._axes[m].dataInfo.dataPointYPositiveSums) {
var n = this._axes[m].dataInfo.dataPointYPositiveSums;
s = h;
for (l in n)
if (n.hasOwnProperty(l) && !isNaN(l) && ((q = n[l]), !u(q))) {
var f = Math.floor((q - w) / c);
q < s[f].min && (s[f].min = q);
q > s[f].max && (s[f].max = q);
}
delete this._axes[m].dataInfo.dataPointYPositiveSums;
}
if (this._axes[m].dataInfo.dataPointYNegativeSums) {
n = this._axes[m].dataInfo.dataPointYNegativeSums;
s = h;
for (l in n)
n.hasOwnProperty(l) &&
!isNaN(l) &&
((q = -1 * n[l]),
u(q) ||
((f = Math.floor((q - w) / c)),
q < s[f].min && (s[f].min = q),
q > s[f].max && (s[f].max = q)));
delete this._axes[m].dataInfo.dataPointYNegativeSums;
}
for (l = 0; l < h.length - 1; l++)
if (((s = h[l].max), isFinite(s)))
for (; l < h.length - 1; )
if (((w = h[l + 1].min), isFinite(w))) {
q = w - s;
q > c && g.push({ diff: q, start: s, end: w });
break;
} else l++;
if (this._axes[m].scaleBreaks.customBreaks)
for (
l = 0;
l < this._axes[m].scaleBreaks.customBreaks.length;
l++
)
for (c = 0; c < g.length; c++)
if (
(this._axes[m].scaleBreaks.customBreaks[l].startValue <=
g[c].start &&
g[c].start <=
this._axes[m].scaleBreaks.customBreaks[l].endValue) ||
(this._axes[m].scaleBreaks.customBreaks[l].startValue <=
g[c].start &&
g[c].start <=
this._axes[m].scaleBreaks.customBreaks[l].endValue) ||
(g[c].start <=
this._axes[m].scaleBreaks.customBreaks[l].startValue &&
this._axes[m].scaleBreaks.customBreaks[l].startValue <=
g[c].end) ||
(g[c].start <=
this._axes[m].scaleBreaks.customBreaks[l].endValue &&
this._axes[m].scaleBreaks.customBreaks[l].endValue <=
g[c].end)
)
g.splice(c, 1), c--;
g.sort(function (a, c) {
return c.diff - a.diff;
});
for (
l = 0;
l <
Math.min(
g.length,
this._axes[m].scaleBreaks.maxNumberOfAutoBreaks
);
l++
)
(c = a(
g[l].start,
g[l].end,
this._axes[m].logarithmic
? this._axes[m].dataInfo.max / this._axes[m].dataInfo.min
: this._axes[m].dataInfo.max - this._axes[m].dataInfo.min,
this._axes[m].logarithmic
)),
this._axes[m].scaleBreaks.autoBreaks.push(
new L(
this,
"autoBreaks",
c,
l,
++this._eventManager.lastObjectId,
this._axes[m].scaleBreaks
)
),
this._axes[m].scaleBreaks._appliedBreaks.push(
this._axes[m].scaleBreaks.autoBreaks[
this._axes[m].scaleBreaks.autoBreaks.length - 1
]
);
this._axes[m].scaleBreaks._appliedBreaks.sort(function (a, c) {
return a.startValue - c.startValue;
});
}
}
};
p.prototype.getDataPointAtXY = function (a, d, b) {
b = b || !1;
for (var c = [], e = this._dataInRenderedOrder.length - 1; 0 <= e; e--) {
var g = null;
(g = this._dataInRenderedOrder[e].getDataPointAtXY(a, d, b)) &&
c.push(g);
}
a = null;
d = !1;
for (b = 0; b < c.length; b++)
if (
"line" === c[b].dataSeries.type ||
"stepLine" === c[b].dataSeries.type ||
"area" === c[b].dataSeries.type ||
"stepArea" === c[b].dataSeries.type
)
if (
((e = na("markerSize", c[b].dataPoint, c[b].dataSeries) || 8),
c[b].distance <= e / 2)
) {
d = !0;
break;
}
for (b = 0; b < c.length; b++)
(d &&
"line" !== c[b].dataSeries.type &&
"stepLine" !== c[b].dataSeries.type &&
"area" !== c[b].dataSeries.type &&
"stepArea" !== c[b].dataSeries.type) ||
(a ? c[b].distance <= a.distance && (a = c[b]) : (a = c[b]));
return a;
};
p.prototype.getObjectAtXY = function (a, d, b) {
var c = null;
if ((b = this.getDataPointAtXY(a, d, b || !1)))
c = b.dataSeries.dataPointIds[b.dataPointIndex];
else if (r) c = ab(a, d, this._eventManager.ghostCtx);
else
for (b = 0; b < this.legend.items.length; b++) {
var e = this.legend.items[b];
a >= e.x1 && a <= e.x2 && d >= e.y1 && d <= e.y2 && (c = e.id);
}
return c;
};
p.prototype.getAutoFontSize = lb;
p.prototype.resetOverlayedCanvas = function () {
this.overlaidCanvasCtx.clearRect(0, 0, this.width, this.height);
};
p.prototype.clearCanvas = kb;
p.prototype.attachEvent = function (a) {
this._events.push(a);
};
p.prototype._touchEventHandler = function (a) {
if (a.changedTouches && this.interactivityEnabled) {
var d = [],
b = a.changedTouches,
c = b ? b[0] : a,
e = null;
switch (a.type) {
case "touchstart":
case "MSPointerDown":
d = ["mousemove", "mousedown"];
this._lastTouchData = Ra(c);
this._lastTouchData.time = new Date();
break;
case "touchmove":
case "MSPointerMove":
d = ["mousemove"];
break;
case "touchend":
case "MSPointerUp":
var g =
this._lastTouchData && this._lastTouchData.time
? new Date() - this._lastTouchData.time
: 0,
d =
"touchstart" === this._lastTouchEventType ||
"MSPointerDown" === this._lastTouchEventType ||
300 > g
? ["mouseup", "click"]
: ["mouseup"];
break;
default:
return;
}
if (!(b && 1 < b.length)) {
e = Ra(c);
e.time = new Date();
try {
var m = e.y - this._lastTouchData.y,
g = e.time - this._lastTouchData.time;
if (
(1 < Math.abs(m) && this._lastTouchData.scroll) ||
(5 < Math.abs(m) && 250 > g)
)
this._lastTouchData.scroll = !0;
} catch (l) {}
this._lastTouchEventType = a.type;
if (this._lastTouchData.scroll && this.zoomEnabled)
this.isDrag && this.resetOverlayedCanvas(), (this.isDrag = !1);
else
for (b = 0; b < d.length; b++)
if (
((e = d[b]),
(m = document.createEvent("MouseEvent")),
m.initMouseEvent(
e,
!0,
!0,
window,
1,
c.screenX,
c.screenY,
c.clientX,
c.clientY,
!1,
!1,
!1,
!1,
0,
null
),
c.target.dispatchEvent(m),
(!u(this._lastTouchData.scroll) &&
!this._lastTouchData.scroll) ||
(!this._lastTouchData.scroll && 250 < g) ||
"click" === e)
)
a.preventManipulation && a.preventManipulation(),
a.preventDefault && a.preventDefault();
}
}
};
p.prototype._dispatchRangeEvent = function (a, d) {
var b = { chart: this };
b.type = a;
b.trigger = d;
var c = [];
this.axisX && 0 < this.axisX.length && c.push("axisX");
this.axisX2 && 0 < this.axisX2.length && c.push("axisX2");
this.axisY && 0 < this.axisY.length && c.push("axisY");
this.axisY2 && 0 < this.axisY2.length && c.push("axisY2");
for (var e = 0; e < c.length; e++)
if ((u(b[c[e]]) && (b[c[e]] = []), "axisY" === c[e]))
for (var g = 0; g < this.axisY.length; g++)
b[c[e]].push({
viewportMinimum:
this[c[e]][g].sessionVariables.newViewportMinimum,
viewportMaximum:
this[c[e]][g].sessionVariables.newViewportMaximum,
});
else if ("axisY2" === c[e])
for (g = 0; g < this.axisY2.length; g++)
b[c[e]].push({
viewportMinimum:
this[c[e]][g].sessionVariables.newViewportMinimum,
viewportMaximum:
this[c[e]][g].sessionVariables.newViewportMaximum,
});
else if ("axisX" === c[e])
for (g = 0; g < this.axisX.length; g++)
b[c[e]].push({
viewportMinimum:
this[c[e]][g].sessionVariables.newViewportMinimum,
viewportMaximum:
this[c[e]][g].sessionVariables.newViewportMaximum,
});
else if ("axisX2" === c[e])
for (g = 0; g < this.axisX2.length; g++)
b[c[e]].push({
viewportMinimum:
this[c[e]][g].sessionVariables.newViewportMinimum,
viewportMaximum:
this[c[e]][g].sessionVariables.newViewportMaximum,
});
this.dispatchEvent(a, b, this);
};
p.prototype._mouseEventHandler = function (a) {
"undefined" === typeof a.target &&
a.srcElement &&
(a.target = a.srcElement);
var d = Ra(a),
b = a.type,
c,
e;
a.which ? (e = 3 == a.which) : a.button && (e = 2 == a.button);
p.capturedEventParam &&
((c = p.capturedEventParam),
"mouseup" === b &&
((p.capturedEventParam = null),
c.chart.overlaidCanvas.releaseCapture
? c.chart.overlaidCanvas.releaseCapture()
: document.documentElement.removeEventListener(
"mouseup",
c.chart._mouseEventHandler,
!1
)),
c.hasOwnProperty(b) &&
("mouseup" !== b || c.chart.overlaidCanvas.releaseCapture
? (a.target !== c.chart.overlaidCanvas && r) ||
c[b].call(c.context, d.x, d.y)
: a.target !== c.chart.overlaidCanvas && (c.chart.isDrag = !1)));
if (this.interactivityEnabled)
if (this._ignoreNextEvent) this._ignoreNextEvent = !1;
else if (
(a.preventManipulation && a.preventManipulation(),
a.preventDefault && a.preventDefault(),
Ja &&
window.console &&
(window.console.log(b + " --\x3e x: " + d.x + "; y:" + d.y),
e && window.console.log(a.which),
"mouseup" === b && window.console.log("mouseup")),
!e)
) {
if (!p.capturedEventParam && this._events) {
for (var g = 0; g < this._events.length; g++)
if (this._events[g].hasOwnProperty(b))
if (
((c = this._events[g]),
(e = c.bounds),
d.x >= e.x1 && d.x <= e.x2 && d.y >= e.y1 && d.y <= e.y2)
) {
c[b].call(c.context, d.x, d.y);
"mousedown" === b && !0 === c.capture
? ((p.capturedEventParam = c),
this.overlaidCanvas.setCapture
? this.overlaidCanvas.setCapture()
: document.documentElement.addEventListener(
"mouseup",
this._mouseEventHandler,
!1
))
: "mouseup" === b &&
(c.chart.overlaidCanvas.releaseCapture
? c.chart.overlaidCanvas.releaseCapture()
: document.documentElement.removeEventListener(
"mouseup",
this._mouseEventHandler,
!1
));
break;
} else c = null;
a.target.style.cursor =
c && c.cursor ? c.cursor : this._defaultCursor;
}
b = this.plotArea;
if (d.x < b.x1 || d.x > b.x2 || d.y < b.y1 || d.y > b.y2)
this.toolTip && this.toolTip.enabled
? this.toolTip.hide()
: this.resetOverlayedCanvas();
(this.isDrag && this.zoomEnabled) ||
!this._eventManager ||
this._eventManager.mouseEventHandler(a);
}
};
p.prototype._plotAreaMouseDown = function (a, d) {
this.isDrag = !0;
this.dragStartPoint = { x: a, y: d };
};
p.prototype._plotAreaMouseUp = function (a, d) {
if (
("normal" === this.plotInfo.axisPlacement ||
"xySwapped" === this.plotInfo.axisPlacement) &&
this.isDrag
) {
var b = d - this.dragStartPoint.y,
c = a - this.dragStartPoint.x,
e = 0 <= this.zoomType.indexOf("x"),
g = 0 <= this.zoomType.indexOf("y"),
m = !1;
this.resetOverlayedCanvas();
if ("xySwapped" === this.plotInfo.axisPlacement)
var l = g,
g = e,
e = l;
if (this.panEnabled || this.zoomEnabled) {
if (this.panEnabled)
for (e = g = 0; e < this._axes.length; e++)
(b = this._axes[e]),
b.logarithmic
? b.viewportMinimum < b.minimum
? ((g = b.minimum / b.viewportMinimum),
(b.sessionVariables.newViewportMinimum =
b.viewportMinimum * g),
(b.sessionVariables.newViewportMaximum =
b.viewportMaximum * g),
(m = !0))
: b.viewportMaximum > b.maximum &&
((g = b.viewportMaximum / b.maximum),
(b.sessionVariables.newViewportMinimum =
b.viewportMinimum / g),
(b.sessionVariables.newViewportMaximum =
b.viewportMaximum / g),
(m = !0))
: b.viewportMinimum < b.minimum
? ((g = b.minimum - b.viewportMinimum),
(b.sessionVariables.newViewportMinimum =
b.viewportMinimum + g),
(b.sessionVariables.newViewportMaximum =
b.viewportMaximum + g),
(m = !0))
: b.viewportMaximum > b.maximum &&
((g = b.viewportMaximum - b.maximum),
(b.sessionVariables.newViewportMinimum =
b.viewportMinimum - g),
(b.sessionVariables.newViewportMaximum =
b.viewportMaximum - g),
(m = !0));
else if (
(!e || 2 < Math.abs(c)) &&
(!g || 2 < Math.abs(b)) &&
this.zoomEnabled
) {
if (!this.dragStartPoint) return;
b = e ? this.dragStartPoint.x : this.plotArea.x1;
c = g ? this.dragStartPoint.y : this.plotArea.y1;
e = e ? a : this.plotArea.x2;
g = g ? d : this.plotArea.y2;
2 < Math.abs(b - e) &&
2 < Math.abs(c - g) &&
this._zoomPanToSelectedRegion(b, c, e, g) &&
(m = !0);
}
m &&
((this._ignoreNextEvent = !0),
this._dispatchRangeEvent("rangeChanging", "zoom"),
this.render(),
this._dispatchRangeEvent("rangeChanged", "zoom"),
m &&
this.zoomEnabled &&
"none" === this._zoomButton.style.display &&
(Qa(this._zoomButton, this._resetButton),
ua(this, this._zoomButton, "pan"),
ua(this, this._resetButton, "reset")));
}
}
this.isDrag = !1;
if ("none" !== this.plotInfo.axisPlacement) {
this.resetOverlayedCanvas();
if (this.axisX && 0 < this.axisX.length)
for (m = 0; m < this.axisX.length; m++)
this.axisX[m].crosshair &&
this.axisX[m].crosshair.enabled &&
this.axisX[m].renderCrosshair(a, d);
if (this.axisX2 && 0 < this.axisX2.length)
for (m = 0; m < this.axisX2.length; m++)
this.axisX2[m].crosshair &&
this.axisX2[m].crosshair.enabled &&
this.axisX2[m].renderCrosshair(a, d);
if (this.axisY && 0 < this.axisY.length)
for (m = 0; m < this.axisY.length; m++)
this.axisY[m].crosshair &&
this.axisY[m].crosshair.enabled &&
this.axisY[m].renderCrosshair(a, d);
if (this.axisY2 && 0 < this.axisY2.length)
for (m = 0; m < this.axisY2.length; m++)
this.axisY2[m].crosshair &&
this.axisY2[m].crosshair.enabled &&
this.axisY2[m].renderCrosshair(a, d);
}
};
p.prototype._plotAreaMouseMove = function (a, d) {
if (this.isDrag && "none" !== this.plotInfo.axisPlacement) {
var b = 0,
c = 0,
e = (b = null),
e = 0 <= this.zoomType.indexOf("x"),
g = 0 <= this.zoomType.indexOf("y"),
m = this;
"xySwapped" === this.plotInfo.axisPlacement &&
((b = g), (g = e), (e = b));
b = this.dragStartPoint.x - a;
c = this.dragStartPoint.y - d;
2 < Math.abs(b) &&
8 > Math.abs(b) &&
(this.panEnabled || this.zoomEnabled)
? this.toolTip.hide()
: this.panEnabled ||
this.zoomEnabled ||
this.toolTip.mouseMoveHandler(a, d);
if (
(!e || 2 < Math.abs(b) || !g || 2 < Math.abs(c)) &&
(this.panEnabled || this.zoomEnabled)
)
if (this.panEnabled)
(e = {
x1: e ? this.plotArea.x1 + b : this.plotArea.x1,
y1: g ? this.plotArea.y1 + c : this.plotArea.y1,
x2: e ? this.plotArea.x2 + b : this.plotArea.x2,
y2: g ? this.plotArea.y2 + c : this.plotArea.y2,
}),
clearTimeout(m._panTimerId),
(m._panTimerId = setTimeout(
(function (c, b, e, f) {
return function () {
m._zoomPanToSelectedRegion(c, b, e, f, !0) &&
(m._dispatchRangeEvent("rangeChanging", "pan"),
m.render(),
m._dispatchRangeEvent("rangeChanged", "pan"),
(m.dragStartPoint.x = a),
(m.dragStartPoint.y = d));
};
})(e.x1, e.y1, e.x2, e.y2),
0
));
else if (this.zoomEnabled) {
this.resetOverlayedCanvas();
b = this.overlaidCanvasCtx.globalAlpha;
this.overlaidCanvasCtx.fillStyle = "#A89896";
var c = e ? this.dragStartPoint.x : this.plotArea.x1,
l = g ? this.dragStartPoint.y : this.plotArea.y1,
w = e
? a - this.dragStartPoint.x
: this.plotArea.x2 - this.plotArea.x1,
h = g
? d - this.dragStartPoint.y
: this.plotArea.y2 - this.plotArea.y1;
this.validateRegion(
c,
l,
e ? a : this.plotArea.x2 - this.plotArea.x1,
g ? d : this.plotArea.y2 - this.plotArea.y1,
"xy" !== this.zoomType
).isValid &&
(this.resetOverlayedCanvas(),
(this.overlaidCanvasCtx.fillStyle = "#99B2B5"));
this.overlaidCanvasCtx.globalAlpha = 0.7;
this.overlaidCanvasCtx.fillRect(c, l, w, h);
this.overlaidCanvasCtx.globalAlpha = b;
}
} else if (
(this.toolTip.mouseMoveHandler(a, d),
"none" !== this.plotInfo.axisPlacement)
) {
if (this.axisX && 0 < this.axisX.length)
for (e = 0; e < this.axisX.length; e++)
this.axisX[e].crosshair &&
this.axisX[e].crosshair.enabled &&
this.axisX[e].renderCrosshair(a, d);
if (this.axisX2 && 0 < this.axisX2.length)
for (e = 0; e < this.axisX2.length; e++)
this.axisX2[e].crosshair &&
this.axisX2[e].crosshair.enabled &&
this.axisX2[e].renderCrosshair(a, d);
if (this.axisY && 0 < this.axisY.length)
for (e = 0; e < this.axisY.length; e++)
this.axisY[e].crosshair &&
this.axisY[e].crosshair.enabled &&
this.axisY[e].renderCrosshair(a, d);
if (this.axisY2 && 0 < this.axisY2.length)
for (e = 0; e < this.axisY2.length; e++)
this.axisY2[e].crosshair &&
this.axisY2[e].crosshair.enabled &&
this.axisY2[e].renderCrosshair(a, d);
}
};
p.prototype._zoomPanToSelectedRegion = function (a, d, b, c, e) {
a = this.validateRegion(a, d, b, c, e);
d = a.axesWithValidRange;
b = a.axesRanges;
if (a.isValid)
for (c = 0; c < d.length; c++)
(e = b[c]),
d[c].setViewPortRange(e.val1, e.val2),
this.syncCharts && this.syncCharts(e.val1, e.val2);
return a.isValid;
};
p.prototype.validateRegion = function (a, d, b, c, e) {
e = e || !1;
for (
var g = 0 <= this.zoomType.indexOf("x"),
m = 0 <= this.zoomType.indexOf("y"),
l = !1,
w = [],
h = [],
s = [],
q = 0;
q < this._axes.length;
q++
)
(("axisX" === this._axes[q].type && g) ||
("axisY" === this._axes[q].type && m)) &&
h.push(this._axes[q]);
for (m = 0; m < h.length; m++) {
var q = h[m],
g = !1,
n = q.convertPixelToValue({ x: a, y: d }),
f = q.convertPixelToValue({ x: b, y: c });
if (n > f)
var B = f,
f = n,
n = B;
if (q.scaleBreaks)
for (B = 0; !g && B < q.scaleBreaks._appliedBreaks.length; B++)
g =
q.scaleBreaks._appliedBreaks[B].startValue <= n &&
q.scaleBreaks._appliedBreaks[B].endValue >= f;
if (isFinite(q.dataInfo.minDiff))
if (
((B = q.getApparentDifference(n, f, null, !0)),
!(
g ||
(!(
this.panEnabled &&
q.scaleBreaks &&
q.scaleBreaks._appliedBreaks.length
) &&
((q.logarithmic && B < Math.pow(q.dataInfo.minDiff, 3)) ||
(!q.logarithmic && B < 3 * Math.abs(q.dataInfo.minDiff)))) ||
n < q.minimum ||
f > q.maximum
))
)
w.push(q), s.push({ val1: n, val2: f }), (l = !0);
else if (!e) {
l = !1;
break;
}
}
return { isValid: l, axesWithValidRange: w, axesRanges: s };
};
p.prototype.preparePlotArea = function () {
var a = this.plotArea;
!r && (0 < a.x1 || 0 < a.y1) && a.ctx.translate(a.x1, a.y1);
if (
(this.axisX[0] || this.axisX2[0]) &&
(this.axisY[0] || this.axisY2[0])
) {
var d = this.axisX[0]
? this.axisX[0].lineCoordinates
: this.axisX2[0].lineCoordinates;
if (this.axisY && 0 < this.axisY.length && this.axisY[0]) {
var b = this.axisY[0];
a.x1 = d.x1 < d.x2 ? d.x1 : b.lineCoordinates.x1;
a.y1 = d.y1 < b.lineCoordinates.y1 ? d.y1 : b.lineCoordinates.y1;
a.x2 = d.x2 > b.lineCoordinates.x2 ? d.x2 : b.lineCoordinates.x2;
a.y2 = d.y2 > d.y1 ? d.y2 : b.lineCoordinates.y2;
a.width = a.x2 - a.x1;
a.height = a.y2 - a.y1;
}
this.axisY2 &&
0 < this.axisY2.length &&
this.axisY2[0] &&
((b = this.axisY2[0]),
(a.x1 = d.x1 < d.x2 ? d.x1 : b.lineCoordinates.x1),
(a.y1 = d.y1 < b.lineCoordinates.y1 ? d.y1 : b.lineCoordinates.y1),
(a.x2 = d.x2 > b.lineCoordinates.x2 ? d.x2 : b.lineCoordinates.x2),
(a.y2 = d.y2 > d.y1 ? d.y2 : b.lineCoordinates.y2),
(a.width = a.x2 - a.x1),
(a.height = a.y2 - a.y1));
} else
(d = this.layoutManager.getFreeSpace()),
(a.x1 = d.x1),
(a.x2 = d.x2),
(a.y1 = d.y1),
(a.y2 = d.y2),
(a.width = d.width),
(a.height = d.height);
r ||
((a.canvas.width = a.width),
(a.canvas.height = a.height),
(a.canvas.style.left = a.x1 + "px"),
(a.canvas.style.top = a.y1 + "px"),
(0 < a.x1 || 0 < a.y1) && a.ctx.translate(-a.x1, -a.y1));
a.layoutManager = new Ga(a.x1, a.y1, a.x2, a.y2, 2);
};
p.prototype.renderIndexLabels = function (a) {
var d = a || this.plotArea.ctx,
b = this.plotArea,
c = 0,
e = 0,
g = 0,
m = 0,
l = (c = m = e = g = 0),
w = 0;
for (a = 0; a < this._indexLabels.length; a++) {
var h = this._indexLabels[a],
s = h.chartType.toLowerCase(),
q,
n,
l = na("indexLabelFontColor", h.dataPoint, h.dataSeries),
w = na("indexLabelFontSize", h.dataPoint, h.dataSeries);
q = na("indexLabelFontFamily", h.dataPoint, h.dataSeries);
n = na("indexLabelFontStyle", h.dataPoint, h.dataSeries);
var m = na("indexLabelFontWeight", h.dataPoint, h.dataSeries),
f = na("indexLabelBackgroundColor", h.dataPoint, h.dataSeries),
e = na("indexLabelMaxWidth", h.dataPoint, h.dataSeries),
g = na("indexLabelWrap", h.dataPoint, h.dataSeries),
B = na("indexLabelLineDashType", h.dataPoint, h.dataSeries),
k = na("indexLabelLineColor", h.dataPoint, h.dataSeries),
p = u(h.dataPoint.indexLabelLineThickness)
? u(h.dataSeries.options.indexLabelLineThickness)
? 0
: h.dataSeries.options.indexLabelLineThickness
: h.dataPoint.indexLabelLineThickness,
c =
0 < p
? Math.min(
10,
("normal" === this.plotInfo.axisPlacement
? this.plotArea.height
: this.plotArea.width) << 0
)
: 0,
t = { percent: null, total: null },
C = null;
if (
0 <= h.dataSeries.type.indexOf("stacked") ||
"pie" === h.dataSeries.type ||
"doughnut" === h.dataSeries.type
)
t = this.getPercentAndTotal(h.dataSeries, h.dataPoint);
if (h.dataSeries.indexLabelFormatter || h.dataPoint.indexLabelFormatter)
C = {
chart: this,
dataSeries: h.dataSeries,
dataPoint: h.dataPoint,
index: h.indexKeyword,
total: t.total,
percent: t.percent,
};
var x = h.dataPoint.indexLabelFormatter
? h.dataPoint.indexLabelFormatter(C)
: h.dataPoint.indexLabel
? this.replaceKeywordsWithValue(
h.dataPoint.indexLabel,
h.dataPoint,
h.dataSeries,
null,
h.indexKeyword
)
: h.dataSeries.indexLabelFormatter
? h.dataSeries.indexLabelFormatter(C)
: h.dataSeries.indexLabel
? this.replaceKeywordsWithValue(
h.dataSeries.indexLabel,
h.dataPoint,
h.dataSeries,
null,
h.indexKeyword
)
: null;
if (null !== x && "" !== x) {
var t = na("indexLabelPlacement", h.dataPoint, h.dataSeries),
C = na("indexLabelOrientation", h.dataPoint, h.dataSeries),
ma = h.direction,
y = h.dataSeries.axisX,
A = h.dataSeries.axisY,
v = !1,
f = new ka(d, {
x: 0,
y: 0,
maxWidth: e ? e : 0.5 * this.width,
maxHeight: g ? 5 * w : 1.5 * w,
angle: "horizontal" === C ? 0 : -90,
text: x,
padding: 0,
backgroundColor: f,
horizontalAlign: "left",
fontSize: w,
fontFamily: q,
fontWeight: m,
fontColor: l,
fontStyle: n,
textBaseline: "top",
});
f.measureText();
h.dataSeries.indexLabelMaxWidth = f.maxWidth;
if ("stackedarea100" === s) {
if (
h.point.x < b.x1 ||
h.point.x > b.x2 ||
h.point.y < b.y1 - 1 ||
h.point.y > b.y2 + 1
)
continue;
} else if ("rangearea" === s || "rangesplinearea" === s) {
if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum ||
Math.max.apply(null, h.dataPoint.y) < A.viewportMinimum ||
Math.min.apply(null, h.dataPoint.y) > A.viewportMaximum
)
continue;
} else if (
0 <= s.indexOf("line") ||
0 <= s.indexOf("area") ||
0 <= s.indexOf("bubble") ||
0 <= s.indexOf("scatter")
) {
if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum ||
h.dataPoint.y < A.viewportMinimum ||
h.dataPoint.y > A.viewportMaximum
)
continue;
} else if (
0 <= s.indexOf("column") ||
"waterfall" === s ||
("error" === s && !h.axisSwapped)
) {
if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum ||
h.bounds.y1 > b.y2 ||
h.bounds.y2 < b.y1
)
continue;
} else if (0 <= s.indexOf("bar") || "error" === s) {
if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum ||
h.bounds.x1 > b.x2 ||
h.bounds.x2 < b.x1
)
continue;
} else if ("candlestick" === s || "ohlc" === s) {
if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum ||
Math.max.apply(null, h.dataPoint.y) < A.viewportMinimum ||
Math.min.apply(null, h.dataPoint.y) > A.viewportMaximum
)
continue;
} else if (
h.dataPoint.x < y.viewportMinimum ||
h.dataPoint.x > y.viewportMaximum
)
continue;
e = m = 2;
"horizontal" === C
? ((l = f.width), (w = f.height))
: ((w = f.width), (l = f.height));
if ("normal" === this.plotInfo.axisPlacement) {
if (0 <= s.indexOf("line") || 0 <= s.indexOf("area"))
(t = "auto"), (m = 4);
else if (0 <= s.indexOf("stacked")) "auto" === t && (t = "inside");
else if ("bubble" === s || "scatter" === s) t = "inside";
q = h.point.x - l / 2;
"inside" !== t
? ((e = b.y1),
(g = b.y2),
0 < ma
? ((n = h.point.y - w - m - c),
n < e &&
((n =
"auto" === t
? Math.max(h.point.y, e) + m + c
: e + m + c),
(v = n + w > h.point.y)))
: ((n = h.point.y + m + c),
n > g - w - m - c &&
((n =
"auto" === t
? Math.min(h.point.y, g) - w - m - c
: g - w - m - c),
(v = n < h.point.y))))
: ((e = Math.max(h.bounds.y1, b.y1)),
(g = Math.min(h.bounds.y2, b.y2)),
(c =
0 <= s.indexOf("range") || "error" === s
? 0 < ma
? Math.max(h.bounds.y1, b.y1) + w / 2 + m
: Math.min(h.bounds.y2, b.y2) - w / 2 - m
: (Math.max(h.bounds.y1, b.y1) +
Math.min(h.bounds.y2, b.y2)) /
2),
0 < ma
? ((n = Math.max(h.point.y, c) - w / 2),
n < e &&
("bubble" === s || "scatter" === s) &&
(n = Math.max(h.point.y - w - m, b.y1 + m)))
: ((n = Math.min(h.point.y, c) - w / 2),
n > g - w - m &&
("bubble" === s || "scatter" === s) &&
(n = Math.min(h.point.y + m, b.y2 - w - m))),
(n = Math.min(n, g - w)));
} else
0 <= s.indexOf("line") ||
0 <= s.indexOf("area") ||
0 <= s.indexOf("scatter")
? ((t = "auto"), (e = 4))
: 0 <= s.indexOf("stacked")
? "auto" === t && (t = "inside")
: "bubble" === s && (t = "inside"),
(n = h.point.y - w / 2),
"inside" !== t
? ((m = b.x1),
(g = b.x2),
0 > ma
? ((q = h.point.x - l - e - c),
q < m &&
((q =
"auto" === t
? Math.max(h.point.x, m) + e + c
: m + e + c),
(v = q + l > h.point.x)))
: ((q = h.point.x + e + c),
q > g - l - e - c &&
((q =
"auto" === t
? Math.min(h.point.x, g) - l - e - c
: g - l - e - c),
(v = q < h.point.x))))
: ((m = Math.max(h.bounds.x1, b.x1)),
Math.min(h.bounds.x2, b.x2),
(c =
0 <= s.indexOf("range") || "error" === s
? 0 > ma
? Math.max(h.bounds.x1, b.x1) + l / 2 + e
: Math.min(h.bounds.x2, b.x2) - l / 2 - e
: (Math.max(h.bounds.x1, b.x1) +
Math.min(h.bounds.x2, b.x2)) /
2),
(q =
0 > ma
? Math.max(h.point.x, c) - l / 2
: Math.min(h.point.x, c) - l / 2),
(q = Math.max(q, m)));
"vertical" === C && (n += w);
f.x = q;
f.y = n;
f.render(!0);
p &&
"inside" !== t &&
((0 > s.indexOf("bar") &&
("error" !== s || !h.axisSwapped) &&
h.point.x > b.x1 &&
h.point.x < b.x2) ||
!v) &&
((0 > s.indexOf("column") &&
("error" !== s || h.axisSwapped) &&
h.point.y > b.y1 &&
h.point.y < b.y2) ||
!v) &&
((d.lineWidth = p),
(d.strokeStyle = k ? k : "gray"),
d.setLineDash && d.setLineDash(R(B, p)),
d.beginPath(),
d.moveTo(h.point.x, h.point.y),
0 <= s.indexOf("bar") || ("error" === s && h.axisSwapped)
? d.lineTo(
q + (0 < h.direction ? 0 : l),
n + ("horizontal" === C ? w : -w) / 2
)
: 0 <= s.indexOf("column") || ("error" === s && !h.axisSwapped)
? d.lineTo(
q + l / 2,
n +
((0 < h.direction ? w : -w) +
("horizontal" === C ? w : -w)) /
2
)
: d.lineTo(
q + l / 2,
n +
((n < h.point.y ? w : -w) + ("horizontal" === C ? w : -w)) /
2
),
d.stroke());
}
}
d = {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
startTimePercent: 0.7,
};
for (a = 0; a < this._indexLabels.length; a++)
(h = this._indexLabels[a]),
(f = na("indexLabelBackgroundColor", h.dataPoint, h.dataSeries)),
(h.dataSeries.indexLabelBackgroundColor = u(f)
? r
? "transparent"
: null
: f);
return d;
};
p.prototype.renderLine = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this._eventManager.ghostCtx;
b.save();
var e = this.plotArea;
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
for (var g = [], m, l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = a.dataSeriesIndexes[l],
h = this.data[w];
b.lineWidth = h.lineThickness;
var s = h.dataPoints,
q = "solid";
if (b.setLineDash) {
var n = R(h.nullDataLineDashType, h.lineThickness),
q = h.lineDashType,
f = R(q, h.lineThickness);
b.setLineDash(f);
}
var B = h.id;
this._eventManager.objectMap[B] = {
objectType: "dataSeries",
dataSeriesIndex: w,
};
B = N(B);
c.strokeStyle = B;
c.lineWidth = 0 < h.lineThickness ? Math.max(h.lineThickness, 4) : 0;
var B = h._colorSet,
k =
(B =
h.lineColor =
h.options.lineColor ? h.options.lineColor : B[0]);
b.strokeStyle = B;
var p = !0,
t = 0,
C,
x;
b.beginPath();
if (0 < s.length) {
for (var u = !1, t = 0; t < s.length; t++)
if (
((C = s[t].x.getTime ? s[t].x.getTime() : s[t].x),
!(
C < a.axisX.dataInfo.viewPortMin ||
(C > a.axisX.dataInfo.viewPortMax &&
(!h.connectNullData || !u))
))
)
if ("number" !== typeof s[t].y)
0 < t &&
!(h.connectNullData || u || p) &&
(b.stroke(), r && c.stroke()),
(u = !0);
else {
C = a.axisX.convertValueToPixel(C);
x = a.axisY.convertValueToPixel(s[t].y);
var y = h.dataPointIds[t];
this._eventManager.objectMap[y] = {
id: y,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: t,
x1: C,
y1: x,
};
p || u
? (!p && h.connectNullData
? (b.setLineDash &&
(h.options.nullDataLineDashType ||
(q === h.lineDashType &&
h.lineDashType !== h.nullDataLineDashType)) &&
(b.stroke(),
b.beginPath(),
b.moveTo(m.x, m.y),
(q = h.nullDataLineDashType),
b.setLineDash(n)),
b.lineTo(C, x),
r && c.lineTo(C, x))
: (b.beginPath(),
b.moveTo(C, x),
r && (c.beginPath(), c.moveTo(C, x))),
(u = p = !1))
: (b.lineTo(C, x),
r && c.lineTo(C, x),
0 == t % 500 &&
(b.stroke(),
b.beginPath(),
b.moveTo(C, x),
r && (c.stroke(), c.beginPath(), c.moveTo(C, x))));
m = { x: C, y: x };
t < s.length - 1 &&
(k !== (s[t].lineColor || B) ||
q !== (s[t].lineDashType || h.lineDashType)) &&
(b.stroke(),
b.beginPath(),
b.moveTo(C, x),
(k = s[t].lineColor || B),
(b.strokeStyle = k),
b.setLineDash &&
(s[t].lineDashType
? ((q = s[t].lineDashType),
b.setLineDash(R(q, h.lineThickness)))
: ((q = h.lineDashType), b.setLineDash(f))));
if (0 < s[t].markerSize || 0 < h.markerSize) {
var A = h.getMarkerProperties(t, C, x, b);
g.push(A);
y = N(y);
r &&
g.push({
x: C,
y: x,
ctx: c,
type: A.type,
size: A.size,
color: y,
borderColor: y,
borderThickness: A.borderThickness,
});
}
(s[t].indexLabel ||
h.indexLabel ||
s[t].indexLabelFormatter ||
h.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "line",
dataPoint: s[t],
dataSeries: h,
point: { x: C, y: x },
direction: 0 > s[t].y === a.axisY.reversed ? 1 : -1,
color: B,
});
}
b.stroke();
r && c.stroke();
}
}
ia.drawMarkers(g);
r &&
(d.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),
c.beginPath());
b.restore();
b.beginPath();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderStepLine = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this._eventManager.ghostCtx;
b.save();
var e = this.plotArea;
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
for (var g = [], m, l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = a.dataSeriesIndexes[l],
h = this.data[w];
b.lineWidth = h.lineThickness;
var s = h.dataPoints,
q = "solid";
if (b.setLineDash) {
var n = R(h.nullDataLineDashType, h.lineThickness),
q = h.lineDashType,
f = R(q, h.lineThickness);
b.setLineDash(f);
}
var B = h.id;
this._eventManager.objectMap[B] = {
objectType: "dataSeries",
dataSeriesIndex: w,
};
B = N(B);
c.strokeStyle = B;
c.lineWidth = 0 < h.lineThickness ? Math.max(h.lineThickness, 4) : 0;
var B = h._colorSet,
k =
(B =
h.lineColor =
h.options.lineColor ? h.options.lineColor : B[0]);
b.strokeStyle = B;
var p = !0,
t = 0,
C,
x;
b.beginPath();
if (0 < s.length) {
for (var u = !1, t = 0; t < s.length; t++)
if (
((C = s[t].getTime ? s[t].x.getTime() : s[t].x),
!(
C < a.axisX.dataInfo.viewPortMin ||
(C > a.axisX.dataInfo.viewPortMax &&
(!h.connectNullData || !u))
))
)
if ("number" !== typeof s[t].y)
0 < t &&
!(h.connectNullData || u || p) &&
(b.stroke(), r && c.stroke()),
(u = !0);
else {
var y = x;
C = a.axisX.convertValueToPixel(C);
x = a.axisY.convertValueToPixel(s[t].y);
var A = h.dataPointIds[t];
this._eventManager.objectMap[A] = {
id: A,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: t,
x1: C,
y1: x,
};
p || u
? (!p && h.connectNullData
? (b.setLineDash &&
(h.options.nullDataLineDashType ||
(q === h.lineDashType &&
h.lineDashType !== h.nullDataLineDashType)) &&
(b.stroke(),
b.beginPath(),
b.moveTo(m.x, m.y),
(q = h.nullDataLineDashType),
b.setLineDash(n)),
b.lineTo(C, y),
b.lineTo(C, x),
r && (c.lineTo(C, y), c.lineTo(C, x)))
: (b.beginPath(),
b.moveTo(C, x),
r && (c.beginPath(), c.moveTo(C, x))),
(u = p = !1))
: (b.lineTo(C, y),
r && c.lineTo(C, y),
b.lineTo(C, x),
r && c.lineTo(C, x),
0 == t % 500 &&
(b.stroke(),
b.beginPath(),
b.moveTo(C, x),
r && (c.stroke(), c.beginPath(), c.moveTo(C, x))));
m = { x: C, y: x };
t < s.length - 1 &&
(k !== (s[t].lineColor || B) ||
q !== (s[t].lineDashType || h.lineDashType)) &&
(b.stroke(),
b.beginPath(),
b.moveTo(C, x),
(k = s[t].lineColor || B),
(b.strokeStyle = k),
b.setLineDash &&
(s[t].lineDashType
? ((q = s[t].lineDashType),
b.setLineDash(R(q, h.lineThickness)))
: ((q = h.lineDashType), b.setLineDash(f))));
if (0 < s[t].markerSize || 0 < h.markerSize)
(y = h.getMarkerProperties(t, C, x, b)),
g.push(y),
(A = N(A)),
r &&
g.push({
x: C,
y: x,
ctx: c,
type: y.type,
size: y.size,
color: A,
borderColor: A,
borderThickness: y.borderThickness,
});
(s[t].indexLabel ||
h.indexLabel ||
s[t].indexLabelFormatter ||
h.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stepLine",
dataPoint: s[t],
dataSeries: h,
point: { x: C, y: x },
direction: 0 > s[t].y === a.axisY.reversed ? 1 : -1,
color: B,
});
}
b.stroke();
r && c.stroke();
}
}
ia.drawMarkers(g);
r &&
(d.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),
c.beginPath());
b.restore();
b.beginPath();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderSpline = function (a) {
function d(a) {
a = v(a, 2);
if (0 < a.length) {
c.beginPath();
r && e.beginPath();
c.moveTo(a[0].x, a[0].y);
a[0].newStrokeStyle && (c.strokeStyle = a[0].newStrokeStyle);
a[0].newLineDashArray && c.setLineDash(a[0].newLineDashArray);
r && e.moveTo(a[0].x, a[0].y);
for (var b = 0; b < a.length - 3; b += 3)
if (
(c.bezierCurveTo(
a[b + 1].x,
a[b + 1].y,
a[b + 2].x,
a[b + 2].y,
a[b + 3].x,
a[b + 3].y
),
r &&
e.bezierCurveTo(
a[b + 1].x,
a[b + 1].y,
a[b + 2].x,
a[b + 2].y,
a[b + 3].x,
a[b + 3].y
),
(0 < b && 0 === b % 3e3) ||
a[b + 3].newStrokeStyle ||
a[b + 3].newLineDashArray)
)
c.stroke(),
c.beginPath(),
c.moveTo(a[b + 3].x, a[b + 3].y),
a[b + 3].newStrokeStyle &&
(c.strokeStyle = a[b + 3].newStrokeStyle),
a[b + 3].newLineDashArray &&
c.setLineDash(a[b + 3].newLineDashArray),
r &&
(e.stroke(), e.beginPath(), e.moveTo(a[b + 3].x, a[b + 3].y));
c.stroke();
r && e.stroke();
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = 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 m = [], l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = a.dataSeriesIndexes[l],
h = this.data[w];
c.lineWidth = h.lineThickness;
var s = h.dataPoints,
q = "solid";
if (c.setLineDash) {
var n = R(h.nullDataLineDashType, h.lineThickness),
q = h.lineDashType,
f = R(q, h.lineThickness);
c.setLineDash(f);
}
var B = h.id;
this._eventManager.objectMap[B] = {
objectType: "dataSeries",
dataSeriesIndex: w,
};
B = N(B);
e.strokeStyle = B;
e.lineWidth = 0 < h.lineThickness ? Math.max(h.lineThickness, 4) : 0;
var B = h._colorSet,
k =
(B =
h.lineColor =
h.options.lineColor ? h.options.lineColor : B[0]);
c.strokeStyle = B;
var p = 0,
t,
u,
x = [];
c.beginPath();
if (0 < s.length)
for (u = !1, p = 0; p < s.length; p++)
if (
((t = s[p].getTime ? s[p].x.getTime() : s[p].x),
!(
t < a.axisX.dataInfo.viewPortMin ||
(t > a.axisX.dataInfo.viewPortMax &&
(!h.connectNullData || !u))
))
)
if ("number" !== typeof s[p].y)
0 < p &&
!u &&
(h.connectNullData
? c.setLineDash &&
0 < x.length &&
(h.options.nullDataLineDashType ||
!s[p - 1].lineDashType) &&
((x[x.length - 1].newLineDashArray = n),
(q = h.nullDataLineDashType))
: (d(x), (x = []))),
(u = !0);
else {
t = a.axisX.convertValueToPixel(t);
u = a.axisY.convertValueToPixel(s[p].y);
var ma = h.dataPointIds[p];
this._eventManager.objectMap[ma] = {
id: ma,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: p,
x1: t,
y1: u,
};
x[x.length] = { x: t, y: u };
p < s.length - 1 &&
(k !== (s[p].lineColor || B) ||
q !== (s[p].lineDashType || h.lineDashType)) &&
((k = s[p].lineColor || B),
(x[x.length - 1].newStrokeStyle = k),
c.setLineDash &&
(s[p].lineDashType
? ((q = s[p].lineDashType),
(x[x.length - 1].newLineDashArray = R(
q,
h.lineThickness
)))
: ((q = h.lineDashType),
(x[x.length - 1].newLineDashArray = f))));
if (0 < s[p].markerSize || 0 < h.markerSize) {
var y = h.getMarkerProperties(p, t, u, c);
m.push(y);
ma = N(ma);
r &&
m.push({
x: t,
y: u,
ctx: e,
type: y.type,
size: y.size,
color: ma,
borderColor: ma,
borderThickness: y.borderThickness,
});
}
(s[p].indexLabel ||
h.indexLabel ||
s[p].indexLabelFormatter ||
h.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "spline",
dataPoint: s[p],
dataSeries: h,
point: { x: t, y: u },
direction: 0 > s[p].y === a.axisY.reversed ? 1 : -1,
color: B,
});
u = !1;
}
d(x);
}
ia.drawMarkers(m);
r &&
(b.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),
e.beginPath());
c.restore();
c.beginPath();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderColumn = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
m,
l,
w,
h = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
g = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1,
s = 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,
q = a.axisX.dataInfo.minDiff;
isFinite(q) || (q = 0.3 * Math.abs(a.axisX.range));
q = this.dataPointWidth = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.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 &&
g > s &&
(g = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
s
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
s < g &&
(s = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
g
));
q < g && (q = g);
q > s && (q = s);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (s = 0; s < a.dataSeriesIndexes.length; s++) {
var n = a.dataSeriesIndexes[s],
f = this.data[n],
B = f.dataPoints;
if (0 < B.length)
for (
var p = 5 < q && f.bevelEnabled ? !0 : !1, g = 0;
g < B.length;
g++
)
if (
(B[g].getTime ? (w = B[g].x.getTime()) : (w = B[g].x),
!(
w < a.axisX.dataInfo.viewPortMin ||
w > a.axisX.dataInfo.viewPortMax
) && "number" === typeof B[g].y)
) {
m = a.axisX.convertValueToPixel(w);
l = a.axisY.convertValueToPixel(B[g].y);
m = a.axisX.reversed
? (m +
(a.plotType.totalDataSeries * q) / 2 -
(a.previousDataSeriesCount + s) * q) <<
0
: (m -
(a.plotType.totalDataSeries * q) / 2 +
(a.previousDataSeriesCount + s) * q) <<
0;
var k = a.axisX.reversed ? (m - q) << 0 : (m + q) << 0,
t;
0 <= B[g].y ? (t = h) : ((t = l), (l = h));
l > t && ((c = l), (l = t), (t = c));
c = B[g].color
? B[g].color
: f._colorSet[g % f._colorSet.length];
ea(
b,
m,
l,
k,
t,
c,
0,
null,
p && 0 <= B[g].y,
0 > B[g].y && p,
!1,
!1,
f.fillOpacity
);
c = f.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: m,
y1: l,
x2: k,
y2: t,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
m,
l,
k,
t,
c,
0,
null,
!1,
!1,
!1,
!1
);
(B[g].indexLabel ||
f.indexLabel ||
B[g].indexLabelFormatter ||
f.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "column",
dataPoint: B[g],
dataSeries: f,
point: {
x: m + (k - m) / 2,
y: 0 > B[g].y === a.axisY.reversed ? l : t,
},
direction: 0 > B[g].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: m,
y1: Math.min(l, t),
x2: k,
y2: Math.max(l, t),
},
color: c,
});
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.yScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
h < a.axisY.bounds.y1
? a.axisY.bounds.y1
: h > a.axisY.bounds.y2
? a.axisY.bounds.y2
: h,
};
}
};
p.prototype.renderStackedColumn = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
m = [],
l = [],
w = [],
h = 0,
s,
q,
n = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
h = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
s = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: (0.15 * this.width) << 0;
var f = a.axisX.dataInfo.minDiff;
isFinite(f) || (f = 0.3 * Math.abs(a.axisX.range));
f = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.width *
(a.axisX.logarithmic
? Math.log(f) / Math.log(a.axisX.range)
: Math.abs(f) / Math.abs(a.axisX.range))) /
a.plotType.plotUnits.length)) <<
0;
this.dataPointMaxWidth &&
h > s &&
(h = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
s
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
s < h &&
(s = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
h
));
f < h && (f = h);
f > s && (f = s);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var B = 0; B < a.dataSeriesIndexes.length; B++) {
var k = a.dataSeriesIndexes[B],
p = this.data[k],
t = p.dataPoints;
if (0 < t.length) {
var u = 5 < f && p.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (h = 0; h < t.length; h++)
if (
((c = t[h].x.getTime ? t[h].x.getTime() : t[h].x),
!(
c < a.axisX.dataInfo.viewPortMin ||
c > a.axisX.dataInfo.viewPortMax
) && "number" === typeof t[h].y)
) {
s = a.axisX.convertValueToPixel(c);
var x =
(s - (a.plotType.plotUnits.length * f) / 2 + a.index * f) <<
0,
v = (x + f) << 0,
y;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 < t[h].y)
)
(l[c] = t[h].y + (l[c] ? l[c] : 0)),
0 < l[c] &&
((q = a.axisY.convertValueToPixel(l[c])),
(y = "undefined" !== typeof g[c] ? g[c] : n),
(g[c] = q));
else if (
a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 >= t[h].y
)
(w[c] = t[h].y + (w[c] ? w[c] : 0)),
(y = a.axisY.convertValueToPixel(w[c])),
(q = "undefined" !== typeof m[c] ? m[c] : n),
(m[c] = y);
else if (
((q = a.axisY.convertValueToPixel(t[h].y)), 0 <= t[h].y)
) {
var A = "undefined" !== typeof g[c] ? g[c] : 0;
q -= A;
y = n - A;
g[c] = A + (y - q);
} else
(A = m[c] ? m[c] : 0),
(y = q + A),
(q = n + A),
(m[c] = A + (y - q));
c = t[h].color
? t[h].color
: p._colorSet[h % p._colorSet.length];
ea(
b,
x,
q,
v,
y,
c,
0,
null,
u && 0 <= t[h].y,
0 > t[h].y && u,
!1,
!1,
p.fillOpacity
);
c = p.dataPointIds[h];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: k,
dataPointIndex: h,
x1: x,
y1: q,
x2: v,
y2: y,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
x,
q,
v,
y,
c,
0,
null,
!1,
!1,
!1,
!1
);
(t[h].indexLabel ||
p.indexLabel ||
t[h].indexLabelFormatter ||
p.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedColumn",
dataPoint: t[h],
dataSeries: p,
point: { x: s, y: 0 <= t[h].y ? q : y },
direction: 0 > t[h].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: x,
y1: Math.min(q, y),
x2: v,
y2: Math.max(q, y),
},
color: c,
});
}
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.yScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
n < a.axisY.bounds.y1
? a.axisY.bounds.y1
: n > a.axisY.bounds.y2
? a.axisY.bounds.y2
: n,
};
}
};
p.prototype.renderStackedColumn100 = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
m = [],
l = [],
w = [],
h = 0,
s,
q,
n = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
h = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
s = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: (0.15 * this.width) << 0;
var f = a.axisX.dataInfo.minDiff;
isFinite(f) || (f = 0.3 * Math.abs(a.axisX.range));
f = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.width *
(a.axisX.logarithmic
? Math.log(f) / Math.log(a.axisX.range)
: Math.abs(f) / Math.abs(a.axisX.range))) /
a.plotType.plotUnits.length)) <<
0;
this.dataPointMaxWidth &&
h > s &&
(h = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
s
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
s < h &&
(s = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
h
));
f < h && (f = h);
f > s && (f = s);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var B = 0; B < a.dataSeriesIndexes.length; B++) {
var p = a.dataSeriesIndexes[B],
k = this.data[p],
t = k.dataPoints;
if (0 < t.length)
for (
var u = 5 < f && k.bevelEnabled ? !0 : !1, h = 0;
h < t.length;
h++
)
if (
((c = t[h].x.getTime ? t[h].x.getTime() : t[h].x),
!(
c < a.axisX.dataInfo.viewPortMin ||
c > a.axisX.dataInfo.viewPortMax
) && "number" === typeof t[h].y)
) {
s = a.axisX.convertValueToPixel(c);
q =
0 !== a.dataPointYSums[c]
? 100 * (t[h].y / a.dataPointYSums[c])
: 0;
var x =
(s - (a.plotType.plotUnits.length * f) / 2 + a.index * f) <<
0,
v = (x + f) << 0,
y;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 < t[h].y)
) {
l[c] = q + ("undefined" !== typeof l[c] ? l[c] : 0);
if (0 >= l[c]) continue;
q = a.axisY.convertValueToPixel(l[c]);
y = g[c] ? g[c] : n;
g[c] = q;
} else if (
a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 >= t[h].y
)
(w[c] = q + ("undefined" !== typeof w[c] ? w[c] : 0)),
(y = a.axisY.convertValueToPixel(w[c])),
(q = m[c] ? m[c] : n),
(m[c] = y);
else if (((q = a.axisY.convertValueToPixel(q)), 0 <= t[h].y)) {
var A = "undefined" !== typeof g[c] ? g[c] : 0;
q -= A;
y = n - A;
a.dataSeriesIndexes.length - 1 === B &&
1 >= Math.abs(e.y1 - q) &&
(q = e.y1);
g[c] = A + (y - q);
} else
(A = "undefined" !== typeof m[c] ? m[c] : 0),
(y = q + A),
(q = n + A),
a.dataSeriesIndexes.length - 1 === B &&
1 >= Math.abs(e.y2 - y) &&
(y = e.y2),
(m[c] = A + (y - q));
c = t[h].color
? t[h].color
: k._colorSet[h % k._colorSet.length];
ea(
b,
x,
q,
v,
y,
c,
0,
null,
u && 0 <= t[h].y,
0 > t[h].y && u,
!1,
!1,
k.fillOpacity
);
c = k.dataPointIds[h];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: p,
dataPointIndex: h,
x1: x,
y1: q,
x2: v,
y2: y,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
x,
q,
v,
y,
c,
0,
null,
!1,
!1,
!1,
!1
);
(t[h].indexLabel ||
k.indexLabel ||
t[h].indexLabelFormatter ||
k.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedColumn100",
dataPoint: t[h],
dataSeries: k,
point: { x: s, y: 0 <= t[h].y ? q : y },
direction: 0 > t[h].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: x,
y1: Math.min(q, y),
x2: v,
y2: Math.max(q, y),
},
color: c,
});
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.yScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
n < a.axisY.bounds.y1
? a.axisY.bounds.y1
: n > a.axisY.bounds.y2
? a.axisY.bounds.y2
: n,
};
}
};
p.prototype.renderBar = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
m,
l,
w,
h = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
g = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1,
s = 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,
q = a.axisX.dataInfo.minDiff;
isFinite(q) || (q = 0.3 * Math.abs(a.axisX.range));
q = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.height *
(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 &&
g > s &&
(g = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
s
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
s < g &&
(s = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
g
));
q < g && (q = g);
q > s && (q = s);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (s = 0; s < a.dataSeriesIndexes.length; s++) {
var n = a.dataSeriesIndexes[s],
f = this.data[n],
B = f.dataPoints;
if (0 < B.length) {
var k = 5 < q && f.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (g = 0; g < B.length; g++)
if (
(B[g].getTime ? (w = B[g].x.getTime()) : (w = B[g].x),
!(
w < a.axisX.dataInfo.viewPortMin ||
w > a.axisX.dataInfo.viewPortMax
) && "number" === typeof B[g].y)
) {
l = a.axisX.convertValueToPixel(w);
m = a.axisY.convertValueToPixel(B[g].y);
l = a.axisX.reversed
? (l +
(a.plotType.totalDataSeries * q) / 2 -
(a.previousDataSeriesCount + s) * q) <<
0
: (l -
(a.plotType.totalDataSeries * q) / 2 +
(a.previousDataSeriesCount + s) * q) <<
0;
var p = a.axisX.reversed ? (l - q) << 0 : (l + q) << 0,
t;
0 <= B[g].y ? (t = h) : ((t = m), (m = h));
c = B[g].color
? B[g].color
: f._colorSet[g % f._colorSet.length];
ea(b, t, l, m, p, c, 0, null, k, !1, !1, !1, f.fillOpacity);
c = f.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: t,
y1: l,
x2: m,
y2: p,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
t,
l,
m,
p,
c,
0,
null,
!1,
!1,
!1,
!1
);
(B[g].indexLabel ||
f.indexLabel ||
B[g].indexLabelFormatter ||
f.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "bar",
dataPoint: B[g],
dataSeries: f,
point: { x: 0 <= B[g].y ? m : t, y: l + (p - l) / 2 },
direction: 0 > B[g].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(t, m),
y1: l,
x2: Math.max(t, m),
y2: p,
},
color: c,
});
}
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.xScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
h < a.axisY.bounds.x1
? a.axisY.bounds.x1
: h > a.axisY.bounds.x2
? a.axisY.bounds.x2
: h,
};
}
};
p.prototype.renderStackedBar = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
m = [],
l = [],
w = [],
h = 0,
s,
q,
n = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
h = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
q = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: (0.15 * this.height) << 0;
var f = a.axisX.dataInfo.minDiff;
isFinite(f) || (f = 0.3 * Math.abs(a.axisX.range));
f = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.height *
(a.axisX.logarithmic
? Math.log(f) / Math.log(a.axisX.range)
: Math.abs(f) / Math.abs(a.axisX.range))) /
a.plotType.plotUnits.length)) <<
0;
this.dataPointMaxWidth &&
h > q &&
(h = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
q
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
q < h &&
(q = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
h
));
f < h && (f = h);
f > q && (f = q);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var B = 0; B < a.dataSeriesIndexes.length; B++) {
var p = a.dataSeriesIndexes[B],
k = this.data[p],
t = k.dataPoints;
if (0 < t.length) {
var u = 5 < f && k.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (h = 0; h < t.length; h++)
if (
((c = t[h].x.getTime ? t[h].x.getTime() : t[h].x),
!(
c < a.axisX.dataInfo.viewPortMin ||
c > a.axisX.dataInfo.viewPortMax
) && "number" === typeof t[h].y)
) {
q = a.axisX.convertValueToPixel(c);
var x =
(q - (a.plotType.plotUnits.length * f) / 2 + a.index * f) <<
0,
v = (x + f) << 0,
y;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 < t[h].y)
)
(l[c] = t[h].y + (l[c] ? l[c] : 0)),
0 < l[c] &&
((y = g[c] ? g[c] : n),
(g[c] = s = a.axisY.convertValueToPixel(l[c])));
else if (
a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 >= t[h].y
)
(w[c] = t[h].y + (w[c] ? w[c] : 0)),
(s = m[c] ? m[c] : n),
(m[c] = y = a.axisY.convertValueToPixel(w[c]));
else if (
((s = a.axisY.convertValueToPixel(t[h].y)), 0 <= t[h].y)
) {
var A = g[c] ? g[c] : 0;
y = n + A;
s += A;
g[c] = A + (s - y);
} else
(A = m[c] ? m[c] : 0),
(y = s - A),
(s = n - A),
(m[c] = A + (s - y));
c = t[h].color
? t[h].color
: k._colorSet[h % k._colorSet.length];
ea(b, y, x, s, v, c, 0, null, u, !1, !1, !1, k.fillOpacity);
c = k.dataPointIds[h];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: p,
dataPointIndex: h,
x1: y,
y1: x,
x2: s,
y2: v,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
y,
x,
s,
v,
c,
0,
null,
!1,
!1,
!1,
!1
);
(t[h].indexLabel ||
k.indexLabel ||
t[h].indexLabelFormatter ||
k.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedBar",
dataPoint: t[h],
dataSeries: k,
point: { x: 0 <= t[h].y ? s : y, y: q },
direction: 0 > t[h].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(y, s),
y1: x,
x2: Math.max(y, s),
y2: v,
},
color: c,
});
}
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.xScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
n < a.axisY.bounds.x1
? a.axisY.bounds.x1
: n > a.axisY.bounds.x2
? a.axisY.bounds.x2
: n,
};
}
};
p.prototype.renderStackedBar100 = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
m = [],
l = [],
w = [],
h = 0,
s,
q,
n = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
h = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
q = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: (0.15 * this.height) << 0;
var f = a.axisX.dataInfo.minDiff;
isFinite(f) || (f = 0.3 * Math.abs(a.axisX.range));
f = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.height *
(a.axisX.logarithmic
? Math.log(f) / Math.log(a.axisX.range)
: Math.abs(f) / Math.abs(a.axisX.range))) /
a.plotType.plotUnits.length)) <<
0;
this.dataPointMaxWidth &&
h > q &&
(h = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
q
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
q < h &&
(q = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
h
));
f < h && (f = h);
f > q && (f = q);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var B = 0; B < a.dataSeriesIndexes.length; B++) {
var k = a.dataSeriesIndexes[B],
p = this.data[k],
t = p.dataPoints;
if (0 < t.length) {
var u = 5 < f && p.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (h = 0; h < t.length; h++)
if (
((c = t[h].x.getTime ? t[h].x.getTime() : t[h].x),
!(
c < a.axisX.dataInfo.viewPortMin ||
c > a.axisX.dataInfo.viewPortMax
) && "number" === typeof t[h].y)
) {
q = a.axisX.convertValueToPixel(c);
var x;
x =
0 !== a.dataPointYSums[c]
? 100 * (t[h].y / a.dataPointYSums[c])
: 0;
var v =
(q - (a.plotType.plotUnits.length * f) / 2 + a.index * f) <<
0,
y = (v + f) << 0;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 < t[h].y)
) {
l[c] = x + (l[c] ? l[c] : 0);
if (0 >= l[c]) continue;
x = g[c] ? g[c] : n;
g[c] = s = a.axisY.convertValueToPixel(l[c]);
} else if (
a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length &&
0 >= t[h].y
)
(w[c] = x + (w[c] ? w[c] : 0)),
(s = m[c] ? m[c] : n),
(m[c] = x = a.axisY.convertValueToPixel(w[c]));
else if (((s = a.axisY.convertValueToPixel(x)), 0 <= t[h].y)) {
var A = g[c] ? g[c] : 0;
x = n + A;
s += A;
a.dataSeriesIndexes.length - 1 === B &&
1 >= Math.abs(e.x2 - s) &&
(s = e.x2);
g[c] = A + (s - x);
} else
(A = m[c] ? m[c] : 0),
(x = s - A),
(s = n - A),
a.dataSeriesIndexes.length - 1 === B &&
1 >= Math.abs(e.x1 - x) &&
(x = e.x1),
(m[c] = A + (s - x));
c = t[h].color
? t[h].color
: p._colorSet[h % p._colorSet.length];
ea(b, x, v, s, y, c, 0, null, u, !1, !1, !1, p.fillOpacity);
c = p.dataPointIds[h];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: k,
dataPointIndex: h,
x1: x,
y1: v,
x2: s,
y2: y,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
x,
v,
s,
y,
c,
0,
null,
!1,
!1,
!1,
!1
);
(t[h].indexLabel ||
p.indexLabel ||
t[h].indexLabelFormatter ||
p.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedBar100",
dataPoint: t[h],
dataSeries: p,
point: { x: 0 <= t[h].y ? s : x, y: q },
direction: 0 > t[h].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(x, s),
y1: v,
x2: Math.max(x, s),
y2: y,
},
color: c,
});
}
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.xScaleAnimation,
easingFunction: M.easing.easeOutQuart,
animationBase:
n < a.axisY.bounds.x1
? a.axisY.bounds.x1
: n > a.axisY.bounds.x2
? a.axisY.bounds.x2
: n,
};
}
};
p.prototype.renderArea = function (a) {
var d, b;
function c() {
A &&
(0 < B.lineThickness && g.stroke(),
a.axisY.logarithmic ||
(0 >= a.axisY.viewportMinimum && 0 <= a.axisY.viewportMaximum)
? (y = v)
: 0 > a.axisY.viewportMaximum
? (y = w.y1)
: 0 < a.axisY.viewportMinimum && (y = l.y2),
g.lineTo(t, y),
g.lineTo(A.x, y),
g.closePath(),
(g.globalAlpha = B.fillOpacity),
g.fill(),
(g.globalAlpha = 1),
r && (m.lineTo(t, y), m.lineTo(A.x, y), m.closePath(), m.fill()),
g.beginPath(),
g.moveTo(t, u),
m.beginPath(),
m.moveTo(t, u),
(A = { x: t, y: u }));
}
var e = a.targetCanvasCtx || this.plotArea.ctx,
g = r ? this._preRenderCtx : e;
if (!(0 >= a.dataSeriesIndexes.length)) {
var m = this._eventManager.ghostCtx,
l = a.axisX.lineCoordinates,
w = a.axisY.lineCoordinates,
h = [],
s = this.plotArea,
q;
g.save();
r && m.save();
g.beginPath();
g.rect(s.x1, s.y1, s.width, s.height);
g.clip();
r && (m.beginPath(), m.rect(s.x1, s.y1, s.width, s.height), m.clip());
for (var n = 0; n < a.dataSeriesIndexes.length; n++) {
var f = a.dataSeriesIndexes[n],
B = this.data[f],
p = B.dataPoints,
h = B.id;
this._eventManager.objectMap[h] = {
objectType: "dataSeries",
dataSeriesIndex: f,
};
h = N(h);
m.fillStyle = h;
h = [];
d = !0;
var k = 0,
t,
u,
x,
v = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
y,
A = null;
if (0 < p.length) {
var z = B._colorSet[k % B._colorSet.length],
aa = (B.lineColor = B.options.lineColor || z),
T = aa;
g.fillStyle = z;
g.strokeStyle = aa;
g.lineWidth = B.lineThickness;
b = "solid";
if (g.setLineDash) {
var Y = R(B.nullDataLineDashType, B.lineThickness);
b = B.lineDashType;
var ca = R(b, B.lineThickness);
g.setLineDash(ca);
}
for (var da = !0; k < p.length; k++)
if (
((x = p[k].x.getTime ? p[k].x.getTime() : p[k].x),
!(
x < a.axisX.dataInfo.viewPortMin ||
(x > a.axisX.dataInfo.viewPortMax &&
(!B.connectNullData || !da))
))
)
if ("number" !== typeof p[k].y)
B.connectNullData || da || d || c(), (da = !0);
else {
t = a.axisX.convertValueToPixel(x);
u = a.axisY.convertValueToPixel(p[k].y);
d || da
? (!d && B.connectNullData
? (g.setLineDash &&
(B.options.nullDataLineDashType ||
(b === B.lineDashType &&
B.lineDashType !== B.nullDataLineDashType)) &&
((d = t),
(b = u),
(t = q.x),
(u = q.y),
c(),
g.moveTo(q.x, q.y),
(t = d),
(u = b),
(A = q),
(b = B.nullDataLineDashType),
g.setLineDash(Y)),
g.lineTo(t, u),
r && m.lineTo(t, u))
: (g.beginPath(),
g.moveTo(t, u),
r && (m.beginPath(), m.moveTo(t, u)),
(A = { x: t, y: u })),
(da = d = !1))
: (g.lineTo(t, u),
r && m.lineTo(t, u),
0 == k % 250 && c());
q = { x: t, y: u };
k < p.length - 1 &&
(T !== (p[k].lineColor || aa) ||
b !== (p[k].lineDashType || B.lineDashType)) &&
(c(),
(T = p[k].lineColor || aa),
(g.strokeStyle = T),
g.setLineDash &&
(p[k].lineDashType
? ((b = p[k].lineDashType),
g.setLineDash(R(b, B.lineThickness)))
: ((b = B.lineDashType), g.setLineDash(ca))));
var Z = B.dataPointIds[k];
this._eventManager.objectMap[Z] = {
id: Z,
objectType: "dataPoint",
dataSeriesIndex: f,
dataPointIndex: k,
x1: t,
y1: u,
};
0 !== p[k].markerSize &&
(0 < p[k].markerSize || 0 < B.markerSize) &&
((x = B.getMarkerProperties(k, t, u, g)),
h.push(x),
(Z = N(Z)),
r &&
h.push({
x: t,
y: u,
ctx: m,
type: x.type,
size: x.size,
color: Z,
borderColor: Z,
borderThickness: x.borderThickness,
}));
(p[k].indexLabel ||
B.indexLabel ||
p[k].indexLabelFormatter ||
B.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "area",
dataPoint: p[k],
dataSeries: B,
point: { x: t, y: u },
direction: 0 > p[k].y === a.axisY.reversed ? 1 : -1,
color: z,
});
}
c();
ia.drawMarkers(h);
}
}
r &&
(e.drawImage(this._preRenderCanvas, 0, 0, this.width, this.height),
(g.globalCompositeOperation = "source-atop"),
a.axisX.maskCanvas &&
g.drawImage(a.axisX.maskCanvas, 0, 0, this.width, this.height),
a.axisY.maskCanvas &&
g.drawImage(a.axisY.maskCanvas, 0, 0, this.width, this.height),
this._breaksCanvasCtx &&
this._breaksCanvasCtx.drawImage(
this._preRenderCanvas,
0,
0,
this.width,
this.height
),
g.clearRect(s.x1, s.y1, s.width, s.height),
this._eventManager.ghostCtx.restore());
g.restore();
return {
source: e,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderSplineArea = function (a) {
function d() {
var b = v(x, 2);
if (0 < b.length) {
if (0 < q.lineThickness) {
c.beginPath();
c.moveTo(b[0].x, b[0].y);
b[0].newStrokeStyle && (c.strokeStyle = b[0].newStrokeStyle);
b[0].newLineDashArray && c.setLineDash(b[0].newLineDashArray);
for (var d = 0; d < b.length - 3; d += 3)
if (
(c.bezierCurveTo(
b[d + 1].x,
b[d + 1].y,
b[d + 2].x,
b[d + 2].y,
b[d + 3].x,
b[d + 3].y
),
r &&
e.bezierCurveTo(
b[d + 1].x,
b[d + 1].y,
b[d + 2].x,
b[d + 2].y,
b[d + 3].x,
b[d + 3].y
),
b[d + 3].newStrokeStyle || b[d + 3].newLineDashArray)
)
c.stroke(),
c.beginPath(),
c.moveTo(b[d + 3].x, b[d + 3].y),
b[d + 3].newStrokeStyle &&
(c.strokeStyle = b[d + 3].newStrokeStyle),
b[d + 3].newLineDashArray &&
c.setLineDash(b[d + 3].newLineDashArray);
c.stroke();
}
c.beginPath();
c.moveTo(b[0].x, b[0].y);
r && (e.beginPath(), e.moveTo(b[0].x, b[0].y));
for (d = 0; d < b.length - 3; d += 3)
c.bezierCurveTo(
b[d + 1].x,
b[d + 1].y,
b[d + 2].x,
b[d + 2].y,
b[d + 3].x,
b[d + 3].y
),
r &&
e.bezierCurveTo(
b[d + 1].x,
b[d + 1].y,
b[d + 2].x,
b[d + 2].y,
b[d + 3].x,
b[d + 3].y
);
a.axisY.logarithmic ||
(0 >= a.axisY.viewportMinimum && 0 <= a.axisY.viewportMaximum)
? (t = p)
: 0 > a.axisY.viewportMaximum
? (t = m.y1)
: 0 < a.axisY.viewportMinimum && (t = g.y2);
u = { x: b[0].x, y: b[0].y };
c.lineTo(b[b.length - 1].x, t);
c.lineTo(u.x, t);
c.closePath();
c.globalAlpha = q.fillOpacity;
c.fill();
c.globalAlpha = 1;
r &&
(e.lineTo(b[b.length - 1].x, t),
e.lineTo(u.x, t),
e.closePath(),
e.fill());
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = this._eventManager.ghostCtx,
g = a.axisX.lineCoordinates,
m = a.axisY.lineCoordinates,
l = [],
w = this.plotArea;
c.save();
r && e.save();
c.beginPath();
c.rect(w.x1, w.y1, w.width, w.height);
c.clip();
r && (e.beginPath(), e.rect(w.x1, w.y1, w.width, w.height), e.clip());
for (var h = 0; h < a.dataSeriesIndexes.length; h++) {
var s = a.dataSeriesIndexes[h],
q = this.data[s],
n = q.dataPoints,
l = q.id;
this._eventManager.objectMap[l] = {
objectType: "dataSeries",
dataSeriesIndex: s,
};
l = N(l);
e.fillStyle = l;
var l = [],
f = 0,
B,
k,
p = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
t,
u = null,
x = [];
if (0 < n.length) {
var ma = q._colorSet[f % q._colorSet.length],
y = (q.lineColor = q.options.lineColor || ma),
A = y;
c.fillStyle = ma;
c.strokeStyle = y;
c.lineWidth = q.lineThickness;
var z = "solid";
if (c.setLineDash) {
var aa = R(q.nullDataLineDashType, q.lineThickness),
z = q.lineDashType,
T = R(z, q.lineThickness);
c.setLineDash(T);
}
for (k = !1; f < n.length; f++)
if (
((B = n[f].x.getTime ? n[f].x.getTime() : n[f].x),
!(
B < a.axisX.dataInfo.viewPortMin ||
(B > a.axisX.dataInfo.viewPortMax &&
(!q.connectNullData || !k))
))
)
if ("number" !== typeof n[f].y)
0 < f &&
!k &&
(q.connectNullData
? c.setLineDash &&
0 < x.length &&
(q.options.nullDataLineDashType ||
!n[f - 1].lineDashType) &&
((x[x.length - 1].newLineDashArray = aa),
(z = q.nullDataLineDashType))
: (d(), (x = []))),
(k = !0);
else {
B = a.axisX.convertValueToPixel(B);
k = a.axisY.convertValueToPixel(n[f].y);
var Y = q.dataPointIds[f];
this._eventManager.objectMap[Y] = {
id: Y,
objectType: "dataPoint",
dataSeriesIndex: s,
dataPointIndex: f,
x1: B,
y1: k,
};
x[x.length] = { x: B, y: k };
f < n.length - 1 &&
(A !== (n[f].lineColor || y) ||
z !== (n[f].lineDashType || q.lineDashType)) &&
((A = n[f].lineColor || y),
(x[x.length - 1].newStrokeStyle = A),
c.setLineDash &&
(n[f].lineDashType
? ((z = n[f].lineDashType),
(x[x.length - 1].newLineDashArray = R(
z,
q.lineThickness
)))
: ((z = q.lineDashType),
(x[x.length - 1].newLineDashArray = T))));
if (
0 !== n[f].markerSize &&
(0 < n[f].markerSize || 0 < q.markerSize)
) {
var ca = q.getMarkerProperties(f, B, k, c);
l.push(ca);
Y = N(Y);
r &&
l.push({
x: B,
y: k,
ctx: e,
type: ca.type,
size: ca.size,
color: Y,
borderColor: Y,
borderThickness: ca.borderThickness,
});
}
(n[f].indexLabel ||
q.indexLabel ||
n[f].indexLabelFormatter ||
q.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "splineArea",
dataPoint: n[f],
dataSeries: q,
point: { x: B, y: k },
direction: 0 > n[f].y === a.axisY.reversed ? 1 : -1,
color: ma,
});
k = !1;
}
d();
ia.drawMarkers(l);
}
}
r &&
(b.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(w.x1, w.y1, w.width, w.height),
this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderStepArea = function (a) {
var d, b;
function c() {
A &&
(0 < B.lineThickness && g.stroke(),
a.axisY.logarithmic ||
(0 >= a.axisY.viewportMinimum && 0 <= a.axisY.viewportMaximum)
? (y = v)
: 0 > a.axisY.viewportMaximum
? (y = w.y1)
: 0 < a.axisY.viewportMinimum && (y = l.y2),
g.lineTo(t, y),
g.lineTo(A.x, y),
g.closePath(),
(g.globalAlpha = B.fillOpacity),
g.fill(),
(g.globalAlpha = 1),
r && (m.lineTo(t, y), m.lineTo(A.x, y), m.closePath(), m.fill()),
g.beginPath(),
g.moveTo(t, u),
m.beginPath(),
m.moveTo(t, u),
(A = { x: t, y: u }));
}
var e = a.targetCanvasCtx || this.plotArea.ctx,
g = r ? this._preRenderCtx : e;
if (!(0 >= a.dataSeriesIndexes.length)) {
var m = this._eventManager.ghostCtx,
l = a.axisX.lineCoordinates,
w = a.axisY.lineCoordinates,
h = [],
s = this.plotArea,
q;
g.save();
r && m.save();
g.beginPath();
g.rect(s.x1, s.y1, s.width, s.height);
g.clip();
r && (m.beginPath(), m.rect(s.x1, s.y1, s.width, s.height), m.clip());
for (var n = 0; n < a.dataSeriesIndexes.length; n++) {
var f = a.dataSeriesIndexes[n],
B = this.data[f],
k = B.dataPoints,
h = B.id;
this._eventManager.objectMap[h] = {
objectType: "dataSeries",
dataSeriesIndex: f,
};
h = N(h);
m.fillStyle = h;
h = [];
d = !0;
var p = 0,
t,
u,
x,
v = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
y,
A = null;
b = !1;
if (0 < k.length) {
var z = B._colorSet[p % B._colorSet.length],
aa = (B.lineColor = B.options.lineColor || z),
T = aa;
g.fillStyle = z;
g.strokeStyle = aa;
g.lineWidth = B.lineThickness;
var Y = "solid";
if (g.setLineDash) {
var ca = R(B.nullDataLineDashType, B.lineThickness),
Y = B.lineDashType,
da = R(Y, B.lineThickness);
g.setLineDash(da);
}
for (; p < k.length; p++)
if (
((x = k[p].x.getTime ? k[p].x.getTime() : k[p].x),
!(
x < a.axisX.dataInfo.viewPortMin ||
(x > a.axisX.dataInfo.viewPortMax &&
(!B.connectNullData || !b))
))
) {
var Z = u;
"number" !== typeof k[p].y
? (B.connectNullData || b || d || c(), (b = !0))
: ((t = a.axisX.convertValueToPixel(x)),
(u = a.axisY.convertValueToPixel(k[p].y)),
d || b
? (!d && B.connectNullData
? (g.setLineDash &&
(B.options.nullDataLineDashType ||
(Y === B.lineDashType &&
B.lineDashType !== B.nullDataLineDashType)) &&
((d = t),
(b = u),
(t = q.x),
(u = q.y),
c(),
g.moveTo(q.x, q.y),
(t = d),
(u = b),
(A = q),
(Y = B.nullDataLineDashType),
g.setLineDash(ca)),
g.lineTo(t, Z),
g.lineTo(t, u),
r && (m.lineTo(t, Z), m.lineTo(t, u)))
: (g.beginPath(),
g.moveTo(t, u),
r && (m.beginPath(), m.moveTo(t, u)),
(A = { x: t, y: u })),
(b = d = !1))
: (g.lineTo(t, Z),
r && m.lineTo(t, Z),
g.lineTo(t, u),
r && m.lineTo(t, u),
0 == p % 250 && c()),
(q = { x: t, y: u }),
p < k.length - 1 &&
(T !== (k[p].lineColor || aa) ||
Y !== (k[p].lineDashType || B.lineDashType)) &&
(c(),
(T = k[p].lineColor || aa),
(g.strokeStyle = T),
g.setLineDash &&
(k[p].lineDashType
? ((Y = k[p].lineDashType),
g.setLineDash(R(Y, B.lineThickness)))
: ((Y = B.lineDashType), g.setLineDash(da)))),
(x = B.dataPointIds[p]),
(this._eventManager.objectMap[x] = {
id: x,
objectType: "dataPoint",
dataSeriesIndex: f,
dataPointIndex: p,
x1: t,
y1: u,
}),
0 !== k[p].markerSize &&
(0 < k[p].markerSize || 0 < B.markerSize) &&
((Z = B.getMarkerProperties(p, t, u, g)),
h.push(Z),
(x = N(x)),
r &&
h.push({
x: t,
y: u,
ctx: m,
type: Z.type,
size: Z.size,
color: x,
borderColor: x,
borderThickness: Z.borderThickness,
})),
(k[p].indexLabel ||
B.indexLabel ||
k[p].indexLabelFormatter ||
B.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stepArea",
dataPoint: k[p],
dataSeries: B,
point: { x: t, y: u },
direction: 0 > k[p].y === a.axisY.reversed ? 1 : -1,
color: z,
}));
}
c();
ia.drawMarkers(h);
}
}
r &&
(e.drawImage(this._preRenderCanvas, 0, 0, this.width, this.height),
(g.globalCompositeOperation = "source-atop"),
a.axisX.maskCanvas &&
g.drawImage(a.axisX.maskCanvas, 0, 0, this.width, this.height),
a.axisY.maskCanvas &&
g.drawImage(a.axisY.maskCanvas, 0, 0, this.width, this.height),
this._breaksCanvasCtx &&
this._breaksCanvasCtx.drawImage(
this._preRenderCanvas,
0,
0,
this.width,
this.height
),
g.clearRect(s.x1, s.y1, s.width, s.height),
this._eventManager.ghostCtx.restore());
g.restore();
return {
source: e,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderStackedArea = function (a) {
function d() {
if (!(1 > h.length)) {
for (0 < A.lineThickness && c.stroke(); 0 < h.length; ) {
var a = h.pop();
c.lineTo(a.x, a.y);
r && u.lineTo(a.x, a.y);
}
c.closePath();
c.globalAlpha = A.fillOpacity;
c.fill();
c.globalAlpha = 1;
c.beginPath();
r && (u.closePath(), u.fill(), u.beginPath());
h = [];
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = null,
m = [],
l = this.plotArea,
w = [],
h = [],
s = [],
q = [],
n = 0,
f,
k,
p = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
u = this._eventManager.ghostCtx,
t,
C,
x;
r && u.beginPath();
c.save();
r && u.save();
c.beginPath();
c.rect(l.x1, l.y1, l.width, l.height);
c.clip();
r && (u.beginPath(), u.rect(l.x1, l.y1, l.width, l.height), u.clip());
for (var e = [], v = 0; v < a.dataSeriesIndexes.length; v++) {
var y = a.dataSeriesIndexes[v],
A = this.data[y],
z = A.dataPoints;
A.dataPointIndexes = [];
for (n = 0; n < z.length; n++)
(y = z[n].x.getTime ? z[n].x.getTime() : z[n].x),
(A.dataPointIndexes[y] = n),
e[y] || (s.push(y), (e[y] = !0));
s.sort(Sa);
}
for (v = 0; v < a.dataSeriesIndexes.length; v++) {
y = a.dataSeriesIndexes[v];
A = this.data[y];
z = A.dataPoints;
C = !0;
h = [];
n = A.id;
this._eventManager.objectMap[n] = {
objectType: "dataSeries",
dataSeriesIndex: y,
};
n = N(n);
u.fillStyle = n;
if (0 < s.length) {
var e = A._colorSet[0],
aa = (A.lineColor = A.options.lineColor || e),
T = aa;
c.fillStyle = e;
c.strokeStyle = aa;
c.lineWidth = A.lineThickness;
x = "solid";
if (c.setLineDash) {
var Y = R(A.nullDataLineDashType, A.lineThickness);
x = A.lineDashType;
var ca = R(x, A.lineThickness);
c.setLineDash(ca);
}
for (var da = !0, n = 0; n < s.length; n++) {
var g = s[n],
Z = null,
Z =
0 <= A.dataPointIndexes[g]
? z[A.dataPointIndexes[g]]
: { x: g, y: null };
if (
!(
g < a.axisX.dataInfo.viewPortMin ||
(g > a.axisX.dataInfo.viewPortMax &&
(!A.connectNullData || !da))
)
)
if ("number" !== typeof Z.y)
A.connectNullData || da || C || d(), (da = !0);
else {
f = a.axisX.convertValueToPixel(g);
var oa = w[g] ? w[g] : 0;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length)
) {
q[g] = Z.y + (q[g] ? q[g] : 0);
if (0 >= q[g] && a.axisY.logarithmic) continue;
k = a.axisY.convertValueToPixel(q[g]);
} else (k = a.axisY.convertValueToPixel(Z.y)), (k -= oa);
h.push({ x: f, y: p - oa });
w[g] = p - k;
C || da
? (!C && A.connectNullData
? (c.setLineDash &&
(A.options.nullDataLineDashType ||
(x === A.lineDashType &&
A.lineDashType !== A.nullDataLineDashType)) &&
((C = h.pop()),
(x = h[h.length - 1]),
d(),
c.moveTo(t.x, t.y),
h.push(x),
h.push(C),
(x = A.nullDataLineDashType),
c.setLineDash(Y)),
c.lineTo(f, k),
r && u.lineTo(f, k))
: (c.beginPath(),
c.moveTo(f, k),
r && (u.beginPath(), u.moveTo(f, k))),
(da = C = !1))
: (c.lineTo(f, k),
r && u.lineTo(f, k),
0 == n % 250 &&
(d(),
c.moveTo(f, k),
r && u.moveTo(f, k),
h.push({ x: f, y: p - oa })));
t = { x: f, y: k };
n < z.length - 1 &&
(T !== (z[n].lineColor || aa) ||
x !== (z[n].lineDashType || A.lineDashType)) &&
(d(),
c.beginPath(),
c.moveTo(f, k),
h.push({ x: f, y: p - oa }),
(T = z[n].lineColor || aa),
(c.strokeStyle = T),
c.setLineDash &&
(z[n].lineDashType
? ((x = z[n].lineDashType),
c.setLineDash(R(x, A.lineThickness)))
: ((x = A.lineDashType), c.setLineDash(ca))));
if (0 <= A.dataPointIndexes[g]) {
var la = A.dataPointIds[A.dataPointIndexes[g]];
this._eventManager.objectMap[la] = {
id: la,
objectType: "dataPoint",
dataSeriesIndex: y,
dataPointIndex: A.dataPointIndexes[g],
x1: f,
y1: k,
};
}
0 <= A.dataPointIndexes[g] &&
0 !== Z.markerSize &&
(0 < Z.markerSize || 0 < A.markerSize) &&
((oa = A.getMarkerProperties(
A.dataPointIndexes[g],
f,
k,
c
)),
m.push(oa),
(g = N(la)),
r &&
m.push({
x: f,
y: k,
ctx: u,
type: oa.type,
size: oa.size,
color: g,
borderColor: g,
borderThickness: oa.borderThickness,
}));
(Z.indexLabel ||
A.indexLabel ||
Z.indexLabelFormatter ||
A.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedArea",
dataPoint: Z,
dataSeries: A,
point: { x: f, y: k },
direction: 0 > z[n].y === a.axisY.reversed ? 1 : -1,
color: e,
});
}
}
d();
c.moveTo(f, k);
r && u.moveTo(f, k);
}
delete A.dataPointIndexes;
}
ia.drawMarkers(m);
r &&
(b.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(l.x1, l.y1, l.width, l.height),
u.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderStackedArea100 = function (a) {
function d() {
for (0 < A.lineThickness && c.stroke(); 0 < h.length; ) {
var a = h.pop();
c.lineTo(a.x, a.y);
r && x.lineTo(a.x, a.y);
}
c.closePath();
c.globalAlpha = A.fillOpacity;
c.fill();
c.globalAlpha = 1;
c.beginPath();
r && (x.closePath(), x.fill(), x.beginPath());
h = [];
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = null,
m = this.plotArea,
l = [],
w = [],
h = [],
s = [],
q = [],
n = 0,
f,
k,
p,
u,
t,
C = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? a.axisY.viewportMinimum : 0
),
x = this._eventManager.ghostCtx;
c.save();
r && x.save();
c.beginPath();
c.rect(m.x1, m.y1, m.width, m.height);
c.clip();
r && (x.beginPath(), x.rect(m.x1, m.y1, m.width, m.height), x.clip());
for (var e = [], v = 0; v < a.dataSeriesIndexes.length; v++) {
var y = a.dataSeriesIndexes[v],
A = this.data[y],
z = A.dataPoints;
A.dataPointIndexes = [];
for (n = 0; n < z.length; n++)
(y = z[n].x.getTime ? z[n].x.getTime() : z[n].x),
(A.dataPointIndexes[y] = n),
e[y] || (s.push(y), (e[y] = !0));
s.sort(Sa);
}
for (v = 0; v < a.dataSeriesIndexes.length; v++) {
y = a.dataSeriesIndexes[v];
A = this.data[y];
z = A.dataPoints;
u = !0;
e = A.id;
this._eventManager.objectMap[e] = {
objectType: "dataSeries",
dataSeriesIndex: y,
};
e = N(e);
x.fillStyle = e;
h = [];
if (0 < s.length) {
var e = A._colorSet[n % A._colorSet.length],
aa = (A.lineColor = A.options.lineColor || e),
T = aa;
c.fillStyle = e;
c.strokeStyle = aa;
c.lineWidth = A.lineThickness;
t = "solid";
if (c.setLineDash) {
var Y = R(A.nullDataLineDashType, A.lineThickness);
t = A.lineDashType;
var ca = R(t, A.lineThickness);
c.setLineDash(ca);
}
for (var da = !0, n = 0; n < s.length; n++) {
var g = s[n],
Z = null,
Z =
0 <= A.dataPointIndexes[g]
? z[A.dataPointIndexes[g]]
: { x: g, y: null };
if (
!(
g < a.axisX.dataInfo.viewPortMin ||
(g > a.axisX.dataInfo.viewPortMax &&
(!A.connectNullData || !da))
)
)
if ("number" !== typeof Z.y)
A.connectNullData || da || u || d(), (da = !0);
else {
var oa;
oa =
0 !== a.dataPointYSums[g]
? 100 * (Z.y / a.dataPointYSums[g])
: 0;
f = a.axisX.convertValueToPixel(g);
var la = w[g] ? w[g] : 0;
if (
a.axisY.logarithmic ||
(a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length)
) {
q[g] = oa + (q[g] ? q[g] : 0);
if (0 >= q[g] && a.axisY.logarithmic) continue;
k = a.axisY.convertValueToPixel(q[g]);
} else (k = a.axisY.convertValueToPixel(oa)), (k -= la);
h.push({ x: f, y: C - la });
w[g] = C - k;
u || da
? (!u && A.connectNullData
? (c.setLineDash &&
(A.options.nullDataLineDashType ||
(t === A.lineDashType &&
A.lineDashType !== A.nullDataLineDashType)) &&
((u = h.pop()),
(t = h[h.length - 1]),
d(),
c.moveTo(p.x, p.y),
h.push(t),
h.push(u),
(t = A.nullDataLineDashType),
c.setLineDash(Y)),
c.lineTo(f, k),
r && x.lineTo(f, k))
: (c.beginPath(),
c.moveTo(f, k),
r && (x.beginPath(), x.moveTo(f, k))),
(da = u = !1))
: (c.lineTo(f, k),
r && x.lineTo(f, k),
0 == n % 250 &&
(d(),
c.moveTo(f, k),
r && x.moveTo(f, k),
h.push({ x: f, y: C - la })));
p = { x: f, y: k };
n < z.length - 1 &&
(T !== (z[n].lineColor || aa) ||
t !== (z[n].lineDashType || A.lineDashType)) &&
(d(),
c.beginPath(),
c.moveTo(f, k),
h.push({ x: f, y: C - la }),
(T = z[n].lineColor || aa),
(c.strokeStyle = T),
c.setLineDash &&
(z[n].lineDashType
? ((t = z[n].lineDashType),
c.setLineDash(R(t, A.lineThickness)))
: ((t = A.lineDashType), c.setLineDash(ca))));
if (0 <= A.dataPointIndexes[g]) {
var G = A.dataPointIds[A.dataPointIndexes[g]];
this._eventManager.objectMap[G] = {
id: G,
objectType: "dataPoint",
dataSeriesIndex: y,
dataPointIndex: A.dataPointIndexes[g],
x1: f,
y1: k,
};
}
0 <= A.dataPointIndexes[g] &&
0 !== Z.markerSize &&
(0 < Z.markerSize || 0 < A.markerSize) &&
((la = A.getMarkerProperties(n, f, k, c)),
l.push(la),
(g = N(G)),
r &&
l.push({
x: f,
y: k,
ctx: x,
type: la.type,
size: la.size,
color: g,
borderColor: g,
borderThickness: la.borderThickness,
}));
(Z.indexLabel ||
A.indexLabel ||
Z.indexLabelFormatter ||
A.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "stackedArea100",
dataPoint: Z,
dataSeries: A,
point: { x: f, y: k },
direction: 0 > z[n].y === a.axisY.reversed ? 1 : -1,
color: e,
});
}
}
d();
c.moveTo(f, k);
r && x.moveTo(f, k);
}
delete A.dataPointIndexes;
}
ia.drawMarkers(l);
r &&
(b.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(m.x1, m.y1, m.width, m.height),
x.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderBubble = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this.plotArea,
e = 0,
g,
m;
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(c.x1, c.y1, c.width, c.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(c.x1, c.y1, c.width, c.height),
this._eventManager.ghostCtx.clip());
for (
var l = -Infinity, w = Infinity, h = 0;
h < a.dataSeriesIndexes.length;
h++
)
for (
var s = a.dataSeriesIndexes[h],
q = this.data[s],
n = q.dataPoints,
f = 0,
e = 0;
e < n.length;
e++
)
(g = n[e].getTime ? (g = n[e].x.getTime()) : (g = n[e].x)),
g < a.axisX.dataInfo.viewPortMin ||
g > a.axisX.dataInfo.viewPortMax ||
"undefined" === typeof n[e].z ||
((f = n[e].z), f > l && (l = f), f < w && (w = f));
for (
var k = 25 * Math.PI,
p = Math.max(
Math.pow((0.25 * Math.min(c.height, c.width)) / 2, 2) * Math.PI,
k
),
h = 0;
h < a.dataSeriesIndexes.length;
h++
)
if (
((s = a.dataSeriesIndexes[h]),
(q = this.data[s]),
(n = q.dataPoints),
0 < n.length)
)
for (b.strokeStyle = "#4572A7 ", e = 0; e < n.length; e++)
if (
((g = n[e].getTime ? (g = n[e].x.getTime()) : (g = n[e].x)),
!(
g < a.axisX.dataInfo.viewPortMin ||
g > a.axisX.dataInfo.viewPortMax
) && "number" === typeof n[e].y)
) {
g = a.axisX.convertValueToPixel(g);
m = a.axisY.convertValueToPixel(n[e].y);
var f = n[e].z,
u =
2 *
Math.max(
Math.sqrt(
(l === w ? p / 2 : k + ((p - k) / (l - w)) * (f - w)) /
Math.PI
) << 0,
1
),
f = q.getMarkerProperties(e, b);
f.size = u;
b.globalAlpha = q.fillOpacity;
ia.drawMarker(
g,
m,
b,
f.type,
f.size,
f.color,
f.borderColor,
f.borderThickness
);
b.globalAlpha = 1;
var t = q.dataPointIds[e];
this._eventManager.objectMap[t] = {
id: t,
objectType: "dataPoint",
dataSeriesIndex: s,
dataPointIndex: e,
x1: g,
y1: m,
size: u,
};
u = N(t);
r &&
ia.drawMarker(
g,
m,
this._eventManager.ghostCtx,
f.type,
f.size,
u,
u,
f.borderThickness
);
(n[e].indexLabel ||
q.indexLabel ||
n[e].indexLabelFormatter ||
q.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "bubble",
dataPoint: n[e],
dataSeries: q,
point: { x: g, y: m },
direction: 1,
bounds: {
x1: g - f.size / 2,
y1: m - f.size / 2,
x2: g + f.size / 2,
y2: m + f.size / 2,
},
color: null,
});
}
r &&
(d.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(c.x1, c.y1, c.width, c.height),
this._eventManager.ghostCtx.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderScatter = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this.plotArea,
e = 0,
g,
m;
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(c.x1, c.y1, c.width, c.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(c.x1, c.y1, c.width, c.height),
this._eventManager.ghostCtx.clip());
for (var l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = a.dataSeriesIndexes[l],
h = this.data[w],
s = h.dataPoints;
if (0 < s.length) {
b.strokeStyle = "#4572A7 ";
Math.pow((0.3 * Math.min(c.height, c.width)) / 2, 2);
for (var q = 0, n = 0, e = 0; e < s.length; e++)
if (
((g = s[e].getTime ? (g = s[e].x.getTime()) : (g = s[e].x)),
!(
g < a.axisX.dataInfo.viewPortMin ||
g > a.axisX.dataInfo.viewPortMax
) && "number" === typeof s[e].y)
) {
g = a.axisX.convertValueToPixel(g);
m = a.axisY.convertValueToPixel(s[e].y);
var f = h.getMarkerProperties(e, g, m, b);
b.globalAlpha = h.fillOpacity;
ia.drawMarker(
f.x,
f.y,
f.ctx,
f.type,
f.size,
f.color,
f.borderColor,
f.borderThickness
);
b.globalAlpha = 1;
(Math.sqrt((q - g) * (q - g) + (n - m) * (n - m)) <
Math.min(f.size, 5) &&
s.length >
Math.min(this.plotArea.width, this.plotArea.height)) ||
((q = h.dataPointIds[e]),
(this._eventManager.objectMap[q] = {
id: q,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: e,
x1: g,
y1: m,
}),
(q = N(q)),
r &&
ia.drawMarker(
f.x,
f.y,
this._eventManager.ghostCtx,
f.type,
f.size,
q,
q,
f.borderThickness
),
(s[e].indexLabel ||
h.indexLabel ||
s[e].indexLabelFormatter ||
h.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "scatter",
dataPoint: s[e],
dataSeries: h,
point: { x: g, y: m },
direction: 1,
bounds: {
x1: g - f.size / 2,
y1: m - f.size / 2,
x2: g + f.size / 2,
y2: m + f.size / 2,
},
color: null,
}),
(q = g),
(n = m));
}
}
}
r &&
(d.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(c.x1, c.y1, c.width, c.height),
this._eventManager.ghostCtx.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderCandlestick = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d,
c = this._eventManager.ghostCtx;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = null,
m = this.plotArea,
l = 0,
w,
h,
s,
q,
n,
f,
e = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1,
g = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 0.015 * this.width,
k = a.axisX.dataInfo.minDiff;
isFinite(k) || (k = 0.3 * Math.abs(a.axisX.range));
k = this.options.dataPointWidth
? this.dataPointWidth
: (0.7 *
m.width *
(a.axisX.logarithmic
? Math.log(k) / Math.log(a.axisX.range)
: Math.abs(k) / Math.abs(a.axisX.range))) <<
0;
this.dataPointMaxWidth &&
e > g &&
(e = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
g
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
g < e &&
(g = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
e
));
k < e && (k = e);
k > g && (k = g);
b.save();
r && c.save();
b.beginPath();
b.rect(m.x1, m.y1, m.width, m.height);
b.clip();
r && (c.beginPath(), c.rect(m.x1, m.y1, m.width, m.height), c.clip());
for (var p = 0; p < a.dataSeriesIndexes.length; p++) {
var v = a.dataSeriesIndexes[p],
t = this.data[v],
C = t.dataPoints;
if (0 < C.length)
for (
var x = 5 < k && t.bevelEnabled ? !0 : !1, l = 0;
l < C.length;
l++
)
if (
(C[l].getTime ? (f = C[l].x.getTime()) : (f = C[l].x),
!(
f < a.axisX.dataInfo.viewPortMin ||
f > a.axisX.dataInfo.viewPortMax
) &&
!u(C[l].y) &&
C[l].y.length &&
"number" === typeof C[l].y[0] &&
"number" === typeof C[l].y[1] &&
"number" === typeof C[l].y[2] &&
"number" === typeof C[l].y[3])
) {
w = a.axisX.convertValueToPixel(f);
h = a.axisY.convertValueToPixel(C[l].y[0]);
s = a.axisY.convertValueToPixel(C[l].y[1]);
q = a.axisY.convertValueToPixel(C[l].y[2]);
n = a.axisY.convertValueToPixel(C[l].y[3]);
var z = (w - k / 2) << 0,
y = (z + k) << 0,
g = t.options.fallingColor ? t.fallingColor : t._colorSet[0],
e = C[l].color ? C[l].color : t._colorSet[0],
A = Math.round(Math.max(1, 0.15 * k)),
D = 0 === A % 2 ? 0 : 0.5,
aa = t.dataPointIds[l];
this._eventManager.objectMap[aa] = {
id: aa,
objectType: "dataPoint",
dataSeriesIndex: v,
dataPointIndex: l,
x1: z,
y1: h,
x2: y,
y2: s,
x3: w,
y3: q,
x4: w,
y4: n,
borderThickness: A,
color: e,
};
b.strokeStyle = e;
b.beginPath();
b.lineWidth = A;
c.lineWidth = Math.max(A, 4);
"candlestick" === t.type
? (b.moveTo(w - D, s),
b.lineTo(w - D, Math.min(h, n)),
b.stroke(),
b.moveTo(w - D, Math.max(h, n)),
b.lineTo(w - D, q),
b.stroke(),
ea(
b,
z,
Math.min(h, n),
y,
Math.max(h, n),
C[l].y[0] <= C[l].y[3] ? t.risingColor : g,
A,
e,
x,
x,
!1,
!1,
t.fillOpacity
),
r &&
((e = N(aa)),
(c.strokeStyle = e),
c.moveTo(w - D, s),
c.lineTo(w - D, Math.min(h, n)),
c.stroke(),
c.moveTo(w - D, Math.max(h, n)),
c.lineTo(w - D, q),
c.stroke(),
ea(
c,
z,
Math.min(h, n),
y,
Math.max(h, n),
e,
0,
null,
!1,
!1,
!1,
!1
)))
: "ohlc" === t.type &&
(b.moveTo(w - D, s),
b.lineTo(w - D, q),
b.stroke(),
b.beginPath(),
b.moveTo(w, h),
b.lineTo(z, h),
b.stroke(),
b.beginPath(),
b.moveTo(w, n),
b.lineTo(y, n),
b.stroke(),
r &&
((e = N(aa)),
(c.strokeStyle = e),
c.moveTo(w - D, s),
c.lineTo(w - D, q),
c.stroke(),
c.beginPath(),
c.moveTo(w, h),
c.lineTo(z, h),
c.stroke(),
c.beginPath(),
c.moveTo(w, n),
c.lineTo(y, n),
c.stroke()));
(C[l].indexLabel ||
t.indexLabel ||
C[l].indexLabelFormatter ||
t.indexLabelFormatter) &&
this._indexLabels.push({
chartType: t.type,
dataPoint: C[l],
dataSeries: t,
point: { x: z + (y - z) / 2, y: a.axisY.reversed ? q : s },
direction: 1,
bounds: {
x1: z,
y1: Math.min(s, q),
x2: y,
y2: Math.max(s, q),
},
color: e,
});
}
}
r &&
(d.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(m.x1, m.y1, m.width, m.height),
c.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderBoxAndWhisker = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d,
c = this._eventManager.ghostCtx;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = this.plotArea,
m = 0,
l,
w,
h,
s,
q,
n,
f,
e = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1,
m = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 0.015 * this.width,
k = a.axisX.dataInfo.minDiff;
isFinite(k) || (k = 0.3 * Math.abs(a.axisX.range));
k = this.options.dataPointWidth
? this.dataPointWidth
: (0.7 *
g.width *
(a.axisX.logarithmic
? Math.log(k) / Math.log(a.axisX.range)
: Math.abs(k) / Math.abs(a.axisX.range))) <<
0;
this.dataPointMaxWidth &&
e > m &&
(e = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
m
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
m < e &&
(m = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
e
));
k < e && (k = e);
k > m && (k = m);
b.save();
r && c.save();
b.beginPath();
b.rect(g.x1, g.y1, g.width, g.height);
b.clip();
r && (c.beginPath(), c.rect(g.x1, g.y1, g.width, g.height), c.clip());
for (
var p = !1, p = !!a.axisY.reversed, v = 0;
v < a.dataSeriesIndexes.length;
v++
) {
var t = a.dataSeriesIndexes[v],
C = this.data[t],
x = C.dataPoints;
if (0 < x.length)
for (
var z = 5 < k && C.bevelEnabled ? !0 : !1, m = 0;
m < x.length;
m++
)
if (
(x[m].getTime ? (f = x[m].x.getTime()) : (f = x[m].x),
!(
f < a.axisX.dataInfo.viewPortMin ||
f > a.axisX.dataInfo.viewPortMax
) &&
!u(x[m].y) &&
x[m].y.length &&
"number" === typeof x[m].y[0] &&
"number" === typeof x[m].y[1] &&
"number" === typeof x[m].y[2] &&
"number" === typeof x[m].y[3] &&
"number" === typeof x[m].y[4] &&
5 === x[m].y.length)
) {
l = a.axisX.convertValueToPixel(f);
w = a.axisY.convertValueToPixel(x[m].y[0]);
h = a.axisY.convertValueToPixel(x[m].y[1]);
s = a.axisY.convertValueToPixel(x[m].y[2]);
q = a.axisY.convertValueToPixel(x[m].y[3]);
n = a.axisY.convertValueToPixel(x[m].y[4]);
var y = (l - k / 2) << 0,
A = (l + k / 2) << 0,
e = x[m].color ? x[m].color : C._colorSet[0],
D = Math.round(Math.max(1, 0.15 * k)),
aa = 0 === D % 2 ? 0 : 0.5,
T = x[m].whiskerColor
? x[m].whiskerColor
: x[m].color
? C.whiskerColor
? C.whiskerColor
: x[m].color
: C.whiskerColor
? C.whiskerColor
: e,
Y =
"number" === typeof x[m].whiskerThickness
? x[m].whiskerThickness
: "number" === typeof C.options.whiskerThickness
? C.whiskerThickness
: D,
ca = x[m].whiskerDashType
? x[m].whiskerDashType
: C.whiskerDashType,
da = u(x[m].whiskerLength)
? u(C.options.whiskerLength)
? k
: C.whiskerLength
: x[m].whiskerLength,
da =
"number" === typeof da
? 0 >= da
? 0
: da >= k
? k
: da
: "string" === typeof da
? (parseInt(da) * k) / 100 > k
? k
: (parseInt(da) * k) / 100
: k,
Z = 1 === Math.round(Y) % 2 ? 0.5 : 0,
oa = x[m].stemColor
? x[m].stemColor
: x[m].color
? C.stemColor
? C.stemColor
: x[m].color
: C.stemColor
? C.stemColor
: e,
la =
"number" === typeof x[m].stemThickness
? x[m].stemThickness
: "number" === typeof C.options.stemThickness
? C.stemThickness
: D,
G = 1 === Math.round(la) % 2 ? 0.5 : 0,
F = x[m].stemDashType ? x[m].stemDashType : C.stemDashType,
E = x[m].lineColor
? x[m].lineColor
: x[m].color
? C.lineColor
? C.lineColor
: x[m].color
: C.lineColor
? C.lineColor
: e,
H =
"number" === typeof x[m].lineThickness
? x[m].lineThickness
: "number" === typeof C.options.lineThickness
? C.lineThickness
: D,
I = x[m].lineDashType ? x[m].lineDashType : C.lineDashType,
K = 1 === Math.round(H) % 2 ? 0.5 : 0,
L = C.upperBoxColor,
O = C.lowerBoxColor,
Q = u(C.options.fillOpacity) ? 1 : C.fillOpacity,
P = C.dataPointIds[m];
this._eventManager.objectMap[P] = {
id: P,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: m,
x1: y,
y1: w,
x2: A,
y2: h,
x3: l,
y3: s,
x4: l,
y4: q,
y5: n,
borderThickness: D,
color: e,
stemThickness: la,
stemColor: oa,
whiskerThickness: Y,
whiskerLength: da,
whiskerColor: T,
lineThickness: H,
lineColor: E,
};
b.save();
0 < la &&
(b.beginPath(),
(b.strokeStyle = oa),
(b.lineWidth = la),
b.setLineDash && b.setLineDash(R(F, la)),
b.moveTo(l - G, h),
b.lineTo(l - G, w),
b.stroke(),
b.moveTo(l - G, q),
b.lineTo(l - G, s),
b.stroke());
b.restore();
c.lineWidth = Math.max(D, 4);
b.beginPath();
ea(
b,
y,
Math.min(n, h),
A,
Math.max(h, n),
O,
0,
e,
p ? z : !1,
p ? !1 : z,
!1,
!1,
Q
);
b.beginPath();
ea(
b,
y,
Math.min(s, n),
A,
Math.max(n, s),
L,
0,
e,
p ? !1 : z,
p ? z : !1,
!1,
!1,
Q
);
b.beginPath();
b.lineWidth = D;
b.strokeStyle = e;
b.rect(
y - aa,
Math.min(h, s) - aa,
A - y + 2 * aa,
Math.max(h, s) - Math.min(h, s) + 2 * aa
);
b.stroke();
b.save();
0 < H &&
(b.beginPath(),
(b.globalAlpha = 1),
b.setLineDash && b.setLineDash(R(I, H)),
(b.strokeStyle = E),
(b.lineWidth = H),
b.moveTo(y, n - K),
b.lineTo(A, n - K),
b.stroke());
b.restore();
b.save();
0 < Y &&
(b.beginPath(),
b.setLineDash && b.setLineDash(R(ca, Y)),
(b.strokeStyle = T),
(b.lineWidth = Y),
b.moveTo((l - da / 2) << 0, q - Z),
b.lineTo((l + da / 2) << 0, q - Z),
b.stroke(),
b.moveTo((l - da / 2) << 0, w + Z),
b.lineTo((l + da / 2) << 0, w + Z),
b.stroke());
b.restore();
r &&
((e = N(P)),
(c.strokeStyle = e),
(c.lineWidth = la),
0 < la &&
(c.moveTo(l - aa - G, h),
c.lineTo(l - aa - G, Math.max(w, q)),
c.stroke(),
c.moveTo(l - aa - G, Math.min(w, q)),
c.lineTo(l - aa - G, s),
c.stroke()),
ea(
c,
y,
Math.max(h, s),
A,
Math.min(h, s),
e,
0,
null,
!1,
!1,
!1,
!1
),
0 < Y &&
(c.beginPath(),
(c.lineWidth = Y),
c.moveTo(l + da / 2, q - Z),
c.lineTo(l - da / 2, q - Z),
c.stroke(),
c.moveTo(l + da / 2, w + Z),
c.lineTo(l - da / 2, w + Z),
c.stroke()));
(x[m].indexLabel ||
C.indexLabel ||
x[m].indexLabelFormatter ||
C.indexLabelFormatter) &&
this._indexLabels.push({
chartType: C.type,
dataPoint: x[m],
dataSeries: C,
point: { x: y + (A - y) / 2, y: a.axisY.reversed ? w : q },
direction: 1,
bounds: {
x1: y,
y1: Math.min(w, q),
x2: A,
y2: Math.max(w, q),
},
color: e,
});
}
}
r &&
(d.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(g.x1, g.y1, g.width, g.height),
c.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderRangeColumn = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
m,
l,
w,
g = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
m = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 0.03 * this.width;
var h = a.axisX.dataInfo.minDiff;
isFinite(h) || (h = 0.3 * Math.abs(a.axisX.range));
h = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.width *
(a.axisX.logarithmic
? Math.log(h) / Math.log(a.axisX.range)
: Math.abs(h) / Math.abs(a.axisX.range))) /
a.plotType.totalDataSeries)) <<
0;
this.dataPointMaxWidth &&
g > m &&
(g = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
m
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
m < g &&
(m = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
g
));
h < g && (h = g);
h > m && (h = m);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var s = 0; s < a.dataSeriesIndexes.length; s++) {
var q = a.dataSeriesIndexes[s],
n = this.data[q],
f = n.dataPoints;
if (0 < f.length)
for (
var k = 5 < h && n.bevelEnabled ? !0 : !1, g = 0;
g < f.length;
g++
)
if (
(f[g].getTime ? (w = f[g].x.getTime()) : (w = f[g].x),
!(
w < a.axisX.dataInfo.viewPortMin ||
w > a.axisX.dataInfo.viewPortMax
) &&
!u(f[g].y) &&
f[g].y.length &&
"number" === typeof f[g].y[0] &&
"number" === typeof f[g].y[1])
) {
c = a.axisX.convertValueToPixel(w);
m = a.axisY.convertValueToPixel(f[g].y[0]);
l = a.axisY.convertValueToPixel(f[g].y[1]);
var p = a.axisX.reversed
? (c +
(a.plotType.totalDataSeries * h) / 2 -
(a.previousDataSeriesCount + s) * h) <<
0
: (c -
(a.plotType.totalDataSeries * h) / 2 +
(a.previousDataSeriesCount + s) * h) <<
0,
v = a.axisX.reversed ? (p - h) << 0 : (p + h) << 0,
c = f[g].color
? f[g].color
: n._colorSet[g % n._colorSet.length];
if (m > l) {
var t = m;
m = l;
l = t;
}
t = n.dataPointIds[g];
this._eventManager.objectMap[t] = {
id: t,
objectType: "dataPoint",
dataSeriesIndex: q,
dataPointIndex: g,
x1: p,
y1: m,
x2: v,
y2: l,
};
ea(b, p, m, v, l, c, 0, c, k, k, !1, !1, n.fillOpacity);
c = N(t);
r &&
ea(
this._eventManager.ghostCtx,
p,
m,
v,
l,
c,
0,
null,
!1,
!1,
!1,
!1
);
if (
f[g].indexLabel ||
n.indexLabel ||
f[g].indexLabelFormatter ||
n.indexLabelFormatter
)
this._indexLabels.push({
chartType: "rangeColumn",
dataPoint: f[g],
dataSeries: n,
indexKeyword: 0,
point: {
x: p + (v - p) / 2,
y: f[g].y[1] >= f[g].y[0] ? l : m,
},
direction: f[g].y[1] >= f[g].y[0] ? -1 : 1,
bounds: {
x1: p,
y1: Math.min(m, l),
x2: v,
y2: Math.max(m, l),
},
color: c,
}),
this._indexLabels.push({
chartType: "rangeColumn",
dataPoint: f[g],
dataSeries: n,
indexKeyword: 1,
point: {
x: p + (v - p) / 2,
y: f[g].y[1] >= f[g].y[0] ? m : l,
},
direction: f[g].y[1] >= f[g].y[0] ? 1 : -1,
bounds: {
x1: p,
y1: Math.min(m, l),
x2: v,
y2: Math.max(m, l),
},
color: c,
});
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderError = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d,
c = a.axisY._position
? "left" === a.axisY._position || "right" === a.axisY._position
? !1
: !0
: !1;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = !1,
m = this.plotArea,
l = 0,
w,
h,
s,
q,
n,
f,
k,
p = a.axisX.dataInfo.minDiff;
isFinite(p) || (p = 0.3 * Math.abs(a.axisX.range));
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(m.x1, m.y1, m.width, m.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(m.x1, m.y1, m.width, m.height),
this._eventManager.ghostCtx.clip());
for (var v = 0, t = 0; t < this.data.length; t++)
!this.data[t].type.match(/(bar|column)/gi) ||
!this.data[t].visible ||
(this.data[t].type.match(/(stacked)/gi) && v) ||
v++;
for (var C = 0; C < a.dataSeriesIndexes.length; C++) {
var x = a.dataSeriesIndexes[C],
z = this.data[x],
y = z.dataPoints,
A = u(z._linkedSeries)
? !1
: z._linkedSeries.type.match(/(bar|column)/gi) &&
z._linkedSeries.visible
? !0
: !1,
D = 0;
if (A)
for (e = z._linkedSeries.id, t = 0; t < e; t++)
!this.data[t].type.match(/(bar|column)/gi) ||
!this.data[t].visible ||
(this.data[t].type.match(/(stacked)/gi) && D) ||
(this.data[t].type.match(/(range)/gi) && (g = !0), D++);
e = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
l = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: c
? Math.min(
0.15 * this.height,
0.9 * (this.plotArea.height / (A ? v : 1))
) << 0
: 0.3 * this.width;
g &&
(l = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: c
? Math.min(
0.15 * this.height,
0.9 * (this.plotArea.height / (A ? v : 1))
) << 0
: 0.03 * this.width);
t = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
(((c ? m.height : m.width) *
(a.axisX.logarithmic
? Math.log(p) / Math.log(a.axisX.range)
: Math.abs(p) / Math.abs(a.axisX.range))) /
(A ? v : 1))) <<
0;
this.dataPointMaxWidth &&
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
));
t < e && (t = e);
t > l && (t = l);
if (0 < y.length)
for (var aa = z._colorSet, l = 0; l < y.length; l++) {
var e = (z.lineColor = z.options.color ? z.options.color : aa[0]),
T = {
color: y[l].whiskerColor
? y[l].whiskerColor
: y[l].color
? z.whiskerColor
? z.whiskerColor
: y[l].color
: z.whiskerColor
? z.whiskerColor
: e,
thickness: u(y[l].whiskerThickness)
? z.whiskerThickness
: y[l].whiskerThickness,
dashType: y[l].whiskerDashType
? y[l].whiskerDashType
: z.whiskerDashType,
length: u(y[l].whiskerLength)
? u(z.options.whiskerLength)
? t
: z.options.whiskerLength
: y[l].whiskerLength,
trimLength: u(y[l].whiskerLength)
? u(z.options.whiskerLength)
? 50
: 0
: 0,
};
T.length =
"number" === typeof T.length
? 0 >= T.length
? 0
: T.length >= t
? t
: T.length
: "string" === typeof T.length
? (parseInt(T.length) * t) / 100 > t
? t
: (parseInt(T.length) * t) / 100 > t
: t;
T.thickness =
"number" === typeof T.thickness
? 0 > T.thickness
? 0
: Math.round(T.thickness)
: 2;
var Y = {
color: y[l].stemColor
? y[l].stemColor
: y[l].color
? z.stemColor
? z.stemColor
: y[l].color
: z.stemColor
? z.stemColor
: e,
thickness: y[l].stemThickness
? y[l].stemThickness
: z.stemThickness,
dashType: y[l].stemDashType
? y[l].stemDashType
: z.stemDashType,
};
Y.thickness =
"number" === typeof Y.thickness
? 0 > Y.thickness
? 0
: Math.round(Y.thickness)
: 2;
y[l].getTime ? (k = y[l].x.getTime()) : (k = y[l].x);
if (
!(
k < a.axisX.dataInfo.viewPortMin ||
k > a.axisX.dataInfo.viewPortMax
) &&
!u(y[l].y) &&
y[l].y.length &&
"number" === typeof y[l].y[0] &&
"number" === typeof y[l].y[1]
) {
var ca = a.axisX.convertValueToPixel(k);
c ? (h = ca) : (w = ca);
ca = a.axisY.convertValueToPixel(y[l].y[0]);
c ? (s = ca) : (n = ca);
ca = a.axisY.convertValueToPixel(y[l].y[1]);
c ? (q = ca) : (f = ca);
c
? ((n = a.axisX.reversed
? (h + ((A ? v : 1) * t) / 2 - (A ? D - 1 : 0) * t) << 0
: (h - ((A ? v : 1) * t) / 2 + (A ? D - 1 : 0) * t) << 0),
(f = a.axisX.reversed ? (n - t) << 0 : (n + t) << 0))
: ((s = a.axisX.reversed
? (w + ((A ? v : 1) * t) / 2 - (A ? D - 1 : 0) * t) << 0
: (w - ((A ? v : 1) * t) / 2 + (A ? D - 1 : 0) * t) << 0),
(q = a.axisX.reversed ? (s - t) << 0 : (s + t) << 0));
!c && n > f && ((ca = n), (n = f), (f = ca));
c && s > q && ((ca = s), (s = q), (q = ca));
ca = z.dataPointIds[l];
this._eventManager.objectMap[ca] = {
id: ca,
objectType: "dataPoint",
dataSeriesIndex: x,
dataPointIndex: l,
x1: Math.min(s, q),
y1: Math.min(n, f),
x2: Math.max(q, s),
y2: Math.max(f, n),
isXYSwapped: c,
stemProperties: Y,
whiskerProperties: T,
};
E(
b,
Math.min(s, q),
Math.min(n, f),
Math.max(q, s),
Math.max(f, n),
e,
T,
Y,
c
);
r && E(this._eventManager.ghostCtx, s, n, q, f, e, T, Y, c);
if (
y[l].indexLabel ||
z.indexLabel ||
y[l].indexLabelFormatter ||
z.indexLabelFormatter
)
this._indexLabels.push({
chartType: "error",
dataPoint: y[l],
dataSeries: z,
indexKeyword: 0,
point: {
x: c ? (y[l].y[1] >= y[l].y[0] ? s : q) : s + (q - s) / 2,
y: c ? n + (f - n) / 2 : y[l].y[1] >= y[l].y[0] ? f : n,
},
direction: y[l].y[1] >= y[l].y[0] ? -1 : 1,
bounds: {
x1: c ? Math.min(s, q) : s,
y1: c ? n : Math.min(n, f),
x2: c ? Math.max(s, q) : q,
y2: c ? f : Math.max(n, f),
},
color: e,
axisSwapped: c,
}),
this._indexLabels.push({
chartType: "error",
dataPoint: y[l],
dataSeries: z,
indexKeyword: 1,
point: {
x: c
? y[l].y[1] >= y[l].y[0]
? q
: s
: s + (q - s) / 2,
y: c ? n + (f - n) / 2 : y[l].y[1] >= y[l].y[0] ? n : f,
},
direction: y[l].y[1] >= y[l].y[0] ? 1 : -1,
bounds: {
x1: c ? Math.min(s, q) : s,
y1: c ? n : Math.min(n, f),
x2: c ? Math.max(s, q) : q,
y2: c ? f : Math.max(n, f),
},
color: e,
axisSwapped: c,
});
}
}
}
r &&
(d.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(m.x1, m.y1, m.width, m.height),
this._eventManager.ghostCtx.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderRangeBar = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
m,
l,
w,
h,
g = this.options.dataPointMinWidth
? this.dataPointMinWidth
: this.options.dataPointWidth
? this.dataPointWidth
: 1;
m = this.options.dataPointMaxWidth
? this.dataPointMaxWidth
: this.options.dataPointWidth
? this.dataPointWidth
: Math.min(
0.15 * this.height,
0.9 * (this.plotArea.height / a.plotType.totalDataSeries)
) << 0;
var s = a.axisX.dataInfo.minDiff;
isFinite(s) || (s = 0.3 * Math.abs(a.axisX.range));
s = this.options.dataPointWidth
? this.dataPointWidth
: (0.9 *
((e.height *
(a.axisX.logarithmic
? Math.log(s) / Math.log(a.axisX.range)
: Math.abs(s) / Math.abs(a.axisX.range))) /
a.plotType.totalDataSeries)) <<
0;
this.dataPointMaxWidth &&
g > m &&
(g = Math.min(
this.options.dataPointWidth ? this.dataPointWidth : Infinity,
m
));
!this.dataPointMaxWidth &&
this.dataPointMinWidth &&
m < g &&
(m = Math.max(
this.options.dataPointWidth ? this.dataPointWidth : -Infinity,
g
));
s < g && (s = g);
s > m && (s = m);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var q = 0; q < a.dataSeriesIndexes.length; q++) {
var n = a.dataSeriesIndexes[q],
f = this.data[n],
k = f.dataPoints;
if (0 < k.length) {
var p = 5 < s && f.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (g = 0; g < k.length; g++)
if (
(k[g].getTime ? (h = k[g].x.getTime()) : (h = k[g].x),
!(
h < a.axisX.dataInfo.viewPortMin ||
h > a.axisX.dataInfo.viewPortMax
) &&
!u(k[g].y) &&
k[g].y.length &&
"number" === typeof k[g].y[0] &&
"number" === typeof k[g].y[1])
) {
m = a.axisY.convertValueToPixel(k[g].y[0]);
l = a.axisY.convertValueToPixel(k[g].y[1]);
w = a.axisX.convertValueToPixel(h);
w = a.axisX.reversed
? (w +
(a.plotType.totalDataSeries * s) / 2 -
(a.previousDataSeriesCount + q) * s) <<
0
: (w -
(a.plotType.totalDataSeries * s) / 2 +
(a.previousDataSeriesCount + q) * s) <<
0;
var v = a.axisX.reversed ? (w - s) << 0 : (w + s) << 0;
m > l && ((c = m), (m = l), (l = c));
c = k[g].color
? k[g].color
: f._colorSet[g % f._colorSet.length];
ea(b, m, w, l, v, c, 0, null, p, !1, !1, !1, f.fillOpacity);
c = f.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: m,
y1: w,
x2: l,
y2: v,
};
c = N(c);
r &&
ea(
this._eventManager.ghostCtx,
m,
w,
l,
v,
c,
0,
null,
!1,
!1,
!1,
!1
);
if (
k[g].indexLabel ||
f.indexLabel ||
k[g].indexLabelFormatter ||
f.indexLabelFormatter
)
this._indexLabels.push({
chartType: "rangeBar",
dataPoint: k[g],
dataSeries: f,
indexKeyword: 0,
point: {
x: k[g].y[1] >= k[g].y[0] ? m : l,
y: w + (v - w) / 2,
},
direction: k[g].y[1] >= k[g].y[0] ? -1 : 1,
bounds: {
x1: Math.min(m, l),
y1: w,
x2: Math.max(m, l),
y2: v,
},
color: c,
}),
this._indexLabels.push({
chartType: "rangeBar",
dataPoint: k[g],
dataSeries: f,
indexKeyword: 1,
point: {
x: k[g].y[1] >= k[g].y[0] ? l : m,
y: w + (v - w) / 2,
},
direction: k[g].y[1] >= k[g].y[0] ? 1 : -1,
bounds: {
x1: Math.min(m, l),
y1: w,
x2: Math.max(m, l),
y2: v,
},
color: c,
});
}
}
}
r &&
(d.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());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
p.prototype.renderRangeArea = function (a) {
function d() {
if (C) {
var a = null;
0 < s.lineThickness && c.stroke();
for (var b = w.length - 1; 0 <= b; b--)
(a = w[b]), c.lineTo(a.x, a.y), e.lineTo(a.x, a.y);
c.closePath();
c.globalAlpha = s.fillOpacity;
c.fill();
c.globalAlpha = 1;
e.fill();
if (0 < s.lineThickness) {
c.beginPath();
c.moveTo(a.x, a.y);
for (b = 0; b < w.length; b++) (a = w[b]), c.lineTo(a.x, a.y);
c.stroke();
}
c.beginPath();
c.moveTo(k, p);
e.beginPath();
e.moveTo(k, p);
C = { x: k, y: p };
w = [];
w.push({ x: k, y: u });
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = this._eventManager.ghostCtx,
g = [],
m = this.plotArea;
c.save();
r && e.save();
c.beginPath();
c.rect(m.x1, m.y1, m.width, m.height);
c.clip();
r && (e.beginPath(), e.rect(m.x1, m.y1, m.width, m.height), e.clip());
for (var l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = [],
h = a.dataSeriesIndexes[l],
s = this.data[h],
q = s.dataPoints,
g = s.id;
this._eventManager.objectMap[g] = {
objectType: "dataSeries",
dataSeriesIndex: h,
};
g = N(g);
e.fillStyle = g;
var g = [],
n = !0,
f = 0,
k,
p,
u,
t,
C = null;
if (0 < q.length) {
var x = s._colorSet[f % s._colorSet.length],
v = (s.lineColor = s.options.lineColor || x),
y = v;
c.fillStyle = x;
c.strokeStyle = v;
c.lineWidth = s.lineThickness;
var A = "solid";
if (c.setLineDash) {
var z = R(s.nullDataLineDashType, s.lineThickness),
A = s.lineDashType,
D = R(A, s.lineThickness);
c.setLineDash(D);
}
for (var T = !0; f < q.length; f++)
if (
((t = q[f].x.getTime ? q[f].x.getTime() : q[f].x),
!(
t < a.axisX.dataInfo.viewPortMin ||
(t > a.axisX.dataInfo.viewPortMax &&
(!s.connectNullData || !T))
))
)
if (
null !== q[f].y &&
q[f].y.length &&
"number" === typeof q[f].y[0] &&
"number" === typeof q[f].y[1]
) {
k = a.axisX.convertValueToPixel(t);
p = a.axisY.convertValueToPixel(q[f].y[0]);
u = a.axisY.convertValueToPixel(q[f].y[1]);
n || T
? (s.connectNullData && !n
? (c.setLineDash &&
(s.options.nullDataLineDashType ||
(A === s.lineDashType &&
s.lineDashType !== s.nullDataLineDashType)) &&
((w[w.length - 1].newLineDashArray = D),
(A = s.nullDataLineDashType),
c.setLineDash(z)),
c.lineTo(k, p),
r && e.lineTo(k, p),
w.push({ x: k, y: u }))
: (c.beginPath(),
c.moveTo(k, p),
(C = { x: k, y: p }),
(w = []),
w.push({ x: k, y: u }),
r && (e.beginPath(), e.moveTo(k, p))),
(T = n = !1))
: (c.lineTo(k, p),
w.push({ x: k, y: u }),
r && e.lineTo(k, p),
0 == f % 250 && d());
t = s.dataPointIds[f];
this._eventManager.objectMap[t] = {
id: t,
objectType: "dataPoint",
dataSeriesIndex: h,
dataPointIndex: f,
x1: k,
y1: p,
y2: u,
};
f < q.length - 1 &&
(y !== (q[f].lineColor || v) ||
A !== (q[f].lineDashType || s.lineDashType)) &&
(d(),
(y = q[f].lineColor || v),
(w[w.length - 1].newStrokeStyle = y),
(c.strokeStyle = y),
c.setLineDash &&
(q[f].lineDashType
? ((A = q[f].lineDashType),
(w[w.length - 1].newLineDashArray = R(
A,
s.lineThickness
)),
c.setLineDash(w[w.length - 1].newLineDashArray))
: ((A = s.lineDashType),
(w[w.length - 1].newLineDashArray = D),
c.setLineDash(D))));
if (
0 !== q[f].markerSize &&
(0 < q[f].markerSize || 0 < s.markerSize)
) {
var Y = s.getMarkerProperties(f, k, u, c);
g.push(Y);
var ca = N(t);
r &&
g.push({
x: k,
y: u,
ctx: e,
type: Y.type,
size: Y.size,
color: ca,
borderColor: ca,
borderThickness: Y.borderThickness,
});
Y = s.getMarkerProperties(f, k, p, c);
g.push(Y);
ca = N(t);
r &&
g.push({
x: k,
y: p,
ctx: e,
type: Y.type,
size: Y.size,
color: ca,
borderColor: ca,
borderThickness: Y.borderThickness,
});
}
if (
q[f].indexLabel ||
s.indexLabel ||
q[f].indexLabelFormatter ||
s.indexLabelFormatter
)
this._indexLabels.push({
chartType: "rangeArea",
dataPoint: q[f],
dataSeries: s,
indexKeyword: 0,
point: { x: k, y: p },
direction:
q[f].y[0] > q[f].y[1] === a.axisY.reversed ? -1 : 1,
color: x,
}),
this._indexLabels.push({
chartType: "rangeArea",
dataPoint: q[f],
dataSeries: s,
indexKeyword: 1,
point: { x: k, y: u },
direction:
q[f].y[0] > q[f].y[1] === a.axisY.reversed ? 1 : -1,
color: x,
});
} else T || n || d(), (T = !0);
d();
ia.drawMarkers(g);
}
}
r &&
(b.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(m.x1, m.y1, m.width, m.height),
this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderRangeSplineArea = function (a) {
function d(a, b) {
var d = v(u, 2);
if (0 < d.length) {
if (0 < h.lineThickness) {
c.strokeStyle = b;
c.setLineDash && c.setLineDash(a);
c.beginPath();
c.moveTo(d[0].x, d[0].y);
for (var f = 0; f < d.length - 3; f += 3) {
if (d[f].newStrokeStyle || d[f].newLineDashArray)
c.stroke(),
c.beginPath(),
c.moveTo(d[f].x, d[f].y),
d[f].newStrokeStyle && (c.strokeStyle = d[f].newStrokeStyle),
d[f].newLineDashArray && c.setLineDash(d[f].newLineDashArray);
c.bezierCurveTo(
d[f + 1].x,
d[f + 1].y,
d[f + 2].x,
d[f + 2].y,
d[f + 3].x,
d[f + 3].y
);
}
c.stroke();
}
c.beginPath();
c.moveTo(d[0].x, d[0].y);
r && (e.beginPath(), e.moveTo(d[0].x, d[0].y));
for (f = 0; f < d.length - 3; f += 3)
c.bezierCurveTo(
d[f + 1].x,
d[f + 1].y,
d[f + 2].x,
d[f + 2].y,
d[f + 3].x,
d[f + 3].y
),
r &&
e.bezierCurveTo(
d[f + 1].x,
d[f + 1].y,
d[f + 2].x,
d[f + 2].y,
d[f + 3].x,
d[f + 3].y
);
d = v(z, 2);
c.lineTo(z[z.length - 1].x, z[z.length - 1].y);
for (f = d.length - 1; 2 < f; f -= 3)
c.bezierCurveTo(
d[f - 1].x,
d[f - 1].y,
d[f - 2].x,
d[f - 2].y,
d[f - 3].x,
d[f - 3].y
),
r &&
e.bezierCurveTo(
d[f - 1].x,
d[f - 1].y,
d[f - 2].x,
d[f - 2].y,
d[f - 3].x,
d[f - 3].y
);
c.closePath();
c.globalAlpha = h.fillOpacity;
c.fill();
r && (e.closePath(), e.fill());
c.globalAlpha = 1;
if (0 < h.lineThickness) {
c.strokeStyle = b;
c.setLineDash && c.setLineDash(a);
c.beginPath();
c.moveTo(d[0].x, d[0].y);
for (var g = (f = 0); f < d.length - 3; f += 3, g++) {
if (u[g].newStrokeStyle || u[g].newLineDashArray)
c.stroke(),
c.beginPath(),
c.moveTo(d[f].x, d[f].y),
u[g].newStrokeStyle && (c.strokeStyle = u[g].newStrokeStyle),
u[g].newLineDashArray && c.setLineDash(u[g].newLineDashArray);
c.bezierCurveTo(
d[f + 1].x,
d[f + 1].y,
d[f + 2].x,
d[f + 2].y,
d[f + 3].x,
d[f + 3].y
);
}
c.stroke();
}
c.beginPath();
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = r ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = this._eventManager.ghostCtx,
g = [],
m = this.plotArea;
c.save();
r && e.save();
c.beginPath();
c.rect(m.x1, m.y1, m.width, m.height);
c.clip();
r && (e.beginPath(), e.rect(m.x1, m.y1, m.width, m.height), e.clip());
for (var l = 0; l < a.dataSeriesIndexes.length; l++) {
var w = a.dataSeriesIndexes[l],
h = this.data[w],
k = h.dataPoints,
g = h.id;
this._eventManager.objectMap[g] = {
objectType: "dataSeries",
dataSeriesIndex: w,
};
g = N(g);
e.fillStyle = g;
var g = [],
q = 0,
n,
f,
p,
u = [],
z = [];
if (0 < k.length) {
var t = h._colorSet[q % h._colorSet.length],
C = (h.lineColor = h.options.lineColor || t),
x = C;
c.fillStyle = t;
c.lineWidth = h.lineThickness;
var F = "solid",
y;
if (c.setLineDash) {
var A = R(h.nullDataLineDashType, h.lineThickness),
F = h.lineDashType;
y = R(F, h.lineThickness);
}
for (f = !1; q < k.length; q++)
if (
((n = k[q].x.getTime ? k[q].x.getTime() : k[q].x),
!(
n < a.axisX.dataInfo.viewPortMin ||
(n > a.axisX.dataInfo.viewPortMax &&
(!h.connectNullData || !f))
))
)
if (
null !== k[q].y &&
k[q].y.length &&
"number" === typeof k[q].y[0] &&
"number" === typeof k[q].y[1]
) {
n = a.axisX.convertValueToPixel(n);
f = a.axisY.convertValueToPixel(k[q].y[0]);
p = a.axisY.convertValueToPixel(k[q].y[1]);
var E = h.dataPointIds[q];
this._eventManager.objectMap[E] = {
id: E,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: q,
x1: n,
y1: f,
y2: p,
};
u[u.length] = { x: n, y: f };
z[z.length] = { x: n, y: p };
q < k.length - 1 &&
(x !== (k[q].lineColor || C) ||
F !== (k[q].lineDashType || h.lineDashType)) &&
((x = k[q].lineColor || C),
(u[u.length - 1].newStrokeStyle = x),
c.setLineDash &&
(k[q].lineDashType
? ((F = k[q].lineDashType),
(u[u.length - 1].newLineDashArray = R(
F,
h.lineThickness
)))
: ((F = h.lineDashType),
(u[u.length - 1].newLineDashArray = y))));
if (
0 !== k[q].markerSize &&
(0 < k[q].markerSize || 0 < h.markerSize)
) {
var aa = h.getMarkerProperties(q, n, f, c);
g.push(aa);
var T = N(E);
r &&
g.push({
x: n,
y: f,
ctx: e,
type: aa.type,
size: aa.size,
color: T,
borderColor: T,
borderThickness: aa.borderThickness,
});
aa = h.getMarkerProperties(q, n, p, c);
g.push(aa);
T = N(E);
r &&
g.push({
x: n,
y: p,
ctx: e,
type: aa.type,
size: aa.size,
color: T,
borderColor: T,
borderThickness: aa.borderThickness,
});
}
if (
k[q].indexLabel ||
h.indexLabel ||
k[q].indexLabelFormatter ||
h.indexLabelFormatter
)
this._indexLabels.push({
chartType: "rangeSplineArea",
dataPoint: k[q],
dataSeries: h,
indexKeyword: 0,
point: { x: n, y: f },
direction: k[q].y[0] <= k[q].y[1] ? -1 : 1,
color: t,
}),
this._indexLabels.push({
chartType: "rangeSplineArea",
dataPoint: k[q],
dataSeries: h,
indexKeyword: 1,
point: { x: n, y: p },
direction: k[q].y[0] <= k[q].y[1] ? 1 : -1,
color: t,
});
f = !1;
} else
0 < q &&
!f &&
(h.connectNullData
? c.setLineDash &&
0 < u.length &&
(h.options.nullDataLineDashType ||
!k[q - 1].lineDashType) &&
((u[u.length - 1].newLineDashArray = A),
(F = h.nullDataLineDashType))
: (d(y, C), (u = []), (z = []))),
(f = !0);
d(y, C);
ia.drawMarkers(g);
}
}
r &&
(b.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(m.x1, m.y1, m.width, m.height),
this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: M.xClipAnimation,
easingFunction: M.easing.linear,
animationBase: 0,
};
}
};
p.prototype.renderWaterfall = function (a) {
var d = a.targetCanvasCtx || this.plotArea.ctx,
b = r ? this._preRenderCtx : d;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this._eventManager.ghostCtx,
e = null,
g = this.plotArea,
m = 0,
l,
k,
h,
s,
q = a.axisY.convertValueToPixel(
a.axisY.logarithmic ? 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
: Math.min(
0.15 * this.width,
0.9 * (this.plotArea.width / 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.6 *
((g.width *
(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 &&
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
));
n < m && (n = m);
n > k && (n = k);
b.save();
r && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(g.x1, g.y1, g.width, g.height);
b.clip();
r &&
(this._eventManager.ghostCtx.beginPath(),
this._eventManager.ghostCtx.rect(g.x1, g.y1, g.width, g.height),
this._eventManager.ghostCtx.clip());
for (var f = 0; f < a.dataSeriesIndexes.length; f++) {
var p = a.dataSeriesIndexes[f],
u = this.data[p],
v = u.dataPoints,
e = u._colorSet[0];
u.risingColor = u.options.risingColor ? u.options.risingColor : e;
u.fallingColor = u.options.fallingColor
? u.options.fallingColor
: "#e40a0a";
var t =
"number" === typeof u.options.lineThickness
? Math.round(u.lineThickness)
: 1,
C = 1 === Math.round(t) % 2 ? -0.5 : 0;
if (0 < v.length)
for (
var x = 5 < n && u.bevelEnabled ? !0 : !1,
z = !1,
y = null,
A = null,
m = 0;
m < v.length;
m++
)
if (
(v[m].getTime ? (s = v[m].x.getTime()) : (s = v[m].x),
"number" !== typeof v[m].y)
) {
if (0 < m && !z && u.connectNullData)
var D =
u.options.nullDataLineDashType || !v[m - 1].lineDashType
? u.nullDataLineDashType
: v[m - 1].lineDashType;
z = !0;
} else {
l = a.axisX.convertValueToPixel(s);
k =
0 === u.dataPointEOs[m].cumulativeSum
? q
: a.axisY.convertValueToPixel(
u.dataPointEOs[m].cumulativeSum
);
h =
0 === u.dataPointEOs[m].cumulativeSumYStartValue
? q
: a.axisY.convertValueToPixel(
u.dataPointEOs[m].cumulativeSumYStartValue
);
l = a.axisX.reversed
? (l +
(a.plotType.totalDataSeries * n) / 2 -
(a.previousDataSeriesCount + f) * n) <<
0
: (l -
(a.plotType.totalDataSeries * n) / 2 +
(a.previousDataSeriesCount + f) * n) <<
0;
var F = a.axisX.reversed ? (l - n) << 0 : (l + n) << 0;
k > h && ((e = k), (k = h), (h = e));
a.axisY.reversed && ((e = k), (k = h), (h = e));
e = u.dataPointIds[m];
this._eventManager.objectMap[e] = {
id: e,
objectType: "dataPoint",
dataSeriesIndex: p,
dataPointIndex: m,
x1: l,
y1: k,
x2: F,
y2: h,
};
var T = v[m].color
? v[m].color
: 0 < v[m].y
? u.risingColor
: u.fallingColor;
ea(b, l, k, F, h, T, 0, T, x, x, !1, !1, u.fillOpacity);
e = N(e);
r &&
ea(
this._eventManager.ghostCtx,
l,
k,
F,
h,
e,
0,
null,
!1,
!1,
!1,
!1
);
var Y,
T = l;
Y =
("undefined" !== typeof v[m].isIntermediateSum &&
!0 === v[m].isIntermediateSum) ||
("undefined" !== typeof v[m].isCumulativeSum &&
!0 === v[m].isCumulativeSum)
? 0 < v[m].y
? k
: h
: 0 < v[m].y
? h
: k;
0 < m &&
y &&
(!z || u.connectNullData) &&
(z && b.setLineDash && b.setLineDash(R(D, t)),
b.beginPath(),
b.moveTo(y, A - C),
b.lineTo(T, Y - C),
0 < t && b.stroke(),
r &&
(c.beginPath(),
c.moveTo(y, A - C),
c.lineTo(T, Y - C),
0 < t && c.stroke()));
z = !1;
y = F;
A = 0 < v[m].y ? k : h;
T = v[m].lineDashType
? v[m].lineDashType
: u.options.lineDashType
? u.options.lineDashType
: "shortDash";
b.strokeStyle = v[m].lineColor
? v[m].lineColor
: u.options.lineColor
? u.options.lineColor
: "#9e9e9e";
b.lineWidth = t;
b.setLineDash && ((T = R(T, t)), b.setLineDash(T));
(v[m].indexLabel ||
u.indexLabel ||
v[m].indexLabelFormatter ||
u.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "waterfall",
dataPoint: v[m],
dataSeries: u,
point: { x: l + (F - l) / 2, y: 0 <= v[m].y ? k : h },
direction: 0 > v[m].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: l,
y1: Math.min(k, h),
x2: F,
y2: Math.max(k, h),
},
color: e,
});
}
}
r &&
(d.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(g.x1, g.y1, g.width, g.height),
this._eventManager.ghostCtx.restore());
b.restore();
return {
source: d,
dest: this.plotArea.ctx,
animationCallback: M.fadeInAnimation,
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
};
var ja = function (a, d, b, c, e, g, m, l, k) {
if (!(0 > b)) {
"undefined" === typeof l && (l = 1);
if (!r) {
var h = Number((m % (2 * Math.PI)).toFixed(8));
Number((g % (2 * Math.PI)).toFixed(8)) === h && (m -= 1e-4);
}
a.save();
a.globalAlpha = l;
"pie" === e
? (a.beginPath(),
a.moveTo(d.x, d.y),
a.arc(d.x, d.y, b, g, m, !1),
(a.fillStyle = c),
(a.strokeStyle = "white"),
(a.lineWidth = 2),
a.closePath(),
a.fill())
: "doughnut" === e &&
(a.beginPath(),
a.arc(d.x, d.y, b, g, m, !1),
0 <= k && a.arc(d.x, d.y, k * b, m, g, !0),
a.closePath(),
(a.fillStyle = c),
(a.strokeStyle = "white"),
(a.lineWidth = 2),
a.fill());
a.globalAlpha = 1;
a.restore();
}
};
p.prototype.renderPie = function (a) {
function d() {
if (h && s) {
for (var a = 0, b = 0, c = 0, e = 0, d = 0; d < s.length; d++) {
var g = s[d],
l = h.dataPointIds[d];
f[d].id = l;
f[d].objectType = "dataPoint";
f[d].dataPointIndex = d;
f[d].dataSeriesIndex = 0;
var m = f[d],
q = { percent: null, total: null },
p = null,
q = k.getPercentAndTotal(h, g);
if (h.indexLabelFormatter || g.indexLabelFormatter)
p = {
chart: k.options,
dataSeries: h,
dataPoint: g,
total: q.total,
percent: q.percent,
};
q = g.indexLabelFormatter
? g.indexLabelFormatter(p)
: g.indexLabel
? k.replaceKeywordsWithValue(g.indexLabel, g, h, d)
: h.indexLabelFormatter
? h.indexLabelFormatter(p)
: h.indexLabel
? k.replaceKeywordsWithValue(h.indexLabel, g, h, d)
: g.label
? g.label
: "";
k._eventManager.objectMap[l] = m;
m.center = { x: x.x, y: x.y };
m.y = g.y;
m.radius = A;
m.percentInnerRadius = F;
m.indexLabelText = q;
m.indexLabelPlacement = h.indexLabelPlacement;
m.indexLabelLineColor = g.indexLabelLineColor
? g.indexLabelLineColor
: h.options.indexLabelLineColor
? h.options.indexLabelLineColor
: g.color
? g.color
: h._colorSet[d % h._colorSet.length];
m.indexLabelLineThickness = u(g.indexLabelLineThickness)
? h.indexLabelLineThickness
: g.indexLabelLineThickness;
m.indexLabelLineDashType = g.indexLabelLineDashType
? g.indexLabelLineDashType
: h.indexLabelLineDashType;
m.indexLabelFontColor = g.indexLabelFontColor
? g.indexLabelFontColor
: h.indexLabelFontColor;
m.indexLabelFontStyle = g.indexLabelFontStyle
? g.indexLabelFontStyle
: h.indexLabelFontStyle;
m.indexLabelFontWeight = g.indexLabelFontWeight
? g.indexLabelFontWeight
: h.indexLabelFontWeight;
m.indexLabelFontSize = u(g.indexLabelFontSize)
? h.indexLabelFontSize
: g.indexLabelFontSize;
m.indexLabelFontFamily = g.indexLabelFontFamily
? g.indexLabelFontFamily
: h.indexLabelFontFamily;
m.indexLabelBackgroundColor = g.indexLabelBackgroundColor
? g.indexLabelBackgroundColor
: h.options.indexLabelBackgroundColor
? h.options.indexLabelBackgroundColor
: h.indexLabelBackgroundColor;
m.indexLabelMaxWidth = g.indexLabelMaxWidth
? g.indexLabelMaxWidth
: h.indexLabelMaxWidth
? h.indexLabelMaxWidth
: 0.33 * n.width;
m.indexLabelWrap =
"undefined" !== typeof g.indexLabelWrap
? g.indexLabelWrap
: h.indexLabelWrap;
m.startAngle =
0 === d
? h.startAngle
? (h.startAngle / 180) * Math.PI
: 0
: f[d - 1].endAngle;
m.startAngle = (m.startAngle + 2 * Math.PI) % (2 * Math.PI);
m.endAngle = m.startAngle + ((2 * Math.PI) / z) * Math.abs(g.y);
g = (m.endAngle + m.startAngle) / 2;
g = (g + 2 * Math.PI) % (2 * Math.PI);
m.midAngle = g;
if (m.midAngle > Math.PI / 2 - t && m.midAngle < Math.PI / 2 + t) {
if (0 === a || f[c].midAngle > m.midAngle) c = d;
a++;
} else if (
m.midAngle > (3 * Math.PI) / 2 - t &&
m.midAngle < (3 * Math.PI) / 2 + t
) {
if (0 === b || f[e].midAngle > m.midAngle) e = d;
b++;
}
m.hemisphere =
g > Math.PI / 2 && g <= (3 * Math.PI) / 2 ? "left" : "right";
m.indexLabelTextBlock = new ka(k.plotArea.ctx, {
fontSize: m.indexLabelFontSize,
fontFamily: m.indexLabelFontFamily,
fontColor: m.indexLabelFontColor,
fontStyle: m.indexLabelFontStyle,
fontWeight: m.indexLabelFontWeight,
horizontalAlign: "left",
backgroundColor: m.indexLabelBackgroundColor,
maxWidth: m.indexLabelMaxWidth,
maxHeight: m.indexLabelWrap
? 5 * m.indexLabelFontSize
: 1.5 * m.indexLabelFontSize,
text: m.indexLabelText,
padding: 0,
textBaseline: "top",
});
m.indexLabelTextBlock.measureText();
}
l = g = 0;
q = !1;
for (d = 0; d < s.length; d++)
(m = f[(c + d) % s.length]),
1 < a &&
m.midAngle > Math.PI / 2 - t &&
m.midAngle < Math.PI / 2 + t &&
(g <= a / 2 && !q
? ((m.hemisphere = "right"), g++)
: ((m.hemisphere = "left"), (q = !0)));
q = !1;
for (d = 0; d < s.length; d++)
(m = f[(e + d) % s.length]),
1 < b &&
m.midAngle > (3 * Math.PI) / 2 - t &&
m.midAngle < (3 * Math.PI) / 2 + t &&
(l <= b / 2 && !q
? ((m.hemisphere = "left"), l++)
: ((m.hemisphere = "right"), (q = !0)));
}
}
function b(a) {
var b = k.plotArea.ctx;
b.clearRect(n.x1, n.y1, n.width, n.height);
b.fillStyle = k.backgroundColor;
b.fillRect(n.x1, n.y1, n.width, n.height);
for (b = 0; b < s.length; b++) {
var c = f[b].startAngle,
e = f[b].endAngle;
if (e > c) {
var d = 0.07 * A * Math.cos(f[b].midAngle),
g = 0.07 * A * Math.sin(f[b].midAngle),
m = !1;
if (s[b].exploded) {
if (
1e-9 < Math.abs(f[b].center.x - (x.x + d)) ||
1e-9 < Math.abs(f[b].center.y - (x.y + g))
)
(f[b].center.x = x.x + d * a),
(f[b].center.y = x.y + g * a),
(m = !0);
} else if (
0 < Math.abs(f[b].center.x - x.x) ||
0 < Math.abs(f[b].center.y - x.y)
)
(f[b].center.x = x.x + d * (1 - a)),
(f[b].center.y = x.y + g * (1 - a)),
(m = !0);
m &&
((d = {}),
(d.dataSeries = h),
(d.dataPoint = h.dataPoints[b]),
(d.index = b),
k.toolTip.highlightObjects([d]));
ja(
k.plotArea.ctx,
f[b].center,
f[b].radius,
s[b].color ? s[b].color : h._colorSet[b % h._colorSet.length],
h.type,
c,
e,
h.fillOpacity,
f[b].percentInnerRadius
);
}
}
a = k.plotArea.ctx;
a.save();
a.fillStyle = "black";
a.strokeStyle = "grey";
a.textBaseline = "middle";
a.lineJoin = "round";
for (b = b = 0; b < s.length; b++)
(c = f[b]),
c.indexLabelText &&
((c.indexLabelTextBlock.y -= c.indexLabelTextBlock.height / 2),
(e = 0),
(e =
"left" === c.hemisphere
? "inside" !== h.indexLabelPlacement
? -(c.indexLabelTextBlock.width + q)
: -c.indexLabelTextBlock.width / 2
: "inside" !== h.indexLabelPlacement
? q
: -c.indexLabelTextBlock.width / 2),
(c.indexLabelTextBlock.x += e),
c.indexLabelTextBlock.render(!0),
(c.indexLabelTextBlock.x -= e),
(c.indexLabelTextBlock.y += c.indexLabelTextBlock.height / 2),
"inside" !== c.indexLabelPlacement &&
0 < c.indexLabelLineThickness &&
((e = c.center.x + A * Math.cos(c.midAngle)),
(d = c.center.y + A * Math.sin(c.midAngle)),
(a.strokeStyle = c.indexLabelLineColor),
(a.lineWidth = c.indexLabelLineThickness),
a.setLineDash &&
a.setLineDash(
R(c.indexLabelLineDashType, c.indexLabelLineThickness)
),
a.beginPath(),
a.moveTo(e, d),
a.lineTo(c.indexLabelTextBlock.x, c.indexLabelTextBlock.y),
a.lineTo(
c.indexLabelTextBlock.x + ("left" === c.hemisphere ? -q : q),
c.indexLabelTextBlock.y
),
a.stroke()),
(a.lineJoin = "miter"));
a.save();
}
function c(a, b) {
var c = 0,
c = a.indexLabelTextBlock.y - a.indexLabelTextBlock.height / 2,
e = a.indexLabelTextBlock.y + a.indexLabelTextBlock.height / 2,
d = b.indexLabelTextBlock.y - b.indexLabelTextBlock.height / 2,
f = b.indexLabelTextBlock.y + b.indexLabelTextBlock.height / 2;
return (c =
b.indexLabelTextBlock.y > a.indexLabelTextBlock.y ? d - e : c - f);
}
function e(a) {
for (var b = null, e = 1; e < s.length; e++)
if (
((b = (a + e + f.length) % f.length),
f[b].hemisphere !== f[a].hemisphere)
) {
b = null;
break;
} else if (
f[b].indexLabelText &&
b !== a &&
(0 > c(f[b], f[a]) ||
("right" === f[a].hemisphere
? f[b].indexLabelTextBlock.y >= f[a].indexLabelTextBlock.y
: f[b].indexLabelTextBlock.y <= f[a].indexLabelTextBlock.y))
)
break;
else b = null;
return b;
}
function g(a, b, d) {
d = (d || 0) + 1;
if (1e3 < d) return 0;
b = b || 0;
var m = 0,
h = x.y - 1 * r,
l = x.y + 1 * r;
if (0 <= a && a < s.length) {
var n = f[a];
if (
(0 > b && n.indexLabelTextBlock.y < h) ||
(0 < b && n.indexLabelTextBlock.y > l)
)
return 0;
var k = 0,
q = 0,
q = (k = k = 0);
0 > b
? n.indexLabelTextBlock.y - n.indexLabelTextBlock.height / 2 > h &&
n.indexLabelTextBlock.y - n.indexLabelTextBlock.height / 2 + b <
h &&
(b = -(
h -
(n.indexLabelTextBlock.y - n.indexLabelTextBlock.height / 2 + b)
))
: n.indexLabelTextBlock.y + n.indexLabelTextBlock.height / 2 < h &&
n.indexLabelTextBlock.y + n.indexLabelTextBlock.height / 2 + b >
l &&
(b =
n.indexLabelTextBlock.y +
n.indexLabelTextBlock.height / 2 +
b -
l);
b = n.indexLabelTextBlock.y + b;
h = 0;
h =
"right" === n.hemisphere
? x.x + Math.sqrt(Math.pow(r, 2) - Math.pow(b - x.y, 2))
: x.x - Math.sqrt(Math.pow(r, 2) - Math.pow(b - x.y, 2));
q = x.x + A * Math.cos(n.midAngle);
k = x.y + A * Math.sin(n.midAngle);
k = Math.sqrt(Math.pow(h - q, 2) + Math.pow(b - k, 2));
q = Math.acos(A / r);
k = Math.acos((r * r + A * A - k * k) / (2 * A * r));
b = k < q ? b - n.indexLabelTextBlock.y : 0;
h = null;
for (l = 1; l < s.length; l++)
if (
((h = (a - l + f.length) % f.length),
f[h].hemisphere !== f[a].hemisphere)
) {
h = null;
break;
} else if (
f[h].indexLabelText &&
f[h].hemisphere === f[a].hemisphere &&
h !== a &&
(0 > c(f[h], f[a]) ||
("right" === f[a].hemisphere
? f[h].indexLabelTextBlock.y <= f[a].indexLabelTextBlock.y
: f[h].indexLabelTextBlock.y >= f[a].indexLabelTextBlock.y))
)
break;
else h = null;
q = h;
k = e(a);
l = h = 0;
0 > b
? ((l = "right" === n.hemisphere ? q : k),
(m = b),
null !== l &&
((q = -b),
(b =
n.indexLabelTextBlock.y -
n.indexLabelTextBlock.height / 2 -
(f[l].indexLabelTextBlock.y +
f[l].indexLabelTextBlock.height / 2)),
b - q < p &&
((h = -q),
(l = g(l, h, d + 1)),
+l.toFixed(C) > +h.toFixed(C) &&
(m = b > p ? -(b - p) : -(q - (l - h))))))
: 0 < b &&
((l = "right" === n.hemisphere ? k : q),
(m = b),
null !== l &&
((q = b),
(b =
f[l].indexLabelTextBlock.y -
f[l].indexLabelTextBlock.height / 2 -
(n.indexLabelTextBlock.y + n.indexLabelTextBlock.height / 2)),
b - q < p &&
((h = q),
(l = g(l, h, d + 1)),
+l.toFixed(C) < +h.toFixed(C) &&
(m = b > p ? b - p : q - (h - l)))));
m &&
((d = n.indexLabelTextBlock.y + m),
(b = 0),
(b =
"right" === n.hemisphere
? x.x + Math.sqrt(Math.pow(r, 2) - Math.pow(d - x.y, 2))
: x.x - Math.sqrt(Math.pow(r, 2) - Math.pow(d - x.y, 2))),
n.midAngle > Math.PI / 2 - t && n.midAngle < Math.PI / 2 + t
? ((h = (a - 1 + f.length) % f.length),
(h = f[h]),
(a = f[(a + 1 + f.length) % f.length]),
"left" === n.hemisphere &&
"right" === h.hemisphere &&
b > h.indexLabelTextBlock.x
? (b = h.indexLabelTextBlock.x - 15)
: "right" === n.hemisphere &&
"left" === a.hemisphere &&
b < a.indexLabelTextBlock.x &&
(b = a.indexLabelTextBlock.x + 15))
: n.midAngle > (3 * Math.PI) / 2 - t &&
n.midAngle < (3 * Math.PI) / 2 + t &&
((h = (a - 1 + f.length) % f.length),
(h = f[h]),
(a = f[(a + 1 + f.length) % f.length]),
"right" === n.hemisphere &&
"left" === h.hemisphere &&
b < h.indexLabelTextBlock.x
? (b = h.indexLabelTextBlock.x + 15)
: "left" === n.hemisphere &&
"right" === a.hemisphere &&
b > a.indexLabelTextBlock.x &&
(b = a.indexLabelTextBlock.x - 15)),
(n.indexLabelTextBlock.y = d),
(n.indexLabelTextBlock.x = b),
(n.indexLabelAngle = Math.atan2(
n.indexLabelTextBlock.y - x.y,
n.indexLabelTextBlock.x - x.x
)));
}
return m;
}
function m() {
var a = k.plotArea.ctx;
a.fillStyle = "grey";
a.strokeStyle = "grey";
a.font = "16px Arial";
a.textBaseline = "middle";
for (
var b = (a = 0), d = 0, m = !0, b = 0;
10 > b && (1 > b || 0 < d);
b++
) {
if (
h.radius ||
(!h.radius &&
"undefined" !== typeof h.innerRadius &&
null !== h.innerRadius &&
A - d <= D)
)
m = !1;
m && (A -= d);
d = 0;
if ("inside" !== h.indexLabelPlacement) {
r = A * v;
for (a = 0; a < s.length; a++) {
var l = f[a];
l.indexLabelTextBlock.x = x.x + r * Math.cos(l.midAngle);
l.indexLabelTextBlock.y = x.y + r * Math.sin(l.midAngle);
l.indexLabelAngle = l.midAngle;
l.radius = A;
l.percentInnerRadius = F;
}
for (var t, u, a = 0; a < s.length; a++) {
var l = f[a],
y = e(a);
if (null !== y) {
t = f[a];
u = f[y];
var z = 0,
z = c(t, u) - p;
if (0 > z) {
for (var E = (u = 0), H = 0; H < s.length; H++)
H !== a &&
f[H].hemisphere === l.hemisphere &&
(f[H].indexLabelTextBlock.y < l.indexLabelTextBlock.y
? u++
: E++);
u = (z / (u + E || 1)) * E;
var E = -1 * (z - u),
I = (H = 0);
"right" === l.hemisphere
? ((H = g(a, u)),
(E = -1 * (z - H)),
(I = g(y, E)),
+I.toFixed(C) < +E.toFixed(C) &&
+H.toFixed(C) <= +u.toFixed(C) &&
g(a, -(E - I)))
: ((H = g(y, u)),
(E = -1 * (z - H)),
(I = g(a, E)),
+I.toFixed(C) < +E.toFixed(C) &&
+H.toFixed(C) <= +u.toFixed(C) &&
g(y, -(E - I)));
}
}
}
} else
for (a = 0; a < s.length; a++)
(l = f[a]),
(r = "pie" === h.type ? 0.7 * A : 0.8 * A),
(y = x.x + r * Math.cos(l.midAngle)),
(u = x.y + r * Math.sin(l.midAngle)),
(l.indexLabelTextBlock.x = y),
(l.indexLabelTextBlock.y = u);
for (a = 0; a < s.length; a++)
if (
((l = f[a]),
(y = l.indexLabelTextBlock.measureText()),
0 !== y.height && 0 !== y.width)
)
(y = y = 0),
"right" === l.hemisphere
? ((y =
n.x2 -
(l.indexLabelTextBlock.x +
l.indexLabelTextBlock.width +
q)),
(y *= -1))
: (y =
n.x1 -
(l.indexLabelTextBlock.x -
l.indexLabelTextBlock.width -
q)),
0 < y &&
(!m &&
l.indexLabelText &&
((u =
"right" === l.hemisphere
? n.x2 - l.indexLabelTextBlock.x
: l.indexLabelTextBlock.x - n.x1),
0.3 * l.indexLabelTextBlock.maxWidth > u
? (l.indexLabelText = "")
: (l.indexLabelTextBlock.maxWidth = 0.85 * u),
0.3 * l.indexLabelTextBlock.maxWidth < u &&
(l.indexLabelTextBlock.x -=
"right" === l.hemisphere ? 2 : -2)),
Math.abs(
l.indexLabelTextBlock.y -
l.indexLabelTextBlock.height / 2 -
x.y
) < A ||
Math.abs(
l.indexLabelTextBlock.y +
l.indexLabelTextBlock.height / 2 -
x.y
) < A) &&
((y /= Math.abs(Math.cos(l.indexLabelAngle))),
9 < y && (y *= 0.3),
y > d && (d = y)),
(y = y = 0),
0 < l.indexLabelAngle && l.indexLabelAngle < Math.PI
? ((y =
n.y2 -
(l.indexLabelTextBlock.y +
l.indexLabelTextBlock.height / 2 +
5)),
(y *= -1))
: (y =
n.y1 -
(l.indexLabelTextBlock.y -
l.indexLabelTextBlock.height / 2 -
5)),
0 < y &&
(!m &&
l.indexLabelText &&
((u =
0 < l.indexLabelAngle && l.indexLabelAngle < Math.PI
? -1
: 1),
0 === g(a, y * u) && g(a, 2 * u)),
Math.abs(l.indexLabelTextBlock.x - x.x) < A &&
((y /= Math.abs(Math.sin(l.indexLabelAngle))),
9 < y && (y *= 0.3),
y > d && (d = y)));
var K = function (a, b, c) {
for (
var e = [], d = 0;
e.push(f[b]), b !== c;
b = (b + 1 + s.length) % s.length
);
e.sort(function (a, b) {
return a.y - b.y;
});
for (b = 0; b < e.length; b++)
if (((c = e[b]), d < 0.7 * a))
(d += c.indexLabelTextBlock.height),
(c.indexLabelTextBlock.text = ""),
(c.indexLabelText = ""),
c.indexLabelTextBlock.measureText();
else break;
};
(function () {
for (var a = -1, b = -1, d = 0, g = !1, l = 0; l < s.length; l++)
if (((g = !1), (t = f[l]), t.indexLabelText)) {
var m = e(l);
if (null !== m) {
var h = f[m];
z = 0;
z = c(t, h);
var n;
if ((n = 0 > z)) {
n = t.indexLabelTextBlock.x;
var k =
t.indexLabelTextBlock.y -
t.indexLabelTextBlock.height / 2,
w =
t.indexLabelTextBlock.y +
t.indexLabelTextBlock.height / 2,
p =
h.indexLabelTextBlock.y -
h.indexLabelTextBlock.height / 2,
u = h.indexLabelTextBlock.x + h.indexLabelTextBlock.width,
r =
h.indexLabelTextBlock.y +
h.indexLabelTextBlock.height / 2;
n =
t.indexLabelTextBlock.x + t.indexLabelTextBlock.width <
h.indexLabelTextBlock.x - q ||
n > u + q ||
k > r + q ||
w < p - q
? !1
: !0;
}
n
? (0 > a && (a = l),
m !== a && ((b = m), (d += -z)),
0 === l % Math.max(s.length / 10, 3) && (g = !0))
: (g = !0);
g &&
0 < d &&
0 <= a &&
0 <= b &&
(K(d, a, b), (b = a = -1), (d = 0));
}
}
0 < d && K(d, a, b);
})();
}
}
function l() {
k.plotArea.layoutManager.reset();
k.title &&
(k.title.dockInsidePlotArea ||
("center" === k.title.horizontalAlign &&
"center" === k.title.verticalAlign)) &&
k.title.render();
if (k.subtitles)
for (var a = 0; a < k.subtitles.length; a++) {
var b = k.subtitles[a];
(b.dockInsidePlotArea ||
("center" === b.horizontalAlign &&
"center" === b.verticalAlign)) &&
b.render();
}
k.legend &&
(k.legend.dockInsidePlotArea ||
("center" === k.legend.horizontalAlign &&
"center" === k.legend.verticalAlign)) &&
(k.legend.setLayout(), k.legend.render());
}
var k = this;
if (!(0 >= a.dataSeriesIndexes.length)) {
var h = this.data[a.dataSeriesIndexes[0]],
s = h.dataPoints,
q = 10,
n = this.plotArea,
f = h.dataPointEOs,
p = 2,
r,
v = 1.3,
t = (20 / 180) * Math.PI,
C = 6,
x = { x: (n.x2 + n.x1) / 2, y: (n.y2 + n.y1) / 2 },
z = 0;
a = !1;
for (var y = 0; y < s.length; y++)
(z += Math.abs(s[y].y)),
!a &&
"undefined" !== typeof s[y].indexLabel &&
null !== s[y].indexLabel &&
0 < s[y].indexLabel.toString().length &&
(a = !0),
!a &&
"undefined" !== typeof s[y].label &&
null !== s[y].label &&
0 < s[y].label.toString().length &&
(a = !0);
if (0 !== z) {
a =
a ||
("undefined" !== typeof h.indexLabel &&
null !== h.indexLabel &&
0 < h.indexLabel.toString().length);
var A =
"inside" !== h.indexLabelPlacement && a
? (0.75 * Math.min(n.width, n.height)) / 2
: (0.92 * Math.min(n.width, n.height)) / 2;
h.radius && (A = I(h.radius, A));
var D =
"undefined" !== typeof h.innerRadius && null !== h.innerRadius
? I(h.innerRadius, A)
: 0.7 * A;
h.radius = A;
"doughnut" === h.type && (h.innerRadius = D);
var F = Math.min(D / A, (A - 1) / A);
this.pieDoughnutClickHandler = function (a) {
k.isAnimating ||
(!u(a.dataSeries.explodeOnClick) &&
!a.dataSeries.explodeOnClick) ||
((a = a.dataPoint),
(a.exploded = a.exploded ? !1 : !0),
1 < this.dataPoints.length &&
k._animator.animate(0, 500, function (a) {
b(a);
l();
}));
};
d();
m();
m();
m();
m();
this.disableToolTip = !0;
this._animator.animate(
0,
this.animatedRender ? this.animationDuration : 0,
function (a) {
var b = k.plotArea.ctx;
b.clearRect(n.x1, n.y1, n.width, n.height);
b.fillStyle = k.backgroundColor;
b.fillRect(n.x1, n.y1, n.width, n.height);
a = f[0].startAngle + 2 * Math.PI * a;
for (b = 0; b < s.length; b++) {
var c = 0 === b ? f[b].startAngle : e,
e = c + (f[b].endAngle - f[b].startAngle),
d = !1;
e > a && ((e = a), (d = !0));
var g = s[b].color
? s[b].color
: h._colorSet[b % h._colorSet.length];
e > c &&
ja(
k.plotArea.ctx,
f[b].center,
f[b].radius,
g,
h.type,
c,
e,
h.fillOpacity,
f[b].percentInnerRadius
);
if (d) break;
}
l();
},
function () {
k.disableToolTip = !1;
k._animator.animate(0, k.animatedRender ? 500 : 0, function (a) {
b(a);
l();
});
}
);
}
}
};
var ra = function (a, d, b, c) {
"undefined" === typeof b && (b = 1);
0 >= Math.round(d.y4 - d.y1) ||
(a.save(),
(a.globalAlpha = b),
a.beginPath(),
a.moveTo(Math.round(d.x1), Math.round(d.y1)),
a.lineTo(Math.round(d.x2), Math.round(d.y2)),
a.lineTo(Math.round(d.x3), Math.round(d.y3)),
a.lineTo(Math.round(d.x4), Math.round(d.y4)),
"undefined" !== d.x5 &&
(a.lineTo(Math.round(d.x5), Math.round(d.y5)),
a.lineTo(Math.round(d.x6), Math.round(d.y6))),
a.closePath(),
(a.fillStyle = c ? c : d.color),
a.fill(),
(a.globalAplha = 1),
a.restore());
};
p.prototype.renderFunnel = function (a) {
function d() {
for (var a = 0, b = [], c = 0; c < C.length; c++) {
if ("undefined" === typeof C[c].y) return -1;
C[c].y = "number" === typeof C[c].y ? C[c].y : 0;
a += Math.abs(C[c].y);
}
if (0 === a) return -1;
for (c = b[0] = 0; c < C.length; c++)
b.push((Math.abs(C[c].y) * F) / a);
return b;
}
function b() {
var a = $,
b = V,
c = K,
e = ea,
d,
f;
d = O;
f = Z - N;
e = Math.abs(((f - d) * (b - a + (e - c))) / 2);
c = ea - K;
d = f - d;
f = c * (f - Z);
f = Math.abs(f);
f = e + f;
for (var e = [], g = 0, l = 0; l < C.length; l++) {
if ("undefined" === typeof C[l].y) return -1;
C[l].y = "number" === typeof C[l].y ? C[l].y : 0;
g += Math.abs(C[l].y);
}
if (0 === g) return -1;
for (
var m = (e[0] = 0), h = 0, n, k, b = b - a, m = !1, l = 0;
l < C.length;
l++
)
(a = (Math.abs(C[l].y) * f) / g),
m
? (n = 0 == Number(c.toFixed(3)) ? 0 : a / c)
: ((k = ba * ba * b * b - 4 * Math.abs(ba) * a),
0 > k
? ((k = c),
(m = ((b + k) * (d - h)) / 2),
(a -= m),
(n = d - h),
(h += d - h),
(n += 0 == k ? 0 : a / k),
(h += a / k),
(m = !0))
: ((n = (Math.abs(ba) * b - Math.sqrt(k)) / 2),
(k = b - (2 * n) / Math.abs(ba)),
(h += n),
h > d &&
((h -= n),
(k = c),
(m = ((b + k) * (d - h)) / 2),
(a -= m),
(n = d - h),
(h += d - h),
(n += a / k),
(h += a / k),
(m = !0)),
(b = k))),
e.push(n);
return e;
}
function c() {
if (t && C) {
for (
var a,
b,
c,
e,
d,
g,
l,
h,
m,
n,
k,
q,
s,
w,
p = [],
B = [],
x = { percent: null, total: null },
v = null,
y = 0;
y < C.length;
y++
)
(w = P[y]),
(w =
"undefined" !== typeof w.x5
? (w.y2 + w.y4) / 2
: (w.y2 + w.y3) / 2),
(w = f(w).x2 + 1),
(p[y] = L - w - S);
w = 0.5 * S;
for (var y = 0, A = C.length - 1; y < C.length || 0 <= A; y++, A--) {
b = t.reversed ? C[A] : C[y];
a = b.color
? b.color
: t.reversed
? t._colorSet[(C.length - 1 - y) % t._colorSet.length]
: t._colorSet[y % t._colorSet.length];
c = b.indexLabelPlacement || t.indexLabelPlacement || "outside";
e =
b.indexLabelBackgroundColor ||
t.indexLabelBackgroundColor ||
(r ? "transparent" : null);
d = b.indexLabelFontColor || t.indexLabelFontColor || "#979797";
g = u(b.indexLabelFontSize)
? t.indexLabelFontSize
: b.indexLabelFontSize;
l = b.indexLabelFontStyle || t.indexLabelFontStyle || "normal";
h = b.indexLabelFontFamily || t.indexLabelFontFamily || "arial";
m = b.indexLabelFontWeight || t.indexLabelFontWeight || "normal";
a = b.indexLabelLineColor || t.options.indexLabelLineColor || a;
n =
"number" === typeof b.indexLabelLineThickness
? b.indexLabelLineThickness
: "number" === typeof t.indexLabelLineThickness
? t.indexLabelLineThickness
: 2;
k = b.indexLabelLineDashType || t.indexLabelLineDashType || "solid";
q =
"undefined" !== typeof b.indexLabelWrap
? b.indexLabelWrap
: "undefined" !== typeof t.indexLabelWrap
? t.indexLabelWrap
: !0;
s = t.dataPointIds[y];
z._eventManager.objectMap[s] = {
id: s,
objectType: "dataPoint",
dataPointIndex: y,
dataSeriesIndex: 0,
funnelSection: P[t.reversed ? C.length - 1 - y : y],
};
"inside" === t.indexLabelPlacement &&
((p[y] =
y !== fa
? t.reversed
? P[y].x2 - P[y].x1
: P[y].x3 - P[y].x4
: P[y].x3 - P[y].x6),
20 > p[y] &&
((p[y] =
y !== fa
? t.reversed
? P[y].x3 - P[y].x4
: P[y].x2 - P[y].x1
: P[y].x2 - P[y].x1),
(p[y] /= 2)));
s = b.indexLabelMaxWidth
? b.indexLabelMaxWidth
: t.options.indexLabelMaxWidth
? t.indexLabelMaxWidth
: p[y];
if (s > p[y] || 0 > s) s = p[y];
B[y] = "inside" === t.indexLabelPlacement ? P[y].height : !1;
x = z.getPercentAndTotal(t, b);
if (t.indexLabelFormatter || b.indexLabelFormatter)
v = {
chart: z.options,
dataSeries: t,
dataPoint: b,
total: x.total,
percent: x.percent,
};
b = b.indexLabelFormatter
? b.indexLabelFormatter(v)
: b.indexLabel
? z.replaceKeywordsWithValue(b.indexLabel, b, t, y)
: t.indexLabelFormatter
? t.indexLabelFormatter(v)
: t.indexLabel
? z.replaceKeywordsWithValue(t.indexLabel, b, t, y)
: b.label
? b.label
: "";
0 >= n && (n = 0);
1e3 > s && 1e3 - s < w && (s += 1e3 - s);
Q.roundRect || Ea(Q);
c = new ka(Q, {
fontSize: g,
fontFamily: h,
fontColor: d,
fontStyle: l,
fontWeight: m,
horizontalAlign: c,
backgroundColor: e,
maxWidth: s,
maxHeight: !1 === B[y] ? (q ? 4.28571429 * g : 1.5 * g) : B[y],
text: b,
padding: ga,
});
c.measureText();
J.push({
textBlock: c,
id: t.reversed ? A : y,
isDirty: !1,
lineColor: a,
lineThickness: n,
lineDashType: k,
height: c.height < c.maxHeight ? c.height : c.maxHeight,
width: c.width < c.maxWidth ? c.width : c.maxWidth,
});
}
}
}
function e() {
var a,
b,
c,
e,
d,
f = [];
d = !1;
c = 0;
for (
var g,
l = L - V - S / 2,
l = t.options.indexLabelMaxWidth
? t.indexLabelMaxWidth > l
? l
: t.indexLabelMaxWidth
: l,
h = J.length - 1;
0 <= h;
h--
) {
g = C[J[h].id];
c = J[h];
e = c.textBlock;
b = (a = n(h) < P.length ? J[n(h)] : null) ? a.textBlock : null;
c = c.height;
a && e.y + c + ga > b.y && (d = !0);
c = g.indexLabelMaxWidth || l;
if (c > l || 0 > c) c = l;
f.push(c);
}
if (d)
for (h = J.length - 1; 0 <= h; h--)
(a = P[h]),
(J[h].textBlock.maxWidth = f[f.length - (h + 1)]),
J[h].textBlock.measureText(),
(J[h].textBlock.x = L - l),
(c =
J[h].textBlock.height < J[h].textBlock.maxHeight
? J[h].textBlock.height
: J[h].textBlock.maxHeight),
(d =
J[h].textBlock.width < J[h].textBlock.maxWidth
? J[h].textBlock.width
: J[h].textBlock.maxWidth),
(J[h].height = c),
(J[h].width = d),
(c =
"undefined" !== typeof a.x5
? (a.y2 + a.y4) / 2
: (a.y2 + a.y3) / 2),
(J[h].textBlock.y = c - J[h].height / 2),
t.reversed
? (J[h].textBlock.y + J[h].height > pa + D &&
(J[h].textBlock.y = pa + D - J[h].height),
J[h].textBlock.y < wa - D && (J[h].textBlock.y = wa - D))
: (J[h].textBlock.y < pa - D && (J[h].textBlock.y = pa - D),
J[h].textBlock.y + J[h].height > wa + D &&
(J[h].textBlock.y = wa + D - J[h].height));
}
function g() {
var a, b, c, e;
if ("inside" !== t.indexLabelPlacement)
for (var d = 0; d < P.length; d++)
0 == J[d].textBlock.text.length
? (J[d].isDirty = !0)
: ((a = P[d]),
(c =
"undefined" !== typeof a.x5
? (a.y2 + a.y4) / 2
: (a.y2 + a.y3) / 2),
(b = t.reversed
? "undefined" !== typeof a.x5
? c > Da
? f(c).x2 + 1
: (a.x2 + a.x3) / 2 + 1
: (a.x2 + a.x3) / 2 + 1
: "undefined" !== typeof a.x5
? c < Da
? f(c).x2 + 1
: (a.x4 + a.x3) / 2 + 1
: (a.x2 + a.x3) / 2 + 1),
(J[d].textBlock.x = b + S),
(J[d].textBlock.y = c - J[d].height / 2),
t.reversed
? (J[d].textBlock.y + J[d].height > pa + D &&
(J[d].textBlock.y = pa + D - J[d].height),
J[d].textBlock.y < wa - D && (J[d].textBlock.y = wa - D))
: (J[d].textBlock.y < pa - D && (J[d].textBlock.y = pa - D),
J[d].textBlock.y + J[d].height > wa + D &&
(J[d].textBlock.y = wa + D - J[d].height)));
else
for (d = 0; d < P.length; d++)
0 == J[d].textBlock.text.length
? (J[d].isDirty = !0)
: ((a = P[d]),
(b = a.height),
(c = J[d].height),
(e = J[d].width),
b >= c
? ((b =
d != fa
? (a.x4 + a.x3) / 2 - e / 2
: (a.x5 + a.x4) / 2 - e / 2),
(c =
d != fa
? (a.y1 + a.y3) / 2 - c / 2
: (a.y1 + a.y4) / 2 - c / 2),
(J[d].textBlock.x = b),
(J[d].textBlock.y = c))
: (J[d].isDirty = !0));
}
function m() {
function a(b, c) {
var d;
if (0 > b || b >= J.length) return 0;
var e,
f = J[b].textBlock;
if (0 > c) {
c *= -1;
e = q(b);
d = l(e, b);
if (d >= c) return (f.y -= c), c;
if (0 == b) return 0 < d && (f.y -= d), d;
d += a(e, -(c - d));
0 < d && (f.y -= d);
return d;
}
e = n(b);
d = l(b, e);
if (d >= c) return (f.y += c), c;
if (b == P.length - 1) return 0 < d && (f.y += d), d;
d += a(e, c - d);
0 < d && (f.y += d);
return d;
}
function b() {
var a,
d,
e,
f,
g = 0,
h;
f = (Z - O + 2 * D) / k;
h = k;
for (var l, m = 1; m < h; m++) {
e = m * f;
for (var s = J.length - 1; 0 <= s; s--)
!J[s].isDirty &&
J[s].textBlock.y < e &&
J[s].textBlock.y + J[s].height > e &&
((l = n(s)),
!(l >= J.length - 1) &&
J[s].textBlock.y + J[s].height + ga > J[l].textBlock.y &&
(J[s].textBlock.y =
J[s].textBlock.y + J[s].height - e > e - J[s].textBlock.y
? e + 1
: e - J[s].height - 1));
}
for (l = P.length - 1; 0 < l; l--)
if (!J[l].isDirty) {
e = q(l);
if (0 > e && ((e = 0), J[e].isDirty)) break;
if (J[l].textBlock.y < J[e].textBlock.y + J[e].height) {
d = d || l;
f = l;
for (
h = 0;
J[f].textBlock.y < J[e].textBlock.y + J[e].height + ga;
) {
a = a || J[f].textBlock.y + J[f].height;
h += J[f].height;
h += ga;
f = e;
if (0 >= f) {
f = 0;
h += J[f].height;
break;
}
e = q(f);
if (0 > e) {
f = 0;
h += J[f].height;
break;
}
}
if (f != l) {
g = J[f].textBlock.y;
a -= g;
a = h - a;
g = c(a, d, f);
break;
}
}
}
return g;
}
function c(a, b, d) {
var e = [],
f = 0,
g = 0;
for (a = Math.abs(a); d <= b; d++) e.push(P[d]);
e.sort(function (a, b) {
return a.height - b.height;
});
for (d = 0; d < e.length; d++)
if (((b = e[d]), f < a))
g++,
(f += J[b.id].height + ga),
(J[b.id].textBlock.text = ""),
(J[b.id].indexLabelText = ""),
(J[b.id].isDirty = !0),
J[b.id].textBlock.measureText();
else break;
return g;
}
for (var d, e, f, g, h, m, k = 1, s = 0; s < 2 * k; s++) {
for (
var w = J.length - 1;
0 <= w &&
!(0 <= q(w) && q(w),
(f = J[w]),
(g = f.textBlock),
(m = (h = n(w) < P.length ? J[n(w)] : null) ? h.textBlock : null),
(d = +f.height.toFixed(6)),
(e = +g.y.toFixed(6)),
!f.isDirty &&
h &&
e + d + ga > +m.y.toFixed(6) &&
((d = g.y + d + ga - m.y),
(e = a(w, -d)),
e < d && (0 < e && (d -= e), (e = a(n(w), d)), e != d)));
w--
);
b();
}
}
function l(a, b) {
return (
(b < P.length ? J[b].textBlock.y : t.reversed ? pa + D : wa + D) -
(0 > a
? t.reversed
? wa - D
: pa - D
: J[a].textBlock.y + J[a].height + ga)
);
}
function k(a, b, c) {
var d,
e,
f,
l = [],
m = D,
n = [];
-1 !== b &&
(0 <= W.indexOf(b)
? ((e = W.indexOf(b)), W.splice(e, 1))
: (W.push(b),
(W = W.sort(function (a, b) {
return a - b;
}))));
if (0 === W.length) l = ia;
else {
e =
(D *
(1 != W.length || (0 != W[0] && W[0] != P.length - 1) ? 2 : 1)) /
h();
for (var q = 0; q < P.length; q++) {
if (1 == W.length && 0 == W[0]) {
if (0 === q) {
l.push(ia[q]);
d = m;
continue;
}
} else 0 === q && (d = -1 * m);
l.push(ia[q] + d);
if (0 <= W.indexOf(q) || (q < P.length && 0 <= W.indexOf(q + 1)))
d += e;
}
}
f = (function () {
for (var a = [], b = 0; b < P.length; b++) a.push(l[b] - P[b].y1);
return a;
})();
var w = {
startTime: new Date().getTime(),
duration: c || 500,
easingFunction: function (a, b, c, d) {
return M.easing.easeOutQuart(a, b, c, d);
},
changeSection: function (a) {
for (var b, c, d = 0; d < P.length; d++)
(b = f[d]),
(c = P[d]),
(b *= a),
"undefined" === typeof n[d] && (n[d] = 0),
0 > n && (n *= -1),
(c.y1 += b - n[d]),
(c.y2 += b - n[d]),
(c.y3 += b - n[d]),
(c.y4 += b - n[d]),
c.y5 && ((c.y5 += b - n[d]), (c.y6 += b - n[d])),
(n[d] = b);
},
};
a._animator.animate(
0,
c,
function (c) {
var d = a.plotArea.ctx || a.ctx;
ja = !0;
d.clearRect(x.x1, x.y1, x.x2 - x.x1, x.y2 - x.y1);
d.fillStyle = a.backgroundColor;
d.fillRect(x.x1, x.y1, x.width, x.height);
w.changeSection(c, b);
var e = {};
e.dataSeries = t;
e.dataPoint = t.reversed
? t.dataPoints[C.length - 1 - b]
: t.dataPoints[b];
e.index = t.reversed ? C.length - 1 - b : b;
a.toolTip.highlightObjects([e]);
for (e = 0; e < P.length; e++) ra(d, P[e], t.fillOpacity);
v(d);
H && ("inside" !== t.indexLabelPlacement ? s(d) : g(), p(d));
1 <= c && (ja = !1);
},
null,
M.easing.easeOutQuart
);
}
function h() {
for (var a = 0, b = 0; b < P.length - 1; b++)
(0 <= W.indexOf(b) || 0 <= W.indexOf(b + 1)) && a++;
return a;
}
function s(a) {
for (var b, c, d, e, g = 0; g < P.length; g++)
(e = 1 === J[g].lineThickness % 2 ? 0.5 : 0),
(c = (((P[g].y2 + P[g].y4) / 2) << 0) + e),
(b = f(c).x2 - 1),
(d = J[g].textBlock.x),
(e = ((J[g].textBlock.y + J[g].height / 2) << 0) + e),
J[g].isDirty ||
0 == J[g].lineThickness ||
((a.strokeStyle = J[g].lineColor),
(a.lineWidth = J[g].lineThickness),
a.setLineDash &&
a.setLineDash(R(J[g].lineDashType, J[g].lineThickness)),
a.beginPath(),
a.moveTo(b, c),
a.lineTo(d, e),
a.stroke());
}
function q(a) {
for (a -= 1; -1 <= a && -1 != a && J[a].isDirty; a--);
return a;
}
function n(a) {
for (a += 1; a <= P.length && a != P.length && J[a].isDirty; a++);
return a;
}
function f(a) {
for (var b, c = 0; c < C.length; c++)
if (P[c].y1 < a && P[c].y4 > a) {
b = P[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 p(a) {
for (var b = 0; b < P.length; b++)
J[b].isDirty ||
(a && (J[b].textBlock.ctx = a), J[b].textBlock.render(!0));
}
function v(a) {
z.plotArea.layoutManager.reset();
a.roundRect || Ea(a);
z.title &&
(z.title.dockInsidePlotArea ||
("center" === z.title.horizontalAlign &&
"center" === z.title.verticalAlign)) &&
((z.title.ctx = a), z.title.render());
if (z.subtitles)
for (var b = 0; b < z.subtitles.length; b++) {
var c = z.subtitles[b];
if (
c.dockInsidePlotArea ||
("center" === c.horizontalAlign && "center" === c.verticalAlign)
)
(z.subtitles.ctx = a), c.render();
}
z.legend &&
(z.legend.dockInsidePlotArea ||
("center" === z.legend.horizontalAlign &&
"center" === z.legend.verticalAlign)) &&
((z.legend.ctx = a), z.legend.setLayout(), z.legend.render());
U.fNg && U.fNg(z);
}
var z = this;
if (!(0 >= a.dataSeriesIndexes.length)) {
for (
var t = this.data[a.dataSeriesIndexes[0]],
C = t.dataPoints,
x = this.plotArea,
D = 0.025 * x.width,
y = 0.01 * x.width,
A = 0,
F = x.height - 2 * D,
E = Math.min(x.width - 2 * y, 2.8 * x.height),
H = !1,
I = 0;
I < C.length;
I++
)
if (
(!H &&
"undefined" !== typeof C[I].indexLabel &&
null !== C[I].indexLabel &&
0 < C[I].indexLabel.toString().length &&
(H = !0),
!H &&
"undefined" !== typeof C[I].label &&
null !== C[I].label &&
0 < C[I].label.toString().length &&
(H = !0),
(!H && "function" === typeof t.indexLabelFormatter) ||
"function" === typeof C[I].indexLabelFormatter)
)
H = !0;
H =
H ||
("undefined" !== typeof t.indexLabel &&
null !== t.indexLabel &&
0 < t.indexLabel.toString().length);
("inside" !== t.indexLabelPlacement && H) ||
(y = (x.width - 0.75 * E) / 2);
var I = x.x1 + y,
L = x.x2 - y,
O = x.y1 + D,
Z = x.y2 - D,
Q = a.targetCanvasCtx || this.plotArea.ctx || this.ctx;
if (0 != t.length && t.dataPoints && t.visible && 0 !== C.length) {
var N, G;
a = (75 * E) / 100;
var S = (30 * (L - a)) / 100;
"funnel" === t.type
? ((N = u(t.options.neckHeight) ? 0.35 * F : t.neckHeight),
(G = u(t.options.neckWidth) ? 0.25 * a : t.neckWidth),
"string" === typeof N && N.match(/%$/)
? ((N = parseInt(N)), (N = (N * F) / 100))
: (N = parseInt(N)),
"string" === typeof G && G.match(/%$/)
? ((G = parseInt(G)), (G = (G * a) / 100))
: (G = parseInt(G)),
N > F ? (N = F) : 0 >= N && (N = 0),
G > a ? (G = a - 0.5) : 0 >= G && (G = 0))
: "pyramid" === t.type &&
((G = N = 0), (t.reversed = t.reversed ? !1 : !0));
var y = I + a / 2,
$ = I,
V = I + a,
pa = t.reversed ? Z : O,
K = y - G / 2,
ea = y + G / 2,
Da = t.reversed ? O + N : Z - N,
wa = t.reversed ? O : Z;
a = [];
var y = [],
P = [],
E = [],
X = O,
fa,
ba = (Da - pa) / (K - $),
ha = -ba,
I =
"area" === (t.valueRepresents ? t.valueRepresents : "height")
? b()
: d();
if (-1 !== I) {
if (t.reversed)
for (E.push(X), G = I.length - 1; 0 < G; G--)
(X += I[G]), E.push(X);
else for (G = 0; G < I.length; G++) (X += I[G]), E.push(X);
if (t.reversed)
for (G = 0; G < I.length; G++)
E[G] < Da
? (a.push(K), y.push(ea), (fa = G))
: (a.push((E[G] - pa + ba * $) / ba),
y.push((E[G] - pa + ha * V) / ha));
else
for (G = 0; G < I.length; G++)
E[G] < Da
? (a.push((E[G] - pa + ba * $) / ba),
y.push((E[G] - pa + ha * V) / ha),
(fa = G))
: (a.push(K), y.push(ea));
for (G = 0; G < I.length - 1; G++)
(X = t.reversed
? C[C.length - 1 - G].color
? C[C.length - 1 - G].color
: t._colorSet[(C.length - 1 - G) % t._colorSet.length]
: C[G].color
? C[G].color
: t._colorSet[G % t._colorSet.length]),
G === fa
? P.push({
x1: a[G],
y1: E[G],
x2: y[G],
y2: E[G],
x3: ea,
y3: Da,
x4: y[G + 1],
y4: E[G + 1],
x5: a[G + 1],
y5: E[G + 1],
x6: K,
y6: Da,
id: G,
height: E[G + 1] - E[G],
color: X,
})
: P.push({
x1: a[G],
y1: E[G],
x2: y[G],
y2: E[G],
x3: y[G + 1],
y3: E[G + 1],
x4: a[G + 1],
y4: E[G + 1],
id: G,
height: E[G + 1] - E[G],
color: X,
});
var ga = 2,
J = [],
ja = !1,
W = [],
ia = [],
I = !1;
a = a = 0;
Fa(W);
for (G = 0; G < C.length; G++)
C[G].exploded &&
((I = !0), t.reversed ? W.push(C.length - 1 - G) : W.push(G));
Q.clearRect(x.x1, x.y1, x.width, x.height);
Q.fillStyle = z.backgroundColor;
Q.fillRect(x.x1, x.y1, x.width, x.height);
if (
H &&
t.visible &&
(c(), g(), e(), "inside" !== t.indexLabelPlacement)
) {
m();
for (G = 0; G < C.length; G++)
J[G].isDirty ||
((a = J[G].textBlock.x + J[G].width),
(a = (L - a) / 2),
0 == G && (A = a),
A > a && (A = a));
for (G = 0; G < P.length; G++)
(P[G].x1 += A),
(P[G].x2 += A),
(P[G].x3 += A),
(P[G].x4 += A),
P[G].x5 && ((P[G].x5 += A), (P[G].x6 += A)),
(J[G].textBlock.x += A);
}
for (G = 0; G < P.length; G++)
(A = P[G]), ra(Q, A, t.fillOpacity), ia.push(A.y1);
v(Q);
H &&
t.visible &&
("inside" === t.indexLabelPlacement || z.animationEnabled || s(Q),
z.animationEnabled || p());
if (!H)
for (G = 0; G < C.length; G++)
(A = t.dataPointIds[G]),
(a = {
id: A,
objectType: "dataPoint",
dataPointIndex: G,
dataSeriesIndex: 0,
funnelSection: P[t.reversed ? C.length - 1 - G : G],
}),
(z._eventManager.objectMap[A] = a);
!z.animationEnabled && I
? k(z, -1, 0)
: z.animationEnabled && !z.animatedRender && k(z, -1, 0);
this.funnelPyramidClickHandler = function (a) {
var b = -1;
if (
!ja &&
!z.isAnimating &&
(u(a.dataSeries.explodeOnClick) ||
a.dataSeries.explodeOnClick) &&
((b = t.reversed
? C.length - 1 - a.dataPointIndex
: a.dataPointIndex),
0 <= b)
) {
a = b;
if ("funnel" === t.type || "pyramid" === t.type)
t.reversed
? (C[C.length - 1 - a].exploded = C[C.length - 1 - a]
.exploded
? !1
: !0)
: (C[a].exploded = C[a].exploded ? !1 : !0);
k(z, b, 500);
}
};
return {
source: Q,
dest: this.plotArea.ctx,
animationCallback: function (a, b) {
M.fadeInAnimation(a, b);
1 <= a && (k(z, -1, 500), v(z.plotArea.ctx || z.ctx));
},
easingFunction: M.easing.easeInQuad,
animationBase: 0,
};
}
}
}
};
p.prototype.requestAnimFrame = (function () {
return (
window.requestAnimationFrame ||
window.webkitRequestAnimationFrame ||
window.mozRequestAnimationFrame ||
window.oRequestAnimationFrame ||
window.msRequestAnimationFrame ||
function (a) {
window.setTimeout(a, 1e3 / 60);
}
);
})();
p.prototype.cancelRequestAnimFrame =
window.cancelAnimationFrame ||
window.webkitCancelRequestAnimationFrame ||
window.mozCancelRequestAnimationFrame ||
window.oCancelRequestAnimationFrame ||
window.msCancelRequestAnimationFrame ||
clearTimeout;
p.prototype.set = function (a, d, b) {
b = "undefined" === typeof b ? !0 : b;
"options" === a
? ((this.options = d), b && this.render())
: p.base.set.call(this, a, d, b);
};
p.prototype.exportChart = function (a) {
a = "undefined" === typeof a ? {} : a;
var d = a.format ? a.format : "png",
b = a.fileName ? a.fileName : this.exportFileName;
if (a.toDataURL) return this.canvas.toDataURL("image/" + d);
Ta(this.canvas, d, b);
};
p.prototype.print = function () {
var a = this.exportChart({ toDataURL: !0 }),
d = document.createElement("iframe");
d.setAttribute("class", "canvasjs-chart-print-frame");
d.setAttribute(
"style",
"position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;"
);
d.style.height = this.height + "px";
this._canvasJSContainer.appendChild(d);
var b = this,
c = d.contentWindow || d.contentDocument.document || d.contentDocument;
c.document.open();
c.document.write(
'\n