/*
CanvasJS HTML5 & JavaScript Charts - v2.0.1 GA - https://canvasjs.com/
Copyright 2017 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-canvasjs/
*/
(function () {
function pa(m, s) {
m.prototype = $a(s.prototype);
m.prototype.constructor = m;
m.base = s.prototype
}
function $a(m) {
function s() {}
s.prototype = m;
return new s
}
function Ta(m, s, q) {
"millisecond" === q ? m.setMilliseconds(m.getMilliseconds() + 1 * s) : "second" === q ? m.setSeconds(m.getSeconds() + 1 * s) : "minute" === q ? m.setMinutes(m.getMinutes() + 1 * s) : "hour" === q ? m.setHours(m.getHours() + 1 * s) : "day" === q ? m.setDate(m.getDate() + 1 * s) : "week" === q ? m.setDate(m.getDate() + 7 * s) : "month" === q ? m.setMonth(m.getMonth() + 1 * s) : "year" === q && m.setFullYear(m.getFullYear() +
1 * s);
return m
}
function ia(m, s) {
var q = !1;
0 > m && (q = !0, m *= -1);
m = "" + m;
for (s = s ? s : 1; m.length < s;) m = "0" + m;
return q ? "-" + m : m
}
function Ga(m) {
if (!m) return m;
m = m.replace(/^\s\s*/, "");
for (var s = /\s/, q = m.length; s.test(m.charAt(--q)););
return m.slice(0, q + 1)
}
function Ca(m) {
m.roundRect = function (m, q, v, y, x, z, Q, C) {
Q && (this.fillStyle = Q);
C && (this.strokeStyle = C);
"undefined" === typeof x && (x = 5);
this.lineWidth = z;
this.beginPath();
this.moveTo(m + x, q);
this.lineTo(m + v - x, q);
this.quadraticCurveTo(m + v, q, m + v, q + x);
this.lineTo(m + v, q + y -
x);
this.quadraticCurveTo(m + v, q + y, m + v - x, q + y);
this.lineTo(m + x, q + y);
this.quadraticCurveTo(m, q + y, m, q + y - x);
this.lineTo(m, q + x);
this.quadraticCurveTo(m, q, m + x, q);
this.closePath();
Q && this.fill();
C && 0 < z && this.stroke()
}
}
function Pa(m, s) {
return m - s
}
function R(m) {
var s = ((m & 16711680) >> 16).toString(16),
q = ((m & 65280) >> 8).toString(16);
m = ((m & 255) >> 0).toString(16);
s = 2 > s.length ? "0" + s : s;
q = 2 > q.length ? "0" + q : q;
m = 2 > m.length ? "0" + m : m;
return "#" + s + q + m
}
function ab(m, s) {
var q = this.length >>> 0,
v = Number(s) || 0,
v = 0 > v ? Math.ceil(v) : Math.floor(v);
for (0 > v && (v += q); v < q; v++)
if (v in this && this[v] === m) return v;
return -1
}
function y(m) {
return null === m || "undefined" === typeof m
}
function Da(m) {
m.indexOf || (m.indexOf = ab);
return m
}
function bb(m) {
if (Z.fSDec) m[ka("`eeDwdouMhrudods")](ka("e`u`@ohl`uhnoHuds`uhnoDoe"), function () {
Z._fTWm && Z._fTWm(m)
})
}
function Ua(m, s, q) {
q = q || "normal";
var v = m + "_" + s + "_" + q,
y = Va[v];
if (isNaN(y)) {
try {
m = "position:absolute; left:0px; top:-20000px; padding:0px;margin:0px;border:none;white-space:pre;line-height:normal;font-family:" + m + "; font-size:" +
s + "px; font-weight:" + q + ";";
if (!ra) {
var x = document.body;
ra = document.createElement("span");
ra.innerHTML = "";
var z = document.createTextNode("Mpgyi");
ra.appendChild(z);
x.appendChild(ra)
}
ra.style.display = "";
ra.setAttribute("style", m);
y = Math.round(ra.offsetHeight);
ra.style.display = "none"
} catch (Q) {
y = Math.ceil(1.1 * s)
}
y = Math.max(y, s);
Va[v] = y
}
return y
}
function G(m, s) {
var q = [];
if (q = {
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]
}[m || "solid"])
for (var v = 0; v < q.length; v++) q[v] *= s;
else q = [];
return q
}
function N(m, s, q, v) {
return m.addEventListener ? (m.addEventListener(s, q, v || !1), q) : m.attachEvent ? (v = function (s) {
s = s || window.event;
s.preventDefault = s.preventDefault || function () {
s.returnValue = !1
};
s.stopPropagation = s.stopPropagation || function () {
s.cancelBubble = !0
};
q.call(m, s)
}, m.attachEvent("on" + s, v), v) : !1
}
function Wa(m, s, q) {
m *= ha;
s *= ha;
m = q.getImageData(m, s, 2, 2).data;
s = !0;
for (q = 0; 4 > q; q++)
if (m[q] !== m[q + 4] | m[q] !== m[q + 8] | m[q] !== m[q + 12]) {
s = !1;
break
}
return s ? m[0] << 16 | m[1] << 8 | m[2] : 0
}
function na(m, s, q) {
return m in s ? s[m] : q[m]
}
function Ha(m, s, q) {
if (v && Xa) {
var y = m.getContext("2d");
La = y.webkitBackingStorePixelRatio || y.mozBackingStorePixelRatio || y.msBackingStorePixelRatio || y.oBackingStorePixelRatio || y.backingStorePixelRatio || 1;
ha = Qa / La;
m.width = s * ha;
m.height = q * ha;
Qa !== La && (m.style.width = s + "px", m.style.height = q + "px", y.scale(ha, ha))
} else m.width = s, m.height = q
}
function cb(m) {
// if (!Ya) {
// var s = !1,
// q = !1;
// // "undefined" === typeof sa.Chart.creditHref ? (m.creditHref = ka("iuuqr;..b`ow`rkr/bnl."), m.creditText = ka("B`ow`rKR/bnl")) : (s = m.updateOption("creditText"), q = m.updateOption("creditHref"));
// // if (m.creditHref && m.creditText) {
// // m._creditLink || (m._creditLink = document.createElement("a"), m._creditLink.setAttribute("class", "canvasjs-chart-credit"), m._creditLink.setAttribute("style", "outline:none;margin:0px;position:absolute;right:2px;top:" + (m.height - 14) + "px;color:dimgrey;text-decoration:none;font-size:11px;font-family: Calibri, Lucida Grande, Lucida Sans Unicode, Arial, sans-serif"),
// // m._creditLink.setAttribute("tabIndex", -1), m._creditLink.setAttribute("target", "_blank"));
// // if (0 === m.renderCount || s || q) m._creditLink.setAttribute("href", m.creditHref), m._creditLink.innerHTML = m.creditText;
// // m._creditLink && m.creditHref && m.creditText ? (m._creditLink.parentElement || m._canvasJSContainer.appendChild(m._creditLink), m._creditLink.style.top = m.height - 14 + "px") : m._creditLink.parentElement && m._canvasJSContainer.removeChild(m._creditLink)
// // }
// }
}
function ua(m, s) {
var q = document.createElement("canvas");
q.setAttribute("class",
"canvasjs-chart-canvas");
Ha(q, m, s);
v || "undefined" === typeof G_vmlCanvasManager || G_vmlCanvasManager.initElement(q);
return q
}
function qa(m, s, q) {
for (var v in q) s.style[v] = q[v]
}
function va(m, s, q) {
s.getAttribute("state") || (s.style.backgroundColor = m.toolbar.backgroundColor, s.style.color = m.toolbar.fontColor, s.style.border = "none", qa(m, s, {
WebkitUserSelect: "none",
MozUserSelect: "none",
msUserSelect: "none",
userSelect: "none"
}));
s.getAttribute("state") !== q && (s.setAttribute("state", q), s.setAttribute("type", "button"),
qa(m, s, {
padding: "5px 12px",
cursor: "pointer",
"float": "left",
width: "40px",
height: "25px",
outline: "0px",
verticalAlign: "baseline",
lineHeight: "0"
}), s.setAttribute("title", m._cultureInfo[q + "Text"]), s.innerHTML = "
")
}
function Ma() {
for (var m = null, s = 0; s < arguments.length; s++) m = arguments[s], m.style && (m.style.display = "inline")
}
function wa() {
for (var m = null, s = 0; s < arguments.length; s++)(m = arguments[s]) && m.style && (m.style.display = "none")
}
function X(m, s, q, v, x) {
this._defaultsKey = m;
this._themeOptionsKey = s;
this._index = v;
this.parent = x;
this._eventListeners = [];
m = {};
this.theme && y(s) && y(v) ? m = y(ya[this.theme]) ? ya.light1 : ya[this.theme] : this.parent && (this.parent.themeOptions && this.parent.themeOptions[s]) && (null === v ? m = this.parent.themeOptions[s] : 0 < this.parent.themeOptions[s].length && (v = Math.min(this.parent.themeOptions[s].length - 1, v), m = this.parent.themeOptions[s][v]));
this.themeOptions = m;
this.options = q ? q : {
_isPlaceholder: !0
};
this.setOptions(this.options,
m)
}
function Ea(m, s, q, v, y) {
"undefined" === typeof y && (y = 0);
this._padding = y;
this._x1 = m;
this._y1 = s;
this._x2 = q;
this._y2 = v;
this._rightOccupied = this._leftOccupied = this._bottomOccupied = this._topOccupied = this._padding
}
function la(m, s) {
la.base.constructor.call(this, "TextBlock", null, s, null, null);
this.ctx = m;
this._isDirty = !0;
this._wrappedText = null;
this._initialize()
}
function Ra(m, s) {
Ra.base.constructor.call(this, "Toolbar", "toolbar", s, null, m);
this.chart = m;
this.canvas = m.canvas;
this.ctx = this.chart.ctx;
this.optionsName =
"toolbar"
}
function Ia(m, s) {
Ia.base.constructor.call(this, "Title", "title", s, null, m);
this.chart = m;
this.canvas = m.canvas;
this.ctx = this.chart.ctx;
this.optionsName = "title";
if (y(this.options.margin) && m.options.subtitles)
for (var q = m.options.subtitles, v = 0; v < q.length; v++)
if ((y(q[v].horizontalAlign) && "center" === this.horizontalAlign || q[v].horizontalAlign === this.horizontalAlign) && (y(q[v].verticalAlign) && "top" === this.verticalAlign || q[v].verticalAlign === this.verticalAlign) && !q[v].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 Na(m, s, q) {
Na.base.constructor.call(this, "Subtitle", "subtitles", s, q, m);
this.chart = m;
this.canvas = m.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 Ja(m) {
var s;
m && Ka[m] && (s = Ka[m]);
Ja.base.constructor.call(this, "CultureInfo", null, s, null, null)
}
var Z = {},
v = !!document.createElement("canvas").getContext,
sa = {
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: v ? "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: v ? "transparent" : null,
borderColor: v ? "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: v ? "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: v ? "transparent" : null,
titleBorderColor: v ? "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: v ? "transparent" : null,
labelBorderColor: v ? "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: v ? "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: v ? "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: v ? "grey" : null,
labelBorderColor: v ? "grey" : null,
labelBorderThickness: 0,
labelCornerRadius: 0,
labelFontFamily: v ? "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: v ? "transparent" : null,
legendMarkerBorderThickness: 0,
markerType: "circle",
markerColor: null,
markerSize: null,
markerBorderColor: v ? "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(" ")
}
},
Ka = {
en: {}
},
x = v ? "Trebuchet MS, Helvetica, sans-serif" : "Arial",
Fa = v ? "Impact, Charcoal, sans-serif" : "Arial",
Aa = {
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(" ")
},
O, ga, T, Y, fa;
ga = "#333333";
T = "#000000";
O = "#666666";
fa = Y = "#000000";
var aa = 20,
z = 14,
Sa = {
colorSet: "colorSet1",
backgroundColor: "#FFFFFF",
title: {
fontFamily: Fa,
fontSize: 32,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
},
subtitles: [{
fontFamily: Fa,
fontSize: z,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
}],
data: [{
indexLabelFontFamily: x,
indexLabelFontSize: z,
indexLabelFontColor: ga,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1
}],
axisX: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: ga,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid"
}
}],
axisX2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: ga,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid"
}
}],
axisY: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: ga,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid"
}
}],
axisY2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: ga,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#EEEEEE",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#BBBBBB",
lineThickness: 1,
lineDashType: "solid"
}
}],
legend: {
fontFamily: x,
fontSize: 14,
fontColor: ga,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center"
},
toolTip: {
fontFamily: x,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1
}
};
T = ga = "#F5F5F5";
O = "#FFFFFF";
Y = "#40BAF1";
fa = "#F5F5F5";
var aa = 20,
z = 14,
Za = {
colorSet: "colorSet2",
title: {
fontFamily: x,
fontSize: 33,
fontColor: "#3A3A3A",
fontWeight: "bold",
verticalAlign: "top",
margin: 5
},
subtitles: [{
fontFamily: x,
fontSize: z,
fontColor: "#3A3A3A",
fontWeight: "normal",
verticalAlign: "top",
margin: 5
}],
data: [{
indexLabelFontFamily: x,
indexLabelFontSize: z,
indexLabelFontColor: "#666666",
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1
}],
axisX: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 1,
lineColor: "#BBBBBB",
tickThickness: 1,
tickColor: "#BBBBBB",
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
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: x,
titleFontSize: aa,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 1,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
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: x,
titleFontSize: aa,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 0,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
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: x,
titleFontSize: aa,
titleFontColor: "#666666",
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#666666",
labelFontWeight: "normal",
lineThickness: 0,
lineColor: "#BBBBBB",
tickColor: "#BBBBBB",
tickThickness: 1,
gridThickness: 1,
gridColor: "#BBBBBB",
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FFA500",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FFA500",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
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: x,
fontSize: 14,
fontColor: "#3A3A3A",
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center"
},
toolTip: {
fontFamily: x,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1
}
};
T = ga = "#F5F5F5";
O = "#FFFFFF";
Y = "#40BAF1";
fa = "#F5F5F5";
aa = 20;
z = 14;
Fa = {
colorSet: "colorSet12",
backgroundColor: "#2A2A2A",
title: {
fontFamily: Fa,
fontSize: 32,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
},
subtitles: [{
fontFamily: Fa,
fontSize: z,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
}],
toolbar: {
backgroundColor: "#666666",
backgroundColorOnHover: "#FF7372",
borderColor: "#FF7372",
borderThickness: 1,
fontColor: "#F5F5F5",
fontColorOnHover: "#F5F5F5"
},
data: [{
indexLabelFontFamily: x,
indexLabelFontSize: z,
indexLabelFontColor: T,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1
}],
axisX: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisX2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisY: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisY2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
legend: {
fontFamily: x,
fontSize: 14,
fontColor: ga,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center"
},
toolTip: {
fontFamily: x,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
fontColor: T,
backgroundColor: "rgba(0, 0, 0, .7)"
}
};
O = "#FFFFFF";
T = ga = "#FAFAFA";
Y = "#40BAF1";
fa = "#F5F5F5";
var aa = 20,
z = 14,
ya = {
light1: Sa,
light2: Za,
dark1: Fa,
dark2: {
colorSet: "colorSet2",
backgroundColor: "#32373A",
title: {
fontFamily: x,
fontSize: 32,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
},
subtitles: [{
fontFamily: x,
fontSize: z,
fontColor: ga,
fontWeight: "normal",
verticalAlign: "top",
margin: 5
}],
toolbar: {
backgroundColor: "#666666",
backgroundColorOnHover: "#FF7372",
borderColor: "#FF7372",
borderThickness: 1,
fontColor: "#F5F5F5",
fontColorOnHover: "#F5F5F5"
},
data: [{
indexLabelFontFamily: x,
indexLabelFontSize: z,
indexLabelFontColor: T,
indexLabelFontWeight: "normal",
indexLabelLineThickness: 1
}],
axisX: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisX2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 1,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 0,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisY: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 0,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
axisY2: [{
titleFontFamily: x,
titleFontSize: aa,
titleFontColor: T,
titleFontWeight: "normal",
labelFontFamily: x,
labelFontSize: z,
labelFontColor: T,
labelFontWeight: "normal",
lineThickness: 0,
lineColor: O,
tickThickness: 1,
tickColor: O,
gridThickness: 1,
gridColor: O,
stripLines: [{
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#FF7300",
labelFontWeight: "normal",
labelBackgroundColor: null,
color: "#FF7300",
thickness: 1
}],
crosshair: {
labelFontFamily: x,
labelFontSize: z,
labelFontColor: "#000000",
labelFontWeight: "normal",
labelBackgroundColor: fa,
color: Y,
thickness: 1,
lineDashType: "dash"
},
scaleBreaks: {
type: "zigzag",
spacing: "2%",
lineColor: "#777777",
lineThickness: 1,
lineDashType: "solid",
color: "#111111"
}
}],
legend: {
fontFamily: x,
fontSize: 14,
fontColor: ga,
fontWeight: "bold",
verticalAlign: "bottom",
horizontalAlign: "center"
},
toolTip: {
fontFamily: x,
fontSize: 14,
fontStyle: "normal",
cornerRadius: 0,
borderThickness: 1,
fontColor: T,
backgroundColor: "rgba(0, 0, 0, .7)"
}
},
theme1: Sa,
theme2: Za,
theme3: Sa
},
U = {
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 () {
Z.fSDec = function (m) {
for (var s = "", q = 0; q < m.length; q++) s += String.fromCharCode(Math.ceil(m.length / 57 / 5) ^ m.charCodeAt(q));
return s
};
Z.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 sa[Z.fSDec("Bi`su")][Z.fSDec("bsdehuIsdg")];
Z.pro = {
sCH: sa[Z.fSDec("Bi`su")][Z.fSDec("bsdehuIsdg")]
};
Z._fTWm = function (m) {
if ("undefined" === typeof Z.pro.sCH && !Ya) try {
var s = m[Z.fSDec(Z.obj.cntx)];
s[Z.fSDec(Z.obj.txtBl)] = Z.fSDec(Z.obj.tp);
s[Z.fSDec(Z.obj.fnt)] = 11 + Z.fSDec(Z.obj.fntStr);
s[Z.fSDec(Z.obj.fSy)] = Z.fSDec(Z.obj.grClr);
s[Z.fSDec(Z.obj.fTx)](Z.fSDec(Z.obj.trVs), 2, m.height - 11 - 2)
} catch (q) {}
}
})();
var Va = {},
ra = null,
Ba = function () {
var m = /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,
s = "Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),
q = "Sun Mon Tue Wed Thu Fri Sat".split(" "),
v = "January February March April May June July August September October November December".split(" "),
y = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),
x = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
z = /[^-+\dA-Z]/g;
return function (Q, C, P) {
var G = P ? P.days : s,
O = P ? P.months : v,
R = P ? P.shortDays : q,
N = P ? P.shortMonths : y;
P = "";
var U = !1;
Q = Q && Q.getTime ? Q : Q ? new Date(Q) : new Date;
if (isNaN(Q)) throw SyntaxError("invalid date");
"UTC:" === C.slice(0, 4) && (C = C.slice(4), U = !0);
P = U ? "getUTC" : "get";
var Z = Q[P + "Date"](),
V = Q[P + "Day"](),
X = Q[P + "Month"](),
T = Q[P + "FullYear"](),
H = Q[P + "Hours"](),
W = Q[P + "Minutes"](),
a = Q[P + "Seconds"](),
f = Q[P + "Milliseconds"](),
b = U ? 0 : Q.getTimezoneOffset();
return P = C.replace(m, function (c) {
switch (c) {
case "D":
return Z;
case "DD":
return ia(Z, 2);
case "DDD":
return R[V];
case "DDDD":
return G[V];
case "M":
return X + 1;
case "MM":
return ia(X + 1, 2);
case "MMM":
return N[X];
case "MMMM":
return O[X];
case "Y":
return parseInt(String(T).slice(-2));
case "YY":
return ia(String(T).slice(-2), 2);
case "YYY":
return ia(String(T).slice(-3), 3);
case "YYYY":
return ia(T, 4);
case "h":
return H % 12 || 12;
case "hh":
return ia(H % 12 || 12, 2);
case "H":
return H;
case "HH":
return ia(H, 2);
case "m":
return W;
case "mm":
return ia(W, 2);
case "s":
return a;
case "ss":
return ia(a, 2);
case "f":
return String(f).slice(0, 1);
case "ff":
return ia(String(f).slice(0, 2), 2);
case "fff":
return ia(String(f).slice(0, 3), 3);
case "t":
return 12 > H ? "a" : "p";
case "tt":
return 12 > H ? "am" : "pm";
case "T":
return 12 > H ? "A" : "P";
case "TT":
return 12 > H ? "AM" : "PM";
case "K":
return U ? "UTC" : (String(Q).match(x) || [""]).pop().replace(z, "");
case "z":
return (0 < b ? "-" : "+") + Math.floor(Math.abs(b) / 60);
case "zz":
return (0 < b ? "-" : "+") + ia(Math.floor(Math.abs(b) / 60), 2);
case "zzz":
return (0 < b ? "-" : "+") + ia(Math.floor(Math.abs(b) / 60), 2) + ia(Math.abs(b) % 60, 2);
default:
return c.slice(1, c.length - 1)
}
})
}
}(),
W = function (m, s, q) {
if (null === m) return "";
if (!isFinite(m)) return m;
m = Number(m);
var v = 0 > m ? !0 :
!1;
v && (m *= -1);
var y = q ? q.decimalSeparator : ".",
x = q ? q.digitGroupSeparator : ",",
z = "";
s = String(s);
var z = 1,
Q = q = "",
C = -1,
P = [],
G = [],
O = 0,
R = 0,
U = 0,
N = !1,
Z = 0,
Q = s.match(/"[^"]*"|'[^']*'|[eE][+-]*[0]+|[,]+[.]|\u2030|./g);
s = null;
for (var V = 0; Q && V < Q.length; V++)
if (s = Q[V], "." === s && 0 > C) C = V;
else {
if ("%" === s) z *= 100;
else if ("\u2030" === s) {
z *= 1E3;
continue
} else if ("," === s[0] && "." === s[s.length - 1]) {
z /= Math.pow(1E3, s.length - 1);
C = V + s.length - 1;
continue
} else "E" !== s[0] && "e" !== s[0] || "0" !== s[s.length - 1] || (N = !0);
0 > C ? (P.push(s), "#" === s ||
"0" === s ? O++ : "," === s && U++) : (G.push(s), "#" !== s && "0" !== s || R++)
}
N && (s = Math.floor(m), Q = -Math.floor(Math.log(m) / Math.LN10 + 1), Z = 0 === m ? 0 : 0 === s ? -(O + Q) : String(s).length - O, z /= Math.pow(10, Z));
0 > C && (C = V);
z = (m * z).toFixed(R);
s = z.split(".");
z = (s[0] + "").split("");
m = (s[1] + "").split("");
z && "0" === z[0] && z.shift();
for (N = Q = V = R = C = 0; 0 < P.length;)
if (s = P.pop(), "#" === s || "0" === s)
if (C++, C === O) {
var X = z,
z = [];
if ("0" === s)
for (s = O - R - (X ? X.length : 0); 0 < s;) X.unshift("0"), s--;
for (; 0 < X.length;) q = X.pop() + q, N++, 0 === N % Q && (V === U && 0 < X.length) &&
(q = x + q)
} else 0 < z.length ? (q = z.pop() + q, R++, N++) : "0" === s && (q = "0" + q, R++, N++), 0 === N % Q && (V === U && 0 < z.length) && (q = x + q);
else "E" !== s[0] && "e" !== s[0] || "0" !== s[s.length - 1] || !/[eE][+-]*[0]+/.test(s) ? "," === s ? (V++, Q = N, N = 0, 0 < z.length && (q = x + q)) : q = 1 < s.length && ('"' === s[0] && '"' === s[s.length - 1] || "'" === s[0] && "'" === s[s.length - 1]) ? s.slice(1, s.length - 1) + q : s + q : (s = 0 > Z ? s.replace("+", "").replace("-", "") : s.replace("-", ""), q += s.replace(/[0]+/, function (m) {
return ia(Z, m.length)
}));
x = "";
for (P = !1; 0 < G.length;) s = G.shift(), "#" === s || "0" ===
s ? 0 < m.length && 0 !== Number(m.join("")) ? (x += m.shift(), P = !0) : "0" === s && (x += "0", P = !0) : 1 < s.length && ('"' === s[0] && '"' === s[s.length - 1] || "'" === s[0] && "'" === s[s.length - 1]) ? x += s.slice(1, s.length - 1) : "E" !== s[0] && "e" !== s[0] || "0" !== s[s.length - 1] || !/[eE][+-]*[0]+/.test(s) ? x += s : (s = 0 > Z ? s.replace("+", "").replace("-", "") : s.replace("-", ""), x += s.replace(/[0]+/, function (m) {
return ia(Z, m.length)
}));
q += (P ? y : "") + x;
return v ? "-" + q : q
},
Oa = function (m) {
var s = 0,
q = 0;
m = m || window.event;
m.offsetX || 0 === m.offsetX ? (s = m.offsetX, q = m.offsetY) :
m.layerX || 0 == m.layerX ? (s = m.layerX, q = m.layerY) : (s = m.pageX - m.target.offsetLeft, q = m.pageY - m.target.offsetTop);
return {
x: s,
y: q
}
},
Xa = !0,
Qa = window.devicePixelRatio || 1,
La = 1,
ha = Xa ? Qa / La : 1,
ka = function (m) {
for (var s = "", q = 0; q < m.length; q++) s += String.fromCharCode(Math.ceil(m.length / 57 / 5) ^ m.charCodeAt(q));
return s
},
Ya = window && window[ka("mnb`uhno")] && window[ka("mnb`uhno")].href && window[ka("mnb`uhno")].href.indexOf && (-1 !== window[ka("mnb`uhno")].href.indexOf(ka("b`ow`rkr/bnl")) || -1 !== window[ka("mnb`uhno")].href.indexOf(ka("gdonqhy/bnl")) ||
-1 !== window[ka("mnb`uhno")].href.indexOf(ka("gheemd"))),
db = {
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"
}
};
X.prototype.setOptions = function (m, s) {
if (sa[this._defaultsKey]) {
var q = sa[this._defaultsKey],
v;
for (v in q) "publicProperties" !== v && q.hasOwnProperty(v) && (this[v] = m && v in m ? m[v] : s && v in s ? s[v] : q[v])
}
};
X.prototype.get = function (m) {
var s = sa[this._defaultsKey];
if ("options" === m) return this.options && this.options._isPlaceholder ? null : this.options;
if (s.hasOwnProperty(m) || s.publicProperties && s.publicProperties.hasOwnProperty(m)) return this[m];
window.console && window.console.log('Property "' + m + "\" doesn't exist. Please check for typo.")
};
X.prototype.set = function (m, s, q) {
q = "undefined" === typeof q ? !0 : q;
var v = sa[this._defaultsKey];
if ("options" === m) this.createUserOptions(s);
else if (v.hasOwnProperty(m) || v.publicProperties && v.publicProperties.hasOwnProperty(m) && "readWrite" === v.publicProperties[m]) this.options._isPlaceholder && this.createUserOptions(), this.options[m] = s;
else {
window.console && (v.publicProperties && v.publicProperties.hasOwnProperty(m) && "readOnly" === v.publicProperties[m] ? window.console.log('Property "' + m + '" is read-only.') : window.console.log('Property "' +
m + "\" doesn't exist. Please check for typo."));
return
}
q && (this.chart || this).render()
};
X.prototype.addTo = function (m, s, q, v) {
v = "undefined" === typeof v ? !0 : v;
var y = sa[this._defaultsKey];
y.hasOwnProperty(m) || y.publicProperties && y.publicProperties.hasOwnProperty(m) && "readWrite" === y.publicProperties[m] ? (this.options._isPlaceholder && this.createUserOptions(), "undefined" === typeof this.options[m] && (this.options[m] = []), m = this.options[m], q = "undefined" === typeof q || null === q ? m.length : q, m.splice(q, 0, s), v && (this.chart ||
this).render()) : window.console && (y.publicProperties && y.publicProperties.hasOwnProperty(m) && "readOnly" === y.publicProperties[m] ? window.console.log('Property "' + m + '" is read-only.') : window.console.log('Property "' + m + "\" doesn't exist. Please check for typo."))
};
X.prototype.createUserOptions = function (m) {
if ("undefined" !== typeof m || this.options._isPlaceholder)
if (this.parent.options._isPlaceholder && this.parent.createUserOptions(), this.isOptionsInArray) {
this.parent.options[this.optionsName] || (this.parent.options[this.optionsName] = []);
var s = this.parent.options[this.optionsName],
q = s.length;
this.options._isPlaceholder || (Da(s), q = s.indexOf(this.options));
this.options = "undefined" === typeof m ? {} : m;
s[q] = this.options
} else this.options = "undefined" === typeof m ? {} : m, m = this.parent.options, this.optionsName ? s = this.optionsName : (s = this._defaultsKey) && 0 !== s.length ? (q = s.charAt(0).toLowerCase(), 1 < s.length && (q = q.concat(s.slice(1))), s = q) : s = void 0, m[s] = this.options
};
X.prototype.remove = function (m) {
m = "undefined" === typeof m ? !0 : m;
if (this.isOptionsInArray) {
var s =
this.parent.options[this.optionsName];
Da(s);
var q = s.indexOf(this.options);
0 <= q && s.splice(q, 1)
} else delete this.parent.options[this.optionsName];
m && (this.chart || this).render()
};
X.prototype.updateOption = function (m) {
var s = sa[this._defaultsKey],
q = {},
v = this[m],
x = this._themeOptionsKey,
z = this._index;
this.theme && y(x) && y(z) ? q = y(ya[this.theme]) ? ya.light1 : ya[this.theme] : this.parent && (this.parent.themeOptions && this.parent.themeOptions[x]) && (null === z ? q = this.parent.themeOptions[x] : 0 < this.parent.themeOptions[x].length &&
(q = Math.min(this.parent.themeOptions[x].length - 1, z), q = this.parent.themeOptions[x][q]));
this.themeOptions = q;
m in s && (v = m in this.options ? this.options[m] : q && m in q ? q[m] : s[m]);
if (v === this[m]) return !1;
this[m] = v;
return !0
};
X.prototype.trackChanges = function (m) {
if (!this.sessionVariables) throw "Session Variable Store not set";
this.sessionVariables[m] = this.options[m]
};
X.prototype.isBeingTracked = function (m) {
this.options._oldOptions || (this.options._oldOptions = {});
return this.options._oldOptions[m] ? !0 : !1
};
X.prototype.hasOptionChanged =
function (m) {
if (!this.sessionVariables) throw "Session Variable Store not set";
return this.sessionVariables[m] !== this.options[m]
};
X.prototype.addEventListener = function (m, s, v) {
m && s && (this._eventListeners[m] = this._eventListeners[m] || [], this._eventListeners[m].push({
context: v || this,
eventHandler: s
}))
};
X.prototype.removeEventListener = function (m, s) {
if (m && s && this._eventListeners[m])
for (var v = this._eventListeners[m], y = 0; y < v.length; y++)
if (v[y].eventHandler === s) {
v[y].splice(y, 1);
break
}
};
X.prototype.removeAllEventListeners =
function () {
this._eventListeners = []
};
X.prototype.dispatchEvent = function (m, s, v) {
if (m && this._eventListeners[m]) {
s = s || {};
for (var y = this._eventListeners[m], x = 0; x < y.length; x++) y[x].eventHandler.call(y[x].context, s)
}
"function" === typeof this[m] && this[m].call(v || this.chart, s)
};
Ea.prototype.registerSpace = function (m, s) {
"top" === m ? this._topOccupied += s.height : "bottom" === m ? this._bottomOccupied += s.height : "left" === m ? this._leftOccupied += s.width : "right" === m && (this._rightOccupied += s.width)
};
Ea.prototype.unRegisterSpace =
function (m, s) {
"top" === m ? this._topOccupied -= s.height : "bottom" === m ? this._bottomOccupied -= s.height : "left" === m ? this._leftOccupied -= s.width : "right" === m && (this._rightOccupied -= s.width)
};
Ea.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
}
};
Ea.prototype.reset = function () {
this._rightOccupied =
this._leftOccupied = this._bottomOccupied = this._topOccupied = this._padding
};
pa(la, X);
la.prototype._initialize = function () {
y(this.padding) || "object" !== typeof this.padding ? this.topPadding = this.rightPadding = this.bottomPadding = this.leftPadding = Number(this.padding) | 0 : (this.topPadding = y(this.padding.top) ? 0 : Number(this.padding.top) | 0, this.rightPadding = y(this.padding.right) ? 0 : Number(this.padding.right) | 0, this.bottomPadding = y(this.padding.bottom) ? 0 : Number(this.padding.bottom) | 0, this.leftPadding = y(this.padding.left) ?
0 : Number(this.padding.left) | 0)
};
la.prototype.render = function (m) {
if (0 !== this.fontSize) {
m && this.ctx.save();
var s = this.ctx.font;
this.ctx.textBaseline = this.textBaseline;
var v = 0;
this._isDirty && this.measureText(this.ctx);
this.ctx.translate(this.x, this.y + v);
"middle" === this.textBaseline && (v = -this._lineHeight / 2);
this.ctx.font = this._getFontString();
this.ctx.rotate(Math.PI / 180 * this.angle);
var y = 0,
x = this.topPadding,
z = null;
this.ctx.roundRect || Ca(this.ctx);
(0 < this.borderThickness && this.borderColor || this.backgroundColor) &&
this.ctx.roundRect(0, v, this.width, this.height, this.cornerRadius, this.borderThickness, this.backgroundColor, this.borderColor);
this.ctx.fillStyle = this.fontColor;
for (v = 0; v < this._wrappedText.lines.length; v++) z = this._wrappedText.lines[v], "right" === this.horizontalAlign ? y = (this.width - (this.leftPadding + this.rightPadding)) / 2 - z.width / 2 + this.leftPadding : "left" === this.horizontalAlign ? y = this.leftPadding : "center" === this.horizontalAlign && (y = (this.width - (this.leftPadding + this.rightPadding)) / 2 - z.width / 2 + this.leftPadding),
this.ctx.fillText(z.text, y, x), x += z.height;
this.ctx.font = s;
m && this.ctx.restore()
}
};
la.prototype.setText = function (m) {
this.text = m;
this._isDirty = !0;
this._wrappedText = null
};
la.prototype.measureText = function () {
this._lineHeight = Ua(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
}
};
la.prototype._getLineWithWidth = function (m, s, v) {
m = String(m);
if (!m) return {
text: "",
width: 0
};
var y = v = 0,
x = m.length - 1,
z = Infinity;
for (this.ctx.font = this._getFontString(); y <= x;) {
var z = Math.floor((y + x) / 2),
G = m.substr(0, z + 1);
v = this.ctx.measureText(G).width;
if (v < s) y = z + 1;
else if (v > s) x = z - 1;
else break
}
v > s && 1 < G.length && (G = G.substr(0, G.length - 1), v = this.ctx.measureText(G).width);
s = !0;
if (G.length === m.length || " " === m[G.length]) s = !1;
s && (m = G.split(" "), 1 < m.length && m.pop(), G = m.join(" "), v = this.ctx.measureText(G).width);
return {
text: G,
width: v
}
};
la.prototype._wrapText = function () {
var m = new String(Ga(String(this.text))),
v = [],
q = this.ctx.font,
y = 0,
x = 0;
this.ctx.font = this._getFontString();
if (0 === this.frontSize) x = y = 0;
else
for (; 0 < m.length;) {
var z = this.maxHeight - (this.topPadding + this.bottomPadding),
G = this._getLineWithWidth(m, this.maxWidth - (this.leftPadding + this.rightPadding), !1);
G.height = this._lineHeight;
v.push(G);
var Q = x,
x = Math.max(x, G.width),
y = y + G.height,
m = Ga(m.slice(G.text.length, m.length));
z && y > z && (G = v.pop(), y -= G.height, x = Q)
}
this._wrappedText = {
lines: v,
width: x,
height: y
};
this.width = x + (this.leftPadding + this.rightPadding);
this.height = y + (this.topPadding + this.bottomPadding);
this.ctx.font = q
};
la.prototype._getFontString = function () {
var m;
m = "" + (this.fontStyle ? this.fontStyle + " " : "");
m += this.fontWeight ? this.fontWeight + " " : "";
m += this.fontSize ? this.fontSize + "px " : "";
var s = this.fontFamily ? this.fontFamily + "" : "";
!v && s && (s = s.split(",")[0], "'" !== s[0] && '"' !== s[0] && (s = "'" + s + "'"));
return m += s
};
pa(Ra, X);
pa(Ia, X);
Ia.prototype.render = function () {
if (this.text) {
var m = this.dockInsidePlotArea ? this.chart.plotArea : this.chart,
v = m.layoutManager.getFreeSpace(),
q = v.x1,
x = v.y1,
z = 0,
G = 0,
R = this.chart._menuButton && this.chart.exportEnabled && "top" === this.verticalAlign ? 22 : 0,
Q, C;
"top" === this.verticalAlign || "bottom" === this.verticalAlign ? (null === this.maxWidth && (this.maxWidth = v.width - 4 - R * ("center" === this.horizontalAlign ? 2 : 1)), G = 0.5 * v.height - this.margin - 2, z = 0) : "center" === this.verticalAlign && ("left" === this.horizontalAlign || "right" === this.horizontalAlign ? (null === this.maxWidth && (this.maxWidth = v.height - 4), G = 0.5 * v.width - this.margin - 2) : "center" === this.horizontalAlign && (null ===
this.maxWidth && (this.maxWidth = v.width - 4), G = 0.5 * v.height - 4));
var P;
y(this.padding) || "number" !== typeof this.padding ? y(this.padding) || "object" !== typeof this.padding || (P = this.padding.top ? this.padding.top : this.padding.bottom ? this.padding.bottom : 0, P += this.padding.bottom ? this.padding.bottom : this.padding.top ? this.padding.top : 0, P *= 1.25) : P = 2.5 * this.padding;
this.wrap || (G = Math.min(G, Math.max(1.5 * this.fontSize, this.fontSize + P)));
G = new la(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: G,
cornerRadius: this.cornerRadius,
text: this.text,
padding: this.padding,
textBaseline: "top"
});
P = G.measureText();
"top" === this.verticalAlign || "bottom" === this.verticalAlign ? ("top" === this.verticalAlign ? (x = v.y1 + 2, C = "top") : "bottom" === this.verticalAlign &&
(x = v.y2 - 2 - P.height, C = "bottom"), "left" === this.horizontalAlign ? q = v.x1 + 2 : "center" === this.horizontalAlign ? q = v.x1 + v.width / 2 - P.width / 2 : "right" === this.horizontalAlign && (q = v.x2 - 2 - P.width - R), Q = this.horizontalAlign, this.width = P.width, this.height = P.height) : "center" === this.verticalAlign && ("left" === this.horizontalAlign ? (q = v.x1 + 2, x = v.y2 - 2 - (this.maxWidth / 2 - P.width / 2), z = -90, C = "left", this.width = P.height, this.height = P.width) : "right" === this.horizontalAlign ? (q = v.x2 - 2, x = v.y1 + 2 + (this.maxWidth / 2 - P.width / 2), z = 90, C = "right",
this.width = P.height, this.height = P.width) : "center" === this.horizontalAlign && (x = m.y1 + (m.height / 2 - P.height / 2), q = m.x1 + (m.width / 2 - P.width / 2), C = "center", this.width = P.width, this.height = P.height), Q = "center");
G.x = q;
G.y = x;
G.angle = z;
G.horizontalAlign = Q;
G.render(!0);
m.layoutManager.registerSpace(C, {
width: this.width + ("left" === C || "right" === C ? this.margin + 2 : 0),
height: this.height + ("top" === C || "bottom" === C ? this.margin + 2 : 0)
});
this.bounds = {
x1: q,
y1: x,
x2: q + this.width,
y2: x + this.height
};
this.ctx.textBaseline = "top"
}
};
pa(Na,
X);
Na.prototype.render = Ia.prototype.render;
pa(Ja, X);
x = {
addTheme: function (m, v) {
ya[m] = v
},
addColorSet: function (m, v) {
Aa[m] = v
},
addCultureInfo: function (m, v) {
Ka[m] = v
},
formatNumber: function (m, v, q) {
q = q || "en";
if (Ka[q]) return W(m, v || "#,##0.##", new Ja(q));
throw "Unknown Culture Name";
},
formatDate: function (m, v, q) {
q = q || "en";
if (Ka[q]) return Ba(m, v || "DD MMM YYYY", new Ja(q));
throw "Unknown Culture Name";
}
};
window.CanvasJS = x;
x.Chart = function () {
function m(a, f) {
return a.x - f.x
}
function s(a, f, b) {
if (a && f && b) {
b = b + "." + f;
var c =
"image/" + f;
a = a.toDataURL(c);
var e = !1,
g = document.createElement("a");
g.download = b;
g.href = a;
if ("undefined" !== typeof Blob && new Blob) {
for (var h = a.replace(/^data:[a-z\/]*;base64,/, ""), h = atob(h), l = new ArrayBuffer(h.length), l = new Uint8Array(l), t = 0; t < h.length; t++) l[t] = h.charCodeAt(t);
f = new Blob([l.buffer], {
type: "image/" + f
});
try {
window.navigator.msSaveBlob(f, b), e = !0
} catch (k) {
g.dataset.downloadurl = [c, g.download, g.href].join(":"), g.href = window.URL.createObjectURL(f)
}
}
if (!e) try {
event = document.createEvent("MouseEvents"),
event.initMouseEvent("click", !0, !1, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), g.dispatchEvent ? g.dispatchEvent(event) : g.fireEvent && g.fireEvent("onclick")
} catch (r) {
f = window.open(), f.document.write("
Please right click on the image and save it to your device
"), f.document.close()
}
}
}
function q(a, f) {
f = f || {};
this.theme = y(f.theme) || y(ya[f.theme]) ? "light1" : f.theme;
q.base.constructor.call(this, "Chart", null, f, 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.panEnabled = this.disableToolTip = this.animatedRender = !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 Aa[this.colorSet] ? Aa[this.colorSet] : Aa.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";
v || (this._canvasJSContainer.style.height = "0px");
this.container.appendChild(this._canvasJSContainer);
this.canvas = ua(c, e);
this._preRenderCanvas = ua(c, e);
this.canvas.style.position = "absolute";
this.canvas.getContext && (this._canvasJSContainer.appendChild(this.canvas), this.ctx = this.canvas.getContext("2d"), this.ctx.textBaseline = "top", Ca(this.ctx), this._preRenderCtx = this._preRenderCanvas.getContext("2d"),
this._preRenderCtx.textBaseline = "top", Ca(this._preRenderCtx), v ? this.plotArea.ctx = this.ctx : (this.plotArea.canvas = ua(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 = ua(c, e), this.overlaidCanvas.style.position = "absolute", this.overlaidCanvas.style.webkitTapHighlightColor = "transparent", this.overlaidCanvas.getContext &&
(this._canvasJSContainer.appendChild(this.overlaidCanvas), this.overlaidCanvasCtx = this.overlaidCanvas.getContext("2d"), this.overlaidCanvasCtx.textBaseline = "top", Ca(this.overlaidCanvasCtx)), this._eventManager = new fa(this), this.windowResizeHandler = N(window, "resize", function () {
b._updateSize() && b.render()
}), 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
}, N(this.overlaidCanvas, "click", function (a) {
b._mouseEventHandler(a)
}), N(this.overlaidCanvas, "mousemove", function (a) {
b._mouseEventHandler(a)
}), N(this.overlaidCanvas, "mouseup", function (a) {
b._mouseEventHandler(a)
}), N(this.overlaidCanvas, "mousedown", function (a) {
b._mouseEventHandler(a);
wa(b._dropdownMenu)
}), N(this.overlaidCanvas, "mouseout", function (a) {
b._mouseEventHandler(a)
}), N(this.overlaidCanvas, window.navigator.msPointerEnabled ? "MSPointerDown" : "touchstart",
function (a) {
b._touchEventHandler(a)
}), N(this.overlaidCanvas, window.navigator.msPointerEnabled ? "MSPointerMove" : "touchmove", function (a) {
b._touchEventHandler(a)
}), N(this.overlaidCanvas, window.navigator.msPointerEnabled ? "MSPointerUp" : "touchend", function (a) {
b._touchEventHandler(a)
}), N(this.overlaidCanvas, window.navigator.msPointerEnabled ? "MSPointerCancel" : "touchcancel", function (a) {
b._touchEventHandler(a)
}), this.toolTip = new Y(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 x(a, f) {
for (var b = [], c, e = 0; e < a.length; e++)
if (0 == e) b.push(a[0]);
else {
var g, h, l;
l = e - 1;
g = 0 === l ? 0 : l - 1;
h = l === a.length - 1 ? l : l + 1;
c = Math.abs((a[h].x - a[g].x) / (0 === a[h].x - a[l].x ? 0.01 : a[h].x - a[l].x)) * (f - 1) / 2 + 1;
var t = (a[h].x - a[g].x) / c;
c = (a[h].y - a[g].y) / c;
b[b.length] = a[l].x > a[g].x && 0 < t || a[l].x < a[g].x && 0 >
t ? {
x: a[l].x + t / 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;
h = l === a.length - 1 ? l : l + 1;
c = Math.abs((a[h].x - a[g].x) / (0 === a[l].x - a[g].x ? 0.01 : a[l].x - a[g].x)) * (f - 1) / 2 + 1;
t = (a[h].x - a[g].x) / c;
c = (a[h].y - a[g].y) / c;
b[b.length] = a[l].x > a[g].x && 0 < t || a[l].x < a[g].x && 0 > t ? {
x: a[l].x - t / 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 z(a, f, b, c, e, g, h, l, t, k) {
var r = 0;
k ? (h.color = g, l.color = g) : k = 1;
r = t ? Math.abs(e - b) : Math.abs(c - f);
r = 0 < h.trimLength ? Math.abs(r * h.trimLength / 100) : Math.abs(r - h.length);
t ? (b += r / 2, e -= r / 2) : (f += r / 2, c -= r / 2);
var r = 1 === Math.round(h.thickness) % 2 ? 0.5 : 0,
p = 1 === Math.round(l.thickness) % 2 ? 0.5 : 0;
a.save();
a.globalAlpha = k;
a.strokeStyle = l.color || g;
a.lineWidth = l.thickness || 2;
a.setLineDash && a.setLineDash(G(l.dashType, l.thickness));
a.beginPath();
t && 0 < l.thickness ? (a.moveTo(c - h.thickness / 2, Math.round((b + e) / 2) - p), a.lineTo(f + h.thickness / 2, Math.round((b + e) / 2) - p)) : 0 < l.thickness && (a.moveTo(Math.round((f + c) / 2) - p, b + h.thickness / 2), a.lineTo(Math.round((f + c) / 2) - p, e - h.thickness / 2));
a.stroke();
a.strokeStyle =
h.color || g;
a.lineWidth = h.thickness || 2;
a.setLineDash && a.setLineDash(G(h.dashType, h.thickness));
a.beginPath();
t && 0 < h.thickness ? (a.moveTo(c - r, b), a.lineTo(c - r, e), a.moveTo(f + r, b), a.lineTo(f + r, e)) : 0 < h.thickness && (a.moveTo(f, b + r), a.lineTo(c, b + r), a.moveTo(f, e - r), a.lineTo(c, e - r));
a.stroke();
a.restore()
}
function O(a, f, b, c, e) {
if (null === a || "undefined" === typeof a) return "undefined" === typeof b ? f : b;
a = parseFloat(a.toString()) * (0 <= a.toString().indexOf("%") ? f / 100 : 1);
"undefined" !== typeof c && (a = Math.min(c, a), "undefined" !==
typeof e && (a = Math.max(e, a)));
return !isNaN(a) && a <= f && 0 <= a ? a : "undefined" === typeof b ? f : b
}
function T(a, f) {
T.base.constructor.call(this, "Legend", "legend", f, 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 = Ua(this.fontFamily, this.fontSize, this.fontWeight);
this.horizontalSpacing = this.fontSize
}
function Q(a, f, b, c) {
Q.base.constructor.call(this, "DataSeries", "data", f, 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 = f.dataPoints ? f.dataPoints.length : 0;
this.dataPointEOs = [];
for (f = 0; f < a; f++) this.dataPointEOs[f] = {};
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 C(a, f, b, c, e, g) {
C.base.constructor.call(this, "Axis", f, 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", y(this.chart.sessionVariables.axisX[c]) && (this.chart.sessionVariables.axisX[c] = {}), this.sessionVariables = this.chart.sessionVariables.axisX[c]) : (this.optionsName = "axisX2", y(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", y(this.chart.sessionVariables.axisY[c]) && (this.chart.sessionVariables.axisY[c] = {}), this.sessionVariables = this.chart.sessionVariables.axisY[c]) : (this.optionsName = "axisY2", y(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 P(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 ga(this.chart, this.options.stripLines[a], a, ++this.chart._eventManager.lastObjectId, this));
this.options.crosshair && (this.crosshair = new ia(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 P(a, f, b, c) {
P.base.constructor.call(this, "ScaleBreaks", "scaleBreaks", f, 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 aa(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 aa(a, f, b, c, e, g) {
aa.base.constructor.call(this, "Break", f, b, c, g);
this.id = e;
this.chart = a;
this.ctx = this.chart.ctx;
this.scaleBreaks = g;
this.optionsName = f;
this.isOptionsInArray = !0;
this.type = b.type ? this.type : g.type;
this.fillOpacity = y(b.fillOpacity) ? g.fillOpacity : this.fillOpacity;
this.lineThickness = y(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;
!y(this.startValue) && this.startValue.getTime && (this.startValue = this.startValue.getTime());
!y(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 ga(a, f, b, c, e) {
ga.base.constructor.call(this, "StripLine", "stripLines", f, 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 ia(a, f, b) {
ia.base.constructor.call(this, "Crosshair", "crosshair", f, null, b);
this.chart = a;
this.ctx = this.chart.ctx;
this.axis = b;
this.optionsName = "crosshair";
this._thicknessType = "pixel"
}
function Y(a, f) {
Y.base.constructor.call(this, "ToolTip", "toolTip", f, null, a);
this.chart = a;
this.canvas = a.canvas;
this.ctx = this.chart.ctx;
this.currentDataPointIndex = this.currentSeriesIndex = -1;
this._timerId = 0;
this._prevY = this._prevX = NaN;
this.containerTransitionDuration = 0.1;
this.mozContainerTransition = this.getContainerTransition(this.containerTransitionDuration);
this.optionsName = "toolTip";
this._initialize()
}
function fa(a) {
this.chart = a;
this.lastObjectId = 0;
this.objectMap = [];
this.rectangularRegionEventSubscriptions = [];
this.previousDataPointEventObject = null;
this.ghostCanvas = ua(this.chart.width, this.chart.height);
this.ghostCtx = this.ghostCanvas.getContext("2d");
this.mouseoveredObjectMaps = []
}
function ka(a) {
this.chart = a;
this.ctx = this.chart.plotArea.ctx;
this.animations = [];
this.animationRequestId = null
}
pa(q, X);
q.prototype.destroy = function () {
var a = window,
f = this.windowResizeHandler;
a.removeEventListener ? a.removeEventListener("resize", f) : a.detachEvent && a.detachEvent("onresize", f)
};
q.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 Aa[this.colorSet] ? Aa[this.colorSet] : Aa.colorSet1);
this.updateOption("backgroundColor");
this.backgroundColor || (this.backgroundColor = "rgba(0,0,0,0)");
this.updateOption("culture");
this._cultureInfo =
new Ja(this.options.culture);
this.updateOption("animationEnabled");
this.animationEnabled = this.animationEnabled && v;
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 f = !1;
wa(this._zoomButton = document.createElement("button"));
va(this, this._zoomButton, "pan");
this._toolBar.appendChild(this._zoomButton);
this._zoomButton.style.borderRight = this.toolbar.borderThickness + "px solid " + this.toolbar.borderColor;
N(this._zoomButton, "touchstart", function (a) {
f = !0
});
N(this._zoomButton, "click", function () {
a.zoomEnabled ? (a.zoomEnabled = !1, a.panEnabled = !0, va(a, a._zoomButton, "zoom")) : (a.zoomEnabled = !0, a.panEnabled = !1, va(a, a._zoomButton, "pan"));
a.render()
});
N(this._zoomButton, "mouseover", function () {
f ? f = !1 : (qa(a, a._zoomButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.fontColorOnHover,
transition: "0.4s",
WebkitTransition: "0.4s"
}), 0 >= navigator.userAgent.search("MSIE") && qa(a, a._zoomButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)"
}))
});
N(this._zoomButton, "mouseout", function () {
f || (qa(a, a._zoomButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor,
transition: "0.4s",
WebkitTransition: "0.4s"
}), 0 >= navigator.userAgent.search("MSIE") && qa(a, a._zoomButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)"
}))
})
}
this._resetButton || (f = !1, wa(this._resetButton =
document.createElement("button")), va(this, this._resetButton, "reset"), this._resetButton.style.borderRight = (this.exportEnabled ? this.toolbar.borderThickness : 0) + "px solid " + this.toolbar.borderColor, this._toolBar.appendChild(this._resetButton), N(this._resetButton, "touchstart", function (a) {
f = !0
}), N(this._resetButton, "click", function () {
a.toolTip.hide();
a.zoomEnabled || a.panEnabled ? (a.zoomEnabled = !0, a.panEnabled = !1, va(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();
wa(a._zoomButton, a._resetButton);
a._dispatchRangeEvent("rangeChanging", "reset");
a.render();
a._dispatchRangeEvent("rangeChanged", "reset")
}), N(this._resetButton, "mouseover", function () {
f || (qa(a, a._resetButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.hoverFfontColorOnHoverontColor,
transition: "0.4s",
WebkitTransition: "0.4s"
}), 0 >= navigator.userAgent.search("MSIE") && qa(a, a._resetButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)"
}))
}), N(this._resetButton, "mouseout", function () {
f || (qa(a, a._resetButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor,
transition: "0.4s",
WebkitTransition: "0.4s"
}), 0 >= navigator.userAgent.search("MSIE") && qa(a, a._resetButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)"
}))
}),
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), Ma(a._zoomButton, a._resetButton)) : (this.zoomEnabled = !0, this.panEnabled = !1))
} else this.panEnabled = this.zoomEnabled = !1;
this._menuButton ? this.exportEnabled ? Ma(this._menuButton) : wa(this._menuButton) : this.exportEnabled && v && (f = !1, this._menuButton = document.createElement("button"),
va(this, this._menuButton, "menu"), this._toolBar.appendChild(this._menuButton), N(this._menuButton, "touchstart", function (a) {
f = !0
}), N(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())
}, !0), N(this._menuButton, "mouseover", function () {
f || (qa(a, a._menuButton, {
backgroundColor: a.toolbar.backgroundColorOnHover,
color: a.toolbar.fontColorOnHover
}),
0 >= navigator.userAgent.search("MSIE") && qa(a, a._menuButton.childNodes[0], {
WebkitFilter: "invert(100%)",
filter: "invert(100%)"
}))
}, !0), N(this._menuButton, "mouseout", function () {
f || (qa(a, a._menuButton, {
backgroundColor: a.toolbar.backgroundColor,
color: a.toolbar.fontColor
}), 0 >= navigator.userAgent.search("MSIE") && qa(a, a._menuButton.childNodes[0], {
WebkitFilter: "invert(0%)",
filter: "invert(0%)"
}))
}, !0));
if (!this._dropdownMenu && this.exportEnabled && v) {
f = !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);
N(this._dropdownMenu, "blur", function () {
wa(a._dropdownMenu);
a._dropDownCloseTime = new Date
}, !0);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
// b.innerHTML = this._cultureInfo.printText;
b.innerHTML ='พิมพ์';
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
N(b, "touchstart", function (a) {
f = !0
});
N(b, "mouseover", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColorOnHover,
this.style.color = a.toolbar.fontColorOnHover)
}, !0);
N(b, "mouseout", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColor, this.style.color = a.toolbar.fontColor)
}, !0);
N(b, "click", function () {
a.print();
wa(a._dropdownMenu)
}, !0);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
// b.innerHTML = this._cultureInfo.saveJPGText;
b.innerHTML = 'บันทึกเป็น .JPEG';
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
N(b, "touchstart", function (a) {
f = !0
});
N(b, "mouseover", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColorOnHover, this.style.color = a.toolbar.fontColorOnHover)
}, !0);
N(b, "mouseout", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColor, this.style.color = a.toolbar.fontColor)
}, !0);
N(b, "click", function () {
s(a.canvas, "jpeg", a.exportFileName);
wa(a._dropdownMenu)
}, !0);
b = document.createElement("div");
b.style.cssText = "padding: 12px 8px 12px 8px";
// b.innerHTML = this._cultureInfo.savePNGText;
b.innerHTML = 'บันทึกเป็น .PNG';
b.style.backgroundColor = this.toolbar.backgroundColor;
b.style.color = this.toolbar.fontColor;
this._dropdownMenu.appendChild(b);
N(b, "touchstart", function (a) {
f = !0
});
N(b, "mouseover", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColorOnHover, this.style.color = a.toolbar.fontColorOnHover)
}, !0);
N(b, "mouseout", function () {
f || (this.style.backgroundColor = a.toolbar.backgroundColor, this.style.color = a.toolbar.fontColor)
}, !0);
N(b, "click", function () {
s(a.canvas, "png", a.exportFileName);
wa(a._dropdownMenu)
}, !0)
}
"none" !== this._toolBar.style.display && this._zoomButton &&
(this.panEnabled ? va(a, a._zoomButton, "zoom") : va(a, a._zoomButton, "pan"), a._resetButton.getAttribute("state") !== a._cultureInfo.resetText && va(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)
};
q.prototype._updateSize = function () {
var a = 0,
f = 0;
this.options.width ? a = this.width : this.width = a = 0 < this.container.clientWidth ?
this.container.clientWidth : this.width;
this.options.height ? f = this.height : this.height = f = 0 < this.container.clientHeight ? this.container.clientHeight : this.height;
return this.canvas.width !== a * ha || this.canvas.height !== f * ha ? (Ha(this.canvas, a, f), Ha(this._preRenderCanvas, a, f), Ha(this.overlaidCanvas, a, f), Ha(this._eventManager.ghostCanvas, a, f), this.bounds = {
x1: 0,
y1: 0,
x2: this.width,
y2: this.height
}, !0) : !1
};
q.prototype._initialize = function () {
this.toolbar = new Ra(this, this.options.toolbar);
this._animator ? this._animator.cancelAllAnimations() :
this._animator = new ka(this);
this.removeAllEventListeners();
this.disableToolTip = !1;
this._axes = [];
this.funnelPyramidClickHandler = this.pieDoughnutClickHandler = null;
this.animationRequestId && this.cancelRequestAnimFrame.call(window, this.animationRequestId);
this._updateOptions();
this.animatedRender = v && 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 Ea(0, 0, this.width, this.height, 2);
this.plotArea.layoutManager && this.plotArea.layoutManager.reset();
this.data = [];
var a = 0,
f = null;
if (this.options.data) {
for (var b = 0; b < this.options.data.length; b++)
if (a++, !this.options.data[b].type || 0 <= q._supportedChartTypes.indexOf(this.options.data[b].type)) {
var c = new Q(this, this.options.data[b], a - 1, ++this._eventManager.lastObjectId);
"error" === c.type && (c.linkedDataSeriesIndex = y(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(m) : c.dataPoints.sort(m));
this.data.push(c);
var e = c.axisPlacement,
f = f || 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" == f && "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 = f || "normal", this.data[b]._linkedSeries = null === this.data[b].linkedDataSeriesIndex ? null : this.data[this.data[b].linkedDataSeriesIndex])
}
}
this._objectsInitialized = !0
};
q._supportedChartTypes = Da("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(" "));
q.prototype.render = function (a) {
a && (this.options = a);
this._initialize();
bb(this);
cb(this);
var f = [];
for (a = 0; a < this.data.length; a++)
if ("normal" === this.plotInfo.axisPlacement || "xySwapped" === this.plotInfo.axisPlacement) {
if (!this.data[a].axisYType || "primary" === this.data[a].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 C(this, "axisY", this.options.axisY[b],
b, "axisY", "left")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisY[b] = new C(this, "axisY", this.options.axisY[b], b, "axisY", "bottom"));
this.data[a].axisY = this.axisY[0 <= this.data[a].axisYIndex && this.data[a].axisYIndex < this.axisY.length ? this.data[a].axisYIndex : 0];
this.axisY[0 <= this.data[a].axisYIndex && this.data[a].axisYIndex < this.axisY.length ? this.data[a].axisYIndex : 0].dataSeries.push(this.data[a])
} else this.axisY.length || ("normal" === this.plotInfo.axisPlacement ? this._axes.push(this.axisY[0] =
new C(this, "axisY", this.options.axisY, 0, "axisY", "left")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisY[0] = new C(this, "axisY", this.options.axisY, 0, "axisY", "bottom"))), this.data[a].axisY = this.axisY[0], this.axisY[0].dataSeries.push(this.data[a]);
if ("secondary" === this.data[a].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 C(this,
"axisY2", this.options.axisY2[b], b, "axisY", "right")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisY2[b] = new C(this, "axisY2", this.options.axisY2[b], b, "axisY", "top"));
this.data[a].axisY = this.axisY2[0 <= this.data[a].axisYIndex && this.data[a].axisYIndex < this.axisY2.length ? this.data[a].axisYIndex : 0];
this.axisY2[0 <= this.data[a].axisYIndex && this.data[a].axisYIndex < this.axisY2.length ? this.data[a].axisYIndex : 0].dataSeries.push(this.data[a])
} else this.axisY2.length || ("normal" === this.plotInfo.axisPlacement ?
this._axes.push(this.axisY2[0] = new C(this, "axisY2", this.options.axisY2, 0, "axisY", "right")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisY2[0] = new C(this, "axisY2", this.options.axisY2, 0, "axisY", "top"))), this.data[a].axisY = this.axisY2[0], this.axisY2[0].dataSeries.push(this.data[a]);
if (!this.data[a].axisXType || "primary" === this.data[a].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 C(this, "axisX", this.options.axisX[b], b, "axisX", "bottom")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisX[b] = new C(this, "axisX", this.options.axisX[b], b, "axisX", "left"));
this.data[a].axisX = this.axisX[0 <= this.data[a].axisXIndex && this.data[a].axisXIndex < this.axisX.length ? this.data[a].axisXIndex : 0];
this.axisX[0 <= this.data[a].axisXIndex && this.data[a].axisXIndex < this.axisX.length ? this.data[a].axisXIndex : 0].dataSeries.push(this.data[a])
} else this.axisX.length ||
("normal" === this.plotInfo.axisPlacement ? this._axes.push(this.axisX[0] = new C(this, "axisX", this.options.axisX, 0, "axisX", "bottom")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisX[0] = new C(this, "axisX", this.options.axisX, 0, "axisX", "left"))), this.data[a].axisX = this.axisX[0], this.axisX[0].dataSeries.push(this.data[a]);
if ("secondary" === this.data[a].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 C(this, "axisX2", this.options.axisX2[b], b, "axisX", "top")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisX2[b] = new C(this, "axisX2", this.options.axisX2[b], b, "axisX", "right"));
this.data[a].axisX = this.axisX2[0 <= this.data[a].axisXIndex && this.data[a].axisXIndex < this.axisX2.length ? this.data[a].axisXIndex : 0];
this.axisX2[0 <= this.data[a].axisXIndex && this.data[a].axisXIndex < this.axisX2.length ? this.data[a].axisXIndex : 0].dataSeries.push(this.data[a])
} else this.axisX2.length ||
("normal" === this.plotInfo.axisPlacement ? this._axes.push(this.axisX2[0] = new C(this, "axisX2", this.options.axisX2, 0, "axisX", "top")) : "xySwapped" === this.plotInfo.axisPlacement && this._axes.push(this.axisX2[0] = new C(this, "axisX2", this.options.axisX2, 0, "axisX", "right"))), this.data[a].axisX = this.axisX2[0], this.axisX2[0].dataSeries.push(this.data[a])
}
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 (a = 0; a < this._axes.length; a++)
if (null !== this._axes[a].viewportMinimum || null !== this._axes[a].viewportMaximum) {
b = !0;
break
}
b ? (Ma(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) : (wa(this._zoomButton, this._resetButton), this._toolBar.style.border = this.toolbar.borderThickness + "px solid transparent", this.options.zoomEnabled && (this.zoomEnabled = !0, this.panEnabled = !1));
this._processData();
this.options.title && (this.title = new Ia(this,
this.options.title), this.title.dockInsidePlotArea ? f.push(this.title) : this.title.render());
if (this.options.subtitles)
for (this.subtitles = [], a = 0; a < this.options.subtitles.length; a++) b = new Na(this, this.options.subtitles[a], a), this.subtitles.push(b), b.dockInsidePlotArea ? f.push(b) : b.render();
this.legend = new T(this, this.options.legend);
for (a = 0; a < this.data.length; a++)(this.data[a].showInLegend || "pie" === this.data[a].type || "doughnut" === this.data[a].type || "funnel" === this.data[a].type || "pyramid" === this.data[a].type) &&
this.legend.dataSeries.push(this.data[a]);
this.legend.dockInsidePlotArea ? f.push(this.legend) : this.legend.render();
for (a = 0; a < this._axes.length; a++)
if (this._axes[a].scaleBreaks && this._axes[a].scaleBreaks._appliedBreaks.length) {
v ? (this._breaksCanvas = ua(this.width, this.height, !0), this._breaksCanvasCtx = this._breaksCanvas.getContext("2d")) : (this._breaksCanvas = this.canvas, this._breaksCanvasCtx = this.ctx);
break
}
this._preRenderCanvas = ua(this.width, this.height);
this._preRenderCtx = this._preRenderCanvas.getContext("2d");
if ("normal" === this.plotInfo.axisPlacement || "xySwapped" === this.plotInfo.axisPlacement) C.setLayoutAndRender(this.axisX, this.axisX2, this.axisY, this.axisY2, this.plotInfo.axisPlacement, this.layoutManager.getFreeSpace());
else if ("none" === this.plotInfo.axisPlacement) this.preparePlotArea();
else return;
for (a = 0; a < f.length; a++) f[a].render();
var c = [];
if (this.animatedRender) {
var e = ua(this.width, this.height);
e.getContext("2d").drawImage(this.canvas, 0, 0, this.width, this.height)
}
var f = this.ctx.miterLimit,
g;
this.ctx.miterLimit =
3;
v && 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 (a = 0; a < this.plotInfo.plotTypes.length; a++)
for (var h = this.plotInfo.plotTypes[a], l = 0; l < h.plotUnits.length; l++) {
var t = h.plotUnits[l],
k = null;
t.targetCanvas = null;
this.animatedRender && (t.targetCanvas = ua(this.width, this.height), t.targetCanvasCtx = t.targetCanvas.getContext("2d"), g = t.targetCanvasCtx.miterLimit, t.targetCanvasCtx.miterLimit = 3);
"line" === t.type ? k = this.renderLine(t) : "stepLine" === t.type ? k = this.renderStepLine(t) : "spline" === t.type ? k = this.renderSpline(t) : "column" === t.type ? k = this.renderColumn(t) : "bar" === t.type ? k = this.renderBar(t) : "area" === t.type ? k = this.renderArea(t) : "stepArea" === t.type ? k = this.renderStepArea(t) : "splineArea" === t.type ?
k = this.renderSplineArea(t) : "stackedColumn" === t.type ? k = this.renderStackedColumn(t) : "stackedColumn100" === t.type ? k = this.renderStackedColumn100(t) : "stackedBar" === t.type ? k = this.renderStackedBar(t) : "stackedBar100" === t.type ? k = this.renderStackedBar100(t) : "stackedArea" === t.type ? k = this.renderStackedArea(t) : "stackedArea100" === t.type ? k = this.renderStackedArea100(t) : "bubble" === t.type ? k = k = this.renderBubble(t) : "scatter" === t.type ? k = this.renderScatter(t) : "pie" === t.type ? this.renderPie(t) : "doughnut" === t.type ? this.renderPie(t) :
"funnel" === t.type ? k = this.renderFunnel(t) : "pyramid" === t.type ? k = this.renderFunnel(t) : "candlestick" === t.type ? k = this.renderCandlestick(t) : "ohlc" === t.type ? k = this.renderCandlestick(t) : "rangeColumn" === t.type ? k = this.renderRangeColumn(t) : "error" === t.type ? k = this.renderError(t) : "rangeBar" === t.type ? k = this.renderRangeBar(t) : "rangeArea" === t.type ? k = this.renderRangeArea(t) : "rangeSplineArea" === t.type ? k = this.renderRangeSplineArea(t) : "waterfall" === t.type ? k = this.renderWaterfall(t) : "boxAndWhisker" === t.type && (k = this.renderBoxAndWhisker(t));
for (b = 0; b < t.dataSeriesIndexes.length; b++) this._dataInRenderedOrder.push(this.data[t.dataSeriesIndexes[b]]);
this.animatedRender && (t.targetCanvasCtx.miterLimit = g, k && c.push(k))
}
this.ctx.miterLimit = f;
this.animatedRender && this._breaksCanvasCtx && c.push({
source: this._breaksCanvasCtx,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0,
startTimePercent: 0.7
});
this.animatedRender && 0 < this._indexLabels.length && (g = ua(this.width, this.height).getContext("2d"),
c.push(this.renderIndexLabels(g)));
var r = this;
if (0 < c.length) r.disableToolTip = !0, r._animator.animate(200, r.animationDuration, function (a) {
r.ctx.clearRect(0, 0, r.width, r.height);
r.ctx.drawImage(e, 0, 0, Math.floor(r.width * ha), Math.floor(r.height * ha), 0, 0, r.width, r.height);
for (var b = 0; b < c.length; b++) k = c[b], 1 > a && "undefined" !== typeof k.startTimePercent ? a >= k.startTimePercent && k.animationCallback(k.easingFunction(a - k.startTimePercent, 0, 1, 1 - k.startTimePercent), k) : k.animationCallback(k.easingFunction(a, 0, 1, 1), k);
r.dispatchEvent("dataAnimationIterationEnd", {
chart: r
})
}, function () {
c = [];
for (var a = 0; a < r.plotInfo.plotTypes.length; a++)
for (var b = r.plotInfo.plotTypes[a], d = 0; d < b.plotUnits.length; d++) b.plotUnits[d].targetCanvas = null;
e = null;
r.disableToolTip = !1
});
else {
if (r._breaksCanvas)
if (v) r.plotArea.ctx.drawImage(r._breaksCanvas, 0, 0, this.width, this.height);
else
for (b = 0; b < r._axes.length; b++) r._axes[b].createMask();
0 < r._indexLabels.length && r.renderIndexLabels();
r.dispatchEvent("dataAnimationIterationEnd", {
chart: r
})
}
this.attachPlotAreaEventHandlers();
this.zoomEnabled || (this.panEnabled || !this._zoomButton || "none" === this._zoomButton.style.display) || wa(this._zoomButton, this._resetButton);
this.toolTip._updateToolTip();
this.renderCount++;
this._breaksCanvas && (delete this._breaksCanvas, delete this._breaksCanvasCtx);
for (b = 0; b < this._axes.length; b++) this._axes[b].maskCanvas && (delete this._axes[b].maskCanvas, delete this._axes[b].maskCtx)
};
q.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
})
};
q.prototype.categoriseDataSeries = function () {
for (var a = "", f = 0; f < this.data.length; f++)
if (a = this.data[f], a.dataPoints && (0 !== a.dataPoints.length && a.visible) && 0 <= q._supportedChartTypes.indexOf(a.type)) {
for (var b = null, c = !1, e = null, g = !1, h = 0; h < this.plotInfo.plotTypes.length; h++)
if (this.plotInfo.plotTypes[h].type === a.type) {
c = !0;
b = this.plotInfo.plotTypes[h];
break
}
c || (b = {
type: a.type,
totalDataSeries: 0,
plotUnits: []
}, this.plotInfo.plotTypes.push(b));
for (h = 0; h < b.plotUnits.length; h++)
if (b.plotUnits[h].axisYType === a.axisYType && b.plotUnits[h].axisXType === a.axisXType && b.plotUnits[h].axisYIndex === a.axisYIndex && b.plotUnits[h].axisXIndex === a.axisXIndex) {
g = !0;
e = b.plotUnits[h];
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(f);
a.plotUnit = e
}
for (f = 0; f < this.plotInfo.plotTypes.length; f++)
for (b = this.plotInfo.plotTypes[f],
h = a = 0; h < b.plotUnits.length; h++) b.plotUnits[h].previousDataSeriesCount = a, a += b.plotUnits[h].dataSeriesIndexes.length
};
q.prototype.assignIdToDataPoints = function () {
for (var a = 0; a < this.data.length; a++) {
var f = this.data[a];
if (f.dataPoints)
for (var b = f.dataPoints.length, c = 0; c < b; c++) f.dataPointIds[c] = ++this._eventManager.lastObjectId
}
};
q.prototype._processData = function () {
this.assignIdToDataPoints();
this.categoriseDataSeries();
for (var a = 0; a < this.plotInfo.plotTypes.length; a++)
for (var f = this.plotInfo.plotTypes[a],
b = 0; b < f.plotUnits.length; b++) {
var c = f.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()
};
q.prototype._processMultiseriesPlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length))
for (var f = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, h = 0; h < a.dataSeriesIndexes.length; h++) {
var l = this.data[a.dataSeriesIndexes[h]],
t = 0,
k = !1,
r = !1,
p;
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,
d = 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[t].x && l.dataPoints[t].x.getTime || "dateTime" === l.xValueType) g = !0;
for (t = 0; t < l.dataPoints.length; t++) {
"undefined" === typeof l.dataPoints[t].x && (l.dataPoints[t].x = t + (a.axisX.logarithmic ? 1 : 0));
l.dataPoints[t].x.getTime ? (g = !0, c = l.dataPoints[t].x.getTime()) : c = l.dataPoints[t].x;
e = l.dataPoints[t].y;
c < b.min && (b.min = c);
c > b.max && (b.max = c);
e < f.min && "number" === typeof e && (f.min = e);
e > f.max && "number" === typeof e && (f.max = e);
if (0 < t) {
if (a.axisX.logarithmic) {
var w = c / l.dataPoints[t - 1].x;
1 > w && (w = 1 / w);
b.minDiff > w && 1 !== w && (b.minDiff = w)
} else w = c - l.dataPoints[t - 1].x, 0 > w && (w *= -1), b.minDiff > w && 0 !== w && (b.minDiff = w);
null !== e && null !== l.dataPoints[t - 1].y && (a.axisY.logarithmic ? (w = e / l.dataPoints[t - 1].y, 1 > w && (w = 1 / w), f.minDiff > w && 1 !== w && (f.minDiff = w)) : (w = e - l.dataPoints[t - 1].y, 0 > w && (w *= -1), f.minDiff > w && 0 !== w && (f.minDiff = w)))
}
if (c < n && !k) null !== e && (p = c);
else {
if (!k && (k = !0, 0 < t)) {
t -= 2;
continue
}
if (c > d &&
!r) r = !0;
else if (c > d && r) continue;
l.dataPoints[t].label && (a.axisX.labels[c] = l.dataPoints[t].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === e ? b.viewPortMin === c && p < c && (b.viewPortMin = p) : (e < f.viewPortMin && "number" === typeof e && (f.viewPortMin = e), e > f.viewPortMax && "number" === typeof e && (f.viewPortMax = e))
}
}
l.axisX.valueType = l.xValueType = g ? "dateTime" : "number"
}
};
q.prototype._processStackedPlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length)) {
for (var f =
a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, h = [], l = [], t = Infinity, k = -Infinity, r = 0; r < a.dataSeriesIndexes.length; r++) {
var p = this.data[a.dataSeriesIndexes[r]],
n = 0,
d = !1,
w = !1,
za;
if ("normal" === p.axisPlacement || "xySwapped" === p.axisPlacement) var D = this.sessionVariables.axisX.newViewportMinimum ? this.sessionVariables.axisX.newViewportMinimum : this.options.axisX && this.options.axisX.viewportMinimum ? this.options.axisX.viewportMinimum : this.options.axisX && this.options.axisX.minimum ? this.options.axisX.minimum : -Infinity,
u = this.sessionVariables.axisX.newViewportMaximum ? this.sessionVariables.axisX.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 (p.dataPoints[n].x && p.dataPoints[n].x.getTime || "dateTime" === p.xValueType) g = !0;
for (n = 0; n < p.dataPoints.length; n++) {
"undefined" === typeof p.dataPoints[n].x && (p.dataPoints[n].x = n + (a.axisX.logarithmic ? 1 : 0));
p.dataPoints[n].x.getTime ? (g = !0, c = p.dataPoints[n].x.getTime()) : c = p.dataPoints[n].x;
e = y(p.dataPoints[n].y) ? 0 : p.dataPoints[n].y;
c < b.min && (b.min = c);
c > b.max && (b.max = c);
if (0 < n) {
if (a.axisX.logarithmic) {
var m = c / p.dataPoints[n - 1].x;
1 > m && (m = 1 / m);
b.minDiff > m && 1 !== m && (b.minDiff = m)
} else m = c - p.dataPoints[n - 1].x, 0 > m && (m *= -1), b.minDiff > m && 0 !== m && (b.minDiff = m);
null !== e && null !== p.dataPoints[n - 1].y && (a.axisY.logarithmic ? 0 < e && (m = e / p.dataPoints[n - 1].y, 1 > m && (m = 1 / m), f.minDiff > m && 1 !== m && (f.minDiff = m)) : (m = e - p.dataPoints[n - 1].y, 0 > m && (m *= -1), f.minDiff >
m && 0 !== m && (f.minDiff = m)))
}
if (c < D && !d) null !== p.dataPoints[n].y && (za = c);
else {
if (!d && (d = !0, 0 < n)) {
n -= 2;
continue
}
if (c > u && !w) w = !0;
else if (c > u && w) continue;
p.dataPoints[n].label && (a.axisX.labels[c] = p.dataPoints[n].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === p.dataPoints[n].y ? b.viewPortMin === c && za < c && (b.viewPortMin = za) : (a.yTotals[c] = (a.yTotals[c] ? a.yTotals[c] : 0) + e, 0 <= e ? h[c] ? h[c] += e : (h[c] = e, t = Math.min(e, t)) : l[c] ? l[c] += e : (l[c] = e, k = Math.max(e, k)))
}
}
a.axisY.scaleBreaks &&
(a.axisY.scaleBreaks.autoCalculate && 1 <= a.axisY.scaleBreaks.maxNumberOfAutoBreaks) && (f.dataPointYPositiveSums ? (f.dataPointYPositiveSums.push.apply(f.dataPointYPositiveSums, h), f.dataPointYNegativeSums.push.apply(f.dataPointYPositiveSums, l)) : (f.dataPointYPositiveSums = h, f.dataPointYNegativeSums = l));
p.axisX.valueType = p.xValueType = g ? "dateTime" : "number"
}
for (n in h) h.hasOwnProperty(n) && !isNaN(n) && (a = h[n], a < f.min && (f.min = Math.min(a, t)), a > f.max && (f.max = a), n < b.viewPortMin || n > b.viewPortMax || (a < f.viewPortMin &&
(f.viewPortMin = Math.min(a, t)), a > f.viewPortMax && (f.viewPortMax = a)));
for (n in l) l.hasOwnProperty(n) && !isNaN(n) && (a = l[n], a < f.min && (f.min = a), a > f.max && (f.max = Math.max(a, k)), n < b.viewPortMin || n > b.viewPortMax || (a < f.viewPortMin && (f.viewPortMin = a), a > f.viewPortMax && (f.viewPortMax = Math.max(a, k))))
}
};
q.prototype._processStacked100PlotUnit = function (a) {
if (a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length)) {
for (var f = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, h = !1, l = !1, t = [], k = 0; k < a.dataSeriesIndexes.length; k++) {
var r =
this.data[a.dataSeriesIndexes[k]],
p = 0,
n = !1,
d = !1,
w;
if ("normal" === r.axisPlacement || "xySwapped" === r.axisPlacement) var m = this.sessionVariables.axisX.newViewportMinimum ? this.sessionVariables.axisX.newViewportMinimum : this.options.axisX && this.options.axisX.viewportMinimum ? this.options.axisX.viewportMinimum : this.options.axisX && this.options.axisX.minimum ? this.options.axisX.minimum : -Infinity,
D = this.sessionVariables.axisX.newViewportMaximum ? this.sessionVariables.axisX.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 (r.dataPoints[p].x && r.dataPoints[p].x.getTime || "dateTime" === r.xValueType) g = !0;
for (p = 0; p < r.dataPoints.length; p++) {
"undefined" === typeof r.dataPoints[p].x && (r.dataPoints[p].x = p + (a.axisX.logarithmic ? 1 : 0));
r.dataPoints[p].x.getTime ? (g = !0, c = r.dataPoints[p].x.getTime()) : c = r.dataPoints[p].x;
e = y(r.dataPoints[p].y) ? null : r.dataPoints[p].y;
c < b.min && (b.min =
c);
c > b.max && (b.max = c);
if (0 < p) {
if (a.axisX.logarithmic) {
var u = c / r.dataPoints[p - 1].x;
1 > u && (u = 1 / u);
b.minDiff > u && 1 !== u && (b.minDiff = u)
} else u = c - r.dataPoints[p - 1].x, 0 > u && (u *= -1), b.minDiff > u && 0 !== u && (b.minDiff = u);
y(e) || null === r.dataPoints[p - 1].y || (a.axisY.logarithmic ? 0 < e && (u = e / r.dataPoints[p - 1].y, 1 > u && (u = 1 / u), f.minDiff > u && 1 !== u && (f.minDiff = u)) : (u = e - r.dataPoints[p - 1].y, 0 > u && (u *= -1), f.minDiff > u && 0 !== u && (f.minDiff = u)))
}
if (c < m && !n) null !== e && (w = c);
else {
if (!n && (n = !0, 0 < p)) {
p -= 2;
continue
}
if (c > D && !d) d = !0;
else if (c >
D && d) continue;
r.dataPoints[p].label && (a.axisX.labels[c] = r.dataPoints[p].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
null === e ? b.viewPortMin === c && w < c && (b.viewPortMin = w) : (a.yTotals[c] = (a.yTotals[c] ? a.yTotals[c] : 0) + e, 0 <= e ? h = !0 : 0 > e && (l = !0), t[c] = t[c] ? t[c] + Math.abs(e) : Math.abs(e))
}
}
r.axisX.valueType = r.xValueType = g ? "dateTime" : "number"
}
a.axisY.logarithmic ? (f.max = y(f.viewPortMax) ? 99 * Math.pow(a.axisY.logarithmBase, -0.05) : Math.max(f.viewPortMax, 99 * Math.pow(a.axisY.logarithmBase, -0.05)), f.min = y(f.viewPortMin) ? 1 : Math.min(f.viewPortMin, 1)) : h && !l ? (f.max = y(f.viewPortMax) ? 99 : Math.max(f.viewPortMax, 99), f.min = y(f.viewPortMin) ? 1 : Math.min(f.viewPortMin, 1)) : h && l ? (f.max = y(f.viewPortMax) ? 99 : Math.max(f.viewPortMax, 99), f.min = y(f.viewPortMin) ? -99 : Math.min(f.viewPortMin, -99)) : !h && l && (f.max = y(f.viewPortMax) ? -1 : Math.max(f.viewPortMax, -1), f.min = y(f.viewPortMin) ? -99 : Math.min(f.viewPortMin, -99));
f.viewPortMin = f.min;
f.viewPortMax = f.max;
a.dataPointYSums = t
}
};
q.prototype._processMultiYPlotUnit = function (a) {
if (a.dataSeriesIndexes &&
!(1 > a.dataSeriesIndexes.length))
for (var f = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g, h, l = !1, t = 0; t < a.dataSeriesIndexes.length; t++) {
var k = this.data[a.dataSeriesIndexes[t]],
r = 0,
p = !1,
n = !1,
d, w, m;
if ("normal" === k.axisPlacement || "xySwapped" === k.axisPlacement) var D = 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,
u = 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 (k.dataPoints[r].x && k.dataPoints[r].x.getTime || "dateTime" === k.xValueType) l = !0;
for (r = 0; r < k.dataPoints.length; r++) {
"undefined" === typeof k.dataPoints[r].x && (k.dataPoints[r].x = r + (a.axisX.logarithmic ? 1 : 0));
k.dataPoints[r].x.getTime ?
(l = !0, c = k.dataPoints[r].x.getTime()) : c = k.dataPoints[r].x;
if ((e = k.dataPoints[r].y) && e.length) {
g = Math.min.apply(null, e);
h = Math.max.apply(null, e);
w = !0;
for (var v = 0; v < e.length; v++) null === e.k && (w = !1);
w && (p || (m = d), d = c)
}
c < b.min && (b.min = c);
c > b.max && (b.max = c);
g < f.min && (f.min = g);
h > f.max && (f.max = h);
0 < r && (a.axisX.logarithmic ? (w = c / k.dataPoints[r - 1].x, 1 > w && (w = 1 / w), b.minDiff > w && 1 !== w && (b.minDiff = w)) : (w = c - k.dataPoints[r - 1].x, 0 > w && (w *= -1), b.minDiff > w && 0 !== w && (b.minDiff = w)), e && (null !== e[0] && k.dataPoints[r - 1].y && null !==
k.dataPoints[r - 1].y[0]) && (a.axisY.logarithmic ? (w = e[0] / k.dataPoints[r - 1].y[0], 1 > w && (w = 1 / w), f.minDiff > w && 1 !== w && (f.minDiff = w)) : (w = e[0] - k.dataPoints[r - 1].y[0], 0 > w && (w *= -1), f.minDiff > w && 0 !== w && (f.minDiff = w))));
if (!(c < D) || p) {
if (!p && (p = !0, 0 < r)) {
r -= 2;
d = m;
continue
}
if (c > u && !n) n = !0;
else if (c > u && n) continue;
k.dataPoints[r].label && (a.axisX.labels[c] = k.dataPoints[r].label);
c < b.viewPortMin && (b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
if (b.viewPortMin === c && e)
for (v = 0; v < e.length; v++)
if (null === e[v] && d < c) {
b.viewPortMin =
d;
break
}
null === e ? b.viewPortMin === c && d < c && (b.viewPortMin = d) : (g < f.viewPortMin && (f.viewPortMin = g), h > f.viewPortMax && (f.viewPortMax = h))
}
}
k.axisX.valueType = k.xValueType = l ? "dateTime" : "number"
}
};
q.prototype._processSpecificPlotUnit = function (a) {
if ("waterfall" === a.type && a.dataSeriesIndexes && !(1 > a.dataSeriesIndexes.length))
for (var f = a.axisY.dataInfo, b = a.axisX.dataInfo, c, e, g = !1, h = 0; h < a.dataSeriesIndexes.length; h++) {
var l = this.data[a.dataSeriesIndexes[h]],
t = 0,
k = !1,
r = !1,
p = 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,
d = 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[t].x && l.dataPoints[t].x.getTime || "dateTime" === l.xValueType) g = !0;
for (t = 0; t < l.dataPoints.length; t++) "undefined" !== typeof l.dataPoints[t].isCumulativeSum && !0 === l.dataPoints[t].isCumulativeSum ? (l.dataPointEOs[t].cumulativeSumYStartValue = 0, l.dataPointEOs[t].cumulativeSum = 0 === t ? 0 : l.dataPointEOs[t - 1].cumulativeSum, l.dataPoints[t].y = 0 === t ? 0 : l.dataPointEOs[t - 1].cumulativeSum) : "undefined" !== typeof l.dataPoints[t].isIntermediateSum &&
!0 === l.dataPoints[t].isIntermediateSum ? (l.dataPointEOs[t].cumulativeSumYStartValue = p, l.dataPointEOs[t].cumulativeSum = 0 === t ? 0 : l.dataPointEOs[t - 1].cumulativeSum, l.dataPoints[t].y = 0 === t ? 0 : c, p = 0 === t ? 0 : l.dataPointEOs[t - 1].cumulativeSum, c = 0) : (e = "number" !== typeof l.dataPoints[t].y ? 0 : l.dataPoints[t].y, l.dataPointEOs[t].cumulativeSumYStartValue = 0 === t ? 0 : l.dataPointEOs[t - 1].cumulativeSum, l.dataPointEOs[t].cumulativeSum = 0 === t ? e : l.dataPointEOs[t - 1].cumulativeSum + e, c += e);
for (t = 0; t < l.dataPoints.length; t++)
if ("undefined" ===
typeof l.dataPoints[t].x && (l.dataPoints[t].x = t + (a.axisX.logarithmic ? 1 : 0)), l.dataPoints[t].x.getTime ? (g = !0, c = l.dataPoints[t].x.getTime()) : c = l.dataPoints[t].x, e = l.dataPoints[t].y, c < b.min && (b.min = c), c > b.max && (b.max = c), l.dataPointEOs[t].cumulativeSum < f.min && (f.min = l.dataPointEOs[t].cumulativeSum), l.dataPointEOs[t].cumulativeSum > f.max && (f.max = l.dataPointEOs[t].cumulativeSum), 0 < t && (a.axisX.logarithmic ? (p = c / l.dataPoints[t - 1].x, 1 > p && (p = 1 / p), b.minDiff > p && 1 !== p && (b.minDiff = p)) : (p = c - l.dataPoints[t - 1].x, 0 > p &&
(p *= -1), b.minDiff > p && 0 !== p && (b.minDiff = p)), null !== e && null !== l.dataPoints[t - 1].y && (a.axisY.logarithmic ? (e = l.dataPointEOs[t].cumulativeSum / l.dataPointEOs[t - 1].cumulativeSum, 1 > e && (e = 1 / e), f.minDiff > e && 1 !== e && (f.minDiff = e)) : (e = l.dataPointEOs[t].cumulativeSum - l.dataPointEOs[t - 1].cumulativeSum, 0 > e && (e *= -1), f.minDiff > e && 0 !== e && (f.minDiff = e)))), !(c < n) || k) {
if (!k && (k = !0, 0 < t)) {
t -= 2;
continue
}
if (c > d && !r) r = !0;
else if (c > d && r) continue;
l.dataPoints[t].label && (a.axisX.labels[c] = l.dataPoints[t].label);
c < b.viewPortMin &&
(b.viewPortMin = c);
c > b.viewPortMax && (b.viewPortMax = c);
0 < t && (l.dataPointEOs[t - 1].cumulativeSum < f.viewPortMin && (f.viewPortMin = l.dataPointEOs[t - 1].cumulativeSum), l.dataPointEOs[t - 1].cumulativeSum > f.viewPortMax && (f.viewPortMax = l.dataPointEOs[t - 1].cumulativeSum));
l.dataPointEOs[t].cumulativeSum < f.viewPortMin && (f.viewPortMin = l.dataPointEOs[t].cumulativeSum);
l.dataPointEOs[t].cumulativeSum > f.viewPortMax && (f.viewPortMax = l.dataPointEOs[t].cumulativeSum)
}
l.axisX.valueType = l.xValueType = g ? "dateTime" : "number"
}
};
q.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 f(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 f = a.axisY.dataInfo, g = a.axisX.dataInfo, k, h = g.min, n = g.max, l = f.min, t = f.max, g = g._dataRanges, f = f._dataRanges, p, r = 0, m = 0; m < a.dataSeriesIndexes.length; m++) {
var v = e.data[a.dataSeriesIndexes[m]];
if (!(4 > v.dataPoints.length))
for (r = 0; r < v.dataPoints.length; r++)
if (c && (p = (n + 1 - h) * Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold) || 10, 10) / 100, k = v.dataPoints[r].x.getTime ? v.dataPoints[r].x.getTime() : v.dataPoints[r].x, p = Math.floor((k - h) / p), k < g[p].min &&
(g[p].min = k), k > g[p].max && (g[p].max = k)), b) {
var s = (t + 1 - l) * Math.max(parseFloat(a.axisY.scaleBreaks.collapsibleThreshold) || 10, 10) / 100;
if ((k = "waterfall" === a.type ? v.dataPointEOs[r].cumulativeSum : v.dataPoints[r].y) && k.length)
for (var q = 0; q < k.length; q++) p = Math.floor((k[q] - l) / s), k[q] < f[p].min && (f[p].min = k[q]), k[q] > f[p].max && (f[p].max = k[q]);
else y(k) || (p = Math.floor((k - l) / s), k < f[p].min && (f[p].min = k), k > f[p].max && (f[p].max = k))
}
}
}
}
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, f = c.max, g = c._dataRanges, k, h = 0, n = 0; n < a.dataSeriesIndexes.length; n++) {
var l = e.data[a.dataSeriesIndexes[n]];
if (!(4 > l.dataPoints.length))
for (h = 0; h < l.dataPoints.length; h++) k = (f + 1 - b) * Math.max(parseFloat(a.axisX.scaleBreaks.collapsibleThreshold) || 10, 10) / 100, c = l.dataPoints[h].x.getTime ? l.dataPoints[h].x.getTime() : l.dataPoints[h].x, k = Math.floor((c - b) / k), c < g[k].min && (g[k].min = c), c > g[k].max && (g[k].max =
c)
}
}
for (var c, e = this, g = !1, h = 0; h < this._axes.length; h++)
if (this._axes[h].scaleBreaks && this._axes[h].scaleBreaks.autoCalculate && 1 <= this._axes[h].scaleBreaks.maxNumberOfAutoBreaks) {
g = !0;
this._axes[h].dataInfo._dataRanges = [];
for (var l = 0; l < 100 / Math.max(parseFloat(this._axes[h].scaleBreaks.collapsibleThreshold) || 10, 10); l++) this._axes[h].dataInfo._dataRanges.push({
min: Infinity,
max: -Infinity
})
}
if (g) {
for (h = 0; h < this.plotInfo.plotTypes.length; h++)
for (g = this.plotInfo.plotTypes[h], 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 ? f(c) : 0 <= c.type.indexOf("stacked") && b(c);
for (h = 0; h < this._axes.length; h++)
if (this._axes[h].dataInfo._dataRanges) {
var t =
this._axes[h].dataInfo.min;
c = (this._axes[h].dataInfo.max + 1 - t) * Math.max(parseFloat(this._axes[h].scaleBreaks.collapsibleThreshold) || 10, 10) / 100;
var k = this._axes[h].dataInfo._dataRanges,
r, p, g = [];
if (this._axes[h].dataInfo.dataPointYPositiveSums) {
var n = this._axes[h].dataInfo.dataPointYPositiveSums;
r = k;
for (l in n) n.hasOwnProperty(l) && !isNaN(l) && (p = n[l], y(p) || (index = Math.floor((p - t) / c), p < r[index].min && (r[index].min = p), p > r[index].max && (r[index].max = p)));
delete this._axes[h].dataInfo.dataPointYPositiveSums
}
if (this._axes[h].dataInfo.dataPointYNegativeSums) {
n =
this._axes[h].dataInfo.dataPointYNegativeSums;
r = k;
for (l in n) n.hasOwnProperty(l) && !isNaN(l) && (p = -1 * n[l], y(p) || (index = Math.floor((p - t) / c), p < r[index].min && (r[index].min = p), p > r[index].max && (r[index].max = p)));
delete this._axes[h].dataInfo.dataPointYNegativeSums
}
for (l = 0; l < k.length - 1; l++)
if (r = k[l].max, isFinite(r))
for (; l < k.length - 1;)
if (t = k[l + 1].min, isFinite(t)) {
p = t - r;
p > c && g.push({
diff: p,
start: r,
end: t
});
break
} else l++;
if (this._axes[h].scaleBreaks.customBreaks)
for (l = 0; l < this._axes[h].scaleBreaks.customBreaks.length; l++)
for (c =
0; c < g.length; c++)
if (this._axes[h].scaleBreaks.customBreaks[l].startValue <= g[c].start && g[c].start <= this._axes[h].scaleBreaks.customBreaks[l].endValue || this._axes[h].scaleBreaks.customBreaks[l].startValue <= g[c].start && g[c].start <= this._axes[h].scaleBreaks.customBreaks[l].endValue || g[c].start <= this._axes[h].scaleBreaks.customBreaks[l].startValue && this._axes[h].scaleBreaks.customBreaks[l].startValue <= g[c].end || g[c].start <= this._axes[h].scaleBreaks.customBreaks[l].endValue && this._axes[h].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[h].scaleBreaks.maxNumberOfAutoBreaks); l++) c = a(g[l].start, g[l].end, this._axes[h].logarithmic ? this._axes[h].dataInfo.max / this._axes[h].dataInfo.min : this._axes[h].dataInfo.max - this._axes[h].dataInfo.min, this._axes[h].logarithmic), this._axes[h].scaleBreaks.autoBreaks.push(new aa(this, "autoBreaks", c, l, ++this._eventManager.lastObjectId, this._axes[h].scaleBreaks)), this._axes[h].scaleBreaks._appliedBreaks.push(this._axes[h].scaleBreaks.autoBreaks[this._axes[h].scaleBreaks.autoBreaks.length -
1]);
this._axes[h].scaleBreaks._appliedBreaks.sort(function (a, c) {
return a.startValue - c.startValue
})
}
}
};
q.prototype.getDataPointAtXY = function (a, f, b) {
b = b || !1;
for (var c = [], e = this._dataInRenderedOrder.length - 1; 0 <= e; e--) {
var g = null;
(g = this._dataInRenderedOrder[e].getDataPointAtXY(a, f, b)) && c.push(g)
}
a = null;
f = !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) {
f = !0;
break
}
for (b = 0; b < c.length; b++) f && "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
};
q.prototype.getObjectAtXY = function (a, f, b) {
var c = null;
if (b = this.getDataPointAtXY(a, f, b || !1)) c = b.dataSeries.dataPointIds[b.dataPointIndex];
else if (v) c = Wa(a, f, 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 && f >= e.y1 && f <= e.y2) && (c = e.id)
}
return c
};
q.prototype.getAutoFontSize = function (a, f, b) {
f = Math.min(this.width, this.height);
return Math.max("theme4" === this.theme ? 0 : 300 <= f ? 12 : 10, Math.round(f * (a / 400)))
};
q.prototype.resetOverlayedCanvas = function () {
this.overlaidCanvasCtx.clearRect(0, 0, this.width, this.height)
};
q.prototype.clearCanvas = 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))
};
q.prototype.attachEvent = function (a) {
this._events.push(a)
};
q.prototype._touchEventHandler = function (a) {
if (a.changedTouches && this.interactivityEnabled) {
var f = [],
b = a.changedTouches,
c = b ? b[0] : a,
e = null;
switch (a.type) {
case "touchstart":
case "MSPointerDown":
f = ["mousemove", "mousedown"];
this._lastTouchData = Oa(c);
this._lastTouchData.time = new Date;
break;
case "touchmove":
case "MSPointerMove":
f = ["mousemove"];
break;
case "touchend":
case "MSPointerUp":
var g = this._lastTouchData && this._lastTouchData.time ? new Date - this._lastTouchData.time :
0,
f = "touchstart" === this._lastTouchEventType || "MSPointerDown" === this._lastTouchEventType || 300 > g ? ["mouseup", "click"] : ["mouseup"];
break;
default:
return
}
if (!(b && 1 < b.length)) {
e = Oa(c);
e.time = new Date;
try {
var h = e.y - this._lastTouchData.y,
g = e.time - this._lastTouchData.time;
if (15 < Math.abs(h) && (this._lastTouchData.scroll || 300 > g)) {
this._lastTouchData.scroll = !0;
var l = window.parent || window;
l && l.scrollBy && l.scrollBy(0, -h)
}
} catch (t) {}
this._lastTouchEventType = a.type;
if (this._lastTouchData.scroll && this.zoomEnabled) this.isDrag &&
this.resetOverlayedCanvas(), this.isDrag = !1;
else
for (b = 0; b < f.length; b++) e = f[b], g = document.createEvent("MouseEvent"), g.initMouseEvent(e, !0, !0, window, 1, c.screenX, c.screenY, c.clientX, c.clientY, !1, !1, !1, !1, 0, null), c.target.dispatchEvent(g), a.preventManipulation && a.preventManipulation(), a.preventDefault && a.preventDefault()
}
}
};
q.prototype._dispatchRangeEvent = function (a, f) {
var b = {
chart: this
};
b.type = a;
b.trigger = f;
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 (y(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)
};
q.prototype._mouseEventHandler = function (a) {
"undefined" === typeof a.target && a.srcElement && (a.target = a.srcElement);
var f = Oa(a),
b = a.type,
c, e;
a.which ? e = 3 == a.which : a.button && (e = 2 == a.button);
q.capturedEventParam && (c = q.capturedEventParam, "mouseup" === b && (q.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 && v || c[b].call(c.context, f.x, f.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(), !e) {
if (!q.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, f.x >= e.x1 && f.x <= e.x2 && f.y >= e.y1 && f.y <= e.y2) {
c[b].call(c.context,
f.x, f.y);
"mousedown" === b && !0 === c.capture ? (q.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 (f.x < b.x1 || f.x >
b.x2 || f.y < b.y1 || f.y > b.y2) this.toolTip && this.toolTip.enabled ? this.toolTip.hide() : this.resetOverlayedCanvas();
this.isDrag && this.zoomEnabled || !this._eventManager || this._eventManager.mouseEventHandler(a)
}
};
q.prototype._plotAreaMouseDown = function (a, f) {
this.isDrag = !0;
this.dragStartPoint = {
x: a,
y: f
}
};
q.prototype._plotAreaMouseUp = function (a, f) {
if (("normal" === this.plotInfo.axisPlacement || "xySwapped" === this.plotInfo.axisPlacement) && this.isDrag) {
var b = f - this.dragStartPoint.y,
c = a - this.dragStartPoint.x,
e = 0 <= this.zoomType.indexOf("x"),
g = 0 <= this.zoomType.indexOf("y"),
h = !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, h = !0) : b.viewportMaximum > b.maximum && (g = b.viewportMaximum / b.maximum, b.sessionVariables.newViewportMinimum =
b.viewportMinimum / g, b.sessionVariables.newViewportMaximum = b.viewportMaximum / g, h = !0) : b.viewportMinimum < b.minimum ? (g = b.minimum - b.viewportMinimum, b.sessionVariables.newViewportMinimum = b.viewportMinimum + g, b.sessionVariables.newViewportMaximum = b.viewportMaximum + g, h = !0) : b.viewportMaximum > b.maximum && (g = b.viewportMaximum - b.maximum, b.sessionVariables.newViewportMinimum = b.viewportMinimum - g, b.sessionVariables.newViewportMaximum = b.viewportMaximum - g, h = !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 ? f : this.plotArea.y2;
2 < Math.abs(b - e) && 2 < Math.abs(c - g) && this._zoomPanToSelectedRegion(b, c, e, g) && (h = !0)
}
h && (this._ignoreNextEvent = !0, this._dispatchRangeEvent("rangeChanging", "zoom"), this.render(), this._dispatchRangeEvent("rangeChanged", "zoom"), h && (this.zoomEnabled && "none" === this._zoomButton.style.display) && (Ma(this._zoomButton, this._resetButton), va(this, this._zoomButton, "pan"), va(this, this._resetButton,
"reset")))
}
}
this.isDrag = !1;
if ("none" !== this.plotInfo.axisPlacement) {
this.resetOverlayedCanvas();
if (this.axisX && 0 < this.axisX.length)
for (h = 0; h < this.axisX.length; h++) this.axisX[h].crosshair && this.axisX[h].crosshair.enabled && this.axisX[h].renderCrosshair(a, f);
if (this.axisX2 && 0 < this.axisX2.length)
for (h = 0; h < this.axisX2.length; h++) this.axisX2[h].crosshair && this.axisX2[h].crosshair.enabled && this.axisX2[h].renderCrosshair(a, f);
if (this.axisY && 0 < this.axisY.length)
for (h = 0; h < this.axisY.length; h++) this.axisY[h].crosshair &&
this.axisY[h].crosshair.enabled && this.axisY[h].renderCrosshair(a, f);
if (this.axisY2 && 0 < this.axisY2.length)
for (h = 0; h < this.axisY2.length; h++) this.axisY2[h].crosshair && this.axisY2[h].crosshair.enabled && this.axisY2[h].renderCrosshair(a, f)
}
};
q.prototype._plotAreaMouseMove = function (a, f) {
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"),
h = this;
"xySwapped" === this.plotInfo.axisPlacement && (b = g, g = e, e = b);
b = this.dragStartPoint.x -
a;
c = this.dragStartPoint.y - f;
2 < Math.abs(b) && 8 > Math.abs(b) && (this.panEnabled || this.zoomEnabled) ? this.toolTip.hide() : this.panEnabled || this.zoomEnabled || this.toolTip.mouseMoveHandler(a, f);
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(h._panTimerId), h._panTimerId = setTimeout(function (c,
b, e, d) {
return function () {
h._zoomPanToSelectedRegion(c, b, e, d, !0) && (h._dispatchRangeEvent("rangeChanging", "pan"), h.render(), h._dispatchRangeEvent("rangeChanged", "pan"), h.dragStartPoint.x = a, h.dragStartPoint.y = f)
}
}(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,
t = e ? a - this.dragStartPoint.x : this.plotArea.x2 -
this.plotArea.x1,
k = g ? f - this.dragStartPoint.y : this.plotArea.y2 - this.plotArea.y1;
this.validateRegion(c, l, e ? a : this.plotArea.x2 - this.plotArea.x1, g ? f : 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, t, k);
this.overlaidCanvasCtx.globalAlpha = b
}
} else if (this.toolTip.mouseMoveHandler(a, f), "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, f);
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, f);
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, f);
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, f)
}
};
q.prototype._zoomPanToSelectedRegion = function (a, f, b, c, e) {
a = this.validateRegion(a, f, b, c, e);
f = a.axesWithValidRange;
b = a.axesRanges;
if (a.isValid)
for (c = 0; c < f.length; c++) e = b[c], f[c].setViewPortRange(e.val1, e.val2);
return a.isValid
};
q.prototype.validateRegion = function (a, f, b, c, e) {
e = e || !1;
for (var g = 0 <= this.zoomType.indexOf("x"), h = 0 <= this.zoomType.indexOf("y"), l = !1, t = [], k = [], r = [], p = 0; p < this._axes.length; p++)("axisX" === this._axes[p].type &&
g || "axisY" === this._axes[p].type && h) && k.push(this._axes[p]);
for (h = 0; h < k.length; h++) {
var p = k[h],
g = !1,
n = p.convertPixelToValue({
x: a,
y: f
}),
d = p.convertPixelToValue({
x: b,
y: c
});
if (n > d) var w = d,
d = n,
n = w;
if (p.scaleBreaks)
for (w = 0; !g && w < p.scaleBreaks._appliedBreaks.length; w++) g = p.scaleBreaks._appliedBreaks[w].startValue <= n && p.scaleBreaks._appliedBreaks[w].endValue >= d;
if (isFinite(p.dataInfo.minDiff))
if (w = p.getApparentDifference(n, d, null, !0), !(g || !(this.panEnabled && p.scaleBreaks && p.scaleBreaks._appliedBreaks.length) &&
(p.logarithmic && w < Math.pow(p.dataInfo.minDiff, 3) || !p.logarithmic && w < 3 * Math.abs(p.dataInfo.minDiff)) || n < p.minimum || d > p.maximum)) t.push(p), r.push({
val1: n,
val2: d
}), l = !0;
else if (!e) {
l = !1;
break
}
}
return {
isValid: l,
axesWithValidRange: t,
axesRanges: r
}
};
q.prototype.preparePlotArea = function () {
var a = this.plotArea;
!v && (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 f = 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 = f.x1 < f.x2 ? f.x1 : b.lineCoordinates.x1;
a.y1 = f.y1 < b.lineCoordinates.y1 ? f.y1 : b.lineCoordinates.y1;
a.x2 = f.x2 > b.lineCoordinates.x2 ? f.x2 : b.lineCoordinates.x2;
a.y2 = f.y2 > f.y1 ? f.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 = f.x1 < f.x2 ? f.x1 : b.lineCoordinates.x1, a.y1 = f.y1 < b.lineCoordinates.y1 ? f.y1 : b.lineCoordinates.y1, a.x2 = f.x2 > b.lineCoordinates.x2 ?
f.x2 : b.lineCoordinates.x2, a.y2 = f.y2 > f.y1 ? f.y2 : b.lineCoordinates.y2, a.width = a.x2 - a.x1, a.height = a.y2 - a.y1)
} else f = this.layoutManager.getFreeSpace(), a.x1 = f.x1, a.x2 = f.x2, a.y1 = f.y1, a.y2 = f.y2, a.width = f.width, a.height = f.height;
v || (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 Ea(a.x1, a.y1, a.x2, a.y2, 2)
};
q.prototype.renderIndexLabels = function (a) {
var f = a || this.plotArea.ctx,
b = this.plotArea,
c = 0,
e = 0,
g = 0,
h = 0,
l = c = h = e = g = 0,
t = 0;
for (a = 0; a < this._indexLabels.length; a++) {
var k = this._indexLabels[a],
r = k.chartType.toLowerCase(),
p, n, l = na("indexLabelFontColor", k.dataPoint, k.dataSeries),
t = na("indexLabelFontSize", k.dataPoint, k.dataSeries);
p = na("indexLabelFontFamily", k.dataPoint, k.dataSeries);
n = na("indexLabelFontStyle", k.dataPoint, k.dataSeries);
var h = na("indexLabelFontWeight", k.dataPoint, k.dataSeries),
d = na("indexLabelBackgroundColor", k.dataPoint, k.dataSeries),
e = na("indexLabelMaxWidth", k.dataPoint, k.dataSeries),
g = na("indexLabelWrap", k.dataPoint, k.dataSeries),
w = na("indexLabelLineDashType", k.dataPoint, k.dataSeries),
m = na("indexLabelLineColor", k.dataPoint, k.dataSeries),
D = y(k.dataPoint.indexLabelLineThickness) ? y(k.dataSeries.options.indexLabelLineThickness) ? 0 : k.dataSeries.options.indexLabelLineThickness : k.dataPoint.indexLabelLineThickness,
c = 0 < D ? Math.min(10, ("normal" === this.plotInfo.axisPlacement ? this.plotArea.height : this.plotArea.width) << 0) : 0,
u = {
percent: null,
total: null
},
S = null;
if (0 <= k.dataSeries.type.indexOf("stacked") ||
"pie" === k.dataSeries.type || "doughnut" === k.dataSeries.type) u = this.getPercentAndTotal(k.dataSeries, k.dataPoint);
if (k.dataSeries.indexLabelFormatter || k.dataPoint.indexLabelFormatter) S = {
chart: this,
dataSeries: k.dataSeries,
dataPoint: k.dataPoint,
index: k.indexKeyword,
total: u.total,
percent: u.percent
};
var ca = k.dataPoint.indexLabelFormatter ? k.dataPoint.indexLabelFormatter(S) : k.dataPoint.indexLabel ? this.replaceKeywordsWithValue(k.dataPoint.indexLabel, k.dataPoint, k.dataSeries, null, k.indexKeyword) : k.dataSeries.indexLabelFormatter ?
k.dataSeries.indexLabelFormatter(S) : k.dataSeries.indexLabel ? this.replaceKeywordsWithValue(k.dataSeries.indexLabel, k.dataPoint, k.dataSeries, null, k.indexKeyword) : null;
if (null !== ca && "" !== ca) {
var u = na("indexLabelPlacement", k.dataPoint, k.dataSeries),
S = na("indexLabelOrientation", k.dataPoint, k.dataSeries),
s = k.direction,
q = k.dataSeries.axisX,
A = k.dataSeries.axisY,
x = !1,
d = new la(f, {
x: 0,
y: 0,
maxWidth: e ? e : 0.5 * this.width,
maxHeight: g ? 5 * t : 1.5 * t,
angle: "horizontal" === S ? 0 : -90,
text: ca,
padding: 0,
backgroundColor: d,
horizontalAlign: "left",
fontSize: t,
fontFamily: p,
fontWeight: h,
fontColor: l,
fontStyle: n,
textBaseline: "top"
});
d.measureText();
k.dataSeries.indexLabelMaxWidth = d.maxWidth;
if ("stackedarea100" === r) {
if (k.point.x < b.x1 || k.point.x > b.x2 || k.point.y < b.y1 - 1 || k.point.y > b.y2 + 1) continue
} else if ("rangearea" === r || "rangesplinearea" === r) {
if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum || Math.max.apply(null, k.dataPoint.y) < A.viewportMinimum || Math.min.apply(null, k.dataPoint.y) > A.viewportMaximum) continue
} else if (0 <= r.indexOf("line") ||
0 <= r.indexOf("area") || 0 <= r.indexOf("bubble") || 0 <= r.indexOf("scatter")) {
if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum || k.dataPoint.y < A.viewportMinimum || k.dataPoint.y > A.viewportMaximum) continue
} else if (0 <= r.indexOf("column") || "waterfall" === r || "error" === r && !k.axisSwapped) {
if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum || k.bounds.y1 > b.y2 || k.bounds.y2 < b.y1) continue
} else if (0 <= r.indexOf("bar") || "error" === r) {
if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum ||
k.bounds.x1 > b.x2 || k.bounds.x2 < b.x1) continue
} else if ("candlestick" === r || "ohlc" === r) {
if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum || Math.max.apply(null, k.dataPoint.y) < A.viewportMinimum || Math.min.apply(null, k.dataPoint.y) > A.viewportMaximum) continue
} else if (k.dataPoint.x < q.viewportMinimum || k.dataPoint.x > q.viewportMaximum) continue;
e = h = 2;
"horizontal" === S ? (l = d.width, t = d.height) : (t = d.width, l = d.height);
if ("normal" === this.plotInfo.axisPlacement) {
if (0 <= r.indexOf("line") || 0 <= r.indexOf("area")) u =
"auto", h = 4;
else if (0 <= r.indexOf("stacked")) "auto" === u && (u = "inside");
else if ("bubble" === r || "scatter" === r) u = "inside";
p = k.point.x - l / 2;
"inside" !== u ? (e = b.y1, g = b.y2, 0 < s ? (n = k.point.y - t - h - c, n < e && (n = "auto" === u ? Math.max(k.point.y, e) + h + c : e + h + c, x = n + t > k.point.y)) : (n = k.point.y + h + c, n > g - t - h - c && (n = "auto" === u ? Math.min(k.point.y, g) - t - h - c : g - t - h - c, x = n < k.point.y))) : (e = Math.max(k.bounds.y1, b.y1), g = Math.min(k.bounds.y2, b.y2), c = 0 <= r.indexOf("range") || "error" === r ? 0 < s ? Math.max(k.bounds.y1, b.y1) + t / 2 + h : Math.min(k.bounds.y2, b.y2) -
t / 2 - h : (Math.max(k.bounds.y1, b.y1) + Math.min(k.bounds.y2, b.y2)) / 2, 0 < s ? (n = Math.max(k.point.y, c) - t / 2, n < e && ("bubble" === r || "scatter" === r) && (n = Math.max(k.point.y - t - h, b.y1 + h))) : (n = Math.min(k.point.y, c) - t / 2, n > g - t - h && ("bubble" === r || "scatter" === r) && (n = Math.min(k.point.y + h, b.y2 - t - h))), n = Math.min(n, g - t))
} else 0 <= r.indexOf("line") || 0 <= r.indexOf("area") || 0 <= r.indexOf("scatter") ? (u = "auto", e = 4) : 0 <= r.indexOf("stacked") ? "auto" === u && (u = "inside") : "bubble" === r && (u = "inside"), n = k.point.y - t / 2, "inside" !== u ? (h = b.x1, g = b.x2,
0 > s ? (p = k.point.x - l - e - c, p < h && (p = "auto" === u ? Math.max(k.point.x, h) + e + c : h + e + c, x = p + l > k.point.x)) : (p = k.point.x + e + c, p > g - l - e - c && (p = "auto" === u ? Math.min(k.point.x, g) - l - e - c : g - l - e - c, x = p < k.point.x))) : (h = Math.max(k.bounds.x1, b.x1), Math.min(k.bounds.x2, b.x2), c = 0 <= r.indexOf("range") || "error" === r ? 0 > s ? Math.max(k.bounds.x1, b.x1) + l / 2 + e : Math.min(k.bounds.x2, b.x2) - l / 2 - e : (Math.max(k.bounds.x1, b.x1) + Math.min(k.bounds.x2, b.x2)) / 2, p = 0 > s ? Math.max(k.point.x, c) - l / 2 : Math.min(k.point.x, c) - l / 2, p = Math.max(p, h));
"vertical" === S && (n +=
t);
d.x = p;
d.y = n;
d.render(!0);
D && ("inside" !== u && (0 > r.indexOf("bar") && ("error" !== r || !k.axisSwapped) && k.point.x > b.x1 && k.point.x < b.x2 || !x) && (0 > r.indexOf("column") && ("error" !== r || k.axisSwapped) && k.point.y > b.y1 && k.point.y < b.y2 || !x)) && (f.lineWidth = D, f.strokeStyle = m ? m : "gray", f.setLineDash && f.setLineDash(G(w, D)), f.beginPath(), f.moveTo(k.point.x, k.point.y), 0 <= r.indexOf("bar") || "error" === r && k.axisSwapped ? f.lineTo(p + (0 < k.direction ? 0 : l), n + ("horizontal" === S ? t : -t) / 2) : 0 <= r.indexOf("column") || "error" === r && !k.axisSwapped ?
f.lineTo(p + l / 2, n + ((0 < k.direction ? t : -t) + ("horizontal" === S ? t : -t)) / 2) : f.lineTo(p + l / 2, n + ((n < k.point.y ? t : -t) + ("horizontal" === S ? t : -t)) / 2), f.stroke())
}
}
f = {
source: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0,
startTimePercent: 0.7
};
for (a = 0; a < this._indexLabels.length; a++) k = this._indexLabels[a], d = na("indexLabelBackgroundColor", k.dataPoint, k.dataSeries), k.dataSeries.indexLabelBackgroundColor = y(d) ? v ? "transparent" : null : d;
return f
};
q.prototype.renderLine =
function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
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 = [], h, l = 0; l < a.dataSeriesIndexes.length; l++) {
var t = a.dataSeriesIndexes[l],
k = this.data[t];
b.lineWidth = k.lineThickness;
var r = k.dataPoints,
p = "solid";
if (b.setLineDash) {
var n = G(k.nullDataLineDashType, k.lineThickness),
p = k.lineDashType,
d = G(p, k.lineThickness);
b.setLineDash(d)
}
var w =
k.id;
this._eventManager.objectMap[w] = {
objectType: "dataSeries",
dataSeriesIndex: t
};
w = R(w);
c.strokeStyle = w;
c.lineWidth = 0 < k.lineThickness ? Math.max(k.lineThickness, 4) : 0;
var w = k._colorSet,
m = w = k.lineColor = k.options.lineColor ? k.options.lineColor : w[0];
b.strokeStyle = w;
var D = !0,
u = 0,
S, ca;
b.beginPath();
if (0 < r.length) {
for (var s = !1, u = 0; u < r.length; u++)
if (S = r[u].x.getTime ? r[u].x.getTime() : r[u].x, !(S < a.axisX.dataInfo.viewPortMin || S > a.axisX.dataInfo.viewPortMax && (!k.connectNullData || !s)))
if ("number" !== typeof r[u].y) 0 <
u && !(k.connectNullData || s || D) && (b.stroke(), v && c.stroke()), s = !0;
else {
S = a.axisX.convertValueToPixel(S);
ca = a.axisY.convertValueToPixel(r[u].y);
var q = k.dataPointIds[u];
this._eventManager.objectMap[q] = {
id: q,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: u,
x1: S,
y1: ca
};
D || s ? (!D && k.connectNullData ? (b.setLineDash && (k.options.nullDataLineDashType || p === k.lineDashType && k.lineDashType !== k.nullDataLineDashType) && (b.stroke(), b.beginPath(), b.moveTo(h.x, h.y), p = k.nullDataLineDashType, b.setLineDash(n)), b.lineTo(S,
ca), v && c.lineTo(S, ca)) : (b.beginPath(), b.moveTo(S, ca), v && (c.beginPath(), c.moveTo(S, ca))), s = D = !1) : (b.lineTo(S, ca), v && c.lineTo(S, ca), 0 == u % 500 && (b.stroke(), b.beginPath(), b.moveTo(S, ca), v && (c.stroke(), c.beginPath(), c.moveTo(S, ca))));
h = {
x: S,
y: ca
};
u < r.length - 1 && (m !== (r[u].lineColor || w) || p !== (r[u].lineDashType || k.lineDashType)) && (b.stroke(), b.beginPath(), b.moveTo(S, ca), m = r[u].lineColor || w, b.strokeStyle = m, b.setLineDash && (r[u].lineDashType ? (p = r[u].lineDashType, b.setLineDash(G(p, k.lineThickness))) : (p = k.lineDashType,
b.setLineDash(d))));
if (0 < r[u].markerSize || 0 < k.markerSize) {
var A = k.getMarkerProperties(u, S, ca, b);
g.push(A);
q = R(q);
v && g.push({
x: S,
y: ca,
ctx: c,
type: A.type,
size: A.size,
color: q,
borderColor: q,
borderThickness: A.borderThickness
})
}(r[u].indexLabel || k.indexLabel || r[u].indexLabelFormatter || k.indexLabelFormatter) && this._indexLabels.push({
chartType: "line",
dataPoint: r[u],
dataSeries: k,
point: {
x: S,
y: ca
},
direction: 0 > r[u].y === a.axisY.reversed ? 1 : -1,
color: w
})
}
b.stroke();
v && c.stroke()
}
}
ja.drawMarkers(g);
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderStepLine = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
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 = [], h, l = 0; l < a.dataSeriesIndexes.length; l++) {
var t = a.dataSeriesIndexes[l],
k = this.data[t];
b.lineWidth = k.lineThickness;
var r = k.dataPoints,
p = "solid";
if (b.setLineDash) {
var n = G(k.nullDataLineDashType, k.lineThickness),
p = k.lineDashType,
d = G(p, k.lineThickness);
b.setLineDash(d)
}
var w = k.id;
this._eventManager.objectMap[w] = {
objectType: "dataSeries",
dataSeriesIndex: t
};
w = R(w);
c.strokeStyle = w;
c.lineWidth = 0 < k.lineThickness ? Math.max(k.lineThickness, 4) : 0;
var w = k._colorSet,
m = w = k.lineColor = k.options.lineColor ? k.options.lineColor : w[0];
b.strokeStyle = w;
var D = !0,
u = 0,
S, ca;
b.beginPath();
if (0 < r.length) {
for (var s = !1, u = 0; u < r.length; u++)
if (S = r[u].getTime ? r[u].x.getTime() : r[u].x, !(S < a.axisX.dataInfo.viewPortMin || S > a.axisX.dataInfo.viewPortMax &&
(!k.connectNullData || !s)))
if ("number" !== typeof r[u].y) 0 < u && !(k.connectNullData || s || D) && (b.stroke(), v && c.stroke()), s = !0;
else {
var q = ca;
S = a.axisX.convertValueToPixel(S);
ca = a.axisY.convertValueToPixel(r[u].y);
var A = k.dataPointIds[u];
this._eventManager.objectMap[A] = {
id: A,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: u,
x1: S,
y1: ca
};
D || s ? (!D && k.connectNullData ? (b.setLineDash && (k.options.nullDataLineDashType || p === k.lineDashType && k.lineDashType !== k.nullDataLineDashType) && (b.stroke(), b.beginPath(),
b.moveTo(h.x, h.y), p = k.nullDataLineDashType, b.setLineDash(n)), b.lineTo(S, q), b.lineTo(S, ca), v && (c.lineTo(S, q), c.lineTo(S, ca))) : (b.beginPath(), b.moveTo(S, ca), v && (c.beginPath(), c.moveTo(S, ca))), s = D = !1) : (b.lineTo(S, q), v && c.lineTo(S, q), b.lineTo(S, ca), v && c.lineTo(S, ca), 0 == u % 500 && (b.stroke(), b.beginPath(), b.moveTo(S, ca), v && (c.stroke(), c.beginPath(), c.moveTo(S, ca))));
h = {
x: S,
y: ca
};
u < r.length - 1 && (m !== (r[u].lineColor || w) || p !== (r[u].lineDashType || k.lineDashType)) && (b.stroke(), b.beginPath(), b.moveTo(S, ca), m = r[u].lineColor ||
w, b.strokeStyle = m, b.setLineDash && (r[u].lineDashType ? (p = r[u].lineDashType, b.setLineDash(G(p, k.lineThickness))) : (p = k.lineDashType, b.setLineDash(d))));
if (0 < r[u].markerSize || 0 < k.markerSize) q = k.getMarkerProperties(u, S, ca, b), g.push(q), A = R(A), v && g.push({
x: S,
y: ca,
ctx: c,
type: q.type,
size: q.size,
color: A,
borderColor: A,
borderThickness: q.borderThickness
});
(r[u].indexLabel || k.indexLabel || r[u].indexLabelFormatter || k.indexLabelFormatter) && this._indexLabels.push({
chartType: "stepLine",
dataPoint: r[u],
dataSeries: k,
point: {
x: S,
y: ca
},
direction: 0 > r[u].y === a.axisY.reversed ? 1 : -1,
color: w
})
}
b.stroke();
v && c.stroke()
}
}
ja.drawMarkers(g);
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderSpline = function (a) {
function f(a) {
a = x(a, 2);
if (0 < a.length) {
c.beginPath();
v && 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);
v && 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), v && 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), v && (e.stroke(), e.beginPath(), e.moveTo(a[b + 3].x, a[b + 3].y));
c.stroke();
v && e.stroke()
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = v ? 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 h = [], l = 0; l < a.dataSeriesIndexes.length; l++) {
var t = a.dataSeriesIndexes[l],
k = this.data[t];
c.lineWidth = k.lineThickness;
var r = k.dataPoints,
p = "solid";
if (c.setLineDash) {
var n = G(k.nullDataLineDashType, k.lineThickness),
p = k.lineDashType,
d = G(p, k.lineThickness);
c.setLineDash(d)
}
var w = k.id;
this._eventManager.objectMap[w] = {
objectType: "dataSeries",
dataSeriesIndex: t
};
w = R(w);
e.strokeStyle = w;
e.lineWidth = 0 < k.lineThickness ? Math.max(k.lineThickness, 4) : 0;
var w = k._colorSet,
m = w = k.lineColor = k.options.lineColor ? k.options.lineColor : w[0];
c.strokeStyle = w;
var D = 0,
u, S, q = [];
c.beginPath();
if (0 < r.length)
for (S = !1, D = 0; D < r.length; D++)
if (u = r[D].getTime ? r[D].x.getTime() : r[D].x, !(u < a.axisX.dataInfo.viewPortMin || u > a.axisX.dataInfo.viewPortMax && (!k.connectNullData || !S)))
if ("number" !== typeof r[D].y) 0 < D && !S && (k.connectNullData ? c.setLineDash && (0 < q.length && (k.options.nullDataLineDashType ||
!r[D - 1].lineDashType)) && (q[q.length - 1].newLineDashArray = n, p = k.nullDataLineDashType) : (f(q), q = [])), S = !0;
else {
u = a.axisX.convertValueToPixel(u);
S = a.axisY.convertValueToPixel(r[D].y);
var s = k.dataPointIds[D];
this._eventManager.objectMap[s] = {
id: s,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: D,
x1: u,
y1: S
};
q[q.length] = {
x: u,
y: S
};
D < r.length - 1 && (m !== (r[D].lineColor || w) || p !== (r[D].lineDashType || k.lineDashType)) && (m = r[D].lineColor || w, q[q.length - 1].newStrokeStyle = m, c.setLineDash && (r[D].lineDashType ? (p =
r[D].lineDashType, q[q.length - 1].newLineDashArray = G(p, k.lineThickness)) : (p = k.lineDashType, q[q.length - 1].newLineDashArray = d)));
if (0 < r[D].markerSize || 0 < k.markerSize) {
var y = k.getMarkerProperties(D, u, S, c);
h.push(y);
s = R(s);
v && h.push({
x: u,
y: S,
ctx: e,
type: y.type,
size: y.size,
color: s,
borderColor: s,
borderThickness: y.borderThickness
})
}(r[D].indexLabel || k.indexLabel || r[D].indexLabelFormatter || k.indexLabelFormatter) && this._indexLabels.push({
chartType: "spline",
dataPoint: r[D],
dataSeries: k,
point: {
x: u,
y: S
},
direction: 0 >
r[D].y === a.axisY.reversed ? 1 : -1,
color: w
});
S = !1
}
f(q)
}
ja.drawMarkers(h);
v && (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: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
var V = function (a, f, b, c, e, g, h, l, t, k, r, p, n) {
"undefined" === typeof n && (n = 1);
h = h || 0;
l = l || "black";
var d = 15 < c - f && 15 < e - b ? 8 : 0.35 * Math.min(c - f, e - b);
a.beginPath();
a.moveTo(f, b);
a.save();
a.fillStyle = g;
a.globalAlpha = n;
a.fillRect(f, b, c - f, e - b);
a.globalAlpha = 1;
0 < h && (n = 0 === h % 2 ? 0 : 0.5, a.beginPath(), a.lineWidth = h, a.strokeStyle = l, a.moveTo(f, b), a.rect(f - n, b - n, c - f + 2 * n, e - b + 2 * n), a.stroke());
a.restore();
!0 === t && (a.save(), a.beginPath(), a.moveTo(f, b), a.lineTo(f + d, b + d), a.lineTo(c - d, b + d), a.lineTo(c, b), a.closePath(), h = a.createLinearGradient((c + f) / 2, b + d, (c + f) / 2, b), h.addColorStop(0, g), h.addColorStop(1, "rgba(255, 255, 255, .4)"), a.fillStyle = h, a.fill(), a.restore());
!0 === k && (a.save(), a.beginPath(), a.moveTo(f, e), a.lineTo(f + d, e - d), a.lineTo(c - d, e - d), a.lineTo(c, e), a.closePath(), h = a.createLinearGradient((c + f) / 2, e - d, (c + f) / 2, e), h.addColorStop(0, g), h.addColorStop(1, "rgba(255, 255, 255, .4)"), a.fillStyle =
h, a.fill(), a.restore());
!0 === r && (a.save(), a.beginPath(), a.moveTo(f, b), a.lineTo(f + d, b + d), a.lineTo(f + d, e - d), a.lineTo(f, e), a.closePath(), h = a.createLinearGradient(f + d, (e + b) / 2, f, (e + b) / 2), h.addColorStop(0, g), h.addColorStop(1, "rgba(255, 255, 255, 0.1)"), a.fillStyle = h, a.fill(), a.restore());
!0 === p && (a.save(), a.beginPath(), a.moveTo(c, b), a.lineTo(c - d, b + d), a.lineTo(c - d, e - d), a.lineTo(c, e), h = a.createLinearGradient(c - d, (e + b) / 2, c, (e + b) / 2), h.addColorStop(0, g), h.addColorStop(1, "rgba(255, 255, 255, 0.1)"), a.fillStyle =
h, h.addColorStop(0, g), h.addColorStop(1, "rgba(255, 255, 255, 0.1)"), a.fillStyle = h, a.fill(), a.closePath(), a.restore())
};
q.prototype.renderColumn = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
h, l, t, k = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
g = this.dataPointMinWidth = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1,
r = this.dataPointMaxWidth =
this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : Math.min(0.15 * this.width, 0.9 * (this.plotArea.width / a.plotType.totalDataSeries)) << 0,
p = a.axisX.dataInfo.minDiff;
isFinite(p) || (p = 0.3 * Math.abs(a.axisX.range));
p = this.dataPointWidth = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.width * (a.axisX.logarithmic ? Math.log(p) / Math.log(a.axisX.range) : Math.abs(p) / Math.abs(a.axisX.range)) / a.plotType.totalDataSeries) << 0;
this.dataPointMaxWidth && g > r && (g = Math.min(this.dataPointWidth ?
this.dataPointWidth : Infinity, r));
!this.dataPointMaxWidth && (this.dataPointMinWidth && r < g) && (r = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, g));
p < g && (p = g);
p > r && (p = r);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (r = 0; r < a.dataSeriesIndexes.length; r++) {
var n = a.dataSeriesIndexes[r],
d = this.data[n],
w = d.dataPoints;
if (0 < w.length)
for (var m = 5 < p && d.bevelEnabled ? !0 : !1, g = 0; g < w.length; g++)
if (w[g].getTime ? t = w[g].x.getTime() : t = w[g].x, !(t < a.axisX.dataInfo.viewPortMin || t > a.axisX.dataInfo.viewPortMax) && "number" === typeof w[g].y) {
h = a.axisX.convertValueToPixel(t);
l = a.axisY.convertValueToPixel(w[g].y);
h = a.axisX.reversed ? h + a.plotType.totalDataSeries * p / 2 - (a.previousDataSeriesCount + r) * p << 0 : h - a.plotType.totalDataSeries * p / 2 + (a.previousDataSeriesCount + r) * p << 0;
var D = a.axisX.reversed ? h - p << 0 : h + p << 0,
u;
0 <= w[g].y ? u = k : (u =
l, l = k);
l > u && (c = l, l = u, u = c);
c = w[g].color ? w[g].color : d._colorSet[g % d._colorSet.length];
V(b, h, l, D, u, c, 0, null, m && 0 <= w[g].y, 0 > w[g].y && m, !1, !1, d.fillOpacity);
c = d.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: h,
y1: l,
x2: D,
y2: u
};
c = R(c);
v && V(this._eventManager.ghostCtx, h, l, D, u, c, 0, null, !1, !1, !1, !1);
(w[g].indexLabel || d.indexLabel || w[g].indexLabelFormatter || d.indexLabelFormatter) && this._indexLabels.push({
chartType: "column",
dataPoint: w[g],
dataSeries: d,
point: {
x: h + (D - h) / 2,
y: 0 > w[g].y === a.axisY.reversed ? l : u
},
direction: 0 > w[g].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: h,
y1: Math.min(l, u),
x2: D,
y2: Math.max(l, u)
},
color: c
})
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.yScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: k < a.axisY.bounds.y1 ? a.axisY.bounds.y1 : k > a.axisY.bounds.y2 ? a.axisY.bounds.y2 : k
}
}
};
q.prototype.renderStackedColumn = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
h = [],
l = [],
t = [],
k = 0,
r, p, n = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
k = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
r = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : 0.15 * this.width << 0;
var d = a.axisX.dataInfo.minDiff;
isFinite(d) || (d = 0.3 * Math.abs(a.axisX.range));
d = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.width * (a.axisX.logarithmic ? Math.log(d) / Math.log(a.axisX.range) : Math.abs(d) /
Math.abs(a.axisX.range)) / a.plotType.plotUnits.length) << 0;
this.dataPointMaxWidth && k > r && (k = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, r));
!this.dataPointMaxWidth && (this.dataPointMinWidth && r < k) && (r = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, k));
d < k && (d = k);
d > r && (d = r);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var w = 0; w < a.dataSeriesIndexes.length; w++) {
var m = a.dataSeriesIndexes[w],
D = this.data[m],
u = D.dataPoints;
if (0 < u.length) {
var q = 5 < d && D.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (k = 0; k < u.length; k++)
if (c = u[k].x.getTime ? u[k].x.getTime() : u[k].x, !(c < a.axisX.dataInfo.viewPortMin || c > a.axisX.dataInfo.viewPortMax) && "number" === typeof u[k].y) {
r = a.axisX.convertValueToPixel(c);
var s = r - a.plotType.plotUnits.length * d / 2 + a.index * d << 0,
y = s + d << 0,
B;
if (a.axisY.logarithmic || a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 < u[k].y) l[c] = u[k].y + (l[c] ? l[c] : 0), 0 < l[c] && (p = a.axisY.convertValueToPixel(l[c]), B = "undefined" !== typeof g[c] ? g[c] : n, g[c] = p);
else if (a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 >= u[k].y) t[c] = u[k].y + (t[c] ? t[c] : 0), B = a.axisY.convertValueToPixel(t[c]), p = "undefined" !== typeof h[c] ? h[c] : n, h[c] = B;
else if (p = a.axisY.convertValueToPixel(u[k].y), 0 <= u[k].y) {
var A = "undefined" !== typeof g[c] ? g[c] : 0;
p -= A;
B = n - A;
g[c] = A + (B - p)
} else A = h[c] ? h[c] : 0, B = p + A,
p = n + A, h[c] = A + (B - p);
c = u[k].color ? u[k].color : D._colorSet[k % D._colorSet.length];
V(b, s, p, y, B, c, 0, null, q && 0 <= u[k].y, 0 > u[k].y && q, !1, !1, D.fillOpacity);
c = D.dataPointIds[k];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: m,
dataPointIndex: k,
x1: s,
y1: p,
x2: y,
y2: B
};
c = R(c);
v && V(this._eventManager.ghostCtx, s, p, y, B, c, 0, null, !1, !1, !1, !1);
(u[k].indexLabel || D.indexLabel || u[k].indexLabelFormatter || D.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedColumn",
dataPoint: u[k],
dataSeries: D,
point: {
x: r,
y: 0 <= u[k].y ? p : B
},
direction: 0 > u[k].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: s,
y1: Math.min(p, B),
x2: y,
y2: Math.max(p, B)
},
color: c
})
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.yScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: n < a.axisY.bounds.y1 ? a.axisY.bounds.y1 : n > a.axisY.bounds.y2 ? a.axisY.bounds.y2 : n
}
}
};
q.prototype.renderStackedColumn100 = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
h = [],
l = [],
t = [],
k = 0,
r, p, n = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
k = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
r = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : 0.15 * this.width << 0;
var d = a.axisX.dataInfo.minDiff;
isFinite(d) || (d = 0.3 * Math.abs(a.axisX.range));
d = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.width * (a.axisX.logarithmic ? Math.log(d) / Math.log(a.axisX.range) : Math.abs(d) / Math.abs(a.axisX.range)) /
a.plotType.plotUnits.length) << 0;
this.dataPointMaxWidth && k > r && (k = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, r));
!this.dataPointMaxWidth && (this.dataPointMinWidth && r < k) && (r = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, k));
d < k && (d = k);
d > r && (d = r);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (var w = 0; w < a.dataSeriesIndexes.length; w++) {
var m = a.dataSeriesIndexes[w],
D = this.data[m],
u = D.dataPoints;
if (0 < u.length)
for (var q = 5 < d && D.bevelEnabled ? !0 : !1, k = 0; k < u.length; k++)
if (c = u[k].x.getTime ? u[k].x.getTime() : u[k].x, !(c < a.axisX.dataInfo.viewPortMin || c > a.axisX.dataInfo.viewPortMax) && "number" === typeof u[k].y) {
r = a.axisX.convertValueToPixel(c);
p = 0 !== a.dataPointYSums[c] ? 100 * (u[k].y / a.dataPointYSums[c]) : 0;
var s = r - a.plotType.plotUnits.length * d / 2 + a.index * d << 0,
y = s + d << 0,
B;
if (a.axisY.logarithmic || a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 < u[k].y) {
l[c] = p + ("undefined" !== typeof l[c] ? l[c] : 0);
if (0 >= l[c]) continue;
p = a.axisY.convertValueToPixel(l[c]);
B = g[c] ? g[c] : n;
g[c] = p
} else if (a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 >= u[k].y) t[c] = p + ("undefined" !== typeof t[c] ? t[c] : 0), B = a.axisY.convertValueToPixel(t[c]), p = h[c] ? h[c] : n, h[c] = B;
else if (p = a.axisY.convertValueToPixel(p), 0 <= u[k].y) {
var A = "undefined" !== typeof g[c] ? g[c] : 0;
p -= A;
B = n - A;
g[c] = A + (B - p)
} else A = "undefined" !== typeof h[c] ?
h[c] : 0, B = p + A, p = n + A, h[c] = A + (B - p);
c = u[k].color ? u[k].color : D._colorSet[k % D._colorSet.length];
V(b, s, p, y, B, c, 0, null, q && 0 <= u[k].y, 0 > u[k].y && q, !1, !1, D.fillOpacity);
c = D.dataPointIds[k];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: m,
dataPointIndex: k,
x1: s,
y1: p,
x2: y,
y2: B
};
c = R(c);
v && V(this._eventManager.ghostCtx, s, p, y, B, c, 0, null, !1, !1, !1, !1);
(u[k].indexLabel || D.indexLabel || u[k].indexLabelFormatter || D.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedColumn100",
dataPoint: u[k],
dataSeries: D,
point: {
x: r,
y: 0 <= u[k].y ? p : B
},
direction: 0 > u[k].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: s,
y1: Math.min(p, B),
x2: y,
y2: Math.max(p, B)
},
color: c
})
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.yScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: n < a.axisY.bounds.y1 ? a.axisY.bounds.y1 : n > a.axisY.bounds.y2 ? a.axisY.bounds.y2 : n
}
}
};
q.prototype.renderBar = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
h, l, t, k = a.axisY.convertValueToPixel(a.axisY.logarithmic ?
a.axisY.viewportMinimum : 0),
g = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1,
r = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : Math.min(0.15 * this.height, 0.9 * (this.plotArea.height / a.plotType.totalDataSeries)) << 0,
p = a.axisX.dataInfo.minDiff;
isFinite(p) || (p = 0.3 * Math.abs(a.axisX.range));
p = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.height * (a.axisX.logarithmic ? Math.log(p) / Math.log(a.axisX.range) : Math.abs(p) / Math.abs(a.axisX.range)) /
a.plotType.totalDataSeries) << 0;
this.dataPointMaxWidth && g > r && (g = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, r));
!this.dataPointMaxWidth && (this.dataPointMinWidth && r < g) && (r = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, g));
p < g && (p = g);
p > r && (p = r);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (r = 0; r < a.dataSeriesIndexes.length; r++) {
var n = a.dataSeriesIndexes[r],
d = this.data[n],
w = d.dataPoints;
if (0 < w.length) {
var m = 5 < p && d.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (g = 0; g < w.length; g++)
if (w[g].getTime ? t = w[g].x.getTime() : t = w[g].x, !(t < a.axisX.dataInfo.viewPortMin || t > a.axisX.dataInfo.viewPortMax) && "number" === typeof w[g].y) {
l = a.axisX.convertValueToPixel(t);
h = a.axisY.convertValueToPixel(w[g].y);
l = a.axisX.reversed ? l + a.plotType.totalDataSeries * p / 2 - (a.previousDataSeriesCount + r) * p << 0 : l - a.plotType.totalDataSeries *
p / 2 + (a.previousDataSeriesCount + r) * p << 0;
var D = a.axisX.reversed ? l - p << 0 : l + p << 0,
u;
0 <= w[g].y ? u = k : (u = h, h = k);
c = w[g].color ? w[g].color : d._colorSet[g % d._colorSet.length];
V(b, u, l, h, D, c, 0, null, m, !1, !1, !1, d.fillOpacity);
c = d.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: u,
y1: l,
x2: h,
y2: D
};
c = R(c);
v && V(this._eventManager.ghostCtx, u, l, h, D, c, 0, null, !1, !1, !1, !1);
(w[g].indexLabel || d.indexLabel || w[g].indexLabelFormatter || d.indexLabelFormatter) && this._indexLabels.push({
chartType: "bar",
dataPoint: w[g],
dataSeries: d,
point: {
x: 0 <= w[g].y ? h : u,
y: l + (D - l) / 2
},
direction: 0 > w[g].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(u, h),
y1: l,
x2: Math.max(u, h),
y2: D
},
color: c
})
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.xScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: k < a.axisY.bounds.x1 ? a.axisY.bounds.x1 : k > a.axisY.bounds.x2 ? a.axisY.bounds.x2 : k
}
}
};
q.prototype.renderStackedBar = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
h = [],
l = [],
t = [],
k = 0,
r, p, n = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
k = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
p = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : 0.15 * this.height << 0;
var d = a.axisX.dataInfo.minDiff;
isFinite(d) || (d = 0.3 * Math.abs(a.axisX.range));
d = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.height * (a.axisX.logarithmic ? Math.log(d) / Math.log(a.axisX.range) : Math.abs(d) /
Math.abs(a.axisX.range)) / a.plotType.plotUnits.length) << 0;
this.dataPointMaxWidth && k > p && (k = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, p));
!this.dataPointMaxWidth && (this.dataPointMinWidth && p < k) && (p = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, k));
d < k && (d = k);
d > p && (d = p);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height),
this._eventManager.ghostCtx.clip());
for (var w = 0; w < a.dataSeriesIndexes.length; w++) {
var m = a.dataSeriesIndexes[w],
D = this.data[m],
u = D.dataPoints;
if (0 < u.length) {
var q = 5 < d && D.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (k = 0; k < u.length; k++)
if (c = u[k].x.getTime ? u[k].x.getTime() : u[k].x, !(c < a.axisX.dataInfo.viewPortMin || c > a.axisX.dataInfo.viewPortMax) && "number" === typeof u[k].y) {
p = a.axisX.convertValueToPixel(c);
var s = p - a.plotType.plotUnits.length * d / 2 + a.index * d << 0,
y = s + d << 0,
B;
if (a.axisY.logarithmic || a.axisY.scaleBreaks &&
0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 < u[k].y) l[c] = u[k].y + (l[c] ? l[c] : 0), 0 < l[c] && (B = g[c] ? g[c] : n, g[c] = r = a.axisY.convertValueToPixel(l[c]));
else if (a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 >= u[k].y) t[c] = u[k].y + (t[c] ? t[c] : 0), r = h[c] ? h[c] : n, h[c] = B = a.axisY.convertValueToPixel(t[c]);
else if (r = a.axisY.convertValueToPixel(u[k].y), 0 <= u[k].y) {
var A = g[c] ? g[c] : 0;
B = n + A;
r += A;
g[c] = A + (r - B)
} else A = h[c] ? h[c] : 0, B = r - A, r = n - A, h[c] = A + (r - B);
c = u[k].color ? u[k].color : D._colorSet[k % D._colorSet.length];
V(b, B, s, r, y, c, 0, null, q, !1, !1, !1, D.fillOpacity);
c = D.dataPointIds[k];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: m,
dataPointIndex: k,
x1: B,
y1: s,
x2: r,
y2: y
};
c = R(c);
v && V(this._eventManager.ghostCtx, B, s, r, y, c, 0, null, !1, !1, !1, !1);
(u[k].indexLabel || D.indexLabel || u[k].indexLabelFormatter || D.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedBar",
dataPoint: u[k],
dataSeries: D,
point: {
x: 0 <= u[k].y ? r : B,
y: p
},
direction: 0 > u[k].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(B,
r),
y1: s,
x2: Math.max(B, r),
y2: y
},
color: c
})
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.xScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: n < a.axisY.bounds.x1 ? a.axisY.bounds.x1 : n > a.axisY.bounds.x2 ? a.axisY.bounds.x2 : n
}
}
};
q.prototype.renderStackedBar100 = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = [],
h = [],
l = [],
t = [],
k = 0,
r, p, n = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
k = this.dataPointMinWidth ?
this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
p = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : 0.15 * this.height << 0;
var d = a.axisX.dataInfo.minDiff;
isFinite(d) || (d = 0.3 * Math.abs(a.axisX.range));
d = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.height * (a.axisX.logarithmic ? Math.log(d) / Math.log(a.axisX.range) : Math.abs(d) / Math.abs(a.axisX.range)) / a.plotType.plotUnits.length) << 0;
this.dataPointMaxWidth && k > p && (k = Math.min(this.dataPointWidth ? this.dataPointWidth :
Infinity, p));
!this.dataPointMaxWidth && (this.dataPointMinWidth && p < k) && (p = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, k));
d < k && (d = k);
d > p && (d = p);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (var w = 0; w < a.dataSeriesIndexes.length; w++) {
var m = a.dataSeriesIndexes[w],
D = this.data[m],
u = D.dataPoints;
if (0 < u.length) {
var q = 5 < d && D.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (k = 0; k < u.length; k++)
if (c = u[k].x.getTime ? u[k].x.getTime() : u[k].x, !(c < a.axisX.dataInfo.viewPortMin || c > a.axisX.dataInfo.viewPortMax) && "number" === typeof u[k].y) {
p = a.axisX.convertValueToPixel(c);
var s;
s = 0 !== a.dataPointYSums[c] ? 100 * (u[k].y / a.dataPointYSums[c]) : 0;
var y = p - a.plotType.plotUnits.length * d / 2 + a.index * d << 0,
B = y + d << 0;
if (a.axisY.logarithmic || a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 < u[k].y) {
l[c] = s +
(l[c] ? l[c] : 0);
if (0 >= l[c]) continue;
s = g[c] ? g[c] : n;
g[c] = r = a.axisY.convertValueToPixel(l[c])
} else if (a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length && 0 >= u[k].y) t[c] = s + (t[c] ? t[c] : 0), r = h[c] ? h[c] : n, h[c] = s = a.axisY.convertValueToPixel(t[c]);
else if (r = a.axisY.convertValueToPixel(s), 0 <= u[k].y) {
var A = g[c] ? g[c] : 0;
s = n + A;
r += A;
g[c] = A + (r - s)
} else A = h[c] ? h[c] : 0, s = r - A, r = n - A, h[c] = A + (r - s);
c = u[k].color ? u[k].color : D._colorSet[k % D._colorSet.length];
V(b, s, y, r, B, c, 0, null, q, !1, !1, !1, D.fillOpacity);
c = D.dataPointIds[k];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: m,
dataPointIndex: k,
x1: s,
y1: y,
x2: r,
y2: B
};
c = R(c);
v && V(this._eventManager.ghostCtx, s, y, r, B, c, 0, null, !1, !1, !1, !1);
(u[k].indexLabel || D.indexLabel || u[k].indexLabelFormatter || D.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedBar100",
dataPoint: u[k],
dataSeries: D,
point: {
x: 0 <= u[k].y ? r : s,
y: p
},
direction: 0 > u[k].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: Math.min(s, r),
y1: y,
x2: Math.max(s, r),
y2: B
},
color: c
})
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.xScaleAnimation,
easingFunction: H.easing.easeOutQuart,
animationBase: n < a.axisY.bounds.x1 ? a.axisY.bounds.x1 : n > a.axisY.bounds.x2 ? a.axisY.bounds.x2 : n
}
}
};
q.prototype.renderArea = function (a) {
var f, b;
function c() {
A && (0 < w.lineThickness && g.stroke(), a.axisY.logarithmic || 0 >= a.axisY.viewportMinimum && 0 <= a.axisY.viewportMaximum ? B = y : 0 > a.axisY.viewportMaximum ? B = t.y1 : 0 < a.axisY.viewportMinimum && (B = l.y2), g.lineTo(u, B), g.lineTo(A.x, B), g.closePath(), g.globalAlpha = w.fillOpacity, g.fill(), g.globalAlpha = 1, v && (h.lineTo(u, B), h.lineTo(A.x, B), h.closePath(), h.fill()), g.beginPath(),
g.moveTo(u, s), h.beginPath(), h.moveTo(u, s), A = {
x: u,
y: s
})
}
var e = a.targetCanvasCtx || this.plotArea.ctx,
g = v ? this._preRenderCtx : e;
if (!(0 >= a.dataSeriesIndexes.length)) {
var h = this._eventManager.ghostCtx,
l = a.axisX.lineCoordinates,
t = a.axisY.lineCoordinates,
k = [],
r = this.plotArea,
p;
g.save();
v && h.save();
g.beginPath();
g.rect(r.x1, r.y1, r.width, r.height);
g.clip();
v && (h.beginPath(), h.rect(r.x1, r.y1, r.width, r.height), h.clip());
for (var n = 0; n < a.dataSeriesIndexes.length; n++) {
var d = a.dataSeriesIndexes[n],
w = this.data[d],
m = w.dataPoints,
k = w.id;
this._eventManager.objectMap[k] = {
objectType: "dataSeries",
dataSeriesIndex: d
};
k = R(k);
h.fillStyle = k;
k = [];
f = !0;
var D = 0,
u, s, q, y = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
B, A = null;
if (0 < m.length) {
var x = w._colorSet[D % w._colorSet.length],
z = w.lineColor = w.options.lineColor || x,
J = z;
g.fillStyle = x;
g.strokeStyle = z;
g.lineWidth = w.lineThickness;
b = "solid";
if (g.setLineDash) {
var I = G(w.nullDataLineDashType, w.lineThickness);
b = w.lineDashType;
var da = G(b, w.lineThickness);
g.setLineDash(da)
}
for (var ea = !0; D < m.length; D++)
if (q = m[D].x.getTime ? m[D].x.getTime() : m[D].x, !(q < a.axisX.dataInfo.viewPortMin || q > a.axisX.dataInfo.viewPortMax && (!w.connectNullData || !ea)))
if ("number" !== typeof m[D].y) w.connectNullData || (ea || f) || c(), ea = !0;
else {
u = a.axisX.convertValueToPixel(q);
s = a.axisY.convertValueToPixel(m[D].y);
f || ea ? (!f && w.connectNullData ? (g.setLineDash && (w.options.nullDataLineDashType || b === w.lineDashType && w.lineDashType !== w.nullDataLineDashType) && (f = u, b = s, u = p.x, s = p.y, c(), g.moveTo(p.x,
p.y), u = f, s = b, A = p, b = w.nullDataLineDashType, g.setLineDash(I)), g.lineTo(u, s), v && h.lineTo(u, s)) : (g.beginPath(), g.moveTo(u, s), v && (h.beginPath(), h.moveTo(u, s)), A = {
x: u,
y: s
}), ea = f = !1) : (g.lineTo(u, s), v && h.lineTo(u, s), 0 == D % 250 && c());
p = {
x: u,
y: s
};
D < m.length - 1 && (J !== (m[D].lineColor || z) || b !== (m[D].lineDashType || w.lineDashType)) && (c(), J = m[D].lineColor || z, g.strokeStyle = J, g.setLineDash && (m[D].lineDashType ? (b = m[D].lineDashType, g.setLineDash(G(b, w.lineThickness))) : (b = w.lineDashType, g.setLineDash(da))));
var $ = w.dataPointIds[D];
this._eventManager.objectMap[$] = {
id: $,
objectType: "dataPoint",
dataSeriesIndex: d,
dataPointIndex: D,
x1: u,
y1: s
};
0 !== m[D].markerSize && (0 < m[D].markerSize || 0 < w.markerSize) && (q = w.getMarkerProperties(D, u, s, g), k.push(q), $ = R($), v && k.push({
x: u,
y: s,
ctx: h,
type: q.type,
size: q.size,
color: $,
borderColor: $,
borderThickness: q.borderThickness
}));
(m[D].indexLabel || w.indexLabel || m[D].indexLabelFormatter || w.indexLabelFormatter) && this._indexLabels.push({
chartType: "area",
dataPoint: m[D],
dataSeries: w,
point: {
x: u,
y: s
},
direction: 0 >
m[D].y === a.axisY.reversed ? 1 : -1,
color: x
})
}
c();
ja.drawMarkers(k)
}
}
v && (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(r.x1, r.y1, r.width, r.height), this._eventManager.ghostCtx.restore());
g.restore();
return {
source: e,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderSplineArea = function (a) {
function f() {
var b = x(q, 2);
if (0 < b.length) {
if (0 < p.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), v &&
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);
v && (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), v && 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 ? u = D : 0 > a.axisY.viewportMaximum ? u = h.y1 : 0 < a.axisY.viewportMinimum && (u = g.y2);
s = {
x: b[0].x,
y: b[0].y
};
c.lineTo(b[b.length - 1].x, u);
c.lineTo(s.x, u);
c.closePath();
c.globalAlpha = p.fillOpacity;
c.fill();
c.globalAlpha = 1;
v && (e.lineTo(b[b.length - 1].x, u), e.lineTo(s.x, u), e.closePath(), e.fill())
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = v ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e =
this._eventManager.ghostCtx,
g = a.axisX.lineCoordinates,
h = a.axisY.lineCoordinates,
l = [],
t = this.plotArea;
c.save();
v && e.save();
c.beginPath();
c.rect(t.x1, t.y1, t.width, t.height);
c.clip();
v && (e.beginPath(), e.rect(t.x1, t.y1, t.width, t.height), e.clip());
for (var k = 0; k < a.dataSeriesIndexes.length; k++) {
var r = a.dataSeriesIndexes[k],
p = this.data[r],
n = p.dataPoints,
l = p.id;
this._eventManager.objectMap[l] = {
objectType: "dataSeries",
dataSeriesIndex: r
};
l = R(l);
e.fillStyle = l;
var l = [],
d = 0,
w, m, D = a.axisY.convertValueToPixel(a.axisY.logarithmic ?
a.axisY.viewportMinimum : 0),
u, s = null,
q = [];
if (0 < n.length) {
var y = p._colorSet[d % p._colorSet.length],
B = p.lineColor = p.options.lineColor || y,
A = B;
c.fillStyle = y;
c.strokeStyle = B;
c.lineWidth = p.lineThickness;
var z = "solid";
if (c.setLineDash) {
var L = G(p.nullDataLineDashType, p.lineThickness),
z = p.lineDashType,
J = G(z, p.lineThickness);
c.setLineDash(J)
}
for (m = !1; d < n.length; d++)
if (w = n[d].x.getTime ? n[d].x.getTime() : n[d].x, !(w < a.axisX.dataInfo.viewPortMin || w > a.axisX.dataInfo.viewPortMax && (!p.connectNullData || !m)))
if ("number" !==
typeof n[d].y) 0 < d && !m && (p.connectNullData ? c.setLineDash && (0 < q.length && (p.options.nullDataLineDashType || !n[d - 1].lineDashType)) && (q[q.length - 1].newLineDashArray = L, z = p.nullDataLineDashType) : (f(), q = [])), m = !0;
else {
w = a.axisX.convertValueToPixel(w);
m = a.axisY.convertValueToPixel(n[d].y);
var I = p.dataPointIds[d];
this._eventManager.objectMap[I] = {
id: I,
objectType: "dataPoint",
dataSeriesIndex: r,
dataPointIndex: d,
x1: w,
y1: m
};
q[q.length] = {
x: w,
y: m
};
d < n.length - 1 && (A !== (n[d].lineColor || B) || z !== (n[d].lineDashType || p.lineDashType)) &&
(A = n[d].lineColor || B, q[q.length - 1].newStrokeStyle = A, c.setLineDash && (n[d].lineDashType ? (z = n[d].lineDashType, q[q.length - 1].newLineDashArray = G(z, p.lineThickness)) : (z = p.lineDashType, q[q.length - 1].newLineDashArray = J)));
if (0 !== n[d].markerSize && (0 < n[d].markerSize || 0 < p.markerSize)) {
var da = p.getMarkerProperties(d, w, m, c);
l.push(da);
I = R(I);
v && l.push({
x: w,
y: m,
ctx: e,
type: da.type,
size: da.size,
color: I,
borderColor: I,
borderThickness: da.borderThickness
})
}(n[d].indexLabel || p.indexLabel || n[d].indexLabelFormatter || p.indexLabelFormatter) &&
this._indexLabels.push({
chartType: "splineArea",
dataPoint: n[d],
dataSeries: p,
point: {
x: w,
y: m
},
direction: 0 > n[d].y === a.axisY.reversed ? 1 : -1,
color: y
});
m = !1
}
f();
ja.drawMarkers(l)
}
}
v && (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(t.x1, t.y1, t.width, t.height), this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderStepArea = function (a) {
var f, b;
function c() {
A && (0 < w.lineThickness && g.stroke(), a.axisY.logarithmic || 0 >= a.axisY.viewportMinimum && 0 <= a.axisY.viewportMaximum ? B = y : 0 > a.axisY.viewportMaximum ? B = t.y1 : 0 < a.axisY.viewportMinimum && (B = l.y2), g.lineTo(u, B), g.lineTo(A.x,
B), g.closePath(), g.globalAlpha = w.fillOpacity, g.fill(), g.globalAlpha = 1, v && (h.lineTo(u, B), h.lineTo(A.x, B), h.closePath(), h.fill()), g.beginPath(), g.moveTo(u, s), h.beginPath(), h.moveTo(u, s), A = {
x: u,
y: s
})
}
var e = a.targetCanvasCtx || this.plotArea.ctx,
g = v ? this._preRenderCtx : e;
if (!(0 >= a.dataSeriesIndexes.length)) {
var h = this._eventManager.ghostCtx,
l = a.axisX.lineCoordinates,
t = a.axisY.lineCoordinates,
k = [],
r = this.plotArea,
p;
g.save();
v && h.save();
g.beginPath();
g.rect(r.x1, r.y1, r.width, r.height);
g.clip();
v && (h.beginPath(),
h.rect(r.x1, r.y1, r.width, r.height), h.clip());
for (var n = 0; n < a.dataSeriesIndexes.length; n++) {
var d = a.dataSeriesIndexes[n],
w = this.data[d],
m = w.dataPoints,
k = w.id;
this._eventManager.objectMap[k] = {
objectType: "dataSeries",
dataSeriesIndex: d
};
k = R(k);
h.fillStyle = k;
k = [];
f = !0;
var D = 0,
u, s, q, y = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
B, A = null;
b = !1;
if (0 < m.length) {
var x = w._colorSet[D % w._colorSet.length],
z = w.lineColor = w.options.lineColor || x,
J = z;
g.fillStyle = x;
g.strokeStyle = z;
g.lineWidth =
w.lineThickness;
var I = "solid";
if (g.setLineDash) {
var da = G(w.nullDataLineDashType, w.lineThickness),
I = w.lineDashType,
ea = G(I, w.lineThickness);
g.setLineDash(ea)
}
for (; D < m.length; D++)
if (q = m[D].x.getTime ? m[D].x.getTime() : m[D].x, !(q < a.axisX.dataInfo.viewPortMin || q > a.axisX.dataInfo.viewPortMax && (!w.connectNullData || !b))) {
var $ = s;
"number" !== typeof m[D].y ? (w.connectNullData || (b || f) || c(), b = !0) : (u = a.axisX.convertValueToPixel(q), s = a.axisY.convertValueToPixel(m[D].y), f || b ? (!f && w.connectNullData ? (g.setLineDash && (w.options.nullDataLineDashType ||
I === w.lineDashType && w.lineDashType !== w.nullDataLineDashType) && (f = u, b = s, u = p.x, s = p.y, c(), g.moveTo(p.x, p.y), u = f, s = b, A = p, I = w.nullDataLineDashType, g.setLineDash(da)), g.lineTo(u, $), g.lineTo(u, s), v && (h.lineTo(u, $), h.lineTo(u, s))) : (g.beginPath(), g.moveTo(u, s), v && (h.beginPath(), h.moveTo(u, s)), A = {
x: u,
y: s
}), b = f = !1) : (g.lineTo(u, $), v && h.lineTo(u, $), g.lineTo(u, s), v && h.lineTo(u, s), 0 == D % 250 && c()), p = {
x: u,
y: s
}, D < m.length - 1 && (J !== (m[D].lineColor || z) || I !== (m[D].lineDashType || w.lineDashType)) && (c(), J = m[D].lineColor ||
z, g.strokeStyle = J, g.setLineDash && (m[D].lineDashType ? (I = m[D].lineDashType, g.setLineDash(G(I, w.lineThickness))) : (I = w.lineDashType, g.setLineDash(ea)))), q = w.dataPointIds[D], this._eventManager.objectMap[q] = {
id: q,
objectType: "dataPoint",
dataSeriesIndex: d,
dataPointIndex: D,
x1: u,
y1: s
}, 0 !== m[D].markerSize && (0 < m[D].markerSize || 0 < w.markerSize) && ($ = w.getMarkerProperties(D, u, s, g), k.push($), q = R(q), v && k.push({
x: u,
y: s,
ctx: h,
type: $.type,
size: $.size,
color: q,
borderColor: q,
borderThickness: $.borderThickness
})), (m[D].indexLabel ||
w.indexLabel || m[D].indexLabelFormatter || w.indexLabelFormatter) && this._indexLabels.push({
chartType: "stepArea",
dataPoint: m[D],
dataSeries: w,
point: {
x: u,
y: s
},
direction: 0 > m[D].y === a.axisY.reversed ? 1 : -1,
color: x
}))
}
c();
ja.drawMarkers(k)
}
}
v && (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(r.x1, r.y1, r.width, r.height), this._eventManager.ghostCtx.restore());
g.restore();
return {
source: e,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderStackedArea = function (a) {
function f() {
if (!(1 > t.length)) {
for (0 < A.lineThickness && c.stroke(); 0 < t.length;) {
var a = t.pop();
c.lineTo(a.x, a.y);
v && s.lineTo(a.x, a.y)
}
c.closePath();
c.globalAlpha = A.fillOpacity;
c.fill();
c.globalAlpha = 1;
c.beginPath();
v && (s.closePath(), s.fill(), s.beginPath());
t = []
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = v ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = [],
h = this.plotArea,
l = [],
t = [],
k = [],
r = [],
p = 0,
n, d, w, m = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
s = this._eventManager.ghostCtx,
u, q, y;
v && s.beginPath();
c.save();
v && s.save();
c.beginPath();
c.rect(h.x1, h.y1, h.width, h.height);
c.clip();
v && (s.beginPath(), s.rect(h.x1, h.y1, h.width,
h.height), s.clip());
for (var e = [], x = 0; x < a.dataSeriesIndexes.length; x++) {
var B = a.dataSeriesIndexes[x],
A = this.data[B],
z = A.dataPoints;
A.dataPointIndexes = [];
for (p = 0; p < z.length; p++) B = z[p].x.getTime ? z[p].x.getTime() : z[p].x, A.dataPointIndexes[B] = p, e[B] || (k.push(B), e[B] = !0);
k.sort(Pa)
}
for (x = 0; x < a.dataSeriesIndexes.length; x++) {
B = a.dataSeriesIndexes[x];
A = this.data[B];
z = A.dataPoints;
q = !0;
t = [];
p = A.id;
this._eventManager.objectMap[p] = {
objectType: "dataSeries",
dataSeriesIndex: B
};
p = R(p);
s.fillStyle = p;
if (0 < k.length) {
var e =
A._colorSet[0],
L = A.lineColor = A.options.lineColor || e,
J = L;
c.fillStyle = e;
c.strokeStyle = L;
c.lineWidth = A.lineThickness;
y = "solid";
if (c.setLineDash) {
var I = G(A.nullDataLineDashType, A.lineThickness);
y = A.lineDashType;
var da = G(y, A.lineThickness);
c.setLineDash(da)
}
for (var ea = !0, p = 0; p < k.length; p++) {
w = k[p];
var $ = null,
$ = 0 <= A.dataPointIndexes[w] ? z[A.dataPointIndexes[w]] : {
x: w,
y: null
};
if (!(w < a.axisX.dataInfo.viewPortMin || w > a.axisX.dataInfo.viewPortMax && (!A.connectNullData || !ea)))
if ("number" !== typeof $.y) A.connectNullData ||
(ea || q) || f(), ea = !0;
else {
n = a.axisX.convertValueToPixel(w);
var xa = l[w] ? l[w] : 0;
if (a.axisY.logarithmic || a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length) {
r[w] = $.y + (r[w] ? r[w] : 0);
if (0 >= r[w] && a.axisY.logarithmic) continue;
d = a.axisY.convertValueToPixel(r[w])
} else d = a.axisY.convertValueToPixel($.y), d -= xa;
t.push({
x: n,
y: m - xa
});
l[w] = m - d;
q || ea ? (!q && A.connectNullData ? (c.setLineDash && (A.options.nullDataLineDashType || y === A.lineDashType && A.lineDashType !== A.nullDataLineDashType) && (q = t.pop(), y = t[t.length -
1], f(), c.moveTo(u.x, u.y), t.push(y), t.push(q), y = A.nullDataLineDashType, c.setLineDash(I)), c.lineTo(n, d), v && s.lineTo(n, d)) : (c.beginPath(), c.moveTo(n, d), v && (s.beginPath(), s.moveTo(n, d))), ea = q = !1) : (c.lineTo(n, d), v && s.lineTo(n, d), 0 == p % 250 && (f(), c.moveTo(n, d), v && s.moveTo(n, d), t.push({
x: n,
y: m - xa
})));
u = {
x: n,
y: d
};
p < z.length - 1 && (J !== (z[p].lineColor || L) || y !== (z[p].lineDashType || A.lineDashType)) && (f(), c.beginPath(), c.moveTo(n, d), t.push({
x: n,
y: m - xa
}), J = z[p].lineColor || L, c.strokeStyle = J, c.setLineDash && (z[p].lineDashType ?
(y = z[p].lineDashType, c.setLineDash(G(y, A.lineThickness))) : (y = A.lineDashType, c.setLineDash(da))));
if (0 <= A.dataPointIndexes[w]) {
var oa = A.dataPointIds[A.dataPointIndexes[w]];
this._eventManager.objectMap[oa] = {
id: oa,
objectType: "dataPoint",
dataSeriesIndex: B,
dataPointIndex: A.dataPointIndexes[w],
x1: n,
y1: d
}
}
0 <= A.dataPointIndexes[w] && 0 !== $.markerSize && (0 < $.markerSize || 0 < A.markerSize) && (w = A.getMarkerProperties(A.dataPointIndexes[w], n, d, c), g.push(w), markerColor = R(oa), v && g.push({
x: n,
y: d,
ctx: s,
type: w.type,
size: w.size,
color: markerColor,
borderColor: markerColor,
borderThickness: w.borderThickness
}));
($.indexLabel || A.indexLabel || $.indexLabelFormatter || A.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedArea",
dataPoint: $,
dataSeries: A,
point: {
x: n,
y: d
},
direction: 0 > z[p].y === a.axisY.reversed ? 1 : -1,
color: e
})
}
}
f();
c.moveTo(n, d);
v && s.moveTo(n, d)
}
delete A.dataPointIndexes
}
ja.drawMarkers(g);
v && (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(h.x1, h.y1, h.width, h.height), s.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderStackedArea100 = function (a) {
function f() {
for (0 < A.lineThickness &&
c.stroke(); 0 < t.length;) {
var a = t.pop();
c.lineTo(a.x, a.y);
v && y.lineTo(a.x, a.y)
}
c.closePath();
c.globalAlpha = A.fillOpacity;
c.fill();
c.globalAlpha = 1;
c.beginPath();
v && (y.closePath(), y.fill(), y.beginPath());
t = []
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = v ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = this.plotArea,
h = [],
l = [],
t = [],
k = [],
r = [],
p = 0,
n, d, w, m, s, u, q = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
y = this._eventManager.ghostCtx;
c.save();
v && y.save();
c.beginPath();
c.rect(g.x1, g.y1, g.width, g.height);
c.clip();
v && (y.beginPath(), y.rect(g.x1, g.y1, g.width, g.height), y.clip());
for (var e = [], x = 0; x < a.dataSeriesIndexes.length; x++) {
var B = a.dataSeriesIndexes[x],
A = this.data[B],
z = A.dataPoints;
A.dataPointIndexes = [];
for (p = 0; p < z.length; p++) B = z[p].x.getTime ? z[p].x.getTime() : z[p].x, A.dataPointIndexes[B] = p, e[B] || (k.push(B), e[B] = !0);
k.sort(Pa)
}
for (x = 0; x < a.dataSeriesIndexes.length; x++) {
B = a.dataSeriesIndexes[x];
A = this.data[B];
z = A.dataPoints;
s = !0;
e = A.id;
this._eventManager.objectMap[e] = {
objectType: "dataSeries",
dataSeriesIndex: B
};
e = R(e);
y.fillStyle = e;
t = [];
if (0 < k.length) {
var e = A._colorSet[p % A._colorSet.length],
L = A.lineColor = A.options.lineColor || e,
J = L;
c.fillStyle = e;
c.strokeStyle = L;
c.lineWidth = A.lineThickness;
u = "solid";
if (c.setLineDash) {
var I = G(A.nullDataLineDashType, A.lineThickness);
u = A.lineDashType;
var da = G(u, A.lineThickness);
c.setLineDash(da)
}
for (var ea = !0, p = 0; p < k.length; p++) {
w = k[p];
var $ = null,
$ = 0 <= A.dataPointIndexes[w] ? z[A.dataPointIndexes[w]] : {
x: w,
y: null
};
if (!(w < a.axisX.dataInfo.viewPortMin ||
w > a.axisX.dataInfo.viewPortMax && (!A.connectNullData || !ea)))
if ("number" !== typeof $.y) A.connectNullData || (ea || s) || f(), ea = !0;
else {
var xa;
xa = 0 !== a.dataPointYSums[w] ? 100 * ($.y / a.dataPointYSums[w]) : 0;
n = a.axisX.convertValueToPixel(w);
var oa = l[w] ? l[w] : 0;
if (a.axisY.logarithmic || a.axisY.scaleBreaks && 0 < a.axisY.scaleBreaks._appliedBreaks.length) {
r[w] = xa + (r[w] ? r[w] : 0);
if (0 >= r[w] && a.axisY.logarithmic) continue;
d = a.axisY.convertValueToPixel(r[w])
} else d = a.axisY.convertValueToPixel(xa), d -= oa;
t.push({
x: n,
y: q - oa
});
l[w] =
q - d;
s || ea ? (!s && A.connectNullData ? (c.setLineDash && (A.options.nullDataLineDashType || u === A.lineDashType && A.lineDashType !== A.nullDataLineDashType) && (s = t.pop(), u = t[t.length - 1], f(), c.moveTo(m.x, m.y), t.push(u), t.push(s), u = A.nullDataLineDashType, c.setLineDash(I)), c.lineTo(n, d), v && y.lineTo(n, d)) : (c.beginPath(), c.moveTo(n, d), v && (y.beginPath(), y.moveTo(n, d))), ea = s = !1) : (c.lineTo(n, d), v && y.lineTo(n, d), 0 == p % 250 && (f(), c.moveTo(n, d), v && y.moveTo(n, d), t.push({
x: n,
y: q - oa
})));
m = {
x: n,
y: d
};
p < z.length - 1 && (J !== (z[p].lineColor ||
L) || u !== (z[p].lineDashType || A.lineDashType)) && (f(), c.beginPath(), c.moveTo(n, d), t.push({
x: n,
y: q - oa
}), J = z[p].lineColor || L, c.strokeStyle = J, c.setLineDash && (z[p].lineDashType ? (u = z[p].lineDashType, c.setLineDash(G(u, A.lineThickness))) : (u = A.lineDashType, c.setLineDash(da))));
if (0 <= A.dataPointIndexes[w]) {
var E = A.dataPointIds[A.dataPointIndexes[w]];
this._eventManager.objectMap[E] = {
id: E,
objectType: "dataPoint",
dataSeriesIndex: B,
dataPointIndex: A.dataPointIndexes[w],
x1: n,
y1: d
}
}
0 <= A.dataPointIndexes[w] && 0 !== $.markerSize &&
(0 < $.markerSize || 0 < A.markerSize) && (w = A.getMarkerProperties(p, n, d, c), h.push(w), markerColor = R(E), v && h.push({
x: n,
y: d,
ctx: y,
type: w.type,
size: w.size,
color: markerColor,
borderColor: markerColor,
borderThickness: w.borderThickness
}));
($.indexLabel || A.indexLabel || $.indexLabelFormatter || A.indexLabelFormatter) && this._indexLabels.push({
chartType: "stackedArea100",
dataPoint: $,
dataSeries: A,
point: {
x: n,
y: d
},
direction: 0 > z[p].y === a.axisY.reversed ? 1 : -1,
color: e
})
}
}
f();
c.moveTo(n, d);
v && y.moveTo(n, d)
}
delete A.dataPointIndexes
}
ja.drawMarkers(h);
v && (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), y.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderBubble = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this.plotArea,
e = 0,
g, h;
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(c.x1, c.y1, c.width, c.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(c.x1, c.y1, c.width, c.height), this._eventManager.ghostCtx.clip());
for (var l = -Infinity, t = Infinity, k = 0; k <
a.dataSeriesIndexes.length; k++)
for (var r = a.dataSeriesIndexes[k], p = this.data[r], n = p.dataPoints, d = 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 || (d = n[e].z, d > l && (l = d), d < t && (t = d));
for (var w = 25 * Math.PI, m = Math.max(Math.pow(0.25 * Math.min(c.height, c.width) / 2, 2) * Math.PI, w), k = 0; k < a.dataSeriesIndexes.length; k++)
if (r = a.dataSeriesIndexes[k], p = this.data[r], n = p.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);
h = a.axisY.convertValueToPixel(n[e].y);
var d = n[e].z,
s = 2 * Math.max(Math.sqrt((l === t ? m / 2 : w + (m - w) / (l - t) * (d - t)) / Math.PI) << 0, 1),
d = p.getMarkerProperties(e, b);
d.size = s;
b.globalAlpha = p.fillOpacity;
ja.drawMarker(g, h, b, d.type, d.size, d.color, d.borderColor, d.borderThickness);
b.globalAlpha = 1;
var u = p.dataPointIds[e];
this._eventManager.objectMap[u] = {
id: u,
objectType: "dataPoint",
dataSeriesIndex: r,
dataPointIndex: e,
x1: g,
y1: h,
size: s
};
s = R(u);
v && ja.drawMarker(g, h, this._eventManager.ghostCtx, d.type, d.size, s, s, d.borderThickness);
(n[e].indexLabel || p.indexLabel || n[e].indexLabelFormatter || p.indexLabelFormatter) && this._indexLabels.push({
chartType: "bubble",
dataPoint: n[e],
dataSeries: p,
point: {
x: g,
y: h
},
direction: 1,
bounds: {
x1: g - d.size / 2,
y1: h - d.size / 2,
x2: g + d.size / 2,
y2: h + d.size / 2
},
color: null
})
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderScatter =
function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this.plotArea,
e = 0,
g, h;
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(c.x1, c.y1, c.width, c.height);
b.clip();
v && (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 t = a.dataSeriesIndexes[l],
k = this.data[t],
r = k.dataPoints;
if (0 <
r.length) {
b.strokeStyle = "#4572A7 ";
Math.pow(0.3 * Math.min(c.height, c.width) / 2, 2);
for (var p = 0, n = 0, e = 0; e < r.length; e++)
if (g = r[e].getTime ? g = r[e].x.getTime() : g = r[e].x, !(g < a.axisX.dataInfo.viewPortMin || g > a.axisX.dataInfo.viewPortMax) && "number" === typeof r[e].y) {
g = a.axisX.convertValueToPixel(g);
h = a.axisY.convertValueToPixel(r[e].y);
var d = k.getMarkerProperties(e, g, h, b);
b.globalAlpha = k.fillOpacity;
ja.drawMarker(d.x, d.y, d.ctx, d.type, d.size, d.color, d.borderColor, d.borderThickness);
b.globalAlpha = 1;
Math.sqrt((p -
g) * (p - g) + (n - h) * (n - h)) < Math.min(d.size, 5) && r.length > Math.min(this.plotArea.width, this.plotArea.height) || (p = k.dataPointIds[e], this._eventManager.objectMap[p] = {
id: p,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: e,
x1: g,
y1: h
}, p = R(p), v && ja.drawMarker(d.x, d.y, this._eventManager.ghostCtx, d.type, d.size, p, p, d.borderThickness), (r[e].indexLabel || k.indexLabel || r[e].indexLabelFormatter || k.indexLabelFormatter) && this._indexLabels.push({
chartType: "scatter",
dataPoint: r[e],
dataSeries: k,
point: {
x: g,
y: h
},
direction: 1,
bounds: {
x1: g - d.size / 2,
y1: h - d.size / 2,
x2: g + d.size / 2,
y2: h + d.size / 2
},
color: null
}), p = g, n = h)
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderCandlestick = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f,
c = this._eventManager.ghostCtx;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = null,
h = this.plotArea,
l = 0,
t, k, r, p, n, d, e = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1,
g = this.dataPointMaxWidth ? this.dataPointMaxWidth :
this.dataPointWidth ? this.dataPointWidth : 0.015 * this.width,
w = a.axisX.dataInfo.minDiff;
isFinite(w) || (w = 0.3 * Math.abs(a.axisX.range));
w = this.dataPointWidth ? this.dataPointWidth : 0.7 * h.width * (a.axisX.logarithmic ? Math.log(w) / Math.log(a.axisX.range) : Math.abs(w) / Math.abs(a.axisX.range)) << 0;
this.dataPointMaxWidth && e > g && (e = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, g));
!this.dataPointMaxWidth && (this.dataPointMinWidth && g < e) && (g = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, e));
w < e &&
(w = e);
w > g && (w = g);
b.save();
v && c.save();
b.beginPath();
b.rect(h.x1, h.y1, h.width, h.height);
b.clip();
v && (c.beginPath(), c.rect(h.x1, h.y1, h.width, h.height), c.clip());
for (var m = 0; m < a.dataSeriesIndexes.length; m++) {
var s = a.dataSeriesIndexes[m],
u = this.data[s],
q = u.dataPoints;
if (0 < q.length)
for (var ca = 5 < w && u.bevelEnabled ? !0 : !1, l = 0; l < q.length; l++)
if (q[l].getTime ? d = q[l].x.getTime() : d = q[l].x, !(d < a.axisX.dataInfo.viewPortMin || d > a.axisX.dataInfo.viewPortMax) && !y(q[l].y) && q[l].y.length && "number" === typeof q[l].y[0] &&
"number" === typeof q[l].y[1] && "number" === typeof q[l].y[2] && "number" === typeof q[l].y[3]) {
t = a.axisX.convertValueToPixel(d);
k = a.axisY.convertValueToPixel(q[l].y[0]);
r = a.axisY.convertValueToPixel(q[l].y[1]);
p = a.axisY.convertValueToPixel(q[l].y[2]);
n = a.axisY.convertValueToPixel(q[l].y[3]);
var x = t - w / 2 << 0,
B = x + w << 0,
g = u.options.fallingColor ? u.fallingColor : u._colorSet[0],
e = q[l].color ? q[l].color : u._colorSet[0],
A = Math.round(Math.max(1, 0.15 * w)),
z = 0 === A % 2 ? 0 : 0.5,
L = u.dataPointIds[l];
this._eventManager.objectMap[L] = {
id: L,
objectType: "dataPoint",
dataSeriesIndex: s,
dataPointIndex: l,
x1: x,
y1: k,
x2: B,
y2: r,
x3: t,
y3: p,
x4: t,
y4: n,
borderThickness: A,
color: e
};
b.strokeStyle = e;
b.beginPath();
b.lineWidth = A;
c.lineWidth = Math.max(A, 4);
"candlestick" === u.type ? (b.moveTo(t - z, r), b.lineTo(t - z, Math.min(k, n)), b.stroke(), b.moveTo(t - z, Math.max(k, n)), b.lineTo(t - z, p), b.stroke(), V(b, x, Math.min(k, n), B, Math.max(k, n), q[l].y[0] <= q[l].y[3] ? u.risingColor : g, A, e, ca, ca, !1, !1, u.fillOpacity), v && (e = R(L), c.strokeStyle = e, c.moveTo(t - z, r), c.lineTo(t - z, Math.min(k,
n)), c.stroke(), c.moveTo(t - z, Math.max(k, n)), c.lineTo(t - z, p), c.stroke(), V(c, x, Math.min(k, n), B, Math.max(k, n), e, 0, null, !1, !1, !1, !1))) : "ohlc" === u.type && (b.moveTo(t - z, r), b.lineTo(t - z, p), b.stroke(), b.beginPath(), b.moveTo(t, k), b.lineTo(x, k), b.stroke(), b.beginPath(), b.moveTo(t, n), b.lineTo(B, n), b.stroke(), v && (e = R(L), c.strokeStyle = e, c.moveTo(t - z, r), c.lineTo(t - z, p), c.stroke(), c.beginPath(), c.moveTo(t, k), c.lineTo(x, k), c.stroke(), c.beginPath(), c.moveTo(t, n), c.lineTo(B, n), c.stroke()));
(q[l].indexLabel || u.indexLabel ||
q[l].indexLabelFormatter || u.indexLabelFormatter) && this._indexLabels.push({
chartType: u.type,
dataPoint: q[l],
dataSeries: u,
point: {
x: x + (B - x) / 2,
y: a.axisY.reversed ? p : r
},
direction: 1,
bounds: {
x1: x,
y1: Math.min(r, p),
x2: B,
y2: Math.max(r, p)
},
color: e
})
}
}
v && (f.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(h.x1, h.y1, h.width, h.height), c.restore());
b.restore();
return {
source: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderBoxAndWhisker = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f,
c = this._eventManager.ghostCtx;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e = null,
g = this.plotArea,
h = 0,
l, t, k, r, p, n, d, e = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1,
h = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : 0.015 * this.width,
w = a.axisX.dataInfo.minDiff;
isFinite(w) || (w = 0.3 * Math.abs(a.axisX.range));
w = this.dataPointWidth ? this.dataPointWidth : 0.7 * g.width * (a.axisX.logarithmic ? Math.log(w) / Math.log(a.axisX.range) : Math.abs(w) / Math.abs(a.axisX.range)) << 0;
this.dataPointMaxWidth && e > h && (e = Math.min(this.dataPointWidth ? this.dataPointWidth :
Infinity, h));
!this.dataPointMaxWidth && (this.dataPointMinWidth && h < e) && (h = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, e));
w < e && (w = e);
w > h && (w = h);
b.save();
v && c.save();
b.beginPath();
b.rect(g.x1, g.y1, g.width, g.height);
b.clip();
v && (c.beginPath(), c.rect(g.x1, g.y1, g.width, g.height), c.clip());
for (var m = !1, m = !!a.axisY.reversed, s = 0; s < a.dataSeriesIndexes.length; s++) {
var u = a.dataSeriesIndexes[s],
q = this.data[u],
x = q.dataPoints;
if (0 < x.length)
for (var z = 5 < w && q.bevelEnabled ? !0 : !1, h = 0; h < x.length; h++)
if (x[h].getTime ?
d = x[h].x.getTime() : d = x[h].x, !(d < a.axisX.dataInfo.viewPortMin || d > a.axisX.dataInfo.viewPortMax) && !y(x[h].y) && x[h].y.length && "number" === typeof x[h].y[0] && "number" === typeof x[h].y[1] && "number" === typeof x[h].y[2] && "number" === typeof x[h].y[3] && "number" === typeof x[h].y[4] && 5 === x[h].y.length) {
l = a.axisX.convertValueToPixel(d);
t = a.axisY.convertValueToPixel(x[h].y[0]);
k = a.axisY.convertValueToPixel(x[h].y[1]);
r = a.axisY.convertValueToPixel(x[h].y[2]);
p = a.axisY.convertValueToPixel(x[h].y[3]);
n = a.axisY.convertValueToPixel(x[h].y[4]);
var B = l - w / 2 << 0,
A = l + w / 2 << 0,
e = x[h].color ? x[h].color : q._colorSet[0],
C = Math.round(Math.max(1, 0.15 * w)),
L = 0 === C % 2 ? 0 : 0.5,
J = x[h].whiskerColor ? x[h].whiskerColor : x[h].color ? q.whiskerColor ? q.whiskerColor : x[h].color : q.whiskerColor ? q.whiskerColor : e,
I = "number" === typeof x[h].whiskerThickness ? x[h].whiskerThickness : "number" === typeof q.options.whiskerThickness ? q.whiskerThickness : C,
da = x[h].whiskerDashType ? x[h].whiskerDashType : q.whiskerDashType,
ea = y(x[h].whiskerLength) ? y(q.options.whiskerLength) ? w : q.whiskerLength : x[h].whiskerLength,
ea = "number" === typeof ea ? 0 >= ea ? 0 : ea >= w ? w : ea : "string" === typeof ea ? parseInt(ea) * w / 100 > w ? w : parseInt(ea) * w / 100 : w,
$ = 1 === Math.round(I) % 2 ? 0.5 : 0,
xa = x[h].stemColor ? x[h].stemColor : x[h].color ? q.stemColor ? q.stemColor : x[h].color : q.stemColor ? q.stemColor : e,
oa = "number" === typeof x[h].stemThickness ? x[h].stemThickness : "number" === typeof q.options.stemThickness ? q.stemThickness : C,
E = 1 === Math.round(oa) % 2 ? 0.5 : 0,
eb = x[h].stemDashType ? x[h].stemDashType : q.stemDashType,
P = x[h].lineColor ? x[h].lineColor : x[h].color ? q.lineColor ? q.lineColor :
x[h].color : q.lineColor ? q.lineColor : e,
O = "number" === typeof x[h].lineThickness ? x[h].lineThickness : "number" === typeof q.options.lineThickness ? q.lineThickness : C,
Q = x[h].lineDashType ? x[h].lineDashType : q.lineDashType,
K = 1 === Math.round(O) % 2 ? 0.5 : 0,
N = q.upperBoxColor,
U = q.lowerBoxColor,
ta = y(q.options.fillOpacity) ? 1 : q.fillOpacity,
M = q.dataPointIds[h];
this._eventManager.objectMap[M] = {
id: M,
objectType: "dataPoint",
dataSeriesIndex: u,
dataPointIndex: h,
x1: B,
y1: t,
x2: A,
y2: k,
x3: l,
y3: r,
x4: l,
y4: p,
y5: n,
borderThickness: C,
color: e,
stemThickness: oa,
stemColor: xa,
whiskerThickness: I,
whiskerLength: ea,
whiskerColor: J,
lineThickness: O,
lineColor: P
};
b.save();
0 < oa && (b.beginPath(), b.strokeStyle = xa, b.lineWidth = oa, b.setLineDash && b.setLineDash(G(eb, oa)), b.moveTo(l - E, k), b.lineTo(l - E, t), b.stroke(), b.moveTo(l - E, p), b.lineTo(l - E, r), b.stroke());
b.restore();
c.lineWidth = Math.max(C, 4);
b.beginPath();
V(b, B, Math.min(n, k), A, Math.max(k, n), U, 0, e, m ? z : !1, m ? !1 : z, !1, !1, ta);
b.beginPath();
V(b, B, Math.min(r, n), A, Math.max(n, r), N, 0, e, m ? !1 : z, m ? z : !1, !1, !1, ta);
b.beginPath();
b.lineWidth = C;
b.strokeStyle = e;
b.rect(B - L, Math.min(k, r) - L, A - B + 2 * L, Math.max(k, r) - Math.min(k, r) + 2 * L);
b.stroke();
b.save();
0 < O && (b.beginPath(), b.globalAlpha = 1, b.setLineDash && b.setLineDash(G(Q, O)), b.strokeStyle = P, b.lineWidth = O, b.moveTo(B, n - K), b.lineTo(A, n - K), b.stroke());
b.restore();
b.save();
0 < I && (b.beginPath(), b.setLineDash && b.setLineDash(G(da, I)), b.strokeStyle = J, b.lineWidth = I, b.moveTo(l - ea / 2 << 0, p - $), b.lineTo(l + ea / 2 << 0, p - $), b.stroke(), b.moveTo(l - ea / 2 << 0, t + $), b.lineTo(l + ea / 2 << 0, t + $), b.stroke());
b.restore();
v && (e = R(M), c.strokeStyle = e, c.lineWidth = oa, 0 < oa && (c.moveTo(l - L - E, k), c.lineTo(l - L - E, Math.max(t, p)), c.stroke(), c.moveTo(l - L - E, Math.min(t, p)), c.lineTo(l - L - E, r), c.stroke()), V(c, B, Math.max(k, r), A, Math.min(k, r), e, 0, null, !1, !1, !1, !1), 0 < I && (c.beginPath(), c.lineWidth = I, c.moveTo(l + ea / 2, p - $), c.lineTo(l - ea / 2, p - $), c.stroke(), c.moveTo(l + ea / 2, t + $), c.lineTo(l - ea / 2, t + $), c.stroke()));
(x[h].indexLabel || q.indexLabel || x[h].indexLabelFormatter || q.indexLabelFormatter) && this._indexLabels.push({
chartType: q.type,
dataPoint: x[h],
dataSeries: q,
point: {
x: B + (A - B) / 2,
y: a.axisY.reversed ? t : p
},
direction: 1,
bounds: {
x1: B,
y1: Math.min(t, p),
x2: A,
y2: Math.max(t, p)
},
color: e
})
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderRangeColumn = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
h, l, t, g = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
h = this.dataPointMaxWidth ? this.dataPointMaxWidth :
this.dataPointWidth ? this.dataPointWidth : 0.03 * this.width;
var k = a.axisX.dataInfo.minDiff;
isFinite(k) || (k = 0.3 * Math.abs(a.axisX.range));
k = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.width * (a.axisX.logarithmic ? Math.log(k) / Math.log(a.axisX.range) : Math.abs(k) / Math.abs(a.axisX.range)) / a.plotType.totalDataSeries) << 0;
this.dataPointMaxWidth && g > h && (g = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, h));
!this.dataPointMaxWidth && (this.dataPointMinWidth && h < g) && (h = Math.max(this.dataPointWidth ? this.dataPointWidth :
-Infinity, g));
k < g && (k = g);
k > h && (k = h);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (var r = 0; r < a.dataSeriesIndexes.length; r++) {
var p = a.dataSeriesIndexes[r],
n = this.data[p],
d = n.dataPoints;
if (0 < d.length)
for (var w = 5 < k && n.bevelEnabled ? !0 : !1, g = 0; g < d.length; g++)
if (d[g].getTime ? t = d[g].x.getTime() : t = d[g].x, !(t <
a.axisX.dataInfo.viewPortMin || t > a.axisX.dataInfo.viewPortMax) && !y(d[g].y) && d[g].y.length && "number" === typeof d[g].y[0] && "number" === typeof d[g].y[1]) {
c = a.axisX.convertValueToPixel(t);
h = a.axisY.convertValueToPixel(d[g].y[0]);
l = a.axisY.convertValueToPixel(d[g].y[1]);
var m = a.axisX.reversed ? c + a.plotType.totalDataSeries * k / 2 - (a.previousDataSeriesCount + r) * k << 0 : c - a.plotType.totalDataSeries * k / 2 + (a.previousDataSeriesCount + r) * k << 0,
q = a.axisX.reversed ? m - k << 0 : m + k << 0,
c = d[g].color ? d[g].color : n._colorSet[g % n._colorSet.length];
if (h > l) {
var u = h;
h = l;
l = u
}
u = n.dataPointIds[g];
this._eventManager.objectMap[u] = {
id: u,
objectType: "dataPoint",
dataSeriesIndex: p,
dataPointIndex: g,
x1: m,
y1: h,
x2: q,
y2: l
};
V(b, m, h, q, l, c, 0, c, w, w, !1, !1, n.fillOpacity);
c = R(u);
v && V(this._eventManager.ghostCtx, m, h, q, l, c, 0, null, !1, !1, !1, !1);
if (d[g].indexLabel || n.indexLabel || d[g].indexLabelFormatter || n.indexLabelFormatter) this._indexLabels.push({
chartType: "rangeColumn",
dataPoint: d[g],
dataSeries: n,
indexKeyword: 0,
point: {
x: m + (q - m) / 2,
y: d[g].y[1] >= d[g].y[0] ? l : h
},
direction: d[g].y[1] >=
d[g].y[0] ? -1 : 1,
bounds: {
x1: m,
y1: Math.min(h, l),
x2: q,
y2: Math.max(h, l)
},
color: c
}), this._indexLabels.push({
chartType: "rangeColumn",
dataPoint: d[g],
dataSeries: n,
indexKeyword: 1,
point: {
x: m + (q - m) / 2,
y: d[g].y[1] >= d[g].y[0] ? h : l
},
direction: d[g].y[1] >= d[g].y[0] ? 1 : -1,
bounds: {
x1: m,
y1: Math.min(h, l),
x2: q,
y2: Math.max(h, l)
},
color: c
})
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderError = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx :
f,
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,
h = this.plotArea,
l = 0,
t, k, r, p, n, d, w, m = a.axisX.dataInfo.minDiff;
isFinite(m) || (m = 0.3 * Math.abs(a.axisX.range));
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(h.x1, h.y1, h.width, h.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(h.x1, h.y1, h.width, h.height), this._eventManager.ghostCtx.clip());
for (var q =
0, u = 0; u < this.data.length; u++) !this.data[u].type.match(/(bar|column)/ig) || !this.data[u].visible || this.data[u].type.match(/(stacked)/ig) && q || q++;
for (var s = 0; s < a.dataSeriesIndexes.length; s++) {
var x = a.dataSeriesIndexes[s],
ba = this.data[x],
B = ba.dataPoints,
A = y(ba._linkedSeries) ? !1 : ba._linkedSeries.type.match(/(bar|column)/ig) && ba._linkedSeries.visible ? !0 : !1,
C = 0;
if (A)
for (e = ba._linkedSeries.id, u = 0; u < e; u++) !this.data[u].type.match(/(bar|column)/ig) || !this.data[u].visible || this.data[u].type.match(/(stacked)/ig) &&
C || (this.data[u].type.match(/(range)/ig) && (g = !0), C++);
e = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
l = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : c ? Math.min(0.15 * this.height, 0.9 * (this.plotArea.height / (A ? q : 1))) << 0 : 0.3 * this.width;
g && (l = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : c ? Math.min(0.15 * this.height, 0.9 * (this.plotArea.height / (A ? q : 1))) << 0 : 0.03 * this.width);
u = this.options.dataPointWidth ?
this.dataPointWidth : 0.9 * ((c ? h.height : h.width) * (a.axisX.logarithmic ? Math.log(m) / Math.log(a.axisX.range) : Math.abs(m) / Math.abs(a.axisX.range)) / (A ? q : 1)) << 0;
this.dataPointMaxWidth && e > l && (e = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, l));
!this.dataPointMaxWidth && (this.dataPointMinWidth && l < e) && (l = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, e));
u < e && (u = e);
u > l && (u = l);
if (0 < B.length)
for (var L = ba._colorSet, l = 0; l < B.length; l++) {
var e = ba.lineColor = ba.options.color ? ba.options.color : L[0],
J = {
color: B[l].whiskerColor ? B[l].whiskerColor : B[l].color ? ba.whiskerColor ? ba.whiskerColor : B[l].color : ba.whiskerColor ? ba.whiskerColor : e,
thickness: y(B[l].whiskerThickness) ? ba.whiskerThickness : B[l].whiskerThickness,
dashType: B[l].whiskerDashType ? B[l].whiskerDashType : ba.whiskerDashType,
length: y(B[l].whiskerLength) ? y(ba.options.whiskerLength) ? u : ba.options.whiskerLength : B[l].whiskerLength,
trimLength: y(B[l].whiskerLength) ? y(ba.options.whiskerLength) ? 50 : 0 : 0
};
J.length = "number" === typeof J.length ? 0 >= J.length ? 0 :
J.length >= u ? u : J.length : "string" === typeof J.length ? parseInt(J.length) * u / 100 > u ? u : parseInt(J.length) * u / 100 > u : u;
J.thickness = "number" === typeof J.thickness ? 0 > J.thickness ? 0 : Math.round(J.thickness) : 2;
var I = {
color: B[l].stemColor ? B[l].stemColor : B[l].color ? ba.stemColor ? ba.stemColor : B[l].color : ba.stemColor ? ba.stemColor : e,
thickness: B[l].stemThickness ? B[l].stemThickness : ba.stemThickness,
dashType: B[l].stemDashType ? B[l].stemDashType : ba.stemDashType
};
I.thickness = "number" === typeof I.thickness ? 0 > I.thickness ? 0 : Math.round(I.thickness) :
2;
B[l].getTime ? w = B[l].x.getTime() : w = B[l].x;
if (!(w < a.axisX.dataInfo.viewPortMin || w > a.axisX.dataInfo.viewPortMax) && !y(B[l].y) && B[l].y.length && "number" === typeof B[l].y[0] && "number" === typeof B[l].y[1]) {
var da = a.axisX.convertValueToPixel(w);
c ? k = da : t = da;
da = a.axisY.convertValueToPixel(B[l].y[0]);
c ? r = da : n = da;
da = a.axisY.convertValueToPixel(B[l].y[1]);
c ? p = da : d = da;
c ? (n = a.axisX.reversed ? k + (A ? q : 1) * u / 2 - (A ? C - 1 : 0) * u << 0 : k - (A ? q : 1) * u / 2 + (A ? C - 1 : 0) * u << 0, d = a.axisX.reversed ? n - u << 0 : n + u << 0) : (r = a.axisX.reversed ? t + (A ? q : 1) * u /
2 - (A ? C - 1 : 0) * u << 0 : t - (A ? q : 1) * u / 2 + (A ? C - 1 : 0) * u << 0, p = a.axisX.reversed ? r - u << 0 : r + u << 0);
!c && n > d && (da = n, n = d, d = da);
c && r > p && (da = r, r = p, p = da);
da = ba.dataPointIds[l];
this._eventManager.objectMap[da] = {
id: da,
objectType: "dataPoint",
dataSeriesIndex: x,
dataPointIndex: l,
x1: Math.min(r, p),
y1: Math.min(n, d),
x2: Math.max(p, r),
y2: Math.max(d, n),
isXYSwapped: c,
stemProperties: I,
whiskerProperties: J
};
z(b, Math.min(r, p), Math.min(n, d), Math.max(p, r), Math.max(d, n), e, J, I, c);
v && z(this._eventManager.ghostCtx, r, n, p, d, e, J, I, c);
if (B[l].indexLabel ||
ba.indexLabel || B[l].indexLabelFormatter || ba.indexLabelFormatter) this._indexLabels.push({
chartType: "error",
dataPoint: B[l],
dataSeries: ba,
indexKeyword: 0,
point: {
x: c ? B[l].y[1] >= B[l].y[0] ? r : p : r + (p - r) / 2,
y: c ? n + (d - n) / 2 : B[l].y[1] >= B[l].y[0] ? d : n
},
direction: B[l].y[1] >= B[l].y[0] ? -1 : 1,
bounds: {
x1: c ? Math.min(r, p) : r,
y1: c ? n : Math.min(n, d),
x2: c ? Math.max(r, p) : p,
y2: c ? d : Math.max(n, d)
},
color: e,
axisSwapped: c
}), this._indexLabels.push({
chartType: "error",
dataPoint: B[l],
dataSeries: ba,
indexKeyword: 1,
point: {
x: c ? B[l].y[1] >= B[l].y[0] ?
p : r : r + (p - r) / 2,
y: c ? n + (d - n) / 2 : B[l].y[1] >= B[l].y[0] ? n : d
},
direction: B[l].y[1] >= B[l].y[0] ? 1 : -1,
bounds: {
x1: c ? Math.min(r, p) : r,
y1: c ? n : Math.min(n, d),
x2: c ? Math.max(r, p) : p,
y2: c ? d : Math.max(n, d)
},
color: e,
axisSwapped: c
})
}
}
}
v && (f.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(h.x1, h.y1, h.width, h.height), this._eventManager.ghostCtx.restore());
b.restore();
return {
source: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderRangeBar = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = null,
e = this.plotArea,
g = 0,
h, l, t, k, g = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth :
1;
h = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.dataPointWidth ? this.dataPointWidth : Math.min(0.15 * this.height, 0.9 * (this.plotArea.height / a.plotType.totalDataSeries)) << 0;
var r = a.axisX.dataInfo.minDiff;
isFinite(r) || (r = 0.3 * Math.abs(a.axisX.range));
r = this.dataPointWidth ? this.dataPointWidth : 0.9 * (e.height * (a.axisX.logarithmic ? Math.log(r) / Math.log(a.axisX.range) : Math.abs(r) / Math.abs(a.axisX.range)) / a.plotType.totalDataSeries) << 0;
this.dataPointMaxWidth && g > h && (g = Math.min(this.dataPointWidth ? this.dataPointWidth :
Infinity, h));
!this.dataPointMaxWidth && (this.dataPointMinWidth && h < g) && (h = Math.max(this.dataPointWidth ? this.dataPointWidth : -Infinity, g));
r < g && (r = g);
r > h && (r = h);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(e.x1, e.y1, e.width, e.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(e.x1, e.y1, e.width, e.height), this._eventManager.ghostCtx.clip());
for (var p = 0; p < a.dataSeriesIndexes.length; p++) {
var n = a.dataSeriesIndexes[p],
d = this.data[n],
w = d.dataPoints;
if (0 < w.length) {
var m = 5 < r && d.bevelEnabled ? !0 : !1;
b.strokeStyle = "#4572A7 ";
for (g = 0; g < w.length; g++)
if (w[g].getTime ? k = w[g].x.getTime() : k = w[g].x, !(k < a.axisX.dataInfo.viewPortMin || k > a.axisX.dataInfo.viewPortMax) && !y(w[g].y) && w[g].y.length && "number" === typeof w[g].y[0] && "number" === typeof w[g].y[1]) {
h = a.axisY.convertValueToPixel(w[g].y[0]);
l = a.axisY.convertValueToPixel(w[g].y[1]);
t = a.axisX.convertValueToPixel(k);
t = a.axisX.reversed ? t + a.plotType.totalDataSeries * r / 2 - (a.previousDataSeriesCount + p) * r << 0 : t - a.plotType.totalDataSeries *
r / 2 + (a.previousDataSeriesCount + p) * r << 0;
var q = a.axisX.reversed ? t - r << 0 : t + r << 0;
h > l && (c = h, h = l, l = c);
c = w[g].color ? w[g].color : d._colorSet[g % d._colorSet.length];
V(b, h, t, l, q, c, 0, null, m, !1, !1, !1, d.fillOpacity);
c = d.dataPointIds[g];
this._eventManager.objectMap[c] = {
id: c,
objectType: "dataPoint",
dataSeriesIndex: n,
dataPointIndex: g,
x1: h,
y1: t,
x2: l,
y2: q
};
c = R(c);
v && V(this._eventManager.ghostCtx, h, t, l, q, c, 0, null, !1, !1, !1, !1);
if (w[g].indexLabel || d.indexLabel || w[g].indexLabelFormatter || d.indexLabelFormatter) this._indexLabels.push({
chartType: "rangeBar",
dataPoint: w[g],
dataSeries: d,
indexKeyword: 0,
point: {
x: w[g].y[1] >= w[g].y[0] ? h : l,
y: t + (q - t) / 2
},
direction: w[g].y[1] >= w[g].y[0] ? -1 : 1,
bounds: {
x1: Math.min(h, l),
y1: t,
x2: Math.max(h, l),
y2: q
},
color: c
}), this._indexLabels.push({
chartType: "rangeBar",
dataPoint: w[g],
dataSeries: d,
indexKeyword: 1,
point: {
x: w[g].y[1] >= w[g].y[0] ? l : h,
y: t + (q - t) / 2
},
direction: w[g].y[1] >= w[g].y[0] ? 1 : -1,
bounds: {
x1: Math.min(h, l),
y1: t,
x2: Math.max(h, l),
y2: q
},
color: c
})
}
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
q.prototype.renderRangeArea =
function (a) {
function f() {
if (s) {
var a = null;
0 < r.lineThickness && c.stroke();
for (var b = t.length - 1; 0 <= b; b--) a = t[b], c.lineTo(a.x, a.y), e.lineTo(a.x, a.y);
c.closePath();
c.globalAlpha = r.fillOpacity;
c.fill();
c.globalAlpha = 1;
e.fill();
if (0 < r.lineThickness) {
c.beginPath();
c.moveTo(a.x, a.y);
for (b = 0; b < t.length; b++) a = t[b], c.lineTo(a.x, a.y);
c.stroke()
}
c.beginPath();
c.moveTo(w, m);
e.beginPath();
e.moveTo(w, m);
s = {
x: w,
y: m
};
t = [];
t.push({
x: w,
y: q
})
}
}
var b = a.targetCanvasCtx || this.plotArea.ctx,
c = v ? this._preRenderCtx : b;
if (!(0 >=
a.dataSeriesIndexes.length)) {
var e = this._eventManager.ghostCtx,
g = [],
h = this.plotArea;
c.save();
v && e.save();
c.beginPath();
c.rect(h.x1, h.y1, h.width, h.height);
c.clip();
v && (e.beginPath(), e.rect(h.x1, h.y1, h.width, h.height), e.clip());
for (var l = 0; l < a.dataSeriesIndexes.length; l++) {
var t = [],
k = a.dataSeriesIndexes[l],
r = this.data[k],
p = r.dataPoints,
g = r.id;
this._eventManager.objectMap[g] = {
objectType: "dataSeries",
dataSeriesIndex: k
};
g = R(g);
e.fillStyle = g;
var g = [],
n = !0,
d = 0,
w, m, q, u, s = null;
if (0 < p.length) {
var y = r._colorSet[d %
r._colorSet.length],
x = r.lineColor = r.options.lineColor || y,
B = x;
c.fillStyle = y;
c.strokeStyle = x;
c.lineWidth = r.lineThickness;
var A = "solid";
if (c.setLineDash) {
var z = G(r.nullDataLineDashType, r.lineThickness),
A = r.lineDashType,
C = G(A, r.lineThickness);
c.setLineDash(C)
}
for (var J = !0; d < p.length; d++)
if (u = p[d].x.getTime ? p[d].x.getTime() : p[d].x, !(u < a.axisX.dataInfo.viewPortMin || u > a.axisX.dataInfo.viewPortMax && (!r.connectNullData || !J)))
if (null !== p[d].y && p[d].y.length && "number" === typeof p[d].y[0] && "number" === typeof p[d].y[1]) {
w =
a.axisX.convertValueToPixel(u);
m = a.axisY.convertValueToPixel(p[d].y[0]);
q = a.axisY.convertValueToPixel(p[d].y[1]);
n || J ? (r.connectNullData && !n ? (c.setLineDash && (r.options.nullDataLineDashType || A === r.lineDashType && r.lineDashType !== r.nullDataLineDashType) && (t[t.length - 1].newLineDashArray = C, A = r.nullDataLineDashType, c.setLineDash(z)), c.lineTo(w, m), v && e.lineTo(w, m), t.push({
x: w,
y: q
})) : (c.beginPath(), c.moveTo(w, m), s = {
x: w,
y: m
}, t = [], t.push({
x: w,
y: q
}), v && (e.beginPath(), e.moveTo(w, m))), J = n = !1) : (c.lineTo(w, m), t.push({
x: w,
y: q
}), v && e.lineTo(w, m), 0 == d % 250 && f());
u = r.dataPointIds[d];
this._eventManager.objectMap[u] = {
id: u,
objectType: "dataPoint",
dataSeriesIndex: k,
dataPointIndex: d,
x1: w,
y1: m,
y2: q
};
d < p.length - 1 && (B !== (p[d].lineColor || x) || A !== (p[d].lineDashType || r.lineDashType)) && (f(), B = p[d].lineColor || x, t[t.length - 1].newStrokeStyle = B, c.strokeStyle = B, c.setLineDash && (p[d].lineDashType ? (A = p[d].lineDashType, t[t.length - 1].newLineDashArray = G(A, r.lineThickness), c.setLineDash(t[t.length - 1].newLineDashArray)) : (A = r.lineDashType, t[t.length -
1].newLineDashArray = C, c.setLineDash(C))));
if (0 !== p[d].markerSize && (0 < p[d].markerSize || 0 < r.markerSize)) {
var I = r.getMarkerProperties(d, w, q, c);
g.push(I);
var da = R(u);
v && g.push({
x: w,
y: q,
ctx: e,
type: I.type,
size: I.size,
color: da,
borderColor: da,
borderThickness: I.borderThickness
});
I = r.getMarkerProperties(d, w, m, c);
g.push(I);
da = R(u);
v && g.push({
x: w,
y: m,
ctx: e,
type: I.type,
size: I.size,
color: da,
borderColor: da,
borderThickness: I.borderThickness
})
}
if (p[d].indexLabel || r.indexLabel || p[d].indexLabelFormatter || r.indexLabelFormatter) this._indexLabels.push({
chartType: "rangeArea",
dataPoint: p[d],
dataSeries: r,
indexKeyword: 0,
point: {
x: w,
y: m
},
direction: p[d].y[0] > p[d].y[1] === a.axisY.reversed ? -1 : 1,
color: y
}), this._indexLabels.push({
chartType: "rangeArea",
dataPoint: p[d],
dataSeries: r,
indexKeyword: 1,
point: {
x: w,
y: q
},
direction: p[d].y[0] > p[d].y[1] === a.axisY.reversed ? 1 : -1,
color: y
})
} else J || n || f(), J = !0;
f();
ja.drawMarkers(g)
}
}
v && (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(h.x1, h.y1, h.width, h.height), this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderRangeSplineArea = function (a) {
function f(a, b) {
var d = x(m, 2);
if (0 < d.length) {
if (0 <
k.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);
v && (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), v && 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 = x(q, 2);
c.lineTo(q[q.length - 1].x, q[q.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), v && 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 = k.fillOpacity;
c.fill();
v && (e.closePath(), e.fill());
c.globalAlpha = 1;
if (0 < k.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 (m[g].newStrokeStyle || m[g].newLineDashArray) c.stroke(), c.beginPath(), c.moveTo(d[f].x, d[f].y), m[g].newStrokeStyle && (c.strokeStyle = m[g].newStrokeStyle), m[g].newLineDashArray && c.setLineDash(m[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 = v ? this._preRenderCtx : b;
if (!(0 >= a.dataSeriesIndexes.length)) {
var e =
this._eventManager.ghostCtx,
g = [],
h = this.plotArea;
c.save();
v && e.save();
c.beginPath();
c.rect(h.x1, h.y1, h.width, h.height);
c.clip();
v && (e.beginPath(), e.rect(h.x1, h.y1, h.width, h.height), e.clip());
for (var l = 0; l < a.dataSeriesIndexes.length; l++) {
var t = a.dataSeriesIndexes[l],
k = this.data[t],
r = k.dataPoints,
g = k.id;
this._eventManager.objectMap[g] = {
objectType: "dataSeries",
dataSeriesIndex: t
};
g = R(g);
e.fillStyle = g;
var g = [],
p = 0,
n, d, w, m = [],
q = [];
if (0 < r.length) {
var u = k._colorSet[p % k._colorSet.length],
s = k.lineColor = k.options.lineColor ||
u,
y = s;
c.fillStyle = u;
c.lineWidth = k.lineThickness;
var z = "solid",
B;
if (c.setLineDash) {
var A = G(k.nullDataLineDashType, k.lineThickness),
z = k.lineDashType;
B = G(z, k.lineThickness)
}
for (d = !1; p < r.length; p++)
if (n = r[p].x.getTime ? r[p].x.getTime() : r[p].x, !(n < a.axisX.dataInfo.viewPortMin || n > a.axisX.dataInfo.viewPortMax && (!k.connectNullData || !d)))
if (null !== r[p].y && r[p].y.length && "number" === typeof r[p].y[0] && "number" === typeof r[p].y[1]) {
n = a.axisX.convertValueToPixel(n);
d = a.axisY.convertValueToPixel(r[p].y[0]);
w = a.axisY.convertValueToPixel(r[p].y[1]);
var C = k.dataPointIds[p];
this._eventManager.objectMap[C] = {
id: C,
objectType: "dataPoint",
dataSeriesIndex: t,
dataPointIndex: p,
x1: n,
y1: d,
y2: w
};
m[m.length] = {
x: n,
y: d
};
q[q.length] = {
x: n,
y: w
};
p < r.length - 1 && (y !== (r[p].lineColor || s) || z !== (r[p].lineDashType || k.lineDashType)) && (y = r[p].lineColor || s, m[m.length - 1].newStrokeStyle = y, c.setLineDash && (r[p].lineDashType ? (z = r[p].lineDashType, m[m.length - 1].newLineDashArray = G(z, k.lineThickness)) : (z = k.lineDashType, m[m.length - 1].newLineDashArray = B)));
if (0 !== r[p].markerSize && (0 <
r[p].markerSize || 0 < k.markerSize)) {
var L = k.getMarkerProperties(p, n, d, c);
g.push(L);
var J = R(C);
v && g.push({
x: n,
y: d,
ctx: e,
type: L.type,
size: L.size,
color: J,
borderColor: J,
borderThickness: L.borderThickness
});
L = k.getMarkerProperties(p, n, w, c);
g.push(L);
J = R(C);
v && g.push({
x: n,
y: w,
ctx: e,
type: L.type,
size: L.size,
color: J,
borderColor: J,
borderThickness: L.borderThickness
})
}
if (r[p].indexLabel || k.indexLabel || r[p].indexLabelFormatter || k.indexLabelFormatter) this._indexLabels.push({
chartType: "rangeSplineArea",
dataPoint: r[p],
dataSeries: k,
indexKeyword: 0,
point: {
x: n,
y: d
},
direction: r[p].y[0] <= r[p].y[1] ? -1 : 1,
color: u
}), this._indexLabels.push({
chartType: "rangeSplineArea",
dataPoint: r[p],
dataSeries: k,
indexKeyword: 1,
point: {
x: n,
y: w
},
direction: r[p].y[0] <= r[p].y[1] ? 1 : -1,
color: u
});
d = !1
} else 0 < p && !d && (k.connectNullData ? c.setLineDash && (0 < m.length && (k.options.nullDataLineDashType || !r[p - 1].lineDashType)) && (m[m.length - 1].newLineDashArray = A, z = k.nullDataLineDashType) : (f(B, s), m = [], q = [])), d = !0;
f(B, s);
ja.drawMarkers(g)
}
}
v && (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(h.x1, h.y1, h.width, h.height), this._eventManager.ghostCtx.restore());
c.restore();
return {
source: b,
dest: this.plotArea.ctx,
animationCallback: H.xClipAnimation,
easingFunction: H.easing.linear,
animationBase: 0
}
}
};
q.prototype.renderWaterfall = function (a) {
var f = a.targetCanvasCtx || this.plotArea.ctx,
b = v ? this._preRenderCtx : f;
if (!(0 >= a.dataSeriesIndexes.length)) {
var c = this._eventManager.ghostCtx,
e = null,
g = this.plotArea,
h = 0,
l, t, k, r, p = a.axisY.convertValueToPixel(a.axisY.logarithmic ? a.axisY.viewportMinimum : 0),
h = this.dataPointMinWidth ? this.dataPointMinWidth : this.dataPointWidth ? this.dataPointWidth : 1;
t = this.dataPointMaxWidth ? this.dataPointMaxWidth : this.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.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 && h > t && (h = Math.min(this.dataPointWidth ? this.dataPointWidth : Infinity, t));
!this.dataPointMaxWidth && (this.dataPointMinWidth && t < h) && (t = Math.max(this.dataPointWidth ?
this.dataPointWidth : -Infinity, h));
n < h && (n = h);
n > t && (n = t);
b.save();
v && this._eventManager.ghostCtx.save();
b.beginPath();
b.rect(g.x1, g.y1, g.width, g.height);
b.clip();
v && (this._eventManager.ghostCtx.beginPath(), this._eventManager.ghostCtx.rect(g.x1, g.y1, g.width, g.height), this._eventManager.ghostCtx.clip());
for (var d = 0; d < a.dataSeriesIndexes.length; d++) {
var w = a.dataSeriesIndexes[d],
m = this.data[w],
q = m.dataPoints,
e = m._colorSet[0];
m.risingColor = m.options.risingColor ? m.options.risingColor : e;
m.fallingColor = m.options.fallingColor ?
m.options.fallingColor : "#e40a0a";
var u = "number" === typeof m.options.lineThickness ? Math.round(m.lineThickness) : 1,
s = 1 === Math.round(u) % 2 ? -0.5 : 0;
if (0 < q.length)
for (var y = 5 < n && m.bevelEnabled ? !0 : !1, x = !1, B = null, A = null, h = 0; h < q.length; h++)
if (q[h].getTime ? r = q[h].x.getTime() : r = q[h].x, "number" !== typeof q[h].y) {
if (0 < h && !x && m.connectNullData) var z = m.options.nullDataLineDashType || !q[h - 1].lineDashType ? m.nullDataLineDashType : q[h - 1].lineDashType;
x = !0
} else {
l = a.axisX.convertValueToPixel(r);
t = 0 === m.dataPointEOs[h].cumulativeSum ?
p : a.axisY.convertValueToPixel(m.dataPointEOs[h].cumulativeSum);
k = 0 === m.dataPointEOs[h].cumulativeSumYStartValue ? p : a.axisY.convertValueToPixel(m.dataPointEOs[h].cumulativeSumYStartValue);
l = a.axisX.reversed ? l + a.plotType.totalDataSeries * n / 2 - (a.previousDataSeriesCount + d) * n << 0 : l - a.plotType.totalDataSeries * n / 2 + (a.previousDataSeriesCount + d) * n << 0;
var C = a.axisX.reversed ? l - n << 0 : l + n << 0;
t > k && (e = t, t = k, k = e);
a.axisY.reversed && (e = t, t = k, k = e);
e = m.dataPointIds[h];
this._eventManager.objectMap[e] = {
id: e,
objectType: "dataPoint",
dataSeriesIndex: w,
dataPointIndex: h,
x1: l,
y1: t,
x2: C,
y2: k
};
var J = q[h].color ? q[h].color : -1 < q[h].y ? m.risingColor : m.fallingColor;
V(b, l, t, C, k, J, 0, J, y, y, !1, !1, m.fillOpacity);
e = R(e);
v && V(this._eventManager.ghostCtx, l, t, C, k, e, 0, null, !1, !1, !1, !1);
var I, J = l;
I = "undefined" !== typeof q[h].isIntermediateSum && !0 === q[h].isIntermediateSum || "undefined" !== typeof q[h].isCumulativeSum && !0 === q[h].isCumulativeSum ? -1 < q[h].y ? t : k : -1 < q[h].y ? k : t;
0 < h && B && (!x || m.connectNullData) && (x && b.setLineDash && b.setLineDash(G(z, u)), b.beginPath(),
b.moveTo(B, A - s), b.lineTo(J, I - s), 0 < u && b.stroke(), v && (c.beginPath(), c.moveTo(B, A - s), c.lineTo(J, I - s), 0 < u && c.stroke()));
x = !1;
B = C;
A = -1 < q[h].y ? t : k;
J = q[h].lineDashType ? q[h].lineDashType : m.options.lineDashType ? m.options.lineDashType : "shortDash";
b.strokeStyle = q[h].lineColor ? q[h].lineColor : m.options.lineColor ? m.options.lineColor : "#9e9e9e";
b.lineWidth = u;
b.setLineDash && (J = G(J, u), b.setLineDash(J));
(q[h].indexLabel || m.indexLabel || q[h].indexLabelFormatter || m.indexLabelFormatter) && this._indexLabels.push({
chartType: "waterfall",
dataPoint: q[h],
dataSeries: m,
point: {
x: l + (C - l) / 2,
y: 0 <= q[h].y ? t : k
},
direction: 0 > q[h].y === a.axisY.reversed ? 1 : -1,
bounds: {
x1: l,
y1: Math.min(t, k),
x2: C,
y2: Math.max(t, k)
},
color: e
})
}
}
v && (f.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: f,
dest: this.plotArea.ctx,
animationCallback: H.fadeInAnimation,
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
};
var ra = function (a, f, b, c, e, g, h, l, t) {
if (!(0 > b)) {
"undefined" === typeof l && (l = 1);
if (!v) {
var k = Number((h % (2 * Math.PI)).toFixed(8));
Number((g % (2 * Math.PI)).toFixed(8)) === k && (h -= 1E-4)
}
a.save();
a.globalAlpha = l;
"pie" === e ? (a.beginPath(), a.moveTo(f.x, f.y), a.arc(f.x, f.y,
b, g, h, !1), a.fillStyle = c, a.strokeStyle = "white", a.lineWidth = 2, a.closePath(), a.fill()) : "doughnut" === e && (a.beginPath(), a.arc(f.x, f.y, b, g, h, !1), 0 <= t && a.arc(f.x, f.y, t * b, h, g, !0), a.closePath(), a.fillStyle = c, a.strokeStyle = "white", a.lineWidth = 2, a.fill());
a.globalAlpha = 1;
a.restore()
}
};
q.prototype.renderPie = function (a) {
function f() {
if (k && r) {
for (var a = 0, b = 0, c = 0, e = 0, f = 0; f < r.length; f++) {
var g = r[f],
h = k.dataPointIds[f];
d[f].id = h;
d[f].objectType = "dataPoint";
d[f].dataPointIndex = f;
d[f].dataSeriesIndex = 0;
var l = d[f],
p = {
percent: null,
total: null
},
m = null,
p = t.getPercentAndTotal(k, g);
if (k.indexLabelFormatter || g.indexLabelFormatter) m = {
chart: t.options,
dataSeries: k,
dataPoint: g,
total: p.total,
percent: p.percent
};
p = g.indexLabelFormatter ? g.indexLabelFormatter(m) : g.indexLabel ? t.replaceKeywordsWithValue(g.indexLabel, g, k, f) : k.indexLabelFormatter ? k.indexLabelFormatter(m) : k.indexLabel ? t.replaceKeywordsWithValue(k.indexLabel, g, k, f) : g.label ? g.label : "";
t._eventManager.objectMap[h] = l;
l.center = {
x: x.x,
y: x.y
};
l.y = g.y;
l.radius = A;
l.percentInnerRadius =
L;
l.indexLabelText = p;
l.indexLabelPlacement = k.indexLabelPlacement;
l.indexLabelLineColor = g.indexLabelLineColor ? g.indexLabelLineColor : k.options.indexLabelLineColor ? k.options.indexLabelLineColor : g.color ? g.color : k._colorSet[f % k._colorSet.length];
l.indexLabelLineThickness = y(g.indexLabelLineThickness) ? k.indexLabelLineThickness : g.indexLabelLineThickness;
l.indexLabelLineDashType = g.indexLabelLineDashType ? g.indexLabelLineDashType : k.indexLabelLineDashType;
l.indexLabelFontColor = g.indexLabelFontColor ? g.indexLabelFontColor :
k.indexLabelFontColor;
l.indexLabelFontStyle = g.indexLabelFontStyle ? g.indexLabelFontStyle : k.indexLabelFontStyle;
l.indexLabelFontWeight = g.indexLabelFontWeight ? g.indexLabelFontWeight : k.indexLabelFontWeight;
l.indexLabelFontSize = y(g.indexLabelFontSize) ? k.indexLabelFontSize : g.indexLabelFontSize;
l.indexLabelFontFamily = g.indexLabelFontFamily ? g.indexLabelFontFamily : k.indexLabelFontFamily;
l.indexLabelBackgroundColor = g.indexLabelBackgroundColor ? g.indexLabelBackgroundColor : k.options.indexLabelBackgroundColor ?
k.options.indexLabelBackgroundColor : k.indexLabelBackgroundColor;
l.indexLabelMaxWidth = g.indexLabelMaxWidth ? g.indexLabelMaxWidth : k.indexLabelMaxWidth ? k.indexLabelMaxWidth : 0.33 * n.width;
l.indexLabelWrap = "undefined" !== typeof g.indexLabelWrap ? g.indexLabelWrap : k.indexLabelWrap;
l.startAngle = 0 === f ? k.startAngle ? k.startAngle / 180 * Math.PI : 0 : d[f - 1].endAngle;
l.startAngle = (l.startAngle + 2 * Math.PI) % (2 * Math.PI);
l.endAngle = l.startAngle + 2 * Math.PI / z * Math.abs(g.y);
g = (l.endAngle + l.startAngle) / 2;
g = (g + 2 * Math.PI) % (2 * Math.PI);
l.midAngle = g;
if (l.midAngle > Math.PI / 2 - u && l.midAngle < Math.PI / 2 + u) {
if (0 === a || d[c].midAngle > l.midAngle) c = f;
a++
} else if (l.midAngle > 3 * Math.PI / 2 - u && l.midAngle < 3 * Math.PI / 2 + u) {
if (0 === b || d[e].midAngle > l.midAngle) e = f;
b++
}
l.hemisphere = g > Math.PI / 2 && g <= 3 * Math.PI / 2 ? "left" : "right";
l.indexLabelTextBlock = new la(t.plotArea.ctx, {
fontSize: l.indexLabelFontSize,
fontFamily: l.indexLabelFontFamily,
fontColor: l.indexLabelFontColor,
fontStyle: l.indexLabelFontStyle,
fontWeight: l.indexLabelFontWeight,
horizontalAlign: "left",
backgroundColor: l.indexLabelBackgroundColor,
maxWidth: l.indexLabelMaxWidth,
maxHeight: l.indexLabelWrap ? 5 * l.indexLabelFontSize : 1.5 * l.indexLabelFontSize,
text: l.indexLabelText,
padding: 0,
textBaseline: "top"
});
l.indexLabelTextBlock.measureText()
}
h = g = 0;
p = !1;
for (f = 0; f < r.length; f++) l = d[(c + f) % r.length], 1 < a && (l.midAngle > Math.PI / 2 - u && l.midAngle < Math.PI / 2 + u) && (g <= a / 2 && !p ? (l.hemisphere = "right", g++) : (l.hemisphere = "left", p = !0));
p = !1;
for (f = 0; f < r.length; f++) l = d[(e + f) % r.length], 1 < b && (l.midAngle > 3 * Math.PI / 2 - u && l.midAngle < 3 * Math.PI / 2 + u) && (h <= b / 2 && !p ? (l.hemisphere =
"left", h++) : (l.hemisphere = "right", p = !0))
}
}
function b(a) {
var b = t.plotArea.ctx;
b.clearRect(n.x1, n.y1, n.width, n.height);
b.fillStyle = t.backgroundColor;
b.fillRect(n.x1, n.y1, n.width, n.height);
for (b = 0; b < r.length; b++) {
var c = d[b].startAngle,
e = d[b].endAngle;
if (e > c) {
var f = 0.07 * A * Math.cos(d[b].midAngle),
g = 0.07 * A * Math.sin(d[b].midAngle),
h = !1;
if (r[b].exploded) {
if (1E-9 < Math.abs(d[b].center.x - (x.x + f)) || 1E-9 < Math.abs(d[b].center.y - (x.y + g))) d[b].center.x = x.x + f * a, d[b].center.y = x.y + g * a, h = !0
} else if (0 < Math.abs(d[b].center.x -
x.x) || 0 < Math.abs(d[b].center.y - x.y)) d[b].center.x = x.x + f * (1 - a), d[b].center.y = x.y + g * (1 - a), h = !0;
h && (f = {}, f.dataSeries = k, f.dataPoint = k.dataPoints[b], f.index = b, t.toolTip.highlightObjects([f]));
ra(t.plotArea.ctx, d[b].center, d[b].radius, r[b].color ? r[b].color : k._colorSet[b % k._colorSet.length], k.type, c, e, k.fillOpacity, d[b].percentInnerRadius)
}
}
a = t.plotArea.ctx;
a.save();
a.fillStyle = "black";
a.strokeStyle = "grey";
a.textBaseline = "middle";
a.lineJoin = "round";
for (b = b = 0; b < r.length; b++) c = d[b], c.indexLabelText && (c.indexLabelTextBlock.y -=
c.indexLabelTextBlock.height / 2, e = 0, e = "left" === c.hemisphere ? "inside" !== k.indexLabelPlacement ? -(c.indexLabelTextBlock.width + p) : -c.indexLabelTextBlock.width / 2 : "inside" !== k.indexLabelPlacement ? p : -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), f = c.center.y + A * Math.sin(c.midAngle),
a.strokeStyle = c.indexLabelLineColor, a.lineWidth = c.indexLabelLineThickness, a.setLineDash && a.setLineDash(G(c.indexLabelLineDashType, c.indexLabelLineThickness)), a.beginPath(), a.moveTo(e, f), a.lineTo(c.indexLabelTextBlock.x, c.indexLabelTextBlock.y), a.lineTo(c.indexLabelTextBlock.x + ("left" === c.hemisphere ? -p : p), c.indexLabelTextBlock.y), a.stroke()), a.lineJoin = "miter");
a.save()
}
function c(a, b) {
var c = 0,
c = a.indexLabelTextBlock.y - a.indexLabelTextBlock.height / 2,
d = a.indexLabelTextBlock.y + a.indexLabelTextBlock.height /
2,
e = b.indexLabelTextBlock.y - b.indexLabelTextBlock.height / 2,
f = b.indexLabelTextBlock.y + b.indexLabelTextBlock.height / 2;
return c = b.indexLabelTextBlock.y > a.indexLabelTextBlock.y ? e - d : c - f
}
function e(a) {
for (var b = null, e = 1; e < r.length; e++)
if (b = (a + e + d.length) % d.length, d[b].hemisphere !== d[a].hemisphere) {
b = null;
break
} else if (d[b].indexLabelText && b !== a && (0 > c(d[b], d[a]) || ("right" === d[a].hemisphere ? d[b].indexLabelTextBlock.y >= d[a].indexLabelTextBlock.y : d[b].indexLabelTextBlock.y <= d[a].indexLabelTextBlock.y))) break;
else b = null;
return b
}
function g(a, b, f) {
f = (f || 0) + 1;
if (1E3 < f) return 0;
b = b || 0;
var k = 0,
h = x.y - 1 * q,
n = x.y + 1 * q;
if (0 <= a && a < r.length) {
var l = d[a];
if (0 > b && l.indexLabelTextBlock.y < h || 0 < b && l.indexLabelTextBlock.y > n) return 0;
var t = 0,
p = 0,
p = t = t = 0;
0 > b ? l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2 > h && l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2 + b < h && (b = -(h - (l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2 + b))) : l.indexLabelTextBlock.y + l.indexLabelTextBlock.height / 2 < h && l.indexLabelTextBlock.y +
l.indexLabelTextBlock.height / 2 + b > n && (b = l.indexLabelTextBlock.y + l.indexLabelTextBlock.height / 2 + b - n);
b = l.indexLabelTextBlock.y + b;
h = 0;
h = "right" === l.hemisphere ? x.x + Math.sqrt(Math.pow(q, 2) - Math.pow(b - x.y, 2)) : x.x - Math.sqrt(Math.pow(q, 2) - Math.pow(b - x.y, 2));
p = x.x + A * Math.cos(l.midAngle);
t = x.y + A * Math.sin(l.midAngle);
t = Math.sqrt(Math.pow(h - p, 2) + Math.pow(b - t, 2));
p = Math.acos(A / q);
t = Math.acos((q * q + A * A - t * t) / (2 * A * q));
b = t < p ? b - l.indexLabelTextBlock.y : 0;
h = null;
for (n = 1; n < r.length; n++)
if (h = (a - n + d.length) % d.length, d[h].hemisphere !==
d[a].hemisphere) {
h = null;
break
} else if (d[h].indexLabelText && d[h].hemisphere === d[a].hemisphere && h !== a && (0 > c(d[h], d[a]) || ("right" === d[a].hemisphere ? d[h].indexLabelTextBlock.y <= d[a].indexLabelTextBlock.y : d[h].indexLabelTextBlock.y >= d[a].indexLabelTextBlock.y))) break;
else h = null;
p = h;
t = e(a);
n = h = 0;
0 > b ? (n = "right" === l.hemisphere ? p : t, k = b, null !== n && (p = -b, b = l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2 - (d[n].indexLabelTextBlock.y + d[n].indexLabelTextBlock.height / 2), b - p < m && (h = -p, n = g(n, h, f + 1), +n.toFixed(v) >
+h.toFixed(v) && (k = b > m ? -(b - m) : -(p - (n - h)))))) : 0 < b && (n = "right" === l.hemisphere ? t : p, k = b, null !== n && (p = b, b = d[n].indexLabelTextBlock.y - d[n].indexLabelTextBlock.height / 2 - (l.indexLabelTextBlock.y + l.indexLabelTextBlock.height / 2), b - p < m && (h = p, n = g(n, h, f + 1), +n.toFixed(v) < +h.toFixed(v) && (k = b > m ? b - m : p - (h - n)))));
k && (f = l.indexLabelTextBlock.y + k, b = 0, b = "right" === l.hemisphere ? x.x + Math.sqrt(Math.pow(q, 2) - Math.pow(f - x.y, 2)) : x.x - Math.sqrt(Math.pow(q, 2) - Math.pow(f - x.y, 2)), l.midAngle > Math.PI / 2 - u && l.midAngle < Math.PI / 2 + u ? (h = (a -
1 + d.length) % d.length, h = d[h], a = d[(a + 1 + d.length) % d.length], "left" === l.hemisphere && "right" === h.hemisphere && b > h.indexLabelTextBlock.x ? b = h.indexLabelTextBlock.x - 15 : "right" === l.hemisphere && ("left" === a.hemisphere && b < a.indexLabelTextBlock.x) && (b = a.indexLabelTextBlock.x + 15)) : l.midAngle > 3 * Math.PI / 2 - u && l.midAngle < 3 * Math.PI / 2 + u && (h = (a - 1 + d.length) % d.length, h = d[h], a = d[(a + 1 + d.length) % d.length], "right" === l.hemisphere && "left" === h.hemisphere && b < h.indexLabelTextBlock.x ? b = h.indexLabelTextBlock.x + 15 : "left" === l.hemisphere &&
("right" === a.hemisphere && b > a.indexLabelTextBlock.x) && (b = a.indexLabelTextBlock.x - 15)), l.indexLabelTextBlock.y = f, l.indexLabelTextBlock.x = b, l.indexLabelAngle = Math.atan2(l.indexLabelTextBlock.y - x.y, l.indexLabelTextBlock.x - x.x))
}
return k
}
function h() {
var a = t.plotArea.ctx;
a.fillStyle = "grey";
a.strokeStyle = "grey";
a.font = "16px Arial";
a.textBaseline = "middle";
for (var b = a = 0, f = 0, h = !0, b = 0; 10 > b && (1 > b || 0 < f); b++) {
if (k.radius || !k.radius && "undefined" !== typeof k.innerRadius && null !== k.innerRadius && A - f <= C) h = !1;
h && (A -=
f);
f = 0;
if ("inside" !== k.indexLabelPlacement) {
q = A * s;
for (a = 0; a < r.length; a++) {
var l = d[a];
l.indexLabelTextBlock.x = x.x + q * Math.cos(l.midAngle);
l.indexLabelTextBlock.y = x.y + q * Math.sin(l.midAngle);
l.indexLabelAngle = l.midAngle;
l.radius = A;
l.percentInnerRadius = L
}
for (var u, y, a = 0; a < r.length; a++) {
var l = d[a],
B = e(a);
if (null !== B) {
u = d[a];
y = d[B];
var z = 0,
z = c(u, y) - m;
if (0 > z) {
for (var ba = y = 0, G = 0; G < r.length; G++) G !== a && d[G].hemisphere === l.hemisphere && (d[G].indexLabelTextBlock.y < l.indexLabelTextBlock.y ? y++ : ba++);
y = z / (y + ba || 1) *
ba;
var ba = -1 * (z - y),
H = G = 0;
"right" === l.hemisphere ? (G = g(a, y), ba = -1 * (z - G), H = g(B, ba), +H.toFixed(v) < +ba.toFixed(v) && +G.toFixed(v) <= +y.toFixed(v) && g(a, -(ba - H))) : (G = g(B, y), ba = -1 * (z - G), H = g(a, ba), +H.toFixed(v) < +ba.toFixed(v) && +G.toFixed(v) <= +y.toFixed(v) && g(B, -(ba - H)))
}
}
}
} else
for (a = 0; a < r.length; a++) l = d[a], q = "pie" === k.type ? 0.7 * A : 0.8 * A, B = x.x + q * Math.cos(l.midAngle), y = x.y + q * Math.sin(l.midAngle), l.indexLabelTextBlock.x = B, l.indexLabelTextBlock.y = y;
for (a = 0; a < r.length; a++)
if (l = d[a], B = l.indexLabelTextBlock.measureText(),
0 !== B.height && 0 !== B.width) B = B = 0, "right" === l.hemisphere ? (B = n.x2 - (l.indexLabelTextBlock.x + l.indexLabelTextBlock.width + p), B *= -1) : B = n.x1 - (l.indexLabelTextBlock.x - l.indexLabelTextBlock.width - p), 0 < B && (!h && l.indexLabelText && (y = "right" === l.hemisphere ? n.x2 - l.indexLabelTextBlock.x : l.indexLabelTextBlock.x - n.x1, 0.3 * l.indexLabelTextBlock.maxWidth > y ? l.indexLabelText = "" : l.indexLabelTextBlock.maxWidth = 0.85 * y, 0.3 * l.indexLabelTextBlock.maxWidth < y && (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) && (B /= Math.abs(Math.cos(l.indexLabelAngle)), 9 < B && (B *= 0.3), B > f && (f = B)), B = B = 0, 0 < l.indexLabelAngle && l.indexLabelAngle < Math.PI ? (B = n.y2 - (l.indexLabelTextBlock.y + l.indexLabelTextBlock.height / 2 + 5), B *= -1) : B = n.y1 - (l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2 - 5), 0 < B && (!h && l.indexLabelText && (y = 0 < l.indexLabelAngle && l.indexLabelAngle < Math.PI ? -1 : 1, 0 === g(a, B * y) && g(a, 2 * y)), Math.abs(l.indexLabelTextBlock.x -
x.x) < A && (B /= Math.abs(Math.sin(l.indexLabelAngle)), 9 < B && (B *= 0.3), B > f && (f = B)));
var K = function (a, b, c) {
for (var e = [], f = 0; e.push(d[b]), b !== c; b = (b + 1 + r.length) % r.length);
e.sort(function (a, b) {
return a.y - b.y
});
for (b = 0; b < e.length; b++)
if (c = e[b], f < 0.7 * a) f += c.indexLabelTextBlock.height, c.indexLabelTextBlock.text = "", c.indexLabelText = "", c.indexLabelTextBlock.measureText();
else break
};
(function () {
for (var a = -1, b = -1, f = 0, g = !1, h = 0; h < r.length; h++)
if (g = !1, u = d[h], u.indexLabelText) {
var k = e(h);
if (null !== k) {
var l = d[k];
z = 0;
z = c(u, l);
var n;
if (n = 0 > z) {
n = u.indexLabelTextBlock.x;
var t = u.indexLabelTextBlock.y - u.indexLabelTextBlock.height / 2,
m = u.indexLabelTextBlock.y + u.indexLabelTextBlock.height / 2,
w = l.indexLabelTextBlock.y - l.indexLabelTextBlock.height / 2,
q = l.indexLabelTextBlock.x + l.indexLabelTextBlock.width,
s = l.indexLabelTextBlock.y + l.indexLabelTextBlock.height / 2;
n = u.indexLabelTextBlock.x + u.indexLabelTextBlock.width < l.indexLabelTextBlock.x - p || n > q + p || t > s + p || m < w - p ? !1 : !0
}
n ? (0 > a && (a = h), k !== a && (b = k, f += -z), 0 === h % Math.max(r.length /
10, 3) && (g = !0)) : g = !0;
g && (0 < f && 0 <= a && 0 <= b) && (K(f, a, b), b = a = -1, f = 0)
}
}
0 < f && K(f, a, b)
})()
}
}
function l() {
t.plotArea.layoutManager.reset();
t.title && (t.title.dockInsidePlotArea || "center" === t.title.horizontalAlign && "center" === t.title.verticalAlign) && t.title.render();
if (t.subtitles)
for (var a = 0; a < t.subtitles.length; a++) {
var b = t.subtitles[a];
(b.dockInsidePlotArea || "center" === b.horizontalAlign && "center" === b.verticalAlign) && b.render()
}
t.legend && (t.legend.dockInsidePlotArea || "center" === t.legend.horizontalAlign && "center" ===
t.legend.verticalAlign) && t.legend.render()
}
var t = this;
if (!(0 >= a.dataSeriesIndexes.length)) {
var k = this.data[a.dataSeriesIndexes[0]],
r = k.dataPoints,
p = 10,
n = this.plotArea,
d = k.dataPointEOs,
m = 2,
q, s = 1.3,
u = 20 / 180 * Math.PI,
v = 6,
x = {
x: (n.x2 + n.x1) / 2,
y: (n.y2 + n.y1) / 2
},
z = 0;
a = !1;
for (var B = 0; B < r.length; B++) z += Math.abs(r[B].y), !a && ("undefined" !== typeof r[B].indexLabel && null !== r[B].indexLabel && 0 < r[B].indexLabel.toString().length) && (a = !0), !a && ("undefined" !== typeof r[B].label && null !== r[B].label && 0 < r[B].label.toString().length) &&
(a = !0);
if (0 !== z) {
a = a || "undefined" !== typeof k.indexLabel && null !== k.indexLabel && 0 < k.indexLabel.toString().length;
var A = "inside" !== k.indexLabelPlacement && a ? 0.75 * Math.min(n.width, n.height) / 2 : 0.92 * Math.min(n.width, n.height) / 2;
k.radius && (A = O(k.radius, A));
var C = "undefined" !== typeof k.innerRadius && null !== k.innerRadius ? O(k.innerRadius, A) : 0.7 * A;
k.radius = A;
"doughnut" === k.type && (k.innerRadius = C);
var L = Math.min(C / A, (A - 1) / A);
this.pieDoughnutClickHandler = function (a) {
t.isAnimating || !y(a.dataSeries.explodeOnClick) &&
!a.dataSeries.explodeOnClick || (a = a.dataPoint, a.exploded = a.exploded ? !1 : !0, 1 < this.dataPoints.length && t._animator.animate(0, 500, function (a) {
b(a);
l()
}))
};
f();
h();
h();
h();
h();
this.disableToolTip = !0;
this._animator.animate(0, this.animatedRender ? this.animationDuration : 0, function (a) {
var b = t.plotArea.ctx;
b.clearRect(n.x1, n.y1, n.width, n.height);
b.fillStyle = t.backgroundColor;
b.fillRect(n.x1, n.y1, n.width, n.height);
a = d[0].startAngle + 2 * Math.PI * a;
for (b = 0; b < r.length; b++) {
var c = 0 === b ? d[b].startAngle : e,
e = c + (d[b].endAngle -
d[b].startAngle),
f = !1;
e > a && (e = a, f = !0);
var g = r[b].color ? r[b].color : k._colorSet[b % k._colorSet.length];
e > c && ra(t.plotArea.ctx, d[b].center, d[b].radius, g, k.type, c, e, k.fillOpacity, d[b].percentInnerRadius);
if (f) break
}
l()
}, function () {
t.disableToolTip = !1;
t._animator.animate(0, t.animatedRender ? 500 : 0, function (a) {
b(a);
l()
})
})
}
}
};
var sa = function (a, f, b, c) {
"undefined" === typeof b && (b = 1);
0 >= Math.round(f.y4 - f.y1) || (a.save(), a.globalAlpha = b, a.beginPath(), a.moveTo(Math.round(f.x1), Math.round(f.y1)), a.lineTo(Math.round(f.x2),
Math.round(f.y2)), a.lineTo(Math.round(f.x3), Math.round(f.y3)), a.lineTo(Math.round(f.x4), Math.round(f.y4)), "undefined" !== f.x5 && (a.lineTo(Math.round(f.x5), Math.round(f.y5)), a.lineTo(Math.round(f.x6), Math.round(f.y6))), a.closePath(), a.fillStyle = c ? c : f.color, a.fill(), a.globalAplha = 1, a.restore())
};
q.prototype.renderFunnel = function (a) {
function f() {
for (var a = 0, b = [], c = 0; c < x.length; c++) {
if ("undefined" === typeof x[c].y) return -1;
x[c].y = "number" === typeof x[c].y ? x[c].y : 0;
a += Math.abs(x[c].y)
}
if (0 === a) return -1;
for (c =
b[0] = 0; c < x.length; c++) b.push(Math.abs(x[c].y) * O / a);
return b
}
function b() {
var a = X,
b = V,
c = K,
d = Y,
e, f;
e = Q;
f = $ - N;
headArea = (f - e) * (b - a + (d - c)) / 2;
headArea = Math.abs(headArea);
c = Y - K;
e = f - e;
f = c * (f - $);
f = Math.abs(f);
f = headArea + f;
for (var d = [], g = 0, h = 0; h < x.length; h++) {
if ("undefined" === typeof x[h].y) return -1;
x[h].y = "number" === typeof x[h].y ? x[h].y : 0;
g += Math.abs(x[h].y)
}
if (0 === g) return -1;
for (var k = d[0] = 0, l = 0, n, b = b - a, t = !1, h = 0; h < x.length; h++) a = Math.abs(x[h].y) * f / g, t ? k = 0 == Number(c.toFixed(3)) ? 0 : a / c : (sqrt = fa * fa * b * b - 4 * Math.abs(fa) *
a, 0 > sqrt ? (n = c, k = (b + n) * (e - l) / 2, a -= k, k = e - l, l += e - l, k += 0 == n ? 0 : a / n, l += a / n, t = !0) : (k = (Math.abs(fa) * b - Math.sqrt(sqrt)) / 2, n = b - 2 * k / Math.abs(fa), l += k, l > e && (l -= k, n = c, k = (b + n) * (e - l) / 2, a -= k, k = e - l, l += e - l, k += a / n, l += a / n, t = !0), b = n)), d.push(k);
return d
}
function c() {
if (u && x) {
for (var a, b, c, e, f, g, h, k, l, n, t, p, r, m, w = [], q = [], A = {
percent: null,
total: null
}, B = null, z = 0; z < x.length; z++) m = M[z], m = "undefined" !== typeof m.x5 ? (m.y2 + m.y4) / 2 : (m.y2 + m.y3) / 2, m = d(m).x2 + 1, w[z] = P - m - U;
m = 0.5 * U;
for (var z = 0, za = x.length - 1; z < x.length || 0 <= za; z++, za--) {
b =
u.reversed ? x[za] : x[z];
a = b.color ? b.color : u.reversed ? u._colorSet[(x.length - 1 - z) % u._colorSet.length] : u._colorSet[z % u._colorSet.length];
c = b.indexLabelPlacement || u.indexLabelPlacement || "outside";
e = b.indexLabelBackgroundColor || u.indexLabelBackgroundColor || (v ? "transparent" : null);
f = b.indexLabelFontColor || u.indexLabelFontColor || "#979797";
g = y(b.indexLabelFontSize) ? u.indexLabelFontSize : b.indexLabelFontSize;
h = b.indexLabelFontStyle || u.indexLabelFontStyle || "normal";
k = b.indexLabelFontFamily || u.indexLabelFontFamily ||
"arial";
l = b.indexLabelFontWeight || u.indexLabelFontWeight || "normal";
a = b.indexLabelLineColor || u.options.indexLabelLineColor || a;
n = "number" === typeof b.indexLabelLineThickness ? b.indexLabelLineThickness : "number" === typeof u.indexLabelLineThickness ? u.indexLabelLineThickness : 2;
t = b.indexLabelLineDashType || u.indexLabelLineDashType || "solid";
p = "undefined" !== typeof b.indexLabelWrap ? b.indexLabelWrap : "undefined" !== typeof u.indexLabelWrap ? u.indexLabelWrap : !0;
r = u.dataPointIds[z];
s._eventManager.objectMap[r] = {
id: r,
objectType: "dataPoint",
dataPointIndex: z,
dataSeriesIndex: 0,
funnelSection: M[u.reversed ? x.length - 1 - z : z]
};
"inside" === u.indexLabelPlacement && (w[z] = z !== ga ? u.reversed ? M[z].x2 - M[z].x1 : M[z].x3 - M[z].x4 : M[z].x3 - M[z].x6, 20 > w[z] && (w[z] = z !== ga ? u.reversed ? M[z].x3 - M[z].x4 : M[z].x2 - M[z].x1 : M[z].x2 - M[z].x1, w[z] /= 2));
r = b.indexLabelMaxWidth ? b.indexLabelMaxWidth : u.options.indexLabelMaxWidth ? u.indexLabelMaxWidth : w[z];
if (r > w[z] || 0 > r) r = w[z];
q[z] = "inside" === u.indexLabelPlacement ? M[z].height : !1;
A = s.getPercentAndTotal(u, b);
if (u.indexLabelFormatter || b.indexLabelFormatter) B = {
chart: s.options,
dataSeries: u,
dataPoint: b,
total: A.total,
percent: A.percent
};
b = b.indexLabelFormatter ? b.indexLabelFormatter(B) : b.indexLabel ? s.replaceKeywordsWithValue(b.indexLabel, b, u, z) : u.indexLabelFormatter ? u.indexLabelFormatter(B) : u.indexLabel ? s.replaceKeywordsWithValue(u.indexLabel, b, u, z) : b.label ? b.label : "";
0 >= n && (n = 0);
1E3 > r && 1E3 - r < m && (r += 1E3 - r);
R.roundRect || Ca(R);
c = new la(R, {
fontSize: g,
fontFamily: k,
fontColor: f,
fontStyle: h,
fontWeight: l,
horizontalAlign: c,
backgroundColor: e,
maxWidth: r,
maxHeight: !1 === q[z] ? p ? 4.28571429 * g : 1.5 * g : q[z],
text: b,
padding: ha
});
c.measureText();
F.push({
textBlock: c,
id: u.reversed ? za : z,
isDirty: !1,
lineColor: a,
lineThickness: n,
lineDashType: t,
height: c.height < c.maxHeight ? c.height : c.maxHeight,
width: c.width < c.maxWidth ? c.width : c.maxWidth
})
}
}
}
function e() {
var a, b, c, d, e, f = [];
e = !1;
c = 0;
for (var g = P - V - U / 2, g = u.options.indexLabelMaxWidth ? u.indexLabelMaxWidth > g ? g : u.indexLabelMaxWidth : g, h = F.length - 1; 0 <= h; h--) {
dataPoint = x[F[h].id];
c = F[h];
d = c.textBlock;
b = (a = n(h) < M.length ? F[n(h)] : null) ? a.textBlock : null;
c = c.height;
a && d.y + c + ha > b.y && (e = !0);
c = dataPoint.indexLabelMaxWidth || g;
if (c > g || 0 > c) c = g;
f.push(c)
}
if (e)
for (h = F.length - 1; 0 <= h; h--) a = M[h], F[h].textBlock.maxWidth = f[f.length - (h + 1)], F[h].textBlock.measureText(), F[h].textBlock.x = P - g, c = F[h].textBlock.height < F[h].textBlock.maxHeight ? F[h].textBlock.height : F[h].textBlock.maxHeight, e = F[h].textBlock.width < F[h].textBlock.maxWidth ? F[h].textBlock.width : F[h].textBlock.maxWidth, F[h].height = c, F[h].width = e, c = "undefined" !==
typeof a.x5 ? (a.y2 + a.y4) / 2 : (a.y2 + a.y3) / 2, F[h].textBlock.y = c - F[h].height / 2, u.reversed ? (F[h].textBlock.y + F[h].height > T + C && (F[h].textBlock.y = T + C - F[h].height), F[h].textBlock.y < ta - C && (F[h].textBlock.y = ta - C)) : (F[h].textBlock.y < T - C && (F[h].textBlock.y = T - C), F[h].textBlock.y + F[h].height > ta + C && (F[h].textBlock.y = ta + C - F[h].height))
}
function g() {
var a, b, c, e;
if ("inside" !== u.indexLabelPlacement)
for (var f = 0; f < M.length; f++) 0 == F[f].textBlock.text.length ? F[f].isDirty = !0 : (a = M[f], c = "undefined" !== typeof a.x5 ? (a.y2 + a.y4) /
2 : (a.y2 + a.y3) / 2, b = u.reversed ? "undefined" !== typeof a.x5 ? c > aa ? d(c).x2 + 1 : (a.x2 + a.x3) / 2 + 1 : (a.x2 + a.x3) / 2 + 1 : "undefined" !== typeof a.x5 ? c < aa ? d(c).x2 + 1 : (a.x4 + a.x3) / 2 + 1 : (a.x2 + a.x3) / 2 + 1, F[f].textBlock.x = b + U, F[f].textBlock.y = c - F[f].height / 2, u.reversed ? (F[f].textBlock.y + F[f].height > T + C && (F[f].textBlock.y = T + C - F[f].height), F[f].textBlock.y < ta - C && (F[f].textBlock.y = ta - C)) : (F[f].textBlock.y < T - C && (F[f].textBlock.y = T - C), F[f].textBlock.y + F[f].height > ta + C && (F[f].textBlock.y = ta + C - F[f].height)));
else
for (f = 0; f < M.length; f++) 0 ==
F[f].textBlock.text.length ? F[f].isDirty = !0 : (a = M[f], b = a.height, c = F[f].height, e = F[f].width, b >= c ? (b = f != ga ? (a.x4 + a.x3) / 2 - e / 2 : (a.x5 + a.x4) / 2 - e / 2, c = f != ga ? (a.y1 + a.y3) / 2 - c / 2 : (a.y1 + a.y4) / 2 - c / 2, F[f].textBlock.x = b, F[f].textBlock.y = c) : F[f].isDirty = !0)
}
function h() {
function a(b, c) {
var d;
if (0 > b || b >= F.length) return 0;
var e, f = F[b].textBlock;
if (0 > c) {
c *= -1;
e = p(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 == M.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 = ($ - Q + 2 * C) / t;
h = t;
for (var k, l = 1; l < h; l++) {
e = l * f;
for (var r = F.length - 1; 0 <= r; r--) !F[r].isDirty && (F[r].textBlock.y < e && F[r].textBlock.y + F[r].height > e) && (k = n(r), !(k >= F.length - 1) && F[r].textBlock.y + F[r].height + ha > F[k].textBlock.y && (F[r].textBlock.y = F[r].textBlock.y + F[r].height - e > e - F[r].textBlock.y ? e + 1 : e - F[r].height - 1))
}
for (k = M.length - 1; 0 < k; k--)
if (!F[k].isDirty) {
e = p(k);
if (0 > e && (e = 0, F[e].isDirty)) break;
if (F[k].textBlock.y <
F[e].textBlock.y + F[e].height) {
d = d || k;
f = k;
for (h = 0; F[f].textBlock.y < F[e].textBlock.y + F[e].height + ha;) {
a = a || F[f].textBlock.y + F[f].height;
h += F[f].height;
h += ha;
f = e;
if (0 >= f) {
f = 0;
h += F[f].height;
break
}
e = p(f);
if (0 > e) {
f = 0;
h += F[f].height;
break
}
}
if (f != k) {
g = F[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(M[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 += F[b.id].height + ha, F[b.id].textBlock.text =
"", F[b.id].indexLabelText = "", F[b.id].isDirty = !0, F[b.id].textBlock.measureText();
else break;
return g
}
for (var d, e, f, g, h, k, t = 1, r = 0; r < 2 * t; r++) {
for (var m = F.length - 1; 0 <= m && !(previousTextBlock = (previousLabel = 0 <= p(m) ? F[p(m)] : null) ? previousLabel.textBlock : null, f = F[m], g = f.textBlock, k = (h = n(m) < M.length ? F[n(m)] : null) ? h.textBlock : null, d = +f.height.toFixed(6), e = +g.y.toFixed(6), !f.isDirty && (h && e + d + ha > +k.y.toFixed(6)) && (d = g.y + d + ha - k.y, e = a(m, -d), e < d && (0 < e && (d -= e), e = a(n(m), d), e != d))); m--);
b()
}
}
function l(a, b) {
return (b <
M.length ? F[b].textBlock.y : u.reversed ? T + C : ta + C) - (0 > a ? u.reversed ? ta - C : T - C : F[a].textBlock.y + F[a].height + ha)
}
function t(a, b, c) {
var d, e, f, h = [],
l = C,
n = []; - 1 !== b && (0 <= ma.indexOf(b) ? (e = ma.indexOf(b), ma.splice(e, 1)) : (ma.push(b), ma = ma.sort(function (a, b) {
return a - b
})));
if (0 === ma.length) h = ka;
else {
e = C * (1 != ma.length || 0 != ma[0] && ma[0] != M.length - 1 ? 2 : 1) / k();
for (var t = 0; t < M.length; t++) {
if (1 == ma.length && 0 == ma[0]) {
if (0 === t) {
h.push(ka[t]);
d = l;
continue
}
} else 0 === t && (d = -1 * l);
h.push(ka[t] + d);
if (0 <= ma.indexOf(t) || t < M.length &&
0 <= ma.indexOf(t + 1)) d += e
}
}
f = function () {
for (var a = [], b = 0; b < M.length; b++) a.push(h[b] - M[b].y1);
return a
}();
var p = {
startTime: (new Date).getTime(),
duration: c || 500,
easingFunction: function (a, b, c, d) {
return H.easing.easeOutQuart(a, b, c, d)
},
changeSection: function (a) {
for (var b, c, d = 0; d < M.length; d++) b = f[d], c = M[d], newY = b * a, "undefined" === typeof n[d] && (n[d] = 0), 0 > n && (n *= -1), c.y1 += newY - n[d], c.y2 += newY - n[d], c.y3 += newY - n[d], c.y4 += newY - n[d], c.y5 && (c.y5 += newY - n[d], c.y6 += newY - n[d]), n[d] = newY
}
};
a._animator.animate(0, c, function (c) {
var d =
a.plotArea.ctx || a.ctx;
ja = !0;
d.clearRect(z.x1, z.y1, z.x2 - z.x1, z.y2 - z.y1);
d.fillStyle = a.backgroundColor;
d.fillRect(z.x1, z.y1, z.width, z.height);
p.changeSection(c, b);
var e = {};
e.dataSeries = u;
e.dataPoint = u.reversed ? u.dataPoints[x.length - 1 - b] : u.dataPoints[b];
e.index = u.reversed ? x.length - 1 - b : b;
a.toolTip.highlightObjects([e]);
for (e = 0; e < M.length; e++) sa(d, M[e], u.fillOpacity);
q(d);
J && ("inside" !== u.indexLabelPlacement ? r(d) : g(), m(d));
1 <= c && (ja = !1)
}, null, H.easing.easeOutQuart)
}
function k() {
for (var a = 0, b = 0; b < M.length -
1; b++)(0 <= ma.indexOf(b) || 0 <= ma.indexOf(b + 1)) && a++;
return a
}
function r(a) {
for (var b, c, e, f, g = 0; g < M.length; g++) f = 1 === F[g].lineThickness % 2 ? 0.5 : 0, c = ((M[g].y2 + M[g].y4) / 2 << 0) + f, b = d(c).x2 - 1, e = F[g].textBlock.x, f = (F[g].textBlock.y + F[g].height / 2 << 0) + f, F[g].isDirty || 0 == F[g].lineThickness || (a.strokeStyle = F[g].lineColor, a.lineWidth = F[g].lineThickness, a.setLineDash && a.setLineDash(G(F[g].lineDashType, F[g].lineThickness)), a.beginPath(), a.moveTo(b, c), a.lineTo(e, f), a.stroke())
}
function p(a) {
for (a -= 1; - 1 <= a && -1 != a && F[a].isDirty; a--);
return a
}
function n(a) {
for (a += 1; a <= M.length && a != M.length && F[a].isDirty; a++);
return a
}
function d(a) {
for (var b, c = 0; c < x.length; c++)
if (M[c].y1 < a && M[c].y4 > a) {
b = M[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 m(a) {
for (var b = 0; b < M.length; b++) F[b].isDirty || (a && (F[b].textBlock.ctx = a), F[b].textBlock.render(!0))
}
function q(a) {
s.plotArea.layoutManager.reset();
a.roundRect || Ca(a);
s.title &&
(s.title.dockInsidePlotArea || "center" === s.title.horizontalAlign && "center" === s.title.verticalAlign) && (s.title.ctx = a, s.title.render());
if (s.subtitles)
for (var b = 0; b < s.subtitles.length; b++) {
var c = s.subtitles[b];
if (c.dockInsidePlotArea || "center" === c.horizontalAlign && "center" === c.verticalAlign) s.subtitles.ctx = a, c.render()
}
s.legend && (s.legend.dockInsidePlotArea || "center" === s.legend.horizontalAlign && "center" === s.legend.verticalAlign) && (s.legend.ctx = a, s.legend.render());
Z.fNg && Z.fNg(s)
}
var s = this;
if (!(0 >=
a.dataSeriesIndexes.length)) {
for (var u = this.data[a.dataSeriesIndexes[0]], x = u.dataPoints, z = this.plotArea, C = 0.025 * z.width, B = 0.01 * z.width, A = 0, O = z.height - 2 * C, L = Math.min(z.width - 2 * B, 2.8 * z.height), J = !1, I = 0; I < x.length; I++)
if (!J && ("undefined" !== typeof x[I].indexLabel && null !== x[I].indexLabel && 0 < x[I].indexLabel.toString().length) && (J = !0), !J && ("undefined" !== typeof x[I].label && null !== x[I].label && 0 < x[I].label.toString().length) && (J = !0), !J && "function" === typeof u.indexLabelFormatter || "function" === typeof x[I].indexLabelFormatter) J = !0;
J = J || "undefined" !== typeof u.indexLabel && null !== u.indexLabel && 0 < u.indexLabel.toString().length;
"inside" !== u.indexLabelPlacement && J || (B = (z.width - 0.75 * L) / 2);
var I = z.x1 + B,
P = z.x2 - B,
Q = z.y1 + C,
$ = z.y2 - C,
R = a.targetCanvasCtx || this.plotArea.ctx || this.ctx;
if (0 != u.length && (u.dataPoints && u.visible) && 0 !== x.length) {
var N, E;
a = 75 * L / 100;
var U = 30 * (P - a) / 100;
"funnel" === u.type ? (N = y(u.options.neckHeight) ? 0.35 * O : u.neckHeight, E = y(u.options.neckWidth) ? 0.25 * a : u.neckWidth, "string" === typeof N && N.match(/%$/) ? (N = parseInt(N), N =
N * O / 100) : N = parseInt(N), "string" === typeof E && E.match(/%$/) ? (E = parseInt(E), E = E * a / 100) : E = parseInt(E), N > O ? N = O : 0 >= N && (N = 0), E > a ? E = a - 0.5 : 0 >= E && (E = 0)) : "pyramid" === u.type && (E = N = 0, u.reversed = u.reversed ? !1 : !0);
var B = I + a / 2,
X = I,
V = I + a,
T = u.reversed ? $ : Q,
K = B - E / 2,
Y = B + E / 2,
aa = u.reversed ? Q + N : $ - N,
ta = u.reversed ? Q : $;
a = [];
var B = [],
M = [],
L = [],
W = Q,
ga, fa = (aa - T) / (K - X),
ia = -fa,
I = "area" === (u.valueRepresents ? u.valueRepresents : "height") ? b() : f();
if (-1 !== I) {
if (u.reversed)
for (L.push(W), E = I.length - 1; 0 < E; E--) W += I[E], L.push(W);
else
for (E =
0; E < I.length; E++) W += I[E], L.push(W);
if (u.reversed)
for (E = 0; E < I.length; E++) L[E] < aa ? (a.push(K), B.push(Y), ga = E) : (a.push((L[E] - T + fa * X) / fa), B.push((L[E] - T + ia * V) / ia));
else
for (E = 0; E < I.length; E++) L[E] < aa ? (a.push((L[E] - T + fa * X) / fa), B.push((L[E] - T + ia * V) / ia), ga = E) : (a.push(K), B.push(Y));
for (E = 0; E < I.length - 1; E++) W = u.reversed ? x[x.length - 1 - E].color ? x[x.length - 1 - E].color : u._colorSet[(x.length - 1 - E) % u._colorSet.length] : x[E].color ? x[E].color : u._colorSet[E % u._colorSet.length], E === ga ? M.push({
x1: a[E],
y1: L[E],
x2: B[E],
y2: L[E],
x3: Y,
y3: aa,
x4: B[E + 1],
y4: L[E + 1],
x5: a[E + 1],
y5: L[E + 1],
x6: K,
y6: aa,
id: E,
height: L[E + 1] - L[E],
color: W
}) : M.push({
x1: a[E],
y1: L[E],
x2: B[E],
y2: L[E],
x3: B[E + 1],
y3: L[E + 1],
x4: a[E + 1],
y4: L[E + 1],
id: E,
height: L[E + 1] - L[E],
color: W
});
var ha = 2,
F = [],
ja = !1,
ma = [],
ka = [],
I = !1;
a = a = 0;
Da(ma);
for (E = 0; E < x.length; E++) x[E].exploded && (I = !0, u.reversed ? ma.push(x.length - 1 - E) : ma.push(E));
R.clearRect(z.x1, z.y1, z.width, z.height);
R.fillStyle = s.backgroundColor;
R.fillRect(z.x1, z.y1, z.width, z.height);
if (J && u.visible && (c(), g(), e(), "inside" !== u.indexLabelPlacement)) {
h();
for (E = 0; E < x.length; E++) F[E].isDirty || (a = F[E].textBlock.x + F[E].width, a = (P - a) / 2, 0 == E && (A = a), A > a && (A = a));
for (E = 0; E < M.length; E++) M[E].x1 += A, M[E].x2 += A, M[E].x3 += A, M[E].x4 += A, M[E].x5 && (M[E].x5 += A, M[E].x6 += A), F[E].textBlock.x += A
}
for (E = 0; E < M.length; E++) A = M[E], sa(R, A, u.fillOpacity), ka.push(A.y1);
q(R);
J && u.visible && ("inside" === u.indexLabelPlacement || s.animationEnabled || r(R), s.animationEnabled || m());
if (!J)
for (E = 0; E < x.length; E++) A = u.dataPointIds[E], a = {
id: A,
objectType: "dataPoint",
dataPointIndex: E,
dataSeriesIndex: 0,
funnelSection: M[u.reversed ? x.length - 1 - E : E]
}, s._eventManager.objectMap[A] = a;
!s.animationEnabled && I ? t(s, -1, 0) : s.animationEnabled && !s.animatedRender && t(s, -1, 0);
this.funnelPyramidClickHandler = function (a) {
var b = -1;
if (!ja && !s.isAnimating && (y(a.dataSeries.explodeOnClick) || a.dataSeries.explodeOnClick) && (b = u.reversed ? x.length - 1 - a.dataPointIndex : a.dataPointIndex, 0 <= b)) {
a = b;
if ("funnel" === u.type || "pyramid" === u.type) u.reversed ? x[x.length - 1 - a].exploded = x[x.length - 1 - a].exploded ? !1 : !0 : x[a].exploded = x[a].exploded ?
!1 : !0;
t(s, b, 500)
}
};
return {
source: R,
dest: this.plotArea.ctx,
animationCallback: function (a, b) {
H.fadeInAnimation(a, b);
1 <= a && (t(s, -1, 500), q(s.plotArea.ctx || s.ctx))
},
easingFunction: H.easing.easeInQuad,
animationBase: 0
}
}
}
}
};
q.prototype.animationRequestId = null;
q.prototype.requestAnimFrame = function () {
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (a) {
window.setTimeout(a, 1E3 / 60)
}
}();
q.prototype.cancelRequestAnimFrame = window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || clearTimeout;
q.prototype.set = function (a, f, b) {
b = "undefined" === typeof b ? !0 : b;
"options" === a ? (this.options = f, b && this.render()) : q.base.set.call(this, a, f, b)
};
q.prototype.exportChart = function (a) {
a = "undefined" === typeof a ? {} : a;
var f = a.format ? a.format : "png",
b = a.fileName ? a.fileName : this.exportFileName;
if (a.toDataURL) return this.canvas.toDataURL("image/" + f);
s(this.canvas, f, b)
};
q.prototype.print = function () {
var a = this.exportChart({
toDataURL: !0
}),
f = document.createElement("iframe");
f.setAttribute("class", "canvasjs-chart-print-frame");
f.setAttribute("style", "position:absolute; width:100%; border: 0px; margin: 0px 0px 0px 0px; padding 0px 0px 0px 0px;");
f.style.height = this.height + "px";
this._canvasJSContainer.appendChild(f);
var b = this,
c = f.contentWindow || f.contentDocument.document || f.contentDocument;
c.document.open();
c.document.write('\n