Skip to content

Instantly share code, notes, and snippets.

@kennyjwilli
Created Jan 10, 2020
Embed
What would you like to do?
/*
Highcharts JS v8.0.0 (2019-12-10)
(c) 2009-2018 Torstein Honsi
License: www.highcharts.com/license
*/
(function(S, M) {
"object" === typeof module && module.exports ? (M["default"] = M, module.exports = S.document ? M(S) : M) : "function" === typeof define && define.amd ? define("highcharts/highcharts", function() {
return M(S)
}) : (S.Highcharts && S.Highcharts.error(16, !0), S.Highcharts = M(S))
})("undefined" !== typeof window ? window : this, function(S) {
function M(c, e, F, I) {
c.hasOwnProperty(e) || (c[e] = I.apply(null, F))
}
var J = {};
M(J, "parts/Globals.js", [], function() {
var c = "undefined" !== typeof S ? S : "undefined" !== typeof window ? window : {},
e = c.document,
F = c.navigator && c.navigator.userAgent || "",
I = e && e.createElementNS && !!e.createElementNS("http://www.w3.org/2000/svg", "svg").createSVGRect,
G = /(edge|msie|trident)/i.test(F) && !c.opera,
H = -1 !== F.indexOf("Firefox"),
v = -1 !== F.indexOf("Chrome"),
q = H && 4 > parseInt(F.split("Firefox/")[1], 10);
return {
product: "Highcharts",
version: "8.0.0",
deg2rad: 2 * Math.PI / 360,
doc: e,
hasBidiBug: q,
hasTouch: !!c.TouchEvent,
isMS: G,
isWebKit: -1 !== F.indexOf("AppleWebKit"),
isFirefox: H,
isChrome: v,
isSafari: !v && -1 !== F.indexOf("Safari"),
isTouchDevice: /(Mobile|Android|Windows Phone)/.test(F),
SVG_NS: "http://www.w3.org/2000/svg",
chartCount: 0,
seriesTypes: {},
symbolSizes: {},
svg: I,
win: c,
marginNames: ["plotTop", "marginRight", "marginBottom", "plotLeft"],
noop: function() {},
charts: [],
dateFormats: {}
}
});
M(J, "parts/Utilities.js", [J["parts/Globals.js"]], function(c) {
function e(d, a) {
return parseInt(d, a || 10)
}
function F(d) {
return "string" === typeof d
}
function I(d) {
d = Object.prototype.toString.call(d);
return "[object Array]" === d || "[object Array Iterator]" === d
}
function G(d, a) {
return !!d && "object" === typeof d && (!a ||
!I(d))
}
function H(d) {
return G(d) && "number" === typeof d.nodeType
}
function v(d) {
var a = d && d.constructor;
return !(!G(d, !0) || H(d) || !a || !a.name || "Object" === a.name)
}
function q(d) {
return "number" === typeof d && !isNaN(d) && Infinity > d && -Infinity < d
}
function C(d) {
return "undefined" !== typeof d && null !== d
}
function B(d, a, b) {
var h;
F(a) ? C(b) ? d.setAttribute(a, b) : d && d.getAttribute && ((h = d.getAttribute(a)) || "class" !== a || (h = d.getAttribute(a + "Name"))) : A(a, function(a, h) {
d.setAttribute(h, a)
});
return h
}
function u(d, a) {
var h;
d || (d = {});
for (h in a) d[h] = a[h];
return d
}
function w() {
for (var d = arguments, a = d.length, b = 0; b < a; b++) {
var l = d[b];
if ("undefined" !== typeof l && null !== l) return l
}
}
function m(d, a) {
var h = function() {};
h.prototype = new d;
u(h.prototype, a);
return h
}
function r(d, a) {
return parseFloat(d.toPrecision(a || 14))
}
function D(d, a, b, l) {
d = +d || 0;
a = +a;
var h = c.defaultOptions.lang,
k = (d.toString().split(".")[1] || "").split("e")[0].length,
g = d.toString().split("e");
if (-1 === a) a = Math.min(k, 20);
else if (!q(a)) a = 2;
else if (a && g[1] && 0 > g[1]) {
var t =
a + +g[1];
0 <= t ? (g[0] = (+g[0]).toExponential(t).split("e")[0], a = t) : (g[0] = g[0].split(".")[0] || 0, d = 20 > a ? (g[0] * Math.pow(10, g[1])).toFixed(a) : 0, g[1] = 0)
}
var x = (Math.abs(g[1] ? g[0] : d) + Math.pow(10, -Math.max(a, k) - 1)).toFixed(a);
k = String(e(x));
t = 3 < k.length ? k.length % 3 : 0;
b = w(b, h.decimalPoint);
l = w(l, h.thousandsSep);
d = (0 > d ? "-" : "") + (t ? k.substr(0, t) + l : "");
d += k.substr(t).replace(/(\d{3})(?=\d)/g, "$1" + l);
a && (d += b + x.slice(-a));
g[1] && 0 !== +d && (d += "e" + g[1]);
return d
}
function A(d, a, b) {
for (var h in d) Object.hasOwnProperty.call(d,
h) && a.call(b || d[h], d[h], h, d)
}
c.timers = [];
var f = c.charts,
b = c.doc,
a = c.win;
c.error = function(d, b, k, l) {
var h = q(d),
f = h ? "Highcharts error #" + d + ": www.highcharts.com/errors/" + d + "/" : d.toString(),
g = function() {
if (b) throw Error(f);
a.console && console.log(f)
};
if ("undefined" !== typeof l) {
var t = "";
h && (f += "?");
c.objectEach(l, function(d, a) {
t += "\n" + a + ": " + d;
h && (f += encodeURI(a) + "=" + encodeURI(d))
});
f += t
}
k ? c.fireEvent(k, "displayError", {
code: d,
message: f,
params: l
}, g) : g()
};
c.Fx = function(d, a, b) {
this.options = a;
this.elem = d;
this.prop =
b
};
c.Fx.prototype = {
dSetter: function() {
var d = this.paths[0],
a = this.paths[1],
b = [],
l = this.now,
f = d.length;
if (1 === l) b = this.toD;
else if (f === a.length && 1 > l)
for (; f--;) {
var p = parseFloat(d[f]);
b[f] = isNaN(p) || "A" === a[f - 4] || "A" === a[f - 5] ? a[f] : l * parseFloat("" + (a[f] - p)) + p
} else b = a;
this.elem.attr("d", b, null, !0)
},
update: function() {
var d = this.elem,
a = this.prop,
b = this.now,
l = this.options.step;
if (this[a + "Setter"]) this[a + "Setter"]();
else d.attr ? d.element && d.attr(a, b, null, !0) : d.style[a] = b + this.unit;
l && l.call(d, b, this)
},
run: function(d,
b, k) {
var h = this,
f = h.options,
p = function(d) {
return p.stopped ? !1 : h.step(d)
},
g = a.requestAnimationFrame || function(d) {
setTimeout(d, 13)
},
t = function() {
for (var d = 0; d < c.timers.length; d++) c.timers[d]() || c.timers.splice(d--, 1);
c.timers.length && g(t)
};
d !== b || this.elem["forceAnimate:" + this.prop] ? (this.startTime = +new Date, this.start = d, this.end = b, this.unit = k, this.now = this.start, this.pos = 0, p.elem = this.elem, p.prop = this.prop, p() && 1 === c.timers.push(p) && g(t)) : (delete f.curAnim[this.prop], f.complete && 0 === Object.keys(f.curAnim).length &&
f.complete.call(this.elem))
},
step: function(d) {
var a = +new Date,
b = this.options,
l = this.elem,
f = b.complete,
p = b.duration,
g = b.curAnim;
if (l.attr && !l.element) d = !1;
else if (d || a >= p + this.startTime) {
this.now = this.end;
this.pos = 1;
this.update();
var t = g[this.prop] = !0;
A(g, function(d) {
!0 !== d && (t = !1)
});
t && f && f.call(l);
d = !1
} else this.pos = b.easing((a - this.startTime) / p), this.now = this.start + (this.end - this.start) * this.pos, this.update(), d = !0;
return d
},
initPath: function(d, a, b) {
function h(d) {
for (n = d.length; n--;) {
var a = "M" ===
d[n] || "L" === d[n];
var b = /[a-zA-Z]/.test(d[n + 3]);
a && b && d.splice(n + 1, 0, d[n + 1], d[n + 2], d[n + 1], d[n + 2])
}
}
function f(d, a) {
for (; d.length < r;) {
d[0] = a[r - d.length];
var b = d.slice(0, c);
[].splice.apply(d, [0, 0].concat(b));
z && (b = d.slice(d.length - c), [].splice.apply(d, [d.length, 0].concat(b)), n--)
}
d[0] = "M"
}
function k(d, a) {
for (var b = (r - d.length) / c; 0 < b && b--;) E = d.slice().splice(d.length / N - c, c * N), E[0] = a[r - c - b * c], x && (E[c - 6] = E[c - 2], E[c - 5] = E[c - 1]), [].splice.apply(d, [d.length / N, 0].concat(E)), z && b--
}
a = a || "";
var g = d.startX,
t = d.endX,
x = -1 < a.indexOf("C"),
c = x ? 7 : 3,
E, n;
a = a.split(" ");
b = b.slice();
var z = d.isArea,
N = z ? 2 : 1;
x && (h(a), h(b));
if (g && t) {
for (n = 0; n < g.length; n++)
if (g[n] === t[0]) {
var O = n;
break
} else if (g[0] === t[t.length - g.length + n]) {
O = n;
var A = !0;
break
} else if (g[g.length - 1] === t[t.length - g.length + n]) {
O = g.length - n;
break
}
"undefined" === typeof O && (a = [])
}
if (a.length && q(O)) {
var r = b.length + O * N * c;
A ? (f(a, b), k(b, a)) : (f(b, a), k(a, b))
}
return [a, b]
},
fillSetter: function() {
c.Fx.prototype.strokeSetter.apply(this, arguments)
},
strokeSetter: function() {
this.elem.attr(this.prop,
c.color(this.start).tweenTo(c.color(this.end), this.pos), null, !0)
}
};
c.merge = function() {
var d, a = arguments,
b = {},
l = function(d, a) {
"object" !== typeof d && (d = {});
A(a, function(b, h) {
!G(b, !0) || v(b) || H(b) ? d[h] = a[h] : d[h] = l(d[h] || {}, b)
});
return d
};
!0 === a[0] && (b = a[1], a = Array.prototype.slice.call(a, 2));
var f = a.length;
for (d = 0; d < f; d++) b = l(b, a[d]);
return b
};
c.clearTimeout = function(d) {
C(d) && clearTimeout(d)
};
c.css = function(d, a) {
c.isMS && !c.svg && a && "undefined" !== typeof a.opacity && (a.filter = "alpha(opacity=" + 100 * a.opacity +
")");
u(d.style, a)
};
c.createElement = function(d, a, f, l, y) {
d = b.createElement(d);
var h = c.css;
a && u(d, a);
y && h(d, {
padding: "0",
border: "none",
margin: "0"
});
f && h(d, f);
l && l.appendChild(d);
return d
};
c.datePropsToTimestamps = function(d) {
A(d, function(a, b) {
G(a) && "function" === typeof a.getTime ? d[b] = a.getTime() : (G(a) || I(a)) && c.datePropsToTimestamps(a)
})
};
c.formatSingle = function(d, a, b) {
var h = /\.([0-9])/,
f = c.defaultOptions.lang,
k = b && b.time || c.time;
b = b && b.numberFormatter || D;
/f$/.test(d) ? (h = (h = d.match(h)) ? h[1] : -1, null !==
a && (a = b(a, h, f.decimalPoint, -1 < d.indexOf(",") ? f.thousandsSep : ""))) : a = k.dateFormat(d, a);
return a
};
c.format = function(d, a, b) {
for (var h = "{", f = !1, k, g, t, x, L = [], E; d;) {
h = d.indexOf(h);
if (-1 === h) break;
k = d.slice(0, h);
if (f) {
k = k.split(":");
g = k.shift().split(".");
x = g.length;
E = a;
for (t = 0; t < x; t++) E && (E = E[g[t]]);
k.length && (E = c.formatSingle(k.join(":"), E, b));
L.push(E)
} else L.push(k);
d = d.slice(h + 1);
h = (f = !f) ? "}" : "{"
}
L.push(d);
return L.join("")
};
c.getMagnitude = function(d) {
return Math.pow(10, Math.floor(Math.log(d) / Math.LN10))
};
c.normalizeTickInterval = function(d, a, b, l, f) {
var h = d;
b = w(b, 1);
var g = d / b;
a || (a = f ? [1, 1.2, 1.5, 2, 2.5, 3, 4, 5, 6, 8, 10] : [1, 2, 2.5, 5, 10], !1 === l && (1 === b ? a = a.filter(function(d) {
return 0 === d % 1
}) : .1 >= b && (a = [1 / b])));
for (l = 0; l < a.length && !(h = a[l], f && h * b >= d || !f && g <= (a[l] + (a[l + 1] || a[l])) / 2); l++);
return h = r(h * b, -Math.round(Math.log(.001) / Math.LN10))
};
c.stableSort = function(d, a) {
var b = d.length,
h, f;
for (f = 0; f < b; f++) d[f].safeI = f;
d.sort(function(d, b) {
h = a(d, b);
return 0 === h ? d.safeI - b.safeI : h
});
for (f = 0; f < b; f++) delete d[f].safeI
};
c.timeUnits = {
millisecond: 1,
second: 1E3,
minute: 6E4,
hour: 36E5,
day: 864E5,
week: 6048E5,
month: 24192E5,
year: 314496E5
};
Math.easeInOutSine = function(d) {
return -.5 * (Math.cos(Math.PI * d) - 1)
};
c.getStyle = function(d, b, f) {
if ("width" === b) return b = Math.min(d.offsetWidth, d.scrollWidth), f = d.getBoundingClientRect && d.getBoundingClientRect().width, f < b && f >= b - 1 && (b = Math.floor(f)), Math.max(0, b - c.getStyle(d, "padding-left") - c.getStyle(d, "padding-right"));
if ("height" === b) return Math.max(0, Math.min(d.offsetHeight, d.scrollHeight) -
c.getStyle(d, "padding-top") - c.getStyle(d, "padding-bottom"));
a.getComputedStyle || c.error(27, !0);
if (d = a.getComputedStyle(d, void 0)) d = d.getPropertyValue(b), w(f, "opacity" !== b) && (d = e(d));
return d
};
c.inArray = function(d, a, b) {
return a.indexOf(d, b)
};
c.find = Array.prototype.find ? function(d, a) {
return d.find(a)
} : function(d, a) {
var b, h = d.length;
for (b = 0; b < h; b++)
if (a(d[b], b)) return d[b]
};
c.keys = Object.keys;
c.stop = function(d, a) {
for (var b = c.timers.length; b--;) c.timers[b].elem !== d || a && a !== c.timers[b].prop || (c.timers[b].stopped = !0)
};
A({
map: "map",
each: "forEach",
grep: "filter",
reduce: "reduce",
some: "some"
}, function(d, a) {
c[a] = function(a) {
return Array.prototype[d].apply(a, [].slice.call(arguments, 1))
}
});
c.addEvent = function(d, a, b, f) {
void 0 === f && (f = {});
var h = d.addEventListener || c.addEventListenerPolyfill;
var l = "function" === typeof d && d.prototype ? d.prototype.protoEvents = d.prototype.protoEvents || {} : d.hcEvents = d.hcEvents || {};
c.Point && d instanceof c.Point && d.series && d.series.chart && (d.series.chart.runTrackerClick = !0);
h && h.call(d, a, b, !1);
l[a] || (l[a] = []);
l[a].push({
fn: b,
order: "number" === typeof f.order ? f.order : Infinity
});
l[a].sort(function(d, a) {
return d.order - a.order
});
return function() {
c.removeEvent(d, a, b)
}
};
c.removeEvent = function(d, a, b) {
function h(a, b) {
var g = d.removeEventListener || c.removeEventListenerPolyfill;
g && g.call(d, a, b, !1)
}
function f(b) {
var g;
if (d.nodeName) {
if (a) {
var f = {};
f[a] = !0
} else f = b;
A(f, function(d, a) {
if (b[a])
for (g = b[a].length; g--;) h(a, b[a][g].fn)
})
}
}
var k;
["protoEvents", "hcEvents"].forEach(function(g, t) {
var l = (t =
t ? d : d.prototype) && t[g];
l && (a ? (k = l[a] || [], b ? (l[a] = k.filter(function(a) {
return b !== a.fn
}), h(a, b)) : (f(l), l[a] = [])) : (f(l), t[g] = {}))
})
};
c.fireEvent = function(a, h, f, l) {
var d;
f = f || {};
if (b.createEvent && (a.dispatchEvent || a.fireEvent)) {
var k = b.createEvent("Events");
k.initEvent(h, !0, !0);
u(k, f);
a.dispatchEvent ? a.dispatchEvent(k) : a.fireEvent(h, k)
} else f.target || u(f, {
preventDefault: function() {
f.defaultPrevented = !0
},
target: a,
type: h
}),
function(b, h) {
void 0 === b && (b = []);
void 0 === h && (h = []);
var g = 0,
t = 0,
l = b.length + h.length;
for (d = 0; d < l; d++) !1 === (b[g] ? h[t] ? b[g].order <= h[t].order ? b[g++] : h[t++] : b[g++] : h[t++]).fn.call(a, f) && f.preventDefault()
}(a.protoEvents && a.protoEvents[h], a.hcEvents && a.hcEvents[h]);
l && !f.defaultPrevented && l.call(a, f)
};
c.animate = function(a, b, f) {
var d, h = "",
k, g;
if (!G(f)) {
var t = arguments;
f = {
duration: t[2],
easing: t[3],
complete: t[4]
}
}
q(f.duration) || (f.duration = 400);
f.easing = "function" === typeof f.easing ? f.easing : Math[f.easing] || Math.easeInOutSine;
f.curAnim = c.merge(b);
A(b, function(t, l) {
c.stop(a, l);
g = new c.Fx(a,
f, l);
k = null;
"d" === l ? (g.paths = g.initPath(a, a.d, b.d), g.toD = b.d, d = 0, k = 1) : a.attr ? d = a.attr(l) : (d = parseFloat(c.getStyle(a, l)) || 0, "opacity" !== l && (h = "px"));
k || (k = t);
k && k.match && k.match("px") && (k = k.replace(/px/g, ""));
g.run(d, k, h)
})
};
c.seriesType = function(a, b, f, l, y) {
var d = c.getOptions(),
g = c.seriesTypes;
d.plotOptions[a] = c.merge(d.plotOptions[b], f);
g[a] = m(g[b] || function() {}, l);
g[a].prototype.type = a;
y && (g[a].prototype.pointClass = m(c.Point, y));
return g[a]
};
c.uniqueKey = function() {
var a = Math.random().toString(36).substring(2,
9),
b = 0;
return function() {
return "highcharts-" + a + "-" + b++
}
}();
c.isFunction = function(a) {
return "function" === typeof a
};
a.jQuery && (a.jQuery.fn.highcharts = function() {
var a = [].slice.call(arguments);
if (this[0]) return a[0] ? (new(c[F(a[0]) ? a.shift() : "Chart"])(this[0], a[0], a[1]), this) : f[B(this[0], "data-highcharts-chart")]
});
return {
animObject: function(a) {
return G(a) ? c.merge(a) : {
duration: a ? 500 : 0
}
},
arrayMax: function(a) {
for (var d = a.length, b = a[0]; d--;) a[d] > b && (b = a[d]);
return b
},
arrayMin: function(a) {
for (var d = a.length,
b = a[0]; d--;) a[d] < b && (b = a[d]);
return b
},
attr: B,
clamp: function(a, b, f) {
return a > b ? a < f ? a : f : b
},
correctFloat: r,
defined: C,
destroyObjectProperties: function(a, b) {
A(a, function(d, h) {
d && d !== b && d.destroy && d.destroy();
delete a[h]
})
},
discardElement: function(a) {
var d = c.garbageBin;
d || (d = c.createElement("div"));
a && d.appendChild(a);
d.innerHTML = ""
},
erase: function(a, b) {
for (var d = a.length; d--;)
if (a[d] === b) {
a.splice(d, 1);
break
}
},
extend: u,
extendClass: m,
isArray: I,
isClass: v,
isDOMElement: H,
isNumber: q,
isObject: G,
isString: F,
numberFormat: D,
objectEach: A,
offset: function(d) {
var h = b.documentElement;
d = d.parentElement || d.parentNode ? d.getBoundingClientRect() : {
top: 0,
left: 0
};
return {
top: d.top + (a.pageYOffset || h.scrollTop) - (h.clientTop || 0),
left: d.left + (a.pageXOffset || h.scrollLeft) - (h.clientLeft || 0)
}
},
pad: function(a, b, f) {
return Array((b || 2) + 1 - String(a).replace("-", "").length).join(f || "0") + a
},
pick: w,
pInt: e,
relativeLength: function(a, b, f) {
return /%$/.test(a) ? b * parseFloat(a) / 100 + (f || 0) : parseFloat(a)
},
setAnimation: function(a, b) {
b.renderer.globalAnimation =
w(a, b.options.chart.animation, !0)
},
splat: function(a) {
return I(a) ? a : [a]
},
syncTimeout: function(a, b, f) {
if (0 < b) return setTimeout(a, b, f);
a.call(0, f);
return -1
},
wrap: function(a, b, f) {
var d = a[b];
a[b] = function() {
var a = Array.prototype.slice.call(arguments),
b = arguments,
g = this;
g.proceed = function() {
d.apply(g, arguments.length ? arguments : b)
};
a.unshift(d);
a = f.apply(this, a);
g.proceed = null;
return a
}
}
}
});
M(J, "parts/Color.js", [J["parts/Globals.js"], J["parts/Utilities.js"]], function(c, e) {
var F = e.isNumber,
I = e.pInt,
G = c.merge;
c.Color = function(e) {
if (!(this instanceof c.Color)) return new c.Color(e);
this.init(e)
};
c.Color.prototype = {
parsers: [{
regex: /rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,
parse: function(c) {
return [I(c[1]), I(c[2]), I(c[3]), parseFloat(c[4], 10)]
}
}, {
regex: /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,
parse: function(c) {
return [I(c[1]), I(c[2]), I(c[3]), 1]
}
}],
names: {
white: "#ffffff",
black: "#000000"
},
init: function(e) {
var v, q;
if ((this.input = e = this.names[e &&
e.toLowerCase ? e.toLowerCase() : ""] || e) && e.stops) this.stops = e.stops.map(function(e) {
return new c.Color(e[1])
});
else {
if (e && e.charAt && "#" === e.charAt()) {
var C = e.length;
e = parseInt(e.substr(1), 16);
7 === C ? v = [(e & 16711680) >> 16, (e & 65280) >> 8, e & 255, 1] : 4 === C && (v = [(e & 3840) >> 4 | (e & 3840) >> 8, (e & 240) >> 4 | e & 240, (e & 15) << 4 | e & 15, 1])
}
if (!v)
for (q = this.parsers.length; q-- && !v;) {
var H = this.parsers[q];
(C = H.regex.exec(e)) && (v = H.parse(C))
}
}
this.rgba = v || []
},
get: function(c) {
var e = this.input,
q = this.rgba;
if (this.stops) {
var C = G(e);
C.stops = [].concat(C.stops);
this.stops.forEach(function(e, q) {
C.stops[q] = [C.stops[q][0], e.get(c)]
})
} else C = q && F(q[0]) ? "rgb" === c || !c && 1 === q[3] ? "rgb(" + q[0] + "," + q[1] + "," + q[2] + ")" : "a" === c ? q[3] : "rgba(" + q.join(",") + ")" : e;
return C
},
brighten: function(c) {
var e, q = this.rgba;
if (this.stops) this.stops.forEach(function(e) {
e.brighten(c)
});
else if (F(c) && 0 !== c)
for (e = 0; 3 > e; e++) q[e] += I(255 * c), 0 > q[e] && (q[e] = 0), 255 < q[e] && (q[e] = 255);
return this
},
setOpacity: function(c) {
this.rgba[3] = c;
return this
},
tweenTo: function(c, e) {
var q = this.rgba,
v = c.rgba;
v.length && q && q.length ? (c = 1 !== v[3] || 1 !== q[3], e = (c ? "rgba(" : "rgb(") + Math.round(v[0] + (q[0] - v[0]) * (1 - e)) + "," + Math.round(v[1] + (q[1] - v[1]) * (1 - e)) + "," + Math.round(v[2] + (q[2] - v[2]) * (1 - e)) + (c ? "," + (v[3] + (q[3] - v[3]) * (1 - e)) : "") + ")") : e = c.input || "none";
return e
}
};
c.color = function(e) {
return new c.Color(e)
}
});
M(J, "parts/SvgRenderer.js", [J["parts/Globals.js"], J["parts/Utilities.js"]], function(c, e) {
var F = e.animObject,
I = e.attr,
G = e.defined,
H = e.destroyObjectProperties,
v = e.erase,
q = e.extend,
C = e.isArray,
B = e.isNumber,
u = e.isObject,
w = e.isString,
m = e.objectEach,
r = e.pick,
D = e.pInt,
A = e.splat,
f = c.addEvent,
b = c.animate,
a = c.charts,
d = c.color,
h = c.css,
k = c.createElement,
l = c.deg2rad,
y = c.doc,
p = c.hasTouch,
g = c.isFirefox,
t = c.isMS,
x = c.isWebKit,
L = c.merge,
E = c.noop,
n = c.removeEvent,
z = c.stop,
N = c.svg,
O = c.SVG_NS,
V = c.symbolSizes,
T = c.win;
var P = c.SVGElement = function() {
return this
};
q(P.prototype, {
opacity: 1,
SVG_NS: O,
textProps: "direction fontSize fontWeight fontFamily fontStyle color lineHeight width textAlign textDecoration textOverflow textOutline cursor".split(" "),
init: function(a, b) {
this.element = "span" === b ? k(b) : y.createElementNS(this.SVG_NS, b);
this.renderer = a;
c.fireEvent(this, "afterInit")
},
animate: function(a, d, n) {
var K = F(r(d, this.renderer.globalAnimation, !0));
r(y.hidden, y.msHidden, y.webkitHidden, !1) && (K.duration = 0);
0 !== K.duration ? (n && (K.complete = n), b(this, a, K)) : (this.attr(a, void 0, n), m(a, function(a, b) {
K.step && K.step.call(this, a, {
prop: b,
pos: 1
})
}, this));
return this
},
complexColor: function(a, b, d) {
var n = this.renderer,
K, Q, g, z, f, h, t, l, R, x, k, N = [],
p;
c.fireEvent(this.renderer,
"complexColor", {
args: arguments
},
function() {
a.radialGradient ? Q = "radialGradient" : a.linearGradient && (Q = "linearGradient");
Q && (g = a[Q], f = n.gradients, t = a.stops, x = d.radialReference, C(g) && (a[Q] = g = {
x1: g[0],
y1: g[1],
x2: g[2],
y2: g[3],
gradientUnits: "userSpaceOnUse"
}), "radialGradient" === Q && x && !G(g.gradientUnits) && (z = g, g = L(g, n.getRadialAttr(x, z), {
gradientUnits: "userSpaceOnUse"
})), m(g, function(a, b) {
"id" !== b && N.push(b, a)
}), m(t, function(a) {
N.push(a)
}), N = N.join(","), f[N] ? k = f[N].attr("id") : (g.id = k = c.uniqueKey(), f[N] = h =
n.createElement(Q).attr(g).add(n.defs), h.radAttr = z, h.stops = [], t.forEach(function(a) {
0 === a[1].indexOf("rgba") ? (K = c.color(a[1]), l = K.get("rgb"), R = K.get("a")) : (l = a[1], R = 1);
a = n.createElement("stop").attr({
offset: a[0],
"stop-color": l,
"stop-opacity": R
}).add(h);
h.stops.push(a)
})), p = "url(" + n.url + "#" + k + ")", d.setAttribute(b, p), d.gradient = N, a.toString = function() {
return p
})
})
},
applyTextOutline: function(a) {
var b = this.element,
d; - 1 !== a.indexOf("contrast") && (a = a.replace(/contrast/g, this.renderer.getContrast(b.style.fill)));
a = a.split(" ");
var n = a[a.length - 1];
if ((d = a[0]) && "none" !== d && c.svg) {
this.fakeTS = !0;
a = [].slice.call(b.getElementsByTagName("tspan"));
this.ySetter = this.xSetter;
d = d.replace(/(^[\d\.]+)(.*?)$/g, function(a, b, d) {
return 2 * b + d
});
this.removeTextOutline(a);
var g = b.firstChild;
a.forEach(function(a, K) {
0 === K && (a.setAttribute("x", b.getAttribute("x")), K = b.getAttribute("y"), a.setAttribute("y", K || 0), null === K && b.setAttribute("y", 0));
a = a.cloneNode(1);
I(a, {
"class": "highcharts-text-outline",
fill: n,
stroke: n,
"stroke-width": d,
"stroke-linejoin": "round"
});
b.insertBefore(a, g)
})
}
},
removeTextOutline: function(a) {
for (var b = a.length, d; b--;) d = a[b], "highcharts-text-outline" === d.getAttribute("class") && v(a, this.element.removeChild(d))
},
symbolCustomAttribs: "x y width height r start end innerR anchorX anchorY rounded".split(" "),
attr: function(a, b, d, n) {
var g = this.element,
K, Q = this,
f, h, t = this.symbolCustomAttribs;
if ("string" === typeof a && "undefined" !== typeof b) {
var l = a;
a = {};
a[l] = b
}
"string" === typeof a ? Q = (this[a + "Getter"] || this._defaultGetter).call(this,
a, g) : (m(a, function(b, d) {
f = !1;
n || z(this, d);
this.symbolName && -1 !== c.inArray(d, t) && (K || (this.symbolAttr(a), K = !0), f = !0);
!this.rotation || "x" !== d && "y" !== d || (this.doTransform = !0);
f || (h = this[d + "Setter"] || this._defaultSetter, h.call(this, b, d, g), !this.styledMode && this.shadows && /^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(d) && this.updateShadows(d, b, h))
}, this), this.afterSetters());
d && d.call(this);
return Q
},
afterSetters: function() {
this.doTransform && (this.updateTransform(), this.doTransform = !1)
},
updateShadows: function(a,
b, d) {
for (var n = this.shadows, g = n.length; g--;) d.call(n[g], "height" === a ? Math.max(b - (n[g].cutHeight || 0), 0) : "d" === a ? this.d : b, a, n[g])
},
addClass: function(a, b) {
var d = b ? "" : this.attr("class") || "";
a = (a || "").split(/ /g).reduce(function(a, b) {
-1 === d.indexOf(b) && a.push(b);
return a
}, d ? [d] : []).join(" ");
a !== d && this.attr("class", a);
return this
},
hasClass: function(a) {
return -1 !== (this.attr("class") || "").split(" ").indexOf(a)
},
removeClass: function(a) {
return this.attr("class", (this.attr("class") || "").replace(w(a) ? new RegExp(" ?" +
a + " ?") : a, ""))
},
symbolAttr: function(a) {
var b = this;
"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach(function(d) {
b[d] = r(a[d], b[d])
});
b.attr({
d: b.renderer.symbols[b.symbolName](b.x, b.y, b.width, b.height, b)
})
},
clip: function(a) {
return this.attr("clip-path", a ? "url(" + this.renderer.url + "#" + a.id + ")" : "none")
},
crisp: function(a, b) {
b = b || a.strokeWidth || 0;
var d = Math.round(b) % 2 / 2;
a.x = Math.floor(a.x || this.x || 0) + d;
a.y = Math.floor(a.y || this.y || 0) + d;
a.width = Math.floor((a.width || this.width ||
0) - 2 * d);
a.height = Math.floor((a.height || this.height || 0) - 2 * d);
G(a.strokeWidth) && (a.strokeWidth = b);
return a
},
css: function(a) {
var b = this.styles,
d = {},
n = this.element,
g = "",
z = !b,
f = ["textOutline", "textOverflow", "width"];
a && a.color && (a.fill = a.color);
b && m(a, function(a, n) {
a !== b[n] && (d[n] = a, z = !0)
});
if (z) {
b && (a = q(b, d));
if (a)
if (null === a.width || "auto" === a.width) delete this.textWidth;
else if ("text" === n.nodeName.toLowerCase() && a.width) var Q = this.textWidth = D(a.width);
this.styles = a;
Q && !N && this.renderer.forExport && delete a.width;
if (n.namespaceURI === this.SVG_NS) {
var t = function(a, b) {
return "-" + b.toLowerCase()
};
m(a, function(a, b) {
-1 === f.indexOf(b) && (g += b.replace(/([A-Z])/g, t) + ":" + a + ";")
});
g && I(n, "style", g)
} else h(n, a);
this.added && ("text" === this.element.nodeName && this.renderer.buildText(this), a && a.textOutline && this.applyTextOutline(a.textOutline))
}
return this
},
getStyle: function(a) {
return T.getComputedStyle(this.element || this, "").getPropertyValue(a)
},
strokeWidth: function() {
if (!this.renderer.styledMode) return this["stroke-width"] ||
0;
var a = this.getStyle("stroke-width"),
b = 0;
if (a.indexOf("px") === a.length - 2) b = D(a);
else if ("" !== a) {
var d = y.createElementNS(O, "rect");
I(d, {
width: a,
"stroke-width": 0
});
this.element.parentNode.appendChild(d);
b = d.getBBox().width;
d.parentNode.removeChild(d)
}
return b
},
on: function(a, b) {
var d = this,
n = d.element;
p && "click" === a ? (n.ontouchstart = function(a) {
d.touchEventFired = Date.now();
a.preventDefault();
b.call(n, a)
}, n.onclick = function(a) {
(-1 === T.navigator.userAgent.indexOf("Android") || 1100 < Date.now() - (d.touchEventFired ||
0)) && b.call(n, a)
}) : n["on" + a] = b;
return this
},
setRadialReference: function(a) {
var b = this.renderer.gradients[this.element.gradient];
this.element.radialReference = a;
b && b.radAttr && b.animate(this.renderer.getRadialAttr(a, b.radAttr));
return this
},
translate: function(a, b) {
return this.attr({
translateX: a,
translateY: b
})
},
invert: function(a) {
this.inverted = a;
this.updateTransform();
return this
},
updateTransform: function() {
var a = this.translateX || 0,
b = this.translateY || 0,
d = this.scaleX,
n = this.scaleY,
g = this.inverted,
z = this.rotation,
f = this.matrix,
h = this.element;
g && (a += this.width, b += this.height);
a = ["translate(" + a + "," + b + ")"];
G(f) && a.push("matrix(" + f.join(",") + ")");
g ? a.push("rotate(90) scale(-1,1)") : z && a.push("rotate(" + z + " " + r(this.rotationOriginX, h.getAttribute("x"), 0) + " " + r(this.rotationOriginY, h.getAttribute("y") || 0) + ")");
(G(d) || G(n)) && a.push("scale(" + r(d, 1) + " " + r(n, 1) + ")");
a.length && h.setAttribute("transform", a.join(" "))
},
toFront: function() {
var a = this.element;
a.parentNode.appendChild(a);
return this
},
align: function(a, b, d) {
var n,
g = {};
var z = this.renderer;
var f = z.alignedObjects;
var K, h;
if (a) {
if (this.alignOptions = a, this.alignByTranslate = b, !d || w(d)) this.alignTo = n = d || "renderer", v(f, this), f.push(this), d = null
} else a = this.alignOptions, b = this.alignByTranslate, n = this.alignTo;
d = r(d, z[n], z);
n = a.align;
z = a.verticalAlign;
f = (d.x || 0) + (a.x || 0);
var t = (d.y || 0) + (a.y || 0);
"right" === n ? K = 1 : "center" === n && (K = 2);
K && (f += (d.width - (a.width || 0)) / K);
g[b ? "translateX" : "x"] = Math.round(f);
"bottom" === z ? h = 1 : "middle" === z && (h = 2);
h && (t += (d.height - (a.height || 0)) /
h);
g[b ? "translateY" : "y"] = Math.round(t);
this[this.placed ? "animate" : "attr"](g);
this.placed = !0;
this.alignAttr = g;
return this
},
getBBox: function(a, b) {
var d, n = this.renderer,
g = this.element,
z = this.styles,
f = this.textStr,
K, h = n.cache,
t = n.cacheKeys,
Q = g.namespaceURI === this.SVG_NS;
b = r(b, this.rotation, 0);
var x = n.styledMode ? g && P.prototype.getStyle.call(g, "font-size") : z && z.fontSize;
if (G(f)) {
var c = f.toString(); - 1 === c.indexOf("<") && (c = c.replace(/[0-9]/g, "0"));
c += ["", b, x, this.textWidth, z && z.textOverflow].join()
}
c && !a &&
(d = h[c]);
if (!d) {
if (Q || n.forExport) {
try {
(K = this.fakeTS && function(a) {
[].forEach.call(g.querySelectorAll(".highcharts-text-outline"), function(b) {
b.style.display = a
})
}) && K("none"), d = g.getBBox ? q({}, g.getBBox()) : {
width: g.offsetWidth,
height: g.offsetHeight
}, K && K("")
} catch (ca) {
""
}
if (!d || 0 > d.width) d = {
width: 0,
height: 0
}
} else d = this.htmlGetBBox();
n.isSVG && (a = d.width, n = d.height, Q && (d.height = n = {
"11px,17": 14,
"13px,20": 16
}[z && z.fontSize + "," + Math.round(n)] || n), b && (z = b * l, d.width = Math.abs(n * Math.sin(z)) + Math.abs(a * Math.cos(z)),
d.height = Math.abs(n * Math.cos(z)) + Math.abs(a * Math.sin(z))));
if (c && 0 < d.height) {
for (; 250 < t.length;) delete h[t.shift()];
h[c] || t.push(c);
h[c] = d
}
}
return d
},
show: function(a) {
return this.attr({
visibility: a ? "inherit" : "visible"
})
},
hide: function(a) {
a ? this.attr({
y: -9999
}) : this.attr({
visibility: "hidden"
});
return this
},
fadeOut: function(a) {
var b = this;
b.animate({
opacity: 0
}, {
duration: a || 150,
complete: function() {
b.attr({
y: -9999
})
}
})
},
add: function(a) {
var b = this.renderer,
d = this.element;
a && (this.parentGroup = a);
this.parentInverted =
a && a.inverted;
"undefined" !== typeof this.textStr && b.buildText(this);
this.added = !0;
if (!a || a.handleZ || this.zIndex) var n = this.zIndexSetter();
n || (a ? a.element : b.box).appendChild(d);
if (this.onAdd) this.onAdd();
return this
},
safeRemoveChild: function(a) {
var b = a.parentNode;
b && b.removeChild(a)
},
destroy: function() {
var a = this,
b = a.element || {},
d = a.renderer,
n = d.isSVG && "SPAN" === b.nodeName && a.parentGroup,
g = b.ownerSVGElement,
f = a.clipPath;
b.onclick = b.onmouseout = b.onmouseover = b.onmousemove = b.point = null;
z(a);
f && g && ([].forEach.call(g.querySelectorAll("[clip-path],[CLIP-PATH]"),
function(a) {
-1 < a.getAttribute("clip-path").indexOf(f.element.id) && a.removeAttribute("clip-path")
}), a.clipPath = f.destroy());
if (a.stops) {
for (g = 0; g < a.stops.length; g++) a.stops[g] = a.stops[g].destroy();
a.stops = null
}
a.safeRemoveChild(b);
for (d.styledMode || a.destroyShadows(); n && n.div && 0 === n.div.childNodes.length;) b = n.parentGroup, a.safeRemoveChild(n.div), delete n.div, n = b;
a.alignTo && v(d.alignedObjects, a);
m(a, function(b, d) {
a[d] && a[d].parentGroup === a && a[d].destroy && a[d].destroy();
delete a[d]
})
},
shadow: function(a,
b, d) {
var n = [],
g, z = this.element;
if (!a) this.destroyShadows();
else if (!this.shadows) {
var f = r(a.width, 3);
var h = (a.opacity || .15) / f;
var K = this.parentInverted ? "(-1,-1)" : "(" + r(a.offsetX, 1) + ", " + r(a.offsetY, 1) + ")";
for (g = 1; g <= f; g++) {
var t = z.cloneNode(0);
var l = 2 * f + 1 - 2 * g;
I(t, {
stroke: a.color || "#000000",
"stroke-opacity": h * g,
"stroke-width": l,
transform: "translate" + K,
fill: "none"
});
t.setAttribute("class", (t.getAttribute("class") || "") + " highcharts-shadow");
d && (I(t, "height", Math.max(I(t, "height") - l, 0)), t.cutHeight = l);
b ? b.element.appendChild(t) : z.parentNode && z.parentNode.insertBefore(t, z);
n.push(t)
}
this.shadows = n
}
return this
},
destroyShadows: function() {
(this.shadows || []).forEach(function(a) {
this.safeRemoveChild(a)
}, this);
this.shadows = void 0
},
xGetter: function(a) {
"circle" === this.element.nodeName && ("x" === a ? a = "cx" : "y" === a && (a = "cy"));
return this._defaultGetter(a)
},
_defaultGetter: function(a) {
a = r(this[a + "Value"], this[a], this.element ? this.element.getAttribute(a) : null, 0);
/^[\-0-9\.]+$/.test(a) && (a = parseFloat(a));
return a
},
dSetter: function(a, b, d) {
a && a.join && (a = a.join(" "));
/(NaN| {2}|^$)/.test(a) && (a = "M 0 0");
this[b] !== a && (d.setAttribute(b, a), this[b] = a)
},
dashstyleSetter: function(a) {
var b, d = this["stroke-width"];
"inherit" === d && (d = 1);
if (a = a && a.toLowerCase()) {
a = a.replace("shortdashdotdot", "3,1,1,1,1,1,").replace("shortdashdot", "3,1,1,1").replace("shortdot", "1,1,").replace("shortdash", "3,1,").replace("longdash", "8,3,").replace(/dot/g, "1,3,").replace("dash", "4,3,").replace(/,$/, "").split(",");
for (b = a.length; b--;) a[b] = D(a[b]) *
d;
a = a.join(",").replace(/NaN/g, "none");
this.element.setAttribute("stroke-dasharray", a)
}
},
alignSetter: function(a) {
var b = {
left: "start",
center: "middle",
right: "end"
};
b[a] && (this.alignValue = a, this.element.setAttribute("text-anchor", b[a]))
},
opacitySetter: function(a, b, d) {
this[b] = a;
d.setAttribute(b, a)
},
titleSetter: function(a) {
var b = this.element.getElementsByTagName("title")[0];
b || (b = y.createElementNS(this.SVG_NS, "title"), this.element.appendChild(b));
b.firstChild && b.removeChild(b.firstChild);
b.appendChild(y.createTextNode(String(r(a,
"")).replace(/<[^>]*>/g, "").replace(/&lt;/g, "<").replace(/&gt;/g, ">")))
},
textSetter: function(a) {
a !== this.textStr && (delete this.bBox, delete this.textPxLength, this.textStr = a, this.added && this.renderer.buildText(this))
},
setTextPath: function(a, b) {
var d = this.element,
n = {
textAnchor: "text-anchor"
},
g = !1,
z = this.textPathWrapper,
f = !z;
b = L(!0, {
enabled: !0,
attributes: {
dy: -5,
startOffset: "50%",
textAnchor: "middle"
}
}, b);
var h = b.attributes;
if (a && b && b.enabled) {
z && null === z.element.parentNode ? (f = !0, z = z.destroy()) : z && this.removeTextOutline.call(z.parentGroup, [].slice.call(d.getElementsByTagName("tspan")));
this.options && this.options.padding && (h.dx = -this.options.padding);
z || (this.textPathWrapper = z = this.renderer.createElement("textPath"), g = !0);
var t = z.element;
(b = a.element.getAttribute("id")) || a.element.setAttribute("id", b = c.uniqueKey());
if (f)
for (a = d.getElementsByTagName("tspan"); a.length;) a[0].setAttribute("y", 0), B(h.dx) && a[0].setAttribute("x", -h.dx), t.appendChild(a[0]);
g && z.add({
element: this.text ? this.text.element : d
});
t.setAttributeNS("http://www.w3.org/1999/xlink",
"href", this.renderer.url + "#" + b);
G(h.dy) && (t.parentNode.setAttribute("dy", h.dy), delete h.dy);
G(h.dx) && (t.parentNode.setAttribute("dx", h.dx), delete h.dx);
m(h, function(a, b) {
t.setAttribute(n[b] || b, a)
});
d.removeAttribute("transform");
this.removeTextOutline.call(z, [].slice.call(d.getElementsByTagName("tspan")));
this.text && !this.renderer.styledMode && this.attr({
fill: "none",
"stroke-width": 0
});
this.applyTextOutline = this.updateTransform = E
} else z && (delete this.updateTransform, delete this.applyTextOutline, this.destroyTextPath(d,
a), this.updateTransform(), this.options.rotation && this.applyTextOutline(this.options.style.textOutline));
return this
},
destroyTextPath: function(a, b) {
var d = a.getElementsByTagName("text")[0];
if (d) {
if (d.removeAttribute("dx"), d.removeAttribute("dy"), b.element.setAttribute("id", ""), d.getElementsByTagName("textPath").length) {
for (a = this.textPathWrapper.element.childNodes; a.length;) d.appendChild(a[0]);
d.removeChild(this.textPathWrapper.element)
}
} else if (a.getAttribute("dx") || a.getAttribute("dy")) a.removeAttribute("dx"),
a.removeAttribute("dy");
this.textPathWrapper = this.textPathWrapper.destroy()
},
fillSetter: function(a, b, d) {
"string" === typeof a ? d.setAttribute(b, a) : a && this.complexColor(a, b, d)
},
visibilitySetter: function(a, b, d) {
"inherit" === a ? d.removeAttribute(b) : this[b] !== a && d.setAttribute(b, a);
this[b] = a
},
zIndexSetter: function(a, b) {
var d = this.renderer,
n = this.parentGroup,
g = (n || d).element || d.box,
z = this.element,
f = !1;
d = g === d.box;
var h = this.added;
var t;
G(a) ? (z.setAttribute("data-z-index", a), a = +a, this[b] === a && (h = !1)) : G(this[b]) &&
z.removeAttribute("data-z-index");
this[b] = a;
if (h) {
(a = this.zIndex) && n && (n.handleZ = !0);
b = g.childNodes;
for (t = b.length - 1; 0 <= t && !f; t--) {
n = b[t];
h = n.getAttribute("data-z-index");
var l = !G(h);
if (n !== z)
if (0 > a && l && !d && !t) g.insertBefore(z, b[t]), f = !0;
else if (D(h) <= a || l && (!G(a) || 0 <= a)) g.insertBefore(z, b[t + 1] || null), f = !0
}
f || (g.insertBefore(z, b[d ? 3 : 0] || null), f = !0)
}
return f
},
_defaultSetter: function(a, b, d) {
d.setAttribute(b, a)
}
});
P.prototype.yGetter = P.prototype.xGetter;
P.prototype.translateXSetter = P.prototype.translateYSetter =
P.prototype.rotationSetter = P.prototype.verticalAlignSetter = P.prototype.rotationOriginXSetter = P.prototype.rotationOriginYSetter = P.prototype.scaleXSetter = P.prototype.scaleYSetter = P.prototype.matrixSetter = function(a, b) {
this[b] = a;
this.doTransform = !0
};
P.prototype["stroke-widthSetter"] = P.prototype.strokeSetter = function(a, b, d) {
this[b] = a;
this.stroke && this["stroke-width"] ? (P.prototype.fillSetter.call(this, this.stroke, "stroke", d), d.setAttribute("stroke-width", this["stroke-width"]), this.hasStroke = !0) : "stroke-width" ===
b && 0 === a && this.hasStroke ? (d.removeAttribute("stroke"), this.hasStroke = !1) : this.renderer.styledMode && this["stroke-width"] && (d.setAttribute("stroke-width", this["stroke-width"]), this.hasStroke = !0)
};
e = c.SVGRenderer = function() {
this.init.apply(this, arguments)
};
q(e.prototype, {
Element: P,
SVG_NS: O,
init: function(a, b, d, n, z, t, l) {
var K = this.createElement("svg").attr({
version: "1.1",
"class": "highcharts-root"
});
l || K.css(this.getStyle(n));
n = K.element;
a.appendChild(n);
I(a, "dir", "ltr"); - 1 === a.innerHTML.indexOf("xmlns") &&
I(n, "xmlns", this.SVG_NS);
this.isSVG = !0;
this.box = n;
this.boxWrapper = K;
this.alignedObjects = [];
this.url = (g || x) && y.getElementsByTagName("base").length ? T.location.href.split("#")[0].replace(/<[^>]*>/g, "").replace(/([\('\)])/g, "\\$1").replace(/ /g, "%20") : "";
this.createElement("desc").add().element.appendChild(y.createTextNode("Created with Highcharts 8.0.0"));
this.defs = this.createElement("defs").add();
this.allowHTML = t;
this.forExport = z;
this.styledMode = l;
this.gradients = {};
this.cache = {};
this.cacheKeys = [];
this.imgCount =
0;
this.setSize(b, d, !1);
var c;
g && a.getBoundingClientRect && (b = function() {
h(a, {
left: 0,
top: 0
});
c = a.getBoundingClientRect();
h(a, {
left: Math.ceil(c.left) - c.left + "px",
top: Math.ceil(c.top) - c.top + "px"
})
}, b(), this.unSubPixelFix = f(T, "resize", b))
},
definition: function(a) {
function b(a, n) {
var g;
A(a).forEach(function(a) {
var z = d.createElement(a.tagName),
f = {};
m(a, function(a, b) {
"tagName" !== b && "children" !== b && "textContent" !== b && (f[b] = a)
});
z.attr(f);
z.add(n || d.defs);
a.textContent && z.element.appendChild(y.createTextNode(a.textContent));
b(a.children || [], z);
g = z
});
return g
}
var d = this;
return b(a)
},
getStyle: function(a) {
return this.style = q({
fontFamily: '"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',
fontSize: "12px"
}, a)
},
setStyle: function(a) {
this.boxWrapper.css(this.getStyle(a))
},
isHidden: function() {
return !this.boxWrapper.getBBox().width
},
destroy: function() {
var a = this.defs;
this.box = null;
this.boxWrapper = this.boxWrapper.destroy();
H(this.gradients || {});
this.gradients = null;
a && (this.defs = a.destroy());
this.unSubPixelFix &&
this.unSubPixelFix();
return this.alignedObjects = null
},
createElement: function(a) {
var b = new this.Element;
b.init(this, a);
return b
},
draw: E,
getRadialAttr: function(a, b) {
return {
cx: a[0] - a[2] / 2 + b.cx * a[2],
cy: a[1] - a[2] / 2 + b.cy * a[2],
r: b.r * a[2]
}
},
truncate: function(a, b, d, n, g, z, f) {
var h = this,
t = a.rotation,
l, K = n ? 1 : 0,
x = (d || n).length,
c = x,
k = [],
N = function(a) {
b.firstChild && b.removeChild(b.firstChild);
a && b.appendChild(y.createTextNode(a))
},
p = function(z, t) {
t = t || z;
if ("undefined" === typeof k[t])
if (b.getSubStringLength) try {
k[t] =
g + b.getSubStringLength(0, n ? t + 1 : t)
} catch (ea) {
""
} else h.getSpanWidth && (N(f(d || n, z)), k[t] = g + h.getSpanWidth(a, b));
return k[t]
},
R;
a.rotation = 0;
var O = p(b.textContent.length);
if (R = g + O > z) {
for (; K <= x;) c = Math.ceil((K + x) / 2), n && (l = f(n, c)), O = p(c, l && l.length - 1), K === x ? K = x + 1 : O > z ? x = c - 1 : K = c;
0 === x ? N("") : d && x === d.length - 1 || N(l || f(d || n, c))
}
n && n.splice(0, c);
a.actualWidth = O;
a.rotation = t;
return R
},
escapes: {
"&": "&amp;",
"<": "&lt;",
">": "&gt;",
"'": "&#39;",
'"': "&quot;"
},
buildText: function(a) {
var b = a.element,
d = this,
n = d.forExport,
g = r(a.textStr, "").toString(),
z = -1 !== g.indexOf("<"),
f = b.childNodes,
t, l = I(b, "x"),
x = a.styles,
c = a.textWidth,
k = x && x.lineHeight,
p = x && x.textOutline,
L = x && "ellipsis" === x.textOverflow,
E = x && "nowrap" === x.whiteSpace,
A = x && x.fontSize,
Q, e = f.length;
x = c && !a.added && this.box;
var V = function(a) {
var n;
d.styledMode || (n = /(px|em)$/.test(a && a.style.fontSize) ? a.style.fontSize : A || d.style.fontSize || 12);
return k ? D(k) : d.fontMetrics(n, a.getAttribute("style") ? a : b).h
},
q = function(a, b) {
m(d.escapes, function(d, n) {
b && -1 !== b.indexOf(d) ||
(a = a.toString().replace(new RegExp(d, "g"), n))
});
return a
},
P = function(a, b) {
var d = a.indexOf("<");
a = a.substring(d, a.indexOf(">") - d);
d = a.indexOf(b + "=");
if (-1 !== d && (d = d + b.length + 1, b = a.charAt(d), '"' === b || "'" === b)) return a = a.substring(d + 1), a.substring(0, a.indexOf(b))
},
T = /<br.*?>/g;
var u = [g, L, E, k, p, A, c].join();
if (u !== a.textCache) {
for (a.textCache = u; e--;) b.removeChild(f[e]);
z || p || L || c || -1 !== g.indexOf(" ") && (!E || T.test(g)) ? (x && x.appendChild(b), z ? (g = d.styledMode ? g.replace(/<(b|strong)>/g, '<span class="highcharts-strong">').replace(/<(i|em)>/g,
'<span class="highcharts-emphasized">') : g.replace(/<(b|strong)>/g, '<span style="font-weight:bold">').replace(/<(i|em)>/g, '<span style="font-style:italic">'), g = g.replace(/<a/g, "<span").replace(/<\/(b|strong|i|em|a)>/g, "</span>").split(T)) : g = [g], g = g.filter(function(a) {
return "" !== a
}), g.forEach(function(g, z) {
var f = 0,
x = 0;
g = g.replace(/^\s+|\s+$/g, "").replace(/<span/g, "|||<span").replace(/<\/span>/g, "</span>|||");
var K = g.split("|||");
K.forEach(function(g) {
if ("" !== g || 1 === K.length) {
var k = {},
p = y.createElementNS(d.SVG_NS,
"tspan"),
R, r;
(R = P(g, "class")) && I(p, "class", R);
if (R = P(g, "style")) R = R.replace(/(;| |^)color([ :])/, "$1fill$2"), I(p, "style", R);
(r = P(g, "href")) && !n && (I(p, "onclick", 'location.href="' + r + '"'), I(p, "class", "highcharts-anchor"), d.styledMode || h(p, {
cursor: "pointer"
}));
g = q(g.replace(/<[a-zA-Z\/](.|\n)*?>/g, "") || " ");
if (" " !== g) {
p.appendChild(y.createTextNode(g));
f ? k.dx = 0 : z && null !== l && (k.x = l);
I(p, k);
b.appendChild(p);
!f && Q && (!N && n && h(p, {
display: "block"
}), I(p, "dy", V(p)));
if (c) {
var m = g.replace(/([^\^])-/g, "$1- ").split(" ");
k = !E && (1 < K.length || z || 1 < m.length);
r = 0;
var e = V(p);
if (L) t = d.truncate(a, p, g, void 0, 0, Math.max(0, c - parseInt(A || 12, 10)), function(a, b) {
return a.substring(0, b) + "\u2026"
});
else if (k)
for (; m.length;) m.length && !E && 0 < r && (p = y.createElementNS(O, "tspan"), I(p, {
dy: e,
x: l
}), R && I(p, "style", R), p.appendChild(y.createTextNode(m.join(" ").replace(/- /g, "-"))), b.appendChild(p)), d.truncate(a, p, null, m, 0 === r ? x : 0, c, function(a, b) {
return m.slice(0, b).join(" ").replace(/- /g, "-")
}), x = a.actualWidth, r++
}
f++
}
}
});
Q = Q || b.childNodes.length
}),
L && t && a.attr("title", q(a.textStr, ["&lt;", "&gt;"])), x && x.removeChild(b), p && a.applyTextOutline && a.applyTextOutline(p)) : b.appendChild(y.createTextNode(q(g)))
}
},
getContrast: function(a) {
a = d(a).rgba;
a[0] *= 1;
a[1] *= 1.2;
a[2] *= .5;
return 459 < a[0] + a[1] + a[2] ? "#000000" : "#FFFFFF"
},
button: function(a, b, d, n, g, z, h, l, x, c) {
var K = this.label(a, b, d, x, null, null, c, null, "button"),
k = 0,
N = this.styledMode;
K.attr(L({
padding: 8,
r: 2
}, g));
if (!N) {
g = L({
fill: "#f7f7f7",
stroke: "#cccccc",
"stroke-width": 1,
style: {
color: "#333333",
cursor: "pointer",
fontWeight: "normal"
}
}, g);
var p = g.style;
delete g.style;
z = L(g, {
fill: "#e6e6e6"
}, z);
var O = z.style;
delete z.style;
h = L(g, {
fill: "#e6ebf5",
style: {
color: "#000000",
fontWeight: "bold"
}
}, h);
var R = h.style;
delete h.style;
l = L(g, {
style: {
color: "#cccccc"
}
}, l);
var E = l.style;
delete l.style
}
f(K.element, t ? "mouseover" : "mouseenter", function() {
3 !== k && K.setState(1)
});
f(K.element, t ? "mouseout" : "mouseleave", function() {
3 !== k && K.setState(k)
});
K.setState = function(a) {
1 !== a && (K.state = k = a);
K.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-" + ["normal", "hover", "pressed", "disabled"][a || 0]);
N || K.attr([g, z, h, l][a || 0]).css([p, O, R, E][a || 0])
};
N || K.attr(g).css(q({
cursor: "default"
}, p));
return K.on("click", function(a) {
3 !== k && n.call(K, a)
})
},
crispLine: function(a, b) {
a[1] === a[4] && (a[1] = a[4] = Math.round(a[1]) - b % 2 / 2);
a[2] === a[5] && (a[2] = a[5] = Math.round(a[2]) + b % 2 / 2);
return a
},
path: function(a) {
var b = this.styledMode ? {} : {
fill: "none"
};
C(a) ? b.d = a : u(a) && q(b, a);
return this.createElement("path").attr(b)
},
circle: function(a, b, d) {
a = u(a) ? a : "undefined" === typeof a ? {} : {
x: a,
y: b,
r: d
};
b = this.createElement("circle");
b.xSetter = b.ySetter = function(a, b, d) {
d.setAttribute("c" + b, a)
};
return b.attr(a)
},
arc: function(a, b, d, n, g, z) {
u(a) ? (n = a, b = n.y, d = n.r, a = n.x) : n = {
innerR: n,
start: g,
end: z
};
a = this.symbol("arc", a, b, d, d, n);
a.r = d;
return a
},
rect: function(a, b, d, n, g, z) {
g = u(a) ? a.r : g;
var f = this.createElement("rect");
a = u(a) ? a : "undefined" === typeof a ? {} : {
x: a,
y: b,
width: Math.max(d, 0),
height: Math.max(n, 0)
};
this.styledMode || ("undefined" !== typeof z && (a.strokeWidth = z, a = f.crisp(a)), a.fill = "none");
g &&
(a.r = g);
f.rSetter = function(a, b, d) {
f.r = a;
I(d, {
rx: a,
ry: a
})
};
f.rGetter = function() {
return f.r
};
return f.attr(a)
},
setSize: function(a, b, d) {
var n = this.alignedObjects,
g = n.length;
this.width = a;
this.height = b;
for (this.boxWrapper.animate({
width: a,
height: b
}, {
step: function() {
this.attr({
viewBox: "0 0 " + this.attr("width") + " " + this.attr("height")
})
},
duration: r(d, !0) ? void 0 : 0
}); g--;) n[g].align()
},
g: function(a) {
var b = this.createElement("g");
return a ? b.attr({
"class": "highcharts-" + a
}) : b
},
image: function(a, b, d, n, g, z) {
var h = {
preserveAspectRatio: "none"
},
t = function(a, b) {
a.setAttributeNS ? a.setAttributeNS("http://www.w3.org/1999/xlink", "href", b) : a.setAttribute("hc-svg-href", b)
},
l = function(b) {
t(x.element, a);
z.call(x, b)
};
1 < arguments.length && q(h, {
x: b,
y: d,
width: n,
height: g
});
var x = this.createElement("image").attr(h);
z ? (t(x.element, "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="), h = new T.Image, f(h, "load", l), h.src = a, h.complete && l({})) : t(x.element, a);
return x
},
symbol: function(b, d, n, g, z, f) {
var t = this,
l = /^url\((.*?)\)$/,
x = l.test(b),
c = !x && (this.symbols[b] ? b : "circle"),
K = c && this.symbols[c],
N = G(d) && K && K.call(this.symbols, Math.round(d), Math.round(n), g, z, f);
if (K) {
var p = this.path(N);
t.styledMode || p.attr("fill", "none");
q(p, {
symbolName: c,
x: d,
y: n,
width: g,
height: z
});
f && q(p, f)
} else if (x) {
var O = b.match(l)[1];
p = this.image(O);
p.imgwidth = r(V[O] && V[O].width, f && f.width);
p.imgheight = r(V[O] && V[O].height, f && f.height);
var R = function() {
p.attr({
width: p.width,
height: p.height
})
};
["width", "height"].forEach(function(a) {
p[a +
"Setter"] = function(a, b) {
var d = {},
n = this["img" + b],
g = "width" === b ? "translateX" : "translateY";
this[b] = a;
G(n) && (f && "within" === f.backgroundSize && this.width && this.height && (n = Math.round(n * Math.min(this.width / this.imgwidth, this.height / this.imgheight))), this.element && this.element.setAttribute(b, n), this.alignByTranslate || (d[g] = ((this[b] || 0) - n) / 2, this.attr(d)))
}
});
G(d) && p.attr({
x: d,
y: n
});
p.isImg = !0;
G(p.imgwidth) && G(p.imgheight) ? R() : (p.attr({
width: 0,
height: 0
}), k("img", {
onload: function() {
var b = a[t.chartIndex];
0 ===
this.width && (h(this, {
position: "absolute",
top: "-999em"
}), y.body.appendChild(this));
V[O] = {
width: this.width,
height: this.height
};
p.imgwidth = this.width;
p.imgheight = this.height;
p.element && R();
this.parentNode && this.parentNode.removeChild(this);