update
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
|
||||
Standalone Highcharts Framework
|
||||
|
||||
License: MIT License
|
||||
*/
|
||||
var HighchartsAdapter=function(){function o(c){function b(b,a,d){b.removeEventListener(a,d,!1)}function d(b,a,d){d=b.HCProxiedMethods[d.toString()];b.detachEvent("on"+a,d)}function a(a,c){var f=a.HCEvents,i,g,k,j;if(a.removeEventListener)i=b;else if(a.attachEvent)i=d;else return;c?(g={},g[c]=!0):g=f;for(j in g)if(f[j])for(k=f[j].length;k--;)i(a,j,f[j][k])}c.HCExtended||Highcharts.extend(c,{HCExtended:!0,HCEvents:{},bind:function(b,a){var d=this,c=this.HCEvents,g;if(d.addEventListener)d.addEventListener(b,
|
||||
a,!1);else if(d.attachEvent){g=function(b){b.target=b.srcElement||window;a.call(d,b)};if(!d.HCProxiedMethods)d.HCProxiedMethods={};d.HCProxiedMethods[a.toString()]=g;d.attachEvent("on"+b,g)}c[b]===r&&(c[b]=[]);c[b].push(a)},unbind:function(c,h){var f,i;c?(f=this.HCEvents[c]||[],h?(i=HighchartsAdapter.inArray(h,f),i>-1&&(f.splice(i,1),this.HCEvents[c]=f),this.removeEventListener?b(this,c,h):this.attachEvent&&d(this,c,h)):(a(this,c),this.HCEvents[c]=[])):(a(this),this.HCEvents={})},trigger:function(b,
|
||||
a){var d=this.HCEvents[b]||[],c=d.length,g,k,j;k=function(){a.defaultPrevented=!0};for(g=0;g<c;g++){j=d[g];if(a.stopped)break;a.preventDefault=k;a.target=this;if(!a.type)a.type=b;j.call(this,a)===!1&&a.preventDefault()}}});return c}var r,l=document,p=[],m=[],q,n;Math.easeInOutSine=function(c,b,d,a){return-d/2*(Math.cos(Math.PI*c/a)-1)+b};return{init:function(c){if(!l.defaultView)this._getStyle=function(b,d){var a;return b.style[d]?b.style[d]:(d==="opacity"&&(d="filter"),a=b.currentStyle[d.replace(/\-(\w)/g,
|
||||
function(a,b){return b.toUpperCase()})],d==="filter"&&(a=a.replace(/alpha\(opacity=([0-9]+)\)/,function(b,a){return a/100})),a===""?1:a)},this.adapterRun=function(b,d){var a={width:"clientWidth",height:"clientHeight"}[d];if(a)return b.style.zoom=1,b[a]-2*parseInt(HighchartsAdapter._getStyle(b,"padding"),10)};if(!Array.prototype.forEach)this.each=function(b,d){for(var a=0,c=b.length;a<c;a++)if(d.call(b[a],b[a],a,b)===!1)return a};if(!Array.prototype.indexOf)this.inArray=function(b,d){var a,c=0;if(d)for(a=
|
||||
d.length;c<a;c++)if(d[c]===b)return c;return-1};if(!Array.prototype.filter)this.grep=function(b,d){for(var a=[],c=0,h=b.length;c<h;c++)d(b[c],c)&&a.push(b[c]);return a};n=function(b,c,a){this.options=c;this.elem=b;this.prop=a};n.prototype={update:function(){var b;b=this.paths;var d=this.elem,a=d.element;b&&a?d.attr("d",c.step(b[0],b[1],this.now,this.toD)):d.attr?a&&d.attr(this.prop,this.now):(b={},b[this.prop]=this.now+this.unit,Highcharts.css(d,b));this.options.step&&this.options.step.call(this.elem,
|
||||
this.now,this)},custom:function(b,c,a){var e=this,h=function(a){return e.step(a)},f;this.startTime=+new Date;this.start=b;this.end=c;this.unit=a;this.now=this.start;this.pos=this.state=0;h.elem=this.elem;h()&&m.push(h)===1&&(q=setInterval(function(){for(f=0;f<m.length;f++)m[f]()||m.splice(f--,1);m.length||clearInterval(q)},13))},step:function(b){var c=+new Date,a;a=this.options;var e=this.elem,h;if(e.stopAnimation||e.attr&&!e.element)a=!1;else if(b||c>=a.duration+this.startTime){this.now=this.end;
|
||||
this.pos=this.state=1;this.update();b=this.options.curAnim[this.prop]=!0;for(h in a.curAnim)a.curAnim[h]!==!0&&(b=!1);b&&a.complete&&a.complete.call(e);a=!1}else e=c-this.startTime,this.state=e/a.duration,this.pos=a.easing(e,0,1,a.duration),this.now=this.start+(this.end-this.start)*this.pos,this.update(),a=!0;return a}};this.animate=function(b,d,a){var e,h="",f,i,g;b.stopAnimation=!1;if(typeof a!=="object"||a===null)e=arguments,a={duration:e[2],easing:e[3],complete:e[4]};if(typeof a.duration!=="number")a.duration=
|
||||
400;a.easing=Math[a.easing]||Math.easeInOutSine;a.curAnim=Highcharts.extend({},d);for(g in d)i=new n(b,a,g),f=null,g==="d"?(i.paths=c.init(b,b.d,d.d),i.toD=d.d,e=0,f=1):b.attr?e=b.attr(g):(e=parseFloat(HighchartsAdapter._getStyle(b,g))||0,g!=="opacity"&&(h="px")),f||(f=parseFloat(d[g])),i.custom(e,f,h)}},_getStyle:function(c,b){return window.getComputedStyle(c,void 0).getPropertyValue(b)},getScript:function(c,b){var d=l.getElementsByTagName("head")[0],a=l.createElement("script");a.type="text/javascript";
|
||||
a.src=c;a.onload=b;d.appendChild(a)},inArray:function(c,b){return b.indexOf?b.indexOf(c):p.indexOf.call(b,c)},adapterRun:function(c,b){return parseInt(HighchartsAdapter._getStyle(c,b),10)},grep:function(c,b){return p.filter.call(c,b)},map:function(c,b){for(var d=[],a=0,e=c.length;a<e;a++)d[a]=b.call(c[a],c[a],a,c);return d},offset:function(c){var b=document.documentElement,c=c.getBoundingClientRect();return{top:c.top+(window.pageYOffset||b.scrollTop)-(b.clientTop||0),left:c.left+(window.pageXOffset||
|
||||
b.scrollLeft)-(b.clientLeft||0)}},addEvent:function(c,b,d){o(c).bind(b,d)},removeEvent:function(c,b,d){o(c).unbind(b,d)},fireEvent:function(c,b,d,a){var e;l.createEvent&&(c.dispatchEvent||c.fireEvent)?(e=l.createEvent("Events"),e.initEvent(b,!0,!0),e.target=c,Highcharts.extend(e,d),c.dispatchEvent?c.dispatchEvent(e):c.fireEvent(b,e)):c.HCExtended===!0&&(d=d||{},c.trigger(b,d));d&&d.defaultPrevented&&(a=null);a&&a(d)},washMouseEvent:function(c){return c},stop:function(c){c.stopAnimation=!0},each:function(c,
|
||||
b){return Array.prototype.forEach.call(c,b)}}}();
|
||||
@@ -0,0 +1,590 @@
|
||||
/**
|
||||
* @license Highcharts JS v4.0.3 (2014-07-03)
|
||||
*
|
||||
* Standalone Highcharts Framework
|
||||
*
|
||||
* License: MIT License
|
||||
*/
|
||||
|
||||
|
||||
/*global Highcharts */
|
||||
var HighchartsAdapter = (function () {
|
||||
|
||||
var UNDEFINED,
|
||||
doc = document,
|
||||
emptyArray = [],
|
||||
timers = [],
|
||||
timerId,
|
||||
Fx;
|
||||
|
||||
Math.easeInOutSine = function (t, b, c, d) {
|
||||
return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Extend given object with custom events
|
||||
*/
|
||||
function augment(obj) {
|
||||
function removeOneEvent(el, type, fn) {
|
||||
el.removeEventListener(type, fn, false);
|
||||
}
|
||||
|
||||
function IERemoveOneEvent(el, type, fn) {
|
||||
fn = el.HCProxiedMethods[fn.toString()];
|
||||
el.detachEvent('on' + type, fn);
|
||||
}
|
||||
|
||||
function removeAllEvents(el, type) {
|
||||
var events = el.HCEvents,
|
||||
remove,
|
||||
types,
|
||||
len,
|
||||
n;
|
||||
|
||||
if (el.removeEventListener) {
|
||||
remove = removeOneEvent;
|
||||
} else if (el.attachEvent) {
|
||||
remove = IERemoveOneEvent;
|
||||
} else {
|
||||
return; // break on non-DOM events
|
||||
}
|
||||
|
||||
|
||||
if (type) {
|
||||
types = {};
|
||||
types[type] = true;
|
||||
} else {
|
||||
types = events;
|
||||
}
|
||||
|
||||
for (n in types) {
|
||||
if (events[n]) {
|
||||
len = events[n].length;
|
||||
while (len--) {
|
||||
remove(el, n, events[n][len]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!obj.HCExtended) {
|
||||
Highcharts.extend(obj, {
|
||||
HCExtended: true,
|
||||
|
||||
HCEvents: {},
|
||||
|
||||
bind: function (name, fn) {
|
||||
var el = this,
|
||||
events = this.HCEvents,
|
||||
wrappedFn;
|
||||
|
||||
// handle DOM events in modern browsers
|
||||
if (el.addEventListener) {
|
||||
el.addEventListener(name, fn, false);
|
||||
|
||||
// handle old IE implementation
|
||||
} else if (el.attachEvent) {
|
||||
|
||||
wrappedFn = function (e) {
|
||||
e.target = e.srcElement || window; // #2820
|
||||
fn.call(el, e);
|
||||
};
|
||||
|
||||
if (!el.HCProxiedMethods) {
|
||||
el.HCProxiedMethods = {};
|
||||
}
|
||||
|
||||
// link wrapped fn with original fn, so we can get this in removeEvent
|
||||
el.HCProxiedMethods[fn.toString()] = wrappedFn;
|
||||
|
||||
el.attachEvent('on' + name, wrappedFn);
|
||||
}
|
||||
|
||||
|
||||
if (events[name] === UNDEFINED) {
|
||||
events[name] = [];
|
||||
}
|
||||
|
||||
events[name].push(fn);
|
||||
},
|
||||
|
||||
unbind: function (name, fn) {
|
||||
var events,
|
||||
index;
|
||||
|
||||
if (name) {
|
||||
events = this.HCEvents[name] || [];
|
||||
if (fn) {
|
||||
index = HighchartsAdapter.inArray(fn, events);
|
||||
if (index > -1) {
|
||||
events.splice(index, 1);
|
||||
this.HCEvents[name] = events;
|
||||
}
|
||||
if (this.removeEventListener) {
|
||||
removeOneEvent(this, name, fn);
|
||||
} else if (this.attachEvent) {
|
||||
IERemoveOneEvent(this, name, fn);
|
||||
}
|
||||
} else {
|
||||
removeAllEvents(this, name);
|
||||
this.HCEvents[name] = [];
|
||||
}
|
||||
} else {
|
||||
removeAllEvents(this);
|
||||
this.HCEvents = {};
|
||||
}
|
||||
},
|
||||
|
||||
trigger: function (name, args) {
|
||||
var events = this.HCEvents[name] || [],
|
||||
target = this,
|
||||
len = events.length,
|
||||
i,
|
||||
preventDefault,
|
||||
fn;
|
||||
|
||||
// Attach a simple preventDefault function to skip default handler if called
|
||||
preventDefault = function () {
|
||||
args.defaultPrevented = true;
|
||||
};
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
fn = events[i];
|
||||
|
||||
// args is never null here
|
||||
if (args.stopped) {
|
||||
return;
|
||||
}
|
||||
|
||||
args.preventDefault = preventDefault;
|
||||
args.target = target;
|
||||
|
||||
// If the type is not set, we're running a custom event (#2297). If it is set,
|
||||
// we're running a browser event, and setting it will cause en error in
|
||||
// IE8 (#2465).
|
||||
if (!args.type) {
|
||||
args.type = name;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// If the event handler return false, prevent the default handler from executing
|
||||
if (fn.call(this, args) === false) {
|
||||
args.preventDefault();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
return {
|
||||
/**
|
||||
* Initialize the adapter. This is run once as Highcharts is first run.
|
||||
*/
|
||||
init: function (pathAnim) {
|
||||
|
||||
/**
|
||||
* Compatibility section to add support for legacy IE. This can be removed if old IE
|
||||
* support is not needed.
|
||||
*/
|
||||
if (!doc.defaultView) {
|
||||
this._getStyle = function (el, prop) {
|
||||
var val;
|
||||
if (el.style[prop]) {
|
||||
return el.style[prop];
|
||||
} else {
|
||||
if (prop === 'opacity') {
|
||||
prop = 'filter';
|
||||
}
|
||||
/*jslint unparam: true*/
|
||||
val = el.currentStyle[prop.replace(/\-(\w)/g, function (a, b) { return b.toUpperCase(); })];
|
||||
if (prop === 'filter') {
|
||||
val = val.replace(
|
||||
/alpha\(opacity=([0-9]+)\)/,
|
||||
function (a, b) {
|
||||
return b / 100;
|
||||
}
|
||||
);
|
||||
}
|
||||
/*jslint unparam: false*/
|
||||
return val === '' ? 1 : val;
|
||||
}
|
||||
};
|
||||
this.adapterRun = function (elem, method) {
|
||||
var alias = { width: 'clientWidth', height: 'clientHeight' }[method];
|
||||
|
||||
if (alias) {
|
||||
elem.style.zoom = 1;
|
||||
return elem[alias] - 2 * parseInt(HighchartsAdapter._getStyle(elem, 'padding'), 10);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (!Array.prototype.forEach) {
|
||||
this.each = function (arr, fn) { // legacy
|
||||
var i = 0,
|
||||
len = arr.length;
|
||||
for (; i < len; i++) {
|
||||
if (fn.call(arr[i], arr[i], i, arr) === false) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (!Array.prototype.indexOf) {
|
||||
this.inArray = function (item, arr) {
|
||||
var len,
|
||||
i = 0;
|
||||
|
||||
if (arr) {
|
||||
len = arr.length;
|
||||
|
||||
for (; i < len; i++) {
|
||||
if (arr[i] === item) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return -1;
|
||||
};
|
||||
}
|
||||
|
||||
if (!Array.prototype.filter) {
|
||||
this.grep = function (elements, callback) {
|
||||
var ret = [],
|
||||
i = 0,
|
||||
length = elements.length;
|
||||
|
||||
for (; i < length; i++) {
|
||||
if (!!callback(elements[i], i)) {
|
||||
ret.push(elements[i]);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
};
|
||||
}
|
||||
|
||||
//--- End compatibility section ---
|
||||
|
||||
|
||||
/**
|
||||
* Start of animation specific code
|
||||
*/
|
||||
Fx = function (elem, options, prop) {
|
||||
this.options = options;
|
||||
this.elem = elem;
|
||||
this.prop = prop;
|
||||
};
|
||||
Fx.prototype = {
|
||||
|
||||
update: function () {
|
||||
var styles,
|
||||
paths = this.paths,
|
||||
elem = this.elem,
|
||||
elemelem = elem.element; // if destroyed, it is null
|
||||
|
||||
// Animating a path definition on SVGElement
|
||||
if (paths && elemelem) {
|
||||
elem.attr('d', pathAnim.step(paths[0], paths[1], this.now, this.toD));
|
||||
|
||||
// Other animations on SVGElement
|
||||
} else if (elem.attr) {
|
||||
if (elemelem) {
|
||||
elem.attr(this.prop, this.now);
|
||||
}
|
||||
|
||||
// HTML styles
|
||||
} else {
|
||||
styles = {};
|
||||
styles[this.prop] = this.now + this.unit;
|
||||
Highcharts.css(elem, styles);
|
||||
}
|
||||
|
||||
if (this.options.step) {
|
||||
this.options.step.call(this.elem, this.now, this);
|
||||
}
|
||||
|
||||
},
|
||||
custom: function (from, to, unit) {
|
||||
var self = this,
|
||||
t = function (gotoEnd) {
|
||||
return self.step(gotoEnd);
|
||||
},
|
||||
i;
|
||||
|
||||
this.startTime = +new Date();
|
||||
this.start = from;
|
||||
this.end = to;
|
||||
this.unit = unit;
|
||||
this.now = this.start;
|
||||
this.pos = this.state = 0;
|
||||
|
||||
t.elem = this.elem;
|
||||
|
||||
if (t() && timers.push(t) === 1) {
|
||||
timerId = setInterval(function () {
|
||||
|
||||
for (i = 0; i < timers.length; i++) {
|
||||
if (!timers[i]()) {
|
||||
timers.splice(i--, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!timers.length) {
|
||||
clearInterval(timerId);
|
||||
}
|
||||
}, 13);
|
||||
}
|
||||
},
|
||||
|
||||
step: function (gotoEnd) {
|
||||
var t = +new Date(),
|
||||
ret,
|
||||
done,
|
||||
options = this.options,
|
||||
elem = this.elem,
|
||||
i;
|
||||
|
||||
if (elem.stopAnimation || (elem.attr && !elem.element)) { // #2616, element including flag is destroyed
|
||||
ret = false;
|
||||
|
||||
} else if (gotoEnd || t >= options.duration + this.startTime) {
|
||||
this.now = this.end;
|
||||
this.pos = this.state = 1;
|
||||
this.update();
|
||||
|
||||
this.options.curAnim[this.prop] = true;
|
||||
|
||||
done = true;
|
||||
for (i in options.curAnim) {
|
||||
if (options.curAnim[i] !== true) {
|
||||
done = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (done) {
|
||||
if (options.complete) {
|
||||
options.complete.call(elem);
|
||||
}
|
||||
}
|
||||
ret = false;
|
||||
|
||||
} else {
|
||||
var n = t - this.startTime;
|
||||
this.state = n / options.duration;
|
||||
this.pos = options.easing(n, 0, 1, options.duration);
|
||||
this.now = this.start + ((this.end - this.start) * this.pos);
|
||||
this.update();
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* The adapter animate method
|
||||
*/
|
||||
this.animate = function (el, prop, opt) {
|
||||
var start,
|
||||
unit = '',
|
||||
end,
|
||||
fx,
|
||||
args,
|
||||
name;
|
||||
|
||||
el.stopAnimation = false; // ready for new
|
||||
|
||||
if (typeof opt !== 'object' || opt === null) {
|
||||
args = arguments;
|
||||
opt = {
|
||||
duration: args[2],
|
||||
easing: args[3],
|
||||
complete: args[4]
|
||||
};
|
||||
}
|
||||
if (typeof opt.duration !== 'number') {
|
||||
opt.duration = 400;
|
||||
}
|
||||
opt.easing = Math[opt.easing] || Math.easeInOutSine;
|
||||
opt.curAnim = Highcharts.extend({}, prop);
|
||||
|
||||
for (name in prop) {
|
||||
fx = new Fx(el, opt, name);
|
||||
end = null;
|
||||
|
||||
if (name === 'd') {
|
||||
fx.paths = pathAnim.init(
|
||||
el,
|
||||
el.d,
|
||||
prop.d
|
||||
);
|
||||
fx.toD = prop.d;
|
||||
start = 0;
|
||||
end = 1;
|
||||
} else if (el.attr) {
|
||||
start = el.attr(name);
|
||||
} else {
|
||||
start = parseFloat(HighchartsAdapter._getStyle(el, name)) || 0;
|
||||
if (name !== 'opacity') {
|
||||
unit = 'px';
|
||||
}
|
||||
}
|
||||
|
||||
if (!end) {
|
||||
end = parseFloat(prop[name]);
|
||||
}
|
||||
fx.custom(start, end, unit);
|
||||
}
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Internal method to return CSS value for given element and property
|
||||
*/
|
||||
_getStyle: function (el, prop) {
|
||||
return window.getComputedStyle(el, undefined).getPropertyValue(prop);
|
||||
},
|
||||
|
||||
/**
|
||||
* Downloads a script and executes a callback when done.
|
||||
* @param {String} scriptLocation
|
||||
* @param {Function} callback
|
||||
*/
|
||||
getScript: function (scriptLocation, callback) {
|
||||
// We cannot assume that Assets class from mootools-more is available so instead insert a script tag to download script.
|
||||
var head = doc.getElementsByTagName('head')[0],
|
||||
script = doc.createElement('script');
|
||||
|
||||
script.type = 'text/javascript';
|
||||
script.src = scriptLocation;
|
||||
script.onload = callback;
|
||||
|
||||
head.appendChild(script);
|
||||
},
|
||||
|
||||
/**
|
||||
* Return the index of an item in an array, or -1 if not found
|
||||
*/
|
||||
inArray: function (item, arr) {
|
||||
return arr.indexOf ? arr.indexOf(item) : emptyArray.indexOf.call(arr, item);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* A direct link to adapter methods
|
||||
*/
|
||||
adapterRun: function (elem, method) {
|
||||
return parseInt(HighchartsAdapter._getStyle(elem, method), 10);
|
||||
},
|
||||
|
||||
/**
|
||||
* Filter an array
|
||||
*/
|
||||
grep: function (elements, callback) {
|
||||
return emptyArray.filter.call(elements, callback);
|
||||
},
|
||||
|
||||
/**
|
||||
* Map an array
|
||||
*/
|
||||
map: function (arr, fn) {
|
||||
var results = [], i = 0, len = arr.length;
|
||||
|
||||
for (; i < len; i++) {
|
||||
results[i] = fn.call(arr[i], arr[i], i, arr);
|
||||
}
|
||||
|
||||
return results;
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the element's offset position, corrected by overflow:auto. Loosely based on jQuery's offset method.
|
||||
*/
|
||||
offset: function (el) {
|
||||
var docElem = document.documentElement,
|
||||
box = el.getBoundingClientRect();
|
||||
|
||||
return {
|
||||
top: box.top + (window.pageYOffset || docElem.scrollTop) - (docElem.clientTop || 0),
|
||||
left: box.left + (window.pageXOffset || docElem.scrollLeft) - (docElem.clientLeft || 0)
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Add an event listener
|
||||
*/
|
||||
addEvent: function (el, type, fn) {
|
||||
augment(el).bind(type, fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* Remove event added with addEvent
|
||||
*/
|
||||
removeEvent: function (el, type, fn) {
|
||||
augment(el).unbind(type, fn);
|
||||
},
|
||||
|
||||
/**
|
||||
* Fire an event on a custom object
|
||||
*/
|
||||
fireEvent: function (el, type, eventArguments, defaultFunction) {
|
||||
var e;
|
||||
|
||||
if (doc.createEvent && (el.dispatchEvent || el.fireEvent)) {
|
||||
e = doc.createEvent('Events');
|
||||
e.initEvent(type, true, true);
|
||||
e.target = el;
|
||||
|
||||
Highcharts.extend(e, eventArguments);
|
||||
|
||||
if (el.dispatchEvent) {
|
||||
el.dispatchEvent(e);
|
||||
} else {
|
||||
el.fireEvent(type, e);
|
||||
}
|
||||
|
||||
} else if (el.HCExtended === true) {
|
||||
eventArguments = eventArguments || {};
|
||||
el.trigger(type, eventArguments);
|
||||
}
|
||||
|
||||
if (eventArguments && eventArguments.defaultPrevented) {
|
||||
defaultFunction = null;
|
||||
}
|
||||
|
||||
if (defaultFunction) {
|
||||
defaultFunction(eventArguments);
|
||||
}
|
||||
},
|
||||
|
||||
washMouseEvent: function (e) {
|
||||
return e;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* Stop running animation
|
||||
*/
|
||||
stop: function (el) {
|
||||
el.stopAnimation = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Utility for iterating over an array. Parameters are reversed compared to jQuery.
|
||||
* @param {Array} arr
|
||||
* @param {Function} fn
|
||||
*/
|
||||
each: function (arr, fn) { // modern browsers
|
||||
return Array.prototype.forEach.call(arr, fn);
|
||||
}
|
||||
};
|
||||
}());
|
||||
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
|
||||
(c) 2009-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(){function r(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function w(){var a,b=arguments,c,d={},e=function(a,b){var c,d;typeof a!=="object"&&(a={});for(d in b)b.hasOwnProperty(d)&&(c=b[d],a[d]=c&&typeof c==="object"&&Object.prototype.toString.call(c)!=="[object Array]"&&d!=="renderTo"&&typeof c.nodeType!=="number"?e(a[d]||{},c):b[d]);return a};b[0]===!0&&(d=b[1],b=Array.prototype.slice.call(b,2));c=b.length;for(a=0;a<c;a++)d=e(d,b[a]);return d}function z(a,b){return parseInt(a,b||
|
||||
10)}function Fa(a){return typeof a==="string"}function da(a){return a&&typeof a==="object"}function La(a){return Object.prototype.toString.call(a)==="[object Array]"}function ia(a){return typeof a==="number"}function za(a){return V.log(a)/V.LN10}function ja(a){return V.pow(10,a)}function ka(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function s(a){return a!==t&&a!==null}function F(a,b,c){var d,e;if(Fa(b))s(c)?a.setAttribute(b,c):a&&a.getAttribute&&(e=a.getAttribute(b));else if(s(b)&&
|
||||
da(b))for(d in b)a.setAttribute(d,b[d]);return e}function ra(a){return La(a)?a:[a]}function p(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++)if(c=a[b],c!==t&&c!==null)return c}function A(a,b){if(Aa&&!ba&&b&&b.opacity!==t)b.filter="alpha(opacity="+b.opacity*100+")";r(a.style,b)}function $(a,b,c,d,e){a=x.createElement(a);b&&r(a,b);e&&A(a,{padding:0,border:P,margin:0});c&&A(a,c);d&&d.appendChild(a);return a}function la(a,b){var c=function(){return t};c.prototype=new a;r(c.prototype,b);return c}function Ga(a,
|
||||
b,c,d){var e=L.lang,a=+a||0,f=b===-1?(a.toString().split(".")[1]||"").length:isNaN(b=Q(b))?2:b,b=c===void 0?e.decimalPoint:c,d=d===void 0?e.thousandsSep:d,e=a<0?"-":"",c=String(z(a=Q(a).toFixed(f))),g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+Q(a-c).toFixed(f).slice(2):"")}function Ha(a,b){return Array((b||2)+1-String(a).length).join(0)+a}function Ma(a,b,c){var d=a[b];a[b]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(d);
|
||||
return c.apply(this,a)}}function Ia(a,b){for(var c="{",d=!1,e,f,g,h,i,j=[];(c=a.indexOf(c))!==-1;){e=a.slice(0,c);if(d){f=e.split(":");g=f.shift().split(".");i=g.length;e=b;for(h=0;h<i;h++)e=e[g[h]];if(f.length)f=f.join(":"),g=/\.([0-9])/,h=L.lang,i=void 0,/f$/.test(f)?(i=(i=f.match(g))?i[1]:-1,e!==null&&(e=Ga(e,i,h.decimalPoint,f.indexOf(",")>-1?h.thousandsSep:""))):e=bb(f,e)}j.push(e);a=a.slice(c+1);c=(d=!d)?"}":"{"}j.push(a);return j.join("")}function lb(a){return V.pow(10,U(V.log(a)/V.LN10))}
|
||||
function mb(a,b,c,d){var e,c=p(c,1);e=a/c;b||(b=[1,2,2.5,5,10],d&&d.allowDecimals===!1&&(c===1?b=[1,2,5,10]:c<=0.1&&(b=[1/c])));for(d=0;d<b.length;d++)if(a=b[d],e<=(b[d]+(b[d+1]||b[d]))/2)break;a*=c;return a}function nb(a,b){var c=a.length,d,e;for(e=0;e<c;e++)a[e].ss_i=e;a.sort(function(a,c){d=b(a,c);return d===0?a.ss_i-c.ss_i:d});for(e=0;e<c;e++)delete a[e].ss_i}function Na(a){for(var b=a.length,c=a[0];b--;)a[b]<c&&(c=a[b]);return c}function Ba(a){for(var b=a.length,c=a[0];b--;)a[b]>c&&(c=a[b]);
|
||||
return c}function Oa(a,b){for(var c in a)a[c]&&a[c]!==b&&a[c].destroy&&a[c].destroy(),delete a[c]}function Pa(a){cb||(cb=$(Ja));a&&cb.appendChild(a);cb.innerHTML=""}function ea(a){return parseFloat(a.toPrecision(14))}function Qa(a,b){va=p(a,b.animation)}function Ab(){var a=L.global.useUTC,b=a?"getUTC":"get",c=a?"setUTC":"set";Ra=(a&&L.global.timezoneOffset||0)*6E4;db=a?Date.UTC:function(a,b,c,g,h,i){return(new Date(a,b,p(c,1),p(g,0),p(h,0),p(i,0))).getTime()};ob=b+"Minutes";pb=b+"Hours";qb=b+"Day";
|
||||
Wa=b+"Date";eb=b+"Month";fb=b+"FullYear";Bb=c+"Minutes";Cb=c+"Hours";rb=c+"Date";Db=c+"Month";Eb=c+"FullYear"}function G(){}function Sa(a,b,c,d){this.axis=a;this.pos=b;this.type=c||"";this.isNew=!0;!c&&!d&&this.addLabel()}function ma(){this.init.apply(this,arguments)}function Xa(){this.init.apply(this,arguments)}function Fb(a,b,c,d,e){var f=a.chart.inverted;this.axis=a;this.isNegative=c;this.options=b;this.x=d;this.total=null;this.points={};this.stack=e;this.alignOptions={align:b.align||(f?c?"left":
|
||||
"right":"center"),verticalAlign:b.verticalAlign||(f?"middle":c?"bottom":"top"),y:p(b.y,f?4:c?14:-6),x:p(b.x,f?c?-6:6:0)};this.textAlign=b.textAlign||(f?c?"right":"left":"center")}var t,x=document,H=window,V=Math,v=V.round,U=V.floor,Ka=V.ceil,u=V.max,C=V.min,Q=V.abs,aa=V.cos,fa=V.sin,na=V.PI,Ca=na*2/360,wa=navigator.userAgent,Gb=H.opera,Aa=/msie/i.test(wa)&&!Gb,gb=x.documentMode===8,sb=/AppleWebKit/.test(wa),Ta=/Firefox/.test(wa),Hb=/(Mobile|Android|Windows Phone)/.test(wa),xa="http://www.w3.org/2000/svg",
|
||||
ba=!!x.createElementNS&&!!x.createElementNS(xa,"svg").createSVGRect,Nb=Ta&&parseInt(wa.split("Firefox/")[1],10)<4,ga=!ba&&!Aa&&!!x.createElement("canvas").getContext,Ya,Za,Ib={},tb=0,cb,L,bb,va,ub,B,oa,sa=function(){return t},W=[],$a=0,Ja="div",P="none",Ob=/^[0-9]+$/,Pb="stroke-width",db,Ra,ob,pb,qb,Wa,eb,fb,Bb,Cb,rb,Db,Eb,J={},S;H.Highcharts?oa(16,!0):S=H.Highcharts={};bb=function(a,b,c){if(!s(b)||isNaN(b))return"Invalid date";var a=p(a,"%Y-%m-%d %H:%M:%S"),d=new Date(b-Ra),e,f=d[pb](),g=d[qb](),
|
||||
h=d[Wa](),i=d[eb](),j=d[fb](),k=L.lang,l=k.weekdays,d=r({a:l[g].substr(0,3),A:l[g],d:Ha(h),e:h,b:k.shortMonths[i],B:k.months[i],m:Ha(i+1),y:j.toString().substr(2,2),Y:j,H:Ha(f),I:Ha(f%12||12),l:f%12||12,M:Ha(d[ob]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",S:Ha(d.getSeconds()),L:Ha(v(b%1E3),3)},S.dateFormats);for(e in d)for(;a.indexOf("%"+e)!==-1;)a=a.replace("%"+e,typeof d[e]==="function"?d[e](b):d[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};oa=function(a,b){var c="Highcharts error #"+a+": www.highcharts.com/errors/"+
|
||||
a;if(b)throw c;H.console&&console.log(c)};B={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:26784E5,year:31556952E3};ub={init:function(a,b,c){var b=b||"",d=a.shift,e=b.indexOf("C")>-1,f=e?7:3,g,b=b.split(" "),c=[].concat(c),h,i,j=function(a){for(g=a.length;g--;)a[g]==="M"&&a.splice(g+1,0,a[g+1],a[g+2],a[g+1],a[g+2])};e&&(j(b),j(c));a.isArea&&(h=b.splice(b.length-6,6),i=c.splice(c.length-6,6));if(d<=c.length/f&&b.length===c.length)for(;d--;)c=[].concat(c).splice(0,f).concat(c);
|
||||
a.shift=0;if(b.length)for(a=c.length;b.length<a;)d=[].concat(b).splice(b.length-f,f),e&&(d[f-6]=d[f-2],d[f-5]=d[f-1]),b=b.concat(d);h&&(b=b.concat(h),c=c.concat(i));return[b,c]},step:function(a,b,c,d){var e=[],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;)d=parseFloat(a[f]),e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d;else e=b;return e}};(function(a){H.HighchartsAdapter=H.HighchartsAdapter||a&&{init:function(b){var c=a.fx,d=c.step,e,f=a.Tween,g=f&&f.propHooks;e=a.cssHooks.opacity;a.extend(a.easing,
|
||||
{easeOutQuad:function(a,b,c,d,e){return-d*(b/=e)*(b-2)+c}});a.each(["cur","_default","width","height","opacity"],function(a,b){var e=d,k;b==="cur"?e=c.prototype:b==="_default"&&f&&(e=g[b],b="set");(k=e[b])&&(e[b]=function(c){var d,c=a?c:this;if(c.prop!=="align")return d=c.elem,d.attr?d.attr(c.prop,b==="cur"?t:c.now):k.apply(this,arguments)})});Ma(e,"get",function(a,b,c){return b.attr?b.opacity||0:a.call(this,b,c)});e=function(a){var c=a.elem,d;if(!a.started)d=b.init(c,c.d,c.toD),a.start=d[0],a.end=
|
||||
d[1],a.started=!0;c.attr("d",b.step(a.start,a.end,a.pos,c.toD))};f?g.d={set:e}:d.d=e;this.each=Array.prototype.forEach?function(a,b){return Array.prototype.forEach.call(a,b)}:function(a,b){var c,d=a.length;for(c=0;c<d;c++)if(b.call(a[c],a[c],c,a)===!1)return c};a.fn.highcharts=function(){var a="Chart",b=arguments,c,d;if(this[0]){Fa(b[0])&&(a=b[0],b=Array.prototype.slice.call(b,1));c=b[0];if(c!==t)c.chart=c.chart||{},c.chart.renderTo=this[0],new S[a](c,b[1]),d=this;c===t&&(d=W[F(this[0],"data-highcharts-chart")])}return d}},
|
||||
getScript:a.getScript,inArray:a.inArray,adapterRun:function(b,c){return a(b)[c]()},grep:a.grep,map:function(a,c){for(var d=[],e=0,f=a.length;e<f;e++)d[e]=c.call(a[e],a[e],e,a);return d},offset:function(b){return a(b).offset()},addEvent:function(b,c,d){a(b).bind(c,d)},removeEvent:function(b,c,d){var e=x.removeEventListener?"removeEventListener":"detachEvent";x[e]&&b&&!b[e]&&(b[e]=function(){});a(b).unbind(c,d)},fireEvent:function(b,c,d,e){var f=a.Event(c),g="detached"+c,h;!Aa&&d&&(delete d.layerX,
|
||||
delete d.layerY,delete d.returnValue);r(f,d);b[c]&&(b[g]=b[c],b[c]=null);a.each(["preventDefault","stopPropagation"],function(a,b){var c=f[b];f[b]=function(){try{c.call(f)}catch(a){b==="preventDefault"&&(h=!0)}}});a(b).trigger(f);b[g]&&(b[c]=b[g],b[g]=null);e&&!f.isDefaultPrevented()&&!h&&e(f)},washMouseEvent:function(a){var c=a.originalEvent||a;if(c.pageX===t)c.pageX=a.pageX,c.pageY=a.pageY;return c},animate:function(b,c,d){var e=a(b);if(!b.style)b.style={};if(c.d)b.toD=c.d,c.d=1;e.stop();c.opacity!==
|
||||
t&&b.attr&&(c.opacity+="px");e.animate(c,d)},stop:function(b){a(b).stop()}}})(H.jQuery);var T=H.HighchartsAdapter,M=T||{};T&&T.init.call(T,ub);var hb=M.adapterRun,Qb=M.getScript,Da=M.inArray,q=M.each,vb=M.grep,Rb=M.offset,Ua=M.map,N=M.addEvent,X=M.removeEvent,K=M.fireEvent,Sb=M.washMouseEvent,ib=M.animate,ab=M.stop,M={enabled:!0,x:0,y:15,style:{color:"#606060",cursor:"default",fontSize:"11px"}};L={colors:"#7cb5ec,#434348,#90ed7d,#f7a35c,#8085e9,#f15c80,#e4d354,#8085e8,#8d4653,#91e8e1".split(","),
|
||||
symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",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(","),weekdays:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday".split(","),decimalPoint:".",numericSymbols:"k,M,G,T,P,E".split(","),resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:","},global:{useUTC:!0,
|
||||
canvasToolsURL:"http://code.highcharts.com/4.0.3/modules/canvas-tools.js",VMLRadialGradientURL:"http://code.highcharts.com/4.0.3/gfx/vml-radial-gradient.png"},chart:{borderColor:"#4572A7",borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0",resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}}},title:{text:"Chart title",align:"center",margin:15,style:{color:"#333333",fontSize:"18px"}},subtitle:{text:"",
|
||||
align:"center",style:{color:"#555555"}},plotOptions:{line:{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},lineWidth:2,marker:{lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{enabled:!0,lineWidthPlus:1,radiusPlus:2},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:w(M,{align:"center",enabled:!1,formatter:function(){return this.y===null?"":Ga(this.y,-1)},verticalAlign:"bottom",y:0}),cropThreshold:300,pointRange:0,states:{hover:{lineWidthPlus:1,
|
||||
marker:{},halo:{size:10,opacity:0.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3}},labels:{style:{position:"absolute",color:"#3E576F"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#909090",borderRadius:0,navigation:{activeColor:"#274b6d",inactiveColor:"#CCC"},shadow:!1,itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},itemHoverStyle:{color:"#000"},itemHiddenStyle:{color:"#CCC"},itemCheckboxStyle:{position:"absolute",
|
||||
width:"13px",height:"13px"},symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:!0,animation:ba,backgroundColor:"rgba(249, 249, 249, .85)",borderWidth:1,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",
|
||||
day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{series.color}">●</span> {series.name}: <b>{point.y}</b><br/>',shadow:!0,snap:Hb?25:10,style:{color:"#333333",cursor:"default",fontSize:"12px",padding:"8px",whiteSpace:"nowrap"}},credits:{enabled:!0,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",
|
||||
color:"#909090",fontSize:"9px"}}};var ca=L.plotOptions,T=ca.line;Ab();var Tb=/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*\)/,Ub=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,Vb=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,ya=function(a){var b=[],c,d;(function(a){a&&a.stops?d=Ua(a.stops,function(a){return ya(a[1])}):(c=Tb.exec(a))?b=[z(c[1]),z(c[2]),z(c[3]),parseFloat(c[4],10)]:(c=Ub.exec(a))?b=[z(c[1],16),z(c[2],16),z(c[3],
|
||||
16),1]:(c=Vb.exec(a))&&(b=[z(c[1]),z(c[2]),z(c[3]),1])})(a);return{get:function(c){var f;d?(f=w(a),f.stops=[].concat(f.stops),q(d,function(a,b){f.stops[b]=[f.stops[b][0],a.get(c)]})):f=b&&!isNaN(b[0])?c==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+")":c==="a"?b[3]:"rgba("+b.join(",")+")":a;return f},brighten:function(a){if(d)q(d,function(b){b.brighten(a)});else if(ia(a)&&a!==0){var c;for(c=0;c<3;c++)b[c]+=z(a*255),b[c]<0&&(b[c]=0),b[c]>255&&(b[c]=255)}return this},rgba:b,setOpacity:function(a){b[3]=a;return this}}};
|
||||
G.prototype={opacity:1,textProps:"fontSize,fontWeight,fontFamily,color,lineHeight,width,textDecoration,textShadow,HcTextStroke".split(","),init:function(a,b){this.element=b==="span"?$(b):x.createElementNS(xa,b);this.renderer=a},animate:function(a,b,c){b=p(b,va,!0);ab(this);if(b){b=w(b,{});if(c)b.complete=c;ib(this,a,b)}else this.attr(a),c&&c();return this},colorGradient:function(a,b,c){var d=this.renderer,e,f,g,h,i,j,k,l,m,n,o=[];a.linearGradient?f="linearGradient":a.radialGradient&&(f="radialGradient");
|
||||
if(f){g=a[f];h=d.gradients;j=a.stops;m=c.radialReference;La(g)&&(a[f]=g={x1:g[0],y1:g[1],x2:g[2],y2:g[3],gradientUnits:"userSpaceOnUse"});f==="radialGradient"&&m&&!s(g.gradientUnits)&&(g=w(g,{cx:m[0]-m[2]/2+g.cx*m[2],cy:m[1]-m[2]/2+g.cy*m[2],r:g.r*m[2],gradientUnits:"userSpaceOnUse"}));for(n in g)n!=="id"&&o.push(n,g[n]);for(n in j)o.push(j[n]);o=o.join(",");h[o]?a=h[o].attr("id"):(g.id=a="highcharts-"+tb++,h[o]=i=d.createElement(f).attr(g).add(d.defs),i.stops=[],q(j,function(a){a[1].indexOf("rgba")===
|
||||
0?(e=ya(a[1]),k=e.get("rgb"),l=e.get("a")):(k=a[1],l=1);a=d.createElement("stop").attr({offset:a[0],"stop-color":k,"stop-opacity":l}).add(i);i.stops.push(a)}));c.setAttribute(b,"url("+d.url+"#"+a+")")}},attr:function(a,b){var c,d,e=this.element,f,g=this,h;typeof a==="string"&&b!==t&&(c=a,a={},a[c]=b);if(typeof a==="string")g=(this[a+"Getter"]||this._defaultGetter).call(this,a,e);else{for(c in a){d=a[c];h=!1;this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(f||(this.symbolAttr(a),
|
||||
f=!0),h=!0);if(this.rotation&&(c==="x"||c==="y"))this.doTransform=!0;h||(this[c+"Setter"]||this._defaultSetter).call(this,d,c,e);this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,d)}if(this.doTransform)this.updateTransform(),this.doTransform=!1}return g},updateShadows:function(a,b){for(var c=this.shadows,d=c.length;d--;)c[d].setAttribute(a,a==="height"?u(b-(c[d].cutHeight||0),0):a==="d"?this.d:b)},addClass:function(a){var b=this.element,c=F(b,"class")||
|
||||
"";c.indexOf(a)===-1&&F(b,"class",c+" "+a);return this},symbolAttr:function(a){var b=this;q("x,y,r,start,end,width,height,innerR,anchorX,anchorY".split(","),function(c){b[c]=p(a[c],b[c])});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+")":P)},crisp:function(a){var b,c={},d,e=a.strokeWidth||this.strokeWidth||0;d=v(e)%2/2;a.x=U(a.x||this.x||0)+d;a.y=U(a.y||this.y||0)+d;a.width=U((a.width||this.width||
|
||||
0)-2*d);a.height=U((a.height||this.height||0)-2*d);a.strokeWidth=e;for(b in a)this[b]!==a[b]&&(this[b]=c[b]=a[b]);return c},css:function(a){var b=this.styles,c={},d=this.element,e,f,g="";e=!b;if(a&&a.color)a.fill=a.color;if(b)for(f in a)a[f]!==b[f]&&(c[f]=a[f],e=!0);if(e){e=this.textWidth=a&&a.width&&d.nodeName.toLowerCase()==="text"&&z(a.width);b&&(a=r(b,c));this.styles=a;e&&(ga||!ba&&this.renderer.forExport)&&delete a.width;if(Aa&&!ba)A(this.element,a);else{b=function(a,b){return"-"+b.toLowerCase()};
|
||||
for(f in a)g+=f.replace(/([A-Z])/g,b)+":"+a[f]+";";F(d,"style",g)}e&&this.added&&this.renderer.buildText(this)}return this},on:function(a,b){var c=this,d=c.element;Za&&a==="click"?(d.ontouchstart=function(a){c.touchEventFired=Date.now();a.preventDefault();b.call(d,a)},d.onclick=function(a){(wa.indexOf("Android")===-1||Date.now()-(c.touchEventFired||0)>1100)&&b.call(d,a)}):d["on"+a]=b;return this},setRadialReference:function(a){this.element.radialReference=a;return this},translate:function(a,b){return this.attr({translateX:a,
|
||||
translateY:b})},invert:function(){this.inverted=!0;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||0,c=this.scaleX,d=this.scaleY,e=this.inverted,f=this.rotation,g=this.element;e&&(a+=this.attr("width"),b+=this.attr("height"));a=["translate("+a+","+b+")"];e?a.push("rotate(90) scale(-1,1)"):f&&a.push("rotate("+f+" "+(g.getAttribute("x")||0)+" "+(g.getAttribute("y")||0)+")");(s(c)||s(d))&&a.push("scale("+p(c,1)+" "+p(d,1)+")");a.length&&g.setAttribute("transform",
|
||||
a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){var d,e,f,g,h={};e=this.renderer;f=e.alignedObjects;if(a){if(this.alignOptions=a,this.alignByTranslate=b,!c||Fa(c))this.alignTo=d=c||"renderer",ka(f,this),f.push(this),c=null}else a=this.alignOptions,b=this.alignByTranslate,d=this.alignTo;c=p(c,e[d],e);d=a.align;e=a.verticalAlign;f=(c.x||0)+(a.x||0);g=(c.y||0)+(a.y||0);if(d==="right"||d==="center")f+=(c.width-(a.width||0))/{right:1,center:2}[d];
|
||||
h[b?"translateX":"x"]=v(f);if(e==="bottom"||e==="middle")g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=v(g);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(){var a=this.bBox,b=this.renderer,c,d,e=this.rotation;c=this.element;var f=this.styles,g=e*Ca;d=this.textStr;var h;if(d===""||Ob.test(d))h="num."+d.toString().length+(f?"|"+f.fontSize+"|"+f.fontFamily:"");h&&(a=b.cache[h]);if(!a){if(c.namespaceURI===xa||b.forExport){try{a=
|
||||
c.getBBox?r({},c.getBBox()):{width:c.offsetWidth,height:c.offsetHeight}}catch(i){}if(!a||a.width<0)a={width:0,height:0}}else a=this.htmlGetBBox();if(b.isSVG){c=a.width;d=a.height;if(Aa&&f&&f.fontSize==="11px"&&d.toPrecision(3)==="16.9")a.height=d=14;if(e)a.width=Q(d*fa(g))+Q(c*aa(g)),a.height=Q(d*aa(g))+Q(c*fa(g))}this.bBox=a;h&&(b.cache[h]=a)}return a},show:function(a){return a&&this.element.namespaceURI===xa?(this.element.removeAttribute("visibility"),this):this.attr({visibility:a?"inherit":"visible"})},
|
||||
hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var b=this;b.animate({opacity:0},{duration:a||150,complete:function(){b.hide()}})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=this.element,f=this.zIndex,g,h;if(a)this.parentGroup=a;this.parentInverted=a&&a.inverted;this.textStr!==void 0&&b.buildText(this);if(f)c.handleZ=!0,f=z(f);if(c.handleZ){a=d.childNodes;for(g=0;g<a.length;g++)if(b=a[g],c=F(b,"zIndex"),b!==e&&(z(c)>f||!s(f)&&s(c))){d.insertBefore(e,
|
||||
b);h=!0;break}}h||d.appendChild(e);this.added=!0;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||{},c=a.shadows,d=a.renderer.isSVG&&b.nodeName==="SPAN"&&a.parentGroup,e,f;b.onclick=b.onmouseout=b.onmouseover=b.onmousemove=b.point=null;ab(a);if(a.clipPath)a.clipPath=a.clipPath.destroy();if(a.stops){for(f=0;f<a.stops.length;f++)a.stops[f]=a.stops[f].destroy();a.stops=null}a.safeRemoveChild(b);for(c&&
|
||||
q(c,function(b){a.safeRemoveChild(b)});d&&d.div&&d.div.childNodes.length===0;)b=d.parentGroup,a.safeRemoveChild(d.div),delete d.div,d=b;a.alignTo&&ka(a.renderer.alignedObjects,a);for(e in a)delete a[e];return null},shadow:function(a,b,c){var d=[],e,f,g=this.element,h,i,j,k;if(a){i=p(a.width,3);j=(a.opacity||0.15)/i;k=this.parentInverted?"(-1,-1)":"("+p(a.offsetX,1)+", "+p(a.offsetY,1)+")";for(e=1;e<=i;e++){f=g.cloneNode(0);h=i*2+1-2*e;F(f,{isShadow:"true",stroke:a.color||"black","stroke-opacity":j*
|
||||
e,"stroke-width":h,transform:"translate"+k,fill:P});if(c)F(f,"height",u(F(f,"height")-h,0)),f.cutHeight=h;b?b.element.appendChild(f):g.parentNode.insertBefore(f,g);d.push(f)}this.shadows=d}return this},xGetter:function(a){this.element.nodeName==="circle"&&(a={x:"cx",y:"cy"}[a]||a);return this._defaultGetter(a)},_defaultGetter:function(a){a=p(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,b,c){a&&a.join&&(a=a.join(" "));
|
||||
/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");c.setAttribute(b,a);this[b]=a},dashstyleSetter:function(a){var b;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(/,$/,"").replace("solid",1).split(",");for(b=a.length;b--;)a[b]=z(a[b])*this["stroke-width"];a=a.join(",");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",
|
||||
{left:"start",center:"middle",right:"end"}[a])},opacitySetter:function(a,b,c){this[b]=a;c.setAttribute(b,a)},titleSetter:function(a){var b=this.element.getElementsByTagName("title")[0];b||(b=x.createElementNS(xa,"title"),this.element.appendChild(b));b.textContent=a},textSetter:function(a){if(a!==this.textStr)delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this)},fillSetter:function(a,b,c){typeof a==="string"?c.setAttribute(b,a):a&&this.colorGradient(a,b,c)},zIndexSetter:function(a,
|
||||
b,c){c.setAttribute(b,a);this[b]=a},_defaultSetter:function(a,b,c){c.setAttribute(b,a)}};G.prototype.yGetter=G.prototype.xGetter;G.prototype.translateXSetter=G.prototype.translateYSetter=G.prototype.rotationSetter=G.prototype.verticalAlignSetter=G.prototype.scaleXSetter=G.prototype.scaleYSetter=function(a,b){this[b]=a;this.doTransform=!0};G.prototype["stroke-widthSetter"]=G.prototype.strokeSetter=function(a,b,c){this[b]=a;if(this.stroke&&this["stroke-width"])this.strokeWidth=this["stroke-width"],
|
||||
G.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0;else if(b==="stroke-width"&&a===0&&this.hasStroke)c.removeAttribute("stroke"),this.hasStroke=!1};var ta=function(){this.init.apply(this,arguments)};ta.prototype={Element:G,init:function(a,b,c,d,e){var f=location,g,d=this.createElement("svg").attr({version:"1.1"}).css(this.getStyle(d));g=d.element;a.appendChild(g);a.innerHTML.indexOf("xmlns")===-1&&F(g,"xmlns",xa);this.isSVG=
|
||||
!0;this.box=g;this.boxWrapper=d;this.alignedObjects=[];this.url=(Ta||sb)&&x.getElementsByTagName("base").length?f.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(x.createTextNode("Created with Highcharts 4.0.3"));this.defs=this.createElement("defs").add();this.forExport=e;this.gradients={};this.cache={};this.setSize(b,c,!1);var h;if(Ta&&a.getBoundingClientRect)this.subPixelFix=b=function(){A(a,{left:0,top:0});h=a.getBoundingClientRect();
|
||||
A(a,{left:Ka(h.left)-h.left+"px",top:Ka(h.top)-h.top+"px"})},b(),N(H,"resize",b)},getStyle:function(a){return this.style=r({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();Oa(this.gradients||{});this.gradients=null;if(a)this.defs=a.destroy();this.subPixelFix&&X(H,"resize",this.subPixelFix);return this.alignedObjects=
|
||||
null},createElement:function(a){var b=new this.Element;b.init(this,a);return b},draw:function(){},buildText:function(a){for(var b=a.element,c=this,d=c.forExport,e=p(a.textStr,"").toString(),f=e.indexOf("<")!==-1,g=b.childNodes,h,i,j=F(b,"x"),k=a.styles,l=a.textWidth,m=k&&k.lineHeight,n=k&&k.HcTextStroke,o=g.length,Y=function(a){return m?z(m):c.fontMetrics(/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:k&&k.fontSize||c.style.fontSize||12,a).h};o--;)b.removeChild(g[o]);!f&&!n&&e.indexOf(" ")===
|
||||
-1?b.appendChild(x.createTextNode(e)):(h=/<.*style="([^"]+)".*>/,i=/<.*href="(http[^"]+)".*>/,l&&!a.added&&this.box.appendChild(b),e=f?e.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g):[e],e[e.length-1]===""&&e.pop(),q(e,function(e,f){var g,m=0,e=e.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");g=e.split("|||");q(g,function(e){if(e!==
|
||||
""||g.length===1){var n={},o=x.createElementNS(xa,"tspan"),p;h.test(e)&&(p=e.match(h)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),F(o,"style",p));i.test(e)&&!d&&(F(o,"onclick",'location.href="'+e.match(i)[1]+'"'),A(o,{cursor:"pointer"}));e=(e.replace(/<(.|\n)*?>/g,"")||" ").replace(/</g,"<").replace(/>/g,">");if(e!==" "){o.appendChild(x.createTextNode(e));if(m)n.dx=0;else if(f&&j!==null)n.x=j;F(o,n);b.appendChild(o);!m&&f&&(!ba&&d&&A(o,{display:"block"}),F(o,"dy",Y(o)));if(l)for(var e=e.replace(/([^\^])-/g,
|
||||
"$1- ").split(" "),n=g.length>1||e.length>1&&k.whiteSpace!=="nowrap",q,E,s=k.HcHeight,u=[],t=Y(o),Kb=1;n&&(e.length||u.length);)delete a.bBox,q=a.getBBox(),E=q.width,!ba&&c.forExport&&(E=c.measureSpanWidth(o.firstChild.data,a.styles)),q=E>l,!q||e.length===1?(e=u,u=[],e.length&&(Kb++,s&&Kb*t>s?(e=["..."],a.attr("title",a.textStr)):(o=x.createElementNS(xa,"tspan"),F(o,{dy:t,x:j}),p&&F(o,"style",p),b.appendChild(o))),E>l&&(l=E)):(o.removeChild(o.firstChild),u.unshift(e.pop())),e.length&&o.appendChild(x.createTextNode(e.join(" ").replace(/- /g,
|
||||
"-")));m++}}})}))},button:function(a,b,c,d,e,f,g,h,i){var j=this.label(a,b,c,i,null,null,null,null,"button"),k=0,l,m,n,o,p,q,a={x1:0,y1:0,x2:0,y2:1},e=w({"stroke-width":1,stroke:"#CCCCCC",fill:{linearGradient:a,stops:[[0,"#FEFEFE"],[1,"#F6F6F6"]]},r:2,padding:5,style:{color:"black"}},e);n=e.style;delete e.style;f=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#FFF"],[1,"#ACF"]]}},f);o=f.style;delete f.style;g=w(e,{stroke:"#68A",fill:{linearGradient:a,stops:[[0,"#9BD"],[1,"#CDF"]]}},g);p=g.style;
|
||||
delete g.style;h=w(e,{style:{color:"#CCC"}},h);q=h.style;delete h.style;N(j.element,Aa?"mouseover":"mouseenter",function(){k!==3&&j.attr(f).css(o)});N(j.element,Aa?"mouseout":"mouseleave",function(){k!==3&&(l=[e,f,g][k],m=[n,o,p][k],j.attr(l).css(m))});j.setState=function(a){(j.state=k=a)?a===2?j.attr(g).css(p):a===3&&j.attr(h).css(q):j.attr(e).css(n)};return j.on("click",function(){k!==3&&d.call(j)}).attr(e).css(r({cursor:"default"},n))},crispLine:function(a,b){a[1]===a[4]&&(a[1]=a[4]=v(a[1])-b%
|
||||
2/2);a[2]===a[5]&&(a[2]=a[5]=v(a[2])+b%2/2);return a},path:function(a){var b={fill:P};La(a)?b.d=a:da(a)&&r(b,a);return this.createElement("path").attr(b)},circle:function(a,b,c){a=da(a)?a:{x:a,y:b,r:c};b=this.createElement("circle");b.xSetter=function(a){this.element.setAttribute("cx",a)};b.ySetter=function(a){this.element.setAttribute("cy",a)};return b.attr(a)},arc:function(a,b,c,d,e,f){if(da(a))b=a.y,c=a.r,d=a.innerR,e=a.start,f=a.end,a=a.x;a=this.symbol("arc",a||0,b||0,c||0,c||0,{innerR:d||0,start:e||
|
||||
0,end:f||0});a.r=c;return a},rect:function(a,b,c,d,e,f){var e=da(a)?a.r:e,g=this.createElement("rect"),a=da(a)?a:a===t?{}:{x:a,y:b,width:u(c,0),height:u(d,0)};if(f!==t)a.strokeWidth=f,a=g.crisp(a);if(e)a.r=e;g.rSetter=function(a){F(this.element,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[p(c,!0)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){var b=this.createElement("g");return s(a)?
|
||||
b.attr({"class":"highcharts-"+a}):b},image:function(a,b,c,d,e){var f={preserveAspectRatio:P};arguments.length>1&&r(f,{x:b,y:c,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e,f){var g,h=this.symbols[a],h=h&&h(v(b),v(c),d,e,f),i=/^url\((.*?)\)$/,j,k;if(h)g=this.path(h),r(g,{symbolName:a,x:b,y:c,width:d,height:e}),f&&r(g,f);else if(i.test(a))k=
|
||||
function(a,b){a.element&&(a.attr({width:b[0],height:b[1]}),a.alignByTranslate||a.translate(v((d-b[0])/2),v((e-b[1])/2)))},j=a.match(i)[1],a=Ib[j],g=this.image(j).attr({x:b,y:c}),g.isImg=!0,a?k(g,a):(g.attr({width:0,height:0}),$("img",{onload:function(){k(g,Ib[j]=[this.width,this.height])},src:j}));return g},symbols:{circle:function(a,b,c,d){var e=0.166*c;return["M",a+c/2,b,"C",a+c+e,b,a+c+e,b+d,a+c/2,b+d,"C",a-e,b+d,a-e,b,a+c/2,b,"Z"]},square:function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c,b+d,a,b+
|
||||
d,"Z"]},triangle:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d,a,b+d,"Z"]},"triangle-down":function(a,b,c,d){return["M",a,b,"L",a+c,b,a+c/2,b+d,"Z"]},diamond:function(a,b,c,d){return["M",a+c/2,b,"L",a+c,b+d/2,a+c/2,b+d,a,b+d/2,"Z"]},arc:function(a,b,c,d,e){var f=e.start,c=e.r||c||d,g=e.end-0.001,d=e.innerR,h=e.open,i=aa(f),j=fa(f),k=aa(g),g=fa(g),e=e.end-f<na?0:1;return["M",a+c*i,b+c*j,"A",c,c,0,e,1,a+c*k,b+c*g,h?"M":"L",a+d*k,b+d*g,"A",d,d,0,e,0,a+d*i,b+d*j,h?"":"Z"]},callout:function(a,b,c,d,
|
||||
e){var f=C(e&&e.r||0,c,d),g=f+6,h=e&&e.anchorX,i=e&&e.anchorY,e=v(e.strokeWidth||0)%2/2;a+=e;b+=e;e=["M",a+f,b,"L",a+c-f,b,"C",a+c,b,a+c,b,a+c,b+f,"L",a+c,b+d-f,"C",a+c,b+d,a+c,b+d,a+c-f,b+d,"L",a+f,b+d,"C",a,b+d,a,b+d,a,b+d-f,"L",a,b+f,"C",a,b,a,b,a+f,b];h&&h>c&&i>b+g&&i<b+d-g?e.splice(13,3,"L",a+c,i-6,a+c+6,i,a+c,i+6,a+c,b+d-f):h&&h<0&&i>b+g&&i<b+d-g?e.splice(33,3,"L",a,i+6,a-6,i,a,i-6,a,b+f):i&&i>d&&h>a+g&&h<a+c-g?e.splice(23,3,"L",h+6,b+d,h,b+d+6,h-6,b+d,a+f,b+d):i&&i<0&&h>a+g&&h<a+c-g&&e.splice(3,
|
||||
3,"L",h-6,b,h,b-6,h+6,b,c-f,b);return e}},clipRect:function(a,b,c,d){var e="highcharts-"+tb++,f=this.createElement("clipPath").attr({id:e}).add(this.defs),a=this.rect(a,b,c,d,0).add(f);a.id=e;a.clipPath=f;return a},text:function(a,b,c,d){var e=ga||!ba&&this.forExport,f={};if(d&&!this.forExport)return this.html(a,b,c);f.x=Math.round(b||0);if(c)f.y=Math.round(c);if(a||a===0)f.text=a;a=this.createElement("text").attr(f);e&&a.css({position:"absolute"});if(!d)a.xSetter=function(a,b,c){var d=c.getElementsByTagName("tspan"),
|
||||
e,f=c.getAttribute(b),m;for(m=0;m<d.length;m++)e=d[m],e.getAttribute(b)===f&&e.setAttribute(b,a);c.setAttribute(b,a)};return a},fontMetrics:function(a,b){a=a||this.style.fontSize;if(b&&H.getComputedStyle)b=b.element||b,a=H.getComputedStyle(b,"").fontSize;var a=/px/.test(a)?z(a):/em/.test(a)?parseFloat(a)*12:12,c=a<24?a+4:v(a*1.2),d=v(c*0.8);return{h:c,b:d,f:a}},label:function(a,b,c,d,e,f,g,h,i){function j(){var a,b;a=o.element.style;E=(u===void 0||wb===void 0||n.styles.textAlign)&&o.textStr&&o.getBBox();
|
||||
n.width=(u||E.width||0)+2*D+jb;n.height=(wb||E.height||0)+2*D;R=D+m.fontMetrics(a&&a.fontSize,o).b;if(z){if(!p)a=v(-I*D),b=h?-R:0,n.box=p=d?m.symbol(d,a,b,n.width,n.height,y):m.rect(a,b,n.width,n.height,0,y[Pb]),p.attr("fill",P).add(n);p.isImg||p.attr(r({width:v(n.width),height:v(n.height)},y));y=null}}function k(){var a=n.styles,a=a&&a.textAlign,b=jb+D*(1-I),c;c=h?0:R;if(s(u)&&E&&(a==="center"||a==="right"))b+={center:0.5,right:1}[a]*(u-E.width);if(b!==o.x||c!==o.y)o.attr("x",b),c!==t&&o.attr("y",
|
||||
c);o.x=b;o.y=c}function l(a,b){p?p.attr(a,b):y[a]=b}var m=this,n=m.g(i),o=m.text("",0,0,g).attr({zIndex:1}),p,E,I=0,D=3,jb=0,u,wb,xb,x,Jb=0,y={},R,z;n.onAdd=function(){o.add(n);n.attr({text:a||"",x:b,y:c});p&&s(e)&&n.attr({anchorX:e,anchorY:f})};n.widthSetter=function(a){u=a};n.heightSetter=function(a){wb=a};n.paddingSetter=function(a){s(a)&&a!==D&&(D=a,k())};n.paddingLeftSetter=function(a){s(a)&&a!==jb&&(jb=a,k())};n.alignSetter=function(a){I={left:0,center:0.5,right:1}[a]};n.textSetter=function(a){a!==
|
||||
t&&o.textSetter(a);j();k()};n["stroke-widthSetter"]=function(a,b){a&&(z=!0);Jb=a%2/2;l(b,a)};n.strokeSetter=n.fillSetter=n.rSetter=function(a,b){b==="fill"&&a&&(z=!0);l(b,a)};n.anchorXSetter=function(a,b){e=a;l(b,a+Jb-xb)};n.anchorYSetter=function(a,b){f=a;l(b,a-x)};n.xSetter=function(a){n.x=a;I&&(a-=I*((u||E.width)+D));xb=v(a);n.attr("translateX",xb)};n.ySetter=function(a){x=n.y=v(a);n.attr("translateY",x)};var C=n.css;return r(n,{css:function(a){if(a){var b={},a=w(a);q(n.textProps,function(c){a[c]!==
|
||||
t&&(b[c]=a[c],delete a[c])});o.css(b)}return C.call(n,a)},getBBox:function(){return{width:E.width+2*D,height:E.height+2*D,x:E.x-D,y:E.y-D}},shadow:function(a){p&&p.shadow(a);return n},destroy:function(){X(n.element,"mouseenter");X(n.element,"mouseleave");o&&(o=o.destroy());p&&(p=p.destroy());G.prototype.destroy.call(n);n=m=j=k=l=null}})}};Ya=ta;r(G.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width)delete a.width,this.textWidth=b,this.updateTransform();this.styles=
|
||||
r(this.styles,a);A(this.element,a);return this},htmlGetBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position="absolute";b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,c=this.translateX||0,d=this.translateY||0,e=this.x||0,f=this.y||0,g=this.textAlign||"left",h={left:0,center:0.5,right:1}[g],i=this.shadows;A(b,{marginLeft:c,marginTop:d});
|
||||
i&&q(i,function(a){A(a,{marginLeft:c+1,marginTop:d+1})});this.inverted&&q(b.childNodes,function(c){a.invertChild(c,b)});if(b.tagName==="SPAN"){var j=this.rotation,k,l=z(this.textWidth),m=[j,g,b.innerHTML,this.textWidth].join(",");if(m!==this.cTT){k=a.fontMetrics(b.style.fontSize).b;s(j)&&this.setSpanRotation(j,h,k);i=p(this.elemWidth,b.offsetWidth);if(i>l&&/[ \-]/.test(b.textContent||b.innerText))A(b,{width:l+"px",display:"block",whiteSpace:"normal"}),i=l;this.getSpanCorrection(i,k,h,j,g)}A(b,{left:e+
|
||||
(this.xCorr||0)+"px",top:f+(this.yCorr||0)+"px"});if(sb)k=b.offsetHeight;this.cTT=m}}else this.alignOnAdd=!0},setSpanRotation:function(a,b,c){var d={},e=Aa?"-ms-transform":sb?"-webkit-transform":Ta?"MozTransform":Gb?"-o-transform":"";d[e]=d.transform="rotate("+a+"deg)";d[e+(Ta?"Origin":"-origin")]=d.transformOrigin=b*100+"% "+c+"px";A(this.element,d)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});r(ta.prototype,{html:function(a,b,c){var d=this.createElement("span"),e=d.element,
|
||||
f=d.renderer;d.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a};d.xSetter=d.ySetter=d.alignSetter=d.rotationSetter=function(a,b){b==="align"&&(b="textAlign");d[b]=a;d.htmlUpdateTransform()};d.attr({text:a,x:v(b),y:v(c)}).css({position:"absolute",whiteSpace:"nowrap",fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});d.css=d.htmlCss;if(f.isSVG)d.add=function(a){var b,c=f.box.parentNode,j=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)j.push(a),a=a.parentGroup;
|
||||
q(j.reverse(),function(a){var d;b=a.div=a.div||$(Ja,{className:F(a.element,"class")},{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px"},b||c);d=b.style;r(a,{translateXSetter:function(b,c){d.left=b+"px";a[c]=b;a.doTransform=!0},translateYSetter:function(b,c){d.top=b+"px";a[c]=b;a.doTransform=!0},visibilitySetter:function(a,b){d[b]=a}})})}}else b=c;b.appendChild(e);d.added=!0;d.alignOnAdd&&d.htmlUpdateTransform();return d};return d}});var Z;if(!ba&&!ga){Z={init:function(a,
|
||||
b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ","absolute",";"],e=b===Ja;(b==="shape"||e)&&d.push("left:0;top:0;width:1px;height:1px;");d.push("visibility: ",e?"hidden":"visible");c.push(' style="',d.join(""),'"/>');if(b)c=e||b==="span"||b==="img"?c.join(""):a.prepVML(c),this.element=$(c);this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box,d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);d.appendChild(c);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&
|
||||
this.updateTransform();if(this.onAdd)this.onAdd();return this},updateTransform:G.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,b=aa(a*Ca),c=fa(a*Ca);A(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",b,", M12=",-c,", M21=",c,", M22=",b,", sizingMethod='auto expand')"].join(""):P})},getSpanCorrection:function(a,b,c,d,e){var f=d?aa(d*Ca):1,g=d?fa(d*Ca):0,h=p(this.elemHeight,this.element.offsetHeight),i;this.xCorr=f<0&&-a;this.yCorr=g<0&&-h;i=f*g<
|
||||
0;this.xCorr+=g*b*(i?1-c:c);this.yCorr-=f*b*(d?i?c:1-c:1);e&&e!=="left"&&(this.xCorr-=a*c*(f<0?-1:1),d&&(this.yCorr-=h*c*(g<0?-1:1)),A(this.element,{textAlign:e}))},pathToVML:function(a){for(var b=a.length,c=[];b--;)if(ia(a[b]))c[b]=v(a[b]*10)-5;else if(a[b]==="Z")c[b]="x";else if(c[b]=a[b],a.isArc&&(a[b]==="wa"||a[b]==="at"))c[b+5]===c[b+7]&&(c[b+7]+=a[b+7]>a[b+5]?1:-1),c[b+6]===c[b+8]&&(c[b+8]+=a[b+8]>a[b+6]?1:-1);return c.join(" ")||"x"},clip:function(a){var b=this,c;a?(c=a.members,ka(c,b),c.push(b),
|
||||
b.destroyClip=function(){ka(c,b)},a=a.getCSS(b)):(b.destroyClip&&b.destroyClip(),a={clip:gb?"inherit":"rect(auto)"});return b.css(a)},css:G.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&Pa(a)},destroy:function(){this.destroyClip&&this.destroyClip();return G.prototype.destroy.apply(this)},on:function(a,b){this.element["on"+a]=function(){var a=H.event;a.target=a.srcElement;b(a)};return this},cutOffPath:function(a,b){var c,a=a.split(/[ ,]/);c=a.length;if(c===9||c===11)a[c-4]=a[c-2]=z(a[c-
|
||||
2])-10*b;return a.join(" ")},shadow:function(a,b,c){var d=[],e,f=this.element,g=this.renderer,h,i=f.style,j,k=f.path,l,m,n,o;k&&typeof k.value!=="string"&&(k="x");m=k;if(a){n=p(a.width,3);o=(a.opacity||0.15)/n;for(e=1;e<=3;e++){l=n*2+1-2*e;c&&(m=this.cutOffPath(k.value,l+0.5));j=['<shape isShadow="true" strokeweight="',l,'" filled="false" path="',m,'" coordsize="10 10" style="',f.style.cssText,'" />'];h=$(g.prepVML(j),null,{left:z(i.left)+p(a.offsetX,1),top:z(i.top)+p(a.offsetY,1)});if(c)h.cutOff=
|
||||
l+1;j=['<stroke color="',a.color||"black",'" opacity="',o*e,'"/>'];$(g.prepVML(j),null,null,h);b?b.element.appendChild(h):f.parentNode.insertBefore(h,f);d.push(h)}this.shadows=d}return this},updateShadows:sa,setAttr:function(a,b){gb?this.element[a]=b:this.element.setAttribute(a,b)},classSetter:function(a){this.element.className=a},dashstyleSetter:function(a,b,c){(c.getElementsByTagName("stroke")[0]||$(this.renderer.prepVML(["<stroke/>"]),null,null,c))[b]=a||"solid";this[b]=a},dSetter:function(a,b,
|
||||
c){var d=this.shadows,a=a||[];this.d=a.join&&a.join(" ");c.path=a=this.pathToVML(a);if(d)for(c=d.length;c--;)d[c].path=d[c].cutOff?this.cutOffPath(a,d[c].cutOff):a;this.setAttr(b,a)},fillSetter:function(a,b,c){var d=c.nodeName;if(d==="SPAN")c.style.color=a;else if(d!=="IMG")c.filled=a!==P,this.setAttr("fillcolor",this.renderer.color(a,c,b,this))},opacitySetter:sa,rotationSetter:function(a,b,c){c=c.style;this[b]=c[b]=a;c.left=-v(fa(a*Ca)+1)+"px";c.top=v(aa(a*Ca))+"px"},strokeSetter:function(a,b,c){this.setAttr("strokecolor",
|
||||
this.renderer.color(a,c,b))},"stroke-widthSetter":function(a,b,c){c.stroked=!!a;this[b]=a;ia(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,b){this.setAttr(b,a)},visibilitySetter:function(a,b,c){a==="inherit"&&(a="visible");this.shadows&&q(this.shadows,function(c){c.style[b]=a});c.nodeName==="DIV"&&(a=a==="hidden"?"-999em":0,gb||(c.style[b]=a?"visible":"hidden"),b="top");c.style[b]=a},xSetter:function(a,b,c){this[b]=a;b==="x"?b="left":b==="y"&&(b="top");this.updateClipping?(this[b]=
|
||||
a,this.updateClipping()):c.style[b]=a},zIndexSetter:function(a,b,c){c.style[b]=a}};S.VMLElement=Z=la(G,Z);Z.prototype.ySetter=Z.prototype.widthSetter=Z.prototype.heightSetter=Z.prototype.xSetter;var ha={Element:Z,isIE8:wa.indexOf("MSIE 8.0")>-1,init:function(a,b,c,d){var e;this.alignedObjects=[];d=this.createElement(Ja).css(r(this.getStyle(d),{position:"relative"}));e=d.element;a.appendChild(d.element);this.isVML=!0;this.box=e;this.boxWrapper=d;this.cache={};this.setSize(b,c,!1);if(!x.namespaces.hcv){x.namespaces.add("hcv",
|
||||
"urn:schemas-microsoft-com:vml");try{x.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(f){x.styleSheets[0].cssText+="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}}},isHidden:function(){return!this.box.offsetWidth},clipRect:function(a,b,c,d){var e=this.createElement(),f=da(a);return r(e,{members:[],left:(f?a.x:a)+1,top:(f?a.y:b)+1,width:(f?a.width:
|
||||
c)-1,height:(f?a.height:d)-1,getCSS:function(a){var b=a.element,c=b.nodeName,a=a.inverted,d=this.top-(c==="shape"?b.offsetTop:0),e=this.left,b=e+this.width,f=d+this.height,d={clip:"rect("+v(a?e:d)+"px,"+v(a?f:b)+"px,"+v(a?b:f)+"px,"+v(a?d:e)+"px)"};!a&&gb&&c==="DIV"&&r(d,{width:b+"px",height:f+"px"});return d},updateClipping:function(){q(e.members,function(a){a.element&&a.css(e.getCSS(a))})}})},color:function(a,b,c,d){var e=this,f,g=/^rgba/,h,i,j=P;a&&a.linearGradient?i="gradient":a&&a.radialGradient&&
|
||||
(i="pattern");if(i){var k,l,m=a.linearGradient||a.radialGradient,n,o,p,E,I,D="",a=a.stops,u,s=[],t=function(){h=['<fill colors="'+s.join(",")+'" opacity="',p,'" o:opacity2="',o,'" type="',i,'" ',D,'focus="100%" method="any" />'];$(e.prepVML(h),null,null,b)};n=a[0];u=a[a.length-1];n[0]>0&&a.unshift([0,n[1]]);u[0]<1&&a.push([1,u[1]]);q(a,function(a,b){g.test(a[1])?(f=ya(a[1]),k=f.get("rgb"),l=f.get("a")):(k=a[1],l=1);s.push(a[0]*100+"% "+k);b?(p=l,E=k):(o=l,I=k)});if(c==="fill")if(i==="gradient")c=
|
||||
m.x1||m[0]||0,a=m.y1||m[1]||0,n=m.x2||m[2]||0,m=m.y2||m[3]||0,D='angle="'+(90-V.atan((m-a)/(n-c))*180/na)+'"',t();else{var j=m.r,r=j*2,v=j*2,x=m.cx,y=m.cy,R=b.radialReference,w,j=function(){R&&(w=d.getBBox(),x+=(R[0]-w.x)/w.width-0.5,y+=(R[1]-w.y)/w.height-0.5,r*=R[2]/w.width,v*=R[2]/w.height);D='src="'+L.global.VMLRadialGradientURL+'" size="'+r+","+v+'" origin="0.5,0.5" position="'+x+","+y+'" color2="'+I+'" ';t()};d.added?j():d.onAdd=j;j=E}else j=k}else if(g.test(a)&&b.tagName!=="IMG")f=ya(a),h=
|
||||
["<",c,' opacity="',f.get("a"),'"/>'],$(this.prepVML(h),null,null,b),j=f.get("rgb");else{j=b.getElementsByTagName(c);if(j.length)j[0].opacity=1,j[0].type="solid";j=a}return j},prepVML:function(a){var b=this.isIE8,a=a.join("");b?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')):a=a.replace("<","<hcv:");
|
||||
return a},text:ta.prototype.html,path:function(a){var b={coordsize:"10 10"};La(a)?b.d=a:da(a)&&r(b,a);return this.createElement("shape").attr(b)},circle:function(a,b,c){var d=this.symbol("circle");if(da(a))c=a.r,b=a.y,a=a.x;d.isCircle=!0;d.r=c;return d.attr({x:a,y:b})},g:function(a){var b;a&&(b={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement(Ja).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.attr({x:b,y:c,width:d,
|
||||
height:e});return f},createElement:function(a){return a==="rect"?this.symbol(a):ta.prototype.createElement.call(this,a)},invertChild:function(a,b){var c=this,d=b.style,e=a.tagName==="IMG"&&a.style;A(a,{flip:"x",left:z(d.width)-(e?z(e.top):1),top:z(d.height)-(e?z(e.left):1),rotation:-90});q(a.childNodes,function(b){c.invertChild(b,a)})},symbols:{arc:function(a,b,c,d,e){var f=e.start,g=e.end,h=e.r||c||d,c=e.innerR,d=aa(f),i=fa(f),j=aa(g),k=fa(g);if(g-f===0)return["x"];f=["wa",a-h,b-h,a+h,b+h,a+h*d,
|
||||
b+h*i,a+h*j,b+h*k];e.open&&!c&&f.push("e","M",a,b);f.push("at",a-c,b-c,a+c,b+c,a+c*j,b+c*k,a+c*d,b+c*i,"x","e");f.isArc=!0;return f},circle:function(a,b,c,d,e){e&&(c=d=2*e.r);e&&e.isCircle&&(a-=c/2,b-=d/2);return["wa",a,b,a+c,b+d,a+c,b+d/2,a+c,b+d/2,"e"]},rect:function(a,b,c,d,e){return ta.prototype.symbols[!s(e)||!e.r?"square":"callout"].call(0,a,b,c,d,e)}}};S.VMLRenderer=Z=function(){this.init.apply(this,arguments)};Z.prototype=w(ta.prototype,ha);Ya=Z}ta.prototype.measureSpanWidth=function(a,b){var c=
|
||||
x.createElement("span"),d;d=x.createTextNode(a);c.appendChild(d);A(c,b);this.box.appendChild(c);d=c.offsetWidth;Pa(c);return d};var Lb;if(ga)S.CanVGRenderer=Z=function(){xa="http://www.w3.org/1999/xhtml"},Z.prototype.symbols={},Lb=function(){function a(){var a=b.length,d;for(d=0;d<a;d++)b[d]();b=[]}var b=[];return{push:function(c,d){b.length===0&&Qb(d,a);b.push(c)}}}(),Ya=Z;Sa.prototype={addLabel:function(){var a=this.axis,b=a.options,c=a.chart,d=a.horiz,e=a.categories,f=a.names,g=this.pos,h=b.labels,
|
||||
i=h.rotation,j=a.tickPositions,d=d&&e&&!h.step&&!h.staggerLines&&!h.rotation&&c.plotWidth/j.length||!d&&(c.margin[3]||c.chartWidth*0.33),k=g===j[0],l=g===j[j.length-1],m,f=e?p(e[g],f[g],g):g,e=this.label,n=j.info;a.isDatetimeAxis&&n&&(m=b.dateTimeLabelFormats[n.higherRanks[g]||n.unitName]);this.isFirst=k;this.isLast=l;b=a.labelFormatter.call({axis:a,chart:c,isFirst:k,isLast:l,dateTimeLabelFormat:m,value:a.isLog?ea(ja(f)):f});g=d&&{width:u(1,v(d-2*(h.padding||10)))+"px"};g=r(g,h.style);if(s(e))e&&
|
||||
e.attr({text:b}).css(g);else{m={align:a.labelAlign};if(ia(i))m.rotation=i;if(d&&h.ellipsis)g.HcHeight=a.len/j.length;this.label=e=s(b)&&h.enabled?c.renderer.text(b,0,0,h.useHTML).attr(m).css(g).add(a.labelGroup):null;a.tickBaseline=c.renderer.fontMetrics(h.style.fontSize,e).b;i&&a.side===2&&(a.tickBaseline*=aa(i*Ca))}this.yOffset=e?p(h.y,a.tickBaseline+(a.side===2?8:-(e.getBBox().height/2))):0},getLabelSize:function(){var a=this.label,b=this.axis;return a?a.getBBox()[b.horiz?"height":"width"]:0},
|
||||
getLabelSides:function(){var a=this.label.getBBox(),b=this.axis,c=b.horiz,d=b.options.labels,a=c?a.width:a.height,b=c?d.x-a*{left:0,center:0.5,right:1}[b.labelAlign]:0;return[b,c?a+b:a]},handleOverflow:function(a,b){var c=!0,d=this.axis,e=this.isFirst,f=this.isLast,g=d.horiz?b.x:b.y,h=d.reversed,i=d.tickPositions,j=this.getLabelSides(),k=j[0],j=j[1],l,m,n,o=this.label.line||0;l=d.labelEdge;m=d.justifyLabels&&(e||f);l[o]===t||g+k>l[o]?l[o]=g+j:m||(c=!1);if(m){l=(m=d.justifyToPlot)?d.pos:0;m=m?l+d.len:
|
||||
d.chart.chartWidth;do a+=e?1:-1,n=d.ticks[i[a]];while(i[a]&&(!n||!n.label||n.label.line!==o));d=n&&n.label.xy&&n.label.xy.x+n.getLabelSides()[e?0:1];e&&!h||f&&h?g+k<l&&(g=l-k,n&&g+j>d&&(c=!1)):g+j>m&&(g=m-j,n&&g+k<d&&(c=!1));b.x=g}return c},getPosition:function(a,b,c,d){var e=this.axis,f=e.chart,g=d&&f.oldChartHeight||f.chartHeight;return{x:a?e.translate(b+c,null,null,d)+e.transB:e.left+e.offset+(e.opposite?(d&&f.oldChartWidth||f.chartWidth)-e.right-e.left:0),y:a?g-e.bottom+e.offset-(e.opposite?e.height:
|
||||
0):g-e.translate(b+c,null,null,d)-e.transB}},getLabelPosition:function(a,b,c,d,e,f,g,h){var i=this.axis,j=i.transA,k=i.reversed,l=i.staggerLines,a=a+e.x-(f&&d?f*j*(k?-1:1):0),b=b+this.yOffset-(f&&!d?f*j*(k?1:-1):0);if(l)c.line=g/(h||1)%l,b+=c.line*(i.labelOffset/l);return{x:a,y:b}},getMarkPath:function(a,b,c,d,e,f){return f.crispLine(["M",a,b,"L",a+(e?0:-c),b+(e?c:0)],d)},render:function(a,b,c){var d=this.axis,e=d.options,f=d.chart.renderer,g=d.horiz,h=this.type,i=this.label,j=this.pos,k=e.labels,
|
||||
l=this.gridLine,m=h?h+"Grid":"grid",n=h?h+"Tick":"tick",o=e[m+"LineWidth"],q=e[m+"LineColor"],E=e[m+"LineDashStyle"],I=e[n+"Length"],m=e[n+"Width"]||0,D=e[n+"Color"],u=e[n+"Position"],n=this.mark,s=k.step,r=!0,v=d.tickmarkOffset,w=this.getPosition(g,j,v,b),x=w.x,w=w.y,y=g&&x===d.pos+d.len||!g&&w===d.pos?-1:1,c=p(c,1);this.isActive=!0;if(o){j=d.getPlotLinePath(j+v,o*y,b,!0);if(l===t){l={stroke:q,"stroke-width":o};if(E)l.dashstyle=E;if(!h)l.zIndex=1;if(b)l.opacity=0;this.gridLine=l=o?f.path(j).attr(l).add(d.gridGroup):
|
||||
null}if(!b&&l&&j)l[this.isNew?"attr":"animate"]({d:j,opacity:c})}if(m&&I)u==="inside"&&(I=-I),d.opposite&&(I=-I),h=this.getMarkPath(x,w,I,m*y,g,f),n?n.animate({d:h,opacity:c}):this.mark=f.path(h).attr({stroke:D,"stroke-width":m,opacity:c}).add(d.axisGroup);if(i&&!isNaN(x))i.xy=w=this.getLabelPosition(x,w,i,g,k,v,a,s),this.isFirst&&!this.isLast&&!p(e.showFirstLabel,1)||this.isLast&&!this.isFirst&&!p(e.showLastLabel,1)?r=!1:!d.isRadial&&!k.step&&!k.rotation&&!b&&c!==0&&(r=this.handleOverflow(a,w)),
|
||||
s&&a%s&&(r=!1),r&&!isNaN(w.y)?(w.opacity=c,i[this.isNew?"attr":"animate"](w),this.isNew=!1):i.attr("y",-9999)},destroy:function(){Oa(this,this.axis)}};S.PlotLineOrBand=function(a,b){this.axis=a;if(b)this.options=b,this.id=b.id};S.PlotLineOrBand.prototype={render:function(){var a=this,b=a.axis,c=b.horiz,d=(b.pointRange||0)/2,e=a.options,f=e.label,g=a.label,h=e.width,i=e.to,j=e.from,k=s(j)&&s(i),l=e.value,m=e.dashStyle,n=a.svgElem,o=[],p,q=e.color,I=e.zIndex,D=e.events,r={},t=b.chart.renderer;b.isLog&&
|
||||
(j=za(j),i=za(i),l=za(l));if(h){if(o=b.getPlotLinePath(l,h),r={stroke:q,"stroke-width":h},m)r.dashstyle=m}else if(k){j=u(j,b.min-d);i=C(i,b.max+d);o=b.getPlotBandPath(j,i,e);if(q)r.fill=q;if(e.borderWidth)r.stroke=e.borderColor,r["stroke-width"]=e.borderWidth}else return;if(s(I))r.zIndex=I;if(n)if(o)n.animate({d:o},null,n.onGetPath);else{if(n.hide(),n.onGetPath=function(){n.show()},g)a.label=g=g.destroy()}else if(o&&o.length&&(a.svgElem=n=t.path(o).attr(r).add(),D))for(p in d=function(b){n.on(b,function(c){D[b].apply(a,
|
||||
[c])})},D)d(p);if(f&&s(f.text)&&o&&o.length&&b.width>0&&b.height>0){f=w({align:c&&k&&"center",x:c?!k&&4:10,verticalAlign:!c&&k&&"middle",y:c?k?16:10:k?6:-4,rotation:c&&!k&&90},f);if(!g){r={align:f.textAlign||f.align,rotation:f.rotation};if(s(I))r.zIndex=I;a.label=g=t.text(f.text,0,0,f.useHTML).attr(r).css(f.style).add()}b=[o[1],o[4],k?o[6]:o[1]];k=[o[2],o[5],k?o[7]:o[2]];o=Na(b);c=Na(k);g.align(f,!1,{x:o,y:c,width:Ba(b)-o,height:Ba(k)-c});g.show()}else g&&g.hide();return a},destroy:function(){ka(this.axis.plotLinesAndBands,
|
||||
this);delete this.axis;Oa(this)}};ma.prototype={defaultOptions:{dateTimeLabelFormats:{millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:!1,gridLineColor:"#C0C0C0",labels:M,lineColor:"#C0D0E0",lineWidth:1,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickColor:"#C0D0E0",tickLength:10,
|
||||
tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#707070"}},type:"linear"},defaultYAxisOptions:{endOnTick:!0,gridLineWidth:1,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:!0,tickWidth:0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return Ga(this.total,-1)},style:M.style}},defaultLeftAxisOptions:{labels:{x:-15,y:null},title:{rotation:270}},
|
||||
defaultRightAxisOptions:{labels:{x:15,y:null},title:{rotation:90}},defaultBottomAxisOptions:{labels:{x:0,y:null},title:{rotation:0}},defaultTopAxisOptions:{labels:{x:0,y:-15},title:{rotation:0}},init:function(a,b){var c=b.isX;this.horiz=a.inverted?!c:c;this.coll=(this.isXAxis=c)?"xAxis":"yAxis";this.opposite=b.opposite;this.side=b.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(b);var d=this.options,e=d.type;this.labelFormatter=d.labels.formatter||this.defaultLabelFormatter;
|
||||
this.userOptions=b;this.minPixelPadding=0;this.chart=a;this.reversed=d.reversed;this.zoomEnabled=d.zoomEnabled!==!1;this.categories=d.categories||e==="category";this.names=[];this.isLog=e==="logarithmic";this.isDatetimeAxis=e==="datetime";this.isLinked=s(d.linkedTo);this.tickmarkOffset=this.categories&&d.tickmarkPlacement==="between"?0.5:0;this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=d.minRange||d.maxZoom;
|
||||
this.range=d.range;this.offset=d.offset||0;this.stacks={};this.oldStacks={};this.min=this.max=null;this.crosshair=p(d.crosshair,ra(a.options.tooltip.crosshairs)[c?0:1],!1);var f,d=this.options.events;Da(this,a.axes)===-1&&(c&&!this.isColorAxis?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];if(a.inverted&&c&&this.reversed===t)this.reversed=!0;this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(f in d)N(this,f,d[f]);if(this.isLog)this.val2lin=
|
||||
za,this.lin2val=ja},setOptions:function(a){this.options=w(this.defaultOptions,this.isXAxis?{}:this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(L[this.coll],a))},defaultLabelFormatter:function(){var a=this.axis,b=this.value,c=a.categories,d=this.dateTimeLabelFormat,e=L.lang.numericSymbols,f=e&&e.length,g,h=a.options.labels.format,a=a.isLog?b:a.tickInterval;if(h)g=Ia(h,this);else if(c)g=b;else if(d)g=
|
||||
bb(d,b);else if(f&&a>=1E3)for(;f--&&g===t;)c=Math.pow(1E3,f+1),a>=c&&e[f]!==null&&(g=Ga(b/c,-1)+e[f]);g===t&&(g=Q(b)>=1E4?Ga(b,0):Ga(b,-1,t,""));return g},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=null;a.buildStacks&&a.buildStacks();q(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries){var d;d=c.options.threshold;var e;a.hasVisibleSeries=!0;a.isLog&&d<=0&&(d=null);if(a.isXAxis){if(d=c.xData,d.length)a.dataMin=C(p(a.dataMin,d[0]),
|
||||
Na(d)),a.dataMax=u(p(a.dataMax,d[0]),Ba(d))}else{c.getExtremes();e=c.dataMax;c=c.dataMin;if(s(c)&&s(e))a.dataMin=C(p(a.dataMin,c),c),a.dataMax=u(p(a.dataMax,e),e);if(s(d))if(a.dataMin>=d)a.dataMin=d,a.ignoreMinPadding=!0;else if(a.dataMax<d)a.dataMax=d,a.ignoreMaxPadding=!0}}})},translate:function(a,b,c,d,e,f){var g=1,h=0,i=d?this.oldTransA:this.transA,d=d?this.oldMin:this.min,j=this.minPixelPadding,e=(this.options.ordinal||this.isLog&&e)&&this.lin2val;if(!i)i=this.transA;if(c)g*=-1,h=this.len;this.reversed&&
|
||||
(g*=-1,h-=g*(this.sector||this.len));b?(a=a*g+h,a-=j,a=a/i+d,e&&(a=this.lin2val(a))):(e&&(a=this.val2lin(a)),f==="between"&&(f=0.5),a=g*(a-d)*i+h+g*j+(ia(f)?i*f*this.pointRange:0));return a},toPixels:function(a,b){return this.translate(a,!1,!this.horiz,null,!0)+(b?0:this.pos)},toValue:function(a,b){return this.translate(a-(b?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,b,c,d,e){var f=this.chart,g=this.left,h=this.top,i,j,k=c&&f.oldChartHeight||f.chartHeight,l=c&&f.oldChartWidth||
|
||||
f.chartWidth,m;i=this.transB;e=p(e,this.translate(a,null,null,c));a=c=v(e+i);i=j=v(k-e-i);if(isNaN(e))m=!0;else if(this.horiz){if(i=h,j=k-this.bottom,a<g||a>g+this.width)m=!0}else if(a=g,c=l-this.right,i<h||i>h+this.height)m=!0;return m&&!d?null:f.renderer.crispLine(["M",a,i,"L",c,j],b||1)},getLinearTickPositions:function(a,b,c){var d,e=ea(U(b/a)*a),f=ea(Ka(c/a)*a),g=[];if(b===c&&ia(b))return[b];for(b=e;b<=f;){g.push(b);b=ea(b+a);if(b===d)break;d=b}return g},getMinorTickPositions:function(){var a=
|
||||
this.options,b=this.tickPositions,c=this.minorTickInterval,d=[],e;if(this.isLog){e=b.length;for(a=1;a<e;a++)d=d.concat(this.getLogTickPositions(c,b[a-1],b[a],!0))}else if(this.isDatetimeAxis&&a.minorTickInterval==="auto")d=d.concat(this.getTimeTicks(this.normalizeTimeTickInterval(c),this.min,this.max,a.startOfWeek)),d[0]<this.min&&d.shift();else for(b=this.min+(b[0]-this.min)%c;b<=this.max;b+=c)d.push(b);return d},adjustForMinRange:function(){var a=this.options,b=this.min,c=this.max,d,e=this.dataMax-
|
||||
this.dataMin>=this.minRange,f,g,h,i,j;if(this.isXAxis&&this.minRange===t&&!this.isLog)s(a.min)||s(a.max)?this.minRange=null:(q(this.series,function(a){i=a.xData;for(g=j=a.xIncrement?1:i.length-1;g>0;g--)if(h=i[g]-i[g-1],f===t||h<f)f=h}),this.minRange=C(f*5,this.dataMax-this.dataMin));if(c-b<this.minRange){var k=this.minRange;d=(k-c+b)/2;d=[b-d,p(a.min,b-d)];if(e)d[2]=this.dataMin;b=Ba(d);c=[b+k,p(a.max,b+k)];if(e)c[2]=this.dataMax;c=Na(c);c-b<k&&(d[0]=c-k,d[1]=p(a.min,c-k),b=Ba(d))}this.min=b;this.max=
|
||||
c},setAxisTranslation:function(a){var b=this,c=b.max-b.min,d=b.axisPointRange||0,e,f=0,g=0,h=b.linkedParent,i=!!b.categories,j=b.transA;if(b.isXAxis||i||d)h?(f=h.minPointOffset,g=h.pointRangePadding):q(b.series,function(a){var h=i?1:b.isXAxis?a.pointRange:b.axisPointRange||0,j=a.options.pointPlacement,n=a.closestPointRange;h>c&&(h=0);d=u(d,h);f=u(f,Fa(j)?0:h/2);g=u(g,j==="on"?0:h);!a.noSharedTooltip&&s(n)&&(e=s(e)?C(e,n):n)}),h=b.ordinalSlope&&e?b.ordinalSlope/e:1,b.minPointOffset=f*=h,b.pointRangePadding=
|
||||
g*=h,b.pointRange=C(d,c),b.closestPointRange=e;if(a)b.oldTransA=j;b.translationSlope=b.transA=j=b.len/(c+g||1);b.transB=b.horiz?b.left:b.bottom;b.minPixelPadding=j*f},setTickPositions:function(a){var b=this,c=b.chart,d=b.options,e=d.startOnTick,f=d.endOnTick,g=b.isLog,h=b.isDatetimeAxis,i=b.isXAxis,j=b.isLinked,k=b.options.tickPositioner,l=d.maxPadding,m=d.minPadding,n=d.tickInterval,o=d.minTickInterval,Y=d.tickPixelInterval,E,I=b.categories;j?(b.linkedParent=c[b.coll][d.linkedTo],c=b.linkedParent.getExtremes(),
|
||||
b.min=p(c.min,c.dataMin),b.max=p(c.max,c.dataMax),d.type!==b.linkedParent.options.type&&oa(11,1)):(b.min=p(b.userMin,d.min,b.dataMin),b.max=p(b.userMax,d.max,b.dataMax));if(g)!a&&C(b.min,p(b.dataMin,b.min))<=0&&oa(10,1),b.min=ea(za(b.min)),b.max=ea(za(b.max));if(b.range&&s(b.max))b.userMin=b.min=u(b.min,b.max-b.range),b.userMax=b.max,b.range=null;b.beforePadding&&b.beforePadding();b.adjustForMinRange();if(!I&&!b.axisPointRange&&!b.usePercentage&&!j&&s(b.min)&&s(b.max)&&(c=b.max-b.min)){if(!s(d.min)&&
|
||||
!s(b.userMin)&&m&&(b.dataMin<0||!b.ignoreMinPadding))b.min-=c*m;if(!s(d.max)&&!s(b.userMax)&&l&&(b.dataMax>0||!b.ignoreMaxPadding))b.max+=c*l}if(ia(d.floor))b.min=u(b.min,d.floor);if(ia(d.ceiling))b.max=C(b.max,d.ceiling);b.min===b.max||b.min===void 0||b.max===void 0?b.tickInterval=1:j&&!n&&Y===b.linkedParent.options.tickPixelInterval?b.tickInterval=b.linkedParent.tickInterval:(b.tickInterval=p(n,I?1:(b.max-b.min)*Y/u(b.len,Y)),!s(n)&&b.len<Y&&!this.isRadial&&!this.isLog&&!I&&e&&f&&(E=!0,b.tickInterval/=
|
||||
4));i&&!a&&q(b.series,function(a){a.processData(b.min!==b.oldMin||b.max!==b.oldMax)});b.setAxisTranslation(!0);b.beforeSetTickPositions&&b.beforeSetTickPositions();if(b.postProcessTickInterval)b.tickInterval=b.postProcessTickInterval(b.tickInterval);if(b.pointRange)b.tickInterval=u(b.pointRange,b.tickInterval);if(!n&&b.tickInterval<o)b.tickInterval=o;if(!h&&!g&&!n)b.tickInterval=mb(b.tickInterval,null,lb(b.tickInterval),d);b.minorTickInterval=d.minorTickInterval==="auto"&&b.tickInterval?b.tickInterval/
|
||||
5:d.minorTickInterval;b.tickPositions=a=d.tickPositions?[].concat(d.tickPositions):k&&k.apply(b,[b.min,b.max]);if(!a)!b.ordinalPositions&&(b.max-b.min)/b.tickInterval>u(2*b.len,200)&&oa(19,!0),a=h?b.getTimeTicks(b.normalizeTimeTickInterval(b.tickInterval,d.units),b.min,b.max,d.startOfWeek,b.ordinalPositions,b.closestPointRange,!0):g?b.getLogTickPositions(b.tickInterval,b.min,b.max):b.getLinearTickPositions(b.tickInterval,b.min,b.max),E&&a.splice(1,a.length-2),b.tickPositions=a;if(!j)d=a[0],g=a[a.length-
|
||||
1],h=b.minPointOffset||0,!e&&!f&&!I&&a.length===2&&a.splice(1,0,(g+d)/2),e?b.min=d:b.min-h>d&&a.shift(),f?b.max=g:b.max+h<g&&a.pop(),a.length===1&&(e=Q(b.max)>1E13?1:0.001,b.min-=e,b.max+=e)},setMaxTicks:function(){var a=this.chart,b=a.maxTicks||{},c=this.tickPositions,d=this._maxTicksKey=[this.coll,this.pos,this.len].join("-");if(!this.isLinked&&!this.isDatetimeAxis&&c&&c.length>(b[d]||0)&&this.options.alignTicks!==!1)b[d]=c.length;a.maxTicks=b},adjustTickAmount:function(){var a=this._maxTicksKey,
|
||||
b=this.tickPositions,c=this.chart.maxTicks;if(c&&c[a]&&!this.isDatetimeAxis&&!this.categories&&!this.isLinked&&this.options.alignTicks!==!1&&this.min!==t){var d=this.tickAmount,e=b.length;this.tickAmount=a=c[a];if(e<a){for(;b.length<a;)b.push(ea(b[b.length-1]+this.tickInterval));this.transA*=(e-1)/(a-1);this.max=b[b.length-1]}if(s(d)&&a!==d)this.isDirty=!0}},setScale:function(){var a=this.stacks,b,c,d,e;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();e=this.len!==
|
||||
this.oldAxisLength;q(this.series,function(a){if(a.isDirtyData||a.isDirty||a.xAxis.isDirty)d=!0});if(e||d||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax){if(!this.isXAxis)for(b in a)for(c in a[b])a[b][c].total=null,a[b][c].cum=0;this.forceRedraw=!1;this.getSeriesExtremes();this.setTickPositions();this.oldUserMin=this.userMin;this.oldUserMax=this.userMax;if(!this.isDirty)this.isDirty=e||this.min!==this.oldMin||this.max!==this.oldMax}else if(!this.isXAxis){if(this.oldStacks)a=
|
||||
this.stacks=this.oldStacks;for(b in a)for(c in a[b])a[b][c].cum=a[b][c].total}this.setMaxTicks()},setExtremes:function(a,b,c,d,e){var f=this,g=f.chart,c=p(c,!0),e=r(e,{min:a,max:b});K(f,"setExtremes",e,function(){f.userMin=a;f.userMax=b;f.eventArgs=e;f.isDirtyExtremes=!0;c&&g.redraw(d)})},zoom:function(a,b){var c=this.dataMin,d=this.dataMax,e=this.options;this.allowZoomOutside||(s(c)&&a<=C(c,p(e.min,c))&&(a=t),s(d)&&b>=u(d,p(e.max,d))&&(b=t));this.displayBtn=a!==t||b!==t;this.setExtremes(a,b,!1,t,
|
||||
{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,b=this.options,c=b.offsetLeft||0,d=this.horiz,e=p(b.width,a.plotWidth-c+(b.offsetRight||0)),f=p(b.height,a.plotHeight),g=p(b.top,a.plotTop),b=p(b.left,a.plotLeft+c),c=/%$/;c.test(f)&&(f=parseInt(f,10)/100*a.plotHeight);c.test(g)&&(g=parseInt(g,10)/100*a.plotHeight+a.plotTop);this.left=b;this.top=g;this.width=e;this.height=f;this.bottom=a.chartHeight-f-g;this.right=a.chartWidth-e-b;this.len=u(d?e:f,0);this.pos=d?b:g},getExtremes:function(){var a=
|
||||
this.isLog;return{min:a?ea(ja(this.min)):this.min,max:a?ea(ja(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var b=this.isLog,c=b?ja(this.min):this.min,b=b?ja(this.max):this.max;c>a||a===null?a=c:b<a&&(a=b);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(p(a,0)-this.side*90+720)%360;return a>15&&a<165?"right":a>195&&a<345?"left":"center"},getOffset:function(){var a=this,b=a.chart,c=b.renderer,d=a.options,
|
||||
e=a.tickPositions,f=a.ticks,g=a.horiz,h=a.side,i=b.inverted?[1,0,3,2][h]:h,j,k,l=0,m,n=0,o=d.title,Y=d.labels,E=0,I=b.axisOffset,b=b.clipOffset,D=[-1,1,1,-1][h],r,v=1,w=p(Y.maxStaggerLines,5),x,z,C,y,R;a.hasData=j=a.hasVisibleSeries||s(a.min)&&s(a.max)&&!!e;a.showAxis=k=j||p(d.showEmpty,!0);a.staggerLines=a.horiz&&Y.staggerLines;if(!a.axisGroup)a.gridGroup=c.g("grid").attr({zIndex:d.gridZIndex||1}).add(),a.axisGroup=c.g("axis").attr({zIndex:d.zIndex||2}).add(),a.labelGroup=c.g("axis-labels").attr({zIndex:Y.zIndex||
|
||||
7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels").add();if(j||a.isLinked){a.labelAlign=p(Y.align||a.autoLabelAlign(Y.rotation));q(e,function(b){f[b]?f[b].addLabel():f[b]=new Sa(a,b)});if(a.horiz&&!a.staggerLines&&w&&!Y.rotation){for(j=a.reversed?[].concat(e).reverse():e;v<w;){x=[];z=!1;for(r=0;r<j.length;r++)C=j[r],y=(y=f[C].label&&f[C].label.getBBox())?y.width:0,R=r%v,y&&(C=a.translate(C),x[R]!==t&&C<x[R]&&(z=!0),x[R]=C+y);if(z)v++;else break}if(v>1)a.staggerLines=v}q(e,function(b){if(h===
|
||||
0||h===2||{1:"left",3:"right"}[h]===a.labelAlign)E=u(f[b].getLabelSize(),E)});if(a.staggerLines)E*=a.staggerLines,a.labelOffset=E}else for(r in f)f[r].destroy(),delete f[r];if(o&&o.text&&o.enabled!==!1){if(!a.axisTitle)a.axisTitle=c.text(o.text,0,0,o.useHTML).attr({zIndex:7,rotation:o.rotation||0,align:o.textAlign||{low:"left",middle:"center",high:"right"}[o.align]}).addClass("highcharts-"+this.coll.toLowerCase()+"-title").css(o.style).add(a.axisGroup),a.axisTitle.isNew=!0;if(k)l=a.axisTitle.getBBox()[g?
|
||||
"height":"width"],m=o.offset,n=s(m)?0:p(o.margin,g?5:10);a.axisTitle[k?"show":"hide"]()}a.offset=D*p(d.offset,I[h]);c=h===2?a.tickBaseline:0;g=E+n+(E&&D*(g?p(Y.y,a.tickBaseline+8):Y.x)-c);a.axisTitleMargin=p(m,g);I[h]=u(I[h],a.axisTitleMargin+l+D*a.offset,g);b[i]=u(b[i],U(d.lineWidth/2)*2)},getLinePath:function(a){var b=this.chart,c=this.opposite,d=this.offset,e=this.horiz,f=this.left+(c?this.width:0)+d,d=b.chartHeight-this.bottom-(c?this.height:0)+d;c&&(a*=-1);return b.renderer.crispLine(["M",e?
|
||||
this.left:f,e?d:this.top,"L",e?b.chartWidth-this.right:f,e?d:b.chartHeight-this.bottom],a)},getTitlePosition:function(){var a=this.horiz,b=this.left,c=this.top,d=this.len,e=this.options.title,f=a?b:c,g=this.opposite,h=this.offset,i=z(e.style.fontSize||12),d={low:f+(a?0:d),middle:f+d/2,high:f+(a?d:0)}[e.align],b=(a?c+this.height:b)+(a?1:-1)*(g?-1:1)*this.axisTitleMargin+(this.side===2?i:0);return{x:a?d:b+(g?this.width:0)+h+(e.x||0),y:a?b-(g?this.height:0)+h:d+(e.y||0)}},render:function(){var a=this,
|
||||
b=a.horiz,c=a.reversed,d=a.chart,e=d.renderer,f=a.options,g=a.isLog,h=a.isLinked,i=a.tickPositions,j,k=a.axisTitle,l=a.ticks,m=a.minorTicks,n=a.alternateBands,o=f.stackLabels,p=f.alternateGridColor,E=a.tickmarkOffset,I=f.lineWidth,D=d.hasRendered&&s(a.oldMin)&&!isNaN(a.oldMin),r=a.hasData,u=a.showAxis,v,w=f.labels.overflow,x=a.justifyLabels=b&&w!==!1,z;a.labelEdge.length=0;a.justifyToPlot=w==="justify";q([l,m,n],function(a){for(var b in a)a[b].isActive=!1});if(r||h)if(a.minorTickInterval&&!a.categories&&
|
||||
q(a.getMinorTickPositions(),function(b){m[b]||(m[b]=new Sa(a,b,"minor"));D&&m[b].isNew&&m[b].render(null,!0);m[b].render(null,!1,1)}),i.length&&(j=i.slice(),(b&&c||!b&&!c)&&j.reverse(),x&&(j=j.slice(1).concat([j[0]])),q(j,function(b,c){x&&(c=c===j.length-1?0:c+1);if(!h||b>=a.min&&b<=a.max)l[b]||(l[b]=new Sa(a,b)),D&&l[b].isNew&&l[b].render(c,!0,0.1),l[b].render(c)}),E&&a.min===0&&(l[-1]||(l[-1]=new Sa(a,-1,null,!0)),l[-1].render(-1))),p&&q(i,function(b,c){if(c%2===0&&b<a.max)n[b]||(n[b]=new S.PlotLineOrBand(a)),
|
||||
v=b+E,z=i[c+1]!==t?i[c+1]+E:a.max,n[b].options={from:g?ja(v):v,to:g?ja(z):z,color:p},n[b].render(),n[b].isActive=!0}),!a._addedPlotLB)q((f.plotLines||[]).concat(f.plotBands||[]),function(b){a.addPlotBandOrLine(b)}),a._addedPlotLB=!0;q([l,m,n],function(a){var b,c,e=[],f=va?va.duration||500:0,g=function(){for(c=e.length;c--;)a[e[c]]&&!a[e[c]].isActive&&(a[e[c]].destroy(),delete a[e[c]])};for(b in a)if(!a[b].isActive)a[b].render(b,!1,0),a[b].isActive=!1,e.push(b);a===n||!d.hasRendered||!f?g():f&&setTimeout(g,
|
||||
f)});if(I)b=a.getLinePath(I),a.axisLine?a.axisLine.animate({d:b}):a.axisLine=e.path(b).attr({stroke:f.lineColor,"stroke-width":I,zIndex:7}).add(a.axisGroup),a.axisLine[u?"show":"hide"]();if(k&&u)k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1;o&&o.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.render();q(this.plotLinesAndBands,function(a){a.render()});q(this.series,function(a){a.isDirty=!0})},destroy:function(a){var b=this,c=b.stacks,d,e=b.plotLinesAndBands;a||X(b);
|
||||
for(d in c)Oa(c[d]),c[d]=null;q([b.ticks,b.minorTicks,b.alternateBands],function(a){Oa(a)});for(a=e.length;a--;)e[a].destroy();q("stackTotalGroup,axisLine,axisTitle,axisGroup,cross,gridGroup,labelGroup".split(","),function(a){b[a]&&(b[a]=b[a].destroy())});this.cross&&this.cross.destroy()},drawCrosshair:function(a,b){if(this.crosshair)if((s(b)||!p(this.crosshair.snap,!0))===!1)this.hideCrosshair();else{var c,d=this.crosshair,e=d.animation;p(d.snap,!0)?s(b)&&(c=this.chart.inverted!=this.horiz?b.plotX:
|
||||
this.len-b.plotY):c=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos;c=this.isRadial?this.getPlotLinePath(this.isXAxis?b.x:p(b.stackY,b.y)):this.getPlotLinePath(null,null,null,null,c);if(c===null)this.hideCrosshair();else if(this.cross)this.cross.attr({visibility:"visible"})[e?"animate":"attr"]({d:c},e);else{e={"stroke-width":d.width||1,stroke:d.color||"#C0C0C0",zIndex:d.zIndex||2};if(d.dashStyle)e.dashstyle=d.dashStyle;this.cross=this.chart.renderer.path(c).attr(e).add()}}},hideCrosshair:function(){this.cross&&
|
||||
this.cross.hide()}};r(ma.prototype,{getPlotBandPath:function(a,b){var c=this.getPlotLinePath(b),d=this.getPlotLinePath(a);d&&c?d.push(c[4],c[5],c[1],c[2]):d=null;return d},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(a,b){var c=(new S.PlotLineOrBand(this,a)).render(),d=this.userOptions;c&&(b&&(d[b]=d[b]||[],d[b].push(a)),this.plotLinesAndBands.push(c));return c},removePlotBandOrLine:function(a){for(var b=
|
||||
this.plotLinesAndBands,c=this.options,d=this.userOptions,e=b.length;e--;)b[e].id===a&&b[e].destroy();q([c.plotLines||[],d.plotLines||[],c.plotBands||[],d.plotBands||[]],function(b){for(e=b.length;e--;)b[e].id===a&&ka(b,b[e])})}});ma.prototype.getTimeTicks=function(a,b,c,d){var e=[],f={},g=L.global.useUTC,h,i=new Date(b-Ra),j=a.unitRange,k=a.count;if(s(b)){j>=B.second&&(i.setMilliseconds(0),i.setSeconds(j>=B.minute?0:k*U(i.getSeconds()/k)));if(j>=B.minute)i[Bb](j>=B.hour?0:k*U(i[ob]()/k));if(j>=B.hour)i[Cb](j>=
|
||||
B.day?0:k*U(i[pb]()/k));if(j>=B.day)i[rb](j>=B.month?1:k*U(i[Wa]()/k));j>=B.month&&(i[Db](j>=B.year?0:k*U(i[eb]()/k)),h=i[fb]());j>=B.year&&(h-=h%k,i[Eb](h));if(j===B.week)i[rb](i[Wa]()-i[qb]()+p(d,1));b=1;Ra&&(i=new Date(i.getTime()+Ra));h=i[fb]();for(var d=i.getTime(),l=i[eb](),m=i[Wa](),n=g?Ra:(864E5+i.getTimezoneOffset()*6E4)%864E5;d<c;)e.push(d),j===B.year?d=db(h+b*k,0):j===B.month?d=db(h,l+b*k):!g&&(j===B.day||j===B.week)?d=db(h,l,m+b*k*(j===B.day?1:7)):d+=j*k,b++;e.push(d);q(vb(e,function(a){return j<=
|
||||
B.hour&&a%B.day===n}),function(a){f[a]="day"})}e.info=r(a,{higherRanks:f,totalRange:j*k});return e};ma.prototype.normalizeTimeTickInterval=function(a,b){var c=b||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]],d=c[c.length-1],e=B[d[0]],f=d[1],g;for(g=0;g<c.length;g++)if(d=c[g],e=B[d[0]],f=d[1],c[g+1]&&a<=(e*f[f.length-1]+B[c[g+1][0]])/2)break;e===B.year&&
|
||||
a<5*e&&(f=[1,2,5]);c=mb(a/e,f,d[0]==="year"?u(lb(a/e),1):1);return{unitRange:e,count:c,unitName:d[0]}};ma.prototype.getLogTickPositions=function(a,b,c,d){var e=this.options,f=this.len,g=[];if(!d)this._minorAutoInterval=null;if(a>=0.5)a=v(a),g=this.getLinearTickPositions(a,b,c);else if(a>=0.08)for(var f=U(b),h,i,j,k,l,e=a>0.3?[1,2,4]:a>0.15?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];f<c+1&&!l;f++){i=e.length;for(h=0;h<i&&!l;h++)j=za(ja(f)*e[h]),j>b&&(!d||k<=c)&&k!==t&&g.push(k),k>c&&(l=!0),k=j}else if(b=ja(b),
|
||||
c=ja(c),a=e[d?"minorTickInterval":"tickInterval"],a=p(a==="auto"?null:a,this._minorAutoInterval,(c-b)*(e.tickPixelInterval/(d?5:1))/((d?f/this.tickPositions.length:f)||1)),a=mb(a,null,lb(a)),g=Ua(this.getLinearTickPositions(a,b,c),za),!d)this._minorAutoInterval=a/5;if(!d)this.tickInterval=a;return g};var Mb=S.Tooltip=function(){this.init.apply(this,arguments)};Mb.prototype={init:function(a,b){var c=b.borderWidth,d=b.style,e=z(d.padding);this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,
|
||||
y:0};this.isHidden=!0;this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:e,fill:b.backgroundColor,"stroke-width":c,r:b.borderRadius,zIndex:8}).css(d).css({padding:0}).add().attr({y:-9999});ga||this.label.shadow(b.shadow);this.shared=b.shared},destroy:function(){if(this.label)this.label=this.label.destroy();clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,d){var e=this,f=e.now,g=e.options.animation!==!1&&!e.isHidden&&
|
||||
(Q(a-f.x)>1||Q(b-f.y)>1),h=e.followPointer||e.len>1;r(f,{x:g?(2*f.x+a)/3:a,y:g?(f.y+b)/2:b,anchorX:h?t:g?(2*f.anchorX+c)/3:c,anchorY:h?t:g?(f.anchorY+d)/2:d});e.label.attr(f);if(g)clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,d)},32)},hide:function(){var a=this,b;clearTimeout(this.hideTimer);if(!this.isHidden)b=this.chart.hoverPoints,this.hideTimer=setTimeout(function(){a.label.fadeOut();a.isHidden=!0},p(this.options.hideDelay,500)),b&&q(b,function(a){a.setState()}),
|
||||
this.chart.hoverPoints=null},getAnchor:function(a,b){var c,d=this.chart,e=d.inverted,f=d.plotTop,g=0,h=0,i,a=ra(a);c=a[0].tooltipPos;this.followPointer&&b&&(b.chartX===t&&(b=d.pointer.normalize(b)),c=[b.chartX-d.plotLeft,b.chartY-f]);c||(q(a,function(a){i=a.series.yAxis;g+=a.plotX;h+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&i?i.top-f:0)}),g/=a.length,h/=a.length,c=[e?d.plotWidth-h:g,this.shared&&!e&&a.length>1&&b?b.chartY-f:e?d.plotHeight-g:h]);return Ua(c,v)},getPosition:function(a,b,c){var d=
|
||||
this.chart,e=this.distance,f={},g,h=["y",d.chartHeight,b,c.plotY+d.plotTop],i=["x",d.chartWidth,a,c.plotX+d.plotLeft],j=c.ttBelow||d.inverted&&!c.negative||!d.inverted&&c.negative,k=function(a,b,c,d){var g=c<d-e,b=d+e+c<b,c=d-e-c;d+=e;if(j&&b)f[a]=d;else if(!j&&g)f[a]=c;else if(g)f[a]=c;else if(b)f[a]=d;else return!1},l=function(a,b,c,d){if(d<e||d>b-e)return!1;else f[a]=d<c/2?1:d>b-c/2?b-c-2:d-c/2},m=function(a){var b=h;h=i;i=b;g=a},n=function(){k.apply(0,h)!==!1?l.apply(0,i)===!1&&!g&&(m(!0),n()):
|
||||
g?f.x=f.y=0:(m(!0),n())};(d.inverted||this.len>1)&&m();n();return f},defaultFormatter:function(a){var b=this.points||ra(this),c=b[0].series,d;d=[a.tooltipHeaderFormatter(b[0])];q(b,function(a){c=a.series;d.push(c.tooltipFormatter&&c.tooltipFormatter(a)||a.point.tooltipFormatter(c.tooltipOptions.pointFormat))});d.push(a.options.footerFormat||"");return d.join("")},refresh:function(a,b){var c=this.chart,d=this.label,e=this.options,f,g,h={},i,j=[];i=e.formatter||this.defaultFormatter;var h=c.hoverPoints,
|
||||
k,l=this.shared;clearTimeout(this.hideTimer);this.followPointer=ra(a)[0].series.tooltipOptions.followPointer;g=this.getAnchor(a,b);f=g[0];g=g[1];l&&(!a.series||!a.series.noSharedTooltip)?(c.hoverPoints=a,h&&q(h,function(a){a.setState()}),q(a,function(a){a.setState("hover");j.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=j,this.len=j.length,a=a[0]):h=a.getLabelConfig();i=i.call(h,this);h=a.series;this.distance=p(h.tooltipOptions.distance,16);i===!1?this.hide():(this.isHidden&&(ab(d),
|
||||
d.attr("opacity",1).show()),d.attr({text:i}),k=e.borderColor||a.color||h.color||"#606060",d.attr({stroke:k}),this.updatePosition({plotX:f,plotY:g,negative:a.negative,ttBelow:a.ttBelow}),this.isHidden=!1);K(c,"tooltipRefresh",{text:i,x:f+c.plotLeft,y:g+c.plotTop,borderColor:k})},updatePosition:function(a){var b=this.chart,c=this.label,c=(this.options.positioner||this.getPosition).call(this,c.width,c.height,a);this.move(v(c.x),v(c.y),a.plotX+b.plotLeft,a.plotY+b.plotTop)},tooltipHeaderFormatter:function(a){var b=
|
||||
a.series,c=b.tooltipOptions,d=c.dateTimeLabelFormats,e=c.xDateFormat,f=b.xAxis,g=f&&f.options.type==="datetime"&&ia(a.key),c=c.headerFormat,f=f&&f.closestPointRange,h;if(g&&!e){if(f)for(h in B){if(B[h]>=f||B[h]<=B.day&&a.key%B[h]>0){e=d[h];break}}else e=d.day;e=e||d.year}g&&e&&(c=c.replace("{point.key}","{point.key:"+e+"}"));return Ia(c,{point:a,series:b})}};var pa;Za=x.documentElement.ontouchstart!==t;var Va=S.Pointer=function(a,b){this.init(a,b)};Va.prototype={init:function(a,b){var c=b.chart,d=
|
||||
c.events,e=ga?"":c.zoomType,c=a.inverted,f;this.options=b;this.chart=a;this.zoomX=f=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=f&&!c||e&&c;this.zoomVert=e&&!c||f&&c;this.hasZoom=f||e;this.runChartClick=d&&!!d.click;this.pinchDown=[];this.lastValidTouch={};if(S.Tooltip&&b.tooltip.enabled)a.tooltip=new Mb(a,b.tooltip),this.followTouchMove=b.tooltip.followTouchMove;this.setDOMEvents()},normalize:function(a,b){var c,d,a=a||window.event,a=Sb(a);if(!a.target)a.target=a.srcElement;d=a.touches?a.touches.length?
|
||||
a.touches.item(0):a.changedTouches[0]:a;if(!b)this.chartPosition=b=Rb(this.chart.container);d.pageX===t?(c=u(a.x,a.clientX-b.left),d=a.y):(c=d.pageX-b.left,d=d.pageY-b.top);return r(a,{chartX:v(c),chartY:v(d)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};q(this.chart.axes,function(c){b[c.isXAxis?"xAxis":"yAxis"].push({axis:c,value:c.toValue(a[c.horiz?"chartX":"chartY"])})});return b},getIndex:function(a){var b=this.chart;return b.inverted?b.plotHeight+b.plotTop-a.chartY:a.chartX-b.plotLeft},
|
||||
runPointActions:function(a){var b=this.chart,c=b.series,d=b.tooltip,e,f,g=b.hoverPoint,h=b.hoverSeries,i,j,k=b.chartWidth,l=this.getIndex(a);if(d&&this.options.tooltip.shared&&(!h||!h.noSharedTooltip)){f=[];i=c.length;for(j=0;j<i;j++)if(c[j].visible&&c[j].options.enableMouseTracking!==!1&&!c[j].noSharedTooltip&&c[j].singularTooltips!==!0&&c[j].tooltipPoints.length&&(e=c[j].tooltipPoints[l])&&e.series)e._dist=Q(l-e.clientX),k=C(k,e._dist),f.push(e);for(i=f.length;i--;)f[i]._dist>k&&f.splice(i,1);if(f.length&&
|
||||
f[0].clientX!==this.hoverX)d.refresh(f,a),this.hoverX=f[0].clientX}c=h&&h.tooltipOptions.followPointer;if(h&&h.tracker&&!c){if((e=h.tooltipPoints[l])&&e!==g)e.onMouseOver(a)}else d&&c&&!d.isHidden&&(h=d.getAnchor([{}],a),d.updatePosition({plotX:h[0],plotY:h[1]}));if(d&&!this._onDocumentMouseMove)this._onDocumentMouseMove=function(a){if(W[pa])W[pa].pointer.onDocumentMouseMove(a)},N(x,"mousemove",this._onDocumentMouseMove);q(b.axes,function(b){b.drawCrosshair(a,p(e,g))})},reset:function(a){var b=this.chart,
|
||||
c=b.hoverSeries,d=b.hoverPoint,e=b.tooltip,f=e&&e.shared?b.hoverPoints:d;(a=a&&e&&f)&&ra(f)[0].plotX===t&&(a=!1);if(a)e.refresh(f),d&&d.setState(d.state,!0);else{if(d)d.onMouseOut();if(c)c.onMouseOut();e&&e.hide();if(this._onDocumentMouseMove)X(x,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null;q(b.axes,function(a){a.hideCrosshair()});this.hoverX=null}},scaleGroups:function(a,b){var c=this.chart,d;q(c.series,function(e){d=a||e.getPlotBox();e.xAxis&&e.xAxis.zoomEnabled&&(e.group.attr(d),
|
||||
e.markerGroup&&(e.markerGroup.attr(d),e.markerGroup.clip(b?c.clipRect:null)),e.dataLabelsGroup&&e.dataLabelsGroup.attr(d))});c.clipRect.attr(b||c.clipBox)},dragStart:function(a){var b=this.chart;b.mouseIsDown=a.type;b.cancelClick=!1;b.mouseDownX=this.mouseDownX=a.chartX;b.mouseDownY=this.mouseDownY=a.chartY},drag:function(a){var b=this.chart,c=b.options.chart,d=a.chartX,e=a.chartY,f=this.zoomHor,g=this.zoomVert,h=b.plotLeft,i=b.plotTop,j=b.plotWidth,k=b.plotHeight,l,m=this.mouseDownX,n=this.mouseDownY,
|
||||
o=c.panKey&&a[c.panKey+"Key"];d<h?d=h:d>h+j&&(d=h+j);e<i?e=i:e>i+k&&(e=i+k);this.hasDragged=Math.sqrt(Math.pow(m-d,2)+Math.pow(n-e,2));if(this.hasDragged>10){l=b.isInsidePlot(m-h,n-i);if(b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&l&&!o&&!this.selectionMarker)this.selectionMarker=b.renderer.rect(h,i,f?1:j,g?1:k,0).attr({fill:c.selectionMarkerFill||"rgba(69,114,167,0.25)",zIndex:7}).add();this.selectionMarker&&f&&(d-=m,this.selectionMarker.attr({width:Q(d),x:(d>0?0:d)+m}));this.selectionMarker&&
|
||||
g&&(d=e-n,this.selectionMarker.attr({height:Q(d),y:(d>0?0:d)+n}));l&&!this.selectionMarker&&c.panning&&b.pan(a,c.panning)}},drop:function(a){var b=this.chart,c=this.hasPinched;if(this.selectionMarker){var d={xAxis:[],yAxis:[],originalEvent:a.originalEvent||a},e=this.selectionMarker,f=e.attr?e.attr("x"):e.x,g=e.attr?e.attr("y"):e.y,h=e.attr?e.attr("width"):e.width,i=e.attr?e.attr("height"):e.height,j;if(this.hasDragged||c)q(b.axes,function(b){if(b.zoomEnabled){var c=b.horiz,e=a.type==="touchend"?b.minPixelPadding:
|
||||
0,n=b.toValue((c?f:g)+e),c=b.toValue((c?f+h:g+i)-e);!isNaN(n)&&!isNaN(c)&&(d[b.coll].push({axis:b,min:C(n,c),max:u(n,c)}),j=!0)}}),j&&K(b,"selection",d,function(a){b.zoom(r(a,c?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();c&&this.scaleGroups()}if(b)A(b.container,{cursor:b._cursor}),b.cancelClick=this.hasDragged>10,b.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[]},onContainerMouseDown:function(a){a=this.normalize(a);a.preventDefault&&a.preventDefault();
|
||||
this.dragStart(a)},onDocumentMouseUp:function(a){W[pa]&&W[pa].pointer.drop(a)},onDocumentMouseMove:function(a){var b=this.chart,c=this.chartPosition,d=b.hoverSeries,a=this.normalize(a,c);c&&d&&!this.inClass(a.target,"highcharts-tracker")&&!b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)&&this.reset()},onContainerMouseLeave:function(){var a=W[pa];if(a)a.pointer.reset(),a.pointer.chartPosition=null},onContainerMouseMove:function(a){var b=this.chart;pa=b.index;a=this.normalize(a);a.returnValue=
|
||||
!1;b.mouseIsDown==="mousedown"&&this.drag(a);(this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop))&&!b.openMenu&&this.runPointActions(a)},inClass:function(a,b){for(var c;a;){if(c=F(a,"class"))if(c.indexOf(b)!==-1)return!0;else if(c.indexOf("highcharts-container")!==-1)return!1;a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries,c=(a=a.relatedTarget||a.toElement)&&a.point&&a.point.series;if(b&&!b.options.stickyTracking&&!this.inClass(a,
|
||||
"highcharts-tooltip")&&c!==b)b.onMouseOut()},onContainerClick:function(a){var b=this.chart,c=b.hoverPoint,d=b.plotLeft,e=b.plotTop,a=this.normalize(a);a.cancelBubble=!0;b.cancelClick||(c&&this.inClass(a.target,"highcharts-tracker")?(K(c.series,"click",r(a,{point:c})),b.hoverPoint&&c.firePointEvent("click",a)):(r(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-e)&&K(b,"click",a)))},setDOMEvents:function(){var a=this,b=a.chart.container;b.onmousedown=function(b){a.onContainerMouseDown(b)};
|
||||
b.onmousemove=function(b){a.onContainerMouseMove(b)};b.onclick=function(b){a.onContainerClick(b)};N(b,"mouseleave",a.onContainerMouseLeave);$a===1&&N(x,"mouseup",a.onDocumentMouseUp);if(Za)b.ontouchstart=function(b){a.onContainerTouchStart(b)},b.ontouchmove=function(b){a.onContainerTouchMove(b)},$a===1&&N(x,"touchend",a.onDocumentTouchEnd)},destroy:function(){var a;X(this.chart.container,"mouseleave",this.onContainerMouseLeave);$a||(X(x,"mouseup",this.onDocumentMouseUp),X(x,"touchend",this.onDocumentTouchEnd));
|
||||
clearInterval(this.tooltipTimeout);for(a in this)this[a]=null}};r(S.Pointer.prototype,{pinchTranslate:function(a,b,c,d,e,f){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,b,c,d,e,f);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,b,c,d,e,f)},pinchTranslateDirection:function(a,b,c,d,e,f,g,h){var i=this.chart,j=a?"x":"y",k=a?"X":"Y",l="chart"+k,m=a?"width":"height",n=i["plot"+(a?"Left":"Top")],o,p,q=h||1,r=i.inverted,D=i.bounds[a?"h":"v"],u=b.length===1,s=b[0][l],
|
||||
v=c[0][l],t=!u&&b[1][l],w=!u&&c[1][l],x,c=function(){!u&&Q(s-t)>20&&(q=h||Q(v-w)/Q(s-t));p=(n-v)/q+s;o=i["plot"+(a?"Width":"Height")]/q};c();b=p;b<D.min?(b=D.min,x=!0):b+o>D.max&&(b=D.max-o,x=!0);x?(v-=0.8*(v-g[j][0]),u||(w-=0.8*(w-g[j][1])),c()):g[j]=[v,w];r||(f[j]=p-n,f[m]=o);f=r?1/q:q;e[m]=o;e[j]=b;d[r?a?"scaleY":"scaleX":"scale"+k]=q;d["translate"+k]=f*n+(v-f*s)},pinch:function(a){var b=this,c=b.chart,d=b.pinchDown,e=b.followTouchMove,f=a.touches,g=f.length,h=b.lastValidTouch,i=b.hasZoom,j=b.selectionMarker,
|
||||
k={},l=g===1&&(b.inClass(a.target,"highcharts-tracker")&&c.runTrackerClick||c.runChartClick),m={};(i||e)&&!l&&a.preventDefault();Ua(f,function(a){return b.normalize(a)});if(a.type==="touchstart")q(f,function(a,b){d[b]={chartX:a.chartX,chartY:a.chartY}}),h.x=[d[0].chartX,d[1]&&d[1].chartX],h.y=[d[0].chartY,d[1]&&d[1].chartY],q(c.axes,function(a){if(a.zoomEnabled){var b=c.bounds[a.horiz?"h":"v"],d=a.minPixelPadding,e=a.toPixels(p(a.options.min,a.dataMin)),f=a.toPixels(p(a.options.max,a.dataMax)),g=
|
||||
C(e,f),e=u(e,f);b.min=C(a.pos,g-d);b.max=u(a.pos+a.len,e+d)}});else if(d.length){if(!j)b.selectionMarker=j=r({destroy:sa},c.plotBox);b.pinchTranslate(d,f,k,j,m,h);b.hasPinched=i;b.scaleGroups(k,m);!i&&e&&g===1&&this.runPointActions(b.normalize(a))}},onContainerTouchStart:function(a){var b=this.chart;pa=b.index;a.touches.length===1?(a=this.normalize(a),b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)?(this.runPointActions(a),this.pinch(a)):this.reset()):a.touches.length===2&&this.pinch(a)},onContainerTouchMove:function(a){(a.touches.length===
|
||||
1||a.touches.length===2)&&this.pinch(a)},onDocumentTouchEnd:function(a){W[pa]&&W[pa].pointer.drop(a)}});if(H.PointerEvent||H.MSPointerEvent){var ua={},yb=!!H.PointerEvent,Wb=function(){var a,b=[];b.item=function(a){return this[a]};for(a in ua)ua.hasOwnProperty(a)&&b.push({pageX:ua[a].pageX,pageY:ua[a].pageY,target:ua[a].target});return b},zb=function(a,b,c,d){a=a.originalEvent||a;if((a.pointerType==="touch"||a.pointerType===a.MSPOINTER_TYPE_TOUCH)&&W[pa])d(a),d=W[pa].pointer,d[b]({type:c,target:a.currentTarget,
|
||||
preventDefault:sa,touches:Wb()})};r(Va.prototype,{onContainerPointerDown:function(a){zb(a,"onContainerTouchStart","touchstart",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){zb(a,"onContainerTouchMove","touchmove",function(a){ua[a.pointerId]={pageX:a.pageX,pageY:a.pageY};if(!ua[a.pointerId].target)ua[a.pointerId].target=a.currentTarget})},onDocumentPointerUp:function(a){zb(a,"onContainerTouchEnd","touchend",function(a){delete ua[a.pointerId]})},
|
||||
batchMSEvents:function(a){a(this.chart.container,yb?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,yb?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(x,yb?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});Ma(Va.prototype,"init",function(a,b,c){a.call(this,b,c);(this.hasZoom||this.followTouchMove)&&A(b.container,{"-ms-touch-action":P,"touch-action":P})});Ma(Va.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&
|
||||
this.batchMSEvents(N)});Ma(Va.prototype,"destroy",function(a){this.batchMSEvents(X);a.call(this)})}var kb=S.Legend=function(a,b){this.init(a,b)};kb.prototype={init:function(a,b){var c=this,d=b.itemStyle,e=p(b.padding,8),f=b.itemMarginTop||0;this.options=b;if(b.enabled)c.itemStyle=d,c.itemHiddenStyle=w(d,b.itemHiddenStyle),c.itemMarginTop=f,c.padding=e,c.initialItemX=e,c.initialItemY=e-5,c.maxItemWidth=0,c.chart=a,c.itemHeight=0,c.lastLineHeight=0,c.symbolWidth=p(b.symbolWidth,16),c.pages=[],c.render(),
|
||||
N(c.chart,"endResize",function(){c.positionCheckboxes()})},colorizeItem:function(a,b){var c=this.options,d=a.legendItem,e=a.legendLine,f=a.legendSymbol,g=this.itemHiddenStyle.color,c=b?c.itemStyle.color:g,h=b?a.legendColor||a.color||"#CCC":g,g=a.options&&a.options.marker,i={fill:h},j;d&&d.css({fill:c,color:c});e&&e.attr({stroke:h});if(f){if(g&&f.isMarker)for(j in i.stroke=h,g=a.convertAttribs(g),g)d=g[j],d!==t&&(i[j]=d);f.attr(i)}},positionItem:function(a){var b=this.options,c=b.symbolPadding,b=!b.rtl,
|
||||
d=a._legendItemPos,e=d[0],d=d[1],f=a.checkbox;a.legendGroup&&a.legendGroup.translate(b?e:this.legendWidth-e-2*c-4,d);if(f)f.x=e,f.y=d},destroyItem:function(a){var b=a.checkbox;q(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&Pa(a.checkbox)},destroy:function(){var a=this.group,b=this.box;if(b)this.box=b.destroy();if(a)this.group=a.destroy()},positionCheckboxes:function(a){var b=this.group.alignAttr,c,d=this.clipHeight||this.legendHeight;if(b)c=
|
||||
b.translateY,q(this.allItems,function(e){var f=e.checkbox,g;f&&(g=c+f.y+(a||0)+3,A(f,{left:b.translateX+e.checkboxOffset+f.x-20+"px",top:g+"px",display:g>c-6&&g<c+d-6?"":P}))})},renderTitle:function(){var a=this.padding,b=this.options.title,c=0;if(b.text){if(!this.title)this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).css(b.style).add(this.group);a=this.title.getBBox();c=a.height;this.offsetWidth=a.width;this.contentGroup.attr({translateY:c})}this.titleHeight=
|
||||
c},renderItem:function(a){var b=this.chart,c=b.renderer,d=this.options,e=d.layout==="horizontal",f=this.symbolWidth,g=d.symbolPadding,h=this.itemStyle,i=this.itemHiddenStyle,j=this.padding,k=e?p(d.itemDistance,20):0,l=!d.rtl,m=d.width,n=d.itemMarginBottom||0,o=this.itemMarginTop,q=this.initialItemX,r=a.legendItem,s=a.series&&a.series.drawLegendSymbol?a.series:a,D=s.options,D=this.createCheckboxForItem&&D&&D.showCheckbox,t=d.useHTML;if(!r){a.legendGroup=c.g("legend-item").attr({zIndex:1}).add(this.scrollGroup);
|
||||
a.legendItem=r=c.text(d.labelFormat?Ia(d.labelFormat,a):d.labelFormatter.call(a),l?f+g:-g,this.baseline||0,t).css(w(a.visible?h:i)).attr({align:l?"left":"right",zIndex:2}).add(a.legendGroup);if(!this.baseline)this.baseline=c.fontMetrics(h.fontSize,r).f+3+o,r.attr("y",this.baseline);s.drawLegendSymbol(this,a);this.setItemEvents&&this.setItemEvents(a,r,t,h,i);this.colorizeItem(a,a.visible);D&&this.createCheckboxForItem(a)}c=r.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+g+c.width+
|
||||
k+(D?20:0);this.itemHeight=g=v(a.legendItemHeight||c.height);if(e&&this.itemX-q+f>(m||b.chartWidth-2*j-q-d.x))this.itemX=q,this.itemY+=o+this.lastLineHeight+n,this.lastLineHeight=0;this.maxItemWidth=u(this.maxItemWidth,f);this.lastItemY=o+this.itemY+n;this.lastLineHeight=u(g,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=f:(this.itemY+=o+g+n,this.lastLineHeight=g);this.offsetWidth=m||u((e?this.itemX-q-k:f)+j,this.offsetWidth)},getAllItems:function(){var a=[];q(this.chart.series,
|
||||
function(b){var c=b.options;if(p(c.showInLegend,!s(c.linkedTo)?t:!1,!0))a=a.concat(b.legendItems||(c.legendType==="point"?b.data:b))});return a},render:function(){var a=this,b=a.chart,c=b.renderer,d=a.group,e,f,g,h,i=a.box,j=a.options,k=a.padding,l=j.borderWidth,m=j.backgroundColor;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;if(!d)a.group=d=c.g("legend").attr({zIndex:7}).add(),a.contentGroup=c.g().attr({zIndex:1}).add(d),a.scrollGroup=c.g().add(a.contentGroup);a.renderTitle();
|
||||
e=a.getAllItems();nb(e,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});j.reversed&&e.reverse();a.allItems=e;a.display=f=!!e.length;q(e,function(b){a.renderItem(b)});g=j.width||a.offsetWidth;h=a.lastItemY+a.lastLineHeight+a.titleHeight;h=a.handleOverflow(h);if(l||m){g+=k;h+=k;if(i){if(g>0&&h>0)i[i.isNew?"attr":"animate"](i.crisp({width:g,height:h})),i.isNew=!1}else a.box=i=c.rect(0,0,g,h,j.borderRadius,l||0).attr({stroke:j.borderColor,"stroke-width":l||
|
||||
0,fill:m||P}).add(d).shadow(j.shadow),i.isNew=!0;i[f?"show":"hide"]()}a.legendWidth=g;a.legendHeight=h;q(e,function(b){a.positionItem(b)});f&&d.align(r({width:g,height:h},j),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,c=this.chart,d=c.renderer,e=this.options,f=e.y,f=c.spacingBox.height+(e.verticalAlign==="top"?-f:f)-this.padding,g=e.maxHeight,h,i=this.clipRect,j=e.navigation,k=p(j.animation,!0),l=j.arrowSize||12,m=this.nav,n=this.pages,o,r=this.allItems;
|
||||
e.layout==="horizontal"&&(f/=2);g&&(f=C(f,g));n.length=0;if(a>f&&!e.useHTML){this.clipHeight=h=u(f-20-this.titleHeight-this.padding,0);this.currentPage=p(this.currentPage,1);this.fullHeight=a;q(r,function(a,b){var c=a._legendItemPos[1],d=v(a.legendItem.getBBox().height),e=n.length;if(!e||c-n[e-1]>h&&(o||c)!==n[e-1])n.push(o||c),e++;b===r.length-1&&c+d-n[e-1]>h&&n.push(c);c!==o&&(o=c)});if(!i)i=b.clipRect=d.clipRect(0,this.padding,9999,0),b.contentGroup.clip(i);i.attr({height:h});if(!m)this.nav=m=
|
||||
d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,l,l).on("click",function(){b.scroll(-1,k)}).add(m),this.pager=d.text("",15,10).css(j.style).add(m),this.down=d.symbol("triangle-down",0,0,l,l).on("click",function(){b.scroll(1,k)}).add(m);b.scroll(0);a=f}else if(m)i.attr({height:c.chartHeight}),m.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0;return a},scroll:function(a,b){var c=this.pages,d=c.length,e=this.currentPage+a,f=this.clipHeight,g=this.options.navigation,
|
||||
h=g.activeColor,g=g.inactiveColor,i=this.pager,j=this.padding;e>d&&(e=d);if(e>0)b!==t&&Qa(b,this.chart),this.nav.attr({translateX:j,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({fill:e===1?g:h}).css({cursor:e===1?"default":"pointer"}),i.attr({text:e+"/"+d}),this.down.attr({x:18+this.pager.getBBox().width,fill:e===d?g:h}).css({cursor:e===d?"default":"pointer"}),c=-c[e-1]+this.initialItemY,this.scrollGroup.animate({translateY:c}),this.currentPage=e,this.positionCheckboxes(c)}};
|
||||
M=S.LegendSymbolMixin={drawRectangle:function(a,b){var c=a.options.symbolHeight||12;b.legendSymbol=this.chart.renderer.rect(0,a.baseline-5-c/2,a.symbolWidth,c,a.options.symbolRadius||0).attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options,c=b.marker,d;d=a.symbolWidth;var e=this.chart.renderer,f=this.legendGroup,a=a.baseline-v(e.fontMetrics(a.options.itemStyle.fontSize,this.legendItem).b*0.3),g;if(b.lineWidth){g={"stroke-width":b.lineWidth};if(b.dashStyle)g.dashstyle=
|
||||
b.dashStyle;this.legendLine=e.path(["M",0,a,"L",d,a]).attr(g).add(f)}if(c&&c.enabled!==!1)b=c.radius,this.legendSymbol=d=e.symbol(this.symbol,d/2-b,a-b,2*b,2*b).add(f),d.isMarker=!0}};(/Trident\/7\.0/.test(wa)||Ta)&&Ma(kb.prototype,"positionItem",function(a,b){var c=this,d=function(){b._legendItemPos&&a.call(c,b)};d();setTimeout(d)});Xa.prototype={init:function(a,b){var c,d=a.series;a.series=null;c=w(L,a);c.series=a.series=d;this.userOptions=a;d=c.chart;this.margin=this.splashArray("margin",d);this.spacing=
|
||||
this.splashArray("spacing",d);var e=d.events;this.bounds={h:{},v:{}};this.callback=b;this.isResizing=0;this.options=c;this.axes=[];this.series=[];this.hasCartesianSeries=d.showAxes;var f=this,g;f.index=W.length;W.push(f);$a++;d.reflow!==!1&&N(f,"load",function(){f.initReflow()});if(e)for(g in e)N(f,g,e[g]);f.xAxis=[];f.yAxis=[];f.animation=ga?!1:p(d.animation,!0);f.pointCount=f.colorCounter=f.symbolCounter=0;f.firstRender()},initSeries:function(a){var b=this.options.chart;(b=J[a.type||b.type||b.defaultSeriesType])||
|
||||
oa(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var d=c?b:a,a=c?a:b;return d>=0&&d<=this.plotWidth&&a>=0&&a<=this.plotHeight},adjustTickAmounts:function(){this.options.chart.alignTicks!==!1&&q(this.axes,function(a){a.adjustTickAmount()});this.maxTicks=null},redraw:function(a){var b=this.axes,c=this.series,d=this.pointer,e=this.legend,f=this.isDirtyLegend,g,h,i=this.hasCartesianSeries,j=this.isDirtyBox,k=c.length,l=k,m=this.renderer,n=m.isHidden(),o=[];Qa(a,this);n&&this.cloneRenderTo();
|
||||
for(this.layOutTitles();l--;)if(a=c[l],a.options.stacking&&(g=!0,a.isDirty)){h=!0;break}if(h)for(l=k;l--;)if(a=c[l],a.options.stacking)a.isDirty=!0;q(c,function(a){a.isDirty&&a.options.legendType==="point"&&(f=!0)});if(f&&e.options.enabled)e.render(),this.isDirtyLegend=!1;g&&this.getStacks();if(i){if(!this.isResizing)this.maxTicks=null,q(b,function(a){a.setScale()});this.adjustTickAmounts()}this.getMargins();i&&(q(b,function(a){a.isDirty&&(j=!0)}),q(b,function(a){if(a.isDirtyExtremes)a.isDirtyExtremes=
|
||||
!1,o.push(function(){K(a,"afterSetExtremes",r(a.eventArgs,a.getExtremes()));delete a.eventArgs});(j||g)&&a.redraw()}));j&&this.drawChartBox();q(c,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);m.draw();K(this,"redraw");n&&this.cloneRenderTo(!0);q(o,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,d,e;for(d=0;d<b.length;d++)if(b[d].options.id===a)return b[d];for(d=0;d<c.length;d++)if(c[d].options.id===a)return c[d];for(d=0;d<c.length;d++){e=
|
||||
c[d].points||[];for(b=0;b<e.length;b++)if(e[b].id===a)return e[b]}return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=ra(b.xAxis||{}),b=b.yAxis=ra(b.yAxis||{});q(c,function(a,b){a.index=b;a.isX=!0});q(b,function(a,b){a.index=b});c=c.concat(b);q(c,function(b){new ma(a,b)});a.adjustTickAmounts()},getSelectedPoints:function(){var a=[];q(this.series,function(b){a=a.concat(vb(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return vb(this.series,function(a){return a.selected})},
|
||||
getStacks:function(){var a=this;q(a.yAxis,function(a){if(a.stacks&&a.hasVisibleSeries)a.oldStacks=a.stacks});q(a.series,function(b){if(b.options.stacking&&(b.visible===!0||a.options.chart.ignoreHiddenSeries===!1))b.stackKey=b.type+p(b.options.stack,"")})},setTitle:function(a,b,c){var g;var d=this,e=d.options,f;f=e.title=w(e.title,a);g=e.subtitle=w(e.subtitle,b),e=g;q([["title",a,f],["subtitle",b,e]],function(a){var b=a[0],c=d[b],e=a[1],a=a[2];c&&e&&(d[b]=c=c.destroy());a&&a.text&&!c&&(d[b]=d.renderer.text(a.text,
|
||||
0,0,a.useHTML).attr({align:a.align,"class":"highcharts-"+b,zIndex:a.zIndex||4}).css(a.style).add())});d.layOutTitles(c)},layOutTitles:function(a){var b=0,c=this.title,d=this.subtitle,e=this.options,f=e.title,e=e.subtitle,g=this.renderer,h=this.spacingBox.width-44;if(c&&(c.css({width:(f.width||h)+"px"}).align(r({y:g.fontMetrics(f.style.fontSize,c).b-3},f),!1,"spacingBox"),!f.floating&&!f.verticalAlign))b=c.getBBox().height;d&&(d.css({width:(e.width||h)+"px"}).align(r({y:b+(f.margin-13)+g.fontMetrics(f.style.fontSize,
|
||||
d).b},e),!1,"spacingBox"),!e.floating&&!e.verticalAlign&&(b=Ka(b+d.getBBox().height)));c=this.titleOffset!==b;this.titleOffset=b;if(!this.isDirtyBox&&c)this.isDirtyBox=c,this.hasRendered&&p(a,!0)&&this.isDirtyBox&&this.redraw()},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,c=this.renderToClone||this.renderTo;if(!s(b))this.containerWidth=hb(c,"width");if(!s(a))this.containerHeight=hb(c,"height");this.chartWidth=u(0,b||this.containerWidth||600);this.chartHeight=u(0,p(a,this.containerHeight>
|
||||
19?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;a?b&&(this.renderTo.appendChild(c),Pa(b),delete this.renderToClone):(c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),A(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),x.body.appendChild(b),c&&b.appendChild(c))},getContainer:function(){var a,b=this.options.chart,
|
||||
c,d,e;this.renderTo=a=b.renderTo;e="highcharts-"+tb++;if(Fa(a))this.renderTo=a=x.getElementById(a);a||oa(13,!0);c=z(F(a,"data-highcharts-chart"));!isNaN(c)&&W[c]&&W[c].hasRendered&&W[c].destroy();F(a,"data-highcharts-chart",this.index);a.innerHTML="";!b.skipClone&&!a.offsetWidth&&this.cloneRenderTo();this.getChartSize();c=this.chartWidth;d=this.chartHeight;this.container=a=$(Ja,{className:"highcharts-container"+(b.className?" "+b.className:""),id:e},r({position:"relative",overflow:"hidden",width:c+
|
||||
"px",height:d+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},b.style),this.renderToClone||a);this._cursor=a.style.cursor;this.renderer=b.forExport?new ta(a,c,d,b.style,!0):new Ya(a,c,d,b.style);ga&&this.renderer.create(this,a,c,d)},getMargins:function(){var a=this.spacing,b,c=this.legend,d=this.margin,e=this.options.legend,f=p(e.margin,20),g=e.x,h=e.y,i=e.align,j=e.verticalAlign,k=this.titleOffset;this.resetMargins();b=this.axisOffset;if(k&&!s(d[0]))this.plotTop=
|
||||
u(this.plotTop,k+this.options.title.margin+a[0]);if(c.display&&!e.floating)if(i==="right"){if(!s(d[1]))this.marginRight=u(this.marginRight,c.legendWidth-g+f+a[1])}else if(i==="left"){if(!s(d[3]))this.plotLeft=u(this.plotLeft,c.legendWidth+g+f+a[3])}else if(j==="top"){if(!s(d[0]))this.plotTop=u(this.plotTop,c.legendHeight+h+f+a[0])}else if(j==="bottom"&&!s(d[2]))this.marginBottom=u(this.marginBottom,c.legendHeight-h+f+a[2]);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&
|
||||
(this.plotTop+=this.extraTopMargin);this.hasCartesianSeries&&q(this.axes,function(a){a.getOffset()});s(d[3])||(this.plotLeft+=b[3]);s(d[0])||(this.plotTop+=b[0]);s(d[2])||(this.marginBottom+=b[2]);s(d[1])||(this.marginRight+=b[1]);this.setChartSize()},reflow:function(a){var b=this,c=b.options.chart,d=b.renderTo,e=c.width||hb(d,"width"),f=c.height||hb(d,"height"),c=a?a.target:H,d=function(){if(b.container)b.setSize(e,f,!1),b.hasUserSize=null};if(!b.hasUserSize&&e&&f&&(c===H||c===x)){if(e!==b.containerWidth||
|
||||
f!==b.containerHeight)clearTimeout(b.reflowTimeout),a?b.reflowTimeout=setTimeout(d,100):d();b.containerWidth=e;b.containerHeight=f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};N(H,"resize",b);N(a,"destroy",function(){X(H,"resize",b)})},setSize:function(a,b,c){var d=this,e,f,g;d.isResizing+=1;g=function(){d&&K(d,"endResize",null,function(){d.isResizing-=1})};Qa(c,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;if(s(a))d.chartWidth=e=u(0,v(a)),d.hasUserSize=!!e;if(s(b))d.chartHeight=
|
||||
f=u(0,v(b));(va?ib:A)(d.container,{width:e+"px",height:f+"px"},va);d.setChartSize(!0);d.renderer.setSize(e,f,c);d.maxTicks=null;q(d.axes,function(a){a.isDirty=!0;a.setScale()});q(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.redraw(c);d.oldChartHeight=null;K(d,"resize");va===!1?g():setTimeout(g,va&&va.duration||500)},setChartSize:function(a){var b=this.inverted,c=this.renderer,d=this.chartWidth,e=this.chartHeight,f=this.options.chart,g=this.spacing,
|
||||
h=this.clipOffset,i,j,k,l;this.plotLeft=i=v(this.plotLeft);this.plotTop=j=v(this.plotTop);this.plotWidth=k=u(0,v(d-i-this.marginRight));this.plotHeight=l=u(0,v(e-j-this.marginBottom));this.plotSizeX=b?l:k;this.plotSizeY=b?k:l;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:d-g[3]-g[1],height:e-g[0]-g[2]};this.plotBox=c.plotBox={x:i,y:j,width:k,height:l};d=2*U(this.plotBorderWidth/2);b=Ka(u(d,h[3])/2);c=Ka(u(d,h[0])/2);this.clipBox={x:b,y:c,width:U(this.plotSizeX-
|
||||
u(d,h[1])/2-b),height:u(0,U(this.plotSizeY-u(d,h[2])/2-c))};a||q(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this.spacing,b=this.margin;this.plotTop=p(b[0],a[0]);this.marginRight=p(b[1],a[1]);this.marginBottom=p(b[2],a[2]);this.plotLeft=p(b[3],a[3]);this.axisOffset=[0,0,0,0];this.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,b=this.renderer,c=this.chartWidth,d=this.chartHeight,e=this.chartBackground,f=this.plotBackground,g=
|
||||
this.plotBorder,h=this.plotBGImage,i=a.borderWidth||0,j=a.backgroundColor,k=a.plotBackgroundColor,l=a.plotBackgroundImage,m=a.plotBorderWidth||0,n,o=this.plotLeft,p=this.plotTop,q=this.plotWidth,r=this.plotHeight,u=this.plotBox,s=this.clipRect,v=this.clipBox;n=i+(a.shadow?8:0);if(i||j)if(e)e.animate(e.crisp({width:c-n,height:d-n}));else{e={fill:j||P};if(i)e.stroke=a.borderColor,e["stroke-width"]=i;this.chartBackground=b.rect(n/2,n/2,c-n,d-n,a.borderRadius,i).attr(e).addClass("highcharts-background").add().shadow(a.shadow)}if(k)f?
|
||||
f.animate(u):this.plotBackground=b.rect(o,p,q,r,0).attr({fill:k}).add().shadow(a.plotShadow);if(l)h?h.animate(u):this.plotBGImage=b.image(l,o,p,q,r).add();s?s.animate({width:v.width,height:v.height}):this.clipRect=b.clipRect(v);if(m)g?g.animate(g.crisp({x:o,y:p,width:q,height:r})):this.plotBorder=b.rect(o,p,q,r,0,-m).attr({stroke:a.plotBorderColor,"stroke-width":m,fill:P,zIndex:1}).add();this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,d=a.options.series,e,f;q(["inverted",
|
||||
"angular","polar"],function(g){c=J[b.type||b.defaultSeriesType];f=a[g]||b[g]||c&&c.prototype[g];for(e=d&&d.length;!f&&e--;)(c=J[d[e].type])&&c.prototype[g]&&(f=!0);a[g]=f})},linkSeries:function(){var a=this,b=a.series;q(b,function(a){a.linkedSeries.length=0});q(b,function(b){var d=b.options.linkedTo;if(Fa(d)&&(d=d===":previous"?a.series[b.index-1]:a.get(d)))d.linkedSeries.push(b),b.linkedParent=d})},renderSeries:function(){q(this.series,function(a){a.translate();a.setTooltipPoints&&a.setTooltipPoints();
|
||||
a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&q(b.items,function(c){var d=r(b.style,c.style),e=z(d.left)+a.plotLeft,f=z(d.top)+a.plotTop+12;delete d.left;delete d.top;a.renderer.text(c.html,e,f).attr({zIndex:2}).css(d).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options;this.setTitle();this.legend=new kb(this,c.legend);this.getStacks();q(a,function(a){a.setScale()});this.getMargins();this.maxTicks=null;q(a,function(a){a.setTickPositions(!0);a.setMaxTicks()});
|
||||
this.adjustTickAmounts();this.getMargins();this.drawChartBox();this.hasCartesianSeries&&q(a,function(a){a.render()});if(!this.seriesGroup)this.seriesGroup=b.g("series-group").attr({zIndex:3}).add();this.renderSeries();this.renderLabels();this.showCredits(c.credits);this.hasRendered=!0},showCredits:function(a){if(a.enabled&&!this.credits)this.credits=this.renderer.text(a.text,0,0).on("click",function(){if(a.href)location.href=a.href}).attr({align:a.position.align,zIndex:8}).css(a.style).add().align(a.position)},
|
||||
destroy:function(){var a=this,b=a.axes,c=a.series,d=a.container,e,f=d&&d.parentNode;K(a,"destroy");W[a.index]=t;$a--;a.renderTo.removeAttribute("data-highcharts-chart");X(a);for(e=b.length;e--;)b[e]=b[e].destroy();for(e=c.length;e--;)c[e]=c[e].destroy();q("title,subtitle,chartBackground,plotBackground,plotBGImage,plotBorder,seriesGroup,clipRect,credits,pointer,scroller,rangeSelector,legend,resetZoomButton,tooltip,renderer".split(","),function(b){var c=a[b];c&&c.destroy&&(a[b]=c.destroy())});if(d)d.innerHTML=
|
||||
"",X(d),f&&Pa(d);for(e in a)delete a[e]},isReadyToRender:function(){var a=this;return!ba&&H==H.top&&x.readyState!=="complete"||ga&&!H.canvg?(ga?Lb.push(function(){a.firstRender()},a.options.global.canvasToolsURL):x.attachEvent("onreadystatechange",function(){x.detachEvent("onreadystatechange",a.firstRender);x.readyState==="complete"&&a.firstRender()}),!1):!0},firstRender:function(){var a=this,b=a.options,c=a.callback;if(a.isReadyToRender()){a.getContainer();K(a,"init");a.resetMargins();a.setChartSize();
|
||||
a.propFromSeries();a.getAxes();q(b.series||[],function(b){a.initSeries(b)});a.linkSeries();K(a,"beforeRender");if(S.Pointer)a.pointer=new Va(a,b);a.render();a.renderer.draw();c&&c.apply(a,[a]);q(a.callbacks,function(b){b.apply(a,[a])});a.cloneRenderTo(!0);K(a,"load")}},splashArray:function(a,b){var c=b[a],c=da(c)?c:[c,c,c,c];return[p(b[a+"Top"],c[0]),p(b[a+"Right"],c[1]),p(b[a+"Bottom"],c[2]),p(b[a+"Left"],c[3])]}};Xa.prototype.callbacks=[];Z=S.CenteredSeriesMixin={getCenter:function(){var a=this.options,
|
||||
b=this.chart,c=2*(a.slicedOffset||0),d,e=b.plotWidth-2*c,f=b.plotHeight-2*c,b=a.center,a=[p(b[0],"50%"),p(b[1],"50%"),a.size||"100%",a.innerSize||0],g=C(e,f),h;return Ua(a,function(a,b){h=/%$/.test(a);d=b<2||b===2&&h;return(h?[e,f,g,g][b]*z(a)/100:a)+(d?c:0)})}};var Ea=function(){};Ea.prototype={init:function(a,b,c){this.series=a;this.applyOptions(b,c);this.pointAttr={};if(a.options.colorByPoint&&(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter++],a.colorCounter===
|
||||
b.length))a.colorCounter=0;a.chart.pointCount++;return this},applyOptions:function(a,b){var c=this.series,d=c.options.pointValKey||c.pointValKey,a=Ea.prototype.optionsToObject.call(this,a);r(this,a);this.options=this.options?r(this.options,a):a;if(d)this.y=this[d];if(this.x===t&&c)this.x=b===t?c.autoIncrement():b;return this},optionsToObject:function(a){var b={},c=this.series,d=c.pointArrayMap||["y"],e=d.length,f=0,g=0;if(typeof a==="number"||a===null)b[d[0]]=a;else if(La(a)){if(a.length>e){c=typeof a[0];
|
||||
if(c==="string")b.name=a[0];else if(c==="number")b.x=a[0];f++}for(;g<e;)b[d[g++]]=a[f++]}else if(typeof a==="object"){b=a;if(a.dataLabels)c._hasPointLabels=!0;if(a.marker)c._hasPointMarkers=!0}return b},destroy:function(){var a=this.series.chart,b=a.hoverPoints,c;a.pointCount--;if(b&&(this.setState(),ka(b,this),!b.length))a.hoverPoints=null;if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)X(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(c in this)this[c]=
|
||||
null},destroyElements:function(){for(var a="graphic,dataLabel,dataLabelUpper,group,connector,shadowGroup".split(","),b,c=6;c--;)b=a[c],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},tooltipFormatter:function(a){var b=this.series,c=b.tooltipOptions,d=p(c.valueDecimals,""),e=c.valuePrefix||"",f=c.valueSuffix||"";q(b.pointArrayMap||
|
||||
["y"],function(b){b="{point."+b;if(e||f)a=a.replace(b+"}",e+b+"}"+f);a=a.replace(b+"}",b+":,."+d+"f}")});return Ia(a,{point:this,series:this.series})},firePointEvent:function(a,b,c){var d=this,e=this.series.options;(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])&&this.importEvents();a==="click"&&e.allowPointSelect&&(c=function(a){d.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});K(this,a,b,c)}};var O=function(){};O.prototype={isCartesian:!0,type:"line",pointClass:Ea,sorted:!0,
|
||||
requireSorting:!0,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],init:function(a,b){var c=this,d,e,f=a.series,g=function(a,b){return p(a.options.index,a._i)-p(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();r(c,{name:b.name,state:"",pointAttr:{},visible:b.visible!==!1,selected:b.selected===!0});if(ga)b.animation=!1;e=b.events;for(d in e)N(c,
|
||||
d,e[d]);if(e&&e.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();q(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);if(c.isCartesian)a.hasCartesianSeries=!0;f.push(c);c._i=f.length-1;nb(f,g);this.yAxis&&nb(this.yAxis.series,g);q(f,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,b=a.options,c=a.chart,d;q(a.axisTypes||[],function(e){q(c[e],function(c){d=c.options;if(b[e]===
|
||||
d.index||b[e]!==t&&b[e]===d.id||b[e]===t&&d.index===0)c.series.push(a),a[e]=c,c.isDirty=!0});!a[e]&&a.optionalAxis!==e&&oa(18,!0)})},updateParallelArrays:function(a,b){var c=a.series,d=arguments;q(c.parallelArrays,typeof b==="number"?function(d){var f=d==="y"&&c.toYData?c.toYData(a):a[d];c[d+"Data"][b]=f}:function(a){Array.prototype[b].apply(c[a+"Data"],Array.prototype.slice.call(d,2))})},autoIncrement:function(){var a=this.options,b=this.xIncrement,b=p(b,a.pointStart,0);this.pointInterval=p(this.pointInterval,
|
||||
a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},getSegments:function(){var a=-1,b=[],c,d=this.points,e=d.length;if(e)if(this.options.connectNulls){for(c=e;c--;)d[c].y===null&&d.splice(c,1);d.length&&(b=[d])}else q(d,function(c,g){c.y===null?(g>a+1&&b.push(d.slice(a+1,g)),a=g):g===e-1&&b.push(d.slice(a+1,g+1))});this.segments=b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},d=b.plotOptions||{},e=c[this.type];this.userOptions=a;c=w(e,c.series,
|
||||
a);this.tooltipOptions=w(L.tooltip,L.plotOptions[this.type].tooltip,b.tooltip,d.series&&d.series.tooltip,d[this.type]&&d[this.type].tooltip,a.tooltip);e.marker===null&&delete c.marker;return c},getCyclic:function(a,b,c){var d=this.userOptions,e="_"+a+"Index",f=a+"Counter";b||(s(d[e])?b=d[e]:(d[e]=b=this.chart[f]%c.length,this.chart[f]+=1),b=c[b]);this[a]=b},getColor:function(){this.options.colorByPoint||this.getCyclic("color",this.options.color||ca[this.type].color,this.chart.options.colors)},getSymbol:function(){var a=
|
||||
this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);if(/^url/.test(this.symbol))a.radius=0},drawLegendSymbol:M.drawLineMarker,setData:function(a,b,c,d){var e=this,f=e.points,g=f&&f.length||0,h,i=e.options,j=e.chart,k=null,l=e.xAxis,m=l&&!!l.categories,n=e.tooltipPoints,o=i.turboThreshold,r=this.xData,u=this.yData,s=(h=e.pointArrayMap)&&h.length,a=a||[];h=a.length;b=p(b,!0);if(d!==!1&&h&&g===h&&!e.cropped&&!e.hasGroupedData)q(a,function(a,b){f[b].update(a,!1)});else{e.xIncrement=
|
||||
null;e.pointRange=m?1:i.pointRange;e.colorCounter=0;q(this.parallelArrays,function(a){e[a+"Data"].length=0});if(o&&h>o){for(c=0;k===null&&c<h;)k=a[c],c++;if(ia(k)){m=p(i.pointStart,0);i=p(i.pointInterval,1);for(c=0;c<h;c++)r[c]=m,u[c]=a[c],m+=i;e.xIncrement=m}else if(La(k))if(s)for(c=0;c<h;c++)i=a[c],r[c]=i[0],u[c]=i.slice(1,s+1);else for(c=0;c<h;c++)i=a[c],r[c]=i[0],u[c]=i[1];else oa(12)}else for(c=0;c<h;c++)if(a[c]!==t&&(i={series:e},e.pointClass.prototype.applyOptions.apply(i,[a[c]]),e.updateParallelArrays(i,
|
||||
c),m&&i.name))l.names[i.x]=i.name;Fa(u[0])&&oa(14,!0);e.data=[];e.options.data=a;for(c=g;c--;)f[c]&&f[c].destroy&&f[c].destroy();if(n)n.length=0;if(l)l.minRange=l.userMinRange;e.isDirty=e.isDirtyData=j.isDirtyBox=!0;c=!1}b&&j.redraw(c)},processData:function(a){var b=this.xData,c=this.yData,d=b.length,e;e=0;var f,g,h=this.xAxis,i=this.options,j=i.cropThreshold,k=0,l=this.isCartesian,m,n;if(l&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(l&&this.sorted&&(!j||d>j||this.forceCrop))if(m=
|
||||
h.getExtremes(),n=m.min,m=m.max,b[d-1]<n||b[0]>m)b=[],c=[];else if(b[0]<n||b[d-1]>m)e=this.cropData(this.xData,this.yData,n,m),b=e.xData,c=e.yData,e=e.start,f=!0,k=b.length;for(a=b.length-1;a>=0;a--)d=b[a]-b[a-1],!f&&b[a]>n&&b[a]<m&&k++,d>0&&(g===t||d<g)?g=d:d<0&&this.requireSorting&&oa(15);this.cropped=f;this.cropStart=e;this.processedXData=b;this.processedYData=c;this.activePointCount=k;if(i.pointRange===null)this.pointRange=g||1;this.closestPointRange=g},cropData:function(a,b,c,d){var e=a.length,
|
||||
f=0,g=e,h=p(this.cropShoulder,1),i;for(i=0;i<e;i++)if(a[i]>=c){f=u(0,i-h);break}for(;i<e;i++)if(a[i]>d){g=i+h;break}return{xData:a.slice(f,g),yData:b.slice(f,g),start:f,end:g}},generatePoints:function(){var a=this.options.data,b=this.data,c,d=this.processedXData,e=this.processedYData,f=this.pointClass,g=d.length,h=this.cropStart||0,i,j=this.hasGroupedData,k,l=[],m;if(!b&&!j)b=[],b.length=a.length,b=this.data=b;for(m=0;m<g;m++)i=h+m,j?l[m]=(new f).init(this,[d[m]].concat(ra(e[m]))):(b[i]?k=b[i]:a[i]!==
|
||||
t&&(b[i]=k=(new f).init(this,a[i],d[m])),l[m]=k);if(b&&(g!==(c=b.length)||j))for(m=0;m<c;m++)if(m===h&&!j&&(m+=g),b[m])b[m].destroyElements(),b[m].plotX=t;this.data=b;this.points=l},getExtremes:function(a){var b=this.yAxis,c=this.processedXData,d,e=[],f=0;d=this.xAxis.getExtremes();var g=d.min,h=d.max,i,j,k,l,a=a||this.stackedYData||this.processedYData;d=a.length;for(l=0;l<d;l++)if(j=c[l],k=a[l],i=k!==null&&k!==t&&(!b.isLog||k.length||k>0),j=this.getExtremesFromAll||this.cropped||(c[l+1]||j)>=g&&
|
||||
(c[l-1]||j)<=h,i&&j)if(i=k.length)for(;i--;)k[i]!==null&&(e[f++]=k[i]);else e[f++]=k;this.dataMin=p(void 0,Na(e));this.dataMax=p(void 0,Ba(e))},translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,c=this.xAxis,d=c.categories,e=this.yAxis,f=this.points,g=f.length,h=!!this.modifyValue,i=a.pointPlacement,j=i==="between"||ia(i),k=a.threshold,a=0;a<g;a++){var l=f[a],m=l.x,n=l.y,o=l.low,q=b&&e.stacks[(this.negStacks&&n<k?"-":"")+this.stackKey];
|
||||
if(e.isLog&&n<=0)l.y=n=null;l.plotX=c.translate(m,0,0,0,1,i,this.type==="flags");if(b&&this.visible&&q&&q[m])q=q[m],n=q.points[this.index+","+a],o=n[0],n=n[1],o===0&&(o=p(k,e.min)),e.isLog&&o<=0&&(o=null),l.total=l.stackTotal=q.total,l.percentage=q.total&&l.y/q.total*100,l.stackY=n,q.setOffset(this.pointXOffset||0,this.barW||0);l.yBottom=s(o)?e.translate(o,0,1,0,1):null;h&&(n=this.modifyValue(n,l));l.plotY=typeof n==="number"&&n!==Infinity?e.translate(n,0,1,0,1):t;l.clientX=j?c.translate(m,0,0,0,
|
||||
1):l.plotX;l.negative=l.y<(k||0);l.category=d&&d[l.x]!==t?d[l.x]:l.x}this.getSegments()},animate:function(a){var b=this.chart,c=b.renderer,d;d=this.options.animation;var e=this.clipBox||b.clipBox,f=b.inverted,g;if(d&&!da(d))d=ca[this.type].animation;g=["_sharedClip",d.duration,d.easing,e.height].join(",");a?(a=b[g],d=b[g+"m"],a||(b[g]=a=c.clipRect(r(e,{width:0})),b[g+"m"]=d=c.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),this.group.clip(a),this.markerGroup.clip(d),this.sharedClipKey=
|
||||
g):((a=b[g])&&a.animate({width:b.plotSizeX},d),b[g+"m"]&&b[g+"m"].animate({width:b.plotSizeX+99},d),this.animate=null)},afterAnimate:function(){var a=this.chart,b=this.sharedClipKey,c=this.group,d=this.clipBox;if(c&&this.options.clip!==!1){if(!b||!d)c.clip(d?a.renderer.clipRect(d):a.clipRect);this.markerGroup.clip()}K(this,"afterAnimate");setTimeout(function(){b&&a[b]&&(d||(a[b]=a[b].destroy()),a[b+"m"]&&(a[b+"m"]=a[b+"m"].destroy()))},100)},drawPoints:function(){var a,b=this.points,c=this.chart,
|
||||
d,e,f,g,h,i,j,k;d=this.options.marker;var l=this.pointAttr[""],m,n=this.markerGroup,o=p(d.enabled,this.activePointCount<0.5*this.xAxis.len/d.radius);if(d.enabled!==!1||this._hasPointMarkers)for(f=b.length;f--;)if(g=b[f],d=U(g.plotX),e=g.plotY,k=g.graphic,i=g.marker||{},a=o&&i.enabled===t||i.enabled,m=c.isInsidePlot(v(d),e,c.inverted),a&&e!==t&&!isNaN(e)&&g.y!==null)if(a=g.pointAttr[g.selected?"select":""]||l,h=a.r,i=p(i.symbol,this.symbol),j=i.indexOf("url")===0,k)k[m?"show":"hide"](!0).animate(r({x:d-
|
||||
h,y:e-h},k.symbolName?{width:2*h,height:2*h}:{}));else{if(m&&(h>0||j))g.graphic=c.renderer.symbol(i,d-h,e-h,2*h,2*h).attr(a).add(n)}else if(k)g.graphic=k.destroy()},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={},a=a||{},b=b||{},c=c||{},d=d||{};for(f in e)g=e[f],h[f]=p(a[g],b[f],c[f],d[f]);return h},getAttribs:function(){var a=this,b=a.options,c=ca[a.type].marker?b.marker:b,d=c.states,e=d.hover,f,g=a.color;f={stroke:g,fill:g};var h=a.points||[],i,j=[],k,l=a.pointAttrToOptions;
|
||||
k=a.hasPointSpecificOptions;var m=b.negativeColor,n=c.lineColor,o=c.fillColor;i=b.turboThreshold;var p;b.marker?(e.radius=e.radius||c.radius+e.radiusPlus,e.lineWidth=e.lineWidth||c.lineWidth+e.lineWidthPlus):e.color=e.color||ya(e.color||g).brighten(e.brightness).get();j[""]=a.convertAttribs(c,f);q(["hover","select"],function(b){j[b]=a.convertAttribs(d[b],j[""])});a.pointAttr=j;g=h.length;if(!i||g<i||k)for(;g--;){i=h[g];if((c=i.options&&i.options.marker||i.options)&&c.enabled===!1)c.radius=0;if(i.negative&&
|
||||
m)i.color=i.fillColor=m;k=b.colorByPoint||i.color;if(i.options)for(p in l)s(c[l[p]])&&(k=!0);if(k){c=c||{};k=[];d=c.states||{};f=d.hover=d.hover||{};if(!b.marker)f.color=f.color||!i.options.color&&e.color||ya(i.color).brighten(f.brightness||e.brightness).get();f={color:i.color};if(!o)f.fillColor=i.color;if(!n)f.lineColor=i.color;k[""]=a.convertAttribs(r(f,c),j[""]);k.hover=a.convertAttribs(d.hover,j.hover,k[""]);k.select=a.convertAttribs(d.select,j.select,k[""])}else k=j;i.pointAttr=k}},destroy:function(){var a=
|
||||
this,b=a.chart,c=/AppleWebKit\/533/.test(wa),d,e,f=a.data||[],g,h,i;K(a,"destroy");X(a);q(a.axisTypes||[],function(b){if(i=a[b])ka(i.series,a),i.isDirty=i.forceRedraw=!0});a.legendItem&&a.chart.legend.destroyItem(a);for(e=f.length;e--;)(g=f[e])&&g.destroy&&g.destroy();a.points=null;clearTimeout(a.animationTimeout);q("area,graph,dataLabelsGroup,group,markerGroup,tracker,graphNeg,areaNeg,posClip,negClip".split(","),function(b){a[b]&&(d=c&&b==="group"?"hide":"destroy",a[b][d]())});if(b.hoverSeries===
|
||||
a)b.hoverSeries=null;ka(b.series,a);for(h in a)delete a[h]},getSegmentPath:function(a){var b=this,c=[],d=b.options.step;q(a,function(e,f){var g=e.plotX,h=e.plotY,i;b.getPointSpline?c.push.apply(c,b.getPointSpline(a,e,f)):(c.push(f?"L":"M"),d&&f&&(i=a[f-1],d==="right"?c.push(i.plotX,h):d==="center"?c.push((i.plotX+g)/2,i.plotY,(i.plotX+g)/2,h):c.push(g,i.plotY)),c.push(e.plotX,e.plotY))});return c},getGraphPath:function(){var a=this,b=[],c,d=[];q(a.segments,function(e){c=a.getSegmentPath(e);e.length>
|
||||
1?b=b.concat(c):d.push(e[0])});a.singlePoints=d;return a.graphPath=b},drawGraph:function(){var a=this,b=this.options,c=[["graph",b.lineColor||this.color]],d=b.lineWidth,e=b.dashStyle,f=b.linecap!=="square",g=this.getGraphPath(),h=b.negativeColor;h&&c.push(["graphNeg",h]);q(c,function(c,h){var k=c[0],l=a[k];if(l)ab(l),l.animate({d:g});else if(d&&g.length)l={stroke:c[1],"stroke-width":d,fill:P,zIndex:1},e?l.dashstyle=e:f&&(l["stroke-linecap"]=l["stroke-linejoin"]="round"),a[k]=a.chart.renderer.path(g).attr(l).add(a.group).shadow(!h&&
|
||||
b.shadow)})},clipNeg:function(){var a=this.options,b=this.chart,c=b.renderer,d=a.negativeColor||a.negativeFillColor,e,f=this.graph,g=this.area,h=this.posClip,i=this.negClip;e=b.chartWidth;var j=b.chartHeight,k=u(e,j),l=this.yAxis;if(d&&(f||g)){d=v(l.toPixels(a.threshold||0,!0));d<0&&(k-=d);a={x:0,y:0,width:k,height:d};k={x:0,y:d,width:k,height:k};if(b.inverted)a.height=k.y=b.plotWidth-d,c.isVML&&(a={x:b.plotWidth-d-b.plotLeft,y:0,width:e,height:j},k={x:d+b.plotLeft-e,y:0,width:b.plotLeft+d,height:e});
|
||||
l.reversed?(b=k,e=a):(b=a,e=k);h?(h.animate(b),i.animate(e)):(this.posClip=h=c.clipRect(b),this.negClip=i=c.clipRect(e),f&&this.graphNeg&&(f.clip(h),this.graphNeg.clip(i)),g&&(g.clip(h),this.areaNeg.clip(i)))}},invertGroups:function(){function a(){var a={width:b.yAxis.len,height:b.xAxis.len};q(["group","markerGroup"],function(c){b[c]&&b[c].attr(a).invert()})}var b=this,c=b.chart;if(b.xAxis)N(c,"resize",a),N(b,"destroy",function(){X(c,"resize",a)}),a(),b.invertGroups=a},plotGroup:function(a,b,c,d,
|
||||
e){var f=this[a],g=!f;g&&(this[a]=f=this.chart.renderer.g(b).attr({visibility:c,zIndex:d||0.1}).add(e));f[g?"attr":"animate"](this.getPlotBox());return f},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;if(a.inverted)b=c,c=this.xAxis;return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},render:function(){var a=this,b=a.chart,c,d=a.options,e=(c=d.animation)&&!!a.animate&&b.renderer.isSVG&&p(c.duration,500)||0,f=a.visible?"visible":"hidden",g=d.zIndex,
|
||||
h=a.hasRendered,i=b.seriesGroup;c=a.plotGroup("group","series",f,g,i);a.markerGroup=a.plotGroup("markerGroup","markers",f,g,i);e&&a.animate(!0);a.getAttribs();c.inverted=a.isCartesian?b.inverted:!1;a.drawGraph&&(a.drawGraph(),a.clipNeg());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&a.options.enableMouseTracking!==!1&&a.drawTracker();b.inverted&&a.invertGroups();d.clip!==!1&&!a.sharedClipKey&&!h&&c.clip(b.clipRect);e&&a.animate();if(!h)e?a.animationTimeout=setTimeout(function(){a.afterAnimate()},
|
||||
e):a.afterAnimate();a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=this.chart,b=this.isDirtyData,c=this.group,d=this.xAxis,e=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:p(d&&d.left,a.plotLeft),translateY:p(e&&e.top,a.plotTop)}));this.translate();this.setTooltipPoints&&this.setTooltipPoints(!0);this.render();b&&K(this,"updatedData")}};Fb.prototype={destroy:function(){Oa(this,this.axis)},render:function(a){var b=this.options,
|
||||
c=b.format,c=c?Ia(c,this):b.formatter.call(this);this.label?this.label.attr({text:c,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(c,null,null,b.useHTML).css(b.style).attr({align:this.textAlign,rotation:b.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,b){var c=this.axis,d=c.chart,e=d.inverted,f=this.isNegative,g=c.translate(c.usePercentage?100:this.total,0,0,0,1),c=c.translate(0),c=Q(g-c),h=d.xAxis[0].translate(this.x)+a,i=d.plotHeight,f={x:e?f?g:g-c:h,y:e?i-h-b:f?i-g-
|
||||
c:i-g,width:e?c:b,height:e?b:c};if(e=this.label)e.align(this.alignOptions,null,f),f=e.alignAttr,e[this.options.crop===!1||d.isInsidePlot(f.x,f.y)?"show":"hide"](!0)}};ma.prototype.buildStacks=function(){var a=this.series,b=p(this.options.reversedStacks,!0),c=a.length;if(!this.isXAxis){for(this.usePercentage=!1;c--;)a[b?c:a.length-c-1].setStackedPoints();if(this.usePercentage)for(c=0;c<a.length;c++)a[c].setPercentStacks()}};ma.prototype.renderStackTotals=function(){var a=this.chart,b=a.renderer,c=
|
||||
this.stacks,d,e,f=this.stackTotalGroup;if(!f)this.stackTotalGroup=f=b.g("stack-labels").attr({visibility:"visible",zIndex:6}).add();f.translate(a.plotLeft,a.plotTop);for(d in c)for(e in a=c[d],a)a[e].render(f)};O.prototype.setStackedPoints=function(){if(this.options.stacking&&!(this.visible!==!0&&this.chart.options.chart.ignoreHiddenSeries!==!1)){var a=this.processedXData,b=this.processedYData,c=[],d=b.length,e=this.options,f=e.threshold,g=e.stack,e=e.stacking,h=this.stackKey,i="-"+h,j=this.negStacks,
|
||||
k=this.yAxis,l=k.stacks,m=k.oldStacks,n,o,p,q,r,s;for(q=0;q<d;q++){r=a[q];s=b[q];p=this.index+","+q;o=(n=j&&s<f)?i:h;l[o]||(l[o]={});if(!l[o][r])m[o]&&m[o][r]?(l[o][r]=m[o][r],l[o][r].total=null):l[o][r]=new Fb(k,k.options.stackLabels,n,r,g);o=l[o][r];o.points[p]=[o.cum||0];e==="percent"?(n=n?h:i,j&&l[n]&&l[n][r]?(n=l[n][r],o.total=n.total=u(n.total,o.total)+Q(s)||0):o.total=ea(o.total+(Q(s)||0))):o.total=ea(o.total+(s||0));o.cum=(o.cum||0)+(s||0);o.points[p].push(o.cum);c[q]=o.cum}if(e==="percent")k.usePercentage=
|
||||
!0;this.stackedYData=c;k.oldStacks={}}};O.prototype.setPercentStacks=function(){var a=this,b=a.stackKey,c=a.yAxis.stacks,d=a.processedXData;q([b,"-"+b],function(b){var e;for(var f=d.length,g,h;f--;)if(g=d[f],e=(h=c[b]&&c[b][g])&&h.points[a.index+","+f],g=e)h=h.total?100/h.total:0,g[0]=ea(g[0]*h),g[1]=ea(g[1]*h),a.stackedYData[f]=g[1]})};r(Xa.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=p(b,!0),K(e,"addSeries",{options:a},function(){d=e.initSeries(a);e.isDirtyLegend=!0;e.linkSeries();b&&
|
||||
e.redraw(c)}));return d},addAxis:function(a,b,c,d){var e=b?"xAxis":"yAxis",f=this.options;new ma(this,w(a,{index:this[e].length,isX:b}));f[e]=ra(f[e]||{});f[e].push(a);p(c,!0)&&this.redraw(d)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=c.loading,f=function(){d&&A(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};if(!d)b.loadingDiv=d=$(Ja,{className:"highcharts-loading"},r(e.style,{zIndex:10,display:P}),b.container),b.loadingSpan=$("span",
|
||||
null,e.labelStyle,d),N(b,"redraw",f);b.loadingSpan.innerHTML=a||c.lang.loading;if(!b.loadingShown)A(d,{opacity:0,display:""}),ib(d,{opacity:e.style.opacity},{duration:e.showDuration||0}),b.loadingShown=!0;f()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&ib(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){A(b,{display:P})}});this.loadingShown=!1}});r(Ea.prototype,{update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g,h=e.data,i=e.chart,j=e.options,b=p(b,
|
||||
!0);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(da(a)){e.getAttribs();if(f)a&&a.marker&&a.marker.symbol?d.graphic=f.destroy():f.attr(d.pointAttr[d.state||""]);if(a&&a.dataLabels&&d.dataLabel)d.dataLabel=d.dataLabel.destroy()}g=Da(d,h);e.updateParallelArrays(d,g);j.data[g]=d.options;e.isDirty=e.isDirtyData=!0;if(!e.fixedBox&&e.hasCartesianSeries)i.isDirtyBox=!0;j.legendType==="point"&&i.legend.destroyItem(d);b&&i.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.points,
|
||||
f=d.chart,g,h=d.data;Qa(b,f);a=p(a,!0);c.firePointEvent("remove",null,function(){g=Da(c,h);h.length===e.length&&e.splice(g,1);h.splice(g,1);d.options.data.splice(g,1);d.updateParallelArrays(c,"splice",g,1);c.destroy();d.isDirty=!0;d.isDirtyData=!0;a&&f.redraw()})}});r(O.prototype,{addPoint:function(a,b,c,d){var e=this.options,f=this.data,g=this.graph,h=this.area,i=this.chart,j=this.xAxis&&this.xAxis.names,k=g&&g.shift||0,l=e.data,m,n=this.xData;Qa(d,i);c&&q([g,h,this.graphNeg,this.areaNeg],function(a){if(a)a.shift=
|
||||
k+1});if(h)h.isArea=!0;b=p(b,!0);d={series:this};this.pointClass.prototype.applyOptions.apply(d,[a]);g=d.x;h=n.length;if(this.requireSorting&&g<n[h-1])for(m=!0;h&&n[h-1]>g;)h--;this.updateParallelArrays(d,"splice",h,0,0);this.updateParallelArrays(d,h);if(j)j[g]=d.name;l.splice(h,0,a);m&&(this.data.splice(h,0,null),this.processData());e.legendType==="point"&&this.generatePoints();c&&(f[0]&&f[0].remove?f[0].remove(!1):(f.shift(),this.updateParallelArrays(d,"shift"),l.shift()));this.isDirtyData=this.isDirty=
|
||||
!0;b&&(this.getAttribs(),i.redraw())},remove:function(a,b){var c=this,d=c.chart,a=p(a,!0);if(!c.isRemoving)c.isRemoving=!0,K(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=!0;d.linkSeries();a&&d.redraw(b)});c.isRemoving=!1},update:function(a,b){var c=this,d=this.chart,e=this.userOptions,f=this.type,g=J[f].prototype,h=["group","markerGroup","dataLabelsGroup"],i;q(h,function(a){h[a]=c[a];delete c[a]});a=w(e,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},
|
||||
a);this.remove(!1);for(i in g)g.hasOwnProperty(i)&&(this[i]=t);r(this,J[a.type||f].prototype);q(h,function(a){c[a]=h[a]});this.init(d,a);d.linkSeries();p(b,!0)&&d.redraw(!1)}});r(ma.prototype,{update:function(a,b){var c=this.chart,a=c.options[this.coll][this.options.index]=w(this.userOptions,a);this.destroy(!0);this._addedPlotLB=t;this.init(c,r(a,{events:t}));c.isDirtyBox=!0;p(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,d=this.series,e=d.length;e--;)d[e]&&d[e].remove(!1);
|
||||
ka(b.axes,this);ka(b[c],this);b.options[c].splice(this.options.index,1);q(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;p(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}});ha=la(O);J.line=ha;ca.area=w(T,{threshold:0});var qa=la(O,{type:"area",getSegments:function(){var a=this,b=[],c=[],d=[],e=this.xAxis,f=this.yAxis,g=f.stacks[this.stackKey],h={},i,j,k=this.points,l=this.options.connectNulls,m,n;
|
||||
if(this.options.stacking&&!this.cropped){for(m=0;m<k.length;m++)h[k[m].x]=k[m];for(n in g)g[n].total!==null&&d.push(+n);d.sort(function(a,b){return a-b});q(d,function(b){var d=0,k;if(!l||h[b]&&h[b].y!==null)if(h[b])c.push(h[b]);else{for(m=a.index;m<=f.series.length;m++)if(k=g[b].points[m+","+b]){d=k[1];break}i=e.translate(b);j=f.toPixels(d,!0);c.push({y:null,plotX:i,clientX:i,plotY:j,yBottom:j,onMouseOver:sa})}});c.length&&b.push(c)}else O.prototype.getSegments.call(this),b=this.segments;this.segments=
|
||||
b},getSegmentPath:function(a){var b=O.prototype.getSegmentPath.call(this,a),c=[].concat(b),d,e=this.options;d=b.length;var f=this.yAxis.getThreshold(e.threshold),g;d===3&&c.push("L",b[1],b[2]);if(e.stacking&&!this.closedStacks)for(d=a.length-1;d>=0;d--)g=p(a[d].yBottom,f),d<a.length-1&&e.step&&c.push(a[d+1].plotX,g),c.push(a[d].plotX,g);else this.closeSegment(c,a,f);this.areaPath=this.areaPath.concat(c);return b},closeSegment:function(a,b,c){a.push("L",b[b.length-1].plotX,c,"L",b[0].plotX,c)},drawGraph:function(){this.areaPath=
|
||||
[];O.prototype.drawGraph.apply(this);var a=this,b=this.areaPath,c=this.options,d=c.negativeColor,e=c.negativeFillColor,f=[["area",this.color,c.fillColor]];(d||e)&&f.push(["areaNeg",d,e]);q(f,function(d){var e=d[0],f=a[e];f?f.animate({d:b}):a[e]=a.chart.renderer.path(b).attr({fill:p(d[2],ya(d[1]).setOpacity(p(c.fillOpacity,0.75)).get()),zIndex:0}).add(a.group)})},drawLegendSymbol:M.drawRectangle});J.area=qa;ca.spline=w(T);ha=la(O,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,
|
||||
f=a[c-1],g=a[c+1],h,i,j,k;if(f&&g){a=f.plotY;j=g.plotX;var g=g.plotY,l;h=(1.5*d+f.plotX)/2.5;i=(1.5*e+a)/2.5;j=(1.5*d+j)/2.5;k=(1.5*e+g)/2.5;l=(k-i)*(j-d)/(j-h)+e-k;i+=l;k+=l;i>a&&i>e?(i=u(a,e),k=2*e-i):i<a&&i<e&&(i=C(a,e),k=2*e-i);k>g&&k>e?(k=u(g,e),i=2*e-k):k<g&&k<e&&(k=C(g,e),i=2*e-k);b.rightContX=j;b.rightContY=k}c?(b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,i||e,d,e],f.rightContX=f.rightContY=null):b=["M",d,e];return b}});J.spline=ha;ca.areaspline=w(ca.area);qa=qa.prototype;ha=la(ha,
|
||||
{type:"areaspline",closedStacks:!0,getSegmentPath:qa.getSegmentPath,closeSegment:qa.closeSegment,drawGraph:qa.drawGraph,drawLegendSymbol:M.drawRectangle});J.areaspline=ha;ca.column=w(T,{borderColor:"#FFFFFF",borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{brightness:0.1,shadow:!1,halo:!1},select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}},dataLabels:{align:null,verticalAlign:null,y:null},stickyTracking:!1,tooltip:{distance:6},
|
||||
threshold:0});ha=la(O,{type:"column",pointAttrToOptions:{stroke:"borderColor",fill:"color",r:"borderRadius"},cropShoulder:0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){O.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&q(b.series,function(b){if(b.type===a.type)b.isDirty=!0})},getColumnMetrics:function(){var a=this,b=a.options,c=a.xAxis,d=a.yAxis,e=c.reversed,f,g={},h,i=0;b.grouping===!1?i=1:q(a.chart.series,function(b){var c=b.options,e=b.yAxis;if(b.type===
|
||||
a.type&&b.visible&&d.len===e.len&&d.pos===e.pos)c.stacking?(f=b.stackKey,g[f]===t&&(g[f]=i++),h=g[f]):c.grouping!==!1&&(h=i++),b.columnIndex=h});var c=C(Q(c.transA)*(c.ordinalSlope||b.pointRange||c.closestPointRange||c.tickInterval||1),c.len),j=c*b.groupPadding,k=(c-2*j)/i,l=b.pointWidth,b=s(l)?(k-l)/2:k*b.pointPadding,l=p(l,k-2*b);return a.columnMetrics={width:l,offset:b+(j+((e?i-(a.columnIndex||0):a.columnIndex)||0)*k-c/2)*(e?-1:1)}},translate:function(){var a=this,b=a.chart,c=a.options,d=a.borderWidth=
|
||||
p(c.borderWidth,a.activePointCount>0.5*a.xAxis.len?0:1),e=a.yAxis,f=a.translatedThreshold=e.getThreshold(c.threshold),g=p(c.minPointLength,5),h=a.getColumnMetrics(),i=h.width,j=a.barW=u(i,1+2*d),k=a.pointXOffset=h.offset,l=-(d%2?0.5:0),m=d%2?0.5:1;b.renderer.isVML&&b.inverted&&(m+=1);c.pointPadding&&(j=Ka(j));O.prototype.translate.apply(a);q(a.points,function(c){var d=p(c.yBottom,f),h=C(u(-999-d,c.plotY),e.len+999+d),q=c.plotX+k,r=j,s=C(h,d),t;t=u(h,d)-s;Q(t)<g&&g&&(t=g,s=v(Q(s-f)>g?d-g:f-(e.translate(c.y,
|
||||
0,1,0,1)<=f?g:0)));c.barX=q;c.pointWidth=i;c.tooltipPos=b.inverted?[e.len-h,a.xAxis.len-q-r/2]:[q+r/2,h];r=v(q+r)+l;q=v(q)+l;r-=q;d=Q(s)<0.5;t=v(s+t)+m;s=v(s)+m;t-=s;d&&(s-=1,t+=1);c.shapeType="rect";c.shapeArgs={x:q,y:s,width:r,height:t}})},getSymbol:sa,drawLegendSymbol:M.drawRectangle,drawGraph:sa,drawPoints:function(){var a=this,b=this.chart,c=a.options,d=b.renderer,e=c.animationLimit||250,f,g;q(a.points,function(h){var i=h.plotY,j=h.graphic;if(i!==t&&!isNaN(i)&&h.y!==null)f=h.shapeArgs,i=s(a.borderWidth)?
|
||||
{"stroke-width":a.borderWidth}:{},g=h.pointAttr[h.selected?"select":""]||a.pointAttr[""],j?(ab(j),j.attr(i)[b.pointCount<e?"animate":"attr"](w(f))):h.graphic=d[h.shapeType](f).attr(g).attr(i).add(a.group).shadow(c.shadow,null,c.stacking&&!c.borderRadius);else if(j)h.graphic=j.destroy()})},animate:function(a){var b=this.yAxis,c=this.options,d=this.chart.inverted,e={};if(ba)a?(e.scaleY=0.001,a=C(b.pos+b.len,u(b.pos,b.toPixels(c.threshold))),d?e.translateX=a-b.len:e.translateY=a,this.group.attr(e)):
|
||||
(e.scaleY=1,e[d?"translateX":"translateY"]=b.pos,this.group.animate(e,this.options.animation),this.animate=null)},remove:function(){var a=this,b=a.chart;b.hasRendered&&q(b.series,function(b){if(b.type===a.type)b.isDirty=!0});O.prototype.remove.apply(a,arguments)}});J.column=ha;ca.bar=w(ca.column);qa=la(ha,{type:"bar",inverted:!0});J.bar=qa;ca.scatter=w(T,{lineWidth:0,tooltip:{headerFormat:'<span style="color:{series.color}">●</span> <span style="font-size: 10px;"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"},
|
||||
stickyTracking:!1});qa=la(O,{type:"scatter",sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,singularTooltips:!0,drawGraph:function(){this.options.lineWidth&&O.prototype.drawGraph.call(this)}});J.scatter=qa;ca.pie=w(T,{borderColor:"#FFFFFF",borderWidth:1,center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return this.point.name}},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,
|
||||
showInLegend:!1,slicedOffset:10,states:{hover:{brightness:0.1,shadow:!1}},stickyTracking:!1,tooltip:{followPointer:!0}});T={type:"pie",isCartesian:!1,pointClass:la(Ea,{init:function(){Ea.prototype.init.apply(this,arguments);var a=this,b;if(a.y<0)a.y=null;r(a,{visible:a.visible!==!1,name:p(a.name,"Slice")});b=function(b){a.slice(b.type==="select")};N(a,"select",b);N(a,"unselect",b);return a},setVisible:function(a){var b=this,c=b.series,d=c.chart;b.visible=b.options.visible=a=a===t?!b.visible:a;c.options.data[Da(b,
|
||||
c.data)]=b.options;q(["graphic","dataLabel","connector","shadowGroup"],function(c){if(b[c])b[c][a?"show":"hide"](!0)});b.legendItem&&d.legend.colorizeItem(b,a);if(!c.isDirty&&c.options.ignoreHiddenPoint)c.isDirty=!0,d.redraw()},slice:function(a,b,c){var d=this.series;Qa(c,d.chart);p(b,!0);this.sliced=this.options.sliced=a=s(a)?a:!this.sliced;d.options.data[Da(this,d.data)]=this.options;a=a?this.slicedTranslation:{translateX:0,translateY:0};this.graphic.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)},
|
||||
haloPath:function(a){var b=this.shapeArgs,c=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(c.plotLeft+b.x,c.plotTop+b.y,b.r+a,b.r+a,{innerR:this.shapeArgs.r,start:b.start,end:b.end})}}),requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},singularTooltips:!0,getColor:sa,animate:function(a){var b=this,c=b.points,d=b.startAngleRad;
|
||||
if(!a)q(c,function(a){var c=a.graphic,a=a.shapeArgs;c&&(c.attr({r:b.center[3]/2,start:d,end:d}),c.animate({r:a.r,start:a.start,end:a.end},b.options.animation))}),b.animate=null},setData:function(a,b,c,d){O.prototype.setData.call(this,a,!1,c,d);this.processData();this.generatePoints();p(b,!0)&&this.chart.redraw(c)},generatePoints:function(){var a,b=0,c,d,e,f=this.options.ignoreHiddenPoint;O.prototype.generatePoints.call(this);c=this.points;d=c.length;for(a=0;a<d;a++)e=c[a],b+=f&&!e.visible?0:e.y;this.total=
|
||||
b;for(a=0;a<d;a++)e=c[a],e.percentage=b>0?e.y/b*100:0,e.total=b},translate:function(a){this.generatePoints();var b=0,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f,g,h,i=c.startAngle||0,j=this.startAngleRad=na/180*(i-90),i=(this.endAngleRad=na/180*(p(c.endAngle,i+360)-90))-j,k=this.points,l=c.dataLabels.distance,c=c.ignoreHiddenPoint,m,n=k.length,o;if(!a)this.center=a=this.getCenter();this.getX=function(b,c){h=V.asin(C((b-a[1])/(a[2]/2+l),1));return a[0]+(c?-1:1)*aa(h)*(a[2]/2+l)};for(m=0;m<
|
||||
n;m++){o=k[m];f=j+b*i;if(!c||o.visible)b+=o.percentage/100;g=j+b*i;o.shapeType="arc";o.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:v(f*1E3)/1E3,end:v(g*1E3)/1E3};h=(g+f)/2;h>1.5*na?h-=2*na:h<-na/2&&(h+=2*na);o.slicedTranslation={translateX:v(aa(h)*d),translateY:v(fa(h)*d)};f=aa(h)*a[2]/2;g=fa(h)*a[2]/2;o.tooltipPos=[a[0]+f*0.7,a[1]+g*0.7];o.half=h<-na/2||h>na/2?1:0;o.angle=h;e=C(e,l/2);o.labelPos=[a[0]+f+aa(h)*l,a[1]+g+fa(h)*l,a[0]+f+aa(h)*e,a[1]+g+fa(h)*e,a[0]+f,a[1]+g,l<0?"center":o.half?
|
||||
"right":"left",h]}},drawGraph:null,drawPoints:function(){var a=this,b=a.chart.renderer,c,d,e=a.options.shadow,f,g;if(e&&!a.shadowGroup)a.shadowGroup=b.g("shadow").add(a.group);q(a.points,function(h){d=h.graphic;g=h.shapeArgs;f=h.shadowGroup;if(e&&!f)f=h.shadowGroup=b.g("shadow").add(a.shadowGroup);c=h.sliced?h.slicedTranslation:{translateX:0,translateY:0};f&&f.attr(c);d?d.animate(r(g,c)):h.graphic=d=b[h.shapeType](g).setRadialReference(a.center).attr(h.pointAttr[h.selected?"select":""]).attr({"stroke-linejoin":"round"}).attr(c).add(a.group).shadow(e,
|
||||
f);h.visible!==void 0&&h.setVisible(h.visible)})},sortByAngle:function(a,b){a.sort(function(a,d){return a.angle!==void 0&&(d.angle-a.angle)*b})},drawLegendSymbol:M.drawRectangle,getCenter:Z.getCenter,getSymbol:sa};T=la(O,T);J.pie=T;O.prototype.drawDataLabels=function(){var a=this,b=a.options,c=b.cursor,d=b.dataLabels,e=a.points,f,g,h,i;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),i=a.plotGroup("dataLabelsGroup","data-labels",d.defer?"hidden":"visible",d.zIndex||6),!a.hasRendered&&
|
||||
p(d.defer,!0)&&(i.attr({opacity:0}),N(a,"afterAnimate",function(){a.visible&&i.show();i[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),g=d,q(e,function(b){var e,l=b.dataLabel,m,n,o=b.connector,q=!0;f=b.options&&b.options.dataLabels;e=p(f&&f.enabled,g.enabled);if(l&&!e)b.dataLabel=l.destroy();else if(e){d=w(g,f);e=d.rotation;m=b.getLabelConfig();h=d.format?Ia(d.format,m):d.formatter.call(m,d);d.style.color=p(d.color,d.style.color,a.color,"black");if(l)if(s(h))l.attr({text:h}),q=!1;else{if(b.dataLabel=
|
||||
l=l.destroy(),o)b.connector=o.destroy()}else if(s(h)){l={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(n in l)l[n]===t&&delete l[n];l=b.dataLabel=a.chart.renderer[e?"text":"label"](h,0,-999,null,null,null,d.useHTML).attr(l).css(r(d.style,c&&{cursor:c})).add(i).shadow(d.shadow)}l&&a.alignDataLabel(b,l,d,null,q)}})};O.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=p(a.plotX,-999),
|
||||
i=p(a.plotY,-999),j=b.getBBox();if(a=this.visible&&(a.series.forceDL||f.isInsidePlot(h,v(i),g)||d&&f.isInsidePlot(h,g?d.x+1:d.y+d.height-1,g)))d=r({x:g?f.plotWidth-i:h,y:v(g?f.plotHeight-h:i),width:0,height:0},d),r(c,{width:j.width,height:j.height}),c.rotation?b[e?"attr":"animate"]({x:d.x+c.x+d.width/2,y:d.y+c.y+d.height/2}).attr({align:c.align}):(b.align(c,null,d),g=b.alignAttr,p(c.overflow,"justify")==="justify"?this.justifyDataLabel(b,c,g,j,d,e):p(c.crop,!0)&&(a=f.isInsidePlot(g.x,g.y)&&f.isInsidePlot(g.x+
|
||||
j.width,g.y+j.height)));if(!a)b.attr({y:-999}),b.placed=!1};O.prototype.justifyDataLabel=function(a,b,c,d,e,f){var g=this.chart,h=b.align,i=b.verticalAlign,j,k;j=c.x;if(j<0)h==="right"?b.align="left":b.x=-j,k=!0;j=c.x+d.width;if(j>g.plotWidth)h==="left"?b.align="right":b.x=g.plotWidth-j,k=!0;j=c.y;if(j<0)i==="bottom"?b.verticalAlign="top":b.y=-j,k=!0;j=c.y+d.height;if(j>g.plotHeight)i==="top"?b.verticalAlign="bottom":b.y=g.plotHeight-j,k=!0;if(k)a.placed=!f,a.align(b,null,e)};if(J.pie)J.pie.prototype.drawDataLabels=
|
||||
function(){var a=this,b=a.data,c,d=a.chart,e=a.options.dataLabels,f=p(e.connectorPadding,10),g=p(e.connectorWidth,1),h=d.plotWidth,i=d.plotHeight,j,k,l=p(e.softConnector,!0),m=e.distance,n=a.center,o=n[2]/2,r=n[1],s=m>0,t,w,x,z=[[],[]],B,A,K,J,y,R=[0,0,0,0],N=function(a,b){return b.y-a.y};if(a.visible&&(e.enabled||a._hasPointLabels)){O.prototype.drawDataLabels.apply(a);q(b,function(a){a.dataLabel&&a.visible&&z[a.half].push(a)});for(J=2;J--;){var H=[],M=[],F=z[J],L=F.length,G;if(L){a.sortByAngle(F,
|
||||
J-0.5);for(y=b=0;!b&&F[y];)b=F[y]&&F[y].dataLabel&&(F[y].dataLabel.getBBox().height||21),y++;if(m>0){w=C(r+o+m,d.plotHeight);for(y=u(0,r-o-m);y<=w;y+=b)H.push(y);w=H.length;if(L>w){c=[].concat(F);c.sort(N);for(y=L;y--;)c[y].rank=y;for(y=L;y--;)F[y].rank>=w&&F.splice(y,1);L=F.length}for(y=0;y<L;y++){c=F[y];x=c.labelPos;c=9999;var S,P;for(P=0;P<w;P++)S=Q(H[P]-x[1]),S<c&&(c=S,G=P);if(G<y&&H[y]!==null)G=y;else for(w<L-y+G&&H[y]!==null&&(G=w-L+y);H[G]===null;)G++;M.push({i:G,y:H[G]});H[G]=null}M.sort(N)}for(y=
|
||||
0;y<L;y++){c=F[y];x=c.labelPos;t=c.dataLabel;K=c.visible===!1?"hidden":"visible";c=x[1];if(m>0){if(w=M.pop(),G=w.i,A=w.y,c>A&&H[G+1]!==null||c<A&&H[G-1]!==null)A=C(u(0,c),d.plotHeight)}else A=c;B=e.justify?n[0]+(J?-1:1)*(o+m):a.getX(A===r-o-m||A===r+o+m?c:A,J);t._attr={visibility:K,align:x[6]};t._pos={x:B+e.x+({left:f,right:-f}[x[6]]||0),y:A+e.y-10};t.connX=B;t.connY=A;if(this.options.size===null)w=t.width,B-w<f?R[3]=u(v(w-B+f),R[3]):B+w>h-f&&(R[1]=u(v(B+w-h+f),R[1])),A-b/2<0?R[0]=u(v(-A+b/2),R[0]):
|
||||
A+b/2>i&&(R[2]=u(v(A+b/2-i),R[2]))}}}if(Ba(R)===0||this.verifyDataLabelOverflow(R))this.placeDataLabels(),s&&g&&q(this.points,function(b){j=b.connector;x=b.labelPos;if((t=b.dataLabel)&&t._pos)K=t._attr.visibility,B=t.connX,A=t.connY,k=l?["M",B+(x[6]==="left"?5:-5),A,"C",B,A,2*x[2]-x[4],2*x[3]-x[5],x[2],x[3],"L",x[4],x[5]]:["M",B+(x[6]==="left"?5:-5),A,"L",x[2],x[3],"L",x[4],x[5]],j?(j.animate({d:k}),j.attr("visibility",K)):b.connector=j=a.chart.renderer.path(k).attr({"stroke-width":g,stroke:e.connectorColor||
|
||||
b.color||"#606060",visibility:K}).add(a.dataLabelsGroup);else if(j)b.connector=j.destroy()})}},J.pie.prototype.placeDataLabels=function(){q(this.points,function(a){var a=a.dataLabel,b;if(a)(b=a._pos)?(a.attr(a._attr),a[a.moved?"animate":"attr"](b),a.moved=!0):a&&a.attr({y:-999})})},J.pie.prototype.alignDataLabel=sa,J.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,c=this.options,d=c.center,e=c=c.minSize||80,f;d[0]!==null?e=u(b[2]-u(a[1],a[3]),c):(e=u(b[2]-a[1]-a[3],c),b[0]+=(a[3]-
|
||||
a[1])/2);d[1]!==null?e=u(C(e,b[2]-u(a[0],a[2])),c):(e=u(C(e,b[2]-a[0]-a[2]),c),b[1]+=(a[0]-a[2])/2);e<b[2]?(b[2]=e,this.translate(b),q(this.points,function(a){if(a.dataLabel)a.dataLabel._pos=null}),this.drawDataLabels&&this.drawDataLabels()):f=!0;return f};if(J.column)J.column.prototype.alignDataLabel=function(a,b,c,d,e){var f=this.chart,g=f.inverted,h=a.dlBox||a.shapeArgs,i=a.below||a.plotY>p(this.translatedThreshold,f.plotSizeY),j=p(c.inside,!!this.options.stacking);if(h&&(d=w(h),g&&(d={x:f.plotWidth-
|
||||
d.y-d.height,y:f.plotHeight-d.x-d.width,width:d.height,height:d.width}),!j))g?(d.x+=i?0:d.width,d.width=0):(d.y+=i?d.height:0,d.height=0);c.align=p(c.align,!g||j?"center":i?"right":"left");c.verticalAlign=p(c.verticalAlign,g||j?"middle":i?"top":"bottom");O.prototype.alignDataLabel.call(this,a,b,c,d,e)};T=S.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,d=a.options.cursor,e=d&&{cursor:d},f=function(c){var d=c.target,e;if(b.hoverSeries!==a)a.onMouseOver();for(;d&&!e;)e=d.point,
|
||||
d=d.parentNode;if(e!==t&&e!==b.hoverPoint)e.onMouseOver(c)};q(a.points,function(a){if(a.graphic)a.graphic.element.point=a;if(a.dataLabel)a.dataLabel.element.point=a});if(!a._hasTracking)q(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",f).on("mouseout",function(a){c.onTrackerMouseOut(a)}).css(e),Za))a[b].on("touchstart",f)}),a._hasTracking=!0},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,d=[].concat(c?a.areaPath:a.graphPath),e=d.length,
|
||||
f=a.chart,g=f.pointer,h=f.renderer,i=f.options.tooltip.snap,j=a.tracker,k=b.cursor,l=k&&{cursor:k},k=a.singlePoints,m,n=function(){if(f.hoverSeries!==a)a.onMouseOver()},o="rgba(192,192,192,"+(ba?1.0E-4:0.002)+")";if(e&&!c)for(m=e+1;m--;)d[m]==="M"&&d.splice(m+1,0,d[m+1]-i,d[m+2],"L"),(m&&d[m]==="M"||m===e)&&d.splice(m,0,"L",d[m-2]+i,d[m-1]);for(m=0;m<k.length;m++)e=k[m],d.push("M",e.plotX-i,e.plotY,"L",e.plotX+i,e.plotY);j?j.attr({d:d}):(a.tracker=h.path(d).attr({"stroke-linejoin":"round",visibility:a.visible?
|
||||
"visible":"hidden",stroke:o,fill:c?o:P,"stroke-width":b.lineWidth+(c?0:2*i),zIndex:2}).add(a.group),q([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",n).on("mouseout",function(a){g.onTrackerMouseOut(a)}).css(l);if(Za)a.on("touchstart",n)}))}};if(J.column)ha.prototype.drawTracker=T.drawTrackerPoint;if(J.pie)J.pie.prototype.drawTracker=T.drawTrackerPoint;if(J.scatter)qa.prototype.drawTracker=T.drawTrackerPoint;r(kb.prototype,{setItemEvents:function(a,b,c,d,e){var f=
|
||||
this;(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");b.css(f.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d:e);a.setState()}).on("click",function(b){var c=function(){a.setVisible()},b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):K(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=$("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);N(a.checkbox,
|
||||
"click",function(b){K(a,"checkboxClick",{checked:b.target.checked},function(){a.select()})})}});L.legend.itemStyle.cursor="pointer";r(Xa.prototype,{showResetZoom:function(){var a=this,b=L.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f=c.relativeTo==="chart"?null:"plotBox";this.resetZoomButton=a.renderer.button(b.resetZoom,null,null,function(){a.zoomOut()},d,e&&e.hover).attr({align:c.position.align,title:b.resetZoomTitle}).add().align(c.position,!1,f)},zoomOut:function(){var a=this;
|
||||
K(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var b,c=this.pointer,d=!1,e;!a||a.resetSelection?q(this.axes,function(a){b=a.zoom()}):q(a.xAxis.concat(a.yAxis),function(a){var e=a.axis,h=e.isXAxis;if(c[h?"zoomX":"zoomY"]||c[h?"pinchX":"pinchY"])b=e.zoom(a.min,a.max),e.displayBtn&&(d=!0)});e=this.resetZoomButton;if(d&&!e)this.showResetZoom();else if(!d&&da(e))this.resetZoomButton=e.destroy();b&&this.redraw(p(this.options.chart.animation,a&&a.animation,this.pointCount<100))},
|
||||
pan:function(a,b){var c=this,d=c.hoverPoints,e;d&&q(d,function(a){a.setState()});q(b==="xy"?[1,0]:[1],function(b){var d=a[b?"chartX":"chartY"],h=c[b?"xAxis":"yAxis"][0],i=c[b?"mouseDownX":"mouseDownY"],j=(h.pointRange||0)/2,k=h.getExtremes(),l=h.toValue(i-d,!0)+j,i=h.toValue(i+c[b?"plotWidth":"plotHeight"]-d,!0)-j;h.series.length&&l>C(k.dataMin,k.min)&&i<u(k.dataMax,k.max)&&(h.setExtremes(l,i,!1,!1,{trigger:"pan"}),e=!0);c[b?"mouseDownX":"mouseDownY"]=d});e&&c.redraw(!1);A(c.container,{cursor:"move"})}});
|
||||
r(Ea.prototype,{select:function(a,b){var c=this,d=c.series,e=d.chart,a=p(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;d.options.data[Da(c,d.data)]=c.options;c.setState(a&&"select");b||q(e.getSelectedPoints(),function(a){if(a.selected&&a!==c)a.selected=a.options.selected=!1,d.options.data[Da(a,d.data)]=a.options,a.setState(""),a.firePointEvent("unselect")})})},onMouseOver:function(a){var b=this.series,c=b.chart,d=c.tooltip,e=c.hoverPoint;
|
||||
if(e&&e!==this)e.onMouseOut();this.firePointEvent("mouseOver");d&&(!d.shared||b.noSharedTooltip)&&d.refresh(this,a);this.setState("hover");c.hoverPoint=this},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");if(!b||Da(this,b)===-1)this.setState(),a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=w(this.series.options.point,this.options).events,b;this.events=a;for(b in a)N(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,
|
||||
b){var c=this.plotX,d=this.plotY,e=this.series,f=e.options.states,g=ca[e.type].marker&&e.options.marker,h=g&&!g.enabled,i=g&&g.states[a],j=i&&i.enabled===!1,k=e.stateMarkerGraphic,l=this.marker||{},m=e.chart,n=e.halo,o,a=a||"";o=this.pointAttr[a]||e.pointAttr[a];if(!(a===this.state&&!b||this.selected&&a!=="select"||f[a]&&f[a].enabled===!1||a&&(j||h&&i.enabled===!1)||a&&l.states&&l.states[a]&&l.states[a].enabled===!1)){if(this.graphic)g=g&&this.graphic.symbolName&&o.r,this.graphic.attr(w(o,g?{x:c-
|
||||
g,y:d-g,width:2*g,height:2*g}:{})),k&&k.hide();else{if(a&&i)if(g=i.radius,l=l.symbol||e.symbol,k&&k.currentSymbol!==l&&(k=k.destroy()),k)k[b?"animate":"attr"]({x:c-g,y:d-g});else if(l)e.stateMarkerGraphic=k=m.renderer.symbol(l,c-g,d-g,2*g,2*g).attr(o).add(e.markerGroup),k.currentSymbol=l;if(k)k[a&&m.isInsidePlot(c,d,m.inverted)?"show":"hide"]()}if((c=f[a]&&f[a].halo)&&c.size){if(!n)e.halo=n=m.renderer.path().add(e.seriesGroup);n.attr(r({fill:ya(this.color||e.color).setOpacity(c.opacity).get()},c.attributes))[b?
|
||||
"animate":"attr"]({d:this.haloPath(c.size)})}else n&&n.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted;return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:this.plotX)-a,d.translateY+(e?b.xAxis.len-this.plotX:this.plotY)-a,a*2,a*2)}});r(O.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&K(this,"mouseOver");this.setState("hover");a.hoverSeries=
|
||||
this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;if(d)d.onMouseOut();this&&a.events.mouseOut&&K(this,"mouseOut");c&&!a.stickyTracking&&(!c.shared||this.noSharedTooltip)&&c.hide();this.setState();b.hoverSeries=null},setState:function(a){var b=this.options,c=this.graph,d=this.graphNeg,e=b.states,b=b.lineWidth,a=a||"";if(this.state!==a)this.state=a,e[a]&&e[a].enabled===!1||(a&&(b=e[a].lineWidth||b+(e[a].lineWidthPlus||0)),c&&!c.dashstyle&&(a={"stroke-width":b},c.attr(a),
|
||||
d&&d.attr(a)))},setVisible:function(a,b){var c=this,d=c.chart,e=c.legendItem,f,g=d.options.chart.ignoreHiddenSeries,h=c.visible;f=(c.visible=a=c.userOptions.visible=a===t?!h:a)?"show":"hide";q(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][f]()});if(d.hoverSeries===c)c.onMouseOut();e&&d.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&q(d.series,function(a){if(a.options.stacking&&a.visible)a.isDirty=!0});q(c.linkedSeries,function(b){b.setVisible(a,!1)});if(g)d.isDirtyBox=
|
||||
!0;b!==!1&&d.redraw();K(c,f)},setTooltipPoints:function(a){var b=[],c,d,e=this.xAxis,f=e&&e.getExtremes(),g=e?e.tooltipLen||e.len:this.chart.plotSizeX,h,i,j=[];if(!(this.options.enableMouseTracking===!1||this.singularTooltips)){if(a)this.tooltipPoints=null;q(this.segments||this.points,function(a){b=b.concat(a)});e&&e.reversed&&(b=b.reverse());this.orderTooltipPoints&&this.orderTooltipPoints(b);a=b.length;for(i=0;i<a;i++)if(e=b[i],c=e.x,c>=f.min&&c<=f.max){h=b[i+1];c=d===t?0:d+1;for(d=b[i+1]?C(u(0,
|
||||
U((e.clientX+(h?h.wrappedClientX||h.clientX:g))/2)),g):g;c>=0&&c<=d;)j[c++]=e}this.tooltipPoints=j}},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=a===t?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;K(this,a?"select":"unselect")},drawTracker:T.drawTrackerGraph});r(S,{Axis:ma,Chart:Xa,Color:ya,Point:Ea,Tick:Sa,Renderer:Ya,Series:O,SVGElement:G,SVGRenderer:ta,arrayMin:Na,arrayMax:Ba,charts:W,dateFormat:bb,format:Ia,pathAnim:ub,
|
||||
getOptions:function(){return L},hasBidiBug:Nb,isTouchDevice:Hb,numberFormat:Ga,seriesTypes:J,setOptions:function(a){L=w(!0,L,a);Ab();return L},addEvent:N,removeEvent:X,createElement:$,discardElement:Pa,css:A,each:q,extend:r,map:Ua,merge:w,pick:p,splat:ra,extendClass:la,pInt:z,wrap:Ma,svg:ba,canvas:ga,vml:!ba&&!ga,product:"Highcharts",version:"4.0.3"})})();
|
||||
@@ -0,0 +1,655 @@
|
||||
/*
|
||||
Highstock JS v8.0.3 (2020-03-05)
|
||||
|
||||
(c) 2009-2018 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(V,P){"object"===typeof module&&module.exports?(P["default"]=P,module.exports=V.document?P(V):P):"function"===typeof define&&define.amd?define("highcharts/highstock",function(){return P(V)}):(V.Highcharts&&V.Highcharts.error(16,!0),V.Highcharts=P(V))})("undefined"!==typeof window?window:this,function(V){function P(f,m,I,r){f.hasOwnProperty(m)||(f[m]=r.apply(null,I))}var y={};P(y,"parts/Globals.js",[],function(){var f="undefined"!==typeof V?V:"undefined"!==typeof window?window:{},m=f.document,
|
||||
I=f.navigator&&f.navigator.userAgent||"",r=m&&m.createElementNS&&!!m.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,F=/(edge|msie|trident)/i.test(I)&&!f.opera,N=-1!==I.indexOf("Firefox"),G=-1!==I.indexOf("Chrome"),B=N&&4>parseInt(I.split("Firefox/")[1],10);return{product:"Highcharts",version:"8.0.3",deg2rad:2*Math.PI/360,doc:m,hasBidiBug:B,hasTouch:!!f.TouchEvent,isMS:F,isWebKit:-1!==I.indexOf("AppleWebKit"),isFirefox:N,isChrome:G,isSafari:!G&&-1!==I.indexOf("Safari"),isTouchDevice:/(Mobile|Android|Windows Phone)/.test(I),
|
||||
SVG_NS:"http://www.w3.org/2000/svg",chartCount:0,seriesTypes:{},symbolSizes:{},svg:r,win:f,marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){},charts:[],dateFormats:{}}});P(y,"parts/Utilities.js",[y["parts/Globals.js"]],function(f){function m(){var d,a=arguments,c={},b=function(d,a){"object"!==typeof d&&(d={});Y(a,function(c,h){!u(c,!0)||l(c)||n(c)?d[h]=a[h]:d[h]=b(d[h]||{},c)});return d};!0===a[0]&&(c=a[1],a=Array.prototype.slice.call(a,2));var h=a.length;for(d=0;d<
|
||||
h;d++)c=b(c,a[d]);return c}function I(d,a,c){var h;x(a)?b(c)?d.setAttribute(a,c):d&&d.getAttribute&&((h=d.getAttribute(a))||"class"!==a||(h=d.getAttribute(a+"Name"))):Y(a,function(a,c){d.setAttribute(c,a)});return h}function r(){for(var d=arguments,a=d.length,c=0;c<a;c++){var b=d[c];if("undefined"!==typeof b&&null!==b)return b}}function F(d,a){if(!d)return a;var c=d.split(".").reverse();if(1===c.length)return a[d];for(d=c.pop();"undefined"!==typeof d&&"undefined"!==typeof a&&null!==a;)a=a[d],d=c.pop();
|
||||
return a}f.timers=[];var N=f.charts,G=f.doc,B=f.win,D=f.error=function(d,a,c,b){var h=q(d),e=h?"Highcharts error #"+d+": www.highcharts.com/errors/"+d+"/":d.toString(),k=function(){if(a)throw Error(e);B.console&&console.log(e)};if("undefined"!==typeof b){var O="";h&&(e+="?");f.objectEach(b,function(d,a){O+="\n"+a+": "+d;h&&(e+=encodeURI(a)+"="+encodeURI(d))});e+=O}c?f.fireEvent(c,"displayError",{code:d,message:e,params:b},k):k()},K=function(){function d(d,a,c){this.options=a;this.elem=d;this.prop=
|
||||
c}d.prototype.dSetter=function(){var d=this.paths[0],a=this.paths[1],c=[],b=this.now,h=d.length;if(1===b)c=this.toD;else if(h===a.length&&1>b)for(;h--;){var e=parseFloat(d[h]);c[h]=isNaN(e)||"A"===a[h-4]||"A"===a[h-5]?a[h]:b*parseFloat(""+(a[h]-e))+e}else c=a;this.elem.attr("d",c,null,!0)};d.prototype.update=function(){var d=this.elem,a=this.prop,c=this.now,b=this.options.step;if(this[a+"Setter"])this[a+"Setter"]();else d.attr?d.element&&d.attr(a,c,null,!0):d.style[a]=c+this.unit;b&&b.call(d,c,this)};
|
||||
d.prototype.run=function(d,a,c){var b=this,h=b.options,e=function(d){return e.stopped?!1:b.step(d)},k=B.requestAnimationFrame||function(d){setTimeout(d,13)},O=function(){for(var d=0;d<f.timers.length;d++)f.timers[d]()||f.timers.splice(d--,1);f.timers.length&&k(O)};d!==a||this.elem["forceAnimate:"+this.prop]?(this.startTime=+new Date,this.start=d,this.end=a,this.unit=c,this.now=this.start,this.pos=0,e.elem=this.elem,e.prop=this.prop,e()&&1===f.timers.push(e)&&k(O)):(delete h.curAnim[this.prop],h.complete&&
|
||||
0===Object.keys(h.curAnim).length&&h.complete.call(this.elem))};d.prototype.step=function(d){var a=+new Date,c=this.options,b=this.elem,h=c.complete,e=c.duration,k=c.curAnim;if(b.attr&&!b.element)d=!1;else if(d||a>=e+this.startTime){this.now=this.end;this.pos=1;this.update();var O=k[this.prop]=!0;Y(k,function(d){!0!==d&&(O=!1)});O&&h&&h.call(b);d=!1}else this.pos=c.easing((a-this.startTime)/e),this.now=this.start+(this.end-this.start)*this.pos,this.update(),d=!0;return d};d.prototype.initPath=function(d,
|
||||
a,c){function b(d){for(H=d.length;H--;){var a="M"===d[H]||"L"===d[H];var c=/[a-zA-Z]/.test(d[H+3]);a&&c&&d.splice(H+1,0,d[H+1],d[H+2],d[H+1],d[H+2])}}function h(d,a){for(;d.length<R;){d[0]=a[R-d.length];var c=d.slice(0,C);[].splice.apply(d,[0,0].concat(c));p&&(c=d.slice(d.length-C),[].splice.apply(d,[d.length,0].concat(c)),H--)}d[0]="M"}function e(d,a){for(var c=(R-d.length)/C;0<c&&c--;)J=d.slice().splice(d.length/w-C,C*w),J[0]=a[R-C-c*C],g&&(J[C-6]=J[C-2],J[C-5]=J[C-1]),[].splice.apply(d,[d.length/
|
||||
w,0].concat(J)),p&&c--}a=a||"";var k=d.startX,O=d.endX,g=-1<a.indexOf("C"),C=g?7:3,J,H;a=a.split(" ");c=c.slice();var p=d.isArea,w=p?2:1;g&&(b(a),b(c));if(k&&O){for(H=0;H<k.length;H++)if(k[H]===O[0]){var t=H;break}else if(k[0]===O[O.length-k.length+H]){t=H;var v=!0;break}else if(k[k.length-1]===O[O.length-k.length+H]){t=k.length-H;break}"undefined"===typeof t&&(a=[])}if(a.length&&q(t)){var R=c.length+t*w*C;v?(h(a,c),e(c,a)):(h(c,a),e(a,c))}return[a,c]};d.prototype.fillSetter=function(){f.Fx.prototype.strokeSetter.apply(this,
|
||||
arguments)};d.prototype.strokeSetter=function(){this.elem.attr(this.prop,f.color(this.start).tweenTo(f.color(this.end),this.pos),null,!0)};return d}();f.Fx=K;f.merge=m;var z=f.pInt=function(d,a){return parseInt(d,a||10)},x=f.isString=function(d){return"string"===typeof d},A=f.isArray=function(d){d=Object.prototype.toString.call(d);return"[object Array]"===d||"[object Array Iterator]"===d},u=f.isObject=function(d,a){return!!d&&"object"===typeof d&&(!a||!A(d))},n=f.isDOMElement=function(d){return u(d)&&
|
||||
"number"===typeof d.nodeType},l=f.isClass=function(d){var a=d&&d.constructor;return!(!u(d,!0)||n(d)||!a||!a.name||"Object"===a.name)},q=f.isNumber=function(d){return"number"===typeof d&&!isNaN(d)&&Infinity>d&&-Infinity<d},e=f.erase=function(d,a){for(var c=d.length;c--;)if(d[c]===a){d.splice(c,1);break}},b=f.defined=function(d){return"undefined"!==typeof d&&null!==d};f.attr=I;var g=f.splat=function(d){return A(d)?d:[d]},p=f.syncTimeout=function(d,a,c){if(0<a)return setTimeout(d,a,c);d.call(0,c);return-1},
|
||||
c=f.clearTimeout=function(d){b(d)&&clearTimeout(d)},a=f.extend=function(d,a){var c;d||(d={});for(c in a)d[c]=a[c];return d};f.pick=r;var w=f.css=function(d,c){f.isMS&&!f.svg&&c&&"undefined"!==typeof c.opacity&&(c.filter="alpha(opacity="+100*c.opacity+")");a(d.style,c)},E=f.createElement=function(d,c,b,h,e){d=G.createElement(d);c&&a(d,c);e&&w(d,{padding:"0",border:"none",margin:"0"});b&&w(d,b);h&&h.appendChild(d);return d},v=f.extendClass=function(d,c){var b=function(){};b.prototype=new d;a(b.prototype,
|
||||
c);return b},k=f.pad=function(d,a,c){return Array((a||2)+1-String(d).replace("-","").length).join(c||"0")+d},h=f.relativeLength=function(d,a,c){return/%$/.test(d)?a*parseFloat(d)/100+(c||0):parseFloat(d)},t=f.wrap=function(d,a,c){var b=d[a];d[a]=function(){var d=Array.prototype.slice.call(arguments),a=arguments,h=this;h.proceed=function(){b.apply(h,arguments.length?arguments:a)};d.unshift(b);d=c.apply(this,d);h.proceed=null;return d}},L=f.format=function(d,a,c){var b="{",h=!1,e=[],k=/f$/,O=/\.([0-9])/,
|
||||
C=f.defaultOptions.lang,g=c&&c.time||f.time;for(c=c&&c.numberFormatter||X;d;){var H=d.indexOf(b);if(-1===H)break;var J=d.slice(0,H);if(h){J=J.split(":");b=F(J.shift()||"",a);if(J.length&&"number"===typeof b)if(J=J.join(":"),k.test(J)){var w=parseInt((J.match(O)||["","-1"])[1],10);null!==b&&(b=c(b,w,C.decimalPoint,-1<J.indexOf(",")?C.thousandsSep:""))}else b=g.dateFormat(J,b);e.push(b)}else e.push(J);d=d.slice(H+1);b=(h=!h)?"}":"{"}e.push(d);return e.join("")},M=f.getMagnitude=function(d){return Math.pow(10,
|
||||
Math.floor(Math.log(d)/Math.LN10))},Q=f.normalizeTickInterval=function(d,a,c,b,h){var e=d;c=r(c,1);var k=d/c;a||(a=h?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===b&&(1===c?a=a.filter(function(d){return 0===d%1}):.1>=c&&(a=[1/c])));for(b=0;b<a.length&&!(e=a[b],h&&e*c>=d||!h&&k<=(a[b]+(a[b+1]||a[b]))/2);b++);return e=W(e*c,-Math.round(Math.log(.001)/Math.LN10))},C=f.stableSort=function(d,a){var c=d.length,b,h;for(h=0;h<c;h++)d[h].safeI=h;d.sort(function(d,c){b=a(d,c);return 0===b?d.safeI-c.safeI:
|
||||
b});for(h=0;h<c;h++)delete d[h].safeI},d=f.arrayMin=function(d){for(var a=d.length,c=d[0];a--;)d[a]<c&&(c=d[a]);return c},J=f.arrayMax=function(d){for(var a=d.length,c=d[0];a--;)d[a]>c&&(c=d[a]);return c},H=f.destroyObjectProperties=function(d,a){Y(d,function(c,b){c&&c!==a&&c.destroy&&c.destroy();delete d[b]})},T=f.discardElement=function(d){var a=f.garbageBin;a||(a=E("div"));d&&a.appendChild(d);a.innerHTML=""},W=f.correctFloat=function(d,a){return parseFloat(d.toPrecision(a||14))},U=f.setAnimation=
|
||||
function(d,a){a.renderer.globalAnimation=r(d,a.options.chart.animation,!0)},S=f.animObject=function(d){return u(d)?m(d):{duration:d?500:0}},O=f.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5},X=f.numberFormat=function(d,a,c,b){d=+d||0;a=+a;var h=f.defaultOptions.lang,e=(d.toString().split(".")[1]||"").split("e")[0].length,k=d.toString().split("e");if(-1===a)a=Math.min(e,20);else if(!q(a))a=2;else if(a&&k[1]&&0>k[1]){var O=a+ +k[1];0<=O?(k[0]=
|
||||
(+k[0]).toExponential(O).split("e")[0],a=O):(k[0]=k[0].split(".")[0]||0,d=20>a?(k[0]*Math.pow(10,k[1])).toFixed(a):0,k[1]=0)}var C=(Math.abs(k[1]?k[0]:d)+Math.pow(10,-Math.max(a,e)-1)).toFixed(a);e=String(z(C));O=3<e.length?e.length%3:0;c=r(c,h.decimalPoint);b=r(b,h.thousandsSep);d=(0>d?"-":"")+(O?e.substr(0,O)+b:"");d+=e.substr(O).replace(/(\d{3})(?=\d)/g,"$1"+b);a&&(d+=c+C.slice(-a));k[1]&&0!==+d&&(d+="e"+k[1]);return d};Math.easeInOutSine=function(d){return-.5*(Math.cos(Math.PI*d)-1)};var ea=f.getStyle=
|
||||
function(d,a,c){if("width"===a)return a=Math.min(d.offsetWidth,d.scrollWidth),c=d.getBoundingClientRect&&d.getBoundingClientRect().width,c<a&&c>=a-1&&(a=Math.floor(c)),Math.max(0,a-f.getStyle(d,"padding-left")-f.getStyle(d,"padding-right"));if("height"===a)return Math.max(0,Math.min(d.offsetHeight,d.scrollHeight)-f.getStyle(d,"padding-top")-f.getStyle(d,"padding-bottom"));B.getComputedStyle||D(27,!0);if(d=B.getComputedStyle(d,void 0))d=d.getPropertyValue(a),r(c,"opacity"!==a)&&(d=z(d));return d},
|
||||
Z=f.inArray=function(d,a,c){return a.indexOf(d,c)},R=f.find=Array.prototype.find?function(d,a){return d.find(a)}:function(d,a){var c,b=d.length;for(c=0;c<b;c++)if(a(d[c],c))return d[c]};f.keys=Object.keys;var ba=f.offset=function(d){var a=G.documentElement;d=d.parentElement||d.parentNode?d.getBoundingClientRect():{top:0,left:0};return{top:d.top+(B.pageYOffset||a.scrollTop)-(a.clientTop||0),left:d.left+(B.pageXOffset||a.scrollLeft)-(a.clientLeft||0)}},ca=f.stop=function(d,a){for(var c=f.timers.length;c--;)f.timers[c].elem!==
|
||||
d||a&&a!==f.timers[c].prop||(f.timers[c].stopped=!0)},Y=f.objectEach=function(d,a,c){for(var b in d)Object.hasOwnProperty.call(d,b)&&a.call(c||d[b],d[b],b,d)};Y({map:"map",each:"forEach",grep:"filter",reduce:"reduce",some:"some"},function(d,a){f[a]=function(a){return Array.prototype[d].apply(a,[].slice.call(arguments,1))}});var ha=f.addEvent=function(d,a,c,b){void 0===b&&(b={});var h=d.addEventListener||f.addEventListenerPolyfill;var e="function"===typeof d&&d.prototype?d.prototype.protoEvents=d.prototype.protoEvents||
|
||||
{}:d.hcEvents=d.hcEvents||{};f.Point&&d instanceof f.Point&&d.series&&d.series.chart&&(d.series.chart.runTrackerClick=!0);h&&h.call(d,a,c,!1);e[a]||(e[a]=[]);e[a].push({fn:c,order:"number"===typeof b.order?b.order:Infinity});e[a].sort(function(d,a){return d.order-a.order});return function(){aa(d,a,c)}},aa=f.removeEvent=function(d,a,c){function b(a,c){var b=d.removeEventListener||f.removeEventListenerPolyfill;b&&b.call(d,a,c,!1)}function h(c){var h;if(d.nodeName){if(a){var e={};e[a]=!0}else e=c;Y(e,
|
||||
function(d,a){if(c[a])for(h=c[a].length;h--;)b(a,c[a][h].fn)})}}var e;["protoEvents","hcEvents"].forEach(function(k,O){var C=(O=O?d:d.prototype)&&O[k];C&&(a?(e=C[a]||[],c?(C[a]=e.filter(function(d){return c!==d.fn}),b(a,c)):(h(C),C[a]=[])):(h(C),O[k]={}))})},da=f.fireEvent=function(d,c,b,h){var e;b=b||{};if(G.createEvent&&(d.dispatchEvent||d.fireEvent)){var k=G.createEvent("Events");k.initEvent(c,!0,!0);a(k,b);d.dispatchEvent?d.dispatchEvent(k):d.fireEvent(c,k)}else b.target||a(b,{preventDefault:function(){b.defaultPrevented=
|
||||
!0},target:d,type:c}),function(a,c){void 0===a&&(a=[]);void 0===c&&(c=[]);var h=0,k=0,O=a.length+c.length;for(e=0;e<O;e++)!1===(a[h]?c[k]?a[h].order<=c[k].order?a[h++]:c[k++]:a[h++]:c[k++]).fn.call(d,b)&&b.preventDefault()}(d.protoEvents&&d.protoEvents[c],d.hcEvents&&d.hcEvents[c]);h&&!b.defaultPrevented&&h.call(d,b)},ia=f.animate=function(d,a,c){var b,h="",e,k;if(!u(c)){var O=arguments;c={duration:O[2],easing:O[3],complete:O[4]}}q(c.duration)||(c.duration=400);c.easing="function"===typeof c.easing?
|
||||
c.easing:Math[c.easing]||Math.easeInOutSine;c.curAnim=m(a);Y(a,function(O,C){ca(d,C);k=new K(d,c,C);e=null;"d"===C?(k.paths=k.initPath(d,d.d,a.d),k.toD=a.d,b=0,e=1):d.attr?b=d.attr(C):(b=parseFloat(ea(d,C))||0,"opacity"!==C&&(h="px"));e||(e=O);e&&e.match&&e.match("px")&&(e=e.replace(/px/g,""));k.run(b,e,h)})},y=f.seriesType=function(d,a,c,b,h){var e=f.getOptions(),k=f.seriesTypes;e.plotOptions[d]=m(e.plotOptions[a],c);k[d]=v(k[a]||function(){},b);k[d].prototype.type=d;h&&(k[d].prototype.pointClass=
|
||||
v(f.Point,h));return k[d]},fa=f.uniqueKey=function(){var d=Math.random().toString(36).substring(2,9),a=0;return function(){return"highcharts-"+d+"-"+a++}}(),ja=f.isFunction=function(d){return"function"===typeof d};B.jQuery&&(B.jQuery.fn.highcharts=function(){var d=[].slice.call(arguments);if(this[0])return d[0]?(new (f[x(d[0])?d.shift():"Chart"])(this[0],d[0],d[1]),this):N[I(this[0],"data-highcharts-chart")]});return{Fx:K,addEvent:ha,animate:ia,animObject:S,arrayMax:J,arrayMin:d,attr:I,clamp:function(d,
|
||||
a,c){return d>a?d<c?d:c:a},clearTimeout:c,correctFloat:W,createElement:E,css:w,defined:b,destroyObjectProperties:H,discardElement:T,erase:e,error:D,extend:a,extendClass:v,find:R,fireEvent:da,format:L,getMagnitude:M,getNestedProperty:F,getStyle:ea,inArray:Z,isArray:A,isClass:l,isDOMElement:n,isFunction:ja,isNumber:q,isObject:u,isString:x,merge:m,normalizeTickInterval:Q,numberFormat:X,objectEach:Y,offset:ba,pad:k,pick:r,pInt:z,relativeLength:h,removeEvent:aa,seriesType:y,setAnimation:U,splat:g,stableSort:C,
|
||||
stop:ca,syncTimeout:p,timeUnits:O,uniqueKey:fa,wrap:t}});P(y,"parts/Color.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.isNumber,r=m.merge,F=m.pInt;m=function(){function f(m){this.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(f){return[F(f[1]),F(f[2]),F(f[3]),parseFloat(f[4],10)]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,parse:function(f){return[F(f[1]),F(f[2]),
|
||||
F(f[3]),1]}}];this.rgba=[];if(!(this instanceof f))return new f(m);this.init(m)}f.parse=function(m){return new f(m)};f.prototype.init=function(m){var B,D;if((this.input=m=f.names[m&&m.toLowerCase?m.toLowerCase():""]||m)&&m.stops)this.stops=m.stops.map(function(x){return new f(x[1])});else{if(m&&m.charAt&&"#"===m.charAt()){var r=m.length;m=parseInt(m.substr(1),16);7===r?B=[(m&16711680)>>16,(m&65280)>>8,m&255,1]:4===r&&(B=[(m&3840)>>4|(m&3840)>>8,(m&240)>>4|m&240,(m&15)<<4|m&15,1])}if(!B)for(D=this.parsers.length;D--&&
|
||||
!B;){var z=this.parsers[D];(r=z.regex.exec(m))&&(B=z.parse(r))}}this.rgba=B||[]};f.prototype.get=function(f){var m=this.input,D=this.rgba;if("undefined"!==typeof this.stops){var G=r(m);G.stops=[].concat(G.stops);this.stops.forEach(function(z,x){G.stops[x]=[G.stops[x][0],z.get(f)]})}else G=D&&I(D[0])?"rgb"===f||!f&&1===D[3]?"rgb("+D[0]+","+D[1]+","+D[2]+")":"a"===f?D[3]:"rgba("+D.join(",")+")":m;return G};f.prototype.brighten=function(f){var m,D=this.rgba;if(this.stops)this.stops.forEach(function(m){m.brighten(f)});
|
||||
else if(I(f)&&0!==f)for(m=0;3>m;m++)D[m]+=F(255*f),0>D[m]&&(D[m]=0),255<D[m]&&(D[m]=255);return this};f.prototype.setOpacity=function(f){this.rgba[3]=f;return this};f.prototype.tweenTo=function(f,m){var D=this.rgba,r=f.rgba;r.length&&D&&D.length?(f=1!==r[3]||1!==D[3],m=(f?"rgba(":"rgb(")+Math.round(r[0]+(D[0]-r[0])*(1-m))+","+Math.round(r[1]+(D[1]-r[1])*(1-m))+","+Math.round(r[2]+(D[2]-r[2])*(1-m))+(f?","+(r[3]+(D[3]-r[3])*(1-m)):"")+")"):m=f.input||"none";return m};f.names={white:"#ffffff",black:"#000000"};
|
||||
return f}();f.Color=m;f.color=m.parse;return f.Color});P(y,"parts/SvgRenderer.js",[y["parts/Globals.js"],y["parts/Color.js"],y["parts/Utilities.js"]],function(f,m,I){var r=m.parse,F=I.addEvent,N=I.animate,G=I.animObject,B=I.attr,D=I.createElement,K=I.css,z=I.defined,x=I.destroyObjectProperties,A=I.erase,u=I.extend,n=I.inArray,l=I.isArray,q=I.isNumber,e=I.isObject,b=I.isString,g=I.merge,p=I.objectEach,c=I.pick,a=I.pInt,w=I.removeEvent,E=I.splat,v=I.stop,k=I.uniqueKey,h=f.charts,t=f.deg2rad,L=f.doc,
|
||||
M=f.hasTouch,Q=f.isFirefox,C=f.isMS,d=f.isWebKit,J=f.noop,H=f.svg,T=f.SVG_NS,W=f.symbolSizes,U=f.win;var S=f.SVGElement=function(){return this};u(S.prototype,{opacity:1,SVG_NS:T,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textAlign textDecoration textOverflow textOutline cursor".split(" "),init:function(d,a){this.element="span"===a?D(a):L.createElementNS(this.SVG_NS,a);this.renderer=d;f.fireEvent(this,"afterInit")},animate:function(d,a,b){var h=G(c(a,this.renderer.globalAnimation,
|
||||
!0));c(L.hidden,L.msHidden,L.webkitHidden,!1)&&(h.duration=0);0!==h.duration?(b&&(h.complete=b),N(this,d,h)):(this.attr(d,void 0,b),p(d,function(d,a){h.step&&h.step.call(this,d,{prop:a,pos:1})},this));return this},complexColor:function(d,a,c){var b=this.renderer,h,e,O,C,J,H,w,t,v,X,E,L=[],n;f.fireEvent(this.renderer,"complexColor",{args:arguments},function(){d.radialGradient?e="radialGradient":d.linearGradient&&(e="linearGradient");e&&(O=d[e],J=b.gradients,w=d.stops,X=c.radialReference,l(O)&&(d[e]=
|
||||
O={x1:O[0],y1:O[1],x2:O[2],y2:O[3],gradientUnits:"userSpaceOnUse"}),"radialGradient"===e&&X&&!z(O.gradientUnits)&&(C=O,O=g(O,b.getRadialAttr(X,C),{gradientUnits:"userSpaceOnUse"})),p(O,function(d,a){"id"!==a&&L.push(a,d)}),p(w,function(d){L.push(d)}),L=L.join(","),J[L]?E=J[L].attr("id"):(O.id=E=k(),J[L]=H=b.createElement(e).attr(O).add(b.defs),H.radAttr=C,H.stops=[],w.forEach(function(d){0===d[1].indexOf("rgba")?(h=r(d[1]),t=h.get("rgb"),v=h.get("a")):(t=d[1],v=1);d=b.createElement("stop").attr({offset:d[0],
|
||||
"stop-color":t,"stop-opacity":v}).add(H);H.stops.push(d)})),n="url("+b.url+"#"+E+")",c.setAttribute(a,n),c.gradient=L,d.toString=function(){return n})})},applyTextOutline:function(d){var a=this.element,c;-1!==d.indexOf("contrast")&&(d=d.replace(/contrast/g,this.renderer.getContrast(a.style.fill)));d=d.split(" ");var b=d[d.length-1];if((c=d[0])&&"none"!==c&&f.svg){this.fakeTS=!0;d=[].slice.call(a.getElementsByTagName("tspan"));this.ySetter=this.xSetter;c=c.replace(/(^[\d\.]+)(.*?)$/g,function(d,a,
|
||||
c){return 2*a+c});this.removeTextOutline(d);var h=a.textContent?/^[\u0591-\u065F\u066A-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC]/.test(a.textContent):!1;var e=a.firstChild;d.forEach(function(d,k){0===k&&(d.setAttribute("x",a.getAttribute("x")),k=a.getAttribute("y"),d.setAttribute("y",k||0),null===k&&a.setAttribute("y",0));k=d.cloneNode(!0);B(h&&!Q?d:k,{"class":"highcharts-text-outline",fill:b,stroke:b,"stroke-width":c,"stroke-linejoin":"round"});a.insertBefore(k,e)});h&&Q&&d[0]&&(d=d[0].cloneNode(!0),d.textContent=
|
||||
" ",a.insertBefore(d,e))}},removeTextOutline:function(d){for(var a=d.length,c;a--;)c=d[a],"highcharts-text-outline"===c.getAttribute("class")&&A(d,this.element.removeChild(c))},symbolCustomAttribs:"x y width height r start end innerR anchorX anchorY rounded".split(" "),attr:function(d,a,c,b){var h=this.element,e,k=this,C,O,g=this.symbolCustomAttribs;if("string"===typeof d&&"undefined"!==typeof a){var J=d;d={};d[J]=a}"string"===typeof d?k=(this[d+"Getter"]||this._defaultGetter).call(this,d,h):(p(d,
|
||||
function(a,c){C=!1;b||v(this,c);this.symbolName&&-1!==n(c,g)&&(e||(this.symbolAttr(d),e=!0),C=!0);!this.rotation||"x"!==c&&"y"!==c||(this.doTransform=!0);C||(O=this[c+"Setter"]||this._defaultSetter,O.call(this,a,c,h),!this.styledMode&&this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,a,O))},this),this.afterSetters());c&&c.call(this);return k},afterSetters:function(){this.doTransform&&(this.updateTransform(),this.doTransform=!1)},updateShadows:function(d,
|
||||
a,c){for(var b=this.shadows,h=b.length;h--;)c.call(b[h],"height"===d?Math.max(a-(b[h].cutHeight||0),0):"d"===d?this.d:a,d,b[h])},addClass:function(d,a){var c=a?"":this.attr("class")||"";d=(d||"").split(/ /g).reduce(function(d,a){-1===c.indexOf(a)&&d.push(a);return d},c?[c]:[]).join(" ");d!==c&&this.attr("class",d);return this},hasClass:function(d){return-1!==(this.attr("class")||"").split(" ").indexOf(d)},removeClass:function(d){return this.attr("class",(this.attr("class")||"").replace(b(d)?new RegExp(" ?"+
|
||||
d+" ?"):d,""))},symbolAttr:function(d){var a=this;"x y r start end width height innerR anchorX anchorY clockwise".split(" ").forEach(function(b){a[b]=c(d[b],a[b])});a.attr({d:a.renderer.symbols[a.symbolName](a.x,a.y,a.width,a.height,a)})},clip:function(d){return this.attr("clip-path",d?"url("+this.renderer.url+"#"+d.id+")":"none")},crisp:function(d,a){a=a||d.strokeWidth||0;var c=Math.round(a)%2/2;d.x=Math.floor(d.x||this.x||0)+c;d.y=Math.floor(d.y||this.y||0)+c;d.width=Math.floor((d.width||this.width||
|
||||
0)-2*c);d.height=Math.floor((d.height||this.height||0)-2*c);z(d.strokeWidth)&&(d.strokeWidth=a);return d},css:function(d){var c=this.styles,b={},h=this.element,e="",k=!c,C=["textOutline","textOverflow","width"];d&&d.color&&(d.fill=d.color);c&&p(d,function(d,a){d!==c[a]&&(b[a]=d,k=!0)});if(k){c&&(d=u(c,b));if(d)if(null===d.width||"auto"===d.width)delete this.textWidth;else if("text"===h.nodeName.toLowerCase()&&d.width)var g=this.textWidth=a(d.width);this.styles=d;g&&!H&&this.renderer.forExport&&delete d.width;
|
||||
if(h.namespaceURI===this.SVG_NS){var O=function(d,a){return"-"+a.toLowerCase()};p(d,function(d,a){-1===C.indexOf(a)&&(e+=a.replace(/([A-Z])/g,O)+":"+d+";")});e&&B(h,"style",e)}else K(h,d);this.added&&("text"===this.element.nodeName&&this.renderer.buildText(this),d&&d.textOutline&&this.applyTextOutline(d.textOutline))}return this},getStyle:function(d){return U.getComputedStyle(this.element||this,"").getPropertyValue(d)},strokeWidth:function(){if(!this.renderer.styledMode)return this["stroke-width"]||
|
||||
0;var d=this.getStyle("stroke-width"),c=0;if(d.indexOf("px")===d.length-2)c=a(d);else if(""!==d){var b=L.createElementNS(T,"rect");B(b,{width:d,"stroke-width":0});this.element.parentNode.appendChild(b);c=b.getBBox().width;b.parentNode.removeChild(b)}return c},on:function(d,a){var c=this,b=c.element;M&&"click"===d?(b.ontouchstart=function(d){c.touchEventFired=Date.now();d.preventDefault();a.call(b,d)},b.onclick=function(d){(-1===U.navigator.userAgent.indexOf("Android")||1100<Date.now()-(c.touchEventFired||
|
||||
0))&&a.call(b,d)}):b["on"+d]=a;return this},setRadialReference:function(d){var a=this.renderer.gradients[this.element.gradient];this.element.radialReference=d;a&&a.radAttr&&a.animate(this.renderer.getRadialAttr(d,a.radAttr));return this},translate:function(d,a){return this.attr({translateX:d,translateY:a})},invert:function(d){this.inverted=d;this.updateTransform();return this},updateTransform:function(){var d=this.translateX||0,a=this.translateY||0,b=this.scaleX,h=this.scaleY,e=this.inverted,k=this.rotation,
|
||||
C=this.matrix,g=this.element;e&&(d+=this.width,a+=this.height);d=["translate("+d+","+a+")"];z(C)&&d.push("matrix("+C.join(",")+")");e?d.push("rotate(90) scale(-1,1)"):k&&d.push("rotate("+k+" "+c(this.rotationOriginX,g.getAttribute("x"),0)+" "+c(this.rotationOriginY,g.getAttribute("y")||0)+")");(z(b)||z(h))&&d.push("scale("+c(b,1)+" "+c(h,1)+")");d.length&&g.setAttribute("transform",d.join(" "))},toFront:function(){var d=this.element;d.parentNode.appendChild(d);return this},align:function(d,a,h){var e,
|
||||
k={};var C=this.renderer;var g=C.alignedObjects;var J,H;if(d){if(this.alignOptions=d,this.alignByTranslate=a,!h||b(h))this.alignTo=e=h||"renderer",A(g,this),g.push(this),h=null}else d=this.alignOptions,a=this.alignByTranslate,e=this.alignTo;h=c(h,C[e],C);e=d.align;C=d.verticalAlign;g=(h.x||0)+(d.x||0);var O=(h.y||0)+(d.y||0);"right"===e?J=1:"center"===e&&(J=2);J&&(g+=(h.width-(d.width||0))/J);k[a?"translateX":"x"]=Math.round(g);"bottom"===C?H=1:"middle"===C&&(H=2);H&&(O+=(h.height-(d.height||0))/
|
||||
H);k[a?"translateY":"y"]=Math.round(O);this[this.placed?"animate":"attr"](k);this.placed=!0;this.alignAttr=k;return this},getBBox:function(d,a){var b,h=this.renderer,e=this.element,k=this.styles,C=this.textStr,g,J=h.cache,H=h.cacheKeys,O=e.namespaceURI===this.SVG_NS;a=c(a,this.rotation,0);var w=h.styledMode?e&&S.prototype.getStyle.call(e,"font-size"):k&&k.fontSize;if(z(C)){var p=C.toString();-1===p.indexOf("<")&&(p=p.replace(/[0-9]/g,"0"));p+=["",a,w,this.textWidth,k&&k.textOverflow].join()}p&&!d&&
|
||||
(b=J[p]);if(!b){if(O||h.forExport){try{(g=this.fakeTS&&function(d){[].forEach.call(e.querySelectorAll(".highcharts-text-outline"),function(a){a.style.display=d})})&&g("none"),b=e.getBBox?u({},e.getBBox()):{width:e.offsetWidth,height:e.offsetHeight},g&&g("")}catch(fa){""}if(!b||0>b.width)b={width:0,height:0}}else b=this.htmlGetBBox();h.isSVG&&(d=b.width,h=b.height,O&&(b.height=h={"11px,17":14,"13px,20":16}[k&&k.fontSize+","+Math.round(h)]||h),a&&(k=a*t,b.width=Math.abs(h*Math.sin(k))+Math.abs(d*Math.cos(k)),
|
||||
b.height=Math.abs(h*Math.cos(k))+Math.abs(d*Math.sin(k))));if(p&&0<b.height){for(;250<H.length;)delete J[H.shift()];J[p]||H.push(p);J[p]=b}}return b},show:function(d){return this.attr({visibility:d?"inherit":"visible"})},hide:function(d){d?this.attr({y:-9999}):this.attr({visibility:"hidden"});return this},fadeOut:function(d){var a=this;a.animate({opacity:0},{duration:d||150,complete:function(){a.attr({y:-9999})}})},add:function(d){var a=this.renderer,c=this.element;d&&(this.parentGroup=d);this.parentInverted=
|
||||
d&&d.inverted;"undefined"!==typeof this.textStr&&a.buildText(this);this.added=!0;if(!d||d.handleZ||this.zIndex)var b=this.zIndexSetter();b||(d?d.element:a.box).appendChild(c);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(d){var a=d.parentNode;a&&a.removeChild(d)},destroy:function(){var d=this,a=d.element||{},c=d.renderer,b=c.isSVG&&"SPAN"===a.nodeName&&d.parentGroup,h=a.ownerSVGElement,e=d.clipPath;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=a.point=null;v(d);e&&h&&([].forEach.call(h.querySelectorAll("[clip-path],[CLIP-PATH]"),
|
||||
function(d){-1<d.getAttribute("clip-path").indexOf(e.element.id)&&d.removeAttribute("clip-path")}),d.clipPath=e.destroy());if(d.stops){for(h=0;h<d.stops.length;h++)d.stops[h]=d.stops[h].destroy();d.stops=null}d.safeRemoveChild(a);for(c.styledMode||d.destroyShadows();b&&b.div&&0===b.div.childNodes.length;)a=b.parentGroup,d.safeRemoveChild(b.div),delete b.div,b=a;d.alignTo&&A(c.alignedObjects,d);p(d,function(a,c){d[c]&&d[c].parentGroup===d&&d[c].destroy&&d[c].destroy();delete d[c]})},shadow:function(d,
|
||||
a,b){var h=[],e,k=this.element;if(!d)this.destroyShadows();else if(!this.shadows){var C=c(d.width,3);var g=(d.opacity||.15)/C;var J=this.parentInverted?"(-1,-1)":"("+c(d.offsetX,1)+", "+c(d.offsetY,1)+")";for(e=1;e<=C;e++){var H=k.cloneNode(0);var p=2*C+1-2*e;B(H,{stroke:d.color||"#000000","stroke-opacity":g*e,"stroke-width":p,transform:"translate"+J,fill:"none"});H.setAttribute("class",(H.getAttribute("class")||"")+" highcharts-shadow");b&&(B(H,"height",Math.max(B(H,"height")-p,0)),H.cutHeight=p);
|
||||
a?a.element.appendChild(H):k.parentNode&&k.parentNode.insertBefore(H,k);h.push(H)}this.shadows=h}return this},destroyShadows:function(){(this.shadows||[]).forEach(function(d){this.safeRemoveChild(d)},this);this.shadows=void 0},xGetter:function(d){"circle"===this.element.nodeName&&("x"===d?d="cx":"y"===d&&(d="cy"));return this._defaultGetter(d)},_defaultGetter:function(d){d=c(this[d+"Value"],this[d],this.element?this.element.getAttribute(d):null,0);/^[\-0-9\.]+$/.test(d)&&(d=parseFloat(d));return d},
|
||||
dSetter:function(d,a,c){d&&d.join&&(d=d.join(" "));/(NaN| {2}|^$)/.test(d)&&(d="M 0 0");this[a]!==d&&(c.setAttribute(a,d),this[a]=d)},dashstyleSetter:function(d){var c,b=this["stroke-width"];"inherit"===b&&(b=1);if(d=d&&d.toLowerCase()){d=d.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(c=d.length;c--;)d[c]=a(d[c])*
|
||||
b;d=d.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",d)}},alignSetter:function(d){var a={left:"start",center:"middle",right:"end"};a[d]&&(this.alignValue=d,this.element.setAttribute("text-anchor",a[d]))},opacitySetter:function(d,a,c){this[a]=d;c.setAttribute(a,d)},titleSetter:function(d){var a=this.element.getElementsByTagName("title")[0];a||(a=L.createElementNS(this.SVG_NS,"title"),this.element.appendChild(a));a.firstChild&&a.removeChild(a.firstChild);a.appendChild(L.createTextNode(String(c(d,
|
||||
"")).replace(/<[^>]*>/g,"").replace(/</g,"<").replace(/>/g,">")))},textSetter:function(d){d!==this.textStr&&(delete this.bBox,delete this.textPxLength,this.textStr=d,this.added&&this.renderer.buildText(this))},setTextPath:function(d,a){var c=this.element,b={textAnchor:"text-anchor"},h=!1,e=this.textPathWrapper,C=!e;a=g(!0,{enabled:!0,attributes:{dy:-5,startOffset:"50%",textAnchor:"middle"}},a);var H=a.attributes;if(d&&a&&a.enabled){e&&null===e.element.parentNode?(C=!0,e=e.destroy()):e&&this.removeTextOutline.call(e.parentGroup,
|
||||
[].slice.call(c.getElementsByTagName("tspan")));this.options&&this.options.padding&&(H.dx=-this.options.padding);e||(this.textPathWrapper=e=this.renderer.createElement("textPath"),h=!0);var w=e.element;(a=d.element.getAttribute("id"))||d.element.setAttribute("id",a=k());if(C)for(d=c.getElementsByTagName("tspan");d.length;)d[0].setAttribute("y",0),q(H.dx)&&d[0].setAttribute("x",-H.dx),w.appendChild(d[0]);h&&e.add({element:this.text?this.text.element:c});w.setAttributeNS("http://www.w3.org/1999/xlink",
|
||||
"href",this.renderer.url+"#"+a);z(H.dy)&&(w.parentNode.setAttribute("dy",H.dy),delete H.dy);z(H.dx)&&(w.parentNode.setAttribute("dx",H.dx),delete H.dx);p(H,function(d,a){w.setAttribute(b[a]||a,d)});c.removeAttribute("transform");this.removeTextOutline.call(e,[].slice.call(c.getElementsByTagName("tspan")));this.text&&!this.renderer.styledMode&&this.attr({fill:"none","stroke-width":0});this.applyTextOutline=this.updateTransform=J}else e&&(delete this.updateTransform,delete this.applyTextOutline,this.destroyTextPath(c,
|
||||
d),this.updateTransform(),this.options.rotation&&this.applyTextOutline(this.options.style.textOutline));return this},destroyTextPath:function(d,a){var c=d.getElementsByTagName("text")[0];if(c){if(c.removeAttribute("dx"),c.removeAttribute("dy"),a.element.setAttribute("id",""),c.getElementsByTagName("textPath").length){for(d=this.textPathWrapper.element.childNodes;d.length;)c.appendChild(d[0]);c.removeChild(this.textPathWrapper.element)}}else if(d.getAttribute("dx")||d.getAttribute("dy"))d.removeAttribute("dx"),
|
||||
d.removeAttribute("dy");this.textPathWrapper=this.textPathWrapper.destroy()},fillSetter:function(d,a,c){"string"===typeof d?c.setAttribute(a,d):d&&this.complexColor(d,a,c)},visibilitySetter:function(d,a,c){"inherit"===d?c.removeAttribute(a):this[a]!==d&&c.setAttribute(a,d);this[a]=d},zIndexSetter:function(d,c){var b=this.renderer,h=this.parentGroup,e=(h||b).element||b.box,k=this.element,C=!1;b=e===b.box;var g=this.added;var H;z(d)?(k.setAttribute("data-z-index",d),d=+d,this[c]===d&&(g=!1)):z(this[c])&&
|
||||
k.removeAttribute("data-z-index");this[c]=d;if(g){(d=this.zIndex)&&h&&(h.handleZ=!0);c=e.childNodes;for(H=c.length-1;0<=H&&!C;H--){h=c[H];g=h.getAttribute("data-z-index");var J=!z(g);if(h!==k)if(0>d&&J&&!b&&!H)e.insertBefore(k,c[H]),C=!0;else if(a(g)<=d||J&&(!z(d)||0<=d))e.insertBefore(k,c[H+1]||null),C=!0}C||(e.insertBefore(k,c[b?3:0]||null),C=!0)}return C},_defaultSetter:function(d,a,c){c.setAttribute(a,d)}});S.prototype.yGetter=S.prototype.xGetter;S.prototype.translateXSetter=S.prototype.translateYSetter=
|
||||
S.prototype.rotationSetter=S.prototype.verticalAlignSetter=S.prototype.rotationOriginXSetter=S.prototype.rotationOriginYSetter=S.prototype.scaleXSetter=S.prototype.scaleYSetter=S.prototype.matrixSetter=function(d,a){this[a]=d;this.doTransform=!0};S.prototype["stroke-widthSetter"]=S.prototype.strokeSetter=function(d,a,c){this[a]=d;this.stroke&&this["stroke-width"]?(S.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===
|
||||
a&&0===d&&this.hasStroke?(c.removeAttribute("stroke"),this.hasStroke=!1):this.renderer.styledMode&&this["stroke-width"]&&(c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0)};m=f.SVGRenderer=function(){this.init.apply(this,arguments)};u(m.prototype,{Element:S,SVG_NS:T,init:function(a,c,b,h,e,k,C){var g=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});C||g.css(this.getStyle(h));h=g.element;a.appendChild(h);B(a,"dir","ltr");-1===a.innerHTML.indexOf("xmlns")&&
|
||||
B(h,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=h;this.boxWrapper=g;this.alignedObjects=[];this.url=(Q||d)&&L.getElementsByTagName("base").length?U.location.href.split("#")[0].replace(/<[^>]*>/g,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(L.createTextNode("Created with Highcharts 8.0.3"));this.defs=this.createElement("defs").add();this.allowHTML=k;this.forExport=e;this.styledMode=C;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=
|
||||
0;this.setSize(c,b,!1);var H;Q&&a.getBoundingClientRect&&(c=function(){K(a,{left:0,top:0});H=a.getBoundingClientRect();K(a,{left:Math.ceil(H.left)-H.left+"px",top:Math.ceil(H.top)-H.top+"px"})},c(),this.unSubPixelFix=F(U,"resize",c))},definition:function(d){function a(d,b){var h;E(d).forEach(function(d){var e=c.createElement(d.tagName),k={};p(d,function(d,a){"tagName"!==a&&"children"!==a&&"textContent"!==a&&(k[a]=d)});e.attr(k);e.add(b||c.defs);d.textContent&&e.element.appendChild(L.createTextNode(d.textContent));
|
||||
a(d.children||[],e);h=e});return h}var c=this;return a(d)},getStyle:function(d){return this.style=u({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},d)},setStyle:function(d){this.boxWrapper.css(this.getStyle(d))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var d=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();x(this.gradients||{});this.gradients=null;d&&(this.defs=d.destroy());this.unSubPixelFix&&
|
||||
this.unSubPixelFix();return this.alignedObjects=null},createElement:function(d){var a=new this.Element;a.init(this,d);return a},draw:J,getRadialAttr:function(d,a){return{cx:d[0]-d[2]/2+a.cx*d[2],cy:d[1]-d[2]/2+a.cy*d[2],r:a.r*d[2]}},truncate:function(d,a,c,b,h,e,k){var C=this,g=d.rotation,H,J=b?1:0,p=(c||b).length,w=p,t=[],v=function(d){a.firstChild&&a.removeChild(a.firstChild);d&&a.appendChild(L.createTextNode(d))},l=function(e,g){g=g||e;if("undefined"===typeof t[g])if(a.getSubStringLength)try{t[g]=
|
||||
h+a.getSubStringLength(0,b?g+1:g)}catch(ka){""}else C.getSpanWidth&&(v(k(c||b,e)),t[g]=h+C.getSpanWidth(d,a));return t[g]},E;d.rotation=0;var R=l(a.textContent.length);if(E=h+R>e){for(;J<=p;)w=Math.ceil((J+p)/2),b&&(H=k(b,w)),R=l(w,H&&H.length-1),J===p?J=p+1:R>e?p=w-1:J=w;0===p?v(""):c&&p===c.length-1||v(H||k(c||b,w))}b&&b.splice(0,w);d.actualWidth=R;d.rotation=g;return E},escapes:{"&":"&","<":"<",">":">","'":"'",'"':"""},buildText:function(d){var b=d.element,h=this,e=h.forExport,
|
||||
k=c(d.textStr,"").toString(),C=-1!==k.indexOf("<"),g=b.childNodes,J,w=B(b,"x"),t=d.styles,v=d.textWidth,l=t&&t.lineHeight,E=t&&t.textOutline,n=t&&"ellipsis"===t.textOverflow,O=t&&"nowrap"===t.whiteSpace,q=t&&t.fontSize,W,f=g.length;t=v&&!d.added&&this.box;var M=function(d){var c;h.styledMode||(c=/(px|em)$/.test(d&&d.style.fontSize)?d.style.fontSize:q||h.style.fontSize||12);return l?a(l):h.fontMetrics(c,d.getAttribute("style")?d:b).h},u=function(d,a){p(h.escapes,function(c,b){a&&-1!==a.indexOf(c)||
|
||||
(d=d.toString().replace(new RegExp(c,"g"),b))});return d},U=function(d,a){var c=d.indexOf("<");d=d.substring(c,d.indexOf(">")-c);c=d.indexOf(a+"=");if(-1!==c&&(c=c+a.length+1,a=d.charAt(c),'"'===a||"'"===a))return d=d.substring(c+1),d.substring(0,d.indexOf(a))},x=/<br.*?>/g;var Q=[k,n,O,l,E,q,v].join();if(Q!==d.textCache){for(d.textCache=Q;f--;)b.removeChild(g[f]);C||E||n||v||-1!==k.indexOf(" ")&&(!O||x.test(k))?(t&&t.appendChild(b),C?(k=h.styledMode?k.replace(/<(b|strong)>/g,'<span class="highcharts-strong">').replace(/<(i|em)>/g,
|
||||
'<span class="highcharts-emphasized">'):k.replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">'),k=k.replace(/<a/g,"<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(x)):k=[k],k=k.filter(function(d){return""!==d}),k.forEach(function(a,c){var k=0,C=0;a=a.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");var g=a.split("|||");g.forEach(function(a){if(""!==a||1===g.length){var p={},t=L.createElementNS(h.SVG_NS,
|
||||
"tspan"),l,E;(l=U(a,"class"))&&B(t,"class",l);if(l=U(a,"style"))l=l.replace(/(;| |^)color([ :])/,"$1fill$2"),B(t,"style",l);(E=U(a,"href"))&&!e&&(B(t,"onclick",'location.href="'+E+'"'),B(t,"class","highcharts-anchor"),h.styledMode||K(t,{cursor:"pointer"}));a=u(a.replace(/<[a-zA-Z\/](.|\n)*?>/g,"")||" ");if(" "!==a){t.appendChild(L.createTextNode(a));k?p.dx=0:c&&null!==w&&(p.x=w);B(t,p);b.appendChild(t);!k&&W&&(!H&&e&&K(t,{display:"block"}),B(t,"dy",M(t)));if(v){var R=a.replace(/([^\^])-/g,"$1- ").split(" ");
|
||||
p=!O&&(1<g.length||c||1<R.length);E=0;var f=M(t);if(n)J=h.truncate(d,t,a,void 0,0,Math.max(0,v-parseInt(q||12,10)),function(d,a){return d.substring(0,a)+"\u2026"});else if(p)for(;R.length;)R.length&&!O&&0<E&&(t=L.createElementNS(T,"tspan"),B(t,{dy:f,x:w}),l&&B(t,"style",l),t.appendChild(L.createTextNode(R.join(" ").replace(/- /g,"-"))),b.appendChild(t)),h.truncate(d,t,null,R,0===E?C:0,v,function(d,a){return R.slice(0,a).join(" ").replace(/- /g,"-")}),C=d.actualWidth,E++}k++}}});W=W||b.childNodes.length}),
|
||||
n&&J&&d.attr("title",u(d.textStr,["<",">"])),t&&t.removeChild(b),E&&d.applyTextOutline&&d.applyTextOutline(E)):b.appendChild(L.createTextNode(u(k)))}},getContrast:function(d){d=r(d).rgba;d[0]*=1;d[1]*=1.2;d[2]*=.5;return 459<d[0]+d[1]+d[2]?"#000000":"#FFFFFF"},button:function(d,a,c,b,h,e,k,H,J,p){var w=this.label(d,a,c,J,null,null,p,null,"button"),t=0,v=this.styledMode;w.attr(g({padding:8,r:2},h));if(!v){h=g({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",
|
||||
fontWeight:"normal"}},h);var l=h.style;delete h.style;e=g(h,{fill:"#e6e6e6"},e);var E=e.style;delete e.style;k=g(h,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},k);var L=k.style;delete k.style;H=g(h,{style:{color:"#cccccc"}},H);var n=H.style;delete H.style}F(w.element,C?"mouseover":"mouseenter",function(){3!==t&&w.setState(1)});F(w.element,C?"mouseout":"mouseleave",function(){3!==t&&w.setState(t)});w.setState=function(d){1!==d&&(w.state=t=d);w.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+
|
||||
["normal","hover","pressed","disabled"][d||0]);v||w.attr([h,e,k,H][d||0]).css([l,E,L,n][d||0])};v||w.attr(h).css(u({cursor:"default"},l));return w.on("click",function(d){3!==t&&b.call(w,d)})},crispLine:function(d,a){d[1]===d[4]&&(d[1]=d[4]=Math.round(d[1])-a%2/2);d[2]===d[5]&&(d[2]=d[5]=Math.round(d[2])+a%2/2);return d},path:function(d){var a=this.styledMode?{}:{fill:"none"};l(d)?a.d=d:e(d)&&u(a,d);return this.createElement("path").attr(a)},circle:function(d,a,c){d=e(d)?d:"undefined"===typeof d?{}:
|
||||
{x:d,y:a,r:c};a=this.createElement("circle");a.xSetter=a.ySetter=function(d,a,c){c.setAttribute("c"+a,d)};return a.attr(d)},arc:function(d,a,c,b,h,k){e(d)?(b=d,a=b.y,c=b.r,d=b.x):b={innerR:b,start:h,end:k};d=this.symbol("arc",d,a,c,c,b);d.r=c;return d},rect:function(d,a,c,b,h,k){h=e(d)?d.r:h;var C=this.createElement("rect");d=e(d)?d:"undefined"===typeof d?{}:{x:d,y:a,width:Math.max(c,0),height:Math.max(b,0)};this.styledMode||("undefined"!==typeof k&&(d.strokeWidth=k,d=C.crisp(d)),d.fill="none");h&&
|
||||
(d.r=h);C.rSetter=function(d,a,c){C.r=d;B(c,{rx:d,ry:d})};C.rGetter=function(){return C.r};return C.attr(d)},setSize:function(d,a,b){var h=this.alignedObjects,e=h.length;this.width=d;this.height=a;for(this.boxWrapper.animate({width:d,height:a},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},duration:c(b,!0)?void 0:0});e--;)h[e].align()},g:function(d){var a=this.createElement("g");return d?a.attr({"class":"highcharts-"+d}):a},image:function(d,a,c,b,h,e){var k=
|
||||
{preserveAspectRatio:"none"},C=function(d,a){d.setAttributeNS?d.setAttributeNS("http://www.w3.org/1999/xlink","href",a):d.setAttribute("hc-svg-href",a)},g=function(a){C(H.element,d);e.call(H,a)};1<arguments.length&&u(k,{x:a,y:c,width:b,height:h});var H=this.createElement("image").attr(k);e?(C(H.element,"data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),k=new U.Image,F(k,"load",g),k.src=d,k.complete&&g({})):C(H.element,d);return H},symbol:function(d,a,b,e,k,C){var g=this,
|
||||
H=/^url\((.*?)\)$/,J=H.test(d),w=!J&&(this.symbols[d]?d:"circle"),p=w&&this.symbols[w],t=z(a)&&p&&p.call(this.symbols,Math.round(a),Math.round(b),e,k,C);if(p){var v=this.path(t);g.styledMode||v.attr("fill","none");u(v,{symbolName:w,x:a,y:b,width:e,height:k});C&&u(v,C)}else if(J){var l=d.match(H)[1];v=this.image(l);v.imgwidth=c(W[l]&&W[l].width,C&&C.width);v.imgheight=c(W[l]&&W[l].height,C&&C.height);var E=function(){v.attr({width:v.width,height:v.height})};["width","height"].forEach(function(d){v[d+
|
||||
"Setter"]=function(d,a){var c={},b=this["img"+a],h="width"===a?"translateX":"translateY";this[a]=d;z(b)&&(C&&"within"===C.backgroundSize&&this.width&&this.height&&(b=Math.round(b*Math.min(this.width/this.imgwidth,this.height/this.imgheight))),this.element&&this.element.setAttribute(a,b),this.alignByTranslate||(c[h]=((this[a]||0)-b)/2,this.attr(c)))}});z(a)&&v.attr({x:a,y:b});v.isImg=!0;z(v.imgwidth)&&z(v.imgheight)?E():(v.attr({width:0,height:0}),D("img",{onload:function(){var d=h[g.chartIndex];0===
|
||||
this.width&&(K(this,{position:"absolute",top:"-999em"}),L.body.appendChild(this));W[l]={width:this.width,height:this.height};v.imgwidth=this.width;v.imgheight=this.height;v.element&&E();this.parentNode&&this.parentNode.removeChild(this);g.imgCount--;if(!g.imgCount&&d&&!d.hasLoaded)d.onload()},src:l}),this.imgCount++)}return v},symbols:{circle:function(d,a,c,b){return this.arc(d+c/2,a+b/2,c/2,b/2,{start:.5*Math.PI,end:2.5*Math.PI,open:!1})},square:function(d,a,c,b){return["M",d,a,"L",d+c,a,d+c,a+b,
|
||||
d,a+b,"Z"]},triangle:function(d,a,c,b){return["M",d+c/2,a,"L",d+c,a+b,d,a+b,"Z"]},"triangle-down":function(d,a,c,b){return["M",d,a,"L",d+c,a,d+c/2,a+b,"Z"]},diamond:function(d,a,c,b){return["M",d+c/2,a,"L",d+c,a+b/2,d+c/2,a+b,d,a+b/2,"Z"]},arc:function(d,a,b,h,e){var k=e.start,C=e.r||b,g=e.r||h||b,H=e.end-.001;b=e.innerR;h=c(e.open,.001>Math.abs(e.end-e.start-2*Math.PI));var J=Math.cos(k),w=Math.sin(k),p=Math.cos(H);H=Math.sin(H);k=c(e.longArc,.001>e.end-k-Math.PI?0:1);C=["M",d+C*J,a+g*w,"A",C,g,
|
||||
0,k,c(e.clockwise,1),d+C*p,a+g*H];z(b)&&C.push(h?"M":"L",d+b*p,a+b*H,"A",b,b,0,k,z(e.clockwise)?1-e.clockwise:0,d+b*J,a+b*w);C.push(h?"":"Z");return C},callout:function(d,a,c,b,h){var e=Math.min(h&&h.r||0,c,b),k=e+6,C=h&&h.anchorX;h=h&&h.anchorY;var g=["M",d+e,a,"L",d+c-e,a,"C",d+c,a,d+c,a,d+c,a+e,"L",d+c,a+b-e,"C",d+c,a+b,d+c,a+b,d+c-e,a+b,"L",d+e,a+b,"C",d,a+b,d,a+b,d,a+b-e,"L",d,a+e,"C",d,a,d,a,d+e,a];C&&C>c?h>a+k&&h<a+b-k?g.splice(13,3,"L",d+c,h-6,d+c+6,h,d+c,h+6,d+c,a+b-e):g.splice(13,3,"L",
|
||||
d+c,b/2,C,h,d+c,b/2,d+c,a+b-e):C&&0>C?h>a+k&&h<a+b-k?g.splice(33,3,"L",d,h+6,d-6,h,d,h-6,d,a+e):g.splice(33,3,"L",d,b/2,C,h,d,b/2,d,a+e):h&&h>b&&C>d+k&&C<d+c-k?g.splice(23,3,"L",C+6,a+b,C,a+b+6,C-6,a+b,d+e,a+b):h&&0>h&&C>d+k&&C<d+c-k&&g.splice(3,3,"L",C-6,a,C,a-6,C+6,a,c-e,a);return g}},clipRect:function(d,a,c,b){var h=k()+"-",e=this.createElement("clipPath").attr({id:h}).add(this.defs);d=this.rect(d,a,c,b,0).add(e);d.id=h;d.clipPath=e;d.count=0;return d},text:function(d,a,c,b){var h={};if(b&&(this.allowHTML||
|
||||
!this.forExport))return this.html(d,a,c);h.x=Math.round(a||0);c&&(h.y=Math.round(c));z(d)&&(h.text=d);d=this.createElement("text").attr(h);b||(d.xSetter=function(d,a,c){var b=c.getElementsByTagName("tspan"),h=c.getAttribute(a),e;for(e=0;e<b.length;e++){var k=b[e];k.getAttribute(a)===h&&k.setAttribute(a,d)}c.setAttribute(a,d)});return d},fontMetrics:function(d,c){d=!this.styledMode&&/px/.test(d)||!U.getComputedStyle?d||c&&c.style&&c.style.fontSize||this.style&&this.style.fontSize:c&&S.prototype.getStyle.call(c,
|
||||
"font-size");d=/px/.test(d)?a(d):12;c=24>d?d+3:Math.round(1.2*d);return{h:c,b:Math.round(.8*c),f:d}},rotCorr:function(d,a,c){var b=d;a&&c&&(b=Math.max(b*Math.cos(a*t),4));return{x:-d/3*Math.sin(a*t),y:b}},label:function(d,a,c,b,h,e,k,C,H){var J=this,p=J.styledMode,t=J.g("button"!==H&&"label"),v=t.text=J.text("",0,0,k).attr({zIndex:1}),l,E,L=0,n=3,W=0,T,f,M,R,U,x={},Q,m,ba=/^url\((.*?)\)$/.test(b),O=p||ba,A=function(){return p?l.strokeWidth()%2/2:(Q?parseInt(Q,10):0)%2/2};H&&t.addClass("highcharts-"+
|
||||
H);var r=function(){var d=v.element.style,a={};E=("undefined"===typeof T||"undefined"===typeof f||U)&&z(v.textStr)&&v.getBBox();t.width=(T||E.width||0)+2*n+W;t.height=(f||E.height||0)+2*n;m=n+Math.min(J.fontMetrics(d&&d.fontSize,v).b,E?E.height:Infinity);O&&(l||(t.box=l=J.symbols[b]||ba?J.symbol(b):J.rect(),l.addClass(("button"===H?"":"highcharts-label-box")+(H?" highcharts-"+H+"-box":"")),l.add(t),d=A(),a.x=d,a.y=(C?-m:0)+d),a.width=Math.round(t.width),a.height=Math.round(t.height),l.attr(u(a,x)),
|
||||
x={})};var D=function(){var d=W+n;var a=C?0:m;z(T)&&E&&("center"===U||"right"===U)&&(d+={center:.5,right:1}[U]*(T-E.width));if(d!==v.x||a!==v.y)v.attr("x",d),v.hasBoxWidthChanged&&(E=v.getBBox(!0),r()),"undefined"!==typeof a&&v.attr("y",a);v.x=d;v.y=a};var X=function(d,a){l?l.attr(d,a):x[d]=a};t.onAdd=function(){v.add(t);t.attr({text:d||0===d?d:"",x:a,y:c});l&&z(h)&&t.attr({anchorX:h,anchorY:e})};t.widthSetter=function(d){T=q(d)?d:null};t.heightSetter=function(d){f=d};t["text-alignSetter"]=function(d){U=
|
||||
d};t.paddingSetter=function(d){z(d)&&d!==n&&(n=t.padding=d,D())};t.paddingLeftSetter=function(d){z(d)&&d!==W&&(W=d,D())};t.alignSetter=function(d){d={left:0,center:.5,right:1}[d];d!==L&&(L=d,E&&t.attr({x:M}))};t.textSetter=function(d){"undefined"!==typeof d&&v.attr({text:d});r();D()};t["stroke-widthSetter"]=function(d,a){d&&(O=!0);Q=this["stroke-width"]=d;X(a,d)};p?t.rSetter=function(d,a){X(a,d)}:t.strokeSetter=t.fillSetter=t.rSetter=function(d,a){"r"!==a&&("fill"===a&&d&&(O=!0),t[a]=d);X(a,d)};t.anchorXSetter=
|
||||
function(d,a){h=t.anchorX=d;X(a,Math.round(d)-A()-M)};t.anchorYSetter=function(d,a){e=t.anchorY=d;X(a,d-R)};t.xSetter=function(d){t.x=d;L&&(d-=L*((T||E.width)+2*n),t["forceAnimate:x"]=!0);M=Math.round(d);t.attr("translateX",M)};t.ySetter=function(d){R=t.y=Math.round(d);t.attr("translateY",R)};var B=t.css;k={css:function(d){if(d){var a={};d=g(d);t.textProps.forEach(function(c){"undefined"!==typeof d[c]&&(a[c]=d[c],delete d[c])});v.css(a);"width"in a&&r();"fontSize"in a&&(r(),D())}return B.call(t,d)},
|
||||
getBBox:function(){return{width:E.width+2*n,height:E.height+2*n,x:E.x-n,y:E.y-n}},destroy:function(){w(t.element,"mouseenter");w(t.element,"mouseleave");v&&(v=v.destroy());l&&(l=l.destroy());S.prototype.destroy.call(t);t=J=r=D=X=null}};p||(k.shadow=function(d){d&&(r(),l&&l.shadow(d));return t});return u(t,k)}});f.Renderer=m});P(y,"parts/Html.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.attr,r=m.createElement,F=m.css,N=m.defined,G=m.extend,B=m.pick,D=m.pInt,K=f.isFirefox,
|
||||
z=f.isMS,x=f.isWebKit,A=f.SVGElement;m=f.SVGRenderer;var u=f.win;G(A.prototype,{htmlCss:function(n){var l="SPAN"===this.element.tagName&&n&&"width"in n,q=B(l&&n.width,void 0);if(l){delete n.width;this.textWidth=q;var e=!0}n&&"ellipsis"===n.textOverflow&&(n.whiteSpace="nowrap",n.overflow="hidden");this.styles=G(this.styles,n);F(this.element,n);e&&this.htmlUpdateTransform();return this},htmlGetBBox:function(){var n=this.element;return{x:n.offsetLeft,y:n.offsetTop,width:n.offsetWidth,height:n.offsetHeight}},
|
||||
htmlUpdateTransform:function(){if(this.added){var n=this.renderer,l=this.element,q=this.translateX||0,e=this.translateY||0,b=this.x||0,g=this.y||0,p=this.textAlign||"left",c={left:0,center:.5,right:1}[p],a=this.styles,w=a&&a.whiteSpace;F(l,{marginLeft:q,marginTop:e});!n.styledMode&&this.shadows&&this.shadows.forEach(function(a){F(a,{marginLeft:q+1,marginTop:e+1})});this.inverted&&[].forEach.call(l.childNodes,function(a){n.invertChild(a,l)});if("SPAN"===l.tagName){a=this.rotation;var E=this.textWidth&&
|
||||
D(this.textWidth),v=[a,p,l.innerHTML,this.textWidth,this.textAlign].join(),k;(k=E!==this.oldTextWidth)&&!(k=E>this.oldTextWidth)&&((k=this.textPxLength)||(F(l,{width:"",whiteSpace:w||"nowrap"}),k=l.offsetWidth),k=k>E);k&&(/[ \-]/.test(l.textContent||l.innerText)||"ellipsis"===l.style.textOverflow)?(F(l,{width:E+"px",display:"block",whiteSpace:w||"normal"}),this.oldTextWidth=E,this.hasBoxWidthChanged=!0):this.hasBoxWidthChanged=!1;v!==this.cTT&&(w=n.fontMetrics(l.style.fontSize,l).b,!N(a)||a===(this.oldRotation||
|
||||
0)&&p===this.oldAlign||this.setSpanRotation(a,c,w),this.getSpanCorrection(!N(a)&&this.textPxLength||l.offsetWidth,w,c,a,p));F(l,{left:b+(this.xCorr||0)+"px",top:g+(this.yCorr||0)+"px"});this.cTT=v;this.oldRotation=a;this.oldAlign=p}}else this.alignOnAdd=!0},setSpanRotation:function(n,l,q){var e={},b=this.renderer.getTransformKey();e[b]=e.transform="rotate("+n+"deg)";e[b+(K?"Origin":"-origin")]=e.transformOrigin=100*l+"% "+q+"px";F(this.element,e)},getSpanCorrection:function(n,l,q){this.xCorr=-n*q;
|
||||
this.yCorr=-l}});G(m.prototype,{getTransformKey:function(){return z&&!/Edge/.test(u.navigator.userAgent)?"-ms-transform":x?"-webkit-transform":K?"MozTransform":u.opera?"-o-transform":""},html:function(n,l,q){var e=this.createElement("span"),b=e.element,g=e.renderer,p=g.isSVG,c=function(a,c){["opacity","visibility"].forEach(function(b){a[b+"Setter"]=function(e,k,h){var g=a.div?a.div.style:c;A.prototype[b+"Setter"].call(this,e,k,h);g&&(g[k]=e)}});a.addedSetters=!0};e.textSetter=function(a){a!==b.innerHTML&&
|
||||
(delete this.bBox,delete this.oldTextWidth);this.textStr=a;b.innerHTML=B(a,"");e.doTransform=!0};p&&c(e,e.element.style);e.xSetter=e.ySetter=e.alignSetter=e.rotationSetter=function(a,c){"align"===c&&(c="textAlign");e[c]=a;e.doTransform=!0};e.afterSetters=function(){this.doTransform&&(this.htmlUpdateTransform(),this.doTransform=!1)};e.attr({text:n,x:Math.round(l),y:Math.round(q)}).css({position:"absolute"});g.styledMode||e.css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize});b.style.whiteSpace=
|
||||
"nowrap";e.css=e.htmlCss;p&&(e.add=function(a){var p=g.box.parentNode,l=[];if(this.parentGroup=a){var v=a.div;if(!v){for(;a;)l.push(a),a=a.parentGroup;l.reverse().forEach(function(a){function b(c,b){a[b]=c;"translateX"===b?g.left=c+"px":g.top=c+"px";a.doTransform=!0}var k=I(a.element,"class");v=a.div=a.div||r("div",k?{className:k}:void 0,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},v||
|
||||
p);var g=v.style;G(a,{classSetter:function(a){return function(c){this.element.setAttribute("class",c);a.className=c}}(v),on:function(){l[0].div&&e.on.apply({element:l[0].div},arguments);return a},translateXSetter:b,translateYSetter:b});a.addedSetters||c(a)})}}else v=p;v.appendChild(b);e.added=!0;e.alignOnAdd&&e.htmlUpdateTransform();return e});return e}})});P(y,"parts/Tick.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.clamp,r=m.correctFloat,F=m.defined,N=m.destroyObjectProperties,
|
||||
G=m.extend,B=m.isNumber,D=m.merge,K=m.objectEach,z=m.pick,x=f.fireEvent,A=f.deg2rad;m=function(){function u(n,l,q,e,b){this.isNewLabel=this.isNew=!0;this.axis=n;this.pos=l;this.type=q||"";this.parameters=b||{};this.tickmarkOffset=this.parameters.tickmarkOffset;this.options=this.parameters.options;q||e||this.addLabel()}u.prototype.addLabel=function(){var n=this,l=n.axis,q=l.options,e=l.chart,b=l.categories,g=l.names,p=n.pos,c=z(n.options&&n.options.labels,q.labels),a=l.tickPositions,w=p===a[0],E=p===
|
||||
a[a.length-1];g=this.parameters.category||(b?z(b[p],g[p],p):p);var v=n.label;b=(!c.step||1===c.step)&&1===l.tickInterval;a=a.info;var k,h;if(l.isDatetimeAxis&&a){var t=e.time.resolveDTLFormat(q.dateTimeLabelFormats[!q.grid&&a.higherRanks[p]||a.unitName]);var L=t.main}n.isFirst=w;n.isLast=E;n.formatCtx={axis:l,chart:e,isFirst:w,isLast:E,dateTimeLabelFormat:L,tickPositionInfo:a,value:l.isLog?r(l.lin2log(g)):g,pos:p};q=l.labelFormatter.call(n.formatCtx,this.formatCtx);if(h=t&&t.list)n.shortenLabel=function(){for(k=
|
||||
0;k<h.length;k++)if(v.attr({text:l.labelFormatter.call(G(n.formatCtx,{dateTimeLabelFormat:h[k]}))}),v.getBBox().width<l.getSlotWidth(n)-2*z(c.padding,5))return;v.attr({text:""})};b&&l._addedPlotLB&&l.isXAxis&&n.moveLabel(q,c);F(v)||n.movedLabel?v&&v.textStr!==q&&!b&&(!v.textWidth||c.style&&c.style.width||v.styles.width||v.css({width:null}),v.attr({text:q}),v.textPxLength=v.getBBox().width):(n.label=v=n.createLabel({x:0,y:0},q,c),n.rotation=0)};u.prototype.createLabel=function(n,l,q){var e=this.axis,
|
||||
b=e.chart;if(n=F(l)&&q.enabled?b.renderer.text(l,n.x,n.y,q.useHTML).add(e.labelGroup):null)b.styledMode||n.css(D(q.style)),n.textPxLength=n.getBBox().width;return n};u.prototype.destroy=function(){N(this,this.axis)};u.prototype.getPosition=function(n,l,q,e){var b=this.axis,g=b.chart,p=e&&g.oldChartHeight||g.chartHeight;n={x:n?r(b.translate(l+q,null,null,e)+b.transB):b.left+b.offset+(b.opposite?(e&&g.oldChartWidth||g.chartWidth)-b.right-b.left:0),y:n?p-b.bottom+b.offset-(b.opposite?b.height:0):r(p-
|
||||
b.translate(l+q,null,null,e)-b.transB)};n.y=I(n.y,-1E5,1E5);x(this,"afterGetPosition",{pos:n});return n};u.prototype.getLabelPosition=function(n,l,q,e,b,g,p,c){var a=this.axis,w=a.transA,E=a.isLinked&&a.linkedParent?a.linkedParent.reversed:a.reversed,v=a.staggerLines,k=a.tickRotCorr||{x:0,y:0},h=b.y,t=e||a.reserveSpaceDefault?0:-a.labelOffset*("center"===a.labelAlign?.5:1),L={};F(h)||(h=0===a.side?q.rotation?-8:-q.getBBox().height:2===a.side?k.y+8:Math.cos(q.rotation*A)*(k.y-q.getBBox(!1,0).height/
|
||||
2));n=n+b.x+t+k.x-(g&&e?g*w*(E?-1:1):0);l=l+h-(g&&!e?g*w*(E?1:-1):0);v&&(q=p/(c||1)%v,a.opposite&&(q=v-q-1),l+=a.labelOffset/v*q);L.x=n;L.y=Math.round(l);x(this,"afterGetLabelPosition",{pos:L,tickmarkOffset:g,index:p});return L};u.prototype.getLabelSize=function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0};u.prototype.getMarkPath=function(n,l,q,e,b,g){return g.crispLine(["M",n,l,"L",n+(b?0:-q),l+(b?q:0)],e)};u.prototype.handleOverflow=function(n){var l=this.axis,q=
|
||||
l.options.labels,e=n.x,b=l.chart.chartWidth,g=l.chart.spacing,p=z(l.labelLeft,Math.min(l.pos,g[3]));g=z(l.labelRight,Math.max(l.isRadial?0:l.pos+l.len,b-g[1]));var c=this.label,a=this.rotation,w={left:0,center:.5,right:1}[l.labelAlign||c.attr("align")],E=c.getBBox().width,v=l.getSlotWidth(this),k=v,h=1,t,L={};if(a||"justify"!==z(q.overflow,"justify"))0>a&&e-w*E<p?t=Math.round(e/Math.cos(a*A)-p):0<a&&e+w*E>g&&(t=Math.round((b-e)/Math.cos(a*A)));else if(b=e+(1-w)*E,e-w*E<p?k=n.x+k*(1-w)-p:b>g&&(k=g-
|
||||
n.x+k*w,h=-1),k=Math.min(v,k),k<v&&"center"===l.labelAlign&&(n.x+=h*(v-k-w*(v-Math.min(E,k)))),E>k||l.autoRotation&&(c.styles||{}).width)t=k;t&&(this.shortenLabel?this.shortenLabel():(L.width=Math.floor(t),(q.style||{}).textOverflow||(L.textOverflow="ellipsis"),c.css(L)))};u.prototype.moveLabel=function(n,l){var q=this,e=q.label,b=!1,g=q.axis,p=g.reversed,c=g.chart.inverted;e&&e.textStr===n?(q.movedLabel=e,b=!0,delete q.label):K(g.ticks,function(a){b||a.isNew||a===q||!a.label||a.label.textStr!==n||
|
||||
(q.movedLabel=a.label,b=!0,a.labelPos=q.movedLabel.xy,delete a.label)});if(!b&&(q.labelPos||e)){var a=q.labelPos||e.xy;e=c?a.x:p?0:g.width+g.left;g=c?p?g.width+g.left:0:a.y;q.movedLabel=q.createLabel({x:e,y:g},n,l);q.movedLabel&&q.movedLabel.attr({opacity:0})}};u.prototype.render=function(n,l,q){var e=this.axis,b=e.horiz,g=this.pos,p=z(this.tickmarkOffset,e.tickmarkOffset);g=this.getPosition(b,g,p,l);p=g.x;var c=g.y;e=b&&p===e.pos+e.len||!b&&c===e.pos?-1:1;q=z(q,1);this.isActive=!0;this.renderGridLine(l,
|
||||
q,e);this.renderMark(g,q,e);this.renderLabel(g,l,q,n);this.isNew=!1;f.fireEvent(this,"afterRender")};u.prototype.renderGridLine=function(n,l,q){var e=this.axis,b=e.options,g=this.gridLine,p={},c=this.pos,a=this.type,w=z(this.tickmarkOffset,e.tickmarkOffset),E=e.chart.renderer,v=a?a+"Grid":"grid",k=b[v+"LineWidth"],h=b[v+"LineColor"];b=b[v+"LineDashStyle"];g||(e.chart.styledMode||(p.stroke=h,p["stroke-width"]=k,b&&(p.dashstyle=b)),a||(p.zIndex=1),n&&(l=0),this.gridLine=g=E.path().attr(p).addClass("highcharts-"+
|
||||
(a?a+"-":"")+"grid-line").add(e.gridGroup));if(g&&(q=e.getPlotLinePath({value:c+w,lineWidth:g.strokeWidth()*q,force:"pass",old:n})))g[n||this.isNew?"attr":"animate"]({d:q,opacity:l})};u.prototype.renderMark=function(n,l,q){var e=this.axis,b=e.options,g=e.chart.renderer,p=this.type,c=p?p+"Tick":"tick",a=e.tickSize(c),w=this.mark,E=!w,v=n.x;n=n.y;var k=z(b[c+"Width"],!p&&e.isXAxis?1:0);b=b[c+"Color"];a&&(e.opposite&&(a[0]=-a[0]),E&&(this.mark=w=g.path().addClass("highcharts-"+(p?p+"-":"")+"tick").add(e.axisGroup),
|
||||
e.chart.styledMode||w.attr({stroke:b,"stroke-width":k})),w[E?"attr":"animate"]({d:this.getMarkPath(v,n,a[0],w.strokeWidth()*q,e.horiz,g),opacity:l}))};u.prototype.renderLabel=function(n,l,q,e){var b=this.axis,g=b.horiz,p=b.options,c=this.label,a=p.labels,w=a.step;b=z(this.tickmarkOffset,b.tickmarkOffset);var E=!0,v=n.x;n=n.y;c&&B(v)&&(c.xy=n=this.getLabelPosition(v,n,c,g,a,b,e,w),this.isFirst&&!this.isLast&&!z(p.showFirstLabel,1)||this.isLast&&!this.isFirst&&!z(p.showLastLabel,1)?E=!1:!g||a.step||
|
||||
a.rotation||l||0===q||this.handleOverflow(n),w&&e%w&&(E=!1),E&&B(n.y)?(n.opacity=q,c[this.isNewLabel?"attr":"animate"](n),this.isNewLabel=!1):(c.attr("y",-9999),this.isNewLabel=!0))};u.prototype.replaceMovedLabel=function(){var n=this.label,l=this.axis,q=l.reversed,e=this.axis.chart.inverted;if(n&&!this.isNew){var b=e?n.xy.x:q?l.left:l.width+l.left;q=e?q?l.width+l.top:l.top:n.xy.y;n.animate({x:b,y:q,opacity:0},void 0,n.destroy);delete this.label}l.isDirty=!0;this.label=this.movedLabel;delete this.movedLabel};
|
||||
return u}();f.Tick=m;return f.Tick});P(y,"parts/Time.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.defined,r=m.error,F=m.extend,N=m.isObject,G=m.merge,B=m.objectEach,D=m.pad,K=m.pick,z=m.splat,x=m.timeUnits,A=f.win;m=function(){function u(n){this.options={};this.variableTimezone=this.useUTC=!1;this.Date=A.Date;this.getTimezoneOffset=this.timezoneOffsetFunction();this.update(n)}u.prototype.get=function(n,l){if(this.variableTimezone||this.timezoneOffset){var q=l.getTime(),
|
||||
e=q-this.getTimezoneOffset(l);l.setTime(e);n=l["getUTC"+n]();l.setTime(q);return n}return this.useUTC?l["getUTC"+n]():l["get"+n]()};u.prototype.set=function(n,l,q){if(this.variableTimezone||this.timezoneOffset){if("Milliseconds"===n||"Seconds"===n||"Minutes"===n)return l["setUTC"+n](q);var e=this.getTimezoneOffset(l);e=l.getTime()-e;l.setTime(e);l["setUTC"+n](q);n=this.getTimezoneOffset(l);e=l.getTime()+n;return l.setTime(e)}return this.useUTC?l["setUTC"+n](q):l["set"+n](q)};u.prototype.update=function(n){var l=
|
||||
K(n&&n.useUTC,!0);this.options=n=G(!0,this.options||{},n);this.Date=n.Date||A.Date||Date;this.timezoneOffset=(this.useUTC=l)&&n.timezoneOffset;this.getTimezoneOffset=this.timezoneOffsetFunction();this.variableTimezone=!(l&&!n.getTimezoneOffset&&!n.timezone)};u.prototype.makeTime=function(n,l,q,e,b,g){if(this.useUTC){var p=this.Date.UTC.apply(0,arguments);var c=this.getTimezoneOffset(p);p+=c;var a=this.getTimezoneOffset(p);c!==a?p+=a-c:c-36E5!==this.getTimezoneOffset(p-36E5)||f.isSafari||(p-=36E5)}else p=
|
||||
(new this.Date(n,l,K(q,1),K(e,0),K(b,0),K(g,0))).getTime();return p};u.prototype.timezoneOffsetFunction=function(){var n=this,l=this.options,q=A.moment;if(!this.useUTC)return function(e){return 6E4*(new Date(e.toString())).getTimezoneOffset()};if(l.timezone){if(q)return function(e){return 6E4*-q.tz(e,l.timezone).utcOffset()};r(25)}return this.useUTC&&l.getTimezoneOffset?function(e){return 6E4*l.getTimezoneOffset(e)}:function(){return 6E4*(n.timezoneOffset||0)}};u.prototype.dateFormat=function(n,l,
|
||||
q){var e;if(!I(l)||isNaN(l))return(null===(e=f.defaultOptions.lang)||void 0===e?void 0:e.invalidDate)||"";n=K(n,"%Y-%m-%d %H:%M:%S");var b=this;e=new this.Date(l);var g=this.get("Hours",e),p=this.get("Day",e),c=this.get("Date",e),a=this.get("Month",e),w=this.get("FullYear",e),E=f.defaultOptions.lang,v=null===E||void 0===E?void 0:E.weekdays,k=null===E||void 0===E?void 0:E.shortWeekdays;e=F({a:k?k[p]:v[p].substr(0,3),A:v[p],d:D(c),e:D(c,2," "),w:p,b:E.shortMonths[a],B:E.months[a],m:D(a+1),o:a+1,y:w.toString().substr(2,
|
||||
2),Y:w,H:D(g),k:g,I:D(g%12||12),l:g%12||12,M:D(this.get("Minutes",e)),p:12>g?"AM":"PM",P:12>g?"am":"pm",S:D(e.getSeconds()),L:D(Math.floor(l%1E3),3)},f.dateFormats);B(e,function(a,c){for(;-1!==n.indexOf("%"+c);)n=n.replace("%"+c,"function"===typeof a?a.call(b,l):a)});return q?n.substr(0,1).toUpperCase()+n.substr(1):n};u.prototype.resolveDTLFormat=function(n){return N(n,!0)?n:(n=z(n),{main:n[0],from:n[1],to:n[2]})};u.prototype.getTimeTicks=function(n,l,q,e){var b=this,g=[],p={};var c=new b.Date(l);
|
||||
var a=n.unitRange,w=n.count||1,E;e=K(e,1);if(I(l)){b.set("Milliseconds",c,a>=x.second?0:w*Math.floor(b.get("Milliseconds",c)/w));a>=x.second&&b.set("Seconds",c,a>=x.minute?0:w*Math.floor(b.get("Seconds",c)/w));a>=x.minute&&b.set("Minutes",c,a>=x.hour?0:w*Math.floor(b.get("Minutes",c)/w));a>=x.hour&&b.set("Hours",c,a>=x.day?0:w*Math.floor(b.get("Hours",c)/w));a>=x.day&&b.set("Date",c,a>=x.month?1:Math.max(1,w*Math.floor(b.get("Date",c)/w)));if(a>=x.month){b.set("Month",c,a>=x.year?0:w*Math.floor(b.get("Month",
|
||||
c)/w));var v=b.get("FullYear",c)}a>=x.year&&b.set("FullYear",c,v-v%w);a===x.week&&(v=b.get("Day",c),b.set("Date",c,b.get("Date",c)-v+e+(v<e?-7:0)));v=b.get("FullYear",c);e=b.get("Month",c);var k=b.get("Date",c),h=b.get("Hours",c);l=c.getTime();b.variableTimezone&&(E=q-l>4*x.month||b.getTimezoneOffset(l)!==b.getTimezoneOffset(q));l=c.getTime();for(c=1;l<q;)g.push(l),l=a===x.year?b.makeTime(v+c*w,0):a===x.month?b.makeTime(v,e+c*w):!E||a!==x.day&&a!==x.week?E&&a===x.hour&&1<w?b.makeTime(v,e,k,h+c*w):
|
||||
l+a*w:b.makeTime(v,e,k+c*w*(a===x.day?1:7)),c++;g.push(l);a<=x.hour&&1E4>g.length&&g.forEach(function(a){0===a%18E5&&"000000000"===b.dateFormat("%H%M%S%L",a)&&(p[a]="day")})}g.info=F(n,{higherRanks:p,totalRange:a*w});return g};u.defaultOptions={Date:void 0,getTimezoneOffset:void 0,timezone:void 0,timezoneOffset:0,useUTC:!0};return u}();f.Time=m;return f.Time});P(y,"parts/Options.js",[y["parts/Globals.js"],y["parts/Time.js"],y["parts/Color.js"],y["parts/Utilities.js"]],function(f,m,I,r){I=I.parse;
|
||||
var F=r.merge;f.defaultOptions={colors:"#7cb5ec #434348 #90ed7d #f7a35c #8085e9 #f15c80 #e4d354 #2b908f #f45b5b #91e8e1".split(" "),symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",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(" "),weekdays:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),decimalPoint:".",numericSymbols:"kMGTPE".split(""),
|
||||
resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",thousandsSep:" "},global:{},time:m.defaultOptions,chart:{styledMode:!1,borderRadius:0,colorCount:10,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}},width:null,height:null,borderColor:"#335cad",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},
|
||||
caption:{margin:15,text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",alignColumns:!0,layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"12px",fontWeight:"bold",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#cccccc"},
|
||||
shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:f.svg,borderRadius:3,dateTimeLabelFormats:{millisecond:"%A, %b %e, %H:%M:%S.%L",second:"%A, %b %e, %H:%M:%S",minute:"%A, %b %e, %H:%M",hour:"%A, %b %e, %H:%M",
|
||||
day:"%A, %b %e, %Y",week:"Week from %A, %b %e, %Y",month:"%B %Y",year:"%Y"},footerFormat:"",padding:8,snap:f.isTouchDevice?25:10,headerFormat:'<span style="font-size: 10px">{point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:I("#f7f7f7").setOpacity(.85).get(),borderWidth:1,shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"https://www.highcharts.com?credits",
|
||||
position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};f.setOptions=function(m){f.defaultOptions=F(!0,f.defaultOptions,m);(m.time||m.global)&&f.time.update(F(f.defaultOptions.global,f.defaultOptions.time,m.global,m.time));return f.defaultOptions};f.getOptions=function(){return f.defaultOptions};f.defaultPlotOptions=f.defaultOptions.plotOptions;f.time=new m(F(f.defaultOptions.global,f.defaultOptions.time));f.dateFormat=
|
||||
function(m,r,B){return f.time.dateFormat(m,r,B)};""});P(y,"parts/Axis.js",[y["parts/Globals.js"],y["parts/Color.js"],y["parts/Tick.js"],y["parts/Utilities.js"]],function(f,m,I,r){var F=m.parse,N=r.addEvent,G=r.animObject,B=r.arrayMax,D=r.arrayMin,K=r.clamp,z=r.correctFloat,x=r.defined,A=r.destroyObjectProperties,u=r.error,n=r.extend,l=r.fireEvent,q=r.format,e=r.getMagnitude,b=r.isArray,g=r.isFunction,p=r.isNumber,c=r.isString,a=r.merge,w=r.normalizeTickInterval,E=r.objectEach,v=r.pick,k=r.relativeLength,
|
||||
h=r.removeEvent,t=r.splat,L=r.syncTimeout,M=f.defaultOptions,Q=f.deg2rad;m=function(){this.init.apply(this,arguments)};n(m.prototype,{defaultOptions:{dateTimeLabelFormats:{millisecond:{main:"%H:%M:%S.%L",range:!1},second:{main:"%H:%M:%S",range:!1},minute:{main:"%H:%M",range:!1},hour:{main:"%H:%M",range:!1},day:{main:"%e. %b"},week:{main:"%e. %b"},month:{main:"%b '%y"},year:{main:"%Y"}},endOnTick:!1,labels:{enabled:!0,indentation:10,x:0,style:{color:"#666666",cursor:"default",fontSize:"11px"}},maxPadding:.01,
|
||||
minorTickLength:2,minorTickPosition:"outside",minPadding:.01,showEmpty:!0,startOfWeek:1,startOnTick:!1,tickLength:10,tickPixelInterval:100,tickmarkPlacement:"between",tickPosition:"outside",title:{align:"middle",style:{color:"#666666"}},type:"linear",minorGridLineColor:"#f2f2f2",minorGridLineWidth:1,minorTickColor:"#999999",lineColor:"#ccd6eb",lineWidth:1,gridLineColor:"#e6e6e6",tickColor:"#ccd6eb"},defaultYAxisOptions:{endOnTick:!0,maxPadding:.05,minPadding:.05,tickPixelInterval:72,showLastLabel:!0,
|
||||
labels:{x:-8},startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{allowOverlap:!1,enabled:!1,crop:!0,overflow:"justify",formatter:function(){var a=this.axis.chart.numberFormatter;return a(this.total,-1)},style:{color:"#000000",fontSize:"11px",fontWeight:"bold",textOutline:"1px contrast"}},gridLineWidth:1,lineWidth:0},defaultLeftAxisOptions:{labels:{x:-15},title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],
|
||||
x:0},margin:15,title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},margin:15,title:{rotation:0}},init:function(a,d){var c=d.isX,b=this;b.chart=a;b.horiz=a.inverted&&!b.isZAxis?!c:c;b.isXAxis=c;b.coll=b.coll||(c?"xAxis":"yAxis");l(this,"init",{userOptions:d});b.opposite=d.opposite;b.side=d.side||(b.horiz?b.opposite?0:2:b.opposite?1:3);b.setOptions(d);var h=this.options,e=h.type;b.labelFormatter=h.labels.formatter||b.defaultLabelFormatter;b.userOptions=d;b.minPixelPadding=0;b.reversed=
|
||||
h.reversed;b.visible=!1!==h.visible;b.zoomEnabled=!1!==h.zoomEnabled;b.hasNames="category"===e||!0===h.categories;b.categories=h.categories||b.hasNames;b.names||(b.names=[],b.names.keys={});b.plotLinesAndBandsGroups={};b.isLog="logarithmic"===e;b.isDatetimeAxis="datetime"===e;b.positiveValuesOnly=b.isLog&&!b.allowNegativeLog;b.isLinked=x(h.linkedTo);b.ticks={};b.labelEdge=[];b.minorTicks={};b.plotLinesAndBands=[];b.alternateBands={};b.len=0;b.minRange=b.userMinRange=h.minRange||h.maxZoom;b.range=
|
||||
h.range;b.offset=h.offset||0;b.stacks={};b.oldStacks={};b.stacksTouched=0;b.max=null;b.min=null;b.crosshair=v(h.crosshair,t(a.options.tooltip.crosshairs)[c?0:1],!1);d=b.options.events;-1===a.axes.indexOf(b)&&(c?a.axes.splice(a.xAxis.length,0,b):a.axes.push(b),a[b.coll].push(b));b.series=b.series||[];a.inverted&&!b.isZAxis&&c&&"undefined"===typeof b.reversed&&(b.reversed=!0);E(d,function(d,a){g(d)&&N(b,a,d)});b.lin2log=h.linearToLogConverter||b.lin2log;b.isLog&&(b.val2lin=b.log2lin,b.lin2val=b.lin2log);
|
||||
l(this,"afterInit")},setOptions:function(c){this.options=a(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],a(M[this.coll],c));l(this,"afterSetOptions",{userOptions:c})},defaultLabelFormatter:function(){var a=this.axis,d=this.value,c=a.chart.time,b=a.categories,h=this.dateTimeLabelFormat,e=M.lang,k=e.numericSymbols;e=e.numericSymbolMagnitude||1E3;var g=k&&
|
||||
k.length,p=a.options.labels.format;a=a.isLog?Math.abs(d):a.tickInterval;var t=this.chart,w=t.numberFormatter;if(p)var v=q(p,this,t);else if(b)v=d;else if(h)v=c.dateFormat(h,d);else if(g&&1E3<=a)for(;g--&&"undefined"===typeof v;)c=Math.pow(e,g+1),a>=c&&0===10*d%c&&null!==k[g]&&0!==d&&(v=w(d/c,-1)+k[g]);"undefined"===typeof v&&(v=1E4<=Math.abs(d)?w(d,-1):w(d,-1,void 0,""));return v},getSeriesExtremes:function(){var a=this,d=a.chart,c;l(this,"getSeriesExtremes",null,function(){a.hasVisibleSeries=!1;
|
||||
a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();a.series.forEach(function(b){if(b.visible||!d.options.chart.ignoreHiddenSeries){var h=b.options,e=h.threshold;a.hasVisibleSeries=!0;a.positiveValuesOnly&&0>=e&&(e=null);if(a.isXAxis){if(h=b.xData,h.length){c=b.getXExtremes(h);var k=c.min;var g=c.max;p(k)||k instanceof Date||(h=h.filter(p),c=b.getXExtremes(h),k=c.min,g=c.max);h.length&&(a.dataMin=Math.min(v(a.dataMin,k),k),a.dataMax=Math.max(v(a.dataMax,
|
||||
g),g))}}else if(b.getExtremes(),g=b.dataMax,k=b.dataMin,x(k)&&x(g)&&(a.dataMin=Math.min(v(a.dataMin,k),k),a.dataMax=Math.max(v(a.dataMax,g),g)),x(e)&&(a.threshold=e),!h.softThreshold||a.positiveValuesOnly)a.softThreshold=!1}})});l(this,"afterGetSeriesExtremes")},translate:function(a,d,c,b,h,e){var k=this.linkedParent||this,g=1,C=0,J=b?k.oldTransA:k.transA;b=b?k.oldMin:k.min;var t=k.minPixelPadding;h=(k.isOrdinal||k.isBroken||k.isLog&&h)&&k.lin2val;J||(J=k.transA);c&&(g*=-1,C=k.len);k.reversed&&(g*=
|
||||
-1,C-=g*(k.sector||k.len));d?(a=(a*g+C-t)/J+b,h&&(a=k.lin2val(a))):(h&&(a=k.val2lin(a)),a=p(b)?g*(a-b)*J+C+g*t+(p(e)?J*e:0):void 0);return a},toPixels:function(a,d){return this.translate(a,!1,!this.horiz,null,!0)+(d?0:this.pos)},toValue:function(a,d){return this.translate(a-(d?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a){var d=this,c=d.chart,b=d.left,h=d.top,e=a.old,k=a.value,g=a.translatedValue,C=a.lineWidth,t=a.force,w,E,n,L,q=e&&c.oldChartHeight||c.chartHeight,f=e&&c.oldChartWidth||
|
||||
c.chartWidth,M,u=d.transB,x=function(d,a,c){if("pass"!==t&&d<a||d>c)t?d=K(d,a,c):M=!0;return d};a={value:k,lineWidth:C,old:e,force:t,acrossPanes:a.acrossPanes,translatedValue:g};l(this,"getPlotLinePath",a,function(a){g=v(g,d.translate(k,null,null,e));g=K(g,-1E5,1E5);w=n=Math.round(g+u);E=L=Math.round(q-g-u);p(g)?d.horiz?(E=h,L=q-d.bottom,w=n=x(w,b,b+d.width)):(w=b,n=f-d.right,E=L=x(E,h,h+d.height)):(M=!0,t=!1);a.path=M&&!t?null:c.renderer.crispLine(["M",w,E,"L",n,L],C||1)});return a.path},getLinearTickPositions:function(a,
|
||||
d,c){var b=z(Math.floor(d/a)*a);c=z(Math.ceil(c/a)*a);var h=[],e;z(b+a)===b&&(e=20);if(this.single)return[d];for(d=b;d<=c;){h.push(d);d=z(d+a,e);if(d===k)break;var k=d}return h},getMinorTickInterval:function(){var a=this.options;return!0===a.minorTicks?v(a.minorTickInterval,"auto"):!1===a.minorTicks?null:a.minorTickInterval},getMinorTickPositions:function(){var a=this,d=a.options,c=a.tickPositions,b=a.minorTickInterval,h=[],e=a.pointRangePadding||0,k=a.min-e;e=a.max+e;var g=e-k;if(g&&g/b<a.len/3)if(a.isLog)this.paddedTicks.forEach(function(d,
|
||||
c,e){c&&h.push.apply(h,a.getLogTickPositions(b,e[c-1],e[c],!0))});else if(a.isDatetimeAxis&&"auto"===this.getMinorTickInterval())h=h.concat(a.getTimeTicks(a.normalizeTimeTickInterval(b),k,e,d.startOfWeek));else for(d=k+(c[0]-k)%b;d<=e&&d!==h[0];d+=b)h.push(d);0!==h.length&&a.trimTicks(h);return h},adjustForMinRange:function(){var a=this.options,d=this.min,c=this.max,b,h,e,k,g;this.isXAxis&&"undefined"===typeof this.minRange&&!this.isLog&&(x(a.min)||x(a.max)?this.minRange=null:(this.series.forEach(function(d){k=
|
||||
d.xData;for(h=g=d.xIncrement?1:k.length-1;0<h;h--)if(e=k[h]-k[h-1],"undefined"===typeof b||e<b)b=e}),this.minRange=Math.min(5*b,this.dataMax-this.dataMin)));if(c-d<this.minRange){var t=this.dataMax-this.dataMin>=this.minRange;var p=this.minRange;var w=(p-c+d)/2;w=[d-w,v(a.min,d-w)];t&&(w[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin);d=B(w);c=[d+p,v(a.max,d+p)];t&&(c[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax);c=D(c);c-d<p&&(w[0]=c-p,w[1]=v(a.min,c-p),d=B(w))}this.min=d;this.max=
|
||||
c},getClosest:function(){var a;this.categories?a=1:this.series.forEach(function(d){var c=d.closestPointRange,b=d.visible||!d.chart.options.chart.ignoreHiddenSeries;!d.noSharedTooltip&&x(c)&&b&&(a=x(a)?Math.min(a,c):c)});return a},nameToX:function(a){var d=b(this.categories),c=d?this.categories:this.names,h=a.options.x;a.series.requireSorting=!1;x(h)||(h=!1===this.options.uniqueNames?a.series.autoIncrement():d?c.indexOf(a.name):v(c.keys[a.name],-1));if(-1===h){if(!d)var e=c.length}else e=h;"undefined"!==
|
||||
typeof e&&(this.names[e]=a.name,this.names.keys[a.name]=e);return e},updateNames:function(){var a=this,d=this.names;0<d.length&&(Object.keys(d.keys).forEach(function(a){delete d.keys[a]}),d.length=0,this.minRange=this.userMinRange,(this.series||[]).forEach(function(d){d.xIncrement=null;if(!d.points||d.isDirtyData)a.max=Math.max(a.max,d.xData.length-1),d.processData(),d.generatePoints();d.data.forEach(function(c,b){if(c&&c.options&&"undefined"!==typeof c.name){var h=a.nameToX(c);"undefined"!==typeof h&&
|
||||
h!==c.x&&(c.x=h,d.xData[b]=h)}})}))},setAxisTranslation:function(a){var d=this,b=d.max-d.min,h=d.axisPointRange||0,e=0,k=0,g=d.linkedParent,C=!!d.categories,p=d.transA,t=d.isXAxis;if(t||C||h){var w=d.getClosest();g?(e=g.minPointOffset,k=g.pointRangePadding):d.series.forEach(function(a){var b=C?1:t?v(a.options.pointRange,w,0):d.axisPointRange||0,g=a.options.pointPlacement;h=Math.max(h,b);if(!d.single||C)a=a.is("xrange")?!t:t,e=Math.max(e,a&&c(g)?0:b/2),k=Math.max(k,a&&"on"===g?0:b)});g=d.ordinalSlope&&
|
||||
w?d.ordinalSlope/w:1;d.minPointOffset=e*=g;d.pointRangePadding=k*=g;d.pointRange=Math.min(h,d.single&&C?1:b);t&&(d.closestPointRange=w)}a&&(d.oldTransA=p);d.translationSlope=d.transA=p=d.staticScale||d.len/(b+k||1);d.transB=d.horiz?d.left:d.bottom;d.minPixelPadding=p*e;l(this,"afterSetAxisTranslation")},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var d=this,c=d.chart,b=d.options,h=d.isLog,k=d.isDatetimeAxis,g=d.isXAxis,C=d.isLinked,t=b.maxPadding,E=b.minPadding,
|
||||
n=b.tickInterval,L=b.tickPixelInterval,q=d.categories,f=p(d.threshold)?d.threshold:null,M=d.softThreshold;k||q||C||this.getTickAmount();var Q=v(d.userMin,b.min);var m=v(d.userMax,b.max);if(C){d.linkedParent=c[d.coll][b.linkedTo];var A=d.linkedParent.getExtremes();d.min=v(A.min,A.dataMin);d.max=v(A.max,A.dataMax);b.type!==d.linkedParent.options.type&&u(11,1,c)}else{if(!M&&x(f))if(d.dataMin>=f)A=f,E=0;else if(d.dataMax<=f){var r=f;t=0}d.min=v(Q,A,d.dataMin);d.max=v(m,r,d.dataMax)}h&&(d.positiveValuesOnly&&
|
||||
!a&&0>=Math.min(d.min,v(d.dataMin,d.min))&&u(10,1,c),d.min=z(d.log2lin(d.min),16),d.max=z(d.log2lin(d.max),16));d.range&&x(d.max)&&(d.userMin=d.min=Q=Math.max(d.dataMin,d.minFromRange()),d.userMax=m=d.max,d.range=null);l(d,"foundExtremes");d.beforePadding&&d.beforePadding();d.adjustForMinRange();!(q||d.axisPointRange||d.usePercentage||C)&&x(d.min)&&x(d.max)&&(c=d.max-d.min)&&(!x(Q)&&E&&(d.min-=c*E),!x(m)&&t&&(d.max+=c*t));p(d.userMin)||(p(b.softMin)&&b.softMin<d.min&&(d.min=Q=b.softMin),p(b.floor)&&
|
||||
(d.min=Math.max(d.min,b.floor)));p(d.userMax)||(p(b.softMax)&&b.softMax>d.max&&(d.max=m=b.softMax),p(b.ceiling)&&(d.max=Math.min(d.max,b.ceiling)));M&&x(d.dataMin)&&(f=f||0,!x(Q)&&d.min<f&&d.dataMin>=f?d.min=d.options.minRange?Math.min(f,d.max-d.minRange):f:!x(m)&&d.max>f&&d.dataMax<=f&&(d.max=d.options.minRange?Math.max(f,d.min+d.minRange):f));d.tickInterval=d.min===d.max||"undefined"===typeof d.min||"undefined"===typeof d.max?1:C&&!n&&L===d.linkedParent.options.tickPixelInterval?n=d.linkedParent.tickInterval:
|
||||
v(n,this.tickAmount?(d.max-d.min)/Math.max(this.tickAmount-1,1):void 0,q?1:(d.max-d.min)*L/Math.max(d.len,L));g&&!a&&d.series.forEach(function(a){a.processData(d.min!==d.oldMin||d.max!==d.oldMax)});d.setAxisTranslation(!0);d.beforeSetTickPositions&&d.beforeSetTickPositions();d.postProcessTickInterval&&(d.tickInterval=d.postProcessTickInterval(d.tickInterval));d.pointRange&&!n&&(d.tickInterval=Math.max(d.pointRange,d.tickInterval));a=v(b.minTickInterval,d.isDatetimeAxis&&d.closestPointRange);!n&&d.tickInterval<
|
||||
a&&(d.tickInterval=a);k||h||n||(d.tickInterval=w(d.tickInterval,null,e(d.tickInterval),v(b.allowDecimals,!(.5<d.tickInterval&&5>d.tickInterval&&1E3<d.max&&9999>d.max)),!!this.tickAmount));this.tickAmount||(d.tickInterval=d.unsquish());this.setTickPositions()},setTickPositions:function(){var a=this.options,d=a.tickPositions;var c=this.getMinorTickInterval();var b=a.tickPositioner,h=a.startOnTick,e=a.endOnTick;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?
|
||||
.5:0;this.minorTickInterval="auto"===c&&this.tickInterval?this.tickInterval/5:c;this.single=this.min===this.max&&x(this.min)&&!this.tickAmount&&(parseInt(this.min,10)===this.min||!1!==a.allowDecimals);this.tickPositions=c=d&&d.slice();!c&&(!this.ordinalPositions&&(this.max-this.min)/this.tickInterval>Math.max(2*this.len,200)?(c=[this.min,this.max],u(19,!1,this.chart)):c=this.isDatetimeAxis?this.getTimeTicks(this.normalizeTimeTickInterval(this.tickInterval,a.units),this.min,this.max,a.startOfWeek,
|
||||
this.ordinalPositions,this.closestPointRange,!0):this.isLog?this.getLogTickPositions(this.tickInterval,this.min,this.max):this.getLinearTickPositions(this.tickInterval,this.min,this.max),c.length>this.len&&(c=[c[0],c.pop()],c[0]===c[1]&&(c.length=1)),this.tickPositions=c,b&&(b=b.apply(this,[this.min,this.max])))&&(this.tickPositions=c=b);this.paddedTicks=c.slice(0);this.trimTicks(c,h,e);this.isLinked||(this.single&&2>c.length&&!this.categories&&!this.series.some(function(d){return d.is("heatmap")&&
|
||||
"between"===d.options.pointPlacement})&&(this.min-=.5,this.max+=.5),d||b||this.adjustTickAmount());l(this,"afterSetTickPositions")},trimTicks:function(a,d,c){var b=a[0],h=a[a.length-1],e=!this.isOrdinal&&this.minPointOffset||0;l(this,"trimTicks");if(!this.isLinked){if(d&&-Infinity!==b)this.min=b;else for(;this.min-e>a[0];)a.shift();if(c)this.max=h;else for(;this.max+e<a[a.length-1];)a.pop();0===a.length&&x(b)&&!this.options.tickPositions&&a.push((h+b)/2)}},alignToOthers:function(){var a={},d,c=this.options;
|
||||
!1===this.chart.options.chart.alignTicks||!1===c.alignTicks||!1===c.startOnTick||!1===c.endOnTick||this.isLog||this.chart[this.coll].forEach(function(c){var b=c.options;b=[c.horiz?b.left:b.top,b.width,b.height,b.pane].join();c.series.length&&(a[b]?d=!0:a[b]=1)});return d},getTickAmount:function(){var a=this.options,d=a.tickAmount,c=a.tickPixelInterval;!x(a.tickInterval)&&this.len<c&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(d=2);!d&&this.alignToOthers()&&(d=Math.ceil(this.len/c)+1);
|
||||
4>d&&(this.finalTickAmt=d,d=5);this.tickAmount=d},adjustTickAmount:function(){var a=this.options,d=this.tickInterval,c=this.tickPositions,b=this.tickAmount,h=this.finalTickAmt,e=c&&c.length,k=v(this.threshold,this.softThreshold?0:null),g;if(this.hasData()){if(e<b){for(g=this.min;c.length<b;)c.length%2||g===k?c.push(z(c[c.length-1]+d)):c.unshift(z(c[0]-d));this.transA*=(e-1)/(b-1);this.min=a.startOnTick?c[0]:Math.min(this.min,c[0]);this.max=a.endOnTick?c[c.length-1]:Math.max(this.max,c[c.length-1])}else e>
|
||||
b&&(this.tickInterval*=2,this.setTickPositions());if(x(h)){for(d=a=c.length;d--;)(3===h&&1===d%2||2>=h&&0<d&&d<a-1)&&c.splice(d,1);this.finalTickAmt=void 0}}},setScale:function(){var a=this.series.some(function(d){return d.isDirtyData||d.isDirty||d.xAxis&&d.xAxis.isDirty}),d;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();(d=this.len!==this.oldAxisLength)||a||this.isLinked||this.forceRedraw||this.userMin!==this.oldUserMin||this.userMax!==this.oldUserMax||this.alignToOthers()?
|
||||
(this.resetStacks&&this.resetStacks(),this.forceRedraw=!1,this.getSeriesExtremes(),this.setTickInterval(),this.oldUserMin=this.userMin,this.oldUserMax=this.userMax,this.isDirty||(this.isDirty=d||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks();l(this,"afterSetScale")},setExtremes:function(a,d,c,b,h){var e=this,k=e.chart;c=v(c,!0);e.series.forEach(function(d){delete d.kdTree});h=n(h,{min:a,max:d});l(e,"setExtremes",h,function(){e.userMin=a;e.userMax=d;e.eventArgs=
|
||||
h;c&&k.redraw(b)})},zoom:function(a,d){var c=this.dataMin,b=this.dataMax,h=this.options,e=Math.min(c,v(h.min,c)),k=Math.max(b,v(h.max,b));a={newMin:a,newMax:d};l(this,"zoom",a,function(d){var a=d.newMin,h=d.newMax;if(a!==this.min||h!==this.max)this.allowZoomOutside||(x(c)&&(a<e&&(a=e),a>k&&(a=k)),x(b)&&(h<e&&(h=e),h>k&&(h=k))),this.displayBtn="undefined"!==typeof a||"undefined"!==typeof h,this.setExtremes(a,h,!1,void 0,{trigger:"zoom"});d.zoomed=!0});return a.zoomed},setAxisSize:function(){var a=
|
||||
this.chart,d=this.options,c=d.offsets||[0,0,0,0],b=this.horiz,h=this.width=Math.round(k(v(d.width,a.plotWidth-c[3]+c[1]),a.plotWidth)),e=this.height=Math.round(k(v(d.height,a.plotHeight-c[0]+c[2]),a.plotHeight)),g=this.top=Math.round(k(v(d.top,a.plotTop+c[0]),a.plotHeight,a.plotTop));d=this.left=Math.round(k(v(d.left,a.plotLeft+c[3]),a.plotWidth,a.plotLeft));this.bottom=a.chartHeight-e-g;this.right=a.chartWidth-h-d;this.len=Math.max(b?h:e,0);this.pos=b?d:g},getExtremes:function(){var a=this.isLog;
|
||||
return{min:a?z(this.lin2log(this.min)):this.min,max:a?z(this.lin2log(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var d=this.isLog,c=d?this.lin2log(this.min):this.min;d=d?this.lin2log(this.max):this.max;null===a||-Infinity===a?a=c:Infinity===a?a=d:c>a?a=c:d<a&&(a=d);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){var d=(v(a,0)-90*this.side+720)%360;a={align:"center"};l(this,"autoLabelAlign",a,function(a){15<
|
||||
d&&165>d?a.align="right":195<d&&345>d&&(a.align="left")});return a.align},tickSize:function(a){var d=this.options,c=d[a+"Length"],b=v(d[a+"Width"],"tick"===a&&this.isXAxis&&!this.categories?1:0);if(b&&c){"inside"===d[a+"Position"]&&(c=-c);var h=[c,b]}a={tickSize:h};l(this,"afterTickSize",a);return a.tickSize},labelMetrics:function(){var a=this.tickPositions&&this.tickPositions[0]||0;return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[a]&&
|
||||
this.ticks[a].label)},unsquish:function(){var a=this.options.labels,d=this.horiz,c=this.tickInterval,b=c,h=this.len/(((this.categories?1:0)+this.max-this.min)/c),e,k=a.rotation,g=this.labelMetrics(),t,p=Number.MAX_VALUE,w,l=this.max-this.min,E=function(d){var a=d/(h||1);a=1<a?Math.ceil(a):1;a*c>l&&Infinity!==d&&Infinity!==h&&l&&(a=Math.ceil(l/c));return z(a*c)};d?(w=!a.staggerLines&&!a.step&&(x(k)?[k]:h<v(a.autoRotationLimit,80)&&a.autoRotation))&&w.forEach(function(d){if(d===k||d&&-90<=d&&90>=d){t=
|
||||
E(Math.abs(g.h/Math.sin(Q*d)));var a=t+Math.abs(d/360);a<p&&(p=a,e=d,b=t)}}):a.step||(b=E(g.h));this.autoRotation=w;this.labelRotation=v(e,k);return b},getSlotWidth:function(a){var d=this.chart,c=this.horiz,b=this.options.labels,h=Math.max(this.tickPositions.length-(this.categories?0:1),1),e=d.margin[3];return a&&a.slotWidth||c&&2>(b.step||0)&&!b.rotation&&(this.staggerLines||1)*this.len/h||!c&&(b.style&&parseInt(b.style.width,10)||e&&e-d.spacing[3]||.33*d.chartWidth)},renderUnsquish:function(){var a=
|
||||
this.chart,d=a.renderer,b=this.tickPositions,h=this.ticks,e=this.options.labels,k=e&&e.style||{},g=this.horiz,t=this.getSlotWidth(),p=Math.max(1,Math.round(t-2*(e.padding||5))),w={},v=this.labelMetrics(),l=e.style&&e.style.textOverflow,E=0;c(e.rotation)||(w.rotation=e.rotation||0);b.forEach(function(d){d=h[d];d.movedLabel&&d.replaceMovedLabel();d&&d.label&&d.label.textPxLength>E&&(E=d.label.textPxLength)});this.maxLabelLength=E;if(this.autoRotation)E>p&&E>v.h?w.rotation=this.labelRotation:this.labelRotation=
|
||||
0;else if(t){var n=p;if(!l){var L="clip";for(p=b.length;!g&&p--;){var q=b[p];if(q=h[q].label)q.styles&&"ellipsis"===q.styles.textOverflow?q.css({textOverflow:"clip"}):q.textPxLength>t&&q.css({width:t+"px"}),q.getBBox().height>this.len/b.length-(v.h-v.f)&&(q.specificTextOverflow="ellipsis")}}}w.rotation&&(n=E>.5*a.chartHeight?.33*a.chartHeight:E,l||(L="ellipsis"));if(this.labelAlign=e.align||this.autoLabelAlign(this.labelRotation))w.align=this.labelAlign;b.forEach(function(d){var a=(d=h[d])&&d.label,
|
||||
c=k.width,b={};a&&(a.attr(w),d.shortenLabel?d.shortenLabel():n&&!c&&"nowrap"!==k.whiteSpace&&(n<a.textPxLength||"SPAN"===a.element.tagName)?(b.width=n,l||(b.textOverflow=a.specificTextOverflow||L),a.css(b)):a.styles&&a.styles.width&&!b.width&&!c&&a.css({width:null}),delete a.specificTextOverflow,d.rotation=w.rotation)},this);this.tickRotCorr=d.rotCorr(v.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.series.some(function(a){return a.hasData()})||this.options.showEmpty&&x(this.min)&&
|
||||
x(this.max)},addTitle:function(c){var d=this.chart.renderer,b=this.horiz,h=this.opposite,e=this.options.title,k,g=this.chart.styledMode;this.axisTitle||((k=e.textAlign)||(k=(b?{low:"left",middle:"center",high:"right"}:{low:h?"right":"left",middle:"center",high:h?"left":"right"})[e.align]),this.axisTitle=d.text(e.text,0,0,e.useHTML).attr({zIndex:7,rotation:e.rotation||0,align:k}).addClass("highcharts-axis-title"),g||this.axisTitle.css(a(e.style)),this.axisTitle.add(this.axisGroup),this.axisTitle.isNew=
|
||||
!0);g||e.style.width||this.isRadial||this.axisTitle.css({width:this.len});this.axisTitle[c?"show":"hide"](c)},generateTick:function(a){var d=this.ticks;d[a]?d[a].addLabel():d[a]=new I(this,a)},getOffset:function(){var a=this,d=a.chart,c=d.renderer,b=a.options,h=a.tickPositions,e=a.ticks,k=a.horiz,g=a.side,t=d.inverted&&!a.isZAxis?[1,0,3,2][g]:g,p,w=0,n=0,L=b.title,q=b.labels,f=0,M=d.axisOffset;d=d.clipOffset;var u=[-1,1,1,-1][g],Q=b.className,z=a.axisParent;var m=a.hasData();a.showAxis=p=m||v(b.showEmpty,
|
||||
!0);a.staggerLines=a.horiz&&q.staggerLines;a.axisGroup||(a.gridGroup=c.g("grid").attr({zIndex:b.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(Q||"")).add(z),a.axisGroup=c.g("axis").attr({zIndex:b.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(Q||"")).add(z),a.labelGroup=c.g("axis-labels").attr({zIndex:q.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(Q||"")).add(z));m||a.isLinked?(h.forEach(function(d,c){a.generateTick(d,c)}),a.renderUnsquish(),
|
||||
a.reserveSpaceDefault=0===g||2===g||{1:"left",3:"right"}[g]===a.labelAlign,v(q.reserveSpace,"center"===a.labelAlign?!0:null,a.reserveSpaceDefault)&&h.forEach(function(d){f=Math.max(e[d].getLabelSize(),f)}),a.staggerLines&&(f*=a.staggerLines),a.labelOffset=f*(a.opposite?-1:1)):E(e,function(d,a){d.destroy();delete e[a]});if(L&&L.text&&!1!==L.enabled&&(a.addTitle(p),p&&!1!==L.reserveSpace)){a.titleOffset=w=a.axisTitle.getBBox()[k?"height":"width"];var A=L.offset;n=x(A)?0:v(L.margin,k?5:10)}a.renderLine();
|
||||
a.offset=u*v(b.offset,M[g]?M[g]+(b.margin||0):0);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};c=0===g?-a.labelMetrics().h:2===g?a.tickRotCorr.y:0;n=Math.abs(f)+n;f&&(n=n-c+u*(k?v(q.y,a.tickRotCorr.y+8*u):q.x));a.axisTitleMargin=v(A,n);a.getMaxLabelDimensions&&(a.maxLabelDimensions=a.getMaxLabelDimensions(e,h));k=this.tickSize("tick");M[g]=Math.max(M[g],a.axisTitleMargin+w+u*a.offset,n,h&&h.length&&k?k[0]+u*a.offset:0);b=b.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);d[t]=Math.max(d[t],b);l(this,"afterGetOffset")},
|
||||
getLinePath:function(a){var d=this.chart,c=this.opposite,b=this.offset,h=this.horiz,e=this.left+(c?this.width:0)+b;b=d.chartHeight-this.bottom-(c?this.height:0)+b;c&&(a*=-1);return d.renderer.crispLine(["M",h?this.left:e,h?b:this.top,"L",h?d.chartWidth-this.right:e,h?b:d.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.chart.styledMode||this.axisLine.attr({stroke:this.options.lineColor,
|
||||
"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,d=this.left,c=this.top,b=this.len,h=this.options.title,e=a?d:c,k=this.opposite,g=this.offset,t=h.x||0,p=h.y||0,w=this.axisTitle,v=this.chart.renderer.fontMetrics(h.style&&h.style.fontSize,w);w=Math.max(w.getBBox(null,0).height-v.h-1,0);b={low:e+(a?0:b),middle:e+b/2,high:e+(a?b:0)}[h.align];d=(a?c+this.height:d)+(a?1:-1)*(k?-1:1)*this.axisTitleMargin+[-w,w,v.f,-w][this.side];a={x:a?b+t:d+(k?this.width:0)+
|
||||
g+t,y:a?d+p-(k?this.height:0)+g:b+p};l(this,"afterGetTitlePosition",{titlePosition:a});return a},renderMinorTick:function(a){var d=this.chart.hasRendered&&p(this.oldMin),c=this.minorTicks;c[a]||(c[a]=new I(this,a,"minor"));d&&c[a].isNew&&c[a].render(null,!0);c[a].render(null,!1,1)},renderTick:function(a,d){var c=this.isLinked,b=this.ticks,h=this.chart.hasRendered&&p(this.oldMin);if(!c||a>=this.min&&a<=this.max)b[a]||(b[a]=new I(this,a)),h&&b[a].isNew&&b[a].render(d,!0,-1),b[a].render(d)},render:function(){var a=
|
||||
this,d=a.chart,c=a.options,b=a.isLog,h=a.isLinked,e=a.tickPositions,k=a.axisTitle,g=a.ticks,t=a.minorTicks,w=a.alternateBands,v=c.stackLabels,n=c.alternateGridColor,q=a.tickmarkOffset,M=a.axisLine,u=a.showAxis,x=G(d.renderer.globalAnimation),Q,z;a.labelEdge.length=0;a.overlap=!1;[g,t,w].forEach(function(d){E(d,function(d){d.isActive=!1})});if(a.hasData()||h)a.minorTickInterval&&!a.categories&&a.getMinorTickPositions().forEach(function(d){a.renderMinorTick(d)}),e.length&&(e.forEach(function(d,c){a.renderTick(d,
|
||||
c)}),q&&(0===a.min||a.single)&&(g[-1]||(g[-1]=new I(a,-1,null,!0)),g[-1].render(-1))),n&&e.forEach(function(c,h){z="undefined"!==typeof e[h+1]?e[h+1]+q:a.max-q;0===h%2&&c<a.max&&z<=a.max+(d.polar?-q:q)&&(w[c]||(w[c]=new f.PlotLineOrBand(a)),Q=c+q,w[c].options={from:b?a.lin2log(Q):Q,to:b?a.lin2log(z):z,color:n},w[c].render(),w[c].isActive=!0)}),a._addedPlotLB||((c.plotLines||[]).concat(c.plotBands||[]).forEach(function(d){a.addPlotBandOrLine(d)}),a._addedPlotLB=!0);[g,t,w].forEach(function(a){var c,
|
||||
b=[],h=x.duration;E(a,function(d,a){d.isActive||(d.render(a,!1,0),d.isActive=!1,b.push(a))});L(function(){for(c=b.length;c--;)a[b[c]]&&!a[b[c]].isActive&&(a[b[c]].destroy(),delete a[b[c]])},a!==w&&d.hasRendered&&h?h:0)});M&&(M[M.isPlaced?"animate":"attr"]({d:this.getLinePath(M.strokeWidth())}),M.isPlaced=!0,M[u?"show":"hide"](u));k&&u&&(c=a.getTitlePosition(),p(c.y)?(k[k.isNew?"attr":"animate"](c),k.isNew=!1):(k.attr("y",-9999),k.isNew=!0));v&&v.enabled&&a.renderStackTotals();a.isDirty=!1;l(this,
|
||||
"afterRender")},redraw:function(){this.visible&&(this.render(),this.plotLinesAndBands.forEach(function(a){a.render()}));this.series.forEach(function(a){a.isDirty=!0})},keepProps:"extKey hcEvents names series userMax userMin".split(" "),destroy:function(a){var d=this,c=d.stacks,b=d.plotLinesAndBands,e;l(this,"destroy",{keepEvents:a});a||h(d);E(c,function(d,a){A(d);c[a]=null});[d.ticks,d.minorTicks,d.alternateBands].forEach(function(d){A(d)});if(b)for(a=b.length;a--;)b[a].destroy();"stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross scrollbar".split(" ").forEach(function(a){d[a]&&
|
||||
(d[a]=d[a].destroy())});for(e in d.plotLinesAndBandsGroups)d.plotLinesAndBandsGroups[e]=d.plotLinesAndBandsGroups[e].destroy();E(d,function(a,c){-1===d.keepProps.indexOf(c)&&delete d[c]})},drawCrosshair:function(a,d){var c=this.crosshair,b=v(c.snap,!0),h,e=this.cross,k=this.chart;l(this,"drawCrosshair",{e:a,point:d});a||(a=this.cross&&this.cross.e);if(this.crosshair&&!1!==(x(d)||!b)){b?x(d)&&(h=v("colorAxis"!==this.coll?d.crosshairPos:null,this.isXAxis?d.plotX:this.len-d.plotY)):h=a&&(this.horiz?
|
||||
a.chartX-this.pos:this.len-a.chartY+this.pos);if(x(h)){var g={value:d&&(this.isXAxis?d.x:v(d.stackY,d.y)),translatedValue:h};k.polar&&n(g,{isCrosshair:!0,chartX:a&&a.chartX,chartY:a&&a.chartY,point:d});g=this.getPlotLinePath(g)||null}if(!x(g)){this.hideCrosshair();return}b=this.categories&&!this.isRadial;e||(this.cross=e=k.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(b?"category ":"thin ")+c.className).attr({zIndex:v(c.zIndex,2)}).add(),k.styledMode||(e.attr({stroke:c.color||
|
||||
(b?F("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":v(c.width,1)}).css({"pointer-events":"none"}),c.dashStyle&&e.attr({dashstyle:c.dashStyle})));e.show().attr({d:g});b&&!c.width&&e.attr({"stroke-width":this.transA});this.cross.e=a}else this.hideCrosshair();l(this,"afterDrawCrosshair",{e:a,point:d})},hideCrosshair:function(){this.cross&&this.cross.hide();l(this,"afterHideCrosshair")}});return f.Axis=m});P(y,"parts/DateTimeAxis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,
|
||||
m){var I=m.getMagnitude,r=m.normalizeTickInterval,F=m.timeUnits;f=f.Axis;f.prototype.getTimeTicks=function(){return this.chart.time.getTimeTicks.apply(this.chart.time,arguments)};f.prototype.normalizeTimeTickInterval=function(f,m){var B=m||[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2]],["week",[1,2]],["month",[1,2,3,4,6]],["year",null]];m=B[B.length-1];var D=F[m[0]],G=m[1],z;for(z=0;z<B.length&&!(m=B[z],
|
||||
D=F[m[0]],G=m[1],B[z+1]&&f<=(D*G[G.length-1]+F[B[z+1][0]])/2);z++);D===F.year&&f<5*D&&(G=[1,2,5]);f=r(f/D,G,"year"===m[0]?Math.max(I(f/D),1):1);return{unitRange:D,count:f,unitName:m[0]}}});P(y,"parts/LogarithmicAxis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.getMagnitude,r=m.normalizeTickInterval,F=m.pick;f=f.Axis;f.prototype.getLogTickPositions=function(f,m,B,D){var G=this.options,z=this.len,x=[];D||(this._minorAutoInterval=null);if(.5<=f)f=Math.round(f),x=this.getLinearTickPositions(f,
|
||||
m,B);else if(.08<=f){z=Math.floor(m);var A,u;for(G=.3<f?[1,2,4]:.15<f?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];z<B+1&&!u;z++){var n=G.length;for(A=0;A<n&&!u;A++){var l=this.log2lin(this.lin2log(z)*G[A]);l>m&&(!D||q<=B)&&"undefined"!==typeof q&&x.push(q);q>B&&(u=!0);var q=l}}}else m=this.lin2log(m),B=this.lin2log(B),f=D?this.getMinorTickInterval():G.tickInterval,f=F("auto"===f?null:f,this._minorAutoInterval,G.tickPixelInterval/(D?5:1)*(B-m)/((D?z/this.tickPositions.length:z)||1)),f=r(f,null,I(f)),x=this.getLinearTickPositions(f,
|
||||
m,B).map(this.log2lin),D||(this._minorAutoInterval=f/5);D||(this.tickInterval=f);return x};f.prototype.log2lin=function(f){return Math.log(f)/Math.LN10};f.prototype.lin2log=function(f){return Math.pow(10,f)}});P(y,"parts/PlotLineOrBand.js",[y["parts/Globals.js"],y["parts/Axis.js"],y["parts/Utilities.js"]],function(f,m,I){var r=I.arrayMax,F=I.arrayMin,N=I.defined,G=I.destroyObjectProperties,B=I.erase,D=I.extend,K=I.merge,z=I.objectEach,x=I.pick,A=function(){function u(n,l){this.axis=n;l&&(this.options=
|
||||
l,this.id=l.id)}u.prototype.render=function(){f.fireEvent(this,"render");var n=this,l=n.axis,q=l.horiz,e=n.options,b=e.label,g=n.label,p=e.to,c=e.from,a=e.value,w=N(c)&&N(p),E=N(a),v=n.svgElem,k=!v,h=[],t=e.color,L=x(e.zIndex,0),M=e.events;h={"class":"highcharts-plot-"+(w?"band ":"line ")+(e.className||"")};var u={},C=l.chart.renderer,d=w?"bands":"lines";l.isLog&&(c=l.log2lin(c),p=l.log2lin(p),a=l.log2lin(a));l.chart.styledMode||(E?(h.stroke=t||"#999999",h["stroke-width"]=x(e.width,1),e.dashStyle&&
|
||||
(h.dashstyle=e.dashStyle)):w&&(h.fill=t||"#e6ebf5",e.borderWidth&&(h.stroke=e.borderColor,h["stroke-width"]=e.borderWidth)));u.zIndex=L;d+="-"+L;(t=l.plotLinesAndBandsGroups[d])||(l.plotLinesAndBandsGroups[d]=t=C.g("plot-"+d).attr(u).add());k&&(n.svgElem=v=C.path().attr(h).add(t));if(E)h=l.getPlotLinePath({value:a,lineWidth:v.strokeWidth(),acrossPanes:e.acrossPanes});else if(w)h=l.getPlotBandPath(c,p,e);else return;(k||!v.d)&&h&&h.length?(v.attr({d:h}),M&&z(M,function(d,a){v.on(a,function(d){M[a].apply(n,
|
||||
[d])})})):v&&(h?(v.show(!0),v.animate({d:h})):v.d&&(v.hide(),g&&(n.label=g=g.destroy())));b&&(N(b.text)||N(b.formatter))&&h&&h.length&&0<l.width&&0<l.height&&!h.isFlat?(b=K({align:q&&w&&"center",x:q?!w&&4:10,verticalAlign:!q&&w&&"middle",y:q?w?16:10:w?6:-4,rotation:q&&!w&&90},b),this.renderLabel(b,h,w,L)):g&&g.hide();return n};u.prototype.renderLabel=function(n,l,q,e){var b=this.label,g=this.axis.chart.renderer;b||(b={align:n.textAlign||n.align,rotation:n.rotation,"class":"highcharts-plot-"+(q?"band":
|
||||
"line")+"-label "+(n.className||"")},b.zIndex=e,e=this.getLabelText(n),this.label=b=g.text(e,0,0,n.useHTML).attr(b).add(),this.axis.chart.styledMode||b.css(n.style));g=l.xBounds||[l[1],l[4],q?l[6]:l[1]];l=l.yBounds||[l[2],l[5],q?l[7]:l[2]];q=F(g);e=F(l);b.align(n,!1,{x:q,y:e,width:r(g)-q,height:r(l)-e});b.show(!0)};u.prototype.getLabelText=function(n){return N(n.formatter)?n.formatter.call(this):n.text};u.prototype.destroy=function(){B(this.axis.plotLinesAndBands,this);delete this.axis;G(this)};return u}();
|
||||
D(m.prototype,{getPlotBandPath:function(f,n){var l=this.getPlotLinePath({value:n,force:!0,acrossPanes:this.options.acrossPanes}),q=this.getPlotLinePath({value:f,force:!0,acrossPanes:this.options.acrossPanes}),e=[],b=this.horiz,g=1;f=f<this.min&&n<this.min||f>this.max&&n>this.max;if(q&&l){if(f){var p=q.toString()===l.toString();g=0}for(f=0;f<q.length;f+=6)b&&l[f+1]===q[f+1]?(l[f+1]+=g,l[f+4]+=g):b||l[f+2]!==q[f+2]||(l[f+2]+=g,l[f+5]+=g),e.push("M",q[f+1],q[f+2],"L",q[f+4],q[f+5],l[f+4],l[f+5],l[f+
|
||||
1],l[f+2],"z"),e.isFlat=p}return e},addPlotBand:function(f){return this.addPlotBandOrLine(f,"plotBands")},addPlotLine:function(f){return this.addPlotBandOrLine(f,"plotLines")},addPlotBandOrLine:function(f,n){var l=(new A(this,f)).render(),q=this.userOptions;if(l){if(n){var e=q[n]||[];e.push(f);q[n]=e}this.plotLinesAndBands.push(l)}return l},removePlotBandOrLine:function(f){for(var n=this.plotLinesAndBands,l=this.options,q=this.userOptions,e=n.length;e--;)n[e].id===f&&n[e].destroy();[l.plotLines||
|
||||
[],q.plotLines||[],l.plotBands||[],q.plotBands||[]].forEach(function(b){for(e=b.length;e--;)b[e].id===f&&B(b,b[e])})},removePlotBand:function(f){this.removePlotBandOrLine(f)},removePlotLine:function(f){this.removePlotBandOrLine(f)}});f.PlotLineOrBand=A;return f.PlotLineOrBand});P(y,"parts/Tooltip.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.clamp,r=m.css,F=m.defined,N=m.discardElement,G=m.extend,B=m.format,D=m.isNumber,K=m.isString,z=m.merge,x=m.pick,A=m.splat,u=m.syncTimeout,
|
||||
n=m.timeUnits;"";var l=f.doc,q=function(){function e(b,e){this.chart=void 0;this.crosshairs=[];this.distance=0;this.isHidden=!0;this.isSticky=!1;this.now={};this.options={};this.outside=!1;this.init(b,e)}e.prototype.applyFilter=function(){var b=this.chart;b.renderer.definition({tagName:"filter",id:"drop-shadow-"+b.index,opacity:.5,children:[{tagName:"feGaussianBlur","in":"SourceAlpha",stdDeviation:1},{tagName:"feOffset",dx:1,dy:1},{tagName:"feComponentTransfer",children:[{tagName:"feFuncA",type:"linear",
|
||||
slope:.3}]},{tagName:"feMerge",children:[{tagName:"feMergeNode"},{tagName:"feMergeNode","in":"SourceGraphic"}]}]});b.renderer.definition({tagName:"style",textContent:".highcharts-tooltip-"+b.index+"{filter:url(#drop-shadow-"+b.index+")}"})};e.prototype.bodyFormatter=function(b){return b.map(function(b){var e=b.series.tooltipOptions;return(e[(b.point.formatPrefix||"point")+"Formatter"]||b.point.tooltipFormatter).call(b.point,e[(b.point.formatPrefix||"point")+"Format"]||"")})};e.prototype.cleanSplit=
|
||||
function(b){this.chart.series.forEach(function(e){var g=e&&e.tt;g&&(!g.isActive||b?e.tt=g.destroy():g.isActive=!1)})};e.prototype.defaultFormatter=function(b){var e=this.points||A(this);var p=[b.tooltipFooterHeaderFormatter(e[0])];p=p.concat(b.bodyFormatter(e));p.push(b.tooltipFooterHeaderFormatter(e[0],!0));return p};e.prototype.destroy=function(){this.label&&(this.label=this.label.destroy());this.split&&this.tt&&(this.cleanSplit(this.chart,!0),this.tt=this.tt.destroy());this.renderer&&(this.renderer=
|
||||
this.renderer.destroy(),N(this.container));m.clearTimeout(this.hideTimer);m.clearTimeout(this.tooltipTimeout)};e.prototype.getAnchor=function(b,e){var g=this.chart,c=g.pointer,a=g.inverted,w=g.plotTop,l=g.plotLeft,v=0,k=0,h,t;b=A(b);this.followPointer&&e?("undefined"===typeof e.chartX&&(e=c.normalize(e)),b=[e.chartX-g.plotLeft,e.chartY-w]):b[0].tooltipPos?b=b[0].tooltipPos:(b.forEach(function(c){h=c.series.yAxis;t=c.series.xAxis;v+=c.plotX+(!a&&t?t.left-l:0);k+=(c.plotLow?(c.plotLow+c.plotHigh)/2:
|
||||
c.plotY)+(!a&&h?h.top-w:0)}),v/=b.length,k/=b.length,b=[a?g.plotWidth-k:v,this.shared&&!a&&1<b.length&&e?e.chartY-w:a?g.plotHeight-v:k]);return b.map(Math.round)};e.prototype.getDateFormat=function(b,e,p,c){var a=this.chart.time,g=a.dateFormat("%m-%d %H:%M:%S.%L",e),l={millisecond:15,second:12,minute:9,hour:6,day:3},v="millisecond";for(k in n){if(b===n.week&&+a.dateFormat("%w",e)===p&&"00:00:00.000"===g.substr(6)){var k="week";break}if(n[k]>b){k=v;break}if(l[k]&&g.substr(l[k])!=="01-01 00:00:00.000".substr(l[k]))break;
|
||||
"week"!==k&&(v=k)}if(k)var h=a.resolveDTLFormat(c[k]).main;return h};e.prototype.getLabel=function(){var b,e=this,p=this.chart.renderer,c=this.chart.styledMode,a=this.options,w="tooltip"+(F(a.className)?" "+a.className:""),l;if(!this.label){this.outside&&(this.container=l=f.doc.createElement("div"),l.className="highcharts-tooltip-container",r(l,{position:"absolute",top:"1px",pointerEvents:a.style&&a.style.pointerEvents,zIndex:3}),f.doc.body.appendChild(l),this.renderer=p=new f.Renderer(l,0,0,{},void 0,
|
||||
void 0,p.styledMode));this.split?this.label=p.g(w):(this.label=p.label("",0,0,a.shape||"callout",null,null,a.useHTML,null,w).attr({padding:a.padding,r:a.borderRadius}),c||this.label.attr({fill:a.backgroundColor,"stroke-width":a.borderWidth}).css(a.style).shadow(a.shadow));c&&(this.applyFilter(),this.label.addClass("highcharts-tooltip-"+this.chart.index));if(e.outside&&!e.split){var v={x:this.label.xSetter,y:this.label.ySetter};this.label.xSetter=function(a,c){v[c].call(this.label,e.distance);l.style.left=
|
||||
a+"px"};this.label.ySetter=function(a,c){v[c].call(this.label,e.distance);l.style.top=a+"px"}}this.label.attr({zIndex:8,pointerEvents:(null===(b=a.style)||void 0===b?0:b.pointerEvents)||a.stickOnHover?"auto":"none"}).add()}return this.label};e.prototype.getPosition=function(b,e,p){var c=this.chart,a=this.distance,g={},E=c.inverted&&p.h||0,v,k=this.outside,h=k?l.documentElement.clientWidth-2*a:c.chartWidth,t=k?Math.max(l.body.scrollHeight,l.documentElement.scrollHeight,l.body.offsetHeight,l.documentElement.offsetHeight,
|
||||
l.documentElement.clientHeight):c.chartHeight,n=c.pointer.getChartPosition(),f=c.containerScaling,q=function(d){return f?d*f.scaleX:d},C=function(d){return f?d*f.scaleY:d},d=function(d){var g="x"===d;return[d,g?h:t,g?b:e].concat(k?[g?q(b):C(e),g?n.left-a+q(p.plotX+c.plotLeft):n.top-a+C(p.plotY+c.plotTop),0,g?h:t]:[g?b:e,g?p.plotX+c.plotLeft:p.plotY+c.plotTop,g?c.plotLeft:c.plotTop,g?c.plotLeft+c.plotWidth:c.plotTop+c.plotHeight])},J=d("y"),H=d("x"),u=!this.followPointer&&x(p.ttBelow,!c.inverted===
|
||||
!!p.negative),z=function(d,c,b,h,e,k,t){var w="y"===d?C(a):q(a),p=(b-h)/2,v=h<e-a,l=e+a+h<c,J=e-w-b+p;e=e+w-p;if(u&&l)g[d]=e;else if(!u&&v)g[d]=J;else if(v)g[d]=Math.min(t-h,0>J-E?J:J-E);else if(l)g[d]=Math.max(k,e+E+b>c?e:e+E);else return!1},m=function(d,c,b,h,e){var k;e<a||e>c-a?k=!1:g[d]=e<b/2?1:e>c-h/2?c-h-2:e-b/2;return k},A=function(d){var a=J;J=H;H=a;v=d},r=function(){!1!==z.apply(0,J)?!1!==m.apply(0,H)||v||(A(!0),r()):v?g.x=g.y=0:(A(!0),r())};(c.inverted||1<this.len)&&A();r();return g};e.prototype.getXDateFormat=
|
||||
function(b,e,p){e=e.dateTimeLabelFormats;var c=p&&p.closestPointRange;return(c?this.getDateFormat(c,b.x,p.options.startOfWeek,e):e.day)||e.year};e.prototype.hide=function(b){var e=this;m.clearTimeout(this.hideTimer);b=x(b,this.options.hideDelay,500);this.isHidden||(this.hideTimer=u(function(){e.getLabel()[b?"fadeOut":"hide"]();e.isHidden=!0},b))};e.prototype.init=function(b,e){this.chart=b;this.options=e;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=e.split&&!b.inverted&&!b.polar;
|
||||
this.shared=e.shared||this.split;this.outside=x(e.outside,!(!b.scrollablePixelsX&&!b.scrollablePixelsY))};e.prototype.move=function(b,e,p,c){var a=this,g=a.now,l=!1!==a.options.animation&&!a.isHidden&&(1<Math.abs(b-g.x)||1<Math.abs(e-g.y)),v=a.followPointer||1<a.len;G(g,{x:l?(2*g.x+b)/3:b,y:l?(g.y+e)/2:e,anchorX:v?void 0:l?(2*g.anchorX+p)/3:p,anchorY:v?void 0:l?(g.anchorY+c)/2:c});a.getLabel().attr(g);l&&(m.clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){a&&a.move(b,e,
|
||||
p,c)},32))};e.prototype.refresh=function(b,e){var g=this.chart,c=this.options,a=b,w={},l=[],v=c.formatter||this.defaultFormatter;w=this.shared;var k=g.styledMode;if(c.enabled){m.clearTimeout(this.hideTimer);this.followPointer=A(a)[0].series.tooltipOptions.followPointer;var h=this.getAnchor(a,e);e=h[0];var t=h[1];!w||a.series&&a.series.noSharedTooltip?w=a.getLabelConfig():(g.pointer.applyInactiveState(a),a.forEach(function(a){a.setState("hover");l.push(a.getLabelConfig())}),w={x:a[0].category,y:a[0].y},
|
||||
w.points=l,a=a[0]);this.len=l.length;g=v.call(w,this);v=a.series;this.distance=x(v.tooltipOptions.distance,16);!1===g?this.hide():(this.split?this.renderSplit(g,A(b)):(b=this.getLabel(),c.style.width&&!k||b.css({width:this.chart.spacingBox.width}),b.attr({text:g&&g.join?g.join(""):g}),b.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+x(a.colorIndex,v.colorIndex)),k||b.attr({stroke:c.borderColor||a.color||v.color||"#666666"}),this.updatePosition({plotX:e,plotY:t,negative:a.negative,
|
||||
ttBelow:a.ttBelow,h:h[2]||0})),this.isHidden&&this.label&&this.label.attr({opacity:1}).show(),this.isHidden=!1);f.fireEvent(this,"refresh")}};e.prototype.renderSplit=function(b,e){function g(d,a,c,b,e){void 0===e&&(e=!0);c?(a=r?0:B,d=I(d-b/2,m.left,m.right-b)):(a-=O,d=e?d-b-J:d+J,d=I(d,e?d:m.left,m.right));return{x:d,y:a}}var c=this,a=c.chart,w=c.chart,l=w.plotHeight,v=w.plotLeft,k=w.plotTop,h=w.pointer,t=w.renderer,n=w.scrollablePixelsY,q=void 0===n?0:n;n=w.scrollingContainer;n=void 0===n?{scrollLeft:0,
|
||||
scrollTop:0}:n;var u=n.scrollLeft,C=n.scrollTop,d=w.styledMode,J=c.distance,H=c.options,z=c.options.positioner,m={left:u,right:u+w.chartWidth,top:C,bottom:C+w.chartHeight},A=c.getLabel(),r=!(!a.xAxis[0]||!a.xAxis[0].opposite),O=k+C,D=0,B=l-q;K(b)&&(b=[!1,b]);b=b.slice(0,e.length+1).reduce(function(a,b,h){if(!1!==b&&""!==b){h=e[h-1]||{isHeader:!0,plotX:e[0].plotX,plotY:l,series:{}};var w=h.isHeader,p=w?c:h.series,E=p.tt,n=h.isHeader;var f=h.series;var L="highcharts-color-"+x(h.colorIndex,f.colorIndex,
|
||||
"none");E||(E={padding:H.padding,r:H.borderRadius},d||(E.fill=H.backgroundColor,E["stroke-width"]=H.borderWidth),E=t.label("",0,0,H[n?"headerShape":"shape"]||"callout",void 0,void 0,H.useHTML).addClass((n?"highcharts-tooltip-header ":"")+"highcharts-tooltip-box "+L).attr(E).add(A));E.isActive=!0;E.attr({text:b});d||E.css(H.style).shadow(H.shadow).attr({stroke:H.borderColor||h.color||f.color||"#333333"});b=p.tt=E;n=b.getBBox();p=n.width+b.strokeWidth();w&&(D=n.height,B+=D,r&&(O-=D));f=h.plotX;f=void 0===
|
||||
f?0:f;L=h.plotY;L=void 0===L?0:L;var M=h.series;if(h.isHeader){f=v+f;var u=k+l/2}else E=M.xAxis,M=M.yAxis,f=E.pos+I(f,-J,E.len+J),M.pos+L>=C+k&&M.pos+L<=C+k+l-q&&(u=M.pos+L);f=I(f,m.left-J,m.right+J);"number"===typeof u?(n=n.height+1,L=z?z.call(c,p,n,h):g(f,u,w,p),a.push({align:z?0:void 0,anchorX:f,anchorY:u,boxWidth:p,point:h,rank:x(L.rank,w?1:0),size:n,target:L.y,tt:b,x:L.x})):b.isActive=!1}return a},[]);!z&&b.some(function(d){return d.x<m.left})&&(b=b.map(function(d){var a=g(d.anchorX,d.anchorY,
|
||||
d.point.isHeader,d.boxWidth,!1);return G(d,{target:a.y,x:a.x})}));c.cleanSplit();f.distribute(b,B);b.forEach(function(d){var a=d.pos;d.tt.attr({visibility:"undefined"===typeof a?"hidden":"inherit",x:d.x,y:a+O,anchorX:d.anchorX,anchorY:d.anchorY})});b=c.container;a=c.renderer;c.outside&&b&&a&&(w=A.getBBox(),a.setSize(w.width+w.x,w.height+w.y,!1),h=h.getChartPosition(),b.style.left=h.left+"px",b.style.top=h.top+"px")};e.prototype.styledModeFormat=function(b){return b.replace('style="font-size: 10px"',
|
||||
'class="highcharts-header"').replace(/style="color:{(point|series)\.color}"/g,'class="highcharts-color-{$1.colorIndex}"')};e.prototype.tooltipFooterHeaderFormatter=function(b,e){var g=e?"footer":"header",c=b.series,a=c.tooltipOptions,w=a.xDateFormat,l=c.xAxis,v=l&&"datetime"===l.options.type&&D(b.key),k=a[g+"Format"];e={isFooter:e,labelConfig:b};f.fireEvent(this,"headerFormatter",e,function(e){v&&!w&&(w=this.getXDateFormat(b,a,l));v&&w&&(b.point&&b.point.tooltipDateKeys||["key"]).forEach(function(a){k=
|
||||
k.replace("{point."+a+"}","{point."+a+":"+w+"}")});c.chart.styledMode&&(k=this.styledModeFormat(k));e.text=B(k,{point:b,series:c},this.chart)});return e.text};e.prototype.update=function(b){this.destroy();z(!0,this.chart.options.tooltip.userOptions,b);this.init(this.chart,z(!0,this.options,b))};e.prototype.updatePosition=function(b){var e=this.chart,p=e.pointer,c=this.getLabel(),a=b.plotX+e.plotLeft,w=b.plotY+e.plotTop;p=p.getChartPosition();b=(this.options.positioner||this.getPosition).call(this,
|
||||
c.width,c.height,b);if(this.outside){var l=(this.options.borderWidth||0)+2*this.distance;this.renderer.setSize(c.width+l,c.height+l,!1);if(e=e.containerScaling)r(this.container,{transform:"scale("+e.scaleX+", "+e.scaleY+")"}),a*=e.scaleX,w*=e.scaleY;a+=p.left-b.x;w+=p.top-b.y}this.move(Math.round(b.x),Math.round(b.y||0),a,w)};return e}();f.Tooltip=q;return f.Tooltip});P(y,"parts/Pointer.js",[y["parts/Globals.js"],y["parts/Utilities.js"],y["parts/Tooltip.js"],y["parts/Color.js"]],function(f,m,I,r){var F=
|
||||
m.addEvent,N=m.attr,G=m.css,B=m.defined,D=m.extend,K=m.find,z=m.fireEvent,x=m.isNumber,A=m.isObject,u=m.objectEach,n=m.offset,l=m.pick,q=m.splat,e=r.parse,b=f.charts,g=f.noop;m=function(){function p(c,a){this.lastValidTouch={};this.pinchDown=[];this.runChartClick=!1;this.chart=c;this.hasDragged=!1;this.options=a;this.unbindContainerMouseLeave=function(){};this.init(c,a)}p.prototype.applyInactiveState=function(c){var a=[],b;(c||[]).forEach(function(c){b=c.series;a.push(b);b.linkedParent&&a.push(b.linkedParent);
|
||||
b.linkedSeries&&(a=a.concat(b.linkedSeries));b.navigatorSeries&&a.push(b.navigatorSeries)});this.chart.series.forEach(function(c){-1===a.indexOf(c)?c.setState("inactive",!0):c.options.inactiveOtherPoints&&c.setAllPointsToState("inactive")})};p.prototype.destroy=function(){var c=this;"undefined"!==typeof c.unDocMouseMove&&c.unDocMouseMove();this.unbindContainerMouseLeave();f.chartCount||(f.unbindDocumentMouseUp&&(f.unbindDocumentMouseUp=f.unbindDocumentMouseUp()),f.unbindDocumentTouchEnd&&(f.unbindDocumentTouchEnd=
|
||||
f.unbindDocumentTouchEnd()));clearInterval(c.tooltipTimeout);u(c,function(a,b){c[b]=null})};p.prototype.drag=function(c){var a=this.chart,b=a.options.chart,g=c.chartX,p=c.chartY,k=this.zoomHor,h=this.zoomVert,t=a.plotLeft,l=a.plotTop,n=a.plotWidth,f=a.plotHeight,q=this.selectionMarker,d=this.mouseDownX||0,J=this.mouseDownY||0,H=A(b.panning)?b.panning&&b.panning.enabled:b.panning,u=b.panKey&&c[b.panKey+"Key"];if(!q||!q.touch)if(g<t?g=t:g>t+n&&(g=t+n),p<l?p=l:p>l+f&&(p=l+f),this.hasDragged=Math.sqrt(Math.pow(d-
|
||||
g,2)+Math.pow(J-p,2)),10<this.hasDragged){var x=a.isInsidePlot(d-t,J-l);a.hasCartesianSeries&&(this.zoomX||this.zoomY)&&x&&!u&&!q&&(this.selectionMarker=q=a.renderer.rect(t,l,k?1:n,h?1:f,0).attr({"class":"highcharts-selection-marker",zIndex:7}).add(),a.styledMode||q.attr({fill:b.selectionMarkerFill||e("#335cad").setOpacity(.25).get()}));q&&k&&(g-=d,q.attr({width:Math.abs(g),x:(0<g?0:g)+d}));q&&h&&(g=p-J,q.attr({height:Math.abs(g),y:(0<g?0:g)+J}));x&&!q&&H&&a.pan(c,b.panning)}};p.prototype.dragStart=
|
||||
function(c){var a=this.chart;a.mouseIsDown=c.type;a.cancelClick=!1;a.mouseDownX=this.mouseDownX=c.chartX;a.mouseDownY=this.mouseDownY=c.chartY};p.prototype.drop=function(c){var a=this,b=this.chart,e=this.hasPinched;if(this.selectionMarker){var g={originalEvent:c,xAxis:[],yAxis:[]},k=this.selectionMarker,h=k.attr?k.attr("x"):k.x,t=k.attr?k.attr("y"):k.y,p=k.attr?k.attr("width"):k.width,l=k.attr?k.attr("height"):k.height,n;if(this.hasDragged||e)b.axes.forEach(function(b){if(b.zoomEnabled&&B(b.min)&&
|
||||
(e||a[{xAxis:"zoomX",yAxis:"zoomY"}[b.coll]])){var d=b.horiz,k="touchend"===c.type?b.minPixelPadding:0,w=b.toValue((d?h:t)+k);d=b.toValue((d?h+p:t+l)-k);g[b.coll].push({axis:b,min:Math.min(w,d),max:Math.max(w,d)});n=!0}}),n&&z(b,"selection",g,function(a){b.zoom(D(a,e?{animation:!1}:null))});x(b.index)&&(this.selectionMarker=this.selectionMarker.destroy());e&&this.scaleGroups()}b&&x(b.index)&&(G(b.container,{cursor:b._cursor}),b.cancelClick=10<this.hasDragged,b.mouseIsDown=this.hasDragged=this.hasPinched=
|
||||
!1,this.pinchDown=[])};p.prototype.findNearestKDPoint=function(c,a,b){var e;if(this.isStickyTooltip(b))return this.chart.hoverPoint;c.forEach(function(c){var k=!(c.noSharedTooltip&&a)&&0>c.options.findNearestPointBy.indexOf("y");c=c.searchPoint(b,k);if((k=A(c,!0))&&!(k=!A(e,!0))){k=e.distX-c.distX;var h=e.dist-c.dist,g=(c.series.group&&c.series.group.zIndex)-(e.series.group&&e.series.group.zIndex);k=0<(0!==k&&a?k:0!==h?h:0!==g?g:e.series.index>c.series.index?-1:1)}k&&(e=c)});return e};p.prototype.getChartCoordinatesFromPoint=
|
||||
function(c,a){var b=c.series,e=b.xAxis;b=b.yAxis;var g=l(c.clientX,c.plotX),k=c.shapeArgs;if(e&&b)return a?{chartX:e.len+e.pos-g,chartY:b.len+b.pos-c.plotY}:{chartX:g+e.pos,chartY:c.plotY+b.pos};if(k&&k.x&&k.y)return{chartX:k.x,chartY:k.y}};p.prototype.getChartPosition=function(){return this.chartPosition||(this.chartPosition=n(this.chart.container))};p.prototype.getCoordinates=function(c){var a={xAxis:[],yAxis:[]};this.chart.axes.forEach(function(b){a[b.isXAxis?"xAxis":"yAxis"].push({axis:b,value:b.toValue(c[b.horiz?
|
||||
"chartX":"chartY"])})});return a};p.prototype.getHoverData=function(c,a,b,e,g,k){var h,t=[];e=!(!e||!c);var p=a&&!a.stickyTracking,w={chartX:k?k.chartX:void 0,chartY:k?k.chartY:void 0,shared:g};z(this,"beforeGetHoverData",w);p=p?[a]:b.filter(function(a){return w.filter?w.filter(a):a.visible&&!(!g&&a.directTouch)&&l(a.options.enableMouseTracking,!0)&&a.stickyTracking});a=(h=e||!k?c:this.findNearestKDPoint(p,g,k))&&h.series;h&&(g&&!a.noSharedTooltip?(p=b.filter(function(a){return w.filter?w.filter(a):
|
||||
a.visible&&!(!g&&a.directTouch)&&l(a.options.enableMouseTracking,!0)&&!a.noSharedTooltip}),p.forEach(function(a){var c=K(a.points,function(d){return d.x===h.x&&!d.isNull});A(c)&&(a.chart.isBoosting&&(c=a.getPoint(c)),t.push(c))})):t.push(h));w={hoverPoint:h};z(this,"afterGetHoverData",w);return{hoverPoint:w.hoverPoint,hoverSeries:a,hoverPoints:t}};p.prototype.getPointFromEvent=function(c){c=c.target;for(var a;c&&!a;)a=c.point,c=c.parentNode;return a};p.prototype.onTrackerMouseOut=function(c){var a=
|
||||
this.chart.hoverSeries,b=c.relatedTarget||c.toElement;this.isDirectTouch=!1;if(!(!a||!b||a.stickyTracking||this.isStickyTooltip(c)||this.inClass(b,"highcharts-tooltip")||this.inClass(b,"highcharts-series-"+a.index)&&this.inClass(b,"highcharts-tracker")))a.onMouseOut()};p.prototype.inClass=function(c,a){for(var b;c;){if(b=N(c,"class")){if(-1!==b.indexOf(a))return!0;if(-1!==b.indexOf("highcharts-container"))return!1}c=c.parentNode}};p.prototype.init=function(c,a){this.options=a;this.chart=c;this.runChartClick=
|
||||
a.chart.events&&!!a.chart.events.click;this.pinchDown=[];this.lastValidTouch={};I&&(c.tooltip=new I(c,a.tooltip),this.followTouchMove=l(a.tooltip.followTouchMove,!0));this.setDOMEvents()};p.prototype.isStickyTooltip=function(c){var a=this.chart,b=this.chartPosition,e=a.hoverPoint,g=a.tooltip;a=c.chartX;c=c.chartY;var k=!1;if(b&&e&&e.graphic&&g&&!g.isHidden&&g.options.stickOnHover&&g.label){k=g.label.getBBox();var h=f.offset(g.label.element);g=e.graphic.getBBox();e=f.offset(e.graphic.element);k.x=
|
||||
h.left-b.left;k.y=h.top-b.top;g.x=e.left-b.left;g.y=e.top-b.top;b=Math.min(g.y,k.y);e=Math.max(g.x+g.width,k.x+k.width);h=Math.max(g.y+g.height,k.y+k.height);k=a>=Math.min(g.x,k.x)&&a<=e&&c>=b&&c<=h}return k};p.prototype.normalize=function(c,a){var b=c.touches,e=b?b.length?b.item(0):b.changedTouches[0]:c;a||(a=this.getChartPosition());b=e.pageX-a.left;a=e.pageY-a.top;if(e=this.chart.containerScaling)b/=e.scaleX,a/=e.scaleY;return D(c,{chartX:Math.round(b),chartY:Math.round(a)})};p.prototype.onContainerClick=
|
||||
function(c){var a=this.chart,b=a.hoverPoint,e=a.plotLeft,g=a.plotTop;c=this.normalize(c);a.cancelClick||(b&&this.inClass(c.target,"highcharts-tracker")?(z(b.series,"click",D(c,{point:b})),a.hoverPoint&&b.firePointEvent("click",c)):(D(c,this.getCoordinates(c)),a.isInsidePlot(c.chartX-e,c.chartY-g)&&z(a,"click",c)))};p.prototype.onContainerMouseDown=function(c){c=this.normalize(c);2!==c.button&&(this.zoomOption(c),c.preventDefault&&c.preventDefault(),this.dragStart(c))};p.prototype.onContainerMouseLeave=
|
||||
function(c){var a=b[f.hoverChartIndex];a&&(c.relatedTarget||c.toElement)&&(a.pointer.reset(),a.pointer.chartPosition=void 0)};p.prototype.onContainerMouseMove=function(c){var a=this.chart;B(f.hoverChartIndex)&&b[f.hoverChartIndex]&&b[f.hoverChartIndex].mouseIsDown||(f.hoverChartIndex=a.index);c=this.normalize(c);c.preventDefault||(c.returnValue=!1);"mousedown"===a.mouseIsDown&&this.drag(c);a.openMenu||this.isStickyTooltip(c)||!this.inClass(c.target,"highcharts-tracker")&&!a.isInsidePlot(c.chartX-
|
||||
a.plotLeft,c.chartY-a.plotTop)||this.runPointActions(c)};p.prototype.onDocumentTouchEnd=function(c){b[f.hoverChartIndex]&&b[f.hoverChartIndex].pointer.drop(c)};p.prototype.onContainerTouchMove=function(c){this.touch(c)};p.prototype.onContainerTouchStart=function(c){this.zoomOption(c);this.touch(c,!0)};p.prototype.onDocumentMouseMove=function(c){var a=this.chart,b=this.chartPosition;c=this.normalize(c,b);!b||this.isStickyTooltip(c)||this.inClass(c.target,"highcharts-tracker")||a.isInsidePlot(c.chartX-
|
||||
a.plotLeft,c.chartY-a.plotTop)||this.reset()};p.prototype.onDocumentMouseUp=function(c){b[f.hoverChartIndex]&&b[f.hoverChartIndex].pointer.drop(c)};p.prototype.pinch=function(c){var a=this,b=a.chart,e=a.pinchDown,p=c.touches||[],k=p.length,h=a.lastValidTouch,t=a.hasZoom,n=a.selectionMarker,f={},q=1===k&&(a.inClass(c.target,"highcharts-tracker")&&b.runTrackerClick||a.runChartClick),C={};1<k&&(a.initiated=!0);t&&a.initiated&&!q&&c.preventDefault();[].map.call(p,function(d){return a.normalize(d)});"touchstart"===
|
||||
c.type?([].forEach.call(p,function(d,a){e[a]={chartX:d.chartX,chartY:d.chartY}}),h.x=[e[0].chartX,e[1]&&e[1].chartX],h.y=[e[0].chartY,e[1]&&e[1].chartY],b.axes.forEach(function(d){if(d.zoomEnabled){var a=b.bounds[d.horiz?"h":"v"],c=d.minPixelPadding,e=d.toPixels(Math.min(l(d.options.min,d.dataMin),d.dataMin)),h=d.toPixels(Math.max(l(d.options.max,d.dataMax),d.dataMax)),k=Math.max(e,h);a.min=Math.min(d.pos,Math.min(e,h)-c);a.max=Math.max(d.pos+d.len,k+c)}}),a.res=!0):a.followTouchMove&&1===k?this.runPointActions(a.normalize(c)):
|
||||
e.length&&(n||(a.selectionMarker=n=D({destroy:g,touch:!0},b.plotBox)),a.pinchTranslate(e,p,f,n,C,h),a.hasPinched=t,a.scaleGroups(f,C),a.res&&(a.res=!1,this.reset(!1,0)))};p.prototype.pinchTranslate=function(c,a,b,e,g,k){this.zoomHor&&this.pinchTranslateDirection(!0,c,a,b,e,g,k);this.zoomVert&&this.pinchTranslateDirection(!1,c,a,b,e,g,k)};p.prototype.pinchTranslateDirection=function(c,a,b,e,g,k,h,t){var p=this.chart,l=c?"x":"y",w=c?"X":"Y",v="chart"+w,d=c?"width":"height",n=p["plot"+(c?"Left":"Top")],
|
||||
f,q,E=t||1,u=p.inverted,x=p.bounds[c?"h":"v"],z=1===a.length,m=a[0][v],A=b[0][v],r=!z&&a[1][v],R=!z&&b[1][v];b=function(){"number"===typeof R&&20<Math.abs(m-r)&&(E=t||Math.abs(A-R)/Math.abs(m-r));q=(n-A)/E+m;f=p["plot"+(c?"Width":"Height")]/E};b();a=q;if(a<x.min){a=x.min;var D=!0}else a+f>x.max&&(a=x.max-f,D=!0);D?(A-=.8*(A-h[l][0]),"number"===typeof R&&(R-=.8*(R-h[l][1])),b()):h[l]=[A,R];u||(k[l]=q-n,k[d]=f);k=u?1/E:E;g[d]=f;g[l]=a;e[u?c?"scaleY":"scaleX":"scale"+w]=E;e["translate"+w]=k*n+(A-k*m)};
|
||||
p.prototype.reset=function(c,a){var b=this.chart,e=b.hoverSeries,g=b.hoverPoint,k=b.hoverPoints,h=b.tooltip,p=h&&h.shared?k:g;c&&p&&q(p).forEach(function(a){a.series.isCartesian&&"undefined"===typeof a.plotX&&(c=!1)});if(c)h&&p&&q(p).length&&(h.refresh(p),h.shared&&k?k.forEach(function(a){a.setState(a.state,!0);a.series.isCartesian&&(a.series.xAxis.crosshair&&a.series.xAxis.drawCrosshair(null,a),a.series.yAxis.crosshair&&a.series.yAxis.drawCrosshair(null,a))}):g&&(g.setState(g.state,!0),b.axes.forEach(function(a){a.crosshair&&
|
||||
g.series[a.coll]===a&&a.drawCrosshair(null,g)})));else{if(g)g.onMouseOut();k&&k.forEach(function(a){a.setState()});if(e)e.onMouseOut();h&&h.hide(a);this.unDocMouseMove&&(this.unDocMouseMove=this.unDocMouseMove());b.axes.forEach(function(a){a.hideCrosshair()});this.hoverX=b.hoverPoints=b.hoverPoint=null}};p.prototype.runPointActions=function(c,a){var e=this.chart,g=e.tooltip&&e.tooltip.options.enabled?e.tooltip:void 0,p=g?g.shared:!1,k=a||e.hoverPoint,h=k&&k.series||e.hoverSeries;h=this.getHoverData(k,
|
||||
h,e.series,(!c||"touchmove"!==c.type)&&(!!a||h&&h.directTouch&&this.isDirectTouch),p,c);k=h.hoverPoint;var t=h.hoverPoints;a=(h=h.hoverSeries)&&h.tooltipOptions.followPointer;p=p&&h&&!h.noSharedTooltip;if(k&&(k!==e.hoverPoint||g&&g.isHidden)){(e.hoverPoints||[]).forEach(function(a){-1===t.indexOf(a)&&a.setState()});if(e.hoverSeries!==h)h.onMouseOver();this.applyInactiveState(t);(t||[]).forEach(function(a){a.setState("hover")});e.hoverPoint&&e.hoverPoint.firePointEvent("mouseOut");if(!k.series)return;
|
||||
k.firePointEvent("mouseOver");e.hoverPoints=t;e.hoverPoint=k;g&&g.refresh(p?t:k,c)}else a&&g&&!g.isHidden&&(k=g.getAnchor([{}],c),g.updatePosition({plotX:k[0],plotY:k[1]}));this.unDocMouseMove||(this.unDocMouseMove=F(e.container.ownerDocument,"mousemove",function(a){var c=b[f.hoverChartIndex];if(c)c.pointer.onDocumentMouseMove(a)}));e.axes.forEach(function(a){var b=l(a.crosshair.snap,!0),e=b?K(t,function(c){return c.series[a.coll]===a}):void 0;e||!b?a.drawCrosshair(c,e):a.hideCrosshair()})};p.prototype.scaleGroups=
|
||||
function(c,a){var b=this.chart,e;b.series.forEach(function(g){e=c||g.getPlotBox();g.xAxis&&g.xAxis.zoomEnabled&&g.group&&(g.group.attr(e),g.markerGroup&&(g.markerGroup.attr(e),g.markerGroup.clip(a?b.clipRect:null)),g.dataLabelsGroup&&g.dataLabelsGroup.attr(e))});b.clipRect.attr(a||b.clipBox)};p.prototype.setDOMEvents=function(){var c=this,a=c.chart.container,b=a.ownerDocument;a.onmousedown=function(a){c.onContainerMouseDown(a)};a.onmousemove=function(a){c.onContainerMouseMove(a)};a.onclick=function(a){c.onContainerClick(a)};
|
||||
this.unbindContainerMouseLeave=F(a,"mouseleave",c.onContainerMouseLeave);f.unbindDocumentMouseUp||(f.unbindDocumentMouseUp=F(b,"mouseup",c.onDocumentMouseUp));f.hasTouch&&(F(a,"touchstart",function(a){c.onContainerTouchStart(a)}),F(a,"touchmove",function(a){c.onContainerTouchMove(a)}),f.unbindDocumentTouchEnd||(f.unbindDocumentTouchEnd=F(b,"touchend",c.onDocumentTouchEnd)))};p.prototype.touch=function(c,a){var b=this.chart,e;if(b.index!==f.hoverChartIndex)this.onContainerMouseLeave({relatedTarget:!0});
|
||||
f.hoverChartIndex=b.index;if(1===c.touches.length)if(c=this.normalize(c),(e=b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop))&&!b.openMenu){a&&this.runPointActions(c);if("touchmove"===c.type){a=this.pinchDown;var g=a[0]?4<=Math.sqrt(Math.pow(a[0].chartX-c.chartX,2)+Math.pow(a[0].chartY-c.chartY,2)):!1}l(g,!0)&&this.pinch(c)}else a&&this.reset();else 2===c.touches.length&&this.pinch(c)};p.prototype.zoomOption=function(c){var a=this.chart,b=a.options.chart,e=b.zoomType||"";a=a.inverted;/touch/.test(c.type)&&
|
||||
(e=l(b.pinchType,e));this.zoomX=c=/x/.test(e);this.zoomY=e=/y/.test(e);this.zoomHor=c&&!a||e&&a;this.zoomVert=e&&!a||c&&a;this.hasZoom=c||e};return p}();f.Pointer=m;return f.Pointer});P(y,"parts/MSPointer.js",[y["parts/Globals.js"],y["parts/Pointer.js"],y["parts/Utilities.js"]],function(f,m,I){function r(){var l=[];l.item=function(l){return this[l]};D(u,function(n){l.push({pageX:n.pageX,pageY:n.pageY,target:n.target})});return l}function F(l,n,e,b){"touch"!==l.pointerType&&l.pointerType!==l.MSPOINTER_TYPE_TOUCH||
|
||||
!z[f.hoverChartIndex]||(b(l),b=z[f.hoverChartIndex].pointer,b[n]({type:e,target:l.currentTarget,preventDefault:A,touches:r()}))}var N=this&&this.__extends||function(){var l=function(n,e){l=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,e){b.__proto__=e}||function(b,e){for(var g in e)e.hasOwnProperty(g)&&(b[g]=e[g])};return l(n,e)};return function(n,e){function b(){this.constructor=n}l(n,e);n.prototype=null===e?Object.create(e):(b.prototype=e.prototype,new b)}}(),G=I.addEvent,B=
|
||||
I.css,D=I.objectEach,K=I.removeEvent,z=f.charts,x=f.doc,A=f.noop,u={},n=!!f.win.PointerEvent;return function(l){function f(){return null!==l&&l.apply(this,arguments)||this}N(f,l);f.prototype.batchMSEvents=function(e){e(this.chart.container,n?"pointerdown":"MSPointerDown",this.onContainerPointerDown);e(this.chart.container,n?"pointermove":"MSPointerMove",this.onContainerPointerMove);e(x,n?"pointerup":"MSPointerUp",this.onDocumentPointerUp)};f.prototype.destroy=function(){this.batchMSEvents(K);l.prototype.destroy.call(this)};
|
||||
f.prototype.init=function(e,b){l.prototype.init.call(this,e,b);this.hasZoom&&B(e.container,{"-ms-touch-action":"none","touch-action":"none"})};f.prototype.onContainerPointerDown=function(e){F(e,"onContainerTouchStart","touchstart",function(b){u[b.pointerId]={pageX:b.pageX,pageY:b.pageY,target:b.currentTarget}})};f.prototype.onContainerPointerMove=function(e){F(e,"onContainerTouchMove","touchmove",function(b){u[b.pointerId]={pageX:b.pageX,pageY:b.pageY};u[b.pointerId].target||(u[b.pointerId].target=
|
||||
b.currentTarget)})};f.prototype.onDocumentPointerUp=function(e){F(e,"onDocumentTouchEnd","touchend",function(b){delete u[b.pointerId]})};f.prototype.setDOMEvents=function(){l.prototype.setDOMEvents.call(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(G)};return f}(m)});P(y,"parts/Legend.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.addEvent,r=m.css,F=m.defined,N=m.discardElement,G=m.find,B=m.fireEvent,D=m.format,K=m.isNumber,z=m.merge,x=m.pick,A=m.relativeLength,
|
||||
u=m.setAnimation,n=m.stableSort,l=m.syncTimeout;m=m.wrap;var q=f.isFirefox,e=f.marginNames,b=f.win,g=function(){function b(c,a){this.allItems=[];this.contentGroup=this.box=void 0;this.display=!1;this.group=void 0;this.offsetWidth=this.maxLegendWidth=this.maxItemWidth=this.legendWidth=this.legendHeight=this.lastLineHeight=this.lastItemY=this.itemY=this.itemX=this.itemMarginTop=this.itemMarginBottom=this.itemHeight=this.initialItemY=0;this.options={};this.padding=0;this.pages=[];this.proximate=!1;this.scrollGroup=
|
||||
void 0;this.widthOption=this.totalItemWidth=this.titleHeight=this.symbolWidth=this.symbolHeight=0;this.chart=c;this.init(c,a)}b.prototype.init=function(c,a){this.chart=c;this.setOptions(a);a.enabled&&(this.render(),I(this.chart,"endResize",function(){this.legend.positionCheckboxes()}),this.proximate?this.unchartrender=I(this.chart,"render",function(){this.legend.proximatePositions();this.legend.positionItems()}):this.unchartrender&&this.unchartrender())};b.prototype.setOptions=function(c){var a=x(c.padding,
|
||||
8);this.options=c;this.chart.styledMode||(this.itemStyle=c.itemStyle,this.itemHiddenStyle=z(this.itemStyle,c.itemHiddenStyle));this.itemMarginTop=c.itemMarginTop||0;this.itemMarginBottom=c.itemMarginBottom||0;this.padding=a;this.initialItemY=a-5;this.symbolWidth=x(c.symbolWidth,16);this.pages=[];this.proximate="proximate"===c.layout&&!this.chart.inverted;this.baseline=void 0};b.prototype.update=function(c,a){var b=this.chart;this.setOptions(z(!0,this.options,c));this.destroy();b.isDirtyLegend=b.isDirtyBox=
|
||||
!0;x(a,!0)&&b.redraw();B(this,"afterUpdate")};b.prototype.colorizeItem=function(c,a){c.legendGroup[a?"removeClass":"addClass"]("highcharts-legend-item-hidden");if(!this.chart.styledMode){var b=this.options,e=c.legendItem,g=c.legendLine,k=c.legendSymbol,h=this.itemHiddenStyle.color;b=a?b.itemStyle.color:h;var t=a?c.color||h:h,p=c.options&&c.options.marker,l={fill:t};e&&e.css({fill:b,color:b});g&&g.attr({stroke:t});k&&(p&&k.isMarker&&(l=c.pointAttribs(),a||(l.stroke=l.fill=h)),k.attr(l))}B(this,"afterColorizeItem",
|
||||
{item:c,visible:a})};b.prototype.positionItems=function(){this.allItems.forEach(this.positionItem,this);this.chart.isResizing||this.positionCheckboxes()};b.prototype.positionItem=function(c){var a=this.options,b=a.symbolPadding;a=!a.rtl;var e=c._legendItemPos,g=e[0];e=e[1];var k=c.checkbox;if((c=c.legendGroup)&&c.element)c[F(c.translateY)?"animate":"attr"]({translateX:a?g:this.legendWidth-g-2*b-4,translateY:e});k&&(k.x=g,k.y=e)};b.prototype.destroyItem=function(c){var a=c.checkbox;["legendItem","legendLine",
|
||||
"legendSymbol","legendGroup"].forEach(function(a){c[a]&&(c[a]=c[a].destroy())});a&&N(c.checkbox)};b.prototype.destroy=function(){function c(a){this[a]&&(this[a]=this[a].destroy())}this.getAllItems().forEach(function(a){["legendItem","legendGroup"].forEach(c,a)});"clipRect up down pager nav box title group".split(" ").forEach(c,this);this.display=null};b.prototype.positionCheckboxes=function(){var c=this.group&&this.group.alignAttr,a=this.clipHeight||this.legendHeight,b=this.titleHeight;if(c){var e=
|
||||
c.translateY;this.allItems.forEach(function(g){var k=g.checkbox;if(k){var h=e+b+k.y+(this.scrollOffset||0)+3;r(k,{left:c.translateX+g.checkboxOffset+k.x-20+"px",top:h+"px",display:this.proximate||h>e-6&&h<e+a-6?"":"none"})}},this)}};b.prototype.renderTitle=function(){var c=this.options,a=this.padding,b=c.title,e=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,c.useHTML,null,"legend-title").attr({zIndex:1}),this.chart.styledMode||this.title.css(b.style),this.title.add(this.group)),
|
||||
b.width||this.title.css({width:this.maxLegendWidth+"px"}),c=this.title.getBBox(),e=c.height,this.offsetWidth=c.width,this.contentGroup.attr({translateY:e}));this.titleHeight=e};b.prototype.setText=function(c){var a=this.options;c.legendItem.attr({text:a.labelFormat?D(a.labelFormat,c,this.chart):a.labelFormatter.call(c)})};b.prototype.renderItem=function(c){var a=this.chart,b=a.renderer,e=this.options,g=this.symbolWidth,k=e.symbolPadding,h=this.itemStyle,t=this.itemHiddenStyle,p="horizontal"===e.layout?
|
||||
x(e.itemDistance,20):0,l=!e.rtl,n=c.legendItem,f=!c.series,d=!f&&c.series.drawLegendSymbol?c.series:c,J=d.options;J=this.createCheckboxForItem&&J&&J.showCheckbox;p=g+k+p+(J?20:0);var H=e.useHTML,q=c.options.className;n||(c.legendGroup=b.g("legend-item").addClass("highcharts-"+d.type+"-series highcharts-color-"+c.colorIndex+(q?" "+q:"")+(f?" highcharts-series-"+c.index:"")).attr({zIndex:1}).add(this.scrollGroup),c.legendItem=n=b.text("",l?g+k:-k,this.baseline||0,H),a.styledMode||n.css(z(c.visible?
|
||||
h:t)),n.attr({align:l?"left":"right",zIndex:2}).add(c.legendGroup),this.baseline||(this.fontMetrics=b.fontMetrics(a.styledMode?12:h.fontSize,n),this.baseline=this.fontMetrics.f+3+this.itemMarginTop,n.attr("y",this.baseline)),this.symbolHeight=e.symbolHeight||this.fontMetrics.f,d.drawLegendSymbol(this,c),this.setItemEvents&&this.setItemEvents(c,n,H));J&&!c.checkbox&&this.createCheckboxForItem&&this.createCheckboxForItem(c);this.colorizeItem(c,c.visible);!a.styledMode&&h.width||n.css({width:(e.itemWidth||
|
||||
this.widthOption||a.spacingBox.width)-p});this.setText(c);a=n.getBBox();c.itemWidth=c.checkboxOffset=e.itemWidth||c.legendItemWidth||a.width+p;this.maxItemWidth=Math.max(this.maxItemWidth,c.itemWidth);this.totalItemWidth+=c.itemWidth;this.itemHeight=c.itemHeight=Math.round(c.legendItemHeight||a.height||this.symbolHeight)};b.prototype.layoutItem=function(c){var a=this.options,b=this.padding,e="horizontal"===a.layout,g=c.itemHeight,k=this.itemMarginBottom,h=this.itemMarginTop,t=e?x(a.itemDistance,20):
|
||||
0,p=this.maxLegendWidth;a=a.alignColumns&&this.totalItemWidth>p?this.maxItemWidth:c.itemWidth;e&&this.itemX-b+a>p&&(this.itemX=b,this.lastLineHeight&&(this.itemY+=h+this.lastLineHeight+k),this.lastLineHeight=0);this.lastItemY=h+this.itemY+k;this.lastLineHeight=Math.max(g,this.lastLineHeight);c._legendItemPos=[this.itemX,this.itemY];e?this.itemX+=a:(this.itemY+=h+g+k,this.lastLineHeight=g);this.offsetWidth=this.widthOption||Math.max((e?this.itemX-b-(c.checkbox?0:t):a)+b,this.offsetWidth)};b.prototype.getAllItems=
|
||||
function(){var c=[];this.chart.series.forEach(function(a){var b=a&&a.options;a&&x(b.showInLegend,F(b.linkedTo)?!1:void 0,!0)&&(c=c.concat(a.legendItems||("point"===b.legendType?a.data:a)))});B(this,"afterGetAllItems",{allItems:c});return c};b.prototype.getAlignment=function(){var c=this.options;return this.proximate?c.align.charAt(0)+"tv":c.floating?"":c.align.charAt(0)+c.verticalAlign.charAt(0)+c.layout.charAt(0)};b.prototype.adjustMargins=function(c,a){var b=this.chart,g=this.options,p=this.getAlignment();
|
||||
p&&[/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/].forEach(function(k,h){k.test(p)&&!F(c[h])&&(b[e[h]]=Math.max(b[e[h]],b.legend[(h+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][h]*g[h%2?"x":"y"]+x(g.margin,12)+a[h]+(b.titleOffset[h]||0)))})};b.prototype.proximatePositions=function(){var c=this.chart,a=[],b="left"===this.options.align;this.allItems.forEach(function(e){var g=b;if(e.yAxis&&e.points){e.xAxis.options.reversed&&(g=!g);var k=G(g?e.points:e.points.slice(0).reverse(),function(a){return K(a.plotY)});
|
||||
g=this.itemMarginTop+e.legendItem.getBBox().height+this.itemMarginBottom;var h=e.yAxis.top-c.plotTop;e.visible?(k=k?k.plotY:e.yAxis.height,k+=h-.3*g):k=h+e.yAxis.height;a.push({target:k,size:g,item:e})}},this);f.distribute(a,c.plotHeight);a.forEach(function(a){a.item._legendItemPos[1]=c.plotTop-c.spacing[0]+a.pos})};b.prototype.render=function(){var c=this.chart,a=c.renderer,b=this.group,e,g=this.box,k=this.options,h=this.padding;this.itemX=h;this.itemY=this.initialItemY;this.lastItemY=this.offsetWidth=
|
||||
0;this.widthOption=A(k.width,c.spacingBox.width-h);var p=c.spacingBox.width-2*h-k.x;-1<["rm","lm"].indexOf(this.getAlignment().substring(0,2))&&(p/=2);this.maxLegendWidth=this.widthOption||p;b||(this.group=b=a.g("legend").attr({zIndex:7}).add(),this.contentGroup=a.g().attr({zIndex:1}).add(b),this.scrollGroup=a.g().add(this.contentGroup));this.renderTitle();p=this.getAllItems();n(p,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});k.reversed&&p.reverse();
|
||||
this.allItems=p;this.display=e=!!p.length;this.itemHeight=this.totalItemWidth=this.maxItemWidth=this.lastLineHeight=0;p.forEach(this.renderItem,this);p.forEach(this.layoutItem,this);p=(this.widthOption||this.offsetWidth)+h;var l=this.lastItemY+this.lastLineHeight+this.titleHeight;l=this.handleOverflow(l);l+=h;g||(this.box=g=a.rect().addClass("highcharts-legend-box").attr({r:k.borderRadius}).add(b),g.isNew=!0);c.styledMode||g.attr({stroke:k.borderColor,"stroke-width":k.borderWidth||0,fill:k.backgroundColor||
|
||||
"none"}).shadow(k.shadow);0<p&&0<l&&(g[g.isNew?"attr":"animate"](g.crisp.call({},{x:0,y:0,width:p,height:l},g.strokeWidth())),g.isNew=!1);g[e?"show":"hide"]();c.styledMode&&"none"===b.getStyle("display")&&(p=l=0);this.legendWidth=p;this.legendHeight=l;e&&(a=c.spacingBox,g=a.y,/(lth|ct|rth)/.test(this.getAlignment())&&0<c.titleOffset[0]?g+=c.titleOffset[0]:/(lbh|cb|rbh)/.test(this.getAlignment())&&0<c.titleOffset[2]&&(g-=c.titleOffset[2]),g!==a.y&&(a=z(a,{y:g})),b.align(z(k,{width:p,height:l,verticalAlign:this.proximate?
|
||||
"top":k.verticalAlign}),!0,a));this.proximate||this.positionItems();B(this,"afterRender")};b.prototype.handleOverflow=function(b){var a=this,c=this.chart,e=c.renderer,g=this.options,k=g.y,h=this.padding;k=c.spacingBox.height+("top"===g.verticalAlign?-k:k)-h;var p=g.maxHeight,l,n=this.clipRect,f=g.navigation,q=x(f.animation,!0),d=f.arrowSize||12,J=this.nav,H=this.pages,u,z=this.allItems,m=function(d){"number"===typeof d?n.attr({height:d}):n&&(a.clipRect=n.destroy(),a.contentGroup.clip());a.contentGroup.div&&
|
||||
(a.contentGroup.div.style.clip=d?"rect("+h+"px,9999px,"+(h+d)+"px,0)":"auto")},A=function(b){a[b]=e.circle(0,0,1.3*d).translate(d/2,d/2).add(J);c.styledMode||a[b].attr("fill","rgba(0,0,0,0.0001)");return a[b]};"horizontal"!==g.layout||"middle"===g.verticalAlign||g.floating||(k/=2);p&&(k=Math.min(k,p));H.length=0;b>k&&!1!==f.enabled?(this.clipHeight=l=Math.max(k-20-this.titleHeight-h,0),this.currentPage=x(this.currentPage,1),this.fullHeight=b,z.forEach(function(a,d){var b=a._legendItemPos[1],c=Math.round(a.legendItem.getBBox().height),
|
||||
e=H.length;if(!e||b-H[e-1]>l&&(u||b)!==H[e-1])H.push(u||b),e++;a.pageIx=e-1;u&&(z[d-1].pageIx=e-1);d===z.length-1&&b+c-H[e-1]>l&&b!==u&&(H.push(b),a.pageIx=e);b!==u&&(u=b)}),n||(n=a.clipRect=e.clipRect(0,h,9999,0),a.contentGroup.clip(n)),m(l),J||(this.nav=J=e.g().attr({zIndex:1}).add(this.group),this.up=e.symbol("triangle",0,0,d,d).add(J),A("upTracker").on("click",function(){a.scroll(-1,q)}),this.pager=e.text("",15,10).addClass("highcharts-legend-navigation"),c.styledMode||this.pager.css(f.style),
|
||||
this.pager.add(J),this.down=e.symbol("triangle-down",0,0,d,d).add(J),A("downTracker").on("click",function(){a.scroll(1,q)})),a.scroll(0),b=k):J&&(m(),this.nav=J.destroy(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return b};b.prototype.scroll=function(b,a){var c=this,e=this.chart,g=this.pages,k=g.length,h=this.currentPage+b;b=this.clipHeight;var p=this.options.navigation,n=this.pager,q=this.padding;h>k&&(h=k);0<h&&("undefined"!==typeof a&&u(a,e),this.nav.attr({translateX:q,translateY:b+
|
||||
this.padding+7+this.titleHeight,visibility:"visible"}),[this.up,this.upTracker].forEach(function(a){a.attr({"class":1===h?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})}),n.attr({text:h+"/"+k}),[this.down,this.downTracker].forEach(function(a){a.attr({x:18+this.pager.getBBox().width,"class":h===k?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"})},this),e.styledMode||(this.up.attr({fill:1===h?p.inactiveColor:p.activeColor}),this.upTracker.css({cursor:1===h?"default":
|
||||
"pointer"}),this.down.attr({fill:h===k?p.inactiveColor:p.activeColor}),this.downTracker.css({cursor:h===k?"default":"pointer"})),this.scrollOffset=-g[h-1]+this.initialItemY,this.scrollGroup.animate({translateY:this.scrollOffset}),this.currentPage=h,this.positionCheckboxes(),a=f.animObject(x(a,e.renderer.globalAnimation,!0)),l(function(){B(c,"afterScroll",{currentPage:h})},a.duration||0))};return b}();(/Trident\/7\.0/.test(b.navigator&&b.navigator.userAgent)||q)&&m(g.prototype,"positionItem",function(b,
|
||||
c){var a=this,e=function(){c._legendItemPos&&b.call(a,c)};e();a.bubbleLegend||setTimeout(e)});f.Legend=g;return f.Legend});P(y,"parts/Chart.js",[y["parts/Globals.js"],y["parts/Legend.js"],y["parts/MSPointer.js"],y["parts/Pointer.js"],y["parts/Time.js"],y["parts/Utilities.js"]],function(f,m,I,r,F,N){var G=N.addEvent,B=N.animate,D=N.animObject,K=N.attr,z=N.createElement,x=N.css,A=N.defined,u=N.discardElement,n=N.erase,l=N.error,q=N.extend,e=N.find,b=N.fireEvent,g=N.getStyle,p=N.isArray,c=N.isFunction,
|
||||
a=N.isNumber,w=N.isObject,E=N.isString,v=N.merge,k=N.numberFormat,h=N.objectEach,t=N.pick,L=N.pInt,M=N.relativeLength,Q=N.removeEvent,C=N.setAnimation,d=N.splat,J=N.syncTimeout,H=N.uniqueKey,T=f.doc,W=f.Axis,U=f.defaultOptions,S=f.charts,O=f.marginNames,X=f.seriesTypes,y=f.win,Z=f.Chart=function(){this.getArgs.apply(this,arguments)};f.chart=function(a,d,b){return new Z(a,d,b)};q(Z.prototype,{callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(E(a[0])||a[0].nodeName)this.renderTo=a.shift();
|
||||
this.init(a[0],a[1])},init:function(a,d){var e,g=a.series,p=a.plotOptions||{};b(this,"init",{args:arguments},function(){a.series=null;e=v(U,a);h(e.plotOptions,function(a,d){w(a)&&(a.tooltip=p[d]&&v(p[d].tooltip)||void 0)});e.tooltip.userOptions=a.chart&&a.chart.forExport&&a.tooltip.userOptions||a.tooltip;e.series=a.series=g;this.userOptions=a;var t=e.chart,l=t.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.labelCollectors=[];this.callback=d;this.isResizing=0;this.options=e;this.axes=
|
||||
[];this.series=[];this.time=a.time&&Object.keys(a.time).length?new F(a.time):f.time;this.numberFormatter=t.numberFormatter||k;this.styledMode=t.styledMode;this.hasCartesianSeries=t.showAxes;var n=this;n.index=S.length;S.push(n);f.chartCount++;l&&h(l,function(a,d){c(a)&&G(n,d,a)});n.xAxis=[];n.yAxis=[];n.pointCount=n.colorCounter=n.symbolCounter=0;b(n,"afterInit");n.firstRender()})},initSeries:function(a){var d=this.options.chart;d=a.type||d.type||d.defaultSeriesType;var b=X[d];b||l(17,!0,this,{missingModuleFor:d});
|
||||
d=new b;d.init(this,a);return d},setSeriesData:function(){this.getSeriesOrderByLinks().forEach(function(a){a.points||a.data||!a.enabledDataSorting||a.setData(a.options.data,!1)})},getSeriesOrderByLinks:function(){return this.series.concat().sort(function(a,d){return a.linkedSeries.length||d.linkedSeries.length?d.linkedSeries.length-a.linkedSeries.length:0})},orderSeries:function(a){var d=this.series;for(a=a||0;a<d.length;a++)d[a]&&(d[a].index=a,d[a].name=d[a].getName())},isInsidePlot:function(a,d,
|
||||
c){var e=c?d:a;a=c?a:d;e={x:e,y:a,isInsidePlot:0<=e&&e<=this.plotWidth&&0<=a&&a<=this.plotHeight};b(this,"afterIsInsidePlot",e);return e.isInsidePlot},redraw:function(a){b(this,"beforeRedraw");var d=this.axes,c=this.series,e=this.pointer,h=this.legend,k=this.userOptions.legend,g=this.isDirtyLegend,p=this.hasCartesianSeries,t=this.isDirtyBox,l=this.renderer,n=l.isHidden(),f=[];this.setResponsive&&this.setResponsive(!1);C(this.hasRendered?a:!1,this);n&&this.temporaryDisplay();this.layOutTitles();for(a=
|
||||
c.length;a--;){var w=c[a];if(w.options.stacking){var J=!0;if(w.isDirty){var H=!0;break}}}if(H)for(a=c.length;a--;)w=c[a],w.options.stacking&&(w.isDirty=!0);c.forEach(function(a){a.isDirty&&("point"===a.options.legendType?(a.updateTotals&&a.updateTotals(),g=!0):k&&(k.labelFormatter||k.labelFormat)&&(g=!0));a.isDirtyData&&b(a,"updatedData")});g&&h&&h.options.enabled&&(h.render(),this.isDirtyLegend=!1);J&&this.getStacks();p&&d.forEach(function(a){a.updateNames();a.setScale()});this.getMargins();p&&(d.forEach(function(a){a.isDirty&&
|
||||
(t=!0)}),d.forEach(function(a){var d=a.min+","+a.max;a.extKey!==d&&(a.extKey=d,f.push(function(){b(a,"afterSetExtremes",q(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(t||J)&&a.redraw()}));t&&this.drawChartBox();b(this,"predraw");c.forEach(function(a){(t||a.isDirty)&&a.visible&&a.redraw();a.isDirtyData=!1});e&&e.reset(!0);l.draw();b(this,"redraw");b(this,"render");n&&this.temporaryDisplay(!0);f.forEach(function(a){a.call()})},get:function(a){function d(d){return d.id===a||d.options&&d.options.id===
|
||||
a}var b=this.series,c;var h=e(this.axes,d)||e(this.series,d);for(c=0;!h&&c<b.length;c++)h=e(b[c].points||[],d);return h},getAxes:function(){var a=this,c=this.options,e=c.xAxis=d(c.xAxis||{});c=c.yAxis=d(c.yAxis||{});b(this,"getAxes");e.forEach(function(a,d){a.index=d;a.isX=!0});c.forEach(function(a,d){a.index=d});e.concat(c).forEach(function(d){new W(a,d)});b(this,"afterGetAxes")},getSelectedPoints:function(){var a=[];this.series.forEach(function(d){a=a.concat(d.getPointsCollection().filter(function(a){return t(a.selectedStaging,
|
||||
a.selected)}))});return a},getSelectedSeries:function(){return this.series.filter(function(a){return a.selected})},setTitle:function(a,d,b){this.applyDescription("title",a);this.applyDescription("subtitle",d);this.applyDescription("caption",void 0);this.layOutTitles(b)},applyDescription:function(a,d){var b=this,c="title"===a?{color:"#333333",fontSize:this.options.isStock?"16px":"18px"}:{color:"#666666"};c=this.options[a]=v(!this.styledMode&&{style:c},this.options[a],d);var e=this[a];e&&d&&(this[a]=
|
||||
e=e.destroy());c&&!e&&(e=this.renderer.text(c.text,0,0,c.useHTML).attr({align:c.align,"class":"highcharts-"+a,zIndex:c.zIndex||4}).add(),e.update=function(d){b[{title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"}[a]](d)},this.styledMode||e.css(c.style),this[a]=e)},layOutTitles:function(a){var d=[0,0,0],c=this.renderer,e=this.spacingBox;["title","subtitle","caption"].forEach(function(a){var b=this[a],h=this.options[a],k=h.verticalAlign||"top";a="title"===a?-3:"top"===k?d[0]+2:0;if(b){if(!this.styledMode)var g=
|
||||
h.style.fontSize;g=c.fontMetrics(g,b).b;b.css({width:(h.width||e.width+(h.widthAdjust||0))+"px"});var p=Math.round(b.getBBox(h.useHTML).height);b.align(q({y:"bottom"===k?g:a+g,height:p},h),!1,"spacingBox");h.floating||("top"===k?d[0]=Math.ceil(d[0]+p):"bottom"===k&&(d[2]=Math.ceil(d[2]+p)))}},this);d[0]&&"top"===(this.options.title.verticalAlign||"top")&&(d[0]+=this.options.title.margin);d[2]&&"bottom"===this.options.caption.verticalAlign&&(d[2]+=this.options.caption.margin);var h=!this.titleOffset||
|
||||
this.titleOffset.join(",")!==d.join(",");this.titleOffset=d;b(this,"afterLayOutTitles");!this.isDirtyBox&&h&&(this.isDirtyBox=this.isDirtyLegend=h,this.hasRendered&&t(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,d=a.width;a=a.height;var b=this.renderTo;A(d)||(this.containerWidth=g(b,"width"));A(a)||(this.containerHeight=g(b,"height"));this.chartWidth=Math.max(0,d||this.containerWidth||600);this.chartHeight=Math.max(0,M(a,this.chartWidth)||(1<this.containerHeight?
|
||||
this.containerHeight:400))},temporaryDisplay:function(a){var d=this.renderTo;if(a)for(;d&&d.style;)d.hcOrigStyle&&(x(d,d.hcOrigStyle),delete d.hcOrigStyle),d.hcOrigDetached&&(T.body.removeChild(d),d.hcOrigDetached=!1),d=d.parentNode;else for(;d&&d.style;){T.body.contains(d)||d.parentNode||(d.hcOrigDetached=!0,T.body.appendChild(d));if("none"===g(d,"display",!1)||d.hcOricDetached)d.hcOrigStyle={display:d.style.display,height:d.style.height,overflow:d.style.overflow},a={display:"block",overflow:"hidden"},
|
||||
d!==this.renderTo&&(a.height=0),x(d,a),d.offsetWidth||d.style.setProperty("display","block","important");d=d.parentNode;if(d===T.body)break}},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var d=this.options,c=d.chart;var e=this.renderTo;var h=H(),k,g;e||(this.renderTo=e=c.renderTo);E(e)&&(this.renderTo=e=T.getElementById(e));e||l(13,!0,this);var p=L(K(e,"data-highcharts-chart"));a(p)&&S[p]&&S[p].hasRendered&&S[p].destroy();K(e,"data-highcharts-chart",
|
||||
this.index);e.innerHTML="";c.skipClone||e.offsetWidth||this.temporaryDisplay();this.getChartSize();p=this.chartWidth;var t=this.chartHeight;x(e,{overflow:"hidden"});this.styledMode||(k=q({position:"relative",overflow:"hidden",width:p+"px",height:t+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"},c.style));this.container=e=z("div",{id:h},k,e);this._cursor=e.style.cursor;this.renderer=new (f[c.renderer]||f.Renderer)(e,p,t,null,c.forExport,d.exporting&&
|
||||
d.exporting.allowHTML,this.styledMode);C(void 0,this);this.setClassName(c.className);if(this.styledMode)for(g in d.defs)this.renderer.definition(d.defs[g]);else this.renderer.setStyle(c.style);this.renderer.chartIndex=this.index;b(this,"afterGetContainer")},getMargins:function(a){var d=this.spacing,c=this.margin,e=this.titleOffset;this.resetMargins();e[0]&&!A(c[0])&&(this.plotTop=Math.max(this.plotTop,e[0]+d[0]));e[2]&&!A(c[2])&&(this.marginBottom=Math.max(this.marginBottom,e[2]+d[2]));this.legend&&
|
||||
this.legend.display&&this.legend.adjustMargins(c,d);b(this,"getMargins");a||this.getAxisMargins()},getAxisMargins:function(){var a=this,d=a.axisOffset=[0,0,0,0],b=a.colorAxis,c=a.margin,e=function(a){a.forEach(function(a){a.visible&&a.getOffset()})};a.hasCartesianSeries?e(a.axes):b&&b.length&&e(b);O.forEach(function(b,e){A(c[e])||(a[b]+=d[e])});a.setChartSize()},reflow:function(a){var d=this,b=d.options.chart,c=d.renderTo,e=A(b.width)&&A(b.height),h=b.width||g(c,"width");b=b.height||g(c,"height");
|
||||
c=a?a.target:y;if(!e&&!d.isPrinting&&h&&b&&(c===y||c===T)){if(h!==d.containerWidth||b!==d.containerHeight)N.clearTimeout(d.reflowTimeout),d.reflowTimeout=J(function(){d.container&&d.setSize(void 0,void 0,!1)},a?100:0);d.containerWidth=h;d.containerHeight=b}},setReflow:function(a){var d=this;!1===a||this.unbindReflow?!1===a&&this.unbindReflow&&(this.unbindReflow=this.unbindReflow()):(this.unbindReflow=G(y,"resize",function(a){d.options&&d.reflow(a)}),G(this,"destroy",this.unbindReflow))},setSize:function(a,
|
||||
d,c){var e=this,h=e.renderer;e.isResizing+=1;C(c,e);e.oldChartHeight=e.chartHeight;e.oldChartWidth=e.chartWidth;"undefined"!==typeof a&&(e.options.chart.width=a);"undefined"!==typeof d&&(e.options.chart.height=d);e.getChartSize();if(!e.styledMode){var k=h.globalAnimation;(k?B:x)(e.container,{width:e.chartWidth+"px",height:e.chartHeight+"px"},k)}e.setChartSize(!0);h.setSize(e.chartWidth,e.chartHeight,c);e.axes.forEach(function(a){a.isDirty=!0;a.setScale()});e.isDirtyLegend=!0;e.isDirtyBox=!0;e.layOutTitles();
|
||||
e.getMargins();e.redraw(c);e.oldChartHeight=null;b(e,"resize");J(function(){e&&b(e,"endResize",null,function(){--e.isResizing})},D(k).duration||0)},setChartSize:function(a){var d=this.inverted,c=this.renderer,e=this.chartWidth,h=this.chartHeight,k=this.options.chart,g=this.spacing,p=this.clipOffset,t,l,n,f;this.plotLeft=t=Math.round(this.plotLeft);this.plotTop=l=Math.round(this.plotTop);this.plotWidth=n=Math.max(0,Math.round(e-t-this.marginRight));this.plotHeight=f=Math.max(0,Math.round(h-l-this.marginBottom));
|
||||
this.plotSizeX=d?f:n;this.plotSizeY=d?n:f;this.plotBorderWidth=k.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:g[3],y:g[0],width:e-g[3]-g[1],height:h-g[0]-g[2]};this.plotBox=c.plotBox={x:t,y:l,width:n,height:f};e=2*Math.floor(this.plotBorderWidth/2);d=Math.ceil(Math.max(e,p[3])/2);c=Math.ceil(Math.max(e,p[0])/2);this.clipBox={x:d,y:c,width:Math.floor(this.plotSizeX-Math.max(e,p[1])/2-d),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(e,p[2])/2-c))};a||this.axes.forEach(function(a){a.setAxisSize();
|
||||
a.setAxisTranslation()});b(this,"afterSetChartSize",{skipAxes:a})},resetMargins:function(){b(this,"resetMargins");var a=this,d=a.options.chart;["margin","spacing"].forEach(function(b){var c=d[b],e=w(c)?c:[c,c,c,c];["Top","Right","Bottom","Left"].forEach(function(c,h){a[b][h]=t(d[b+c],e[h])})});O.forEach(function(d,c){a[d]=t(a.margin[c],a.spacing[c])});a.axisOffset=[0,0,0,0];a.clipOffset=[0,0,0,0]},drawChartBox:function(){var a=this.options.chart,d=this.renderer,c=this.chartWidth,e=this.chartHeight,
|
||||
h=this.chartBackground,k=this.plotBackground,g=this.plotBorder,p=this.styledMode,t=this.plotBGImage,l=a.backgroundColor,n=a.plotBackgroundColor,f=a.plotBackgroundImage,w,J=this.plotLeft,H=this.plotTop,v=this.plotWidth,q=this.plotHeight,C=this.plotBox,L=this.clipRect,u=this.clipBox,x="animate";h||(this.chartBackground=h=d.rect().addClass("highcharts-background").add(),x="attr");if(p)var E=w=h.strokeWidth();else{E=a.borderWidth||0;w=E+(a.shadow?8:0);l={fill:l||"none"};if(E||h["stroke-width"])l.stroke=
|
||||
a.borderColor,l["stroke-width"]=E;h.attr(l).shadow(a.shadow)}h[x]({x:w/2,y:w/2,width:c-w-E%2,height:e-w-E%2,r:a.borderRadius});x="animate";k||(x="attr",this.plotBackground=k=d.rect().addClass("highcharts-plot-background").add());k[x](C);p||(k.attr({fill:n||"none"}).shadow(a.plotShadow),f&&(t?(f!==t.attr("href")&&t.attr("href",f),t.animate(C)):this.plotBGImage=d.image(f,J,H,v,q).add()));L?L.animate({width:u.width,height:u.height}):this.clipRect=d.clipRect(u);x="animate";g||(x="attr",this.plotBorder=
|
||||
g=d.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());p||g.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||0,fill:"none"});g[x](g.crisp({x:J,y:H,width:v,height:q},-g.strokeWidth()));this.isDirtyBox=!1;b(this,"afterDrawChartBox")},propFromSeries:function(){var a=this,d=a.options.chart,c,b=a.options.series,e,h;["inverted","angular","polar"].forEach(function(k){c=X[d.type||d.defaultSeriesType];h=d[k]||c&&c.prototype[k];for(e=b&&b.length;!h&&e--;)(c=X[b[e].type])&&c.prototype[k]&&
|
||||
(h=!0);a[k]=h})},linkSeries:function(){var a=this,d=a.series;d.forEach(function(a){a.linkedSeries.length=0});d.forEach(function(d){var c=d.options.linkedTo;E(c)&&(c=":previous"===c?a.series[d.index-1]:a.get(c))&&c.linkedParent!==d&&(c.linkedSeries.push(d),d.linkedParent=c,c.enabledDataSorting&&d.setDataSortingOptions(),d.visible=t(d.options.visible,c.options.visible,d.visible))});b(this,"afterLinkSeries")},renderSeries:function(){this.series.forEach(function(a){a.translate();a.render()})},renderLabels:function(){var a=
|
||||
this,d=a.options.labels;d.items&&d.items.forEach(function(c){var b=q(d.style,c.style),e=L(b.left)+a.plotLeft,h=L(b.top)+a.plotTop+12;delete b.left;delete b.top;a.renderer.text(c.html,e,h).attr({zIndex:2}).css(b).add()})},render:function(){var a=this.axes,d=this.colorAxis,c=this.renderer,b=this.options,e=0,h=function(a){a.forEach(function(a){a.visible&&a.render()})};this.setTitle();this.legend=new m(this,b.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();b=this.plotWidth;
|
||||
a.some(function(a){if(a.horiz&&a.visible&&a.options.labels.enabled&&a.series.length)return e=21,!0});var k=this.plotHeight=Math.max(this.plotHeight-e,0);a.forEach(function(a){a.setScale()});this.getAxisMargins();var g=1.1<b/this.plotWidth;var p=1.05<k/this.plotHeight;if(g||p)a.forEach(function(a){(a.horiz&&g||!a.horiz&&p)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries?h(a):d&&d.length&&h(d);this.seriesGroup||(this.seriesGroup=c.g("series-group").attr({zIndex:3}).add());
|
||||
this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.updateContainerScaling();this.hasRendered=!0},addCredits:function(a){var d=this;a=v(!0,this.options.credits,a);a.enabled&&!this.credits&&(this.credits=this.renderer.text(a.text+(this.mapCredits||""),0,0).addClass("highcharts-credits").on("click",function(){a.href&&(y.location.href=a.href)}).attr({align:a.position.align,zIndex:8}),d.styledMode||this.credits.css(a.style),this.credits.add().align(a.position),
|
||||
this.credits.update=function(a){d.credits=d.credits.destroy();d.addCredits(a)})},updateContainerScaling:function(){var a=this.container;if(a.offsetWidth&&a.offsetHeight&&a.getBoundingClientRect){var d=a.getBoundingClientRect(),c=d.width/a.offsetWidth;a=d.height/a.offsetHeight;1!==c||1!==a?this.containerScaling={scaleX:c,scaleY:a}:delete this.containerScaling}},destroy:function(){var a=this,d=a.axes,c=a.series,e=a.container,k,g=e&&e.parentNode;b(a,"destroy");a.renderer.forExport?n(S,a):S[a.index]=
|
||||
void 0;f.chartCount--;a.renderTo.removeAttribute("data-highcharts-chart");Q(a);for(k=d.length;k--;)d[k]=d[k].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(k=c.length;k--;)c[k]=c[k].destroy();"title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" ").forEach(function(d){var c=a[d];c&&c.destroy&&(a[d]=c.destroy())});e&&(e.innerHTML="",Q(e),g&&u(e));h(a,function(d,
|
||||
c){delete a[c]})},firstRender:function(){var a=this,d=a.options;if(!a.isReadyToRender||a.isReadyToRender()){a.getContainer();a.resetMargins();a.setChartSize();a.propFromSeries();a.getAxes();(p(d.series)?d.series:[]).forEach(function(d){a.initSeries(d)});a.linkSeries();a.setSeriesData();b(a,"beforeRender");r&&(a.pointer=f.hasTouch||!y.PointerEvent&&!y.MSPointerEvent?new r(a,d):new I(a,d));a.render();if(!a.renderer.imgCount&&!a.hasLoaded)a.onload();a.temporaryDisplay(!0)}},onload:function(){this.callbacks.concat([this.callback]).forEach(function(a){a&&
|
||||
"undefined"!==typeof this.index&&a.apply(this,[this])},this);b(this,"load");b(this,"render");A(this.index)&&this.setReflow(this.options.chart.reflow);this.hasLoaded=!0}})});P(y,"parts/ScrollablePlotArea.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.addEvent,r=m.createElement,F=m.pick,y=m.stop;m=f.Chart;"";I(m,"afterSetChartSize",function(m){var r=this.options.chart.scrollablePlotArea,D=r&&r.minWidth;r=r&&r.minHeight;if(!this.renderer.forExport){if(D){if(this.scrollablePixelsX=
|
||||
D=Math.max(0,D-this.chartWidth)){this.plotWidth+=D;this.inverted?(this.clipBox.height+=D,this.plotBox.height+=D):(this.clipBox.width+=D,this.plotBox.width+=D);var G={1:{name:"right",value:D}}}}else r&&(this.scrollablePixelsY=D=Math.max(0,r-this.chartHeight))&&(this.plotHeight+=D,this.inverted?(this.clipBox.width+=D,this.plotBox.width+=D):(this.clipBox.height+=D,this.plotBox.height+=D),G={2:{name:"bottom",value:D}});G&&!m.skipAxes&&this.axes.forEach(function(z){G[z.side]?z.getPlotLinePath=function(){var x=
|
||||
G[z.side].name,m=this[x];this[x]=m-G[z.side].value;var u=f.Axis.prototype.getPlotLinePath.apply(this,arguments);this[x]=m;return u}:(z.setAxisSize(),z.setAxisTranslation())})}});I(m,"render",function(){this.scrollablePixelsX||this.scrollablePixelsY?(this.setUpScrolling&&this.setUpScrolling(),this.applyFixed()):this.fixedDiv&&this.applyFixed()});m.prototype.setUpScrolling=function(){var f=this,m={WebkitOverflowScrolling:"touch",overflowX:"hidden",overflowY:"hidden"};this.scrollablePixelsX&&(m.overflowX=
|
||||
"auto");this.scrollablePixelsY&&(m.overflowY="auto");this.scrollingContainer=r("div",{className:"highcharts-scrolling"},m,this.renderTo);I(this.scrollingContainer,"scroll",function(){f.pointer&&delete f.pointer.chartPosition});this.innerContainer=r("div",{className:"highcharts-inner-container"},null,this.scrollingContainer);this.innerContainer.appendChild(this.container);this.setUpScrolling=null};m.prototype.moveFixedElements=function(){var f=this.container,m=this.fixedRenderer,r=".highcharts-contextbutton .highcharts-credits .highcharts-legend .highcharts-legend-checkbox .highcharts-navigator-series .highcharts-navigator-xaxis .highcharts-navigator-yaxis .highcharts-navigator .highcharts-reset-zoom .highcharts-scrollbar .highcharts-subtitle .highcharts-title".split(" "),
|
||||
F;this.scrollablePixelsX&&!this.inverted?F=".highcharts-yaxis":this.scrollablePixelsX&&this.inverted?F=".highcharts-xaxis":this.scrollablePixelsY&&!this.inverted?F=".highcharts-xaxis":this.scrollablePixelsY&&this.inverted&&(F=".highcharts-yaxis");r.push(F,F+"-labels");r.forEach(function(z){[].forEach.call(f.querySelectorAll(z),function(f){(f.namespaceURI===m.SVG_NS?m.box:m.box.parentNode).appendChild(f);f.style.pointerEvents="auto"})})};m.prototype.applyFixed=function(){var m,B=!this.fixedDiv,D=this.options.chart.scrollablePlotArea;
|
||||
B?(this.fixedDiv=r("div",{className:"highcharts-fixed"},{position:"absolute",overflow:"hidden",pointerEvents:"none",zIndex:2},null,!0),this.renderTo.insertBefore(this.fixedDiv,this.renderTo.firstChild),this.renderTo.style.overflow="visible",this.fixedRenderer=m=new f.Renderer(this.fixedDiv,this.chartWidth,this.chartHeight),this.scrollableMask=m.path().attr({fill:this.options.chart.backgroundColor||"#fff","fill-opacity":F(D.opacity,.85),zIndex:-1}).addClass("highcharts-scrollable-mask").add(),this.moveFixedElements(),
|
||||
I(this,"afterShowResetZoom",this.moveFixedElements),I(this,"afterLayOutTitles",this.moveFixedElements)):this.fixedRenderer.setSize(this.chartWidth,this.chartHeight);m=this.chartWidth+(this.scrollablePixelsX||0);var K=this.chartHeight+(this.scrollablePixelsY||0);y(this.container);this.container.style.width=m+"px";this.container.style.height=K+"px";this.renderer.boxWrapper.attr({width:m,height:K,viewBox:[0,0,m,K].join(" ")});this.chartBackground.attr({width:m,height:K});this.scrollablePixelsY&&(this.scrollingContainer.style.height=
|
||||
this.chartHeight+"px");B&&(D.scrollPositionX&&(this.scrollingContainer.scrollLeft=this.scrollablePixelsX*D.scrollPositionX),D.scrollPositionY&&(this.scrollingContainer.scrollTop=this.scrollablePixelsY*D.scrollPositionY));K=this.axisOffset;B=this.plotTop-K[0]-1;D=this.plotLeft-K[3]-1;m=this.plotTop+this.plotHeight+K[2]+1;K=this.plotLeft+this.plotWidth+K[1]+1;var z=this.plotLeft+this.plotWidth-(this.scrollablePixelsX||0),x=this.plotTop+this.plotHeight-(this.scrollablePixelsY||0);B=this.scrollablePixelsX?
|
||||
["M",0,B,"L",this.plotLeft-1,B,"L",this.plotLeft-1,m,"L",0,m,"Z","M",z,B,"L",this.chartWidth,B,"L",this.chartWidth,m,"L",z,m,"Z"]:this.scrollablePixelsY?["M",D,0,"L",D,this.plotTop-1,"L",K,this.plotTop-1,"L",K,0,"Z","M",D,x,"L",D,this.chartHeight,"L",K,this.chartHeight,"L",K,x,"Z"]:["M",0,0];"adjustHeight"!==this.redrawTrigger&&this.scrollableMask.attr({d:B})}});P(y,"mixins/legend-symbol.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.merge,r=m.pick;f.LegendSymbolMixin={drawRectangle:function(f,
|
||||
m){var G=f.symbolHeight,B=f.options.squareSymbol;m.legendSymbol=this.chart.renderer.rect(B?(f.symbolWidth-G)/2:0,f.baseline-G+1,B?G:f.symbolWidth,G,r(f.options.symbolRadius,G/2)).addClass("highcharts-point").attr({zIndex:3}).add(m.legendGroup)},drawLineMarker:function(f){var m=this.options,G=m.marker,B=f.symbolWidth,D=f.symbolHeight,F=D/2,z=this.chart.renderer,x=this.legendGroup;f=f.baseline-Math.round(.3*f.fontMetrics.b);var A={};this.chart.styledMode||(A={"stroke-width":m.lineWidth||0},m.dashStyle&&
|
||||
(A.dashstyle=m.dashStyle));this.legendLine=z.path(["M",0,f,"L",B,f]).addClass("highcharts-graph").attr(A).add(x);G&&!1!==G.enabled&&B&&(m=Math.min(r(G.radius,F),F),0===this.symbol.indexOf("url")&&(G=I(G,{width:D,height:D}),m=0),this.legendSymbol=G=z.symbol(this.symbol,B/2-m,f-m,2*m,2*m,G).addClass("highcharts-point").add(x),G.isMarker=!0)}};return f.LegendSymbolMixin});P(y,"parts/Point.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){"";var I=m.animObject,r=m.defined,F=m.erase,y=
|
||||
m.extend,G=m.format,B=m.getNestedProperty,D=m.isArray,K=m.isNumber,z=m.isObject,x=m.syncTimeout,A=m.pick,u=m.removeEvent,n=m.uniqueKey,l=f.fireEvent;m=function(){function f(){this.colorIndex=this.category=void 0;this.formatPrefix="point";this.id=void 0;this.isNull=!1;this.percentage=this.options=this.name=void 0;this.selected=!1;this.total=this.series=void 0;this.visible=!0;this.x=void 0}f.prototype.animateBeforeDestroy=function(){var e=this,b={x:e.startXPos,opacity:0},g,p=e.getGraphicalProps();p.singular.forEach(function(c){g=
|
||||
"dataLabel"===c;e[c]=e[c].animate(g?{x:e[c].startXPos,y:e[c].startYPos,opacity:0}:b)});p.plural.forEach(function(c){e[c].forEach(function(a){a.element&&a.animate(y({x:e.startXPos},a.startYPos?{x:a.startXPos,y:a.startYPos}:{}))})})};f.prototype.applyOptions=function(e,b){var g=this.series,p=g.options.pointValKey||g.pointValKey;e=f.prototype.optionsToObject.call(this,e);y(this,e);this.options=this.options?y(this.options,e):e;e.group&&delete this.group;e.dataLabels&&delete this.dataLabels;p&&(this.y=
|
||||
f.prototype.getNestedProperty.call(this,p));this.formatPrefix=(this.isNull=A(this.isValid&&!this.isValid(),null===this.x||!K(this.y)))?"null":"point";this.selected&&(this.state="select");"name"in this&&"undefined"===typeof b&&g.xAxis&&g.xAxis.hasNames&&(this.x=g.xAxis.nameToX(this));"undefined"===typeof this.x&&g&&(this.x="undefined"===typeof b?g.autoIncrement(this):b);return this};f.prototype.destroy=function(){function e(){if(b.graphic||b.dataLabel||b.dataLabels)u(b),b.destroyElements();for(l in b)b[l]=
|
||||
null}var b=this,g=b.series,p=g.chart;g=g.options.dataSorting;var c=p.hoverPoints,a=I(b.series.chart.renderer.globalAnimation),l;b.legendItem&&p.legend.destroyItem(b);c&&(b.setState(),F(c,b),c.length||(p.hoverPoints=null));if(b===p.hoverPoint)b.onMouseOut();g&&g.enabled?(this.animateBeforeDestroy(),x(e,a.duration)):e();p.pointCount--};f.prototype.destroyElements=function(e){var b=this;e=b.getGraphicalProps(e);e.singular.forEach(function(e){b[e]=b[e].destroy()});e.plural.forEach(function(e){b[e].forEach(function(b){b.element&&
|
||||
b.destroy()});delete b[e]})};f.prototype.firePointEvent=function(e,b,g){var p=this,c=this.series.options;(c.point.events[e]||p.options&&p.options.events&&p.options.events[e])&&p.importEvents();"click"===e&&c.allowPointSelect&&(g=function(a){p.select&&p.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});l(p,e,b,g)};f.prototype.getClassName=function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(this.isNull?" highcharts-null-point":"")+
|
||||
("undefined"!==typeof this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")+(this.zone&&this.zone.className?" "+this.zone.className.replace("highcharts-negative",""):"")};f.prototype.getGraphicalProps=function(e){var b=this,g=[],p,c={singular:[],plural:[]};e=e||{graphic:1,dataLabel:1};e.graphic&&g.push("graphic","shadowGroup");e.dataLabel&&g.push("dataLabel","dataLabelUpper","connector");for(p=g.length;p--;){var a=g[p];b[a]&&c.singular.push(a)}["dataLabel",
|
||||
"connector"].forEach(function(a){var g=a+"s";e[a]&&b[g]&&c.plural.push(g)});return c};f.prototype.getLabelConfig=function(){return{x:this.category,y:this.y,color:this.color,colorIndex:this.colorIndex,key:this.name||this.category,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}};f.prototype.getNestedProperty=function(e){if(e)return 0===e.indexOf("custom.")?B(e,this.options):this[e]};f.prototype.getZone=function(){var e=this.series,b=e.zones;e=e.zoneAxis||
|
||||
"y";var g=0,p;for(p=b[g];this[e]>=p.value;)p=b[++g];this.nonZonedColor||(this.nonZonedColor=this.color);this.color=p&&p.color&&!this.options.color?p.color:this.nonZonedColor;return p};f.prototype.hasNewShapeType=function(){return(this.graphic&&(this.graphic.symbolName||this.graphic.element.nodeName))!==this.shapeType};f.prototype.init=function(e,b,g){this.series=e;this.applyOptions(b,g);this.id=r(this.id)?this.id:n();this.resolveColor();e.chart.pointCount++;l(this,"afterInit");return this};f.prototype.optionsToObject=
|
||||
function(e){var b={},g=this.series,p=g.options.keys,c=p||g.pointArrayMap||["y"],a=c.length,l=0,n=0;if(K(e)||null===e)b[c[0]]=e;else if(D(e))for(!p&&e.length>a&&(g=typeof e[0],"string"===g?b.name=e[0]:"number"===g&&(b.x=e[0]),l++);n<a;)p&&"undefined"===typeof e[l]||(0<c[n].indexOf(".")?f.prototype.setNestedProperty(b,e[l],c[n]):b[c[n]]=e[l]),l++,n++;else"object"===typeof e&&(b=e,e.dataLabels&&(g._hasPointLabels=!0),e.marker&&(g._hasPointMarkers=!0));return b};f.prototype.resolveColor=function(){var e=
|
||||
this.series;var b=e.chart.options.chart.colorCount;var g=e.chart.styledMode;g||this.options.color||(this.color=e.color);e.options.colorByPoint?(g||(b=e.options.colors||e.chart.options.colors,this.color=this.color||b[e.colorCounter],b=b.length),g=e.colorCounter,e.colorCounter++,e.colorCounter===b&&(e.colorCounter=0)):g=e.colorIndex;this.colorIndex=A(this.colorIndex,g)};f.prototype.setNestedProperty=function(e,b,g){g.split(".").reduce(function(e,c,a,g){e[c]=g.length-1===a?b:z(e[c],!0)?e[c]:{};return e[c]},
|
||||
e);return e};f.prototype.tooltipFormatter=function(e){var b=this.series,g=b.tooltipOptions,p=A(g.valueDecimals,""),c=g.valuePrefix||"",a=g.valueSuffix||"";b.chart.styledMode&&(e=b.chart.tooltip.styledModeFormat(e));(b.pointArrayMap||["y"]).forEach(function(b){b="{point."+b;if(c||a)e=e.replace(RegExp(b+"}","g"),c+b+"}"+a);e=e.replace(RegExp(b+"}","g"),b+":,."+p+"f}")});return G(e,{point:this,series:this.series},b.chart)};return f}();f.Point=m;return f.Point});P(y,"parts/Series.js",[y["parts/Globals.js"],
|
||||
y["mixins/legend-symbol.js"],y["parts/Point.js"],y["parts/Utilities.js"]],function(f,m,I,r){"";var F=r.addEvent,y=r.animObject,G=r.arrayMax,B=r.arrayMin,D=r.clamp,K=r.correctFloat,z=r.defined,x=r.erase,A=r.error,u=r.extend,n=r.find,l=r.fireEvent,q=r.getNestedProperty,e=r.isArray,b=r.isFunction,g=r.isNumber,p=r.isString,c=r.merge,a=r.objectEach,w=r.pick,E=r.removeEvent,v=r.seriesType,k=r.splat,h=r.syncTimeout,t=f.defaultOptions,L=f.defaultPlotOptions,M=f.seriesTypes,Q=f.SVGElement,C=f.win;f.Series=
|
||||
v("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{enabledThreshold:2,lineColor:"#ffffff",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:50},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){var a=this.series.chart.numberFormatter;return"number"!==typeof this.y?"":a(this.y,-1)},padding:5,style:{fontSize:"11px",
|
||||
fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:50},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:50},opacity:.2}},stickyTracking:!0,turboThreshold:1E3,findNearestPointBy:"x"},{axisTypes:["xAxis","yAxis"],coll:"series",colorCounter:0,cropShoulder:1,directTouch:!1,eventsToUnbind:[],
|
||||
isCartesian:!0,parallelArrays:["x","y"],pointClass:I,requireSorting:!0,sorted:!0,init:function(d,c){l(this,"init",{options:c});var e=this,h=d.series,k;this.eventOptions=this.eventOptions||{};e.chart=d;e.options=c=e.setOptions(c);e.linkedSeries=[];e.bindAxes();u(e,{name:c.name,state:"",visible:!1!==c.visible,selected:!0===c.selected});var g=c.events;a(g,function(a,d){b(a)&&e.eventOptions[d]!==a&&(b(e.eventOptions[d])&&E(e,d,e.eventOptions[d]),e.eventOptions[d]=a,F(e,d,a))});if(g&&g.click||c.point&&
|
||||
c.point.events&&c.point.events.click||c.allowPointSelect)d.runTrackerClick=!0;e.getColor();e.getSymbol();e.parallelArrays.forEach(function(a){e[a+"Data"]||(e[a+"Data"]=[])});e.isCartesian&&(d.hasCartesianSeries=!0);h.length&&(k=h[h.length-1]);e._i=w(k&&k._i,-1)+1;d.orderSeries(this.insert(h));c.dataSorting&&c.dataSorting.enabled?e.setDataSortingOptions():e.points||e.data||e.setData(c.data,!1);l(this,"afterInit")},is:function(a){return M[a]&&this instanceof M[a]},insert:function(a){var d=this.options.index,
|
||||
c;if(g(d)){for(c=a.length;c--;)if(d>=w(a[c].options.index,a[c]._i)){a.splice(c+1,0,this);break}-1===c&&a.unshift(this);c+=1}else a.push(this);return w(c,a.length-1)},bindAxes:function(){var a=this,c=a.options,b=a.chart,e;l(this,"bindAxes",null,function(){(a.axisTypes||[]).forEach(function(d){b[d].forEach(function(b){e=b.options;if(c[d]===e.index||"undefined"!==typeof c[d]&&c[d]===e.id||"undefined"===typeof c[d]&&0===e.index)a.insert(b.series),a[d]=b,b.isDirty=!0});a[d]||a.optionalAxis===d||A(18,!0,
|
||||
b)})});l(this,"afterBindAxes")},updateParallelArrays:function(a,c){var d=a.series,b=arguments,e=g(c)?function(b){var e="y"===b&&d.toYData?d.toYData(a):a[b];d[b+"Data"][c]=e}:function(a){Array.prototype[c].apply(d[a+"Data"],Array.prototype.slice.call(b,2))};d.parallelArrays.forEach(e)},hasData:function(){return this.visible&&"undefined"!==typeof this.dataMax&&"undefined"!==typeof this.dataMin||this.visible&&this.yData&&0<this.yData.length},autoIncrement:function(){var a=this.options,c=this.xIncrement,
|
||||
b,e=a.pointIntervalUnit,h=this.chart.time;c=w(c,a.pointStart,0);this.pointInterval=b=w(this.pointInterval,a.pointInterval,1);e&&(a=new h.Date(c),"day"===e?h.set("Date",a,h.get("Date",a)+b):"month"===e?h.set("Month",a,h.get("Month",a)+b):"year"===e&&h.set("FullYear",a,h.get("FullYear",a)+b),b=a.getTime()-c);this.xIncrement=c+b;return c},setDataSortingOptions:function(){var a=this.options;u(this,{requireSorting:!1,sorted:!1,enabledDataSorting:!0,allowDG:!1});z(a.pointRange)||(a.pointRange=1)},setOptions:function(a){var d=
|
||||
this.chart,b=d.options,e=b.plotOptions,h=d.userOptions||{};a=c(a);d=d.styledMode;var k={plotOptions:e,userOptions:a};l(this,"setOptions",k);var g=k.plotOptions[this.type],p=h.plotOptions||{};this.userOptions=k.userOptions;h=c(g,e.series,h.plotOptions&&h.plotOptions[this.type],a);this.tooltipOptions=c(t.tooltip,t.plotOptions.series&&t.plotOptions.series.tooltip,t.plotOptions[this.type].tooltip,b.tooltip.userOptions,e.series&&e.series.tooltip,e[this.type].tooltip,a.tooltip);this.stickyTracking=w(a.stickyTracking,
|
||||
p[this.type]&&p[this.type].stickyTracking,p.series&&p.series.stickyTracking,this.tooltipOptions.shared&&!this.noSharedTooltip?!0:h.stickyTracking);null===g.marker&&delete h.marker;this.zoneAxis=h.zoneAxis;b=this.zones=(h.zones||[]).slice();!h.negativeColor&&!h.negativeFillColor||h.zones||(e={value:h[this.zoneAxis+"Threshold"]||h.threshold||0,className:"highcharts-negative"},d||(e.color=h.negativeColor,e.fillColor=h.negativeFillColor),b.push(e));b.length&&z(b[b.length-1].value)&&b.push(d?{}:{color:this.color,
|
||||
fillColor:this.fillColor});l(this,"afterSetOptions",{options:h});return h},getName:function(){return w(this.options.name,"Series "+(this.index+1))},getCyclic:function(a,c,b){var d=this.chart,e=this.userOptions,h=a+"Index",k=a+"Counter",g=b?b.length:w(d.options.chart[a+"Count"],d[a+"Count"]);if(!c){var p=w(e[h],e["_"+h]);z(p)||(d.series.length||(d[k]=0),e["_"+h]=p=d[k]%g,d[k]+=1);b&&(c=b[p])}"undefined"!==typeof p&&(this[h]=p);this[a]=c},getColor:function(){this.chart.styledMode?this.getCyclic("color"):
|
||||
this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||L[this.type].color,this.chart.options.colors)},getPointsCollection:function(){return(this.hasGroupedData?this.points:this.data)||[]},getSymbol:function(){this.getCyclic("symbol",this.options.marker.symbol,this.chart.options.symbols)},findPointIndex:function(a,c){var d=a.id,b=a.x,e=this.points,h,k=this.options.dataSorting;if(d)var p=this.chart.get(d);else if(this.linkedParent||this.enabledDataSorting){var t=
|
||||
k&&k.matchByName?"name":"index";p=n(e,function(d){return!d.touched&&d[t]===a[t]});if(!p)return}if(p){var l=p&&p.index;"undefined"!==typeof l&&(h=!0)}"undefined"===typeof l&&g(b)&&(l=this.xData.indexOf(b,c));-1!==l&&"undefined"!==typeof l&&this.cropped&&(l=l>=this.cropStart?l-this.cropStart:l);!h&&e[l]&&e[l].touched&&(l=void 0);return l},drawLegendSymbol:m.drawLineMarker,updateData:function(a,c){var d=this.options,b=d.dataSorting,e=this.points,h=[],k,p,l,t=this.requireSorting,f=a.length===e.length,
|
||||
n=!0;this.xIncrement=null;a.forEach(function(a,c){var p=z(a)&&this.pointClass.prototype.optionsToObject.call({series:this},a)||{};var n=p.x;if(p.id||g(n)){if(n=this.findPointIndex(p,l),-1===n||"undefined"===typeof n?h.push(a):e[n]&&a!==d.data[n]?(e[n].update(a,!1,null,!1),e[n].touched=!0,t&&(l=n+1)):e[n]&&(e[n].touched=!0),!f||c!==n||b&&b.enabled||this.hasDerivedData)k=!0}else h.push(a)},this);if(k)for(a=e.length;a--;)(p=e[a])&&!p.touched&&p.remove&&p.remove(!1,c);else!f||b&&b.enabled?n=!1:(a.forEach(function(a,
|
||||
d){e[d].update&&a!==e[d].y&&e[d].update(a,!1,null,!1)}),h.length=0);e.forEach(function(a){a&&(a.touched=!1)});if(!n)return!1;h.forEach(function(a){this.addPoint(a,!1,null,null,!1)},this);null===this.xIncrement&&this.xData&&this.xData.length&&(this.xIncrement=G(this.xData),this.autoIncrement());return!0},setData:function(a,c,b,h){var d=this,k=d.points,l=k&&k.length||0,t,f=d.options,n=d.chart,v=f.dataSorting,q=null,J=d.xAxis;q=f.turboThreshold;var C=this.xData,L=this.yData,H=(t=d.pointArrayMap)&&t.length,
|
||||
m=f.keys,u=0,x=1,E;a=a||[];t=a.length;c=w(c,!0);v&&v.enabled&&(a=this.sortData(a));!1!==h&&t&&l&&!d.cropped&&!d.hasGroupedData&&d.visible&&!d.isSeriesBoosting&&(E=this.updateData(a,b));if(!E){d.xIncrement=null;d.colorCounter=0;this.parallelArrays.forEach(function(a){d[a+"Data"].length=0});if(q&&t>q)if(q=d.getFirstValidPoint(a),g(q))for(b=0;b<t;b++)C[b]=this.autoIncrement(),L[b]=a[b];else if(e(q))if(H)for(b=0;b<t;b++)h=a[b],C[b]=h[0],L[b]=h.slice(1,H+1);else for(m&&(u=m.indexOf("x"),x=m.indexOf("y"),
|
||||
u=0<=u?u:0,x=0<=x?x:1),b=0;b<t;b++)h=a[b],C[b]=h[u],L[b]=h[x];else A(12,!1,n);else for(b=0;b<t;b++)"undefined"!==typeof a[b]&&(h={series:d},d.pointClass.prototype.applyOptions.apply(h,[a[b]]),d.updateParallelArrays(h,b));L&&p(L[0])&&A(14,!0,n);d.data=[];d.options.data=d.userOptions.data=a;for(b=l;b--;)k[b]&&k[b].destroy&&k[b].destroy();J&&(J.minRange=J.userMinRange);d.isDirty=n.isDirtyBox=!0;d.isDirtyData=!!k;b=!1}"point"===f.legendType&&(this.processData(),this.generatePoints());c&&n.redraw(b)},
|
||||
sortData:function(a){var d=this,b=d.options.dataSorting.sortKey||"y",c=function(a,d){return z(d)&&a.pointClass.prototype.optionsToObject.call({series:a},d)||{}};a.forEach(function(b,e){a[e]=c(d,b);a[e].index=e},this);a.concat().sort(function(a,d){a=q(b,a);d=q(b,d);return d<a?-1:d>a?1:0}).forEach(function(a,d){a.x=d},this);d.linkedSeries&&d.linkedSeries.forEach(function(d){var b=d.options,e=b.data;b.dataSorting&&b.dataSorting.enabled||!e||(e.forEach(function(b,h){e[h]=c(d,b);a[h]&&(e[h].x=a[h].x,e[h].index=
|
||||
h)}),d.setData(e,!1))});return a},processData:function(a){var d=this.xData,b=this.yData,c=d.length;var e=0;var h=this.xAxis,k=this.options;var g=k.cropThreshold;var p=this.getExtremesFromAll||k.getExtremesFromAll,t=this.isCartesian;k=h&&h.val2lin;var l=h&&h.isLog,f=this.requireSorting;if(t&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;if(h){a=h.getExtremes();var n=a.min;var w=a.max}if(t&&this.sorted&&!p&&(!g||c>g||this.forceCrop))if(d[c-1]<n||d[0]>w)d=[],b=[];else if(this.yData&&(d[0]<
|
||||
n||d[c-1]>w)){e=this.cropData(this.xData,this.yData,n,w);d=e.xData;b=e.yData;e=e.start;var v=!0}for(g=d.length||1;--g;)if(c=l?k(d[g])-k(d[g-1]):d[g]-d[g-1],0<c&&("undefined"===typeof q||c<q))var q=c;else 0>c&&f&&(A(15,!1,this.chart),f=!1);this.cropped=v;this.cropStart=e;this.processedXData=d;this.processedYData=b;this.closestPointRange=this.basePointRange=q},cropData:function(a,b,c,e,h){var d=a.length,k=0,g=d,p;h=w(h,this.cropShoulder);for(p=0;p<d;p++)if(a[p]>=c){k=Math.max(0,p-h);break}for(c=p;c<
|
||||
d;c++)if(a[c]>e){g=c+h;break}return{xData:a.slice(k,g),yData:b.slice(k,g),start:k,end:g}},generatePoints:function(){var a=this.options,b=a.data,c=this.data,e,h=this.processedXData,g=this.processedYData,p=this.pointClass,t=h.length,f=this.cropStart||0,n=this.hasGroupedData;a=a.keys;var w=[],v;c||n||(c=[],c.length=b.length,c=this.data=c);a&&n&&(this.options.keys=!1);for(v=0;v<t;v++){var q=f+v;if(n){var C=(new p).init(this,[h[v]].concat(k(g[v])));C.dataGroup=this.groupMap[v];C.dataGroup.options&&(C.options=
|
||||
C.dataGroup.options,u(C,C.dataGroup.options),delete C.dataLabels)}else(C=c[q])||"undefined"===typeof b[q]||(c[q]=C=(new p).init(this,b[q],h[v]));C&&(C.index=q,w[v]=C)}this.options.keys=a;if(c&&(t!==(e=c.length)||n))for(v=0;v<e;v++)v!==f||n||(v+=t),c[v]&&(c[v].destroyElements(),c[v].plotX=void 0);this.data=c;this.points=w;l(this,"afterGeneratePoints")},getXExtremes:function(a){return{min:B(a),max:G(a)}},getExtremes:function(a){var d=this.xAxis,c=this.yAxis,b=this.processedXData||this.xData,h=[],k=
|
||||
0,p=0;var t=0;var n=this.requireSorting?this.cropShoulder:0,f=c?c.positiveValuesOnly:!1,w;a=a||this.stackedYData||this.processedYData||[];c=a.length;d&&(t=d.getExtremes(),p=t.min,t=t.max);for(w=0;w<c;w++){var v=b[w];var q=a[w];var C=(g(q)||e(q))&&(q.length||0<q||!f);v=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||!d||(b[w+n]||v)>=p&&(b[w-n]||v)<=t;if(C&&v)if(C=q.length)for(;C--;)g(q[C])&&(h[k++]=q[C]);else h[k++]=q}this.dataMin=B(h);this.dataMax=G(h);l(this,"afterGetExtremes")},
|
||||
getFirstValidPoint:function(a){for(var d=null,c=a.length,b=0;null===d&&b<c;)d=a[b],b++;return d},translate:function(){this.processedXData||this.processData();this.generatePoints();var a=this.options,c=a.stacking,b=this.xAxis,h=b.categories,k=this.enabledDataSorting,p=this.yAxis,t=this.points,n=t.length,f=!!this.modifyValue,v,q=this.pointPlacementToXValue(),C=!!q,L=a.threshold,m=a.startFromThreshold?L:0,u,x=this.zoneAxis||"y",E=Number.MAX_VALUE;for(v=0;v<n;v++){var M=t[v],Q=M.x;var A=M.y;var r=M.low,
|
||||
B=c&&p.stacks[(this.negStacks&&A<(m?0:L)?"-":"")+this.stackKey];p.positiveValuesOnly&&null!==A&&0>=A&&(M.isNull=!0);M.plotX=u=K(D(b.translate(Q,0,0,0,1,q,"flags"===this.type),-1E5,1E5));if(c&&this.visible&&B&&B[Q]){var G=this.getStackIndicator(G,Q,this.index);if(!M.isNull){var I=B[Q];var F=I.points[G.key]}}e(F)&&(r=F[0],A=F[1],r===m&&G.key===B[Q].base&&(r=w(g(L)&&L,p.min)),p.positiveValuesOnly&&0>=r&&(r=null),M.total=M.stackTotal=I.total,M.percentage=I.total&&M.y/I.total*100,M.stackY=A,this.irregularWidths||
|
||||
I.setOffset(this.pointXOffset||0,this.barW||0));M.yBottom=z(r)?D(p.translate(r,0,1,0,1),-1E5,1E5):null;f&&(A=this.modifyValue(A,M));M.plotY=A="number"===typeof A&&Infinity!==A?D(p.translate(A,0,1,0,1),-1E5,1E5):void 0;M.isInside="undefined"!==typeof A&&0<=A&&A<=p.len&&0<=u&&u<=b.len;M.clientX=C?K(b.translate(Q,0,0,0,1,q)):u;M.negative=M[x]<(a[x+"Threshold"]||L||0);M.category=h&&"undefined"!==typeof h[M.x]?h[M.x]:M.x;if(!M.isNull&&!1!==M.visible){"undefined"!==typeof y&&(E=Math.min(E,Math.abs(u-y)));
|
||||
var y=u}M.zone=this.zones.length&&M.getZone();!M.graphic&&this.group&&k&&(M.isNew=!0)}this.closestPointRangePx=E;l(this,"afterTranslate")},getValidPoints:function(a,c,b){var d=this.chart;return(a||this.points||[]).filter(function(a){return c&&!d.isInsidePlot(a.plotX,a.plotY,d.inverted)?!1:!1!==a.visible&&(b||!a.isNull)})},getClipBox:function(a,c){var d=this.options,b=this.chart,e=b.inverted,h=this.xAxis,k=h&&this.yAxis;a&&!1===d.clip&&k?a=e?{y:-b.chartWidth+k.len+k.pos,height:b.chartWidth,width:b.chartHeight,
|
||||
x:-b.chartHeight+h.len+h.pos}:{y:-k.pos,height:b.chartHeight,width:b.chartWidth,x:-h.pos}:(a=this.clipBox||b.clipBox,c&&(a.width=b.plotSizeX,a.x=0));return c?{width:a.width,x:a.x}:a},setClip:function(a){var d=this.chart,b=this.options,c=d.renderer,e=d.inverted,h=this.clipBox,k=this.getClipBox(a),g=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,k.height,b.xAxis,b.yAxis].join(),p=d[g],t=d[g+"m"];a&&(k.width=0,e&&(k.x=d.plotHeight+(!1!==b.clip?0:d.plotTop)));p?d.hasLoaded||p.attr(k):(a&&
|
||||
(d[g+"m"]=t=c.clipRect(e?d.plotSizeX+99:-99,e?-d.plotLeft:-d.plotTop,99,e?d.chartWidth:d.chartHeight)),d[g]=p=c.clipRect(k),p.count={length:0});a&&!p.count[this.index]&&(p.count[this.index]=!0,p.count.length+=1);if(!1!==b.clip||a)this.group.clip(a||h?p:d.clipRect),this.markerGroup.clip(t),this.sharedClipKey=g;a||(p.count[this.index]&&(delete p.count[this.index],--p.count.length),0===p.count.length&&g&&d[g]&&(h||(d[g]=d[g].destroy()),d[g+"m"]&&(d[g+"m"]=d[g+"m"].destroy())))},animate:function(a){var d=
|
||||
this.chart,b=y(this.options.animation);if(!d.hasRendered)if(a)this.setClip(b);else{var c=this.sharedClipKey;a=d[c];var e=this.getClipBox(b,!0);a&&a.animate(e,b);d[c+"m"]&&d[c+"m"].animate({width:e.width+99,x:e.x-(d.inverted?0:99)},b)}},afterAnimate:function(){this.setClip();l(this,"afterAnimate");this.finishedAnimating=!0},drawPoints:function(){var a=this.points,b=this.chart,c,e,h=this.options.marker,k=this[this.specialGroup]||this.markerGroup,g=this.xAxis,p=w(h.enabled,!g||g.isRadial?!0:null,this.closestPointRangePx>=
|
||||
h.enabledThreshold*h.radius);if(!1!==h.enabled||this._hasPointMarkers)for(c=0;c<a.length;c++){var t=a[c];var l=(e=t.graphic)?"animate":"attr";var n=t.marker||{};var f=!!t.marker;if((p&&"undefined"===typeof n.enabled||n.enabled)&&!t.isNull&&!1!==t.visible){var v=w(n.symbol,this.symbol);var q=this.markerAttribs(t,t.selected&&"select");this.enabledDataSorting&&(t.startXPos=g.reversed?-q.width:g.width);var C=!1!==t.isInside;e?e[C?"show":"hide"](C).animate(q):C&&(0<q.width||t.hasImage)&&(t.graphic=e=b.renderer.symbol(v,
|
||||
q.x,q.y,q.width,q.height,f?n:h).add(k),this.enabledDataSorting&&b.hasRendered&&(e.attr({x:t.startXPos}),l="animate"));e&&"animate"===l&&e[C?"show":"hide"](C).animate(q);if(e&&!b.styledMode)e[l](this.pointAttribs(t,t.selected&&"select"));e&&e.addClass(t.getClassName(),!0)}else e&&(t.graphic=e.destroy())}},markerAttribs:function(a,b){var d=this.options.marker,c=a.marker||{},e=c.symbol||d.symbol,h=w(c.radius,d.radius);b&&(d=d.states[b],b=c.states&&c.states[b],h=w(b&&b.radius,d&&d.radius,h+(d&&d.radiusPlus||
|
||||
0)));a.hasImage=e&&0===e.indexOf("url");a.hasImage&&(h=0);a={x:Math.floor(a.plotX)-h,y:a.plotY-h};h&&(a.width=a.height=2*h);return a},pointAttribs:function(a,b){var d=this.options.marker,c=a&&a.options,e=c&&c.marker||{},h=this.color,k=c&&c.color,g=a&&a.color;c=w(e.lineWidth,d.lineWidth);var p=a&&a.zone&&a.zone.color;a=1;h=k||p||g||h;k=e.fillColor||d.fillColor||h;h=e.lineColor||d.lineColor||h;b=b||"normal";d=d.states[b];b=e.states&&e.states[b]||{};c=w(b.lineWidth,d.lineWidth,c+w(b.lineWidthPlus,d.lineWidthPlus,
|
||||
0));k=b.fillColor||d.fillColor||k;h=b.lineColor||d.lineColor||h;a=w(b.opacity,d.opacity,a);return{stroke:h,"stroke-width":c,fill:k,opacity:a}},destroy:function(d){var b=this,c=b.chart,e=/AppleWebKit\/533/.test(C.navigator.userAgent),h,k,g=b.data||[],p,t;l(b,"destroy");this.removeEvents(d);(b.axisTypes||[]).forEach(function(a){(t=b[a])&&t.series&&(x(t.series,b),t.isDirty=t.forceRedraw=!0)});b.legendItem&&b.chart.legend.destroyItem(b);for(k=g.length;k--;)(p=g[k])&&p.destroy&&p.destroy();b.points=null;
|
||||
r.clearTimeout(b.animationTimeout);a(b,function(a,d){a instanceof Q&&!a.survive&&(h=e&&"group"===d?"hide":"destroy",a[h]())});c.hoverSeries===b&&(c.hoverSeries=null);x(c.series,b);c.orderSeries();a(b,function(a,c){d&&"hcEvents"===c||delete b[c]})},getGraphPath:function(a,b,c){var d=this,e=d.options,h=e.step,k,g=[],p=[],t;a=a||d.points;(k=a.reversed)&&a.reverse();(h={right:1,center:2}[h]||h&&3)&&k&&(h=4-h);a=this.getValidPoints(a,!1,!(e.connectNulls&&!b&&!c));a.forEach(function(k,l){var n=k.plotX,
|
||||
f=k.plotY,w=a[l-1];(k.leftCliff||w&&w.rightCliff)&&!c&&(t=!0);k.isNull&&!z(b)&&0<l?t=!e.connectNulls:k.isNull&&!b?t=!0:(0===l||t?l=["M",k.plotX,k.plotY]:d.getPointSpline?l=d.getPointSpline(a,k,l):h?(l=1===h?["L",w.plotX,f]:2===h?["L",(w.plotX+n)/2,w.plotY,"L",(w.plotX+n)/2,f]:["L",n,w.plotY],l.push("L",n,f)):l=["L",n,f],p.push(k.x),h&&(p.push(k.x),2===h&&p.push(k.x)),g.push.apply(g,l),t=!1)});g.xMap=p;return d.graphPath=g},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),
|
||||
e=this.chart.styledMode,h=[["graph","highcharts-graph"]];e||h[0].push(b.lineColor||this.color||"#cccccc",b.dashStyle);h=a.getZonesGraphs(h);h.forEach(function(d,h){var k=d[0],g=a[k],p=g?"animate":"attr";g?(g.endX=a.preventGraphAnimation?null:c.xMap,g.animate({d:c})):c.length&&(a[k]=g=a.chart.renderer.path(c).addClass(d[1]).attr({zIndex:1}).add(a.group));g&&!e&&(k={stroke:d[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},d[3]?k.dashstyle=d[3]:"square"!==b.linecap&&(k["stroke-linecap"]=
|
||||
k["stroke-linejoin"]="round"),g[p](k).shadow(2>h&&b.shadow));g&&(g.startX=c.xMap,g.isArea=c.isArea)})},getZonesGraphs:function(a){this.zones.forEach(function(d,b){b=["zone-graph-"+b,"highcharts-graph highcharts-zone-graph-"+b+" "+(d.className||"")];this.chart.styledMode||b.push(d.color||this.color,d.dashStyle||this.options.dashStyle);a.push(b)},this);return a},applyZones:function(){var a=this,b=this.chart,c=b.renderer,e=this.zones,h,k,g=this.clips||[],p,t=this.graph,l=this.area,n=Math.max(b.chartWidth,
|
||||
b.chartHeight),f=this[(this.zoneAxis||"y")+"Axis"],v=b.inverted,q,C,L,m=!1;if(e.length&&(t||l)&&f&&"undefined"!==typeof f.min){var u=f.reversed;var x=f.horiz;t&&!this.showLine&&t.hide();l&&l.hide();var M=f.getExtremes();e.forEach(function(d,e){h=u?x?b.plotWidth:0:x?0:f.toPixels(M.min)||0;h=D(w(k,h),0,n);k=D(Math.round(f.toPixels(w(d.value,M.max),!0)||0),0,n);m&&(h=k=f.toPixels(M.max));q=Math.abs(h-k);C=Math.min(h,k);L=Math.max(h,k);f.isXAxis?(p={x:v?L:C,y:0,width:q,height:n},x||(p.x=b.plotHeight-
|
||||
p.x)):(p={x:0,y:v?L:C,width:n,height:q},x&&(p.y=b.plotWidth-p.y));v&&c.isVML&&(p=f.isXAxis?{x:0,y:u?C:L,height:p.width,width:b.chartWidth}:{x:p.y-b.plotLeft-b.spacingBox.x,y:0,width:p.height,height:b.chartHeight});g[e]?g[e].animate(p):g[e]=c.clipRect(p);t&&a["zone-graph-"+e].clip(g[e]);l&&a["zone-area-"+e].clip(g[e]);m=d.value>M.max;a.resetZones&&0===k&&(k=void 0)});this.clips=g}else a.visible&&(t&&t.show(!0),l&&l.show(!0))},invertGroups:function(a){function d(){["group","markerGroup"].forEach(function(d){b[d]&&
|
||||
(c.renderer.isVML&&b[d].attr({width:b.yAxis.len,height:b.xAxis.len}),b[d].width=b.yAxis.len,b[d].height=b.xAxis.len,b[d].invert(b.isRadialSeries?!1:a))})}var b=this,c=b.chart;b.xAxis&&(b.eventsToUnbind.push(F(c,"resize",d)),d(),b.invertGroups=d)},plotGroup:function(a,b,c,e,h){var d=this[a],k=!d;k&&(this[a]=d=this.chart.renderer.g().attr({zIndex:e||.1}).add(h));d.addClass("highcharts-"+b+" highcharts-series-"+this.index+" highcharts-"+this.type+"-series "+(z(this.colorIndex)?"highcharts-color-"+this.colorIndex+
|
||||
" ":"")+(this.options.className||"")+(d.hasClass("highcharts-tracker")?" highcharts-tracker":""),!0);d.attr({visibility:c})[k?"attr":"animate"](this.getPlotBox());return d},getPlotBox:function(){var a=this.chart,b=this.xAxis,c=this.yAxis;a.inverted&&(b=c,c=this.xAxis);return{translateX:b?b.left:a.plotLeft,translateY:c?c.top:a.plotTop,scaleX:1,scaleY:1}},removeEvents:function(a){a?this.eventsToUnbind.length&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind.length=0):E(this)},render:function(){var a=
|
||||
this,b=a.chart,c=a.options,e=!a.finishedAnimating&&b.renderer.isSVG&&y(c.animation).duration,k=a.visible?"inherit":"hidden",g=c.zIndex,p=a.hasRendered,t=b.seriesGroup,n=b.inverted;l(this,"render");var f=a.plotGroup("group","series",k,g,t);a.markerGroup=a.plotGroup("markerGroup","markers",k,g,t);e&&a.animate&&a.animate(!0);f.inverted=a.isCartesian||a.invertable?n:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.visible&&a.drawPoints();a.drawDataLabels&&a.drawDataLabels();a.redrawPoints&&a.redrawPoints();
|
||||
a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(n);!1===c.clip||a.sharedClipKey||p||f.clip(b.clipRect);e&&a.animate&&a.animate();p||(a.animationTimeout=h(function(){a.afterAnimate()},e||0));a.isDirty=!1;a.hasRendered=!0;l(a,"afterRender")},redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,e=this.xAxis,h=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:w(e&&e.left,a.plotLeft),translateY:w(h&&
|
||||
h.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var d=this.xAxis,c=this.yAxis,e=this.chart.inverted;return this.searchKDTree({clientX:e?d.len-a.chartY+d.pos:a.chartX-d.pos,plotY:e?c.len-a.chartX+c.pos:a.chartY-c.pos},b,a)},buildKDTree:function(a){function d(a,c,e){var h;if(h=a&&a.length){var k=b.kdAxisArray[c%e];a.sort(function(a,d){return a[k]-d[k]});h=Math.floor(h/2);return{point:a[h],left:d(a.slice(0,h),c+1,e),
|
||||
right:d(a.slice(h+1),c+1,e)}}}this.buildingKdTree=!0;var b=this,c=-1<b.options.findNearestPointBy.indexOf("y")?2:1;delete b.kdTree;h(function(){b.kdTree=d(b.getValidPoints(null,!b.directTouch),c,c);b.buildingKdTree=!1},b.options.kdNow||a&&"touchstart"===a.type?0:1)},searchKDTree:function(a,b,c){function d(a,b,c,p){var t=b.point,l=e.kdAxisArray[c%p],n=t;var f=z(a[h])&&z(t[h])?Math.pow(a[h]-t[h],2):null;var w=z(a[k])&&z(t[k])?Math.pow(a[k]-t[k],2):null;w=(f||0)+(w||0);t.dist=z(w)?Math.sqrt(w):Number.MAX_VALUE;
|
||||
t.distX=z(f)?Math.sqrt(f):Number.MAX_VALUE;l=a[l]-t[l];w=0>l?"left":"right";f=0>l?"right":"left";b[w]&&(w=d(a,b[w],c+1,p),n=w[g]<n[g]?w:t);b[f]&&Math.sqrt(l*l)<n[g]&&(a=d(a,b[f],c+1,p),n=a[g]<n[g]?a:n);return n}var e=this,h=this.kdAxisArray[0],k=this.kdAxisArray[1],g=b?"distX":"dist";b=-1<e.options.findNearestPointBy.indexOf("y")?2:1;this.kdTree||this.buildingKdTree||this.buildKDTree(c);if(this.kdTree)return d(a,this.kdTree,b,b)},pointPlacementToXValue:function(){var a=this.options,b=a.pointRange,
|
||||
c=this.xAxis;a=a.pointPlacement;"between"===a&&(a=c.reversed?-.5:.5);return g(a)?a*w(b,c.pointRange):0}});""});P(y,"parts/Stacking.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var I=m.correctFloat,r=m.defined,F=m.destroyObjectProperties,y=m.format,G=m.objectEach,B=m.pick;m=f.Axis;var D=f.Chart,K=f.Series;f.StackItem=function(f,m,A,u,n){var l=f.chart.inverted;this.axis=f;this.isNegative=A;this.options=m=m||{};this.x=u;this.total=null;this.points={};this.stack=n;this.rightCliff=
|
||||
this.leftCliff=0;this.alignOptions={align:m.align||(l?A?"left":"right":"center"),verticalAlign:m.verticalAlign||(l?"middle":A?"bottom":"top"),y:m.y,x:m.x};this.textAlign=m.textAlign||(l?A?"right":"left":"center")};f.StackItem.prototype={destroy:function(){F(this,this.axis)},render:function(f){var m=this.axis.chart,z=this.options,u=z.format;u=u?y(u,this,m):z.formatter.call(this);this.label?this.label.attr({text:u,visibility:"hidden"}):(this.label=m.renderer.label(u,null,null,z.shape,null,null,z.useHTML,
|
||||
!1,"stack-labels"),u={text:u,rotation:z.rotation,padding:B(z.padding,5),visibility:"hidden"},this.label.attr(u),m.styledMode||this.label.css(z.style),this.label.added||this.label.add(f));this.label.labelrank=m.plotHeight},setOffset:function(f,m,A,u,n){var l=this.axis,q=l.chart;u=l.translate(l.usePercentage?100:u?u:this.total,0,0,0,1);A=l.translate(A?A:0);A=r(u)&&Math.abs(u-A);f=B(n,q.xAxis[0].translate(this.x))+f;l=r(u)&&this.getStackBox(q,this,f,u,m,A,l);m=this.label;A=this.isNegative;f="justify"===
|
||||
B(this.options.overflow,"justify");var e=this.textAlign;m&&l&&(n=m.getBBox(),u=m.padding,e="left"===e?q.inverted?-u:u:"right"===e?n.width:q.inverted&&"center"===e?n.width/2:q.inverted?A?n.width+u:-u:n.width/2,A=q.inverted?n.height/2:A?-u:n.height,this.alignOptions.x=B(this.options.x,0),this.alignOptions.y=B(this.options.y,0),l.x-=e,l.y-=A,m.align(this.alignOptions,null,l),q.isInsidePlot(m.alignAttr.x+e-this.alignOptions.x,m.alignAttr.y+A-this.alignOptions.y)?m.show():(m.alignAttr.y=-9999,f=!1),f&&
|
||||
K.prototype.justifyDataLabel.call(this.axis,m,this.alignOptions,m.alignAttr,n,l),m.attr({x:m.alignAttr.x,y:m.alignAttr.y}),B(!f&&this.options.crop,!0)&&((q=q.isInsidePlot(m.x-u+m.width,m.y)&&q.isInsidePlot(m.x+u,m.y))||m.hide()))},getStackBox:function(f,m,A,u,n,l,q){var e=m.axis.reversed,b=f.inverted;f=q.height+q.pos-(b?f.plotLeft:f.plotTop);m=m.isNegative&&!e||!m.isNegative&&e;return{x:b?m?u:u-l:A,y:b?f-A-n:m?f-u-l:f-u,width:b?l:n,height:b?n:l}}};D.prototype.getStacks=function(){var f=this,m=f.inverted;
|
||||
f.yAxis.forEach(function(f){f.stacks&&f.hasVisibleSeries&&(f.oldStacks=f.stacks)});f.series.forEach(function(x){var u=x.xAxis&&x.xAxis.options||{};!x.options.stacking||!0!==x.visible&&!1!==f.options.chart.ignoreHiddenSeries||(x.stackKey=[x.type,B(x.options.stack,""),m?u.top:u.left,m?u.height:u.width].join())})};m.prototype.buildStacks=function(){var m=this.series,x=B(this.options.reversedStacks,!0),A=m.length,u;if(!this.isXAxis){this.usePercentage=!1;for(u=A;u--;){var n=m[x?u:A-u-1];n.setStackedPoints()}for(u=
|
||||
0;u<A;u++)m[u].modifyStacks();f.fireEvent(this,"afterBuildStacks")}};m.prototype.renderStackTotals=function(){var f=this.chart,m=f.renderer,A=this.stacks,u=this.stackTotalGroup;u||(this.stackTotalGroup=u=m.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());u.translate(f.plotLeft,f.plotTop);G(A,function(f){G(f,function(l){l.render(u)})})};m.prototype.resetStacks=function(){var f=this,m=f.stacks;f.isXAxis||G(m,function(m){G(m,function(u,n){u.touched<f.stacksTouched?(u.destroy(),delete m[n]):
|
||||
(u.total=null,u.cumulative=null)})})};m.prototype.cleanStacks=function(){if(!this.isXAxis){if(this.oldStacks)var f=this.stacks=this.oldStacks;G(f,function(f){G(f,function(f){f.cumulative=f.total})})}};K.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var m=this.processedXData,x=this.processedYData,A=[],u=x.length,n=this.options,l=n.threshold,q=B(n.startFromThreshold&&l,0),e=n.stack;n=n.stacking;var b=this.stackKey,
|
||||
g="-"+b,p=this.negStacks,c=this.yAxis,a=c.stacks,w=c.oldStacks,E,v;c.stacksTouched+=1;for(v=0;v<u;v++){var k=m[v];var h=x[v];var t=this.getStackIndicator(t,k,this.index);var L=t.key;var M=(E=p&&h<(q?0:l))?g:b;a[M]||(a[M]={});a[M][k]||(w[M]&&w[M][k]?(a[M][k]=w[M][k],a[M][k].total=null):a[M][k]=new f.StackItem(c,c.options.stackLabels,E,k,e));M=a[M][k];null!==h?(M.points[L]=M.points[this.index]=[B(M.cumulative,q)],r(M.cumulative)||(M.base=L),M.touched=c.stacksTouched,0<t.index&&!1===this.singleStacks&&
|
||||
(M.points[L][0]=M.points[this.index+","+k+",0"][0])):M.points[L]=M.points[this.index]=null;"percent"===n?(E=E?b:g,p&&a[E]&&a[E][k]?(E=a[E][k],M.total=E.total=Math.max(E.total,M.total)+Math.abs(h)||0):M.total=I(M.total+(Math.abs(h)||0))):M.total=I(M.total+(h||0));M.cumulative=B(M.cumulative,q)+(h||0);null!==h&&(M.points[L].push(M.cumulative),A[v]=M.cumulative)}"percent"===n&&(c.usePercentage=!0);this.stackedYData=A;c.oldStacks={}}};K.prototype.modifyStacks=function(){var f=this,m=f.stackKey,A=f.yAxis.stacks,
|
||||
u=f.processedXData,n,l=f.options.stacking;f[l+"Stacker"]&&[m,"-"+m].forEach(function(q){for(var e=u.length,b,g;e--;)if(b=u[e],n=f.getStackIndicator(n,b,f.index,q),g=(b=A[q]&&A[q][b])&&b.points[n.key])f[l+"Stacker"](g,b,e)})};K.prototype.percentStacker=function(f,m,A){m=m.total?100/m.total:0;f[0]=I(f[0]*m);f[1]=I(f[1]*m);this.stackedYData[A]=f[1]};K.prototype.getStackIndicator=function(f,m,A,u){!r(f)||f.x!==m||u&&f.key!==u?f={x:m,index:0,key:u}:f.index++;f.key=[A,m,f.index].join();return f}});P(y,
|
||||
"parts/Dynamics.js",[y["parts/Globals.js"],y["parts/Point.js"],y["parts/Time.js"],y["parts/Utilities.js"]],function(f,m,I,r){var F=r.addEvent,y=r.animate,G=r.createElement,B=r.css,D=r.defined,K=r.erase,z=r.error,x=r.extend,A=r.fireEvent,u=r.isArray,n=r.isNumber,l=r.isObject,q=r.isString,e=r.merge,b=r.objectEach,g=r.pick,p=r.relativeLength,c=r.setAnimation,a=r.splat,w=f.Axis;r=f.Chart;var E=f.Series,v=f.seriesTypes;f.cleanRecursively=function(a,c){var e={};b(a,function(b,h){if(l(a[h],!0)&&!a.nodeType&&
|
||||
c[h])b=f.cleanRecursively(a[h],c[h]),Object.keys(b).length&&(e[h]=b);else if(l(a[h])||a[h]!==c[h])e[h]=a[h]});return e};x(r.prototype,{addSeries:function(a,b,c){var e,h=this;a&&(b=g(b,!0),A(h,"addSeries",{options:a},function(){e=h.initSeries(a);h.isDirtyLegend=!0;h.linkSeries();e.enabledDataSorting&&e.setData(a.data,!1);A(h,"afterAddSeries",{series:e});b&&h.redraw(c)}));return e},addAxis:function(a,b,c,e){return this.createAxis(b?"xAxis":"yAxis",{axis:a,redraw:c,animation:e})},addColorAxis:function(a,
|
||||
b,c){return this.createAxis("colorAxis",{axis:a,redraw:b,animation:c})},createAxis:function(b,c){var h=this.options,k="colorAxis"===b,p=c.redraw,l=c.animation;c=e(c.axis,{index:this[b].length,isX:"xAxis"===b});var n=k?new f.ColorAxis(this,c):new w(this,c);h[b]=a(h[b]||{});h[b].push(c);k&&(this.isDirtyLegend=!0,this.axes.forEach(function(a){a.series=[]}),this.series.forEach(function(a){a.bindAxes();a.isDirtyData=!0}));g(p,!0)&&this.redraw(l);return n},showLoading:function(a){var b=this,c=b.options,
|
||||
e=b.loadingDiv,k=c.loading,p=function(){e&&B(e,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};e||(b.loadingDiv=e=G("div",{className:"highcharts-loading highcharts-loading-hidden"},null,b.container),b.loadingSpan=G("span",{className:"highcharts-loading-inner"},null,e),F(b,"redraw",p));e.className="highcharts-loading";b.loadingSpan.innerHTML=g(a,c.lang.loading,"");b.styledMode||(B(e,x(k.style,{zIndex:10})),B(b.loadingSpan,k.labelStyle),b.loadingShown||(B(e,
|
||||
{opacity:0,display:""}),y(e,{opacity:k.style.opacity||.5},{duration:k.showDuration||0})));b.loadingShown=!0;p()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&(b.className="highcharts-loading highcharts-loading-hidden",this.styledMode||y(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){B(b,{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),
|
||||
propsRequireReflow:"margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft".split(" "),propsRequireUpdateSeries:"chart.inverted chart.polar chart.ignoreHiddenSeries chart.type colors plotOptions time tooltip".split(" "),collectionsWithUpdate:["xAxis","yAxis","zAxis","series"],update:function(c,h,t,l){var k=this,w={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle",caption:"setCaption"},v,d,m,u=c.isResponsiveOptions,L=[];A(k,"update",
|
||||
{options:c});u||k.setResponsive(!1,!0);c=f.cleanRecursively(c,k.options);e(!0,k.userOptions,c);if(v=c.chart){e(!0,k.options.chart,v);"className"in v&&k.setClassName(v.className);"reflow"in v&&k.setReflow(v.reflow);if("inverted"in v||"polar"in v||"type"in v){k.propFromSeries();var E=!0}"alignTicks"in v&&(E=!0);b(v,function(a,b){-1!==k.propsRequireUpdateSeries.indexOf("chart."+b)&&(d=!0);-1!==k.propsRequireDirtyBox.indexOf(b)&&(k.isDirtyBox=!0);u||-1===k.propsRequireReflow.indexOf(b)||(m=!0)});!k.styledMode&&
|
||||
"style"in v&&k.renderer.setStyle(v.style)}!k.styledMode&&c.colors&&(this.options.colors=c.colors);c.plotOptions&&e(!0,this.options.plotOptions,c.plotOptions);c.time&&this.time===f.time&&(this.time=new I(c.time));b(c,function(a,b){if(k[b]&&"function"===typeof k[b].update)k[b].update(a,!1);else if("function"===typeof k[w[b]])k[w[b]](a);"chart"!==b&&-1!==k.propsRequireUpdateSeries.indexOf(b)&&(d=!0)});this.collectionsWithUpdate.forEach(function(d){if(c[d]){if("series"===d){var b=[];k[d].forEach(function(a,
|
||||
d){a.options.isInternal||b.push(g(a.options.index,d))})}a(c[d]).forEach(function(a,c){(c=D(a.id)&&k.get(a.id)||k[d][b?b[c]:c])&&c.coll===d&&(c.update(a,!1),t&&(c.touched=!0));!c&&t&&k.collectionsWithInit[d]&&(k.collectionsWithInit[d][0].apply(k,[a].concat(k.collectionsWithInit[d][1]||[]).concat([!1])).touched=!0)});t&&k[d].forEach(function(a){a.touched||a.options.isInternal?delete a.touched:L.push(a)})}});L.forEach(function(a){a.remove&&a.remove(!1)});E&&k.axes.forEach(function(a){a.update({},!1)});
|
||||
d&&k.getSeriesOrderByLinks().forEach(function(a){a.chart&&a.update({},!1)},this);c.loading&&e(!0,k.options.loading,c.loading);E=v&&v.width;v=v&&v.height;q(v)&&(v=p(v,E||k.chartWidth));m||n(E)&&E!==k.chartWidth||n(v)&&v!==k.chartHeight?k.setSize(E,v,l):g(h,!0)&&k.redraw(l);A(k,"afterUpdate",{options:c,redraw:h,animation:l})},setSubtitle:function(a,b){this.applyDescription("subtitle",a);this.layOutTitles(b)},setCaption:function(a,b){this.applyDescription("caption",a);this.layOutTitles(b)}});r.prototype.collectionsWithInit=
|
||||
{xAxis:[r.prototype.addAxis,[!0]],yAxis:[r.prototype.addAxis,[!1]],series:[r.prototype.addSeries]};x(m.prototype,{update:function(a,b,c,e){function h(){k.applyOptions(a);var e=d&&k.hasDummyGraphic;e=null===k.y?!e:e;d&&e&&(k.graphic=d.destroy(),delete k.hasDummyGraphic);l(a,!0)&&(d&&d.element&&a&&a.marker&&"undefined"!==typeof a.marker.symbol&&(k.graphic=d.destroy()),a&&a.dataLabels&&k.dataLabel&&(k.dataLabel=k.dataLabel.destroy()),k.connector&&(k.connector=k.connector.destroy()));t=k.index;p.updateParallelArrays(k,
|
||||
t);n.data[t]=l(n.data[t],!0)||l(a,!0)?k.options:g(a,n.data[t]);p.isDirty=p.isDirtyData=!0;!p.fixedBox&&p.hasCartesianSeries&&(f.isDirtyBox=!0);"point"===n.legendType&&(f.isDirtyLegend=!0);b&&f.redraw(c)}var k=this,p=k.series,d=k.graphic,t,f=p.chart,n=p.options;b=g(b,!0);!1===e?h():k.firePointEvent("update",{options:a},h)},remove:function(a,b){this.series.removePoint(this.series.data.indexOf(this),a,b)}});x(E.prototype,{addPoint:function(a,b,c,e,p){var h=this.options,k=this.data,d=this.chart,t=this.xAxis;
|
||||
t=t&&t.hasNames&&t.names;var l=h.data,f=this.xData,n;b=g(b,!0);var v={series:this};this.pointClass.prototype.applyOptions.apply(v,[a]);var w=v.x;var q=f.length;if(this.requireSorting&&w<f[q-1])for(n=!0;q&&f[q-1]>w;)q--;this.updateParallelArrays(v,"splice",q,0,0);this.updateParallelArrays(v,q);t&&v.name&&(t[w]=v.name);l.splice(q,0,a);n&&(this.data.splice(q,0,null),this.processData());"point"===h.legendType&&this.generatePoints();c&&(k[0]&&k[0].remove?k[0].remove(!1):(k.shift(),this.updateParallelArrays(v,
|
||||
"shift"),l.shift()));!1!==p&&A(this,"addPoint",{point:v});this.isDirtyData=this.isDirty=!0;b&&d.redraw(e)},removePoint:function(a,b,e){var h=this,k=h.data,p=k[a],t=h.points,d=h.chart,l=function(){t&&t.length===k.length&&t.splice(a,1);k.splice(a,1);h.options.data.splice(a,1);h.updateParallelArrays(p||{series:h},"splice",a,1);p&&p.destroy();h.isDirty=!0;h.isDirtyData=!0;b&&d.redraw()};c(e,d);b=g(b,!0);p?p.firePointEvent("remove",null,l):l()},remove:function(a,b,c,e){function h(){k.destroy(e);k.remove=
|
||||
null;p.isDirtyLegend=p.isDirtyBox=!0;p.linkSeries();g(a,!0)&&p.redraw(b)}var k=this,p=k.chart;!1!==c?A(k,"remove",null,h):h()},update:function(a,b){a=f.cleanRecursively(a,this.userOptions);A(this,"update",{options:a});var c=this,h=c.chart,k=c.userOptions,p=c.initialType||c.type,l=a.type||k.type||h.options.chart.type,d=!(this.hasDerivedData||a.dataGrouping||l&&l!==this.type||"undefined"!==typeof a.pointStart||a.pointInterval||a.pointIntervalUnit||a.keys),n=v[p].prototype,w,q=["group","markerGroup",
|
||||
"dataLabelsGroup","transformGroup"],m=["eventOptions","navigatorSeries","baseSeries"],u=c.finishedAnimating&&{animation:!1},E={};d&&(m.push("data","isDirtyData","points","processedXData","processedYData","xIncrement","_hasPointMarkers","_hasPointLabels","mapMap","mapData","minY","maxY","minX","maxX"),!1!==a.visible&&m.push("area","graph"),c.parallelArrays.forEach(function(a){m.push(a+"Data")}),a.data&&(a.dataSorting&&x(c.options.dataSorting,a.dataSorting),this.setData(a.data,!1)));a=e(k,u,{index:"undefined"===
|
||||
typeof k.index?c.index:k.index,pointStart:g(k.pointStart,c.xData[0])},!d&&{data:c.options.data},a);d&&a.data&&(a.data=c.options.data);m=q.concat(m);m.forEach(function(a){m[a]=c[a];delete c[a]});c.remove(!1,null,!1,!0);for(w in n)c[w]=void 0;v[l||p]?x(c,v[l||p].prototype):z(17,!0,h,{missingModuleFor:l||p});m.forEach(function(a){c[a]=m[a]});c.init(h,a);if(d&&this.points){var r=c.options;!1===r.visible?(E.graphic=1,E.dataLabel=1):c._hasPointLabels||(l=r.marker,n=r.dataLabels,l&&(!1===l.enabled||"symbol"in
|
||||
l)&&(E.graphic=1),n&&!1===n.enabled&&(E.dataLabel=1));this.points.forEach(function(a){a&&a.series&&(a.resolveColor(),Object.keys(E).length&&a.destroyElements(E),!1===r.showInLegend&&a.legendItem&&h.legend.destroyItem(a))},this)}a.zIndex!==k.zIndex&&q.forEach(function(d){c[d]&&c[d].attr({zIndex:a.zIndex})});c.initialType=p;h.linkSeries();A(this,"afterUpdate");g(b,!0)&&h.redraw(d?void 0:!1)},setName:function(a){this.name=this.options.name=this.userOptions.name=a;this.chart.isDirtyLegend=!0}});x(w.prototype,
|
||||
{update:function(a,c){var h=this.chart,k=a&&a.events||{};a=e(this.userOptions,a);h.options[this.coll].indexOf&&(h.options[this.coll][h.options[this.coll].indexOf(this.userOptions)]=a);b(h.options[this.coll].events,function(a,b){"undefined"===typeof k[b]&&(k[b]=void 0)});this.destroy(!0);this.init(h,x(a,{events:k}));h.isDirtyBox=!0;g(c,!0)&&h.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,k=e.length;k--;)e[k]&&e[k].remove(!1);K(b.axes,this);K(b[c],this);u(b.options[c])?
|
||||
b.options[c].splice(this.options.index,1):delete b.options[c];b[c].forEach(function(a,b){a.options.index=a.userOptions.index=b});this.destroy();b.isDirtyBox=!0;g(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}})});P(y,"parts/AreaSeries.js",[y["parts/Globals.js"],y["parts/Color.js"],y["mixins/legend-symbol.js"],y["parts/Utilities.js"]],function(f,m,I,r){var F=m.parse,y=r.objectEach,G=r.pick;m=r.seriesType;var B=f.Series;
|
||||
m("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(f){var m=[],z=[],x=this.xAxis,A=this.yAxis,u=A.stacks[this.stackKey],n={},l=this.index,q=A.series,e=q.length,b=G(A.options.reversedStacks,!0)?1:-1,g;f=f||this.points;if(this.options.stacking){for(g=0;g<f.length;g++)f[g].leftNull=f[g].rightNull=void 0,n[f[g].x]=f[g];y(u,function(b,a){null!==b.total&&z.push(a)});z.sort(function(b,a){return b-a});var p=q.map(function(b){return b.visible});z.forEach(function(c,a){var f=
|
||||
0,q,v;if(n[c]&&!n[c].isNull)m.push(n[c]),[-1,1].forEach(function(k){var h=1===k?"rightNull":"leftNull",f=0,w=u[z[a+k]];if(w)for(g=l;0<=g&&g<e;)q=w.points[g],q||(g===l?n[c][h]=!0:p[g]&&(v=u[c].points[g])&&(f-=v[1]-v[0])),g+=b;n[c][1===k?"rightCliff":"leftCliff"]=f});else{for(g=l;0<=g&&g<e;){if(q=u[c].points[g]){f=q[1];break}g+=b}f=A.translate(f,0,1,0,1);m.push({isNull:!0,plotX:x.translate(c,0,0,0,1),x:c,plotY:f,yBottom:f})}})}return m},getGraphPath:function(f){var m=B.prototype.getGraphPath,z=this.options,
|
||||
x=z.stacking,A=this.yAxis,u,n=[],l=[],q=this.index,e=A.stacks[this.stackKey],b=z.threshold,g=Math.round(A.getThreshold(z.threshold));z=G(z.connectNulls,"percent"===x);var p=function(c,p,k){var h=f[c];c=x&&e[h.x].points[q];var t=h[k+"Null"]||0;k=h[k+"Cliff"]||0;h=!0;if(k||t){var v=(t?c[0]:c[1])+k;var w=c[0]+k;h=!!t}else!x&&f[p]&&f[p].isNull&&(v=w=b);"undefined"!==typeof v&&(l.push({plotX:a,plotY:null===v?g:A.getThreshold(v),isNull:h,isCliff:!0}),n.push({plotX:a,plotY:null===w?g:A.getThreshold(w),doCurve:!1}))};
|
||||
f=f||this.points;x&&(f=this.getStackPoints(f));for(u=0;u<f.length;u++){x||(f[u].leftCliff=f[u].rightCliff=f[u].leftNull=f[u].rightNull=void 0);var c=f[u].isNull;var a=G(f[u].rectPlotX,f[u].plotX);var w=G(f[u].yBottom,g);if(!c||z)z||p(u,u-1,"left"),c&&!x&&z||(l.push(f[u]),n.push({x:u,plotX:a,plotY:w})),z||p(u,u+1,"right")}u=m.call(this,l,!0,!0);n.reversed=!0;c=m.call(this,n,!0,!0);c.length&&(c[0]="L");c=u.concat(c);m=m.call(this,l,!1,z);c.xMap=u.xMap;this.areaPath=c;return m},drawGraph:function(){this.areaPath=
|
||||
[];B.prototype.drawGraph.apply(this);var f=this,m=this.areaPath,z=this.options,x=[["area","highcharts-area",this.color,z.fillColor]];this.zones.forEach(function(m,u){x.push(["zone-area-"+u,"highcharts-area highcharts-zone-area-"+u+" "+m.className,m.color||f.color,m.fillColor||z.fillColor])});x.forEach(function(x){var u=x[0],n=f[u],l=n?"animate":"attr",q={};n?(n.endX=f.preventGraphAnimation?null:m.xMap,n.animate({d:m})):(q.zIndex=0,n=f[u]=f.chart.renderer.path(m).addClass(x[1]).add(f.group),n.isArea=
|
||||
!0);f.chart.styledMode||(q.fill=G(x[3],F(x[2]).setOpacity(G(z.fillOpacity,.75)).get()));n[l](q);n.startX=m.xMap;n.shiftUnit=z.step?2:1})},drawLegendSymbol:I.drawRectangle});""});P(y,"parts/SplineSeries.js",[y["parts/Utilities.js"]],function(f){var m=f.pick;f=f.seriesType;f("spline","line",{},{getPointSpline:function(f,r,F){var y=r.plotX,G=r.plotY,B=f[F-1];F=f[F+1];if(B&&!B.isNull&&!1!==B.doCurve&&!r.isCliff&&F&&!F.isNull&&!1!==F.doCurve&&!r.isCliff){f=B.plotY;var D=F.plotX;F=F.plotY;var I=0;var z=
|
||||
(1.5*y+B.plotX)/2.5;var x=(1.5*G+f)/2.5;D=(1.5*y+D)/2.5;var A=(1.5*G+F)/2.5;D!==z&&(I=(A-x)*(D-y)/(D-z)+G-A);x+=I;A+=I;x>f&&x>G?(x=Math.max(f,G),A=2*G-x):x<f&&x<G&&(x=Math.min(f,G),A=2*G-x);A>F&&A>G?(A=Math.max(F,G),x=2*G-A):A<F&&A<G&&(A=Math.min(F,G),x=2*G-A);r.rightContX=D;r.rightContY=A}r=["C",m(B.rightContX,B.plotX),m(B.rightContY,B.plotY),m(z,y),m(x,G),y,G];B.rightContX=B.rightContY=null;return r}});""});P(y,"parts/AreaSplineSeries.js",[y["parts/Globals.js"],y["mixins/legend-symbol.js"],y["parts/Utilities.js"]],
|
||||
function(f,m,y){y=y.seriesType;var r=f.seriesTypes.area.prototype;y("areaspline","spline",f.defaultPlotOptions.area,{getStackPoints:r.getStackPoints,getGraphPath:r.getGraphPath,drawGraph:r.drawGraph,drawLegendSymbol:m.drawRectangle});""});P(y,"parts/ColumnSeries.js",[y["parts/Globals.js"],y["parts/Color.js"],y["mixins/legend-symbol.js"],y["parts/Utilities.js"]],function(f,m,y,r){var F=m.parse,I=r.animObject,G=r.clamp,B=r.defined,D=r.extend,K=r.isNumber,z=r.merge,x=r.pick;m=r.seriesType;var A=f.Series;
|
||||
m("column","line",{borderRadius:0,crisp:!0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1},select:{color:"#cccccc",borderColor:"#000000"}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0,borderColor:"#ffffff"},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){A.prototype.init.apply(this,
|
||||
arguments);var f=this,n=f.chart;n.hasRendered&&n.series.forEach(function(l){l.type===f.type&&(l.isDirty=!0)})},getColumnMetrics:function(){var f=this,n=f.options,l=f.xAxis,q=f.yAxis,e=l.options.reversedStacks;e=l.reversed&&!e||!l.reversed&&e;var b,g={},p=0;!1===n.grouping?p=1:f.chart.series.forEach(function(a){var c=a.yAxis,e=a.options;if(a.type===f.type&&(a.visible||!f.chart.options.chart.ignoreHiddenSeries)&&q.len===c.len&&q.pos===c.pos){if(e.stacking){b=a.stackKey;"undefined"===typeof g[b]&&(g[b]=
|
||||
p++);var h=g[b]}else!1!==e.grouping&&(h=p++);a.columnIndex=h}});var c=Math.min(Math.abs(l.transA)*(l.ordinalSlope||n.pointRange||l.closestPointRange||l.tickInterval||1),l.len),a=c*n.groupPadding,w=(c-2*a)/(p||1);n=Math.min(n.maxPointWidth||l.len,x(n.pointWidth,w*(1-2*n.pointPadding)));f.columnMetrics={width:n,offset:(w-n)/2+(a+((f.columnIndex||0)+(e?1:0))*w-c/2)*(e?-1:1)};return f.columnMetrics},crispCol:function(f,n,l,q){var e=this.chart,b=this.borderWidth,g=-(b%2?.5:0);b=b%2?.5:1;e.inverted&&e.renderer.isVML&&
|
||||
(b+=1);this.options.crisp&&(l=Math.round(f+l)+g,f=Math.round(f)+g,l-=f);q=Math.round(n+q)+b;g=.5>=Math.abs(n)&&.5<q;n=Math.round(n)+b;q-=n;g&&q&&(--n,q+=1);return{x:f,y:n,width:l,height:q}},translate:function(){var f=this,n=f.chart,l=f.options,q=f.dense=2>f.closestPointRange*f.xAxis.transA;q=f.borderWidth=x(l.borderWidth,q?0:1);var e=f.xAxis,b=f.yAxis,g=l.threshold,p=f.translatedThreshold=b.getThreshold(g),c=x(l.minPointLength,5),a=f.getColumnMetrics(),w=a.width,m=f.barW=Math.max(w,1+2*q),v=f.pointXOffset=
|
||||
a.offset,k=f.dataMin,h=f.dataMax;n.inverted&&(p-=.5);l.pointPadding&&(m=Math.ceil(m));A.prototype.translate.apply(f);f.points.forEach(function(a){var l=x(a.yBottom,p),t=999+Math.abs(l),q=w,C=a.plotX;t=G(a.plotY,-t,b.len+t);var d=a.plotX+v,u=m,E=Math.min(t,l),z=Math.max(t,l)-E;if(c&&Math.abs(z)<c){z=c;var r=!b.reversed&&!a.negative||b.reversed&&a.negative;a.y===g&&f.dataMax<=g&&b.min<g&&k!==h&&(r=!r);E=Math.abs(E-p)>c?l-c:p-(r?c:0)}B(a.options.pointWidth)&&(q=u=Math.ceil(a.options.pointWidth),d-=Math.round((q-
|
||||
w)/2));a.barX=d;a.pointWidth=q;a.tooltipPos=n.inverted?[b.len+b.pos-n.plotLeft-t,e.len+e.pos-n.plotTop-(C||0)-v-u/2,z]:[d+u/2,t+b.pos-n.plotTop,z];a.shapeType=f.pointClass.prototype.shapeType||"rect";a.shapeArgs=f.crispCol.apply(f,a.isNull?[d,p,u,0]:[d,E,u,z])})},getSymbol:f.noop,drawLegendSymbol:y.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(f,n){var l=this.options,q=this.pointAttrToOptions||{};var e=q.stroke||
|
||||
"borderColor";var b=q["stroke-width"]||"borderWidth",g=f&&f.color||this.color,p=f&&f[e]||l[e]||this.color||g,c=f&&f[b]||l[b]||this[b]||0;q=f&&f.options.dashStyle||l.dashStyle;var a=x(f&&f.opacity,l.opacity,1);if(f&&this.zones.length){var w=f.getZone();g=f.options.color||w&&(w.color||f.nonZonedColor)||this.color;w&&(p=w.borderColor||p,q=w.dashStyle||q,c=w.borderWidth||c)}n&&f&&(f=z(l.states[n],f.options.states&&f.options.states[n]||{}),n=f.brightness,g=f.color||"undefined"!==typeof n&&F(g).brighten(f.brightness).get()||
|
||||
g,p=f[e]||p,c=f[b]||c,q=f.dashStyle||q,a=x(f.opacity,a));e={fill:g,stroke:p,"stroke-width":c,opacity:a};q&&(e.dashstyle=q);return e},drawPoints:function(){var f=this,n=this.chart,l=f.options,q=n.renderer,e=l.animationLimit||250,b;f.points.forEach(function(g){var p=g.graphic,c=!!p,a=p&&n.pointCount<e?"animate":"attr";if(K(g.plotY)&&null!==g.y){b=g.shapeArgs;p&&g.hasNewShapeType()&&(p=p.destroy());f.enabledDataSorting&&(g.startXPos=f.xAxis.reversed?-(b?b.width:0):f.xAxis.width);p||(g.graphic=p=q[g.shapeType](b).add(g.group||
|
||||
f.group))&&f.enabledDataSorting&&n.hasRendered&&n.pointCount<e&&(p.attr({x:g.startXPos}),c=!0,a="animate");if(p&&c)p[a](z(b));if(l.borderRadius)p[a]({r:l.borderRadius});n.styledMode||p[a](f.pointAttribs(g,g.selected&&"select")).shadow(!1!==g.allowShadow&&l.shadow,null,l.stacking&&!l.borderRadius);p.addClass(g.getClassName(),!0)}else p&&(g.graphic=p.destroy())})},animate:function(f){var n=this,l=this.yAxis,q=n.options,e=this.chart.inverted,b={},g=e?"translateX":"translateY";if(f)b.scaleY=.001,f=G(l.toPixels(q.threshold),
|
||||
l.pos,l.pos+l.len),e?b.translateX=f-l.len:b.translateY=f,n.clipBox&&n.setClip(),n.group.attr(b);else{var p=n.group.attr(g);n.group.animate({scaleY:1},D(I(n.options.animation),{step:function(c,a){b[g]=p+a.pos*(l.pos-p);n.group.attr(b)}}))}},remove:function(){var f=this,n=f.chart;n.hasRendered&&n.series.forEach(function(l){l.type===f.type&&(l.isDirty=!0)});A.prototype.remove.apply(f,arguments)}});""});P(y,"parts/BarSeries.js",[y["parts/Utilities.js"]],function(f){f=f.seriesType;f("bar","column",null,
|
||||
{inverted:!0});""});P(y,"parts/ScatterSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.addEvent;m=m.seriesType;var r=f.Series;m("scatter","line",{lineWidth:0,findNearestPointBy:"xy",jitter:{x:0,y:0},marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 10px"> {series.name}</span><br/>',pointFormat:"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>"}},{sorted:!1,requireSorting:!1,noSharedTooltip:!0,trackerGroups:["group",
|
||||
"markerGroup","dataLabelsGroup"],takeOrdinalPosition:!1,drawGraph:function(){this.options.lineWidth&&r.prototype.drawGraph.call(this)},applyJitter:function(){var f=this,m=this.options.jitter,r=this.points.length;m&&this.points.forEach(function(B,D){["x","y"].forEach(function(y,z){var x="plot"+y.toUpperCase();if(m[y]&&!B.isNull){var A=f[y+"Axis"];var u=m[y]*A.transA;if(A&&!A.isLog){var n=Math.max(0,B[x]-u);A=Math.min(A.len,B[x]+u);z=1E4*Math.sin(D+z*r);B[x]=n+(A-n)*(z-Math.floor(z));"x"===y&&(B.clientX=
|
||||
B.plotX)}}})})}});y(r,"afterTranslate",function(){this.applyJitter&&this.applyJitter()});""});P(y,"mixins/centered-series.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.isNumber,r=m.pick,F=m.relativeLength,N=f.deg2rad;f.CenteredSeriesMixin={getCenter:function(){var f=this.options,m=this.chart,D=2*(f.slicedOffset||0),y=m.plotWidth-2*D,z=m.plotHeight-2*D,x=f.center,A=Math.min(y,z),u=f.size,n=f.innerSize||0;"string"===typeof u&&(u=parseFloat(u));"string"===typeof n&&(n=parseFloat(n));
|
||||
f=[r(x[0],"50%"),r(x[1],"50%"),r(u&&0>u?void 0:f.size,"100%"),r(n&&0>n?void 0:f.innerSize||0,"0%")];m.angular&&(f[3]=0);for(x=0;4>x;++x)u=f[x],m=2>x||2===x&&/%$/.test(u),f[x]=F(u,[y,z,A,f[2]][x])+(m?D:0);f[3]>f[2]&&(f[3]=f[2]);return f},getStartAndEndRadians:function(f,m){f=y(f)?f:0;m=y(m)&&m>f&&360>m-f?m:f+360;return{start:N*(f+-90),end:N*(m+-90)}}}});P(y,"parts/PieSeries.js",[y["parts/Globals.js"],y["mixins/legend-symbol.js"],y["parts/Point.js"],y["parts/Utilities.js"]],function(f,m,y,r){var F=
|
||||
r.addEvent,I=r.clamp,G=r.defined,B=r.fireEvent,D=r.isNumber,K=r.merge,z=r.pick,x=r.relativeLength,A=r.seriesType,u=r.setAnimation;r=f.CenteredSeriesMixin;var n=r.getStartAndEndRadians,l=f.noop,q=f.Series;A("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{allowOverlap:!0,connectorPadding:5,connectorShape:"fixedOffset",crookDistance:"70%",distance:30,enabled:!0,formatter:function(){return this.point.isNull?void 0:this.point.name},softConnector:!0,x:0},fillColor:void 0,ignoreHiddenPoint:!0,
|
||||
inactiveOtherPoints:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,lineWidth:void 0,states:{hover:{brightness:.1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:f.seriesTypes.column.prototype.pointAttribs,animate:function(e){var b=this,g=b.points,f=b.startAngleRad;e||g.forEach(function(c){var a=c.graphic,
|
||||
e=c.shapeArgs;a&&e&&(a.attr({r:z(c.startR,b.center&&b.center[3]/2),start:f,end:f}),a.animate({r:e.r,start:e.start,end:e.end},b.options.animation))})},hasData:function(){return!!this.processedXData.length},updateTotals:function(){var e,b=0,g=this.points,f=g.length,c=this.options.ignoreHiddenPoint;for(e=0;e<f;e++){var a=g[e];b+=c&&!a.visible?0:a.isNull?0:a.y}this.total=b;for(e=0;e<f;e++)a=g[e],a.percentage=0<b&&(a.visible||!c)?a.y/b*100:0,a.total=b},generatePoints:function(){q.prototype.generatePoints.call(this);
|
||||
this.updateTotals()},getX:function(e,b,g){var f=this.center,c=this.radii?this.radii[g.index]:f[2]/2;e=Math.asin(I((e-f[1])/(c+g.labelDistance),-1,1));return f[0]+(b?-1:1)*Math.cos(e)*(c+g.labelDistance)+(0<g.labelDistance?(b?-1:1)*this.options.dataLabels.padding:0)},translate:function(e){this.generatePoints();var b=0,g=this.options,f=g.slicedOffset,c=f+(g.borderWidth||0),a=n(g.startAngle,g.endAngle),l=this.startAngleRad=a.start;a=(this.endAngleRad=a.end)-l;var m=this.points,v=g.dataLabels.distance;
|
||||
g=g.ignoreHiddenPoint;var k,h=m.length;e||(this.center=e=this.getCenter());for(k=0;k<h;k++){var t=m[k];var q=l+b*a;if(!g||t.visible)b+=t.percentage/100;var u=l+b*a;t.shapeType="arc";t.shapeArgs={x:e[0],y:e[1],r:e[2]/2,innerR:e[3]/2,start:Math.round(1E3*q)/1E3,end:Math.round(1E3*u)/1E3};t.labelDistance=z(t.options.dataLabels&&t.options.dataLabels.distance,v);t.labelDistance=x(t.labelDistance,t.shapeArgs.r);this.maxLabelDistance=Math.max(this.maxLabelDistance||0,t.labelDistance);u=(u+q)/2;u>1.5*Math.PI?
|
||||
u-=2*Math.PI:u<-Math.PI/2&&(u+=2*Math.PI);t.slicedTranslation={translateX:Math.round(Math.cos(u)*f),translateY:Math.round(Math.sin(u)*f)};var r=Math.cos(u)*e[2]/2;var C=Math.sin(u)*e[2]/2;t.tooltipPos=[e[0]+.7*r,e[1]+.7*C];t.half=u<-Math.PI/2||u>Math.PI/2?1:0;t.angle=u;q=Math.min(c,t.labelDistance/5);t.labelPosition={natural:{x:e[0]+r+Math.cos(u)*t.labelDistance,y:e[1]+C+Math.sin(u)*t.labelDistance},"final":{},alignment:0>t.labelDistance?"center":t.half?"right":"left",connectorPosition:{breakAt:{x:e[0]+
|
||||
r+Math.cos(u)*q,y:e[1]+C+Math.sin(u)*q},touchingSliceAt:{x:e[0]+r,y:e[1]+C}}}}B(this,"afterTranslate")},drawEmpty:function(){var e=this.options;if(0===this.total){var b=this.center[0];var g=this.center[1];this.graph||(this.graph=this.chart.renderer.circle(b,g,0).addClass("highcharts-graph").add(this.group));this.graph.animate({"stroke-width":e.borderWidth,cx:b,cy:g,r:this.center[2]/2,fill:e.fillColor||"none",stroke:e.color||"#cccccc"},this.options.animation)}else this.graph&&(this.graph=this.graph.destroy())},
|
||||
redrawPoints:function(){var e=this,b=e.chart,g=b.renderer,f,c,a,l,n=e.options.shadow;this.drawEmpty();!n||e.shadowGroup||b.styledMode||(e.shadowGroup=g.g("shadow").attr({zIndex:-1}).add(e.group));e.points.forEach(function(p){var k={};c=p.graphic;if(!p.isNull&&c){l=p.shapeArgs;f=p.getTranslate();if(!b.styledMode){var h=p.shadowGroup;n&&!h&&(h=p.shadowGroup=g.g("shadow").add(e.shadowGroup));h&&h.attr(f);a=e.pointAttribs(p,p.selected&&"select")}p.delayedRendering?(c.setRadialReference(e.center).attr(l).attr(f),
|
||||
b.styledMode||c.attr(a).attr({"stroke-linejoin":"round"}).shadow(n,h),p.delayedRendering=!1):(c.setRadialReference(e.center),b.styledMode||K(!0,k,a),K(!0,k,l,f),c.animate(k));c.attr({visibility:p.visible?"inherit":"hidden"});c.addClass(p.getClassName())}else c&&(p.graphic=c.destroy())})},drawPoints:function(){var e=this.chart.renderer;this.points.forEach(function(b){b.graphic&&b.hasNewShapeType()&&(b.graphic=b.graphic.destroy());b.graphic||(b.graphic=e[b.shapeType](b.shapeArgs).add(b.series.group),
|
||||
b.delayedRendering=!0)})},searchPoint:l,sortByAngle:function(e,b){e.sort(function(e,f){return"undefined"!==typeof e.angle&&(f.angle-e.angle)*b})},drawLegendSymbol:m.drawRectangle,getCenter:r.getCenter,getSymbol:l,drawGraph:null},{init:function(){y.prototype.init.apply(this,arguments);var e=this;e.name=z(e.name,"Slice");var b=function(b){e.slice("select"===b.type)};F(e,"select",b);F(e,"unselect",b);return e},isValid:function(){return D(this.y)&&0<=this.y},setVisible:function(e,b){var g=this,f=g.series,
|
||||
c=f.chart,a=f.options.ignoreHiddenPoint;b=z(b,a);e!==g.visible&&(g.visible=g.options.visible=e="undefined"===typeof e?!g.visible:e,f.options.data[f.data.indexOf(g)]=g.options,["graphic","dataLabel","connector","shadowGroup"].forEach(function(a){if(g[a])g[a][e?"show":"hide"](!0)}),g.legendItem&&c.legend.colorizeItem(g,e),e||"hover"!==g.state||g.setState(""),a&&(f.isDirty=!0),b&&c.redraw())},slice:function(e,b,g){var f=this.series;u(g,f.chart);z(b,!0);this.sliced=this.options.sliced=G(e)?e:!this.sliced;
|
||||
f.options.data[f.data.indexOf(this)]=this.options;this.graphic.animate(this.getTranslate());this.shadowGroup&&this.shadowGroup.animate(this.getTranslate())},getTranslate:function(){return this.sliced?this.slicedTranslation:{translateX:0,translateY:0}},haloPath:function(e){var b=this.shapeArgs;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(b.x,b.y,b.r+e,b.r+e,{innerR:b.r-1,start:b.start,end:b.end})},connectorShapes:{fixedOffset:function(e,b,g){var f=b.breakAt;b=b.touchingSliceAt;
|
||||
return["M",e.x,e.y].concat(g.softConnector?["C",e.x+("left"===e.alignment?-5:5),e.y,2*f.x-b.x,2*f.y-b.y,f.x,f.y]:["L",f.x,f.y]).concat(["L",b.x,b.y])},straight:function(e,b){b=b.touchingSliceAt;return["M",e.x,e.y,"L",b.x,b.y]},crookedLine:function(e,b,g){b=b.touchingSliceAt;var f=this.series,c=f.center[0],a=f.chart.plotWidth,l=f.chart.plotLeft;f=e.alignment;var n=this.shapeArgs.r;g=x(g.crookDistance,1);g="left"===f?c+n+(a+l-c-n)*(1-g):l+(c-n)*g;c=["L",g,e.y];if("left"===f?g>e.x||g<b.x:g<e.x||g>b.x)c=
|
||||
[];return["M",e.x,e.y].concat(c).concat(["L",b.x,b.y])}},getConnectorPath:function(){var e=this.labelPosition,b=this.series.options.dataLabels,g=b.connectorShape,f=this.connectorShapes;f[g]&&(g=f[g]);return g.call(this,{x:e.final.x,y:e.final.y,alignment:e.alignment},e.connectorPosition,b)}});""});P(y,"parts/DataLabels.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.animObject,r=m.arrayMax,F=m.clamp,N=m.defined,G=m.extend,B=m.format,D=m.isArray,K=m.merge,z=m.objectEach,x=
|
||||
m.pick,A=m.relativeLength,u=m.splat,n=m.stableSort;m=f.noop;var l=f.Series,q=f.seriesTypes;f.distribute=function(e,b,g){function p(a,b){return a.target-b.target}var c,a=!0,l=e,m=[];var v=0;var k=l.reducedLen||b;for(c=e.length;c--;)v+=e[c].size;if(v>k){n(e,function(a,b){return(b.rank||0)-(a.rank||0)});for(v=c=0;v<=k;)v+=e[c].size,c++;m=e.splice(c-1,e.length)}n(e,p);for(e=e.map(function(a){return{size:a.size,targets:[a.target],align:x(a.align,.5)}});a;){for(c=e.length;c--;)a=e[c],v=(Math.min.apply(0,
|
||||
a.targets)+Math.max.apply(0,a.targets))/2,a.pos=F(v-a.size*a.align,0,b-a.size);c=e.length;for(a=!1;c--;)0<c&&e[c-1].pos+e[c-1].size>e[c].pos&&(e[c-1].size+=e[c].size,e[c-1].targets=e[c-1].targets.concat(e[c].targets),e[c-1].align=.5,e[c-1].pos+e[c-1].size>b&&(e[c-1].pos=b-e[c-1].size),e.splice(c,1),a=!0)}l.push.apply(l,m);c=0;e.some(function(a){var e=0;if(a.targets.some(function(){l[c].pos=a.pos+e;if("undefined"!==typeof g&&Math.abs(l[c].pos-l[c].target)>g)return l.slice(0,c+1).forEach(function(a){delete a.pos}),
|
||||
l.reducedLen=(l.reducedLen||b)-.1*b,l.reducedLen>.1*b&&f.distribute(l,b,g),!0;e+=l[c].size;c++}))return!0});n(l,p)};l.prototype.drawDataLabels=function(){function e(a,b){var d=b.filter;return d?(b=d.operator,a=a[d.property],d=d.value,">"===b&&a>d||"<"===b&&a<d||">="===b&&a>=d||"<="===b&&a<=d||"=="===b&&a==d||"==="===b&&a===d?!0:!1):!0}function b(a,b){var d=[],c;if(D(a)&&!D(b))d=a.map(function(a){return K(a,b)});else if(D(b)&&!D(a))d=b.map(function(d){return K(a,d)});else if(D(a)||D(b))for(c=Math.max(a.length,
|
||||
b.length);c--;)d[c]=K(a[c],b[c]);else d=K(a,b);return d}var g=this,p=g.chart,c=g.options,a=c.dataLabels,l=g.points,n,v=g.hasRendered||0,k=y(c.animation).duration,h=Math.min(k,200),t=!p.renderer.forExport&&x(a.defer,0<h),m=p.renderer;a=b(b(p.options.plotOptions&&p.options.plotOptions.series&&p.options.plotOptions.series.dataLabels,p.options.plotOptions&&p.options.plotOptions[g.type]&&p.options.plotOptions[g.type].dataLabels),a);f.fireEvent(this,"drawDataLabels");if(D(a)||a.enabled||g._hasPointLabels){var q=
|
||||
g.plotGroup("dataLabelsGroup","data-labels",t&&!v?"hidden":"inherit",a.zIndex||6);t&&(q.attr({opacity:+v}),v||setTimeout(function(){var a=g.dataLabelsGroup;a&&(g.visible&&q.show(!0),a[c.animation?"animate":"attr"]({opacity:1},{duration:h}))},k-h));l.forEach(function(h){n=u(b(a,h.dlOptions||h.options&&h.options.dataLabels));n.forEach(function(a,d){var b=a.enabled&&(!h.isNull||h.dataLabelOnNull)&&e(h,a),k=h.dataLabels?h.dataLabels[d]:h.dataLabel,f=h.connectors?h.connectors[d]:h.connector,l=x(a.distance,
|
||||
h.labelDistance),t=!k;if(b){var n=h.getLabelConfig();var v=x(a[h.formatPrefix+"Format"],a.format);n=N(v)?B(v,n,p):(a[h.formatPrefix+"Formatter"]||a.formatter).call(n,a);v=a.style;var w=a.rotation;p.styledMode||(v.color=x(a.color,v.color,g.color,"#000000"),"contrast"===v.color?(h.contrastColor=m.getContrast(h.color||g.color),v.color=!N(l)&&a.inside||0>l||c.stacking?h.contrastColor:"#000000"):delete h.contrastColor,c.cursor&&(v.cursor=c.cursor));var C={r:a.borderRadius||0,rotation:w,padding:a.padding,
|
||||
zIndex:1};p.styledMode||(C.fill=a.backgroundColor,C.stroke=a.borderColor,C["stroke-width"]=a.borderWidth);z(C,function(a,d){"undefined"===typeof a&&delete C[d]})}!k||b&&N(n)?b&&N(n)&&(k?C.text=n:(h.dataLabels=h.dataLabels||[],k=h.dataLabels[d]=w?m.text(n,0,-9999,a.useHTML).addClass("highcharts-data-label"):m.label(n,0,-9999,a.shape,null,null,a.useHTML,null,"data-label"),d||(h.dataLabel=k),k.addClass(" highcharts-data-label-color-"+h.colorIndex+" "+(a.className||"")+(a.useHTML?" highcharts-tracker":
|
||||
""))),k.options=a,k.attr(C),p.styledMode||k.css(v).shadow(a.shadow),k.added||k.add(q),a.textPath&&!a.useHTML&&(k.setTextPath(h.getDataLabelPath&&h.getDataLabelPath(k)||h.graphic,a.textPath),h.dataLabelPath&&!a.textPath.enabled&&(h.dataLabelPath=h.dataLabelPath.destroy())),g.alignDataLabel(h,k,a,null,t)):(h.dataLabel=h.dataLabel&&h.dataLabel.destroy(),h.dataLabels&&(1===h.dataLabels.length?delete h.dataLabels:delete h.dataLabels[d]),d||delete h.dataLabel,f&&(h.connector=h.connector.destroy(),h.connectors&&
|
||||
(1===h.connectors.length?delete h.connectors:delete h.connectors[d])))})})}f.fireEvent(this,"afterDrawDataLabels")};l.prototype.alignDataLabel=function(e,b,g,f,c){var a=this,p=this.chart,l=this.isCartesian&&p.inverted,n=this.enabledDataSorting,k=x(e.dlBox&&e.dlBox.centerX,e.plotX,-9999),h=x(e.plotY,-9999),t=b.getBBox(),m=g.rotation,q=g.align,u=p.isInsidePlot(k,Math.round(h),l),C="justify"===x(g.overflow,n?"none":"justify"),d=this.visible&&!1!==e.visible&&(e.series.forceDL||n&&!C||u||g.inside&&f&&
|
||||
p.isInsidePlot(k,l?f.x+1:f.y+f.height-1,l));var z=function(d){n&&a.xAxis&&!C&&a.setDataLabelStartPos(e,b,c,u,d)};if(d){var r=p.renderer.fontMetrics(p.styledMode?void 0:g.style.fontSize,b).b;f=G({x:l?this.yAxis.len-h:k,y:Math.round(l?this.xAxis.len-k:h),width:0,height:0},f);G(g,{width:t.width,height:t.height});m?(C=!1,k=p.renderer.rotCorr(r,m),k={x:f.x+g.x+f.width/2+k.x,y:f.y+g.y+{top:0,middle:.5,bottom:1}[g.verticalAlign]*f.height},z(k),b[c?"attr":"animate"](k).attr({align:q}),z=(m+720)%360,z=180<
|
||||
z&&360>z,"left"===q?k.y-=z?t.height:0:"center"===q?(k.x-=t.width/2,k.y-=t.height/2):"right"===q&&(k.x-=t.width,k.y-=z?0:t.height),b.placed=!0,b.alignAttr=k):(z(f),b.align(g,null,f),k=b.alignAttr);C&&0<=f.height?this.justifyDataLabel(b,g,k,t,f,c):x(g.crop,!0)&&(d=p.isInsidePlot(k.x,k.y)&&p.isInsidePlot(k.x+t.width,k.y+t.height));if(g.shape&&!m)b[c?"attr":"animate"]({anchorX:l?p.plotWidth-e.plotY:e.plotX,anchorY:l?p.plotHeight-e.plotX:e.plotY})}c&&n&&(b.placed=!1);d||n&&!C||(b.hide(!0),b.placed=!1)};
|
||||
l.prototype.setDataLabelStartPos=function(e,b,g,f,c){var a=this.chart,p=a.inverted,l=this.xAxis,n=l.reversed,k=p?b.height/2:b.width/2;e=(e=e.pointWidth)?e/2:0;l=p?c.x:n?-k-e:l.width-k+e;c=p?n?this.yAxis.height-k+e:-k-e:c.y;b.startXPos=l;b.startYPos=c;f?"hidden"===b.visibility&&(b.show(),b.attr({opacity:0}).animate({opacity:1})):b.attr({opacity:1}).animate({opacity:0},void 0,b.hide);a.hasRendered&&(g&&b.attr({x:b.startXPos,y:b.startYPos}),b.placed=!0)};l.prototype.justifyDataLabel=function(e,b,g,f,
|
||||
c,a){var p=this.chart,l=b.align,n=b.verticalAlign,k=e.box?0:e.padding||0;var h=g.x+k;if(0>h){"right"===l?(b.align="left",b.inside=!0):b.x=-h;var t=!0}h=g.x+f.width-k;h>p.plotWidth&&("left"===l?(b.align="right",b.inside=!0):b.x=p.plotWidth-h,t=!0);h=g.y+k;0>h&&("bottom"===n?(b.verticalAlign="top",b.inside=!0):b.y=-h,t=!0);h=g.y+f.height-k;h>p.plotHeight&&("top"===n?(b.verticalAlign="bottom",b.inside=!0):b.y=p.plotHeight-h,t=!0);t&&(e.placed=!a,e.align(b,null,c));return t};q.pie&&(q.pie.prototype.dataLabelPositioners=
|
||||
{radialDistributionY:function(e){return e.top+e.distributeBox.pos},radialDistributionX:function(e,b,g,f){return e.getX(g<b.top+2||g>b.bottom-2?f:g,b.half,b)},justify:function(e,b,g){return g[0]+(e.half?-1:1)*(b+e.labelDistance)},alignToPlotEdges:function(e,b,g,f){e=e.getBBox().width;return b?e+f:g-e-f},alignToConnectors:function(e,b,g,f){var c=0,a;e.forEach(function(b){a=b.dataLabel.getBBox().width;a>c&&(c=a)});return b?c+f:g-c-f}},q.pie.prototype.drawDataLabels=function(){var e=this,b=e.data,g,p=
|
||||
e.chart,c=e.options.dataLabels||{},a=c.connectorPadding,n,m=p.plotWidth,v=p.plotHeight,k=p.plotLeft,h=Math.round(p.chartWidth/3),t,q=e.center,u=q[2]/2,z=q[1],C,d,A,H,D=[[],[]],B,y,F,I,G=[0,0,0,0],P=e.dataLabelPositioners,Z;e.visible&&(c.enabled||e._hasPointLabels)&&(b.forEach(function(a){a.dataLabel&&a.visible&&a.dataLabel.shortened&&(a.dataLabel.attr({width:"auto"}).css({width:"auto",textOverflow:"clip"}),a.dataLabel.shortened=!1)}),l.prototype.drawDataLabels.apply(e),b.forEach(function(a){a.dataLabel&&
|
||||
(a.visible?(D[a.half].push(a),a.dataLabel._pos=null,!N(c.style.width)&&!N(a.options.dataLabels&&a.options.dataLabels.style&&a.options.dataLabels.style.width)&&a.dataLabel.getBBox().width>h&&(a.dataLabel.css({width:.7*h}),a.dataLabel.shortened=!0)):(a.dataLabel=a.dataLabel.destroy(),a.dataLabels&&1===a.dataLabels.length&&delete a.dataLabels))}),D.forEach(function(b,h){var l=b.length,t=[],n;if(l){e.sortByAngle(b,h-.5);if(0<e.maxLabelDistance){var w=Math.max(0,z-u-e.maxLabelDistance);var L=Math.min(z+
|
||||
u+e.maxLabelDistance,p.plotHeight);b.forEach(function(a){0<a.labelDistance&&a.dataLabel&&(a.top=Math.max(0,z-u-a.labelDistance),a.bottom=Math.min(z+u+a.labelDistance,p.plotHeight),n=a.dataLabel.getBBox().height||21,a.distributeBox={target:a.labelPosition.natural.y-a.top+n/2,size:n,rank:a.y},t.push(a.distributeBox))});w=L+n-w;f.distribute(t,w,w/5)}for(I=0;I<l;I++){g=b[I];A=g.labelPosition;C=g.dataLabel;F=!1===g.visible?"hidden":"inherit";y=w=A.natural.y;t&&N(g.distributeBox)&&("undefined"===typeof g.distributeBox.pos?
|
||||
F="hidden":(H=g.distributeBox.size,y=P.radialDistributionY(g)));delete g.positionIndex;if(c.justify)B=P.justify(g,u,q);else switch(c.alignTo){case "connectors":B=P.alignToConnectors(b,h,m,k);break;case "plotEdges":B=P.alignToPlotEdges(C,h,m,k);break;default:B=P.radialDistributionX(e,g,y,w)}C._attr={visibility:F,align:A.alignment};Z=g.options.dataLabels||{};C._pos={x:B+x(Z.x,c.x)+({left:a,right:-a}[A.alignment]||0),y:y+x(Z.y,c.y)-10};A.final.x=B;A.final.y=y;x(c.crop,!0)&&(d=C.getBBox().width,w=null,
|
||||
B-d<a&&1===h?(w=Math.round(d-B+a),G[3]=Math.max(w,G[3])):B+d>m-a&&0===h&&(w=Math.round(B+d-m+a),G[1]=Math.max(w,G[1])),0>y-H/2?G[0]=Math.max(Math.round(-y+H/2),G[0]):y+H/2>v&&(G[2]=Math.max(Math.round(y+H/2-v),G[2])),C.sideOverflow=w)}}}),0===r(G)||this.verifyDataLabelOverflow(G))&&(this.placeDataLabels(),this.points.forEach(function(a){Z=K(c,a.options.dataLabels);if(n=x(Z.connectorWidth,1)){var d;t=a.connector;if((C=a.dataLabel)&&C._pos&&a.visible&&0<a.labelDistance){F=C._attr.visibility;if(d=!t)a.connector=
|
||||
t=p.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex+(a.className?" "+a.className:"")).add(e.dataLabelsGroup),p.styledMode||t.attr({"stroke-width":n,stroke:Z.connectorColor||a.color||"#666666"});t[d?"attr":"animate"]({d:a.getConnectorPath()});t.attr("visibility",F)}else t&&(a.connector=t.destroy())}}))},q.pie.prototype.placeDataLabels=function(){this.points.forEach(function(e){var b=e.dataLabel,g;b&&e.visible&&((g=b._pos)?(b.sideOverflow&&(b._attr.width=Math.max(b.getBBox().width-
|
||||
b.sideOverflow,0),b.css({width:b._attr.width+"px",textOverflow:(this.options.dataLabels.style||{}).textOverflow||"ellipsis"}),b.shortened=!0),b.attr(b._attr),b[b.moved?"animate":"attr"](g),b.moved=!0):b&&b.attr({y:-9999}));delete e.distributeBox},this)},q.pie.prototype.alignDataLabel=m,q.pie.prototype.verifyDataLabelOverflow=function(e){var b=this.center,g=this.options,f=g.center,c=g.minSize||80,a=null!==g.size;if(!a){if(null!==f[0])var l=Math.max(b[2]-Math.max(e[1],e[3]),c);else l=Math.max(b[2]-
|
||||
e[1]-e[3],c),b[0]+=(e[3]-e[1])/2;null!==f[1]?l=F(l,c,b[2]-Math.max(e[0],e[2])):(l=F(l,c,b[2]-e[0]-e[2]),b[1]+=(e[0]-e[2])/2);l<b[2]?(b[2]=l,b[3]=Math.min(A(g.innerSize||0,l),l),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):a=!0}return a});q.column&&(q.column.prototype.alignDataLabel=function(e,b,g,f,c){var a=this.chart.inverted,p=e.series,n=e.dlBox||e.shapeArgs,m=x(e.below,e.plotY>x(this.translatedThreshold,p.yAxis.len)),k=x(g.inside,!!this.options.stacking);n&&(f=K(n),0>f.y&&(f.height+=
|
||||
f.y,f.y=0),n=f.y+f.height-p.yAxis.len,0<n&&n<f.height&&(f.height-=n),a&&(f={x:p.yAxis.len-f.y-f.height,y:p.xAxis.len-f.x-f.width,width:f.height,height:f.width}),k||(a?(f.x+=m?0:f.width,f.width=0):(f.y+=m?f.height:0,f.height=0)));g.align=x(g.align,!a||k?"center":m?"right":"left");g.verticalAlign=x(g.verticalAlign,a||k?"middle":m?"top":"bottom");l.prototype.alignDataLabel.call(this,e,b,g,f,c);g.inside&&e.contrastColor&&b.css({color:e.contrastColor})})});P(y,"modules/overlapping-datalabels.src.js",[y["parts/Globals.js"],
|
||||
y["parts/Utilities.js"]],function(f,m){var y=m.addEvent,r=m.fireEvent,F=m.isArray,N=m.objectEach,G=m.pick;f=f.Chart;y(f,"render",function(){var f=[];(this.labelCollectors||[]).forEach(function(m){f=f.concat(m())});(this.yAxis||[]).forEach(function(m){m.options.stackLabels&&!m.options.stackLabels.allowOverlap&&N(m.stacks,function(m){N(m,function(m){f.push(m.label)})})});(this.series||[]).forEach(function(m){var r=m.options.dataLabels;m.visible&&(!1!==r.enabled||m._hasPointLabels)&&(m.nodes||m.points).forEach(function(m){m.visible&&
|
||||
(F(m.dataLabels)?m.dataLabels:m.dataLabel?[m.dataLabel]:[]).forEach(function(x){var z=x.options;x.labelrank=G(z.labelrank,m.labelrank,m.shapeArgs&&m.shapeArgs.height);z.allowOverlap||f.push(x)})})});this.hideOverlappingLabels(f)});f.prototype.hideOverlappingLabels=function(f){var m=this,B=f.length,z=m.renderer,x,A,u,n=!1;var l=function(b){var e=b.box?0:b.padding||0;var f=0;if(b&&(!b.alignAttr||b.placed)){var c=b.alignAttr||{x:b.attr("x"),y:b.attr("y")};var a=b.parentGroup;b.width||(f=b.getBBox(),
|
||||
b.width=f.width,b.height=f.height,f=z.fontMetrics(null,b.element).h);return{x:c.x+(a.translateX||0)+e,y:c.y+(a.translateY||0)+e-f,width:b.width-2*e,height:b.height-2*e}}};for(A=0;A<B;A++)if(x=f[A])x.oldOpacity=x.opacity,x.newOpacity=1,x.absoluteBox=l(x);f.sort(function(b,e){return(e.labelrank||0)-(b.labelrank||0)});for(A=0;A<B;A++){var q=(l=f[A])&&l.absoluteBox;for(x=A+1;x<B;++x){var e=(u=f[x])&&u.absoluteBox;!q||!e||l===u||0===l.newOpacity||0===u.newOpacity||e.x>q.x+q.width||e.x+e.width<q.x||e.y>
|
||||
q.y+q.height||e.y+e.height<q.y||((l.labelrank<u.labelrank?l:u).newOpacity=0)}}f.forEach(function(b){var e;if(b){var f=b.newOpacity;b.oldOpacity!==f&&(b.alignAttr&&b.placed?(f?b.show(!0):e=function(){b.hide(!0);b.placed=!1},n=!0,b.alignAttr.opacity=f,b[b.isOld?"animate":"attr"](b.alignAttr,null,e),r(m,"afterHideOverlappingLabel")):b.attr({opacity:f}));b.isOld=!0}});n&&r(m,"afterHideAllOverlappingLabels")}});P(y,"parts/Interaction.js",[y["parts/Globals.js"],y["parts/Legend.js"],y["parts/Point.js"],
|
||||
y["parts/Utilities.js"]],function(f,m,y,r){var F=r.addEvent,I=r.createElement,G=r.css,B=r.defined,D=r.extend,K=r.fireEvent,z=r.isArray,x=r.isFunction,A=r.isObject,u=r.merge,n=r.objectEach,l=r.pick;r=f.Chart;var q=f.defaultOptions,e=f.defaultPlotOptions,b=f.hasTouch,g=f.Series,p=f.seriesTypes,c=f.svg;f=f.TrackerMixin={drawTrackerPoint:function(){var a=this,c=a.chart,e=c.pointer,g=function(a){var b=e.getPointFromEvent(a);"undefined"!==typeof b&&(e.isDirectTouch=!0,b.onMouseOver(a))},k;a.points.forEach(function(a){k=
|
||||
z(a.dataLabels)?a.dataLabels:a.dataLabel?[a.dataLabel]:[];a.graphic&&(a.graphic.element.point=a);k.forEach(function(b){b.div?b.div.point=a:b.element.point=a})});a._hasTracking||(a.trackerGroups.forEach(function(h){if(a[h]){a[h].addClass("highcharts-tracker").on("mouseover",g).on("mouseout",function(a){e.onTrackerMouseOut(a)});if(b)a[h].on("touchstart",g);!c.styledMode&&a.options.cursor&&a[h].css(G).css({cursor:a.options.cursor})}}),a._hasTracking=!0);K(this,"afterDrawTracker")},drawTrackerGraph:function(){var a=
|
||||
this,e=a.options,g=e.trackByArea,f=[].concat(g?a.areaPath:a.graphPath),k=f.length,h=a.chart,l=h.pointer,p=h.renderer,n=h.options.tooltip.snap,m=a.tracker,q,d=function(d){l.normalize(d);if(h.hoverSeries!==a&&!l.isStickyTooltip(d))a.onMouseOver()},u="rgba(192,192,192,"+(c?.0001:.002)+")";if(k&&!g)for(q=k+1;q--;)"M"===f[q]&&f.splice(q+1,0,f[q+1]-n,f[q+2],"L"),(q&&"M"===f[q]||q===k)&&f.splice(q,0,"L",f[q-2]+n,f[q-1]);m?m.attr({d:f}):a.graph&&(a.tracker=p.path(f).attr({visibility:a.visible?"visible":"hidden",
|
||||
zIndex:2}).addClass(g?"highcharts-tracker-area":"highcharts-tracker-line").add(a.group),h.styledMode||a.tracker.attr({"stroke-linejoin":"round",stroke:u,fill:g?u:"none","stroke-width":a.graph.strokeWidth()+(g?0:2*n)}),[a.tracker,a.markerGroup].forEach(function(a){a.addClass("highcharts-tracker").on("mouseover",d).on("mouseout",function(a){l.onTrackerMouseOut(a)});e.cursor&&!h.styledMode&&a.css({cursor:e.cursor});if(b)a.on("touchstart",d)}));K(this,"afterDrawTracker")}};p.column&&(p.column.prototype.drawTracker=
|
||||
f.drawTrackerPoint);p.pie&&(p.pie.prototype.drawTracker=f.drawTrackerPoint);p.scatter&&(p.scatter.prototype.drawTracker=f.drawTrackerPoint);D(m.prototype,{setItemEvents:function(a,b,c){var e=this,k=e.chart.renderer.boxWrapper,h=a instanceof y,g="highcharts-legend-"+(h?"point":"series")+"-active",f=e.chart.styledMode;(c?[b,a.legendSymbol]:[a.legendGroup]).forEach(function(c){if(c)c.on("mouseover",function(){a.visible&&e.allItems.forEach(function(b){a!==b&&b.setState("inactive",!h)});a.setState("hover");
|
||||
a.visible&&k.addClass(g);f||b.css(e.options.itemHoverStyle)}).on("mouseout",function(){e.chart.styledMode||b.css(u(a.visible?e.itemStyle:e.itemHiddenStyle));e.allItems.forEach(function(b){a!==b&&b.setState("",!h)});k.removeClass(g);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible();e.allItems.forEach(function(d){a!==d&&d.setState(a.visible?"inactive":"",!h)})};k.removeClass(g);b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):K(a,"legendItemClick",
|
||||
b,c)})})},createCheckboxForItem:function(a){a.checkbox=I("input",{type:"checkbox",className:"highcharts-legend-checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);F(a.checkbox,"click",function(b){K(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});D(r.prototype,{showResetZoom:function(){function a(){b.zoomOut()}var b=this,c=q.lang,e=b.options.chart.resetZoomButton,k=e.theme,h=k.states,g="chart"===e.relativeTo||
|
||||
"spaceBox"===e.relativeTo?null:"plotBox";K(this,"beforeShowResetZoom",null,function(){b.resetZoomButton=b.renderer.button(c.resetZoom,null,null,a,k,h&&h.hover).attr({align:e.position.align,title:c.resetZoomTitle}).addClass("highcharts-reset-zoom").add().align(e.position,!1,g)});K(this,"afterShowResetZoom")},zoomOut:function(){K(this,"selection",{resetSelection:!0},this.zoom)},zoom:function(a){var b=this,c,e=b.pointer,k=!1,h=b.inverted?e.mouseDownX:e.mouseDownY;!a||a.resetSelection?(b.axes.forEach(function(a){c=
|
||||
a.zoom()}),e.initiated=!1):a.xAxis.concat(a.yAxis).forEach(function(a){var g=a.axis,f=b.inverted?g.left:g.top,l=b.inverted?f+g.width:f+g.height,d=g.isXAxis,p=!1;if(!d&&h>=f&&h<=l||d||!B(h))p=!0;e[d?"zoomX":"zoomY"]&&p&&(c=g.zoom(a.min,a.max),g.displayBtn&&(k=!0))});var g=b.resetZoomButton;k&&!g?b.showResetZoom():!k&&A(g)&&(b.resetZoomButton=g.destroy());c&&b.redraw(l(b.options.chart.animation,a&&a.animation,100>b.pointCount))},pan:function(a,b){var c=this,e=c.hoverPoints,k=c.options.chart,h;b="object"===
|
||||
typeof b?b:{enabled:b,type:"x"};k&&k.panning&&(k.panning=b);var g=b.type;K(this,"pan",{originalEvent:a},function(){e&&e.forEach(function(a){a.setState()});var b=[1];"xy"===g?b=[1,0]:"y"===g&&(b=[0]);b.forEach(function(b){var e=c[b?"xAxis":"yAxis"][0],k=e.options,d=e.horiz,g=a[d?"chartX":"chartY"];d=d?"mouseDownX":"mouseDownY";var f=c[d],l=(e.pointRange||0)/2,p=e.reversed&&!c.inverted||!e.reversed&&c.inverted?-1:1,n=e.getExtremes(),t=e.toValue(f-g,!0)+l*p;p=e.toValue(f+e.len-g,!0)-l*p;var m=p<t;f=
|
||||
m?p:t;t=m?t:p;p=Math.min(n.dataMin,l?n.min:e.toValue(e.toPixels(n.min)-e.minPixelPadding));l=Math.max(n.dataMax,l?n.max:e.toValue(e.toPixels(n.max)+e.minPixelPadding));if(!k.ordinal){b&&(k=p-f,0<k&&(t+=k,f=p),k=t-l,0<k&&(t=l,f-=k));if(e.series.length&&f!==n.min&&t!==n.max&&b||e.panningState&&f>=e.panningState.startMin&&t<=e.panningState.startMax)e.setExtremes(f,t,!1,!1,{trigger:"pan"}),h=!0;c[d]=g}});h&&c.redraw(!1);G(c.container,{cursor:"move"})})}});D(y.prototype,{select:function(a,b){var c=this,
|
||||
e=c.series,k=e.chart;this.selectedStaging=a=l(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;e.options.data[e.data.indexOf(c)]=c.options;c.setState(a&&"select");b||k.getSelectedPoints().forEach(function(a){var b=a.series;a.selected&&a!==c&&(a.selected=a.options.selected=!1,b.options.data[b.data.indexOf(a)]=a.options,a.setState(k.hoverPoints&&b.options.inactiveOtherPoints?"inactive":""),a.firePointEvent("unselect"))})});delete this.selectedStaging},
|
||||
onMouseOver:function(a){var b=this.series.chart,c=b.pointer;a=a?c.normalize(a):c.getChartCoordinatesFromPoint(this,b.inverted);c.runPointActions(a,this)},onMouseOut:function(){var a=this.series.chart;this.firePointEvent("mouseOut");this.series.options.inactiveOtherPoints||(a.hoverPoints||[]).forEach(function(a){a.setState()});a.hoverPoints=a.hoverPoint=null},importEvents:function(){if(!this.hasImportedEvents){var a=this,b=u(a.series.options.point,a.options).events;a.events=b;n(b,function(b,c){x(b)&&
|
||||
F(a,c,b)});this.hasImportedEvents=!0}},setState:function(a,b){var c=this.series,g=this.state,k=c.options.states[a||"normal"]||{},h=e[c.type].marker&&c.options.marker,f=h&&!1===h.enabled,p=h&&h.states&&h.states[a||"normal"]||{},n=!1===p.enabled,m=c.stateMarkerGraphic,q=this.marker||{},d=c.chart,w=c.halo,u,x=h&&c.markerAttribs;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===k.enabled||a&&(n||f&&!1===p.enabled)||a&&q.states&&q.states[a]&&!1===q.states[a].enabled)){this.state=a;x&&
|
||||
(u=c.markerAttribs(this,a));if(this.graphic){g&&this.graphic.removeClass("highcharts-point-"+g);a&&this.graphic.addClass("highcharts-point-"+a);if(!d.styledMode){var z=c.pointAttribs(this,a);var r=l(d.options.chart.animation,k.animation);c.options.inactiveOtherPoints&&((this.dataLabels||[]).forEach(function(a){a&&a.animate({opacity:z.opacity},r)}),this.connector&&this.connector.animate({opacity:z.opacity},r));this.graphic.animate(z,r)}u&&this.graphic.animate(u,l(d.options.chart.animation,p.animation,
|
||||
h.animation));m&&m.hide()}else{if(a&&p){g=q.symbol||c.symbol;m&&m.currentSymbol!==g&&(m=m.destroy());if(u)if(m)m[b?"animate":"attr"]({x:u.x,y:u.y});else g&&(c.stateMarkerGraphic=m=d.renderer.symbol(g,u.x,u.y,u.width,u.height).add(c.markerGroup),m.currentSymbol=g);!d.styledMode&&m&&m.attr(c.pointAttribs(this,a))}m&&(m[a&&this.isInside?"show":"hide"](),m.element.point=this)}a=k.halo;k=(m=this.graphic||m)&&m.visibility||"inherit";a&&a.size&&m&&"hidden"!==k&&!this.isCluster?(w||(c.halo=w=d.renderer.path().add(m.parentGroup)),
|
||||
w.show()[b?"animate":"attr"]({d:this.haloPath(a.size)}),w.attr({"class":"highcharts-halo highcharts-color-"+l(this.colorIndex,c.colorIndex)+(this.className?" "+this.className:""),visibility:k,zIndex:-1}),w.point=this,d.styledMode||w.attr(D({fill:this.color||c.color,"fill-opacity":a.opacity},a.attributes))):w&&w.point&&w.point.haloPath&&w.animate({d:w.point.haloPath(0)},null,w.hide);K(this,"afterSetState")}},haloPath:function(a){return this.series.chart.renderer.symbols.circle(Math.floor(this.plotX)-
|
||||
a,this.plotY-a,2*a,2*a)}});D(g.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&K(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,e=b.hoverPoint;b.hoverSeries=null;if(e)e.onMouseOut();this&&a.events.mouseOut&&K(this,"mouseOut");!c||this.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();b.series.forEach(function(a){a.setState("",!0)})},
|
||||
setState:function(a,b){var c=this,e=c.options,k=c.graph,h=e.inactiveOtherPoints,g=e.states,f=e.lineWidth,p=e.opacity,n=l(g[a||"normal"]&&g[a||"normal"].animation,c.chart.options.chart.animation);e=0;a=a||"";if(c.state!==a&&([c.group,c.markerGroup,c.dataLabelsGroup].forEach(function(b){b&&(c.state&&b.removeClass("highcharts-series-"+c.state),a&&b.addClass("highcharts-series-"+a))}),c.state=a,!c.chart.styledMode)){if(g[a]&&!1===g[a].enabled)return;a&&(f=g[a].lineWidth||f+(g[a].lineWidthPlus||0),p=l(g[a].opacity,
|
||||
p));if(k&&!k.dashstyle)for(g={"stroke-width":f},k.animate(g,n);c["zone-graph-"+e];)c["zone-graph-"+e].attr(g),e+=1;h||[c.group,c.markerGroup,c.dataLabelsGroup,c.labelBySeries].forEach(function(a){a&&a.animate({opacity:p},n)})}b&&h&&c.points&&c.setAllPointsToState(a)},setAllPointsToState:function(a){this.points.forEach(function(b){b.setState&&b.setState(a)})},setVisible:function(a,b){var c=this,e=c.chart,k=c.legendItem,h=e.options.chart.ignoreHiddenSeries,g=c.visible;var f=(c.visible=a=c.options.visible=
|
||||
c.userOptions.visible="undefined"===typeof a?!g:a)?"show":"hide";["group","dataLabelsGroup","markerGroup","tracker","tt"].forEach(function(a){if(c[a])c[a][f]()});if(e.hoverSeries===c||(e.hoverPoint&&e.hoverPoint.series)===c)c.onMouseOut();k&&e.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&e.series.forEach(function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});c.linkedSeries.forEach(function(b){b.setVisible(a,!1)});h&&(e.isDirtyBox=!0);K(c,f);!1!==b&&e.redraw()},show:function(){this.setVisible(!0)},
|
||||
hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=this.options.selected="undefined"===typeof a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);K(this,a?"select":"unselect")},drawTracker:f.drawTrackerGraph})});P(y,"parts/Responsive.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.find,r=m.isArray,F=m.isObject,N=m.merge,G=m.objectEach,B=m.pick,D=m.splat,K=m.uniqueKey;f=f.Chart;f.prototype.setResponsive=function(f,m){var x=this.options.responsive,
|
||||
u=[],n=this.currentResponsive;!m&&x&&x.rules&&x.rules.forEach(function(f){"undefined"===typeof f._id&&(f._id=K());this.matchResponsiveRule(f,u)},this);m=N.apply(0,u.map(function(f){return y(x.rules,function(l){return l._id===f}).chartOptions}));m.isResponsiveOptions=!0;u=u.toString()||void 0;u!==(n&&n.ruleIds)&&(n&&this.update(n.undoOptions,f,!0),u?(n=this.currentOptions(m),n.isResponsiveOptions=!0,this.currentResponsive={ruleIds:u,mergedOptions:m,undoOptions:n},this.update(m,f,!0)):this.currentResponsive=
|
||||
void 0)};f.prototype.matchResponsiveRule=function(f,m){var x=f.condition;(x.callback||function(){return this.chartWidth<=B(x.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=B(x.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=B(x.minWidth,0)&&this.chartHeight>=B(x.minHeight,0)}).call(this)&&m.push(f._id)};f.prototype.currentOptions=function(f){function m(f,l,q,e){var b;G(f,function(g,f){if(!e&&-1<z.collectionsWithUpdate.indexOf(f))for(g=D(g),q[f]=[],b=0;b<g.length;b++)l[f][b]&&(q[f][b]={},m(g[b],l[f][b],
|
||||
q[f][b],e+1));else F(g)?(q[f]=r(g)?[]:{},m(g,l[f]||{},q[f],e+1)):q[f]="undefined"===typeof l[f]?null:l[f]})}var z=this,u={};m(f,this.options,u,0);return u}});P(y,"masters/highcharts.src.js",[y["parts/Globals.js"]],function(f){return f});P(y,"parts/Scrollbar.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.addEvent,r=m.correctFloat,F=m.defined,N=m.destroyObjectProperties,G=m.fireEvent,B=m.merge,D=m.pick,K=m.removeEvent;m=f.Axis;var z=f.defaultOptions,x=f.hasTouch,A,u={height:f.isTouchDevice?
|
||||
20:14,barBorderRadius:0,buttonBorderRadius:0,liveRedraw:void 0,margin:10,minWidth:6,step:.2,zIndex:3,barBackgroundColor:"#cccccc",barBorderWidth:1,barBorderColor:"#cccccc",buttonArrowColor:"#333333",buttonBackgroundColor:"#e6e6e6",buttonBorderColor:"#cccccc",buttonBorderWidth:1,rifleColor:"#333333",trackBackgroundColor:"#f2f2f2",trackBorderColor:"#f2f2f2",trackBorderWidth:1};z.scrollbar=B(!0,u,z.scrollbar);f.swapXY=A=function(f,n){var e=f.length;if(n)for(n=0;n<e;n+=3){var b=f[n+1];f[n+1]=f[n+2];f[n+
|
||||
2]=b}return f};var n=function(){function f(f,e,b){this._events=[];this.from=this.chartY=this.chartX=0;this.scrollbar=this.group=void 0;this.scrollbarButtons=[];this.scrollbarGroup=void 0;this.scrollbarLeft=0;this.scrollbarRifles=void 0;this.scrollbarStrokeWidth=1;this.to=this.size=this.scrollbarTop=0;this.track=void 0;this.trackBorderWidth=1;this.userOptions={};this.y=this.x=0;this.chart=b;this.options=e;this.renderer=b.renderer;this.init(f,e,b)}f.prototype.addEvents=function(){var f=this.options.inverted?
|
||||
[1,0]:[0,1],e=this.scrollbarButtons,b=this.scrollbarGroup.element,g=this.track.element,p=this.mouseDownHandler.bind(this),c=this.mouseMoveHandler.bind(this),a=this.mouseUpHandler.bind(this);f=[[e[f[0]].element,"click",this.buttonToMinClick.bind(this)],[e[f[1]].element,"click",this.buttonToMaxClick.bind(this)],[g,"click",this.trackClick.bind(this)],[b,"mousedown",p],[b.ownerDocument,"mousemove",c],[b.ownerDocument,"mouseup",a]];x&&f.push([b,"touchstart",p],[b.ownerDocument,"touchmove",c],[b.ownerDocument,
|
||||
"touchend",a]);f.forEach(function(a){y.apply(null,a)});this._events=f};f.prototype.buttonToMaxClick=function(f){var e=(this.to-this.from)*D(this.options.step,.2);this.updatePosition(this.from+e,this.to+e);G(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:f})};f.prototype.buttonToMinClick=function(f){var e=r(this.to-this.from)*D(this.options.step,.2);this.updatePosition(r(this.from-e),r(this.to-e));G(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:f})};
|
||||
f.prototype.cursorToScrollbarPosition=function(f){var e=this.options;e=e.minWidth>this.calculatedWidth?e.minWidth:0;return{chartX:(f.chartX-this.x-this.xOffset)/(this.barWidth-e),chartY:(f.chartY-this.y-this.yOffset)/(this.barWidth-e)}};f.prototype.destroy=function(){var f=this.chart.scroller;this.removeEvents();["track","scrollbarRifles","scrollbar","scrollbarGroup","group"].forEach(function(e){this[e]&&this[e].destroy&&(this[e]=this[e].destroy())},this);f&&this===f.scrollbar&&(f.scrollbar=null,
|
||||
N(f.scrollbarButtons))};f.prototype.drawScrollbarButton=function(f){var e=this.renderer,b=this.scrollbarButtons,g=this.options,p=this.size;var c=e.g().add(this.group);b.push(c);c=e.rect().addClass("highcharts-scrollbar-button").add(c);this.chart.styledMode||c.attr({stroke:g.buttonBorderColor,"stroke-width":g.buttonBorderWidth,fill:g.buttonBackgroundColor});c.attr(c.crisp({x:-.5,y:-.5,width:p+1,height:p+1,r:g.buttonBorderRadius},c.strokeWidth()));c=e.path(A(["M",p/2+(f?-1:1),p/2-3,"L",p/2+(f?-1:1),
|
||||
p/2+3,"L",p/2+(f?2:-2),p/2],g.vertical)).addClass("highcharts-scrollbar-arrow").add(b[f]);this.chart.styledMode||c.attr({fill:g.buttonArrowColor})};f.prototype.init=function(f,e,b){this.scrollbarButtons=[];this.renderer=f;this.userOptions=e;this.options=B(u,e);this.chart=b;this.size=D(this.options.size,this.options.height);e.enabled&&(this.render(),this.addEvents())};f.prototype.mouseDownHandler=function(f){f=this.chart.pointer.normalize(f);f=this.cursorToScrollbarPosition(f);this.chartX=f.chartX;
|
||||
this.chartY=f.chartY;this.initPositions=[this.from,this.to];this.grabbedCenter=!0};f.prototype.mouseMoveHandler=function(f){var e=this.chart.pointer.normalize(f),b=this.options.vertical?"chartY":"chartX",g=this.initPositions||[];!this.grabbedCenter||f.touches&&0===f.touches[0][b]||(e=this.cursorToScrollbarPosition(e)[b],b=this[b],b=e-b,this.hasDragged=!0,this.updatePosition(g[0]+b,g[1]+b),this.hasDragged&&G(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:f.type,DOMEvent:f}))};
|
||||
f.prototype.mouseUpHandler=function(f){this.hasDragged&&G(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMType:f.type,DOMEvent:f});this.grabbedCenter=this.hasDragged=this.chartX=this.chartY=null};f.prototype.position=function(f,e,b,g){var p=this.options.vertical,c=0,a=this.rendered?"animate":"attr";this.x=f;this.y=e+this.trackBorderWidth;this.width=b;this.xOffset=this.height=g;this.yOffset=c;p?(this.width=this.yOffset=b=c=this.size,this.xOffset=e=0,this.barWidth=g-2*b,this.x=f+=this.options.margin):
|
||||
(this.height=this.xOffset=g=e=this.size,this.barWidth=b-2*g,this.y+=this.options.margin);this.group[a]({translateX:f,translateY:this.y});this.track[a]({width:b,height:g});this.scrollbarButtons[1][a]({translateX:p?0:b-e,translateY:p?g-c:0})};f.prototype.removeEvents=function(){this._events.forEach(function(f){K.apply(null,f)});this._events.length=0};f.prototype.render=function(){var f=this.renderer,e=this.options,b=this.size,g=this.chart.styledMode,p;this.group=p=f.g("scrollbar").attr({zIndex:e.zIndex,
|
||||
translateY:-99999}).add();this.track=f.rect().addClass("highcharts-scrollbar-track").attr({x:0,r:e.trackBorderRadius||0,height:b,width:b}).add(p);g||this.track.attr({fill:e.trackBackgroundColor,stroke:e.trackBorderColor,"stroke-width":e.trackBorderWidth});this.trackBorderWidth=this.track.strokeWidth();this.track.attr({y:-this.trackBorderWidth%2/2});this.scrollbarGroup=f.g().add(p);this.scrollbar=f.rect().addClass("highcharts-scrollbar-thumb").attr({height:b,width:b,r:e.barBorderRadius||0}).add(this.scrollbarGroup);
|
||||
this.scrollbarRifles=f.path(A(["M",-3,b/4,"L",-3,2*b/3,"M",0,b/4,"L",0,2*b/3,"M",3,b/4,"L",3,2*b/3],e.vertical)).addClass("highcharts-scrollbar-rifles").add(this.scrollbarGroup);g||(this.scrollbar.attr({fill:e.barBackgroundColor,stroke:e.barBorderColor,"stroke-width":e.barBorderWidth}),this.scrollbarRifles.attr({stroke:e.rifleColor,"stroke-width":1}));this.scrollbarStrokeWidth=this.scrollbar.strokeWidth();this.scrollbarGroup.translate(-this.scrollbarStrokeWidth%2/2,-this.scrollbarStrokeWidth%2/2);
|
||||
this.drawScrollbarButton(0);this.drawScrollbarButton(1)};f.prototype.setRange=function(f,e){var b=this.options,g=b.vertical,p=b.minWidth,c=this.barWidth,a,l=!this.rendered||this.hasDragged||this.chart.navigator&&this.chart.navigator.hasDragged?"attr":"animate";if(F(c)){f=Math.max(f,0);var n=Math.ceil(c*f);this.calculatedWidth=a=r(c*Math.min(e,1)-n);a<p&&(n=(c-p+a)*f,a=p);p=Math.floor(n+this.xOffset+this.yOffset);c=a/2-.5;this.from=f;this.to=e;g?(this.scrollbarGroup[l]({translateY:p}),this.scrollbar[l]({height:a}),
|
||||
this.scrollbarRifles[l]({translateY:c}),this.scrollbarTop=p,this.scrollbarLeft=0):(this.scrollbarGroup[l]({translateX:p}),this.scrollbar[l]({width:a}),this.scrollbarRifles[l]({translateX:c}),this.scrollbarLeft=p,this.scrollbarTop=0);12>=a?this.scrollbarRifles.hide():this.scrollbarRifles.show(!0);!1===b.showFull&&(0>=f&&1<=e?this.group.hide():this.group.show());this.rendered=!0}};f.prototype.trackClick=function(f){var e=this.chart.pointer.normalize(f),b=this.to-this.from,g=this.y+this.scrollbarTop,
|
||||
l=this.x+this.scrollbarLeft;this.options.vertical&&e.chartY>g||!this.options.vertical&&e.chartX>l?this.updatePosition(this.from+b,this.to+b):this.updatePosition(this.from-b,this.to-b);G(this,"changed",{from:this.from,to:this.to,trigger:"scrollbar",DOMEvent:f})};f.prototype.update=function(f){this.destroy();this.init(this.chart.renderer,B(!0,this.options,f),this.chart)};f.prototype.updatePosition=function(f,e){1<e&&(f=r(1-r(e-f)),e=1);0>f&&(e=r(e-f),f=0);this.from=f;this.to=e};return f}();f.Scrollbar||
|
||||
(y(m,"afterInit",function(){var l=this;l.options&&l.options.scrollbar&&l.options.scrollbar.enabled&&(l.options.scrollbar.vertical=!l.horiz,l.options.startOnTick=l.options.endOnTick=!1,l.scrollbar=new n(l.chart.renderer,l.options.scrollbar,l.chart),y(l.scrollbar,"changed",function(n){var e=Math.min(D(l.options.min,l.min),l.min,l.dataMin),b=Math.max(D(l.options.max,l.max),l.max,l.dataMax)-e;if(l.horiz&&!l.reversed||!l.horiz&&l.reversed){var g=e+b*this.to;e+=b*this.from}else g=e+b*(1-this.from),e+=b*
|
||||
(1-this.to);D(this.options.liveRedraw,f.svg&&!f.isTouchDevice&&!this.chart.isBoosting)||"mouseup"===n.DOMType||!F(n.DOMType)?l.setExtremes(e,g,!0,"mousemove"!==n.DOMType,n):this.setRange(this.from,this.to)}))}),y(m,"afterRender",function(){var f=Math.min(D(this.options.min,this.min),this.min,D(this.dataMin,this.min)),n=Math.max(D(this.options.max,this.max),this.max,D(this.dataMax,this.max)),e=this.scrollbar,b=this.axisTitleMargin+(this.titleOffset||0),g=this.chart.scrollbarsOffsets,p=this.options.margin||
|
||||
0;e&&(this.horiz?(this.opposite||(g[1]+=b),e.position(this.left,this.top+this.height+2+g[1]-(this.opposite?p:0),this.width,this.height),this.opposite||(g[1]+=p),b=1):(this.opposite&&(g[0]+=b),e.position(this.left+this.width+2+g[0]-(this.opposite?0:p),this.top,this.width,this.height),this.opposite&&(g[0]+=p),b=0),g[b]+=e.size+e.options.margin,isNaN(f)||isNaN(n)||!F(this.min)||!F(this.max)||this.min===this.max?e.setRange(0,1):(g=(this.min-f)/(n-f),f=(this.max-f)/(n-f),this.horiz&&!this.reversed||!this.horiz&&
|
||||
this.reversed?e.setRange(g,f):e.setRange(1-f,1-g)))}),y(m,"afterGetOffset",function(){var f=this.horiz?2:1,n=this.scrollbar;n&&(this.chart.scrollbarsOffsets=[0,0],this.chart.axisOffset[f]+=n.size+n.options.margin)}),f.Scrollbar=n);return f.Scrollbar});P(y,"parts/Navigator.js",[y["parts/Globals.js"],y["parts/Color.js"],y["parts/Scrollbar.js"],y["parts/Utilities.js"]],function(f,m,y,r){m=m.parse;var F=r.addEvent,I=r.clamp,G=r.correctFloat,B=r.defined,D=r.destroyObjectProperties,K=r.erase,z=r.extend,
|
||||
x=r.find,A=r.isArray,u=r.isNumber,n=r.merge,l=r.pick,q=r.removeEvent,e=r.splat,b=f.Axis;r=f.Chart;var g=f.defaultOptions,p=f.hasTouch,c=f.isTouchDevice,a=f.Series,w=function(a){for(var b=[],c=1;c<arguments.length;c++)b[c-1]=arguments[c];b=[].filter.call(b,u);if(b.length)return Math[a].apply(0,b)};var E="undefined"===typeof f.seriesTypes.areaspline?"line":"areaspline";z(g,{navigator:{height:40,margin:25,maskInside:!0,handles:{width:7,height:15,symbols:["navigator-handle","navigator-handle"],enabled:!0,
|
||||
lineWidth:1,backgroundColor:"#f2f2f2",borderColor:"#999999"},maskFill:m("#6685c2").setOpacity(.3).get(),outlineColor:"#cccccc",outlineWidth:1,series:{type:E,fillOpacity:.05,lineWidth:1,compare:null,dataGrouping:{approximation:"average",enabled:!0,groupPixelWidth:2,smoothed:!0,units:[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1,2,3,4]],["week",[1,2,3]],["month",[1,3,6]],["year",null]]},dataLabels:{enabled:!1,
|
||||
zIndex:2},id:"highcharts-navigator-series",className:"highcharts-navigator-series",lineColor:null,marker:{enabled:!1},threshold:null},xAxis:{overscroll:0,className:"highcharts-navigator-xaxis",tickLength:0,lineWidth:0,gridLineColor:"#e6e6e6",gridLineWidth:1,tickPixelInterval:200,labels:{align:"left",style:{color:"#999999"},x:3,y:-4},crosshair:!1},yAxis:{className:"highcharts-navigator-yaxis",gridLineWidth:0,startOnTick:!1,endOnTick:!1,minPadding:.1,maxPadding:.1,labels:{enabled:!1},crosshair:!1,title:{text:null},
|
||||
tickLength:0,tickWidth:0}}});f.Renderer.prototype.symbols["navigator-handle"]=function(a,b,c,e,f){a=f.width/2;b=Math.round(a/3)+.5;f=f.height;return["M",-a-1,.5,"L",a,.5,"L",a,f+.5,"L",-a-1,f+.5,"L",-a-1,.5,"M",-b,4,"L",-b,f-3,"M",b-1,4,"L",b-1,f-3]};b.prototype.toFixedRange=function(a,b,c,e){var h=this.chart&&this.chart.fixedRange,f=(this.pointRange||0)/2;a=l(c,this.translate(a,!0,!this.horiz));b=l(e,this.translate(b,!0,!this.horiz));var g=h&&(b-a)/h;B(c)||(a=G(a+f));B(e)||(b=G(b-f));.7<g&&1.3>g&&
|
||||
(e?a=b-h:b=a+h);u(a)&&u(b)||(a=b=void 0);return{min:a,max:b}};var v=function(){function a(a){this.zoomedMin=this.zoomedMax=this.yAxis=this.xAxis=this.top=this.size=this.shades=this.rendered=this.range=this.outlineHeight=this.outline=this.opposite=this.navigatorSize=this.navigatorSeries=this.navigatorOptions=this.navigatorGroup=this.navigatorEnabled=this.left=this.height=this.handles=this.chart=this.baseSeries=void 0;this.init(a)}a.prototype.drawHandle=function(a,b,c,e){var h=this.navigatorOptions.handles.height;
|
||||
this.handles[b][e](c?{translateX:Math.round(this.left+this.height/2),translateY:Math.round(this.top+parseInt(a,10)+.5-h)}:{translateX:Math.round(this.left+parseInt(a,10)),translateY:Math.round(this.top+this.height/2-h/2-1)})};a.prototype.drawOutline=function(a,b,c,e){var h=this.navigatorOptions.maskInside,f=this.outline.strokeWidth(),d=f/2;f=f%2/2;var g=this.outlineHeight,k=this.scrollbarHeight,p=this.size,l=this.left-k,n=this.top;c?(l-=d,c=n+b+f,b=n+a+f,a=["M",l+g,n-k-f,"L",l+g,c,"L",l,c,"L",l,b,
|
||||
"L",l+g,b,"L",l+g,n+p+k].concat(h?["M",l+g,c-d,"L",l+g,b+d]:[])):(a+=l+k-f,b+=l+k-f,n+=d,a=["M",l,n,"L",a,n,"L",a,n+g,"L",b,n+g,"L",b,n,"L",l+p+2*k,n].concat(h?["M",a-d,n,"L",b+d,n]:[]));this.outline[e]({d:a})};a.prototype.drawMasks=function(a,b,c,e){var h=this.left,f=this.top,d=this.height;if(c){var g=[h,h,h];var k=[f,f+a,f+b];var l=[d,d,d];var p=[a,b-a,this.size-b]}else g=[h,h+a,h+b],k=[f,f,f],l=[a,b-a,this.size-b],p=[d,d,d];this.shades.forEach(function(a,d){a[e]({x:g[d],y:k[d],width:l[d],height:p[d]})})};
|
||||
a.prototype.renderElements=function(){var a=this,b=a.navigatorOptions,c=b.maskInside,e=a.chart,f=e.renderer,g,d={cursor:e.inverted?"ns-resize":"ew-resize"};a.navigatorGroup=g=f.g("navigator").attr({zIndex:8,visibility:"hidden"}).add();[!c,c,!c].forEach(function(c,h){a.shades[h]=f.rect().addClass("highcharts-navigator-mask"+(1===h?"-inside":"-outside")).add(g);e.styledMode||a.shades[h].attr({fill:c?b.maskFill:"rgba(0,0,0,0)"}).css(1===h&&d)});a.outline=f.path().addClass("highcharts-navigator-outline").add(g);
|
||||
e.styledMode||a.outline.attr({"stroke-width":b.outlineWidth,stroke:b.outlineColor});b.handles.enabled&&[0,1].forEach(function(c){b.handles.inverted=e.inverted;a.handles[c]=f.symbol(b.handles.symbols[c],-b.handles.width/2-1,0,b.handles.width,b.handles.height,b.handles);a.handles[c].attr({zIndex:7-c}).addClass("highcharts-navigator-handle highcharts-navigator-handle-"+["left","right"][c]).add(g);if(!e.styledMode){var h=b.handles;a.handles[c].attr({fill:h.backgroundColor,stroke:h.borderColor,"stroke-width":h.lineWidth}).css(d)}})};
|
||||
a.prototype.update=function(a){(this.series||[]).forEach(function(a){a.baseSeries&&delete a.baseSeries.navigatorSeries});this.destroy();n(!0,this.chart.options.navigator,this.options,a);this.init(this.chart)};a.prototype.render=function(a,b,c,e){var h=this.chart,f=this.scrollbarHeight,d,g=this.xAxis,k=g.pointRange||0;var p=g.fake?h.xAxis[0]:g;var n=this.navigatorEnabled,t,m=this.rendered;var v=h.inverted;var q=h.xAxis[0].minRange,w=h.xAxis[0].options.maxRange;if(!this.hasDragged||B(c)){a=G(a-k/2);
|
||||
b=G(b+k/2);if(!u(a)||!u(b))if(m)c=0,e=l(g.width,p.width);else return;this.left=l(g.left,h.plotLeft+f+(v?h.plotWidth:0));this.size=t=d=l(g.len,(v?h.plotHeight:h.plotWidth)-2*f);h=v?f:d+2*f;c=l(c,g.toPixels(a,!0));e=l(e,g.toPixels(b,!0));u(c)&&Infinity!==Math.abs(c)||(c=0,e=h);a=g.toValue(c,!0);b=g.toValue(e,!0);var x=Math.abs(G(b-a));x<q?this.grabbedLeft?c=g.toPixels(b-q-k,!0):this.grabbedRight&&(e=g.toPixels(a+q+k,!0)):B(w)&&G(x-k)>w&&(this.grabbedLeft?c=g.toPixels(b-w-k,!0):this.grabbedRight&&(e=
|
||||
g.toPixels(a+w+k,!0)));this.zoomedMax=I(Math.max(c,e),0,t);this.zoomedMin=I(this.fixedWidth?this.zoomedMax-this.fixedWidth:Math.min(c,e),0,t);this.range=this.zoomedMax-this.zoomedMin;t=Math.round(this.zoomedMax);c=Math.round(this.zoomedMin);n&&(this.navigatorGroup.attr({visibility:"visible"}),m=m&&!this.hasDragged?"animate":"attr",this.drawMasks(c,t,v,m),this.drawOutline(c,t,v,m),this.navigatorOptions.handles.enabled&&(this.drawHandle(c,0,v,m),this.drawHandle(t,1,v,m)));this.scrollbar&&(v?(v=this.top-
|
||||
f,p=this.left-f+(n||!p.opposite?0:(p.titleOffset||0)+p.axisTitleMargin),f=d+2*f):(v=this.top+(n?this.height:-f),p=this.left-f),this.scrollbar.position(p,v,h,f),this.scrollbar.setRange(this.zoomedMin/(d||1),this.zoomedMax/(d||1)));this.rendered=!0}};a.prototype.addMouseEvents=function(){var a=this,b=a.chart,c=b.container,e=[],f,g;a.mouseMoveHandler=f=function(d){a.onMouseMove(d)};a.mouseUpHandler=g=function(d){a.onMouseUp(d)};e=a.getPartsEvents("mousedown");e.push(F(b.renderTo,"mousemove",f),F(c.ownerDocument,
|
||||
"mouseup",g));p&&(e.push(F(b.renderTo,"touchmove",f),F(c.ownerDocument,"touchend",g)),e.concat(a.getPartsEvents("touchstart")));a.eventsToUnbind=e;a.series&&a.series[0]&&e.push(F(a.series[0].xAxis,"foundExtremes",function(){b.navigator.modifyNavigatorAxisExtremes()}))};a.prototype.getPartsEvents=function(a){var b=this,c=[];["shades","handles"].forEach(function(e){b[e].forEach(function(h,f){c.push(F(h.element,a,function(a){b[e+"Mousedown"](a,f)}))})});return c};a.prototype.shadesMousedown=function(a,
|
||||
b){a=this.chart.pointer.normalize(a);var c=this.chart,e=this.xAxis,h=this.zoomedMin,f=this.left,d=this.size,g=this.range,k=a.chartX;c.inverted&&(k=a.chartY,f=this.top);if(1===b)this.grabbedCenter=k,this.fixedWidth=g,this.dragOffset=k-h;else{a=k-f-g/2;if(0===b)a=Math.max(0,a);else if(2===b&&a+g>=d)if(a=d-g,this.reversedExtremes){a-=g;var l=this.getUnionExtremes().dataMin}else var p=this.getUnionExtremes().dataMax;a!==h&&(this.fixedWidth=g,b=e.toFixedRange(a,a+g,l,p),B(b.min)&&c.xAxis[0].setExtremes(Math.min(b.min,
|
||||
b.max),Math.max(b.min,b.max),!0,null,{trigger:"navigator"}))}};a.prototype.handlesMousedown=function(a,b){this.chart.pointer.normalize(a);a=this.chart;var c=a.xAxis[0],e=this.reversedExtremes;0===b?(this.grabbedLeft=!0,this.otherHandlePos=this.zoomedMax,this.fixedExtreme=e?c.min:c.max):(this.grabbedRight=!0,this.otherHandlePos=this.zoomedMin,this.fixedExtreme=e?c.max:c.min);a.fixedRange=null};a.prototype.onMouseMove=function(a){var b=this,e=b.chart,h=b.left,g=b.navigatorSize,k=b.range,d=b.dragOffset,
|
||||
p=e.inverted;a.touches&&0===a.touches[0].pageX||(a=e.pointer.normalize(a),e=a.chartX,p&&(h=b.top,e=a.chartY),b.grabbedLeft?(b.hasDragged=!0,b.render(0,0,e-h,b.otherHandlePos)):b.grabbedRight?(b.hasDragged=!0,b.render(0,0,b.otherHandlePos,e-h)):b.grabbedCenter&&(b.hasDragged=!0,e<d?e=d:e>g+d-k&&(e=g+d-k),b.render(0,0,e-d,e-d+k)),b.hasDragged&&b.scrollbar&&l(b.scrollbar.options.liveRedraw,f.svg&&!c&&!this.chart.isBoosting)&&(a.DOMType=a.type,setTimeout(function(){b.onMouseUp(a)},0)))};a.prototype.onMouseUp=
|
||||
function(a){var b=this.chart,c=this.xAxis,e=this.scrollbar,h=a.DOMEvent||a,f=b.inverted,d=this.rendered&&!this.hasDragged?"animate":"attr",g=Math.round(this.zoomedMax),k=Math.round(this.zoomedMin);if(this.hasDragged&&(!e||!e.hasDragged)||"scrollbar"===a.trigger){e=this.getUnionExtremes();if(this.zoomedMin===this.otherHandlePos)var p=this.fixedExtreme;else if(this.zoomedMax===this.otherHandlePos)var l=this.fixedExtreme;this.zoomedMax===this.size&&(l=this.reversedExtremes?e.dataMin:e.dataMax);0===this.zoomedMin&&
|
||||
(p=this.reversedExtremes?e.dataMax:e.dataMin);c=c.toFixedRange(this.zoomedMin,this.zoomedMax,p,l);B(c.min)&&b.xAxis[0].setExtremes(Math.min(c.min,c.max),Math.max(c.min,c.max),!0,this.hasDragged?!1:null,{trigger:"navigator",triggerOp:"navigator-drag",DOMEvent:h})}"mousemove"!==a.DOMType&&"touchmove"!==a.DOMType&&(this.grabbedLeft=this.grabbedRight=this.grabbedCenter=this.fixedWidth=this.fixedExtreme=this.otherHandlePos=this.hasDragged=this.dragOffset=null);this.navigatorEnabled&&(this.shades&&this.drawMasks(k,
|
||||
g,f,d),this.outline&&this.drawOutline(k,g,f,d),this.navigatorOptions.handles.enabled&&Object.keys(this.handles).length===this.handles.length&&(this.drawHandle(k,0,f,d),this.drawHandle(g,1,f,d)))};a.prototype.removeEvents=function(){this.eventsToUnbind&&(this.eventsToUnbind.forEach(function(a){a()}),this.eventsToUnbind=void 0);this.removeBaseSeriesEvents()};a.prototype.removeBaseSeriesEvents=function(){var a=this.baseSeries||[];this.navigatorEnabled&&a[0]&&(!1!==this.navigatorOptions.adaptToUpdatedData&&
|
||||
a.forEach(function(a){q(a,"updatedData",this.updatedDataHandler)},this),a[0].xAxis&&q(a[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes))};a.prototype.init=function(a){var c=a.options,e=c.navigator,f=e.enabled,h=c.scrollbar,g=h.enabled;c=f?e.height:0;var d=g?h.height:0;this.handles=[];this.shades=[];this.chart=a;this.setBaseSeries();this.height=c;this.scrollbarHeight=d;this.scrollbarEnabled=g;this.navigatorEnabled=f;this.navigatorOptions=e;this.scrollbarOptions=h;this.outlineHeight=c+d;this.opposite=
|
||||
l(e.opposite,!(f||!a.inverted));var k=this;f=k.baseSeries;h=a.xAxis.length;g=a.yAxis.length;var p=f&&f[0]&&f[0].xAxis||a.xAxis[0]||{options:{}};a.isDirtyBox=!0;k.navigatorEnabled?(k.xAxis=new b(a,n({breaks:p.options.breaks,ordinal:p.options.ordinal},e.xAxis,{id:"navigator-x-axis",yAxis:"navigator-y-axis",isX:!0,type:"datetime",index:h,isInternal:!0,offset:0,keepOrdinalPadding:!0,startOnTick:!1,endOnTick:!1,minPadding:0,maxPadding:0,zoomEnabled:!1},a.inverted?{offsets:[d,0,-d,0],width:c}:{offsets:[0,
|
||||
-d,0,d],height:c})),k.yAxis=new b(a,n(e.yAxis,{id:"navigator-y-axis",alignTicks:!1,offset:0,index:g,isInternal:!0,zoomEnabled:!1},a.inverted?{width:c}:{height:c})),f||e.series.data?k.updateNavigatorSeries(!1):0===a.series.length&&(k.unbindRedraw=F(a,"beforeRedraw",function(){0<a.series.length&&!k.series&&(k.setBaseSeries(),k.unbindRedraw())})),k.reversedExtremes=a.inverted&&!k.xAxis.reversed||!a.inverted&&k.xAxis.reversed,k.renderElements(),k.addMouseEvents()):k.xAxis={translate:function(b,c){var e=
|
||||
a.xAxis[0],f=e.getExtremes(),h=e.len-2*d,g=w("min",e.options.min,f.dataMin);e=w("max",e.options.max,f.dataMax)-g;return c?b*e/h+g:h*(b-g)/e},toPixels:function(a){return this.translate(a)},toValue:function(a){return this.translate(a,!0)},toFixedRange:b.prototype.toFixedRange,fake:!0};a.options.scrollbar.enabled&&(a.scrollbar=k.scrollbar=new y(a.renderer,n(a.options.scrollbar,{margin:k.navigatorEnabled?0:10,vertical:a.inverted}),a),F(k.scrollbar,"changed",function(b){var d=k.size,c=d*this.to;d*=this.from;
|
||||
k.hasDragged=k.scrollbar.hasDragged;k.render(0,0,d,c);(a.options.scrollbar.liveRedraw||"mousemove"!==b.DOMType&&"touchmove"!==b.DOMType)&&setTimeout(function(){k.onMouseUp(b)})}));k.addBaseSeriesEvents();k.addChartEvents()};a.prototype.getUnionExtremes=function(a){var b=this.chart.xAxis[0],c=this.xAxis,e=c.options,f=b.options,h;a&&null===b.dataMin||(h={dataMin:l(e&&e.min,w("min",f.min,b.dataMin,c.dataMin,c.min)),dataMax:l(e&&e.max,w("max",f.max,b.dataMax,c.dataMax,c.max))});return h};a.prototype.setBaseSeries=
|
||||
function(a,b){var c=this.chart,e=this.baseSeries=[];a=a||c.options&&c.options.navigator.baseSeries||(c.series.length?x(c.series,function(a){return!a.options.isInternal}).index:0);(c.series||[]).forEach(function(b,c){b.options.isInternal||!b.options.showInNavigator&&(c!==a&&b.options.id!==a||!1===b.options.showInNavigator)||e.push(b)});this.xAxis&&!this.xAxis.fake&&this.updateNavigatorSeries(!0,b)};a.prototype.updateNavigatorSeries=function(a,b){var c=this,f=c.chart,h=c.baseSeries,k,d,p=c.navigatorOptions.series,
|
||||
m,t={enableMouseTracking:!1,index:null,linkedTo:null,group:"nav",padXAxis:!1,xAxis:"navigator-x-axis",yAxis:"navigator-y-axis",showInLegend:!1,stacking:!1,isInternal:!0,states:{inactive:{opacity:1}}},v=c.series=(c.series||[]).filter(function(a){var b=a.baseSeries;return 0>h.indexOf(b)?(b&&(q(b,"updatedData",c.updatedDataHandler),delete b.navigatorSeries),a.chart&&a.destroy(),!1):!0});h&&h.length&&h.forEach(function(a){var e=a.navigatorSeries,q=z({color:a.color,visible:a.visible},A(p)?g.navigator.series:
|
||||
p);e&&!1===c.navigatorOptions.adaptToUpdatedData||(t.name="Navigator "+h.length,k=a.options||{},m=k.navigatorOptions||{},d=n(k,t,q,m),d.pointRange=l(q.pointRange,m.pointRange,g.plotOptions[d.type||"line"].pointRange),q=m.data||q.data,c.hasNavigatorData=c.hasNavigatorData||!!q,d.data=q||k.data&&k.data.slice(0),e&&e.options?e.update(d,b):(a.navigatorSeries=f.initSeries(d),a.navigatorSeries.baseSeries=a,v.push(a.navigatorSeries)))});if(p.data&&(!h||!h.length)||A(p))c.hasNavigatorData=!1,p=e(p),p.forEach(function(a,
|
||||
b){t.name="Navigator "+(v.length+1);d=n(g.navigator.series,{color:f.series[b]&&!f.series[b].options.isInternal&&f.series[b].color||f.options.colors[b]||f.options.colors[0]},t,a);d.data=a.data;d.data&&(c.hasNavigatorData=!0,v.push(f.initSeries(d)))});a&&this.addBaseSeriesEvents()};a.prototype.addBaseSeriesEvents=function(){var a=this,b=a.baseSeries||[];b[0]&&b[0].xAxis&&F(b[0].xAxis,"foundExtremes",this.modifyBaseAxisExtremes);b.forEach(function(b){F(b,"show",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!0,
|
||||
!1)});F(b,"hide",function(){this.navigatorSeries&&this.navigatorSeries.setVisible(!1,!1)});!1!==this.navigatorOptions.adaptToUpdatedData&&b.xAxis&&F(b,"updatedData",this.updatedDataHandler);F(b,"remove",function(){this.navigatorSeries&&(K(a.series,this.navigatorSeries),B(this.navigatorSeries.options)&&this.navigatorSeries.remove(!1),delete this.navigatorSeries)})},this)};a.prototype.getBaseSeriesMin=function(a){return this.baseSeries.reduce(function(a,b){return Math.min(a,b.xData?b.xData[0]:a)},a)};
|
||||
a.prototype.modifyNavigatorAxisExtremes=function(){var a=this.xAxis,b;"undefined"!==typeof a.getExtremes&&(!(b=this.getUnionExtremes(!0))||b.dataMin===a.min&&b.dataMax===a.max||(a.min=b.dataMin,a.max=b.dataMax))};a.prototype.modifyBaseAxisExtremes=function(){var a=this.chart.navigator,b=this.getExtremes(),c=b.dataMin,e=b.dataMax;b=b.max-b.min;var f=a.stickToMin,g=a.stickToMax,d=l(this.options.overscroll,0),k=a.series&&a.series[0],p=!!this.setExtremes;if(!this.eventArgs||"rangeSelectorButton"!==this.eventArgs.trigger){if(f){var n=
|
||||
c;var m=n+b}g&&(m=e+d,f||(n=Math.max(m-b,a.getBaseSeriesMin(k&&k.xData?k.xData[0]:-Number.MAX_VALUE))));p&&(f||g)&&u(n)&&(this.min=this.userMin=n,this.max=this.userMax=m)}a.stickToMin=a.stickToMax=null};a.prototype.updatedDataHandler=function(){var a=this.chart.navigator,b=this.navigatorSeries,c=a.getBaseSeriesMin(this.xData[0]);a.stickToMax=a.reversedExtremes?0===Math.round(a.zoomedMin):Math.round(a.zoomedMax)>=Math.round(a.size);a.stickToMin=u(this.xAxis.min)&&this.xAxis.min<=c&&(!this.chart.fixedRange||
|
||||
!a.stickToMax);b&&!a.hasNavigatorData&&(b.options.pointStart=this.xData[0],b.setData(this.options.data,!1,null,!1))};a.prototype.addChartEvents=function(){this.eventsToUnbind||(this.eventsToUnbind=[]);this.eventsToUnbind.push(F(this.chart,"redraw",function(){var a=this.navigator,b=a&&(a.baseSeries&&a.baseSeries[0]&&a.baseSeries[0].xAxis||a.scrollbar&&this.xAxis[0]);b&&a.render(b.min,b.max)}),F(this.chart,"getMargins",function(){var a=this.navigator,b=a.opposite?"plotTop":"marginBottom";this.inverted&&
|
||||
(b=a.opposite?"marginRight":"plotLeft");this[b]=(this[b]||0)+(a.navigatorEnabled||!this.inverted?a.outlineHeight:0)+a.navigatorOptions.margin}))};a.prototype.destroy=function(){this.removeEvents();this.xAxis&&(K(this.chart.xAxis,this.xAxis),K(this.chart.axes,this.xAxis));this.yAxis&&(K(this.chart.yAxis,this.yAxis),K(this.chart.axes,this.yAxis));(this.series||[]).forEach(function(a){a.destroy&&a.destroy()});"series xAxis yAxis shades outline scrollbarTrack scrollbarRifles scrollbarGroup scrollbar navigatorGroup rendered".split(" ").forEach(function(a){this[a]&&
|
||||
this[a].destroy&&this[a].destroy();this[a]=null},this);[this.handles].forEach(function(a){D(a)},this)};return a}();f.Navigator||(f.Navigator=v,F(b,"zoom",function(a){var b=this.chart.options,e=b.chart.zoomType,f=b.chart.pinchType,g=b.navigator;b=b.rangeSelector;this.isXAxis&&(g&&g.enabled||b&&b.enabled)&&("y"===e?a.zoomed=!1:(!c&&"xy"===e||c&&"xy"===f)&&this.options.range&&(e=this.previousZoom,B(a.newMin)?this.previousZoom=[this.min,this.max]:e&&(a.newMin=e[0],a.newMax=e[1],delete this.previousZoom)));
|
||||
"undefined"!==typeof a.zoomed&&a.preventDefault()}),F(r,"beforeShowResetZoom",function(){var a=this.options,b=a.navigator,e=a.rangeSelector;if((b&&b.enabled||e&&e.enabled)&&(!c&&"x"===a.chart.zoomType||c&&"x"===a.chart.pinchType))return!1}),F(r,"beforeRender",function(){var a=this.options;if(a.navigator.enabled||a.scrollbar.enabled)this.scroller=this.navigator=new v(this)}),F(r,"afterSetChartSize",function(){var a=this.legend,b=this.navigator;if(b){var c=a&&a.options;var e=b.xAxis;var f=b.yAxis;var g=
|
||||
b.scrollbarHeight;this.inverted?(b.left=b.opposite?this.chartWidth-g-b.height:this.spacing[3]+g,b.top=this.plotTop+g):(b.left=this.plotLeft+g,b.top=b.navigatorOptions.top||this.chartHeight-b.height-g-this.spacing[2]-(this.rangeSelector&&this.extraBottomMargin?this.rangeSelector.getHeight():0)-(c&&"bottom"===c.verticalAlign&&c.enabled&&!c.floating?a.legendHeight+l(c.margin,10):0)-(this.titleOffset?this.titleOffset[2]:0));e&&f&&(this.inverted?e.options.left=f.options.left=b.left:e.options.top=f.options.top=
|
||||
b.top,e.setAxisSize(),f.setAxisSize())}}),F(r,"update",function(a){var b=a.options.navigator||{},c=a.options.scrollbar||{};this.navigator||this.scroller||!b.enabled&&!c.enabled||(n(!0,this.options.navigator,b),n(!0,this.options.scrollbar,c),delete a.options.navigator,delete a.options.scrollbar)}),F(r,"afterUpdate",function(a){this.navigator||this.scroller||!this.options.navigator.enabled&&!this.options.scrollbar.enabled||(this.scroller=this.navigator=new v(this),l(a.redraw,!0)&&this.redraw(a.animation))}),
|
||||
F(r,"afterAddSeries",function(){this.navigator&&this.navigator.setBaseSeries(null,!1)}),F(a,"afterUpdate",function(){this.chart.navigator&&!this.options.isInternal&&this.chart.navigator.setBaseSeries(null,!1)}),r.prototype.callbacks.push(function(a){var b=a.navigator;b&&a.xAxis[0]&&(a=a.xAxis[0].getExtremes(),b.render(a.min,a.max))}));f.Navigator=v;return f.Navigator});P(y,"parts/OrdinalAxis.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.addEvent,r=m.css,F=m.defined,N=m.extend,
|
||||
G=m.pick,B=m.timeUnits,D=f.Axis;m=f.Chart;var K=f.noop;y(f.Series,"updatedData",function(){var f=this.xAxis;f&&f.options.ordinal&&delete f.ordinalIndex});D.prototype.getTimeTicks=function(f,m,r,u,n,l,q){var e=0,b,g,p={},c=[],a=-Number.MAX_VALUE,w=this.options.tickPixelInterval,x=this.chart.time,v=[];if(!this.options.ordinal&&!this.options.breaks||!n||3>n.length||"undefined"===typeof m)return x.getTimeTicks.apply(x,arguments);var k=n.length;for(b=0;b<k;b++){var h=b&&n[b-1]>r;n[b]<m&&(e=b);if(b===k-
|
||||
1||n[b+1]-n[b]>5*l||h){if(n[b]>a){for(g=x.getTimeTicks(f,n[e],n[b],u);g.length&&g[0]<=a;)g.shift();g.length&&(a=g[g.length-1]);v.push(c.length);c=c.concat(g)}e=b+1}if(h)break}g=g.info;if(q&&g.unitRange<=B.hour){b=c.length-1;for(e=1;e<b;e++)if(x.dateFormat("%d",c[e])!==x.dateFormat("%d",c[e-1])){p[c[e]]="day";var t=!0}t&&(p[c[0]]="day");g.higherRanks=p}g.segmentStarts=v;c.info=g;if(q&&F(w)){e=v=c.length;t=[];var z;for(x=[];e--;)b=this.translate(c[e]),z&&(x[e]=z-b),t[e]=z=b;x.sort();x=x[Math.floor(x.length/
|
||||
2)];x<.6*w&&(x=null);e=c[v-1]>r?v-1:v;for(z=void 0;e--;)b=t[e],v=Math.abs(z-b),z&&v<.8*w&&(null===x||v<.8*x)?(p[c[e]]&&!p[c[e+1]]?(v=e+1,z=b):v=e,c.splice(v,1)):z=b}return c};N(D.prototype,{beforeSetTickPositions:function(){var f=[],m,r=!1,u=this.getExtremes(),n=u.min,l=u.max,q,e=this.isXAxis&&!!this.options.breaks;u=this.options.ordinal;var b=Number.MAX_VALUE,g=this.chart.options.chart.ignoreHiddenSeries,p;if(u||e){this.series.forEach(function(a,l){m=[];if(!(g&&!1===a.visible||!1===a.takeOrdinalPosition&&
|
||||
!e)&&(f=f.concat(a.processedXData),c=f.length,f.sort(function(a,b){return a-b}),b=Math.min(b,G(a.closestPointRange,b)),c)){for(l=0;l<c-1;)f[l]!==f[l+1]&&m.push(f[l+1]),l++;m[0]!==f[0]&&m.unshift(f[0]);f=m}a.isSeriesBoosting&&(p=!0)});p&&(f.length=0);var c=f.length;if(2<c){var a=f[1]-f[0];for(q=c-1;q--&&!r;)f[q+1]-f[q]!==a&&(r=!0);!this.options.keepOrdinalPadding&&(f[0]-n>a||l-f[f.length-1]>a)&&(r=!0)}else this.options.overscroll&&(2===c?b=f[1]-f[0]:1===c?(b=this.options.overscroll,f=[f[0],f[0]+b]):
|
||||
b=this.overscrollPointsRange);r?(this.options.overscroll&&(this.overscrollPointsRange=b,f=f.concat(this.getOverscrollPositions())),this.ordinalPositions=f,a=this.ordinal2lin(Math.max(n,f[0]),!0),q=Math.max(this.ordinal2lin(Math.min(l,f[f.length-1]),!0),1),this.ordinalSlope=l=(l-n)/(q-a),this.ordinalOffset=n-a*l):(this.overscrollPointsRange=G(this.closestPointRange,this.overscrollPointsRange),this.ordinalPositions=this.ordinalSlope=this.ordinalOffset=void 0)}this.isOrdinal=u&&r;this.groupIntervalFactor=
|
||||
null},val2lin:function(f,m){var x=this.ordinalPositions;if(x){var u=x.length,n;for(n=u;n--;)if(x[n]===f){var l=n;break}for(n=u-1;n--;)if(f>x[n]||0===n){f=(f-x[n])/(x[n+1]-x[n]);l=n+f;break}m=m?l:this.ordinalSlope*(l||0)+this.ordinalOffset}else m=f;return m},lin2val:function(f,m){var x=this.ordinalPositions;if(x){var u=this.ordinalSlope,n=this.ordinalOffset,l=x.length-1;if(m)if(0>f)f=x[0];else if(f>l)f=x[l];else{l=Math.floor(f);var q=f-l}else for(;l--;)if(m=u*l+n,f>=m){u=u*(l+1)+n;q=(f-m)/(u-m);break}return"undefined"!==
|
||||
typeof q&&"undefined"!==typeof x[l]?x[l]+(q?q*(x[l+1]-x[l]):0):f}return f},getExtendedPositions:function(){var f=this,m=f.chart,r=f.series[0].currentDataGrouping,u=f.ordinalIndex,n=r?r.count+r.unitName:"raw",l=f.options.overscroll,q=f.getExtremes(),e;u||(u=f.ordinalIndex={});if(!u[n]){var b={series:[],chart:m,getExtremes:function(){return{min:q.dataMin,max:q.dataMax+l}},options:{ordinal:!0},val2lin:D.prototype.val2lin,ordinal2lin:D.prototype.ordinal2lin};f.series.forEach(function(g){e={xAxis:b,xData:g.xData.slice(),
|
||||
chart:m,destroyGroupedData:K};e.xData=e.xData.concat(f.getOverscrollPositions());e.options={dataGrouping:r?{enabled:!0,forced:!0,approximation:"open",units:[[r.unitName,[r.count]]]}:{enabled:!1}};g.processData.apply(e);b.series.push(e)});f.beforeSetTickPositions.apply(b);u[n]=b.ordinalPositions}return u[n]},getOverscrollPositions:function(){var f=this.options.overscroll,m=this.overscrollPointsRange,r=[],u=this.dataMax;if(F(m))for(r.push(u);u<=this.dataMax+f;)u+=m,r.push(u);return r},getGroupIntervalFactor:function(f,
|
||||
m,r){r=r.processedXData;var u=r.length,n=[];var l=this.groupIntervalFactor;if(!l){for(l=0;l<u-1;l++)n[l]=r[l+1]-r[l];n.sort(function(f,e){return f-e});n=n[Math.floor(u/2)];f=Math.max(f,r[0]);m=Math.min(m,r[u-1]);this.groupIntervalFactor=l=u*n/(m-f)}return l},postProcessTickInterval:function(f){var m=this.ordinalSlope;return m?this.options.breaks?this.closestPointRange||f:f/(m/this.closestPointRange):f}});D.prototype.ordinal2lin=D.prototype.val2lin;y(m,"pan",function(f){var m=this.xAxis[0],z=m.options.overscroll,
|
||||
u=f.originalEvent.chartX,n=this.options.chart&&this.options.chart.panning,l=!1;if(n&&"y"!==n.type&&m.options.ordinal&&m.series.length){var q=this.mouseDownX,e=m.getExtremes(),b=e.dataMax,g=e.min,p=e.max,c=this.hoverPoints,a=m.closestPointRange||m.overscrollPointsRange;q=(q-u)/(m.translationSlope*(m.ordinalSlope||a));var w={ordinalPositions:m.getExtendedPositions()};a=m.lin2val;var B=m.val2lin;if(!w.ordinalPositions)l=!0;else if(1<Math.abs(q)){c&&c.forEach(function(a){a.setState()});if(0>q){c=w;var v=
|
||||
m.ordinalPositions?m:w}else c=m.ordinalPositions?m:w,v=w;w=v.ordinalPositions;b>w[w.length-1]&&w.push(b);this.fixedRange=p-g;q=m.toFixedRange(null,null,a.apply(c,[B.apply(c,[g,!0])+q,!0]),a.apply(v,[B.apply(v,[p,!0])+q,!0]));q.min>=Math.min(e.dataMin,g)&&q.max<=Math.max(b,p)+z&&m.setExtremes(q.min,q.max,!0,!1,{trigger:"pan"});this.mouseDownX=u;r(this.container,{cursor:"move"})}}else l=!0;l||n&&/y/.test(n.type)?z&&(m.max=m.dataMax+z):f.preventDefault()});y(D,"foundExtremes",function(){this.isXAxis&&
|
||||
F(this.options.overscroll)&&this.max===this.dataMax&&(!this.chart.mouseIsDown||this.isInternal)&&(!this.eventArgs||this.eventArgs&&"navigator"!==this.eventArgs.trigger)&&(this.max+=this.options.overscroll,!this.isInternal&&F(this.userMin)&&(this.min+=this.options.overscroll))});y(D,"afterSetScale",function(){this.horiz&&!this.isDirty&&(this.isDirty=this.isOrdinal&&this.chart.navigator&&!this.chart.navigator.adaptToUpdatedData)})});P(y,"modules/broken-axis.src.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],
|
||||
function(f,m){var y=m.addEvent,r=m.extend,F=m.find,N=m.fireEvent,G=m.isArray,B=m.pick,D=f.Axis;m=f.Series;var K=function(f,m){return F(m,function(m){return m.from<f&&f<m.to})};r(D.prototype,{isInBreak:function(f,m){var r=f.repeat||Infinity,u=f.from,n=f.to-f.from;m=m>=u?(m-u)%r:r-(u-m)%r;return f.inclusive?m<=n:m<n&&0!==m},isInAnyBreak:function(f,m){var r=this.options.breaks,u=r&&r.length,n;if(u){for(;u--;)if(this.isInBreak(r[u],f)){var l=!0;n||(n=B(r[u].showPoints,!this.isXAxis))}var q=l&&m?l&&!n:
|
||||
l}return q}});y(D,"afterInit",function(){"function"===typeof this.setBreaks&&this.setBreaks(this.options.breaks,!1)});y(D,"afterSetTickPositions",function(){if(this.isBroken){var f=this.tickPositions,m=this.tickPositions.info,r=[],u;for(u=0;u<f.length;u++)this.isInAnyBreak(f[u])||r.push(f[u]);this.tickPositions=r;this.tickPositions.info=m}});y(D,"afterSetOptions",function(){this.isBroken&&(this.options.ordinal=!1)});D.prototype.setBreaks=function(f,m){function r(f){var e=f,b;for(b=0;b<n.breakArray.length;b++){var g=
|
||||
n.breakArray[b];if(g.to<=f)e-=g.len;else if(g.from>=f)break;else if(n.isInBreak(g,f)){e-=f-g.from;break}}return e}function u(f){var e;for(e=0;e<n.breakArray.length;e++){var b=n.breakArray[e];if(b.from>=f)break;else b.to<f?f+=b.len:n.isInBreak(b,f)&&(f+=b.len)}return f}var n=this,l=G(f)&&!!f.length;n.isDirty=n.isBroken!==l;n.isBroken=l;n.options.breaks=n.userOptions.breaks=f;n.forceRedraw=!0;n.series.forEach(function(f){f.isDirty=!0});l||n.val2lin!==r||(delete n.val2lin,delete n.lin2val);l&&(n.userOptions.ordinal=
|
||||
!1,n.val2lin=r,n.lin2val=u,n.setExtremes=function(f,e,b,g,p){if(this.isBroken){for(var c,a=this.options.breaks;c=K(f,a);)f=c.to;for(;c=K(e,a);)e=c.from;e<f&&(e=f)}D.prototype.setExtremes.call(this,f,e,b,g,p)},n.setAxisTranslation=function(f){D.prototype.setAxisTranslation.call(this,f);this.unitLength=null;if(this.isBroken){f=n.options.breaks;var e=[],b=[],g=0,p,c=n.userMin||n.min,a=n.userMax||n.max,l=B(n.pointRangePadding,0),m;f.forEach(function(b){p=b.repeat||Infinity;n.isInBreak(b,c)&&(c+=b.to%
|
||||
p-c%p);n.isInBreak(b,a)&&(a-=a%p-b.from%p)});f.forEach(function(b){k=b.from;for(p=b.repeat||Infinity;k-p>c;)k-=p;for(;k<c;)k+=p;for(m=k;m<a;m+=p)e.push({value:m,move:"in"}),e.push({value:m+(b.to-b.from),move:"out",size:b.breakSize})});e.sort(function(a,b){return a.value===b.value?("in"===a.move?0:1)-("in"===b.move?0:1):a.value-b.value});var v=0;var k=c;e.forEach(function(a){v+="in"===a.move?1:-1;1===v&&"in"===a.move&&(k=a.value);0===v&&(b.push({from:k,to:a.value,len:a.value-k-(a.size||0)}),g+=a.value-
|
||||
k-(a.size||0))});n.breakArray=b;n.unitLength=a-c-g+l;N(n,"afterBreaks");n.staticScale?n.transA=n.staticScale:n.unitLength&&(n.transA*=(a-n.min+l)/n.unitLength);l&&(n.minPixelPadding=n.transA*n.minPointOffset);n.min=c;n.max=a}});B(m,!0)&&this.chart.redraw()};y(m,"afterGeneratePoints",function(){var f=this.options.connectNulls,m=this.points,r=this.xAxis,u=this.yAxis;if(this.isDirty)for(var n=m.length;n--;){var l=m[n],q=!(null===l.y&&!1===f)&&(r&&r.isInAnyBreak(l.x,!0)||u&&u.isInAnyBreak(l.y,!0));l.visible=
|
||||
q?!1:!1!==l.options.visible}});y(m,"afterRender",function(){this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,B(this.pointArrayMap,["y"]))});f.Series.prototype.drawBreaks=function(f,m){var r=this,u=r.points,n,l,q,e;f&&m.forEach(function(b){n=f.breakArray||[];l=f.isXAxis?f.min:B(r.options.threshold,f.min);u.forEach(function(g){e=B(g["stack"+b.toUpperCase()],g[b]);n.forEach(function(b){q=!1;if(l<b.from&&e>b.to||l>b.from&&e<b.from)q="pointBreak";else if(l<b.from&&e>b.from&&e<b.to||l>b.from&&
|
||||
e>b.to&&e<b.from)q="pointInBreak";q&&N(f,q,{point:g,brk:b})})})})};f.Series.prototype.gappedPath=function(){var m=this.currentDataGrouping,r=m&&m.gapSize;m=this.options.gapSize;var B=this.points.slice(),u=B.length-1,n=this.yAxis,l;if(m&&0<u)for("value"!==this.options.gapUnit&&(m*=this.basePointRange),r&&r>m&&r>=this.basePointRange&&(m=r),l=void 0;u--;)l&&!1!==l.visible||(l=B[u+1]),r=B[u],!1!==l.visible&&!1!==r.visible&&(l.x-r.x>m&&(l=(r.x+l.x)/2,B.splice(u+1,0,{isNull:!0,x:l}),this.options.stacking&&
|
||||
(l=n.stacks[this.stackKey][l]=new f.StackItem(n,n.options.stackLabels,!1,l,this.stack),l.total=0)),l=r);return this.getGraphPath(B)}});P(y,"masters/modules/broken-axis.src.js",[],function(){});P(y,"parts/DataGrouping.js",[y["parts/Globals.js"],y["parts/Point.js"],y["parts/Tooltip.js"],y["parts/Utilities.js"]],function(f,m,y,r){"";var F=r.addEvent,I=r.arrayMax,G=r.arrayMin,B=r.correctFloat,D=r.defined,K=r.error,z=r.extend,x=r.format,A=r.isNumber,u=r.merge,n=r.pick,l=f.Axis,q=f.defaultPlotOptions;r=
|
||||
f.Series;var e=f.approximations={sum:function(a){var b=a.length;if(!b&&a.hasNulls)var c=null;else if(b)for(c=0;b--;)c+=a[b];return c},average:function(a){var b=a.length;a=e.sum(a);A(a)&&b&&(a=B(a/b));return a},averages:function(){var a=[];[].forEach.call(arguments,function(b){a.push(e.average(b))});return"undefined"===typeof a[0]?void 0:a},open:function(a){return a.length?a[0]:a.hasNulls?null:void 0},high:function(a){return a.length?I(a):a.hasNulls?null:void 0},low:function(a){return a.length?G(a):
|
||||
a.hasNulls?null:void 0},close:function(a){return a.length?a[a.length-1]:a.hasNulls?null:void 0},ohlc:function(a,b,c,f){a=e.open(a);b=e.high(b);c=e.low(c);f=e.close(f);if(A(a)||A(b)||A(c)||A(f))return[a,b,c,f]},range:function(a,b){a=e.low(a);b=e.high(b);if(A(a)||A(b))return[a,b];if(null===a&&null===b)return null}},b=function(a,b,c,f){var g=this,h=g.data,k=g.options&&g.options.data,d=[],l=[],p=[],n=a.length,m=!!b,t=[],v=g.pointArrayMap,q=v&&v.length,w=["x"].concat(v||["y"]),r=0,x=0,z;f="function"===
|
||||
typeof f?f:e[f]?e[f]:e[g.getDGApproximation&&g.getDGApproximation()||"average"];q?v.forEach(function(){t.push([])}):t.push([]);var B=q||1;for(z=0;z<=n&&!(a[z]>=c[0]);z++);for(z;z<=n;z++){for(;"undefined"!==typeof c[r+1]&&a[z]>=c[r+1]||z===n;){var y=c[r];g.dataGroupInfo={start:g.cropStart+x,length:t[0].length};var E=f.apply(g,t);g.pointClass&&!D(g.dataGroupInfo.options)&&(g.dataGroupInfo.options=u(g.pointClass.prototype.optionsToObject.call({series:g},g.options.data[g.cropStart+x])),w.forEach(function(a){delete g.dataGroupInfo.options[a]}));
|
||||
"undefined"!==typeof E&&(d.push(y),l.push(E),p.push(g.dataGroupInfo));x=z;for(y=0;y<B;y++)t[y].length=0,t[y].hasNulls=!1;r+=1;if(z===n)break}if(z===n)break;if(v)for(y=g.cropStart+z,E=h&&h[y]||g.pointClass.prototype.applyOptions.apply({series:g},[k[y]]),y=0;y<q;y++){var L=E[v[y]];A(L)?t[y].push(L):null===L&&(t[y].hasNulls=!0)}else y=m?b[z]:null,A(y)?t[0].push(y):null===y&&(t[0].hasNulls=!0)}return{groupedXData:d,groupedYData:l,groupMap:p}},g={approximations:e,groupData:b},p=r.prototype,c=p.processData,
|
||||
a=p.generatePoints,w={groupPixelWidth:2,dateTimeLabelFormats:{millisecond:["%A, %b %e, %H:%M:%S.%L","%A, %b %e, %H:%M:%S.%L","-%H:%M:%S.%L"],second:["%A, %b %e, %H:%M:%S","%A, %b %e, %H:%M:%S","-%H:%M:%S"],minute:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],hour:["%A, %b %e, %H:%M","%A, %b %e, %H:%M","-%H:%M"],day:["%A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],week:["Week from %A, %b %e, %Y","%A, %b %e","-%A, %b %e, %Y"],month:["%B %Y","%B","-%B %Y"],year:["%Y","%Y","-%Y"]}},E={line:{},spline:{},
|
||||
area:{},areaspline:{},arearange:{},column:{groupPixelWidth:10},columnrange:{groupPixelWidth:10},candlestick:{groupPixelWidth:10},ohlc:{groupPixelWidth:5}},v=f.defaultDataGroupingUnits=[["millisecond",[1,2,5,10,20,25,50,100,200,500]],["second",[1,2,5,10,15,30]],["minute",[1,2,5,10,15,30]],["hour",[1,2,3,4,6,8,12]],["day",[1]],["week",[1]],["month",[1,3,6]],["year",null]];p.getDGApproximation=function(){return this.is("arearange")?"range":this.is("ohlc")?"ohlc":this.is("column")?"sum":"average"};p.groupData=
|
||||
b;p.processData=function(){var a=this.chart,b=this.options.dataGrouping,e=!1!==this.allowDG&&b&&n(b.enabled,a.options.isStock),f=this.visible||!a.options.chart.ignoreHiddenSeries,g,l=this.currentDataGrouping,m=!1;this.forceCrop=e;this.groupPixelWidth=null;this.hasProcessed=!0;e&&!this.requireSorting&&(this.requireSorting=m=!0);e=!1===c.apply(this,arguments)||!e;m&&(this.requireSorting=!1);if(!e){this.destroyGroupedData();e=b.groupAll?this.xData:this.processedXData;var d=b.groupAll?this.yData:this.processedYData,
|
||||
q=a.plotSizeX;a=this.xAxis;var w=a.options.ordinal,u=this.groupPixelWidth=a.getGroupPixelWidth&&a.getGroupPixelWidth();if(u){this.isDirty=g=!0;this.points=null;m=a.getExtremes();var r=m.min;m=m.max;w=w&&a.getGroupIntervalFactor(r,m,this)||1;u=u*(m-r)/q*w;q=a.getTimeTicks(a.normalizeTimeTickInterval(u,b.units||v),Math.min(r,e[0]),Math.max(m,e[e.length-1]),a.options.startOfWeek,e,this.closestPointRange);d=p.groupData.apply(this,[e,d,q,b.approximation]);e=d.groupedXData;w=d.groupedYData;var x=0;if(b.smoothed&&
|
||||
e.length){var z=e.length-1;for(e[z]=Math.min(e[z],m);z--&&0<z;)e[z]+=u/2;e[0]=Math.max(e[0],r)}for(z=1;z<q.length;z++)q.info.segmentStarts&&-1!==q.info.segmentStarts.indexOf(z)||(x=Math.max(q[z]-q[z-1],x));r=q.info;r.gapSize=x;this.closestPointRange=q.info.totalRange;this.groupMap=d.groupMap;if(D(e[0])&&e[0]<a.min&&f){if(!D(a.options.min)&&a.min<=a.dataMin||a.min===a.dataMin)a.min=Math.min(e[0],a.min);a.dataMin=Math.min(e[0],a.dataMin)}b.groupAll&&(b=this.cropData(e,w,a.min,a.max,1),e=b.xData,w=b.yData);
|
||||
this.processedXData=e;this.processedYData=w}else this.groupMap=null;this.hasGroupedData=g;this.currentDataGrouping=r;this.preventGraphAnimation=(l&&l.totalRange)!==(r&&r.totalRange)}};p.destroyGroupedData=function(){this.groupedData&&(this.groupedData.forEach(function(a,b){a&&(this.groupedData[b]=a.destroy?a.destroy():null)},this),this.groupedData.length=0)};p.generatePoints=function(){a.apply(this);this.destroyGroupedData();this.groupedData=this.hasGroupedData?this.points:null};F(m,"update",function(){if(this.dataGroup)return K(24,
|
||||
!1,this.series.chart),!1});F(y,"headerFormatter",function(a){var b=this.chart,c=b.time,e=a.labelConfig,f=e.series,g=f.tooltipOptions,k=f.options.dataGrouping,d=g.xDateFormat,l=f.xAxis,p=g[(a.isFooter?"footer":"header")+"Format"];if(l&&"datetime"===l.options.type&&k&&A(e.key)){var n=f.currentDataGrouping;k=k.dateTimeLabelFormats||w.dateTimeLabelFormats;if(n)if(g=k[n.unitName],1===n.count)d=g[0];else{d=g[1];var m=g[2]}else!d&&k&&(d=this.getXDateFormat(e,g,l));d=c.dateFormat(d,e.key);m&&(d+=c.dateFormat(m,
|
||||
e.key+n.totalRange-1));f.chart.styledMode&&(p=this.styledModeFormat(p));a.text=x(p,{point:z(e.point,{key:d}),series:f},b);a.preventDefault()}});F(r,"destroy",p.destroyGroupedData);F(r,"afterSetOptions",function(a){a=a.options;var b=this.type,c=this.chart.options.plotOptions,e=q[b].dataGrouping,f=this.useCommonDataGrouping&&w;if(E[b]||f)e||(e=u(w,E[b])),a.dataGrouping=u(f,e,c.series&&c.series.dataGrouping,c[b].dataGrouping,this.userOptions.dataGrouping)});F(l,"afterSetScale",function(){this.series.forEach(function(a){a.hasProcessed=
|
||||
!1})});l.prototype.getGroupPixelWidth=function(){var a=this.series,b=a.length,c,e=0,f=!1,g;for(c=b;c--;)(g=a[c].options.dataGrouping)&&(e=Math.max(e,n(g.groupPixelWidth,w.groupPixelWidth)));for(c=b;c--;)(g=a[c].options.dataGrouping)&&a[c].hasProcessed&&(b=(a[c].processedXData||a[c].data).length,a[c].groupPixelWidth||b>this.chart.plotSizeX/e||b&&g.forced)&&(f=!0);return f?e:0};l.prototype.setDataGrouping=function(a,b){var c;b=n(b,!0);a||(a={forced:!1,units:null});if(this instanceof l)for(c=this.series.length;c--;)this.series[c].update({dataGrouping:a},
|
||||
!1);else this.chart.options.series.forEach(function(b){b.dataGrouping=a},!1);this.ordinalSlope=null;b&&this.chart.redraw()};f.dataGrouping=g;"";return g});P(y,"parts/OHLCSeries.js",[y["parts/Globals.js"],y["parts/Point.js"],y["parts/Utilities.js"]],function(f,m,y){y=y.seriesType;var r=f.seriesTypes;y("ohlc","column",{lineWidth:1,tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> <b> {series.name}</b><br/>Open: {point.open}<br/>High: {point.high}<br/>Low: {point.low}<br/>Close: {point.close}<br/>'},
|
||||
threshold:null,states:{hover:{lineWidth:3}},stickyTracking:!0},{directTouch:!1,pointArrayMap:["open","high","low","close"],toYData:function(f){return[f.open,f.high,f.low,f.close]},pointValKey:"close",pointAttrToOptions:{stroke:"color","stroke-width":"lineWidth"},init:function(){r.column.prototype.init.apply(this,arguments);this.options.stacking=!1},pointAttribs:function(f,m){m=r.column.prototype.pointAttribs.call(this,f,m);var y=this.options;delete m.fill;!f.options.color&&y.upColor&&f.open<f.close&&
|
||||
(m.stroke=y.upColor);return m},translate:function(){var f=this,m=f.yAxis,y=!!f.modifyValue,B=["plotOpen","plotHigh","plotLow","plotClose","yBottom"];r.column.prototype.translate.apply(f);f.points.forEach(function(r){[r.open,r.high,r.low,r.close,r.low].forEach(function(D,z){null!==D&&(y&&(D=f.modifyValue(D)),r[B[z]]=m.toPixels(D,!0))});r.tooltipPos[1]=r.plotHigh+m.pos-f.chart.plotTop})},drawPoints:function(){var f=this,m=f.chart,r=function(f,m,r){f[2]=Math.max(r+m,f[2]);f[5]=Math.min(r-m,f[5])};f.points.forEach(function(y){var B=
|
||||
y.graphic,G=!B;if("undefined"!==typeof y.plotY){B||(y.graphic=B=m.renderer.path().add(f.group));m.styledMode||B.attr(f.pointAttribs(y,y.selected&&"select"));var z=B.strokeWidth();var x=z%2/2;var A=Math.round(y.plotX)-x;var u=Math.round(y.shapeArgs.width/2);var n=["M",A,Math.round(y.yBottom),"L",A,Math.round(y.plotHigh)];if(null!==y.open){var l=Math.round(y.plotOpen)+x;n.push("M",A,l,"L",A-u,l);r(n,z/2,l)}null!==y.close&&(l=Math.round(y.plotClose)+x,n.push("M",A,l,"L",A+u,l),r(n,z/2,l));B[G?"attr":
|
||||
"animate"]({d:n}).addClass(y.getClassName(),!0)}})},animate:null},{getClassName:function(){return m.prototype.getClassName.call(this)+(this.open<this.close?" highcharts-point-up":" highcharts-point-down")}});""});P(y,"parts/CandlestickSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.merge;m=m.seriesType;var r=f.defaultPlotOptions,F=f.seriesTypes;m("candlestick","ohlc",y(r.column,{states:{hover:{lineWidth:2}},tooltip:r.ohlc.tooltip,threshold:null,lineColor:"#000000",
|
||||
lineWidth:1,upColor:"#ffffff",stickyTracking:!0}),{pointAttribs:function(f,m){var r=F.column.prototype.pointAttribs.call(this,f,m),y=this.options,G=f.open<f.close,z=y.lineColor||this.color;r["stroke-width"]=y.lineWidth;r.fill=f.options.color||(G?y.upColor||this.color:this.color);r.stroke=f.options.lineColor||(G?y.upLineColor||z:z);m&&(f=y.states[m],r.fill=f.color||r.fill,r.stroke=f.lineColor||r.stroke,r["stroke-width"]=f.lineWidth||r["stroke-width"]);return r},drawPoints:function(){var f=this,m=f.chart,
|
||||
r=f.yAxis.reversed;f.points.forEach(function(y){var B=y.graphic,z=!B;if("undefined"!==typeof y.plotY){B||(y.graphic=B=m.renderer.path().add(f.group));f.chart.styledMode||B.attr(f.pointAttribs(y,y.selected&&"select")).shadow(f.options.shadow);var x=B.strokeWidth()%2/2;var A=Math.round(y.plotX)-x;var u=y.plotOpen;var n=y.plotClose;var l=Math.min(u,n);u=Math.max(u,n);var q=Math.round(y.shapeArgs.width/2);n=r?u!==y.yBottom:Math.round(l)!==Math.round(y.plotHigh);var e=r?Math.round(l)!==Math.round(y.plotHigh):
|
||||
u!==y.yBottom;l=Math.round(l)+x;u=Math.round(u)+x;x=[];x.push("M",A-q,u,"L",A-q,l,"L",A+q,l,"L",A+q,u,"Z","M",A,l,"L",A,n?Math.round(r?y.yBottom:y.plotHigh):l,"M",A,u,"L",A,e?Math.round(r?y.plotHigh:y.yBottom):u);B[z?"attr":"animate"]({d:x}).addClass(y.getClassName(),!0)}})}});""});P(y,"mixins/on-series.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],function(f,m){var y=m.defined,r=m.stableSort,F=f.seriesTypes;return{getPlotBox:function(){return f.Series.prototype.getPlotBox.call(this.options.onSeries&&
|
||||
this.chart.get(this.options.onSeries)||this)},translate:function(){F.column.prototype.translate.apply(this);var f=this,m=f.options,B=f.chart,D=f.points,I=D.length-1,z,x=m.onSeries;x=x&&B.get(x);m=m.onKey||"y";var A=x&&x.options.step,u=x&&x.points,n=u&&u.length,l=B.inverted,q=f.xAxis,e=f.yAxis,b=0,g;if(x&&x.visible&&n){b=(x.pointXOffset||0)+(x.barW||0)/2;B=x.currentDataGrouping;var p=u[n-1].x+(B?B.totalRange:0);r(D,function(a,b){return a.x-b.x});for(m="plot"+m[0].toUpperCase()+m.substr(1);n--&&D[I];){var c=
|
||||
u[n];B=D[I];B.y=c.y;if(c.x<=B.x&&"undefined"!==typeof c[m]){if(B.x<=p&&(B.plotY=c[m],c.x<B.x&&!A&&(g=u[n+1])&&"undefined"!==typeof g[m])){var a=(B.x-c.x)/(g.x-c.x);B.plotY+=a*(g[m]-c[m]);B.y+=a*(g.y-c.y)}I--;n++;if(0>I)break}}}D.forEach(function(a,c){a.plotX+=b;if("undefined"===typeof a.plotY||l)0<=a.plotX&&a.plotX<=q.len?l?(a.plotY=q.translate(a.x,0,1,0,1),a.plotX=y(a.y)?e.translate(a.y,0,0,0,1):0):a.plotY=(q.opposite?0:f.yAxis.len)+q.offset:a.shapeArgs={};if((z=D[c-1])&&z.plotX===a.plotX){"undefined"===
|
||||
typeof z.stackIndex&&(z.stackIndex=0);var g=z.stackIndex+1}a.stackIndex=g});this.onSeries=x}}});P(y,"parts/FlagsSeries.js",[y["parts/Globals.js"],y["parts/Utilities.js"],y["mixins/on-series.js"]],function(f,m,y){function r(f){l[f+"pin"]=function(e,b,g,p,c){var a=c&&c.anchorX;c=c&&c.anchorY;"circle"===f&&p>g&&(e-=Math.round((p-g)/2),g=p);var n=l[f](e,b,g,p);a&&c&&(n.push("M","circle"===f?e+g/2:n[1]+n[4]/2,b>c?b:b+p,"L",a,c),n=n.concat(l.circle(a-1,c-1,2,2)));return n}}var F=m.addEvent,I=m.defined,
|
||||
G=m.isNumber,B=m.merge,D=m.objectEach,K=m.seriesType,z=m.wrap;m=f.noop;var x=f.Renderer,A=f.Series,u=f.TrackerMixin,n=f.VMLRenderer,l=f.SVGRenderer.prototype.symbols;K("flags","column",{pointRange:0,allowOverlapX:!1,shape:"flag",stackDistance:12,textAlign:"center",tooltip:{pointFormat:"{point.text}<br/>"},threshold:null,y:-30,fillColor:"#ffffff",lineWidth:1,states:{hover:{lineColor:"#000000",fillColor:"#ccd6eb"}},style:{fontSize:"11px",fontWeight:"bold"}},{sorted:!1,noSharedTooltip:!0,allowDG:!1,
|
||||
takeOrdinalPosition:!1,trackerGroups:["markerGroup"],forceCrop:!0,init:A.prototype.init,pointAttribs:function(f,e){var b=this.options,g=f&&f.color||this.color,l=b.lineColor,c=f&&f.lineWidth;f=f&&f.fillColor||b.fillColor;e&&(f=b.states[e].fillColor,l=b.states[e].lineColor,c=b.states[e].lineWidth);return{fill:f||g,stroke:l||g,"stroke-width":c||b.lineWidth||0}},translate:y.translate,getPlotBox:y.getPlotBox,drawPoints:function(){var l=this.points,e=this.chart,b=e.renderer,g=e.inverted,p=this.options,
|
||||
c=p.y,a,n=this.yAxis,m={},v=[];for(a=l.length;a--;){var k=l[a];var h=(g?k.plotY:k.plotX)>this.xAxis.len;var t=k.plotX;var r=k.stackIndex;var u=k.options.shape||p.shape;var x=k.plotY;"undefined"!==typeof x&&(x=k.plotY+c-("undefined"!==typeof r&&r*p.stackDistance));k.anchorX=r?void 0:k.plotX;var y=r?void 0:k.plotY;var d="flag"!==u;r=k.graphic;"undefined"!==typeof x&&0<=t&&!h?(r||(r=k.graphic=b.label("",null,null,u,null,null,p.useHTML),e.styledMode||r.attr(this.pointAttribs(k)).css(B(p.style,k.style)),
|
||||
r.attr({align:d?"center":"left",width:p.width,height:p.height,"text-align":p.textAlign}).addClass("highcharts-point").add(this.markerGroup),k.graphic.div&&(k.graphic.div.point=k),e.styledMode||r.shadow(p.shadow),r.isNew=!0),0<t&&(t-=r.strokeWidth()%2),u={y:x,anchorY:y},p.allowOverlapX&&(u.x=t,u.anchorX=k.anchorX),r.attr({text:k.options.title||p.title||"A"})[r.isNew?"attr":"animate"](u),p.allowOverlapX||(m[k.plotX]?m[k.plotX].size=Math.max(m[k.plotX].size,r.width):m[k.plotX]={align:d?.5:0,size:r.width,
|
||||
target:t,anchorX:t}),k.tooltipPos=[t,x+n.pos-e.plotTop]):r&&(k.graphic=r.destroy())}p.allowOverlapX||(D(m,function(a){a.plotX=a.anchorX;v.push(a)}),f.distribute(v,g?n.len:this.xAxis.len,100),l.forEach(function(a){var b=a.graphic&&m[a.plotX];b&&(a.graphic[a.graphic.isNew?"attr":"animate"]({x:b.pos+b.align*b.size,anchorX:a.anchorX}),I(b.pos)?a.graphic.isNew=!1:(a.graphic.attr({x:-9999,anchorX:-9999}),a.graphic.isNew=!0))}));p.useHTML&&z(this.markerGroup,"on",function(a){return f.SVGElement.prototype.on.apply(a.apply(this,
|
||||
[].slice.call(arguments,1)),[].slice.call(arguments,1))})},drawTracker:function(){var f=this.points;u.drawTrackerPoint.apply(this);f.forEach(function(e){var b=e.graphic;b&&F(b.element,"mouseover",function(){0<e.stackIndex&&!e.raised&&(e._y=b.y,b.attr({y:e._y-8}),e.raised=!0);f.forEach(function(b){b!==e&&b.raised&&b.graphic&&(b.graphic.attr({y:b._y}),b.raised=!1)})})})},animate:function(f){f&&this.setClip()},setClip:function(){A.prototype.setClip.apply(this,arguments);!1!==this.options.clip&&this.sharedClipKey&&
|
||||
this.markerGroup.clip(this.chart[this.sharedClipKey])},buildKDTree:m,invertGroups:m},{isValid:function(){return G(this.y)||"undefined"===typeof this.y}});l.flag=function(f,e,b,g,p){var c=p&&p.anchorX||f;p=p&&p.anchorY||e;return l.circle(c-1,p-1,2,2).concat(["M",c,p,"L",f,e+g,f,e,f+b,e,f+b,e+g,f,e+g,"Z"])};r("circle");r("square");x===n&&["circlepin","flag","squarepin"].forEach(function(f){n.prototype.symbols[f]=l[f]});""});P(y,"parts/RangeSelector.js",[y["parts/Globals.js"],y["parts/Utilities.js"]],
|
||||
function(f,m){function y(b){this.init(b)}var r=m.addEvent,F=m.createElement,N=m.css,G=m.defined,B=m.destroyObjectProperties,D=m.discardElement,K=m.extend,z=m.fireEvent,x=m.isNumber,A=m.merge,u=m.objectEach,n=m.pick,l=m.pInt,q=m.splat,e=f.Axis;m=f.Chart;var b=f.defaultOptions;K(b,{rangeSelector:{verticalAlign:"top",buttonTheme:{width:28,height:18,padding:2,zIndex:7},floating:!1,x:0,y:0,height:void 0,inputPosition:{align:"right",x:0,y:0},buttonPosition:{align:"left",x:0,y:0},labelStyle:{color:"#666666"}}});
|
||||
b.lang=A(b.lang,{rangeSelectorZoom:"Zoom",rangeSelectorFrom:"From",rangeSelectorTo:"To"});y.prototype={clickButton:function(b,f){var c=this.chart,a=this.buttonOptions[b],g=c.xAxis[0],l=c.scroller&&c.scroller.getUnionExtremes()||g||{},p=l.dataMin,k=l.dataMax,h=g&&Math.round(Math.min(g.max,n(k,g.max))),m=a.type;l=a._range;var u,y=a.dataGrouping;if(null!==p&&null!==k){c.fixedRange=l;y&&(this.forcedDataGrouping=!0,e.prototype.setDataGrouping.call(g||{chart:this.chart},y,!1),this.frozenStates=a.preserveDataGrouping);
|
||||
if("month"===m||"year"===m)if(g){m={range:a,max:h,chart:c,dataMin:p,dataMax:k};var z=g.minFromRange.call(m);x(m.newMax)&&(h=m.newMax)}else l=a;else if(l)z=Math.max(h-l,p),h=Math.min(z+l,k);else if("ytd"===m)if(g)"undefined"===typeof k&&(p=Number.MAX_VALUE,k=Number.MIN_VALUE,c.series.forEach(function(a){a=a.xData;p=Math.min(a[0],p);k=Math.max(a[a.length-1],k)}),f=!1),h=this.getYTDExtremes(k,p,c.time.useUTC),z=u=h.min,h=h.max;else{this.deferredYTDClick=b;return}else"all"===m&&g&&(z=p,h=k);z+=a._offsetMin;
|
||||
h+=a._offsetMax;this.setSelected(b);if(g)g.setExtremes(z,h,n(f,1),null,{trigger:"rangeSelectorButton",rangeSelectorButton:a});else{var C=q(c.options.xAxis)[0];var d=C.range;C.range=l;var A=C.min;C.min=u;r(c,"load",function(){C.range=d;C.min=A})}}},setSelected:function(b){this.selected=this.options.selected=b},defaultButtons:[{type:"month",count:1,text:"1m"},{type:"month",count:3,text:"3m"},{type:"month",count:6,text:"6m"},{type:"ytd",text:"YTD"},{type:"year",count:1,text:"1y"},{type:"all",text:"All"}],
|
||||
init:function(b){var e=this,c=b.options.rangeSelector,a=c.buttons||[].concat(e.defaultButtons),f=c.selected,g=function(){var a=e.minInput,b=e.maxInput;a&&a.blur&&z(a,"blur");b&&b.blur&&z(b,"blur")};e.chart=b;e.options=c;e.buttons=[];e.buttonOptions=a;this.unMouseDown=r(b.container,"mousedown",g);this.unResize=r(b,"resize",g);a.forEach(e.computeButtonRange);"undefined"!==typeof f&&a[f]&&this.clickButton(f,!1);r(b,"load",function(){b.xAxis&&b.xAxis[0]&&r(b.xAxis[0],"setExtremes",function(a){this.max-
|
||||
this.min!==b.fixedRange&&"rangeSelectorButton"!==a.trigger&&"updatedData"!==a.trigger&&e.forcedDataGrouping&&!e.frozenStates&&this.setDataGrouping(!1,!1)})})},updateButtonStates:function(){var b=this,e=this.chart,c=e.xAxis[0],a=Math.round(c.max-c.min),f=!c.hasVisibleSeries,l=e.scroller&&e.scroller.getUnionExtremes()||c,n=l.dataMin,k=l.dataMax;e=b.getYTDExtremes(k,n,e.time.useUTC);var h=e.min,m=e.max,q=b.selected,r=x(q),u=b.options.allButtonsEnabled,y=b.buttons;b.buttonOptions.forEach(function(d,e){var g=
|
||||
d._range,l=d.type,p=d.count||1,v=y[e],t=0,w=d._offsetMax-d._offsetMin;d=e===q;var x=g>k-n,z=g<c.minRange,C=!1,A=!1;g=g===a;("month"===l||"year"===l)&&a+36E5>=864E5*{month:28,year:365}[l]*p-w&&a-36E5<=864E5*{month:31,year:366}[l]*p+w?g=!0:"ytd"===l?(g=m-h+w===a,C=!d):"all"===l&&(g=c.max-c.min>=k-n,A=!d&&r&&g);l=!u&&(x||z||A||f);p=d&&g||g&&!r&&!C||d&&b.frozenStates;l?t=3:p&&(r=!0,t=2);v.state!==t&&(v.setState(t),0===t&&q===e&&b.setSelected(null))})},computeButtonRange:function(b){var e=b.type,c=b.count||
|
||||
1,a={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5};if(a[e])b._range=a[e]*c;else if("month"===e||"year"===e)b._range=864E5*{month:30,year:365}[e]*c;b._offsetMin=n(b.offsetMin,0);b._offsetMax=n(b.offsetMax,0);b._range+=b._offsetMax-b._offsetMin},setInputValue:function(b,e){var c=this.chart.options.rangeSelector,a=this.chart.time,f=this[b+"Input"];G(e)&&(f.previousValue=f.HCTime,f.HCTime=e);f.value=a.dateFormat(c.inputEditDateFormat||"%Y-%m-%d",f.HCTime);this[b+"DateBox"].attr({text:a.dateFormat(c.inputDateFormat||
|
||||
"%b %e, %Y",f.HCTime)})},showInput:function(b){var e=this.inputGroup,c=this[b+"DateBox"];N(this[b+"Input"],{left:e.translateX+c.x+"px",top:e.translateY+"px",width:c.width-2+"px",height:c.height-2+"px",border:"2px solid silver"})},hideInput:function(b){N(this[b+"Input"],{border:0,width:"1px",height:"1px"});this.setInputValue(b)},drawInput:function(e){function g(){var b=t.value,e=(v.inputDateParser||Date.parse)(b),d=a.xAxis[0],f=a.scroller&&a.scroller.xAxis?a.scroller.xAxis:d,g=f.dataMin;f=f.dataMax;
|
||||
e!==t.previousValue&&(t.previousValue=e,x(e)||(e=b.split("-"),e=Date.UTC(l(e[0]),l(e[1])-1,l(e[2]))),x(e)&&(a.time.useUTC||(e+=6E4*(new Date).getTimezoneOffset()),h?e>c.maxInput.HCTime?e=void 0:e<g&&(e=g):e<c.minInput.HCTime?e=void 0:e>f&&(e=f),"undefined"!==typeof e&&d.setExtremes(h?e:d.min,h?d.max:e,void 0,void 0,{trigger:"rangeSelectorInput"})))}var c=this,a=c.chart,n=a.renderer.style||{},m=a.renderer,v=a.options.rangeSelector,k=c.div,h="min"===e,t,q,r=this.inputGroup;this[e+"Label"]=q=m.label(b.lang[h?
|
||||
"rangeSelectorFrom":"rangeSelectorTo"],this.inputGroup.offset).addClass("highcharts-range-label").attr({padding:2}).add(r);r.offset+=q.width+5;this[e+"DateBox"]=m=m.label("",r.offset).addClass("highcharts-range-input").attr({padding:2,width:v.inputBoxWidth||90,height:v.inputBoxHeight||17,"text-align":"center"}).on("click",function(){c.showInput(e);c[e+"Input"].focus()});a.styledMode||m.attr({stroke:v.inputBoxBorderColor||"#cccccc","stroke-width":1});m.add(r);r.offset+=m.width+(h?10:0);this[e+"Input"]=
|
||||
t=F("input",{name:e,className:"highcharts-range-selector",type:"text"},{top:a.plotTop+"px"},k);a.styledMode||(q.css(A(n,v.labelStyle)),m.css(A({color:"#333333"},n,v.inputStyle)),N(t,K({position:"absolute",border:0,width:"1px",height:"1px",padding:0,textAlign:"center",fontSize:n.fontSize,fontFamily:n.fontFamily,top:"-9999em"},v.inputStyle)));t.onfocus=function(){c.showInput(e)};t.onblur=function(){t===f.doc.activeElement&&g();c.hideInput(e);t.blur()};t.onchange=g;t.onkeypress=function(a){13===a.keyCode&&
|
||||
g()}},getPosition:function(){var b=this.chart,e=b.options.rangeSelector;b="top"===e.verticalAlign?b.plotTop-b.axisOffset[0]:0;return{buttonTop:b+e.buttonPosition.y,inputTop:b+e.inputPosition.y-10}},getYTDExtremes:function(b,e,c){var a=this.chart.time,f=new a.Date(b),g=a.get("FullYear",f);c=c?a.Date.UTC(g,0,1):+new a.Date(g,0,1);e=Math.max(e||0,c);f=f.getTime();return{max:Math.min(b||f,f),min:e}},render:function(e,f){var c=this,a=c.chart,g=a.renderer,l=a.container,m=a.options,k=m.exporting&&!1!==m.exporting.enabled&&
|
||||
m.navigation&&m.navigation.buttonOptions,h=b.lang,p=c.div,q=m.rangeSelector,r=n(m.chart.style&&m.chart.style.zIndex,0)+1;m=q.floating;var u=c.buttons;p=c.inputGroup;var x=q.buttonTheme,d=q.buttonPosition,y=q.inputPosition,z=q.inputEnabled,A=x&&x.states,B=a.plotLeft,D=c.buttonGroup,G,I=c.options.verticalAlign,K=a.legend,N=K&&K.options,P=d.y,R=y.y,ba=a.hasLoaded,ca=ba?"animate":"attr",Y=0,V=0,aa;if(!1!==q.enabled){c.rendered||(c.group=G=g.g("range-selector-group").attr({zIndex:7}).add(),c.buttonGroup=
|
||||
D=g.g("range-selector-buttons").add(G),c.zoomText=g.text(h.rangeSelectorZoom,0,15).add(D),a.styledMode||(c.zoomText.css(q.labelStyle),x["stroke-width"]=n(x["stroke-width"],0)),c.buttonOptions.forEach(function(a,b){u[b]=g.button(a.text,0,0,function(d){var e=a.events&&a.events.click,f;e&&(f=e.call(a,d));!1!==f&&c.clickButton(b);c.isActive=!0},x,A&&A.hover,A&&A.select,A&&A.disabled).attr({"text-align":"center"}).add(D)}),!1!==z&&(c.div=p=F("div",null,{position:"relative",height:0,zIndex:r}),l.parentNode.insertBefore(p,
|
||||
l),c.inputGroup=p=g.g("input-group").add(G),p.offset=0,c.drawInput("min"),c.drawInput("max")));c.zoomText[ca]({x:n(B+d.x,B)});var da=n(B+d.x,B)+c.zoomText.getBBox().width+5;c.buttonOptions.forEach(function(a,b){u[b][ca]({x:da});da+=u[b].width+n(q.buttonSpacing,5)});B=a.plotLeft-a.spacing[3];c.updateButtonStates();k&&this.titleCollision(a)&&"top"===I&&"right"===d.align&&d.y+D.getBBox().height-12<(k.y||0)+k.height&&(Y=-40);"left"===d.align?aa=d.x-a.spacing[3]:"right"===d.align&&(aa=d.x+Y-a.spacing[1]);
|
||||
D.align({y:d.y,width:D.getBBox().width,align:d.align,x:aa},!0,a.spacingBox);c.group.placed=ba;c.buttonGroup.placed=ba;!1!==z&&(Y=k&&this.titleCollision(a)&&"top"===I&&"right"===y.align&&y.y-p.getBBox().height-12<(k.y||0)+k.height+a.spacing[0]?-40:0,"left"===y.align?aa=B:"right"===y.align&&(aa=-Math.max(a.axisOffset[1],-Y)),p.align({y:y.y,width:p.getBBox().width,align:y.align,x:y.x+aa-2},!0,a.spacingBox),l=p.alignAttr.translateX+p.alignOptions.x-Y+p.getBBox().x+2,k=p.alignOptions.width,h=D.alignAttr.translateX+
|
||||
D.getBBox().x,aa=D.getBBox().width+20,(y.align===d.align||h+aa>l&&l+k>h&&P<R+p.getBBox().height)&&p.attr({translateX:p.alignAttr.translateX+(a.axisOffset[1]>=-Y?0:-Y),translateY:p.alignAttr.translateY+D.getBBox().height+10}),c.setInputValue("min",e),c.setInputValue("max",f),c.inputGroup.placed=ba);c.group.align({verticalAlign:I},!0,a.spacingBox);e=c.group.getBBox().height+20;f=c.group.alignAttr.translateY;"bottom"===I&&(K=N&&"bottom"===N.verticalAlign&&N.enabled&&!N.floating?K.legendHeight+n(N.margin,
|
||||
10):0,e=e+K-20,V=f-e-(m?0:q.y)-(a.titleOffset?a.titleOffset[2]:0)-10);if("top"===I)m&&(V=0),a.titleOffset&&a.titleOffset[0]&&(V=a.titleOffset[0]),V+=a.margin[0]-a.spacing[0]||0;else if("middle"===I)if(R===P)V=0>R?f+void 0:f;else if(R||P)V=0>R||0>P?V-Math.min(R,P):f-e+NaN;c.group.translate(q.x,q.y+Math.floor(V));!1!==z&&(c.minInput.style.marginTop=c.group.translateY+"px",c.maxInput.style.marginTop=c.group.translateY+"px");c.rendered=!0}},getHeight:function(){var b=this.options,e=this.group,c=b.y,a=
|
||||
b.buttonPosition.y,f=b.inputPosition.y;if(b.height)return b.height;b=e?e.getBBox(!0).height+13+c:0;e=Math.min(f,a);if(0>f&&0>a||0<f&&0<a)b+=Math.abs(e);return b},titleCollision:function(b){return!(b.options.title.text||b.options.subtitle.text)},update:function(b){var e=this.chart;A(!0,e.options.rangeSelector,b);this.destroy();this.init(e);e.rangeSelector.render()},destroy:function(){var b=this,e=b.minInput,c=b.maxInput;b.unMouseDown();b.unResize();B(b.buttons);e&&(e.onfocus=e.onblur=e.onchange=null);
|
||||
c&&(c.onfocus=c.onblur=c.onchange=null);u(b,function(a,c){a&&"chart"!==c&&(a.destroy?a.destroy():a.nodeType&&D(this[c]));a!==y.prototype[c]&&(b[c]=null)},this)}};e.prototype.minFromRange=function(){var b=this.range,e=b.type,c=this.max,a=this.chart.time,f=function(b,c){var f="year"===e?"FullYear":"Month",g=new a.Date(b),h=a.get(f,g);a.set(f,g,h+c);h===a.get(f,g)&&a.set("Date",g,0);return g.getTime()-b};if(x(b)){var l=c-b;var m=b}else l=c+f(c,-b.count),this.chart&&(this.chart.fixedRange=c-l);var k=
|
||||
n(this.dataMin,Number.MIN_VALUE);x(l)||(l=k);l<=k&&(l=k,"undefined"===typeof m&&(m=f(l,b.count)),this.newMax=Math.min(l+m,this.dataMax));x(c)||(l=void 0);return l};f.RangeSelector||(r(m,"afterGetContainer",function(){this.options.rangeSelector.enabled&&(this.rangeSelector=new y(this))}),r(m,"beforeRender",function(){var b=this.axes,e=this.rangeSelector;e&&(x(e.deferredYTDClick)&&(e.clickButton(e.deferredYTDClick),delete e.deferredYTDClick),b.forEach(function(b){b.updateNames();b.setScale()}),this.getAxisMargins(),
|
||||
e.render(),b=e.options.verticalAlign,e.options.floating||("bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0)))}),r(m,"update",function(b){var e=b.options.rangeSelector;b=this.rangeSelector;var c=this.extraBottomMargin,a=this.extraTopMargin;e&&e.enabled&&!G(b)&&(this.options.rangeSelector.enabled=!0,this.rangeSelector=new y(this));this.extraTopMargin=this.extraBottomMargin=!1;b&&(b.render(),e=e&&e.verticalAlign||b.options&&b.options.verticalAlign,b.options.floating||("bottom"===
|
||||
e?this.extraBottomMargin=!0:"middle"!==e&&(this.extraTopMargin=!0)),this.extraBottomMargin!==c||this.extraTopMargin!==a)&&(this.isDirtyBox=!0)}),r(m,"render",function(){var b=this.rangeSelector;b&&!b.options.floating&&(b.render(),b=b.options.verticalAlign,"bottom"===b?this.extraBottomMargin=!0:"middle"!==b&&(this.extraTopMargin=!0))}),r(m,"getMargins",function(){var b=this.rangeSelector;b&&(b=b.getHeight(),this.extraTopMargin&&(this.plotTop+=b),this.extraBottomMargin&&(this.marginBottom+=b))}),m.prototype.callbacks.push(function(b){function e(){c=
|
||||
b.xAxis[0].getExtremes();x(c.min)&&a.render(c.min,c.max)}var c,a=b.rangeSelector;if(a){var f=r(b.xAxis[0],"afterSetExtremes",function(b){a.render(b.min,b.max)});var g=r(b,"redraw",e);e()}r(b,"destroy",function(){a&&(g(),f())})}),f.RangeSelector=y)});P(y,"parts/StockChart.js",[y["parts/Globals.js"],y["parts/Point.js"],y["parts/Utilities.js"]],function(f,m,y){var r=y.addEvent,F=y.arrayMax,I=y.arrayMin,G=y.clamp,B=y.defined,D=y.extend,K=y.find,z=y.format,x=y.isNumber,A=y.isString,u=y.merge,n=y.pick,
|
||||
l=y.splat;y=f.Axis;var q=f.Chart,e=f.Renderer,b=f.Series,g=f.SVGRenderer,p=f.VMLRenderer,c=b.prototype,a=c.init,w=c.processData,E=m.prototype.tooltipFormatter;f.StockChart=f.stockChart=function(a,b,c){var e=A(a)||a.nodeName,g=arguments[e?1:0],h=g,k=g.series,m=f.getOptions(),d,p=g.chart&&g.chart.panning,v=n(g.navigator&&g.navigator.enabled,m.navigator.enabled,!0),r=p&&/y/.test(p.type),w={startOnTick:!1,endOnTick:!1};g.xAxis=l(g.xAxis||{}).map(function(a,b){return u({minPadding:0,maxPadding:0,overscroll:0,
|
||||
ordinal:!0,title:{text:null},labels:{overflow:"justify"},showLastLabel:!0},m.xAxis,m.xAxis&&m.xAxis[b],a,{type:"datetime",categories:null},v?w:null)});g.yAxis=l(g.yAxis||{}).map(function(a,b){d=n(a.opposite,!0);return u({labels:{y:-2},opposite:d,showLastLabel:!(!a.categories&&"category"!==a.type),title:{text:null}},m.yAxis,m.yAxis&&m.yAxis[b],a,r?w:null)});g.series=null;g=u({chart:{panning:{enabled:!0,type:"x"},pinchType:"x"},navigator:{enabled:v},scrollbar:{enabled:n(m.scrollbar.enabled,!0)},rangeSelector:{enabled:n(m.rangeSelector.enabled,
|
||||
!0)},title:{text:null},tooltip:{split:n(m.tooltip.split,!0),crosshairs:!0},legend:{enabled:!1}},g,{isStock:!0});g.series=h.series=k;return e?new q(a,g,c):new q(g,b)};r(b,"setOptions",function(a){var b;this.chart.options.isStock&&(this.is("column")||this.is("columnrange")?b={borderWidth:0,shadow:!1}:this.is("scatter")||this.is("sma")||(b={marker:{enabled:!1,radius:2}}),b&&(a.plotOptions[this.type]=u(a.plotOptions[this.type],b)))});r(y,"autoLabelAlign",function(a){var b=this.chart,c=this.options;b=
|
||||
b._labelPanes=b._labelPanes||{};var e=this.options.labels;this.chart.options.isStock&&"yAxis"===this.coll&&(c=c.top+","+c.height,!b[c]&&e.enabled&&(15===e.x&&(e.x=0),"undefined"===typeof e.align&&(e.align="right"),b[c]=this,a.align="right",a.preventDefault()))});r(y,"destroy",function(){var a=this.chart,b=this.options&&this.options.top+","+this.options.height;b&&a._labelPanes&&a._labelPanes[b]===this&&delete a._labelPanes[b]});r(y,"getPlotLinePath",function(a){function b(a){var b="xAxis"===a?"yAxis":
|
||||
"xAxis";a=c.options[b];return x(a)?[f[b][a]]:A(a)?[f.get(a)]:e.map(function(a){return a[b]})}var c=this,e=this.isLinked&&!this.series?this.linkedParent.series:this.series,f=c.chart,g=f.renderer,l=c.left,m=c.top,d,p,q,r,v=[],u=[],w=a.translatedValue,y=a.value,z=a.force;if(f.options.isStock&&!1!==a.acrossPanes&&"xAxis"===c.coll||"yAxis"===c.coll){a.preventDefault();u=b(c.coll);var D=c.isXAxis?f.yAxis:f.xAxis;D.forEach(function(a){if(B(a.options.id)?-1===a.options.id.indexOf("navigator"):1){var b=a.isXAxis?
|
||||
"yAxis":"xAxis";b=B(a.options[b])?f[b][a.options[b]]:f[b][0];c===b&&u.push(a)}});var E=u.length?[]:[c.isXAxis?f.yAxis[0]:f.xAxis[0]];u.forEach(function(a){-1!==E.indexOf(a)||K(E,function(b){return b.pos===a.pos&&b.len===a.len})||E.push(a)});var F=n(w,c.translate(y,null,null,a.old));x(F)&&(c.horiz?E.forEach(function(a){var b;p=a.pos;r=p+a.len;d=q=Math.round(F+c.transB);"pass"!==z&&(d<l||d>l+c.width)&&(z?d=q=G(d,l,l+c.width):b=!0);b||v.push("M",d,p,"L",q,r)}):E.forEach(function(a){var b;d=a.pos;q=d+
|
||||
a.len;p=r=Math.round(m+c.height-F);"pass"!==z&&(p<m||p>m+c.height)&&(z?p=r=G(p,m,m+c.height):b=!0);b||v.push("M",d,p,"L",q,r)}));a.path=0<v.length?g.crispPolyLine(v,a.lineWidth||1):null}});g.prototype.crispPolyLine=function(a,b){var c;for(c=0;c<a.length;c+=6)a[c+1]===a[c+4]&&(a[c+1]=a[c+4]=Math.round(a[c+1])-b%2/2),a[c+2]===a[c+5]&&(a[c+2]=a[c+5]=Math.round(a[c+2])+b%2/2);return a};e===p&&(p.prototype.crispPolyLine=g.prototype.crispPolyLine);r(y,"afterHideCrosshair",function(){this.crossLabel&&(this.crossLabel=
|
||||
this.crossLabel.hide())});r(y,"afterDrawCrosshair",function(a){var b,c;if(B(this.crosshair.label)&&this.crosshair.label.enabled&&this.cross){var e=this.chart,f=this.options.crosshair.label,g=this.horiz,l=this.opposite,m=this.left,d=this.top,p=this.crossLabel,q=f.format,r="",v="inside"===this.options.tickPosition,u=!1!==this.crosshair.snap,w=0,x=a.e||this.cross&&this.cross.e,y=a.point;var A=this.lin2log;if(this.isLog){a=A(this.min);var E=A(this.max)}else a=this.min,E=this.max;A=g?"center":l?"right"===
|
||||
this.labelAlign?"right":"left":"left"===this.labelAlign?"left":"center";p||(p=this.crossLabel=e.renderer.label(null,null,null,f.shape||"callout").addClass("highcharts-crosshair-label"+(this.series[0]&&" highcharts-color-"+this.series[0].colorIndex)).attr({align:f.align||A,padding:n(f.padding,8),r:n(f.borderRadius,3),zIndex:2}).add(this.labelGroup),e.styledMode||p.attr({fill:f.backgroundColor||this.series[0]&&this.series[0].color||"#666666",stroke:f.borderColor||"","stroke-width":f.borderWidth||0}).css(D({color:"#ffffff",
|
||||
fontWeight:"normal",fontSize:"11px",textAlign:"center"},f.style)));g?(A=u?y.plotX+m:x.chartX,d+=l?0:this.height):(A=l?this.width+m:0,d=u?y.plotY+d:x.chartY);q||f.formatter||(this.isDatetimeAxis&&(r="%b %d, %Y"),q="{value"+(r?":"+r:"")+"}");r=u?y[this.isXAxis?"x":"y"]:this.toValue(g?x.chartX:x.chartY);p.attr({text:q?z(q,{value:r},e):f.formatter.call(this,r),x:A,y:d,visibility:r<a||r>E?"hidden":"visible"});f=p.getBBox();if(g){if(v&&!l||!v&&l)d=p.y-f.height}else d=p.y-f.height/2;g?(b=m-f.x,c=m+this.width-
|
||||
f.x):(b="left"===this.labelAlign?m:0,c="right"===this.labelAlign?m+this.width:e.chartWidth);p.translateX<b&&(w=b-p.translateX);p.translateX+f.width>=c&&(w=-(p.translateX+f.width-c));p.attr({x:A+w,y:d,anchorX:g?A:this.opposite?0:e.chartWidth,anchorY:g?this.opposite?e.chartHeight:0:d+f.height/2})}});c.init=function(){a.apply(this,arguments);this.setCompare(this.options.compare)};c.setCompare=function(a){this.modifyValue="value"===a||"percent"===a?function(b,c){var e=this.compareValue;return"undefined"!==
|
||||
typeof b&&"undefined"!==typeof e?(b="value"===a?b-e:b/e*100-(100===this.options.compareBase?0:100),c&&(c.change=b),b):0}:null;this.userOptions.compare=a;this.chart.hasRendered&&(this.isDirty=!0)};c.processData=function(a){var b,c=-1,e=!0===this.options.compareStart?0:1;w.apply(this,arguments);if(this.xAxis&&this.processedYData){var f=this.processedXData;var g=this.processedYData;var l=g.length;this.pointArrayMap&&(c=this.pointArrayMap.indexOf(this.options.pointValKey||this.pointValKey||"y"));for(b=
|
||||
0;b<l-e;b++){var m=g[b]&&-1<c?g[b][c]:g[b];if(x(m)&&f[b+e]>=this.xAxis.min&&0!==m){this.compareValue=m;break}}}};r(b,"afterGetExtremes",function(){if(this.modifyValue){var a=[this.modifyValue(this.dataMin),this.modifyValue(this.dataMax)];this.dataMin=I(a);this.dataMax=F(a)}});y.prototype.setCompare=function(a,b){this.isXAxis||(this.series.forEach(function(b){b.setCompare(a)}),n(b,!0)&&this.chart.redraw())};m.prototype.tooltipFormatter=function(a){var b=this.series.chart.numberFormatter;a=a.replace("{point.change}",
|
||||
(0<this.change?"+":"")+b(this.change,n(this.series.tooltipOptions.changeDecimals,2)));return E.apply(this,[a])};r(b,"render",function(){var a=this.chart;if(!(a.is3d&&a.is3d()||a.polar)&&this.xAxis&&!this.xAxis.isRadial){var b=this.yAxis.len;if(this.xAxis.axisLine){var c=a.plotTop+a.plotHeight-this.yAxis.pos-this.yAxis.len,e=Math.floor(this.xAxis.axisLine.strokeWidth()/2);0<=c&&(b-=Math.max(e-c,0))}!this.clipBox&&this.animate?(this.clipBox=u(a.clipBox),this.clipBox.width=this.xAxis.len,this.clipBox.height=
|
||||
b):a[this.sharedClipKey]&&(a[this.sharedClipKey].animate({width:this.xAxis.len,height:b}),a[this.sharedClipKey+"m"]&&a[this.sharedClipKey+"m"].animate({width:this.xAxis.len}))}});r(q,"update",function(a){a=a.options;"scrollbar"in a&&this.navigator&&(u(!0,this.options.scrollbar,a.scrollbar),this.navigator.update({},!1),delete a.scrollbar)});r(y,"afterSetScale",function(){var a=this,b=a.chart.options.chart&&a.chart.options.chart.panning;if(b&&("y"===b.type||"xy"===b.type)&&!a.isXAxis&&!B(a.panningState)){var c=
|
||||
Number.MAX_VALUE,e=Number.MIN_VALUE;a.series.forEach(function(b){c=Math.min(f.arrayMin(b.yData),c)-(a.min&&a.dataMin?a.dataMin-a.min:0);e=Math.max(f.arrayMax(b.yData),e)+(a.max&&a.dataMax?a.max-a.dataMax:0)});a.panningState={startMin:c,startMax:e}}})});P(y,"masters/modules/stock.src.js",[],function(){});P(y,"masters/highstock.src.js",[y["masters/highcharts.src.js"]],function(f){f.product="Highstock";return f});y["masters/highstock.src.js"]._modules=y;return y["masters/highstock.src.js"]});
|
||||
//# sourceMappingURL=highstock.js.map
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
A class to parse color values
|
||||
@author Stoyan Stefanov <sstoo@gmail.com>
|
||||
@link http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
Use it if you like it
|
||||
|
||||
canvg.js - Javascript SVG parser and renderer on Canvas
|
||||
MIT Licensed
|
||||
Gabe Lerner (gabelerner@gmail.com)
|
||||
http://code.google.com/p/canvg/
|
||||
|
||||
Requires: rgbcolor.js - http://www.phpied.com/rgb-color-parser-in-javascript/
|
||||
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
CanVGRenderer Extension module
|
||||
|
||||
(c) 2011-2012 Torstein Honsi, Erik Olsson
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
function RGBColor(m){this.ok=!1;m.charAt(0)=="#"&&(m=m.substr(1,6));var m=m.replace(/ /g,""),m=m.toLowerCase(),a={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",
|
||||
darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",
|
||||
gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",
|
||||
lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",
|
||||
oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",
|
||||
slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},c;for(c in a)m==c&&(m=a[c]);var d=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(b){return[parseInt(b[1]),parseInt(b[2]),parseInt(b[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,
|
||||
example:["#00ff00","336699"],process:function(b){return[parseInt(b[1],16),parseInt(b[2],16),parseInt(b[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(b){return[parseInt(b[1]+b[1],16),parseInt(b[2]+b[2],16),parseInt(b[3]+b[3],16)]}}];for(c=0;c<d.length;c++){var b=d[c].process,k=d[c].re.exec(m);if(k)channels=b(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r;this.g=this.g<0||isNaN(this.g)?0:
|
||||
this.g>255?255:this.g;this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var b=this.r.toString(16),a=this.g.toString(16),d=this.b.toString(16);b.length==1&&(b="0"+b);a.length==1&&(a="0"+a);d.length==1&&(d="0"+d);return"#"+b+a+d};this.getHelpXML=function(){for(var b=[],k=0;k<d.length;k++)for(var c=d[k].example,j=0;j<c.length;j++)b[b.length]=c[j];for(var h in a)b[b.length]=h;c=document.createElement("ul");
|
||||
c.setAttribute("id","rgbcolor-examples");for(k=0;k<b.length;k++)try{var l=document.createElement("li"),o=new RGBColor(b[k]),n=document.createElement("div");n.style.cssText="margin: 3px; border: 1px solid black; background:"+o.toHex()+"; color:"+o.toHex();n.appendChild(document.createTextNode("test"));var q=document.createTextNode(" "+b[k]+" -> "+o.toRGB()+" -> "+o.toHex());l.appendChild(n);l.appendChild(q);c.appendChild(l)}catch(p){}return c}}
|
||||
if(!window.console)window.console={},window.console.log=function(){},window.console.dir=function(){};if(!Array.prototype.indexOf)Array.prototype.indexOf=function(m){for(var a=0;a<this.length;a++)if(this[a]==m)return a;return-1};
|
||||
(function(){function m(){var a={FRAMERATE:30,MAX_VIRTUAL_PIXELS:3E4};a.init=function(c){a.Definitions={};a.Styles={};a.Animations=[];a.Images=[];a.ctx=c;a.ViewPort=new function(){this.viewPorts=[];this.Clear=function(){this.viewPorts=[]};this.SetCurrent=function(a,b){this.viewPorts.push({width:a,height:b})};this.RemoveCurrent=function(){this.viewPorts.pop()};this.Current=function(){return this.viewPorts[this.viewPorts.length-1]};this.width=function(){return this.Current().width};this.height=function(){return this.Current().height};
|
||||
this.ComputeSize=function(a){return a!=null&&typeof a=="number"?a:a=="x"?this.width():a=="y"?this.height():Math.sqrt(Math.pow(this.width(),2)+Math.pow(this.height(),2))/Math.sqrt(2)}}};a.init();a.ImagesLoaded=function(){for(var c=0;c<a.Images.length;c++)if(!a.Images[c].loaded)return!1;return!0};a.trim=function(a){return a.replace(/^\s+|\s+$/g,"")};a.compressSpaces=function(a){return a.replace(/[\s\r\t\n]+/gm," ")};a.ajax=function(a){var d;return(d=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))?
|
||||
(d.open("GET",a,!1),d.send(null),d.responseText):null};a.parseXml=function(a){if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");else{var a=a.replace(/<!DOCTYPE svg[^>]*>/,""),d=new ActiveXObject("Microsoft.XMLDOM");d.async="false";d.loadXML(a);return d}};a.Property=function(c,d){this.name=c;this.value=d;this.hasValue=function(){return this.value!=null&&this.value!==""};this.numValue=function(){if(!this.hasValue())return 0;var b=parseFloat(this.value);(this.value+"").match(/%$/)&&
|
||||
(b/=100);return b};this.valueOrDefault=function(b){return this.hasValue()?this.value:b};this.numValueOrDefault=function(b){return this.hasValue()?this.numValue():b};var b=this;this.Color={addOpacity:function(d){var c=b.value;if(d!=null&&d!=""){var f=new RGBColor(b.value);f.ok&&(c="rgba("+f.r+", "+f.g+", "+f.b+", "+d+")")}return new a.Property(b.name,c)}};this.Definition={getDefinition:function(){var d=b.value.replace(/^(url\()?#([^\)]+)\)?$/,"$2");return a.Definitions[d]},isUrl:function(){return b.value.indexOf("url(")==
|
||||
0},getFillStyle:function(b){var d=this.getDefinition();return d!=null&&d.createGradient?d.createGradient(a.ctx,b):d!=null&&d.createPattern?d.createPattern(a.ctx,b):null}};this.Length={DPI:function(){return 96},EM:function(b){var d=12,c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);c.hasValue()&&(d=c.Length.toPixels(b));return d},toPixels:function(d){if(!b.hasValue())return 0;var c=b.value+"";return c.match(/em$/)?b.numValue()*this.EM(d):c.match(/ex$/)?b.numValue()*this.EM(d)/2:c.match(/px$/)?
|
||||
b.numValue():c.match(/pt$/)?b.numValue()*1.25:c.match(/pc$/)?b.numValue()*15:c.match(/cm$/)?b.numValue()*this.DPI(d)/2.54:c.match(/mm$/)?b.numValue()*this.DPI(d)/25.4:c.match(/in$/)?b.numValue()*this.DPI(d):c.match(/%$/)?b.numValue()*a.ViewPort.ComputeSize(d):b.numValue()}};this.Time={toMilliseconds:function(){if(!b.hasValue())return 0;var a=b.value+"";if(a.match(/s$/))return b.numValue()*1E3;a.match(/ms$/);return b.numValue()}};this.Angle={toRadians:function(){if(!b.hasValue())return 0;var a=b.value+
|
||||
"";return a.match(/deg$/)?b.numValue()*(Math.PI/180):a.match(/grad$/)?b.numValue()*(Math.PI/200):a.match(/rad$/)?b.numValue():b.numValue()*(Math.PI/180)}}};a.Font=new function(){this.Styles=["normal","italic","oblique","inherit"];this.Variants=["normal","small-caps","inherit"];this.Weights="normal,bold,bolder,lighter,100,200,300,400,500,600,700,800,900,inherit".split(",");this.CreateFont=function(d,b,c,e,f,g){g=g!=null?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f||
|
||||
g.fontFamily,fontSize:e||g.fontSize,fontStyle:d||g.fontStyle,fontWeight:c||g.fontWeight,fontVariant:b||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(d){for(var b={},d=a.trim(a.compressSpaces(d||"")).split(" "),k=!1,e=!1,f=!1,g=!1,j="",h=0;h<d.length;h++)if(!e&&c.Styles.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontStyle=d[h];e=!0}else if(!g&&c.Variants.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontVariant=
|
||||
d[h];e=g=!0}else if(!f&&c.Weights.indexOf(d[h])!=-1){if(d[h]!="inherit")b.fontWeight=d[h];e=g=f=!0}else if(k)d[h]!="inherit"&&(j+=d[h]);else{if(d[h]!="inherit")b.fontSize=d[h].split("/")[0];e=g=f=k=!0}if(j!="")b.fontFamily=j;return b}};a.ToNumberArray=function(c){for(var c=a.trim(a.compressSpaces((c||"").replace(/,/g," "))).split(" "),d=0;d<c.length;d++)c[d]=parseFloat(c[d]);return c};a.Point=function(a,d){this.x=a;this.y=d;this.angleTo=function(b){return Math.atan2(b.y-this.y,b.x-this.x)};this.applyTransform=
|
||||
function(b){var a=this.x*b[1]+this.y*b[3]+b[5];this.x=this.x*b[0]+this.y*b[2]+b[4];this.y=a}};a.CreatePoint=function(c){c=a.ToNumberArray(c);return new a.Point(c[0],c[1])};a.CreatePath=function(c){for(var c=a.ToNumberArray(c),d=[],b=0;b<c.length;b+=2)d.push(new a.Point(c[b],c[b+1]));return d};a.BoundingBox=function(a,d,b,k){this.y2=this.x2=this.y1=this.x1=Number.NaN;this.x=function(){return this.x1};this.y=function(){return this.y1};this.width=function(){return this.x2-this.x1};this.height=function(){return this.y2-
|
||||
this.y1};this.addPoint=function(b,a){if(b!=null){if(isNaN(this.x1)||isNaN(this.x2))this.x2=this.x1=b;if(b<this.x1)this.x1=b;if(b>this.x2)this.x2=b}if(a!=null){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=a;if(a<this.y1)this.y1=a;if(a>this.y2)this.y2=a}};this.addX=function(b){this.addPoint(b,null)};this.addY=function(b){this.addPoint(null,b)};this.addBoundingBox=function(b){this.addPoint(b.x1,b.y1);this.addPoint(b.x2,b.y2)};this.addQuadraticCurve=function(b,a,d,c,k,l){d=b+2/3*(d-b);c=a+2/3*(c-
|
||||
a);this.addBezierCurve(b,a,d,d+1/3*(k-b),c,c+1/3*(l-a),k,l)};this.addBezierCurve=function(b,a,d,c,k,l,o,n){var q=[b,a],p=[d,c],t=[k,l],m=[o,n];this.addPoint(q[0],q[1]);this.addPoint(m[0],m[1]);for(i=0;i<=1;i++)b=function(b){return Math.pow(1-b,3)*q[i]+3*Math.pow(1-b,2)*b*p[i]+3*(1-b)*Math.pow(b,2)*t[i]+Math.pow(b,3)*m[i]},a=6*q[i]-12*p[i]+6*t[i],d=-3*q[i]+9*p[i]-9*t[i]+3*m[i],c=3*p[i]-3*q[i],d==0?a!=0&&(a=-c/a,0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))):(c=Math.pow(a,2)-4*c*d,c<0||(k=
|
||||
(-a+Math.sqrt(c))/(2*d),0<k&&k<1&&(i==0&&this.addX(b(k)),i==1&&this.addY(b(k))),a=(-a-Math.sqrt(c))/(2*d),0<a&&a<1&&(i==0&&this.addX(b(a)),i==1&&this.addY(b(a)))))};this.isPointInBox=function(b,a){return this.x1<=b&&b<=this.x2&&this.y1<=a&&a<=this.y2};this.addPoint(a,d);this.addPoint(b,k)};a.Transform=function(c){var d=this;this.Type={};this.Type.translate=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.translate(this.p.x||0,this.p.y||0)};this.applyToPoint=function(b){b.applyTransform([1,
|
||||
0,0,1,this.p.x||0,this.p.y||0])}};this.Type.rotate=function(b){b=a.ToNumberArray(b);this.angle=new a.Property("angle",b[0]);this.cx=b[1]||0;this.cy=b[2]||0;this.apply=function(b){b.translate(this.cx,this.cy);b.rotate(this.angle.Angle.toRadians());b.translate(-this.cx,-this.cy)};this.applyToPoint=function(b){var a=this.angle.Angle.toRadians();b.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);b.applyTransform([Math.cos(a),Math.sin(a),-Math.sin(a),Math.cos(a),0,0]);b.applyTransform([1,0,0,1,-this.p.x||
|
||||
0,-this.p.y||0])}};this.Type.scale=function(b){this.p=a.CreatePoint(b);this.apply=function(b){b.scale(this.p.x||1,this.p.y||this.p.x||1)};this.applyToPoint=function(b){b.applyTransform([this.p.x||0,0,0,this.p.y||0,0,0])}};this.Type.matrix=function(b){this.m=a.ToNumberArray(b);this.apply=function(b){b.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.applyToPoint=function(b){b.applyTransform(this.m)}};this.Type.SkewBase=function(b){this.base=d.Type.matrix;this.base(b);this.angle=
|
||||
new a.Property("angle",b)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,0,Math.tan(this.angle.Angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(b){this.base=d.Type.SkewBase;this.base(b);this.m=[1,Math.tan(this.angle.Angle.toRadians()),0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].apply(b)};
|
||||
this.applyToPoint=function(b){for(var a=0;a<this.transforms.length;a++)this.transforms[a].applyToPoint(b)};for(var c=a.trim(a.compressSpaces(c)).split(/\s(?=[a-z])/),b=0;b<c.length;b++){var k=c[b].split("(")[0],e=c[b].split("(")[1].replace(")","");this.transforms.push(new this.Type[k](e))}};a.AspectRatio=function(c,d,b,k,e,f,g,j,h,l){var d=a.compressSpaces(d),d=d.replace(/^defer\s/,""),o=d.split(" ")[0]||"xMidYMid",d=d.split(" ")[1]||"meet",n=b/k,q=e/f,p=Math.min(n,q),m=Math.max(n,q);d=="meet"&&(k*=
|
||||
p,f*=p);d=="slice"&&(k*=m,f*=m);h=new a.Property("refX",h);l=new a.Property("refY",l);h.hasValue()&&l.hasValue()?c.translate(-p*h.Length.toPixels("x"),-p*l.Length.toPixels("y")):(o.match(/^xMid/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b/2-k/2,0),o.match(/YMid$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e/2-f/2),o.match(/^xMax/)&&(d=="meet"&&p==q||d=="slice"&&m==q)&&c.translate(b-k,0),o.match(/YMax$/)&&(d=="meet"&&p==n||d=="slice"&&m==n)&&c.translate(0,e-f));o=="none"?c.scale(n,
|
||||
q):d=="meet"?c.scale(p,p):d=="slice"&&c.scale(m,m);c.translate(g==null?0:-g,j==null?0:-j)};a.Element={};a.Element.ElementBase=function(c){this.attributes={};this.styles={};this.children=[];this.attribute=function(b,d){var c=this.attributes[b];if(c!=null)return c;c=new a.Property(b,"");d==!0&&(this.attributes[b]=c);return c};this.style=function(b,d){var c=this.styles[b];if(c!=null)return c;c=this.attribute(b);if(c!=null&&c.hasValue())return c;c=this.parent;if(c!=null&&(c=c.style(b),c!=null&&c.hasValue()))return c;
|
||||
c=new a.Property(b,"");d==!0&&(this.styles[b]=c);return c};this.render=function(b){if(this.style("display").value!="none"&&this.attribute("visibility").value!="hidden"){b.save();this.setContext(b);if(this.attribute("mask").hasValue()){var a=this.attribute("mask").Definition.getDefinition();a!=null&&a.apply(b,this)}else this.style("filter").hasValue()?(a=this.style("filter").Definition.getDefinition(),a!=null&&a.apply(b,this)):this.renderChildren(b);this.clearContext(b);b.restore()}};this.setContext=
|
||||
function(){};this.clearContext=function(){};this.renderChildren=function(b){for(var a=0;a<this.children.length;a++)this.children[a].render(b)};this.addChild=function(b,d){var c=b;d&&(c=a.CreateElement(b));c.parent=this;this.children.push(c)};if(c!=null&&c.nodeType==1){for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1&&this.addChild(b,!0)}for(d=0;d<c.attributes.length;d++)b=c.attributes[d],this.attributes[b.nodeName]=new a.Property(b.nodeName,b.nodeValue);b=a.Styles[c.nodeName];
|
||||
if(b!=null)for(var k in b)this.styles[k]=b[k];if(this.attribute("class").hasValue())for(var d=a.compressSpaces(this.attribute("class").value).split(" "),e=0;e<d.length;e++){b=a.Styles["."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k];b=a.Styles[c.nodeName+"."+d[e]];if(b!=null)for(k in b)this.styles[k]=b[k]}if(this.attribute("style").hasValue()){b=this.attribute("style").value.split(";");for(d=0;d<b.length;d++)a.trim(b[d])!=""&&(c=b[d].split(":"),k=a.trim(c[0]),c=a.trim(c[1]),this.styles[k]=new a.Property(k,
|
||||
c))}this.attribute("id").hasValue()&&a.Definitions[this.attribute("id").value]==null&&(a.Definitions[this.attribute("id").value]=this)}};a.Element.RenderedElementBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.setContext=function(d){if(this.style("fill").Definition.isUrl()){var b=this.style("fill").Definition.getFillStyle(this);if(b!=null)d.fillStyle=b}else if(this.style("fill").hasValue())b=this.style("fill"),this.style("fill-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("fill-opacity").value)),
|
||||
d.fillStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke").Definition.isUrl()){if(b=this.style("stroke").Definition.getFillStyle(this),b!=null)d.strokeStyle=b}else if(this.style("stroke").hasValue())b=this.style("stroke"),this.style("stroke-opacity").hasValue()&&(b=b.Color.addOpacity(this.style("stroke-opacity").value)),d.strokeStyle=b.value=="none"?"rgba(0,0,0,0)":b.value;if(this.style("stroke-width").hasValue())d.lineWidth=this.style("stroke-width").Length.toPixels();if(this.style("stroke-linecap").hasValue())d.lineCap=
|
||||
this.style("stroke-linecap").value;if(this.style("stroke-linejoin").hasValue())d.lineJoin=this.style("stroke-linejoin").value;if(this.style("stroke-miterlimit").hasValue())d.miterLimit=this.style("stroke-miterlimit").value;if(typeof d.font!="undefined")d.font=a.Font.CreateFont(this.style("font-style").value,this.style("font-variant").value,this.style("font-weight").value,this.style("font-size").hasValue()?this.style("font-size").Length.toPixels()+"px":"",this.style("font-family").value).toString();
|
||||
this.attribute("transform").hasValue()&&(new a.Transform(this.attribute("transform").value)).apply(d);this.attribute("clip-path").hasValue()&&(b=this.attribute("clip-path").Definition.getDefinition(),b!=null&&b.apply(d));if(this.style("opacity").hasValue())d.globalAlpha=this.style("opacity").numValue()}};a.Element.RenderedElementBase.prototype=new a.Element.ElementBase;a.Element.PathElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.path=function(d){d!=null&&d.beginPath();
|
||||
return new a.BoundingBox};this.renderChildren=function(d){this.path(d);a.Mouse.checkPath(this,d);d.fillStyle!=""&&d.fill();d.strokeStyle!=""&&d.stroke();var b=this.getMarkers();if(b!=null){if(this.style("marker-start").Definition.isUrl()){var c=this.style("marker-start").Definition.getDefinition();c.render(d,b[0][0],b[0][1])}if(this.style("marker-mid").Definition.isUrl())for(var c=this.style("marker-mid").Definition.getDefinition(),e=1;e<b.length-1;e++)c.render(d,b[e][0],b[e][1]);this.style("marker-end").Definition.isUrl()&&
|
||||
(c=this.style("marker-end").Definition.getDefinition(),c.render(d,b[b.length-1][0],b[b.length-1][1]))}};this.getBoundingBox=function(){return this.path()};this.getMarkers=function(){return null}};a.Element.PathElementBase.prototype=new a.Element.RenderedElementBase;a.Element.svg=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseClearContext=this.clearContext;this.clearContext=function(d){this.baseClearContext(d);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;
|
||||
this.setContext=function(d){d.strokeStyle="rgba(0,0,0,0)";d.lineCap="butt";d.lineJoin="miter";d.miterLimit=4;this.baseSetContext(d);this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&d.translate(this.attribute("x").Length.toPixels("x"),this.attribute("y").Length.toPixels("y"));var b=a.ViewPort.width(),c=a.ViewPort.height();if(typeof this.root=="undefined"&&this.attribute("width").hasValue()&&this.attribute("height").hasValue()){var b=this.attribute("width").Length.toPixels("x"),c=this.attribute("height").Length.toPixels("y"),
|
||||
e=0,f=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(e=-this.attribute("refX").Length.toPixels("x"),f=-this.attribute("refY").Length.toPixels("y"));d.beginPath();d.moveTo(e,f);d.lineTo(b,f);d.lineTo(b,c);d.lineTo(e,c);d.closePath();d.clip()}a.ViewPort.SetCurrent(b,c);if(this.attribute("viewBox").hasValue()){var e=a.ToNumberArray(this.attribute("viewBox").value),f=e[0],g=e[1],b=e[2],c=e[3];a.AspectRatio(d,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),b,a.ViewPort.height(),
|
||||
c,f,g,this.attribute("refX").value,this.attribute("refY").value);a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(e[2],e[3])}}};a.Element.svg.prototype=new a.Element.RenderedElementBase;a.Element.rect=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("x").Length.toPixels("x"),c=this.attribute("y").Length.toPixels("y"),e=this.attribute("width").Length.toPixels("x"),f=this.attribute("height").Length.toPixels("y"),g=this.attribute("rx").Length.toPixels("x"),
|
||||
j=this.attribute("ry").Length.toPixels("y");this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&(j=g);this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=j);d!=null&&(d.beginPath(),d.moveTo(b+g,c),d.lineTo(b+e-g,c),d.quadraticCurveTo(b+e,c,b+e,c+j),d.lineTo(b+e,c+f-j),d.quadraticCurveTo(b+e,c+f,b+e-g,c+f),d.lineTo(b+g,c+f),d.quadraticCurveTo(b,c+f,b,c+f-j),d.lineTo(b,c+j),d.quadraticCurveTo(b,c,b+g,c),d.closePath());return new a.BoundingBox(b,c,b+e,c+f)}};a.Element.rect.prototype=
|
||||
new a.Element.PathElementBase;a.Element.circle=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(d){var b=this.attribute("cx").Length.toPixels("x"),c=this.attribute("cy").Length.toPixels("y"),e=this.attribute("r").Length.toPixels();d!=null&&(d.beginPath(),d.arc(b,c,e,0,Math.PI*2,!0),d.closePath());return new a.BoundingBox(b-e,c-e,b+e,c+e)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(c){this.base=a.Element.PathElementBase;this.base(c);
|
||||
this.path=function(d){var b=4*((Math.sqrt(2)-1)/3),c=this.attribute("rx").Length.toPixels("x"),e=this.attribute("ry").Length.toPixels("y"),f=this.attribute("cx").Length.toPixels("x"),g=this.attribute("cy").Length.toPixels("y");d!=null&&(d.beginPath(),d.moveTo(f,g-e),d.bezierCurveTo(f+b*c,g-e,f+c,g-b*e,f+c,g),d.bezierCurveTo(f+c,g+b*e,f+b*c,g+e,f,g+e),d.bezierCurveTo(f-b*c,g+e,f-c,g+b*e,f-c,g),d.bezierCurveTo(f-c,g-b*e,f-b*c,g-e,f,g-e),d.closePath());return new a.BoundingBox(f-c,g-e,f+c,g+e)}};a.Element.ellipse.prototype=
|
||||
new a.Element.PathElementBase;a.Element.line=function(c){this.base=a.Element.PathElementBase;this.base(c);this.getPoints=function(){return[new a.Point(this.attribute("x1").Length.toPixels("x"),this.attribute("y1").Length.toPixels("y")),new a.Point(this.attribute("x2").Length.toPixels("x"),this.attribute("y2").Length.toPixels("y"))]};this.path=function(d){var b=this.getPoints();d!=null&&(d.beginPath(),d.moveTo(b[0].x,b[0].y),d.lineTo(b[1].x,b[1].y));return new a.BoundingBox(b[0].x,b[0].y,b[1].x,b[1].y)};
|
||||
this.getMarkers=function(){var a=this.getPoints(),b=a[0].angleTo(a[1]);return[[a[0],b],[a[1],b]]}};a.Element.line.prototype=new a.Element.PathElementBase;a.Element.polyline=function(c){this.base=a.Element.PathElementBase;this.base(c);this.points=a.CreatePath(this.attribute("points").value);this.path=function(d){var b=new a.BoundingBox(this.points[0].x,this.points[0].y);d!=null&&(d.beginPath(),d.moveTo(this.points[0].x,this.points[0].y));for(var c=1;c<this.points.length;c++)b.addPoint(this.points[c].x,
|
||||
this.points[c].y),d!=null&&d.lineTo(this.points[c].x,this.points[c].y);return b};this.getMarkers=function(){for(var a=[],b=0;b<this.points.length-1;b++)a.push([this.points[b],this.points[b].angleTo(this.points[b+1])]);a.push([this.points[this.points.length-1],a[a.length-1][1]]);return a}};a.Element.polyline.prototype=new a.Element.PathElementBase;a.Element.polygon=function(c){this.base=a.Element.polyline;this.base(c);this.basePath=this.path;this.path=function(a){var b=this.basePath(a);a!=null&&(a.lineTo(this.points[0].x,
|
||||
this.points[0].y),a.closePath());return b}};a.Element.polygon.prototype=new a.Element.polyline;a.Element.path=function(c){this.base=a.Element.PathElementBase;this.base(c);c=this.attribute("d").value;c=c.replace(/,/gm," ");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");c=c.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([0-9])([+\-])/gm,
|
||||
"$1 $2");c=c.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");c=c.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");c=a.compressSpaces(c);c=a.trim(c);this.PathParser=new function(d){this.tokens=d.split(" ");this.reset=function(){this.i=-1;this.previousCommand=this.command="";this.start=new a.Point(0,0);this.control=new a.Point(0,0);this.current=new a.Point(0,0);this.points=[];this.angles=[]};this.isEnd=function(){return this.i>=this.tokens.length-1};this.isCommandOrEnd=function(){return this.isEnd()?
|
||||
!0:this.tokens[this.i+1].match(/^[A-Za-z]$/)!=null};this.isRelativeCommand=function(){return this.command==this.command.toLowerCase()};this.getToken=function(){this.i+=1;return this.tokens[this.i]};this.getScalar=function(){return parseFloat(this.getToken())};this.nextCommand=function(){this.previousCommand=this.command;this.command=this.getToken()};this.getPoint=function(){return this.makeAbsolute(new a.Point(this.getScalar(),this.getScalar()))};this.getAsControlPoint=function(){var b=this.getPoint();
|
||||
return this.control=b};this.getAsCurrentPoint=function(){var b=this.getPoint();return this.current=b};this.getReflectedControlPoint=function(){return this.previousCommand.toLowerCase()!="c"&&this.previousCommand.toLowerCase()!="s"?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(b){if(this.isRelativeCommand())b.x=this.current.x+b.x,b.y=this.current.y+b.y;return b};this.addMarker=function(b,a,d){d!=null&&this.angles.length>0&&this.angles[this.angles.length-
|
||||
1]==null&&(this.angles[this.angles.length-1]=this.points[this.points.length-1].angleTo(d));this.addMarkerAngle(b,a==null?null:a.angleTo(b))};this.addMarkerAngle=function(b,a){this.points.push(b);this.angles.push(a)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var b=0;b<this.angles.length;b++)if(this.angles[b]==null)for(var a=b+1;a<this.angles.length;a++)if(this.angles[a]!=null){this.angles[b]=this.angles[a];break}return this.angles}}(c);this.path=function(d){var b=
|
||||
this.PathParser;b.reset();var c=new a.BoundingBox;for(d!=null&&d.beginPath();!b.isEnd();)switch(b.nextCommand(),b.command.toUpperCase()){case "M":var e=b.getAsCurrentPoint();b.addMarker(e);c.addPoint(e.x,e.y);d!=null&&d.moveTo(e.x,e.y);for(b.start=b.current;!b.isCommandOrEnd();)e=b.getAsCurrentPoint(),b.addMarker(e,b.start),c.addPoint(e.x,e.y),d!=null&&d.lineTo(e.x,e.y);break;case "L":for(;!b.isCommandOrEnd();){var f=b.current,e=b.getAsCurrentPoint();b.addMarker(e,f);c.addPoint(e.x,e.y);d!=null&&
|
||||
d.lineTo(e.x,e.y)}break;case "H":for(;!b.isCommandOrEnd();)e=new a.Point((b.isRelativeCommand()?b.current.x:0)+b.getScalar(),b.current.y),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "V":for(;!b.isCommandOrEnd();)e=new a.Point(b.current.x,(b.isRelativeCommand()?b.current.y:0)+b.getScalar()),b.addMarker(e,b.current),b.current=e,c.addPoint(b.current.x,b.current.y),d!=null&&d.lineTo(b.current.x,b.current.y);break;case "C":for(;!b.isCommandOrEnd();){var g=
|
||||
b.current,f=b.getPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint();b.addMarker(e,j,f);c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y);d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y)}break;case "S":for(;!b.isCommandOrEnd();)g=b.current,f=b.getReflectedControlPoint(),j=b.getAsControlPoint(),e=b.getAsCurrentPoint(),b.addMarker(e,j,f),c.addBezierCurve(g.x,g.y,f.x,f.y,j.x,j.y,e.x,e.y),d!=null&&d.bezierCurveTo(f.x,f.y,j.x,j.y,e.x,e.y);break;case "Q":for(;!b.isCommandOrEnd();)g=b.current,j=b.getAsControlPoint(),
|
||||
e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "T":for(;!b.isCommandOrEnd();)g=b.current,j=b.getReflectedControlPoint(),b.control=j,e=b.getAsCurrentPoint(),b.addMarker(e,j,j),c.addQuadraticCurve(g.x,g.y,j.x,j.y,e.x,e.y),d!=null&&d.quadraticCurveTo(j.x,j.y,e.x,e.y);break;case "A":for(;!b.isCommandOrEnd();){var g=b.current,h=b.getScalar(),l=b.getScalar(),f=b.getScalar()*(Math.PI/180),o=b.getScalar(),j=b.getScalar(),
|
||||
e=b.getAsCurrentPoint(),n=new a.Point(Math.cos(f)*(g.x-e.x)/2+Math.sin(f)*(g.y-e.y)/2,-Math.sin(f)*(g.x-e.x)/2+Math.cos(f)*(g.y-e.y)/2),q=Math.pow(n.x,2)/Math.pow(h,2)+Math.pow(n.y,2)/Math.pow(l,2);q>1&&(h*=Math.sqrt(q),l*=Math.sqrt(q));o=(o==j?-1:1)*Math.sqrt((Math.pow(h,2)*Math.pow(l,2)-Math.pow(h,2)*Math.pow(n.y,2)-Math.pow(l,2)*Math.pow(n.x,2))/(Math.pow(h,2)*Math.pow(n.y,2)+Math.pow(l,2)*Math.pow(n.x,2)));isNaN(o)&&(o=0);var p=new a.Point(o*h*n.y/l,o*-l*n.x/h),g=new a.Point((g.x+e.x)/2+Math.cos(f)*
|
||||
p.x-Math.sin(f)*p.y,(g.y+e.y)/2+Math.sin(f)*p.x+Math.cos(f)*p.y),m=function(b,a){return(b[0]*a[0]+b[1]*a[1])/(Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2))*Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2)))},s=function(b,a){return(b[0]*a[1]<b[1]*a[0]?-1:1)*Math.acos(m(b,a))},o=s([1,0],[(n.x-p.x)/h,(n.y-p.y)/l]),q=[(n.x-p.x)/h,(n.y-p.y)/l],p=[(-n.x-p.x)/h,(-n.y-p.y)/l],n=s(q,p);if(m(q,p)<=-1)n=Math.PI;m(q,p)>=1&&(n=0);j==0&&n>0&&(n-=2*Math.PI);j==1&&n<0&&(n+=2*Math.PI);q=new a.Point(g.x-h*Math.cos((o+n)/
|
||||
2),g.y-l*Math.sin((o+n)/2));b.addMarkerAngle(q,(o+n)/2+(j==0?1:-1)*Math.PI/2);b.addMarkerAngle(e,n+(j==0?1:-1)*Math.PI/2);c.addPoint(e.x,e.y);d!=null&&(m=h>l?h:l,e=h>l?1:h/l,h=h>l?l/h:1,d.translate(g.x,g.y),d.rotate(f),d.scale(e,h),d.arc(0,0,m,o,o+n,1-j),d.scale(1/e,1/h),d.rotate(-f),d.translate(-g.x,-g.y))}break;case "Z":d!=null&&d.closePath(),b.current=b.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],e=0;e<a.length;e++)c.push([a[e],
|
||||
b[e]]);return c}};a.Element.path.prototype=new a.Element.PathElementBase;a.Element.pattern=function(c){this.base=a.Element.ElementBase;this.base(c);this.createPattern=function(d){var b=new a.Element.svg;b.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);b.attributes.x=new a.Property("x",this.attribute("x").value);b.attributes.y=new a.Property("y",this.attribute("y").value);b.attributes.width=new a.Property("width",this.attribute("width").value);b.attributes.height=new a.Property("height",
|
||||
this.attribute("height").value);b.children=this.children;var c=document.createElement("canvas");c.width=this.attribute("width").Length.toPixels("x");c.height=this.attribute("height").Length.toPixels("y");b.render(c.getContext("2d"));return d.createPattern(c,"repeat")}};a.Element.pattern.prototype=new a.Element.ElementBase;a.Element.marker=function(c){this.base=a.Element.ElementBase;this.base(c);this.baseRender=this.render;this.render=function(d,b,c){d.translate(b.x,b.y);this.attribute("orient").valueOrDefault("auto")==
|
||||
"auto"&&d.rotate(c);this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(d.lineWidth,d.lineWidth);d.save();var e=new a.Element.svg;e.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);e.attributes.refX=new a.Property("refX",this.attribute("refX").value);e.attributes.refY=new a.Property("refY",this.attribute("refY").value);e.attributes.width=new a.Property("width",this.attribute("markerWidth").value);e.attributes.height=new a.Property("height",
|
||||
this.attribute("markerHeight").value);e.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));e.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));e.children=this.children;e.render(d);d.restore();this.attribute("markerUnits").valueOrDefault("strokeWidth")=="strokeWidth"&&d.scale(1/d.lineWidth,1/d.lineWidth);this.attribute("orient").valueOrDefault("auto")=="auto"&&d.rotate(-c);d.translate(-b.x,-b.y)}};a.Element.marker.prototype=
|
||||
new a.Element.ElementBase;a.Element.defs=function(c){this.base=a.Element.ElementBase;this.base(c);this.render=function(){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.gradientUnits=this.attribute("gradientUnits").valueOrDefault("objectBoundingBox");this.stops=[];for(c=0;c<this.children.length;c++)this.stops.push(this.children[c]);this.getGradient=function(){};this.createGradient=function(d,b){var c=this;this.attribute("xlink:href").hasValue()&&
|
||||
(c=this.attribute("xlink:href").Definition.getDefinition());for(var e=this.getGradient(d,b),f=0;f<c.stops.length;f++)e.addColorStop(c.stops[f].offset,c.stops[f].color);if(this.attribute("gradientTransform").hasValue()){c=a.ViewPort.viewPorts[0];f=new a.Element.rect;f.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3);f.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS);f.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS);
|
||||
var g=new a.Element.g;g.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value);g.children=[f];f=new a.Element.svg;f.attributes.x=new a.Property("x",0);f.attributes.y=new a.Property("y",0);f.attributes.width=new a.Property("width",c.width);f.attributes.height=new a.Property("height",c.height);f.children=[g];g=document.createElement("canvas");g.width=c.width;g.height=c.height;c=g.getContext("2d");c.fillStyle=e;f.render(c);return c.createPattern(g,"no-repeat")}return e}};
|
||||
a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("x1").numValue():this.attribute("x1").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y1").numValue():this.attribute("y1").Length.toPixels("y"),g=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("x2").numValue():this.attribute("x2").Length.toPixels("x"),c=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("y2").numValue():this.attribute("y2").Length.toPixels("y");return a.createLinearGradient(e,f,g,c)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.getGradient=function(a,b){var c=b.getBoundingBox(),e=this.gradientUnits=="objectBoundingBox"?
|
||||
c.x()+c.width()*this.attribute("cx").numValue():this.attribute("cx").Length.toPixels("x"),f=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").Length.toPixels("y"),g=e,j=f;this.attribute("fx").hasValue()&&(g=this.gradientUnits=="objectBoundingBox"?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").Length.toPixels("x"));this.attribute("fy").hasValue()&&(j=this.gradientUnits=="objectBoundingBox"?c.y()+c.height()*this.attribute("fy").numValue():
|
||||
this.attribute("fy").Length.toPixels("y"));c=this.gradientUnits=="objectBoundingBox"?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").Length.toPixels();return a.createRadialGradient(g,j,0,e,f,c)}};a.Element.radialGradient.prototype=new a.Element.GradientBase;a.Element.stop=function(c){this.base=a.Element.ElementBase;this.base(c);this.offset=this.attribute("offset").numValue();c=this.style("stop-color");this.style("stop-opacity").hasValue()&&(c=c.Color.addOpacity(this.style("stop-opacity").value));
|
||||
this.color=c.value};a.Element.stop.prototype=new a.Element.ElementBase;a.Element.AnimateBase=function(c){this.base=a.Element.ElementBase;this.base(c);a.Animations.push(this);this.duration=0;this.begin=this.attribute("begin").Time.toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").Time.toMilliseconds();this.getProperty=function(){var a=this.attribute("attributeType").value,b=this.attribute("attributeName").value;return a=="CSS"?this.parent.style(b,!0):this.parent.attribute(b,!0)};this.initialValue=
|
||||
null;this.removed=!1;this.calcValue=function(){return""};this.update=function(a){if(this.initialValue==null)this.initialValue=this.getProperty().value;if(this.duration>this.maxDuration)if(this.attribute("repeatCount").value=="indefinite")this.duration=0;else return this.attribute("fill").valueOrDefault("remove")=="remove"&&!this.removed?(this.removed=!0,this.getProperty().value=this.initialValue,!0):!1;this.duration+=a;a=!1;if(this.begin<this.duration)a=this.calcValue(),this.attribute("type").hasValue()&&
|
||||
(a=this.attribute("type").value+"("+a+")"),this.getProperty().value=a,a=!0;return a};this.progress=function(){return(this.duration-this.begin)/(this.maxDuration-this.begin)}};a.Element.AnimateBase.prototype=new a.Element.ElementBase;a.Element.animate=function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=this.attribute("from").numValue(),b=this.attribute("to").numValue();return a+(b-a)*this.progress()}};a.Element.animate.prototype=new a.Element.AnimateBase;a.Element.animateColor=
|
||||
function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){var a=new RGBColor(this.attribute("from").value),b=new RGBColor(this.attribute("to").value);if(a.ok&&b.ok){var c=a.r+(b.r-a.r)*this.progress(),e=a.g+(b.g-a.g)*this.progress(),a=a.b+(b.b-a.b)*this.progress();return"rgb("+parseInt(c,10)+","+parseInt(e,10)+","+parseInt(a,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(c){this.base=
|
||||
a.Element.animate;this.base(c)};a.Element.animateTransform.prototype=new a.Element.animate;a.Element.font=function(c){this.base=a.Element.ElementBase;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.isArabic=this.isRTL=!1;this.missingGlyph=this.fontFace=null;this.glyphs=[];for(c=0;c<this.children.length;c++){var d=this.children[c];if(d.type=="font-face")this.fontFace=d,d.style("font-family").hasValue()&&(a.Definitions[d.style("font-family").value]=this);else if(d.type=="missing-glyph")this.missingGlyph=
|
||||
d;else if(d.type=="glyph")d.arabicForm!=""?(this.isArabic=this.isRTL=!0,typeof this.glyphs[d.unicode]=="undefined"&&(this.glyphs[d.unicode]=[]),this.glyphs[d.unicode][d.arabicForm]=d):this.glyphs[d.unicode]=d}};a.Element.font.prototype=new a.Element.ElementBase;a.Element.fontface=function(c){this.base=a.Element.ElementBase;this.base(c);this.ascent=this.attribute("ascent").value;this.descent=this.attribute("descent").value;this.unitsPerEm=this.attribute("units-per-em").numValue()};a.Element.fontface.prototype=
|
||||
new a.Element.ElementBase;a.Element.missingglyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=0};a.Element.missingglyph.prototype=new a.Element.path;a.Element.glyph=function(c){this.base=a.Element.path;this.base(c);this.horizAdvX=this.attribute("horiz-adv-x").numValue();this.unicode=this.attribute("unicode").value;this.arabicForm=this.attribute("arabic-form").value};a.Element.glyph.prototype=new a.Element.path;a.Element.text=function(c){this.base=a.Element.RenderedElementBase;
|
||||
this.base(c);if(c!=null){this.children=[];for(var d=0;d<c.childNodes.length;d++){var b=c.childNodes[d];b.nodeType==1?this.addChild(b,!0):b.nodeType==3&&this.addChild(new a.Element.tspan(b),!1)}}this.baseSetContext=this.setContext;this.setContext=function(b){this.baseSetContext(b);if(this.style("dominant-baseline").hasValue())b.textBaseline=this.style("dominant-baseline").value;if(this.style("alignment-baseline").hasValue())b.textBaseline=this.style("alignment-baseline").value};this.renderChildren=
|
||||
function(b){for(var a=this.style("text-anchor").valueOrDefault("start"),c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),j=0;j<this.children.length;j++){var h=this.children[j];h.attribute("x").hasValue()?h.x=h.attribute("x").Length.toPixels("x"):(h.attribute("dx").hasValue()&&(c+=h.attribute("dx").Length.toPixels("x")),h.x=c);c=h.measureText(b);if(a!="start"&&(j==0||h.attribute("x").hasValue())){for(var l=c,o=j+1;o<this.children.length;o++){var n=this.children[o];
|
||||
if(n.attribute("x").hasValue())break;l+=n.measureText(b)}h.x-=a=="end"?l:l/2}c=h.x+c;h.attribute("y").hasValue()?h.y=h.attribute("y").Length.toPixels("y"):(h.attribute("dy").hasValue()&&(d+=h.attribute("dy").Length.toPixels("y")),h.y=d);d=h.y;h.render(b)}}};a.Element.text.prototype=new a.Element.RenderedElementBase;a.Element.TextElementBase=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getGlyph=function(a,b,c){var e=b[c],f=null;if(a.isArabic){var g="isolated";if((c==0||b[c-
|
||||
1]==" ")&&c<b.length-2&&b[c+1]!=" ")g="terminal";c>0&&b[c-1]!=" "&&c<b.length-2&&b[c+1]!=" "&&(g="medial");if(c>0&&b[c-1]!=" "&&(c==b.length-1||b[c+1]==" "))g="initial";typeof a.glyphs[e]!="undefined"&&(f=a.glyphs[e][g],f==null&&a.glyphs[e].type=="glyph"&&(f=a.glyphs[e]))}else f=a.glyphs[e];if(f==null)f=a.missingGlyph;return f};this.renderChildren=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var k=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
e=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),f=this.getText();b.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),j=0;j<f.length;j++){var h=this.getGlyph(b,f,j),l=k/b.fontFace.unitsPerEm;c.translate(this.x,this.y);c.scale(l,-l);var o=c.lineWidth;c.lineWidth=c.lineWidth*b.fontFace.unitsPerEm/k;e=="italic"&&c.transform(1,0,0.4,1,0,0);h.render(c);e=="italic"&&c.transform(1,0,-0.4,1,0,0);c.lineWidth=o;c.scale(1/
|
||||
l,-1/l);c.translate(-this.x,-this.y);this.x+=k*(h.horizAdvX||b.horizAdvX)/b.fontFace.unitsPerEm;typeof g[j]!="undefined"&&!isNaN(g[j])&&(this.x+=g[j])}}else c.strokeStyle!=""&&c.strokeText(a.compressSpaces(this.getText()),this.x,this.y),c.fillStyle!=""&&c.fillText(a.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureText=function(c){var b=this.parent.style("font-family").Definition.getDefinition();if(b!=null){var c=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),
|
||||
k=0,e=this.getText();b.isRTL&&(e=e.split("").reverse().join(""));for(var f=a.ToNumberArray(this.parent.attribute("dx").value),g=0;g<e.length;g++){var j=this.getGlyph(b,e,g);k+=(j.horizAdvX||b.horizAdvX)*c/b.fontFace.unitsPerEm;typeof f[g]!="undefined"&&!isNaN(f[g])&&(k+=f[g])}return k}b=a.compressSpaces(this.getText());if(!c.measureText)return b.length*10;c.save();this.setContext(c);b=c.measureText(b).width;c.restore();return b}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.tspan=function(c){this.base=a.Element.TextElementBase;this.base(c);this.text=c.nodeType==3?c.nodeValue:c.childNodes.length>0?c.childNodes[0].nodeValue:c.text;this.getText=function(){return this.text}};a.Element.tspan.prototype=new a.Element.TextElementBase;a.Element.tref=function(c){this.base=a.Element.TextElementBase;this.base(c);this.getText=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(a!=null)return a.children[0].getText()}};a.Element.tref.prototype=new a.Element.TextElementBase;
|
||||
a.Element.a=function(c){this.base=a.Element.TextElementBase;this.base(c);this.hasText=!0;for(var d=0;d<c.childNodes.length;d++)if(c.childNodes[d].nodeType!=3)this.hasText=!1;this.text=this.hasText?c.childNodes[0].nodeValue:"";this.getText=function(){return this.text};this.baseRenderChildren=this.renderChildren;this.renderChildren=function(b){if(this.hasText){this.baseRenderChildren(b);var c=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);a.Mouse.checkBoundingBox(this,new a.BoundingBox(this.x,
|
||||
this.y-c.Length.toPixels("y"),this.x+this.measureText(b),this.y))}else c=new a.Element.g,c.children=this.children,c.parent=this,c.render(b)};this.onclick=function(){window.open(this.attribute("xlink:href").value)};this.onmousemove=function(){a.ctx.canvas.style.cursor="pointer"}};a.Element.a.prototype=new a.Element.TextElementBase;a.Element.image=function(c){this.base=a.Element.RenderedElementBase;this.base(c);a.Images.push(this);this.img=document.createElement("img");this.loaded=!1;var d=this;this.img.onload=
|
||||
function(){d.loaded=!0};this.img.src=this.attribute("xlink:href").value;this.renderChildren=function(b){var c=this.attribute("x").Length.toPixels("x"),d=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y");f==0||g==0||(b.save(),b.translate(c,d),a.AspectRatio(b,this.attribute("preserveAspectRatio").value,f,this.img.width,g,this.img.height,0,0),b.drawImage(this.img,0,0),b.restore())}};a.Element.image.prototype=new a.Element.RenderedElementBase;
|
||||
a.Element.g=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.getBoundingBox=function(){for(var c=new a.BoundingBox,b=0;b<this.children.length;b++)c.addBoundingBox(this.children[b].getBoundingBox());return c}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(c){this.baseSetContext(c);if(this.attribute("viewBox").hasValue()){var b=
|
||||
a.ToNumberArray(this.attribute("viewBox").value),k=b[0],e=b[1];width=b[2];height=b[3];a.AspectRatio(c,this.attribute("preserveAspectRatio").value,this.attribute("width").Length.toPixels("x"),width,this.attribute("height").Length.toPixels("y"),height,k,e);a.ViewPort.SetCurrent(b[2],b[3])}}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(c){this.base=a.Element.ElementBase;this.base(c);for(var c=c.childNodes[0].nodeValue+(c.childNodes.length>1?c.childNodes[1].nodeValue:
|
||||
""),c=c.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,""),c=a.compressSpaces(c),c=c.split("}"),d=0;d<c.length;d++)if(a.trim(c[d])!="")for(var b=c[d].split("{"),k=b[0].split(","),b=b[1].split(";"),e=0;e<k.length;e++){var f=a.trim(k[e]);if(f!=""){for(var g={},j=0;j<b.length;j++){var h=b[j].indexOf(":"),l=b[j].substr(0,h),h=b[j].substr(h+1,b[j].length-h);l!=null&&h!=null&&(g[a.trim(l)]=new a.Property(a.trim(l),a.trim(h)))}a.Styles[f]=g;if(f=="@font-face"){f=g["font-family"].value.replace(/"/g,
|
||||
"");g=g.src.value.split(",");for(j=0;j<g.length;j++)if(g[j].indexOf('format("svg")')>0){l=g[j].indexOf("url");h=g[j].indexOf(")",l);l=g[j].substr(l+5,h-l-6);l=a.parseXml(a.ajax(l)).getElementsByTagName("font");for(h=0;h<l.length;h++){var o=a.CreateElement(l[h]);a.Definitions[f]=o}}}}}};a.Element.style.prototype=new a.Element.ElementBase;a.Element.use=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=this.setContext;this.setContext=function(a){this.baseSetContext(a);
|
||||
this.attribute("x").hasValue()&&a.translate(this.attribute("x").Length.toPixels("x"),0);this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").Length.toPixels("y"))};this.getDefinition=function(){var a=this.attribute("xlink:href").Definition.getDefinition();if(this.attribute("width").hasValue())a.attribute("width",!0).value=this.attribute("width").value;if(this.attribute("height").hasValue())a.attribute("height",!0).value=this.attribute("height").value;return a};this.path=function(a){var b=
|
||||
this.getDefinition();b!=null&&b.path(a)};this.renderChildren=function(a){var b=this.getDefinition();b!=null&&b.render(a)}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=this.attribute("x").Length.toPixels("x"),e=this.attribute("y").Length.toPixels("y"),f=this.attribute("width").Length.toPixels("x"),g=this.attribute("height").Length.toPixels("y"),j=b.attribute("mask").value;b.attribute("mask").value=
|
||||
"";var h=document.createElement("canvas");h.width=c+f;h.height=e+g;var l=h.getContext("2d");this.renderChildren(l);var o=document.createElement("canvas");o.width=c+f;o.height=e+g;var n=o.getContext("2d");b.render(n);n.globalCompositeOperation="destination-in";n.fillStyle=l.createPattern(h,"no-repeat");n.fillRect(0,0,c+f,e+g);a.fillStyle=n.createPattern(o,"no-repeat");a.fillRect(0,0,c+f,e+g);b.attribute("mask").value=j};this.render=function(){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath=
|
||||
function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a){for(var b=0;b<this.children.length;b++)this.children[b].path&&(this.children[b].path(a),a.clip())};this.render=function(){}};a.Element.clipPath.prototype=new a.Element.ElementBase;a.Element.filter=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,b){var c=b.getBoundingBox(),e=this.attribute("x").Length.toPixels("x"),f=this.attribute("y").Length.toPixels("y");if(e==0||f==0)e=c.x1,f=c.y1;var g=
|
||||
this.attribute("width").Length.toPixels("x"),j=this.attribute("height").Length.toPixels("y");if(g==0||j==0)g=c.width(),j=c.height();c=b.style("filter").value;b.style("filter").value="";var h=0.2*g,l=0.2*j,o=document.createElement("canvas");o.width=g+2*h;o.height=j+2*l;var n=o.getContext("2d");n.translate(-e+h,-f+l);b.render(n);for(var q=0;q<this.children.length;q++)this.children[q].apply(n,0,0,g+2*h,j+2*l);a.drawImage(o,0,0,g+2*h,j+2*l,e-h,f-l,g+2*h,j+2*l);b.style("filter",!0).value=c};this.render=
|
||||
function(){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(c){function d(a,c,d,f,g){for(var j=0;j<g;j++)for(var h=0;h<f;h++)for(var l=a[j*f*4+h*4+3]/255,o=0;o<4;o++){for(var n=d[0]*(l==0?255:a[j*f*4+h*4+o])*(l==0||o==3?1:l),q=1;q<d.length;q++){var p=Math.max(h-q,0),m=a[j*f*4+p*4+3]/255,p=Math.min(h+q,f-1),p=a[j*f*4+p*4+3]/255,s=d[q],r;m==0?r=255:(r=Math.max(h-q,0),r=a[j*f*4+r*4+o]);m=r*(m==0||o==3?1:m);p==0?r=255:(r=Math.min(h+q,f-1),r=a[j*f*4+r*4+o]);n+=
|
||||
s*(m+r*(p==0||o==3?1:p))}c[h*g*4+j*4+o]=n}}this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,e,f,g){var e=this.attribute("stdDeviation").numValue(),c=a.getImageData(0,0,f,g),e=Math.max(e,0.01),j=Math.ceil(e*4)+1;mask=[];for(var h=0;h<j;h++)mask[h]=Math.exp(-0.5*(h/e)*(h/e));e=mask;j=0;for(h=1;h<e.length;h++)j+=Math.abs(e[h]);j=2*j+Math.abs(e[0]);for(h=0;h<e.length;h++)e[h]/=j;tmp=[];d(c.data,tmp,e,f,g);d(tmp,c.data,e,g,f);a.clearRect(0,0,f,g);a.putImageData(c,0,0)}};a.Element.filter.prototype=
|
||||
new a.Element.feGaussianBlur;a.Element.title=function(){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(){};a.Element.desc.prototype=new a.Element.ElementBase;a.Element.MISSING=function(a){console.log("ERROR: Element '"+a.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(c){var d=c.nodeName.replace(/^[^:]+:/,""),d=d.replace(/\-/g,""),b=null,b=typeof a.Element[d]!="undefined"?new a.Element[d](c):new a.Element.MISSING(c);
|
||||
b.type=c.nodeName;return b};a.load=function(c,d){a.loadXml(c,a.ajax(d))};a.loadXml=function(c,d){a.loadXmlDoc(c,a.parseXml(d))};a.loadXmlDoc=function(c,d){a.init(c);var b=function(a){for(var b=c.canvas;b;)a.x-=b.offsetLeft,a.y-=b.offsetTop,b=b.offsetParent;window.scrollX&&(a.x+=window.scrollX);window.scrollY&&(a.y+=window.scrollY);return a};if(a.opts.ignoreMouse!=!0)c.canvas.onclick=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onclick(c.x,c.y)},
|
||||
c.canvas.onmousemove=function(c){c=b(new a.Point(c!=null?c.clientX:event.clientX,c!=null?c.clientY:event.clientY));a.Mouse.onmousemove(c.x,c.y)};var k=a.CreateElement(d.documentElement),e=k.root=!0,f=function(){a.ViewPort.Clear();c.canvas.parentNode&&a.ViewPort.SetCurrent(c.canvas.parentNode.clientWidth,c.canvas.parentNode.clientHeight);if(a.opts.ignoreDimensions!=!0){if(k.style("width").hasValue())c.canvas.width=k.style("width").Length.toPixels("x"),c.canvas.style.width=c.canvas.width+"px";if(k.style("height").hasValue())c.canvas.height=
|
||||
k.style("height").Length.toPixels("y"),c.canvas.style.height=c.canvas.height+"px"}var b=c.canvas.clientWidth||c.canvas.width,d=c.canvas.clientHeight||c.canvas.height;a.ViewPort.SetCurrent(b,d);if(a.opts!=null&&a.opts.offsetX!=null)k.attribute("x",!0).value=a.opts.offsetX;if(a.opts!=null&&a.opts.offsetY!=null)k.attribute("y",!0).value=a.opts.offsetY;if(a.opts!=null&&a.opts.scaleWidth!=null&&a.opts.scaleHeight!=null){var f=1,g=1;k.attribute("width").hasValue()&&(f=k.attribute("width").Length.toPixels("x")/
|
||||
a.opts.scaleWidth);k.attribute("height").hasValue()&&(g=k.attribute("height").Length.toPixels("y")/a.opts.scaleHeight);k.attribute("width",!0).value=a.opts.scaleWidth;k.attribute("height",!0).value=a.opts.scaleHeight;k.attribute("viewBox",!0).value="0 0 "+b*f+" "+d*g;k.attribute("preserveAspectRatio",!0).value="none"}a.opts.ignoreClear!=!0&&c.clearRect(0,0,b,d);k.render(c);e&&(e=!1,a.opts!=null&&typeof a.opts.renderCallback=="function"&&a.opts.renderCallback())},g=!0;a.ImagesLoaded()&&(g=!1,f());
|
||||
a.intervalID=setInterval(function(){var b=!1;g&&a.ImagesLoaded()&&(g=!1,b=!0);a.opts.ignoreMouse!=!0&&(b|=a.Mouse.hasEvents());if(a.opts.ignoreAnimation!=!0)for(var c=0;c<a.Animations.length;c++)b|=a.Animations[c].update(1E3/a.FRAMERATE);a.opts!=null&&typeof a.opts.forceRedraw=="function"&&a.opts.forceRedraw()==!0&&(b=!0);b&&(f(),a.Mouse.runEvents())},1E3/a.FRAMERATE)};a.stop=function(){a.intervalID&&clearInterval(a.intervalID)};a.Mouse=new function(){this.events=[];this.hasEvents=function(){return this.events.length!=
|
||||
0};this.onclick=function(a,d){this.events.push({type:"onclick",x:a,y:d,run:function(a){if(a.onclick)a.onclick()}})};this.onmousemove=function(a,d){this.events.push({type:"onmousemove",x:a,y:d,run:function(a){if(a.onmousemove)a.onmousemove()}})};this.eventElements=[];this.checkPath=function(a,d){for(var b=0;b<this.events.length;b++){var k=this.events[b];d.isPointInPath&&d.isPointInPath(k.x,k.y)&&(this.eventElements[b]=a)}};this.checkBoundingBox=function(a,d){for(var b=0;b<this.events.length;b++){var k=
|
||||
this.events[b];d.isPointInBox(k.x,k.y)&&(this.eventElements[b]=a)}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var c=0;c<this.events.length;c++)for(var d=this.events[c],b=this.eventElements[c];b;)d.run(b),b=b.parent;this.events=[];this.eventElements=[]}};return a}this.canvg=function(a,c,d){if(a==null&&c==null&&d==null)for(var c=document.getElementsByTagName("svg"),b=0;b<c.length;b++){a=c[b];d=document.createElement("canvas");d.width=a.clientWidth;d.height=a.clientHeight;a.parentNode.insertBefore(d,
|
||||
a);a.parentNode.removeChild(a);var k=document.createElement("div");k.appendChild(a);canvg(d,k.innerHTML)}else d=d||{},typeof a=="string"&&(a=document.getElementById(a)),a.svg==null?(b=m(),a.svg=b):(b=a.svg,b.stop()),b.opts=d,a=a.getContext("2d"),typeof c.documentElement!="undefined"?b.loadXmlDoc(a,c):c.substr(0,1)=="<"?b.loadXml(a,c):b.load(a,c)}})();
|
||||
if(CanvasRenderingContext2D)CanvasRenderingContext2D.prototype.drawSvg=function(m,a,c,d,b){canvg(this.canvas,m,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:c,scaleWidth:d,scaleHeight:b})};
|
||||
(function(m){var a=m.css,c=m.CanVGRenderer,d=m.SVGRenderer,b=m.extend,k=m.merge,e=m.addEvent,f=m.createElement,g=m.discardElement;b(c.prototype,d.prototype);b(c.prototype,{create:function(a,b,c,d){this.setContainer(b,c,d);this.configure(a)},setContainer:function(a,b,c){var d=a.style,e=a.parentNode,g=d.left,d=d.top,k=a.offsetWidth,m=a.offsetHeight,s={visibility:"hidden",position:"absolute"};this.init.apply(this,[a,b,c]);this.canvas=f("canvas",{width:k,height:m},{position:"relative",left:g,top:d},a);
|
||||
this.ttLine=f("div",null,s,e);this.ttDiv=f("div",null,s,e);this.ttTimer=void 0;this.hiddenSvg=a=f("div",{width:k,height:m},{visibility:"hidden",left:g,top:d},e);a.appendChild(this.box)},configure:function(b){var c=this,d=b.options.tooltip,f=d.borderWidth,g=c.ttDiv,m=d.style,p=c.ttLine,t=parseInt(m.padding,10),m=k(m,{padding:t+"px","background-color":d.backgroundColor,"border-style":"solid","border-width":f+"px","border-radius":d.borderRadius+"px"});d.shadow&&(m=k(m,{"box-shadow":"1px 1px 3px gray",
|
||||
"-webkit-box-shadow":"1px 1px 3px gray"}));a(g,m);a(p,{"border-left":"1px solid darkgray"});e(b,"tooltipRefresh",function(d){var e=b.container,f=e.offsetLeft,e=e.offsetTop,k;g.innerHTML=d.text;k=b.tooltip.getPosition(g.offsetWidth,g.offsetHeight,{plotX:d.x,plotY:d.y});a(g,{visibility:"visible",left:k.x+"px",top:k.y+"px","border-color":d.borderColor});a(p,{visibility:"visible",left:f+d.x+"px",top:e+b.plotTop+"px",height:b.plotHeight+"px"});c.ttTimer!==void 0&&clearTimeout(c.ttTimer);c.ttTimer=setTimeout(function(){a(g,
|
||||
{visibility:"hidden"});a(p,{visibility:"hidden"})},3E3)})},destroy:function(){g(this.canvas);this.ttTimer!==void 0&&clearTimeout(this.ttTimer);g(this.ttLine);g(this.ttDiv);g(this.hiddenSvg);return d.prototype.destroy.apply(this)},color:function(a,b,c){a&&a.linearGradient&&(a=a.stops[a.stops.length-1][1]);return d.prototype.color.call(this,a,b,c)},draw:function(){window.canvg(this.canvas,this.hiddenSvg.innerHTML)}})})(Highcharts);
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
Data plugin for Highcharts
|
||||
|
||||
(c) 2012-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(j){var m=j.each,n=function(b,a){this.init(b,a)};j.extend(n.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=b&&b.chart&&b.chart.type,c=[];m(b&&b.series||[],function(b){c.push((j.seriesTypes[b.type||a||"line"].prototype.pointArrayMap||[0]).length)});this.valueCount=
|
||||
{global:(j.seriesTypes[a||"line"].prototype.pointArrayMap||[0]).length,individual:c}},dataFound:function(){if(this.options.switchRowsAndColumns)this.columns=this.rowsToColumns(this.columns);this.parseTypes();this.findHeaderRow();this.parsed();this.complete()},parseCSV:function(){var b=this,a=this.options,c=a.csv,d=this.columns,e=a.startRow||0,f=a.endRow||Number.MAX_VALUE,i=a.startColumn||0,h=a.endColumn||Number.MAX_VALUE,g,k,o=0;c&&(k=c.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||
|
||||
"\n"),g=a.itemDelimiter||(c.indexOf("\t")!==-1?"\t":","),m(k,function(a,c){var k=b.trim(a),j=k.indexOf("#")===0;c>=e&&c<=f&&!j&&k!==""&&(k=a.split(g),m(k,function(b,a){a>=i&&a<=h&&(d[a-i]||(d[a-i]=[]),d[a-i][o]=b)}),o+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,c=this.columns,d=b.startRow||0,e=b.endRow||Number.MAX_VALUE,f=b.startColumn||0,i=b.endColumn||Number.MAX_VALUE;a&&(typeof a==="string"&&(a=document.getElementById(a)),m(a.getElementsByTagName("tr"),function(a,
|
||||
b){b>=d&&b<=e&&m(a.children,function(a,e){if((a.tagName==="TD"||a.tagName==="TH")&&e>=f&&e<=i)c[e-f]||(c[e-f]=[]),c[e-f][b-d]=a.innerHTML})}),this.dataFound())},parseGoogleSpreadsheet:function(){var b=this,a=this.options,c=a.googleSpreadsheetKey,d=this.columns,e=a.startRow||0,f=a.endRow||Number.MAX_VALUE,i=a.startColumn||0,h=a.endColumn||Number.MAX_VALUE,g,k;c&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+c+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",
|
||||
error:a.error,success:function(a){var a=a.feed.entry,c,j=a.length,m=0,n=0,l;for(l=0;l<j;l++)c=a[l],m=Math.max(m,c.gs$cell.col),n=Math.max(n,c.gs$cell.row);for(l=0;l<m;l++)if(l>=i&&l<=h)d[l-i]=[],d[l-i].length=Math.min(n,f-e);for(l=0;l<j;l++)if(c=a[l],g=c.gs$cell.row-1,k=c.gs$cell.col-1,k>=i&&k<=h&&g>=e&&g<=f)d[k-i][g-e]=c.content.$t;b.dataFound()}})},findHeaderRow:function(){m(this.columns,function(){});this.headerRow=0},trim:function(b){return typeof b==="string"?b.replace(/^\s+|\s+$/g,""):b},parseTypes:function(){for(var b=
|
||||
this.columns,a=b.length,c,d,e,f;a--;)for(c=b[a].length;c--;)d=b[a][c],e=parseFloat(d),f=this.trim(d),f==e?(b[a][c]=e,e>31536E6?b[a].isDatetime=!0:b[a].isNumeric=!0):(d=this.parseDate(d),a===0&&typeof d==="number"&&!isNaN(d)?(b[a][c]=d,b[a].isDatetime=!0):b[a][c]=f===""?null:f)},dateFormats:{"YYYY-mm-dd":{regex:"^([0-9]{4})-([0-9]{2})-([0-9]{2})$",parser:function(b){return Date.UTC(+b[1],b[2]-1,+b[3])}}},parseDate:function(b){var a=this.options.parseDate,c,d,e;a&&(c=a(b));if(typeof b==="string")for(d in this.dateFormats)a=
|
||||
this.dateFormats[d],(e=b.match(a.regex))&&(c=a.parser(e));return c},rowsToColumns:function(b){var a,c,d,e,f;if(b){f=[];c=b.length;for(a=0;a<c;a++){e=b[a].length;for(d=0;d<e;d++)f[d]||(f[d]=[]),f[d][a]=b[a][d]}}return f},parsed:function(){this.options.parsed&&this.options.parsed.call(this,this.columns)},complete:function(){var b=this.columns,a,c,d=this.options,e,f,i,h,g,k;if(d.complete||d.afterComplete){this.getColumnDistribution();b.length>1&&(a=b.shift(),this.headerRow===0&&a.shift(),a.isDatetime?
|
||||
c="datetime":a.isNumeric||(c="category"));for(h=0;h<b.length;h++)if(this.headerRow===0)b[h].name=b[h].shift();f=[];for(h=0,k=0;h<b.length;k++){e=j.pick(this.valueCount.individual[k],this.valueCount.global);i=[];if(h+e<=b.length)for(g=0;g<b[h].length;g++)i[g]=[a[g],b[h][g]!==void 0?b[h][g]:null],e>1&&i[g].push(b[h+1][g]!==void 0?b[h+1][g]:null),e>2&&i[g].push(b[h+2][g]!==void 0?b[h+2][g]:null),e>3&&i[g].push(b[h+3][g]!==void 0?b[h+3][g]:null),e>4&&i[g].push(b[h+4][g]!==void 0?b[h+4][g]:null);f[k]=
|
||||
{name:b[h].name,data:i};h+=e}b={xAxis:{type:c},series:f};d.complete&&d.complete(b);d.afterComplete&&d.afterComplete(b)}}});j.Data=n;j.data=function(b,a){return new n(b,a)};j.wrap(j.Chart.prototype,"init",function(b,a,c){var d=this;a&&a.data?j.data(j.extend(a.data,{afterComplete:function(e){var f,i;if(a.hasOwnProperty("series"))if(typeof a.series==="object")for(f=Math.max(a.series.length,e.series.length);f--;)i=a.series[f]||{},a.series[f]=j.merge(i,e.series[f]);else delete a.series;a=j.merge(e,a);
|
||||
b.call(d,a,c)}}),a):b.call(d,a,c)})})(Highcharts);
|
||||
@@ -0,0 +1,622 @@
|
||||
/**
|
||||
* @license Data plugin for Highcharts
|
||||
*
|
||||
* (c) 2012-2014 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/*
|
||||
* The Highcharts Data plugin is a utility to ease parsing of input sources like
|
||||
* CSV, HTML tables or grid views into basic configuration options for use
|
||||
* directly in the Highcharts constructor.
|
||||
*
|
||||
* Demo: http://jsfiddle.net/highcharts/SnLFj/
|
||||
*
|
||||
* --- OPTIONS ---
|
||||
*
|
||||
* - columns : Array<Array<Mixed>>
|
||||
* A two-dimensional array representing the input data on tabular form. This input can
|
||||
* be used when the data is already parsed, for example from a grid view component.
|
||||
* Each cell can be a string or number. If not switchRowsAndColumns is set, the columns
|
||||
* are interpreted as series. See also the rows option.
|
||||
*
|
||||
* - complete : Function(chartOptions)
|
||||
* The callback that is evaluated when the data is finished loading, optionally from an
|
||||
* external source, and parsed. The first argument passed is a finished chart options
|
||||
* object, containing the series. Thise options
|
||||
* can be extended with additional options and passed directly to the chart constructor. This is
|
||||
* related to the parsed callback, that goes in at an earlier stage.
|
||||
*
|
||||
* - csv : String
|
||||
* A comma delimited string to be parsed. Related options are startRow, endRow, startColumn
|
||||
* and endColumn to delimit what part of the table is used. The lineDelimiter and
|
||||
* itemDelimiter options define the CSV delimiter formats.
|
||||
*
|
||||
* - endColumn : Integer
|
||||
* In tabular input data, the first row (indexed by 0) to use. Defaults to the last
|
||||
* column containing data.
|
||||
*
|
||||
* - endRow : Integer
|
||||
* In tabular input data, the last row (indexed by 0) to use. Defaults to the last row
|
||||
* containing data.
|
||||
*
|
||||
* - googleSpreadsheetKey : String
|
||||
* A Google Spreadsheet key. See https://developers.google.com/gdata/samples/spreadsheet_sample
|
||||
* for general information on GS.
|
||||
*
|
||||
* - googleSpreadsheetWorksheet : String
|
||||
* The Google Spreadsheet worksheet. The available id's can be read from
|
||||
* https://spreadsheets.google.com/feeds/worksheets/{key}/public/basic
|
||||
*
|
||||
* - itemDelimiter : String
|
||||
* Item or cell delimiter for parsing CSV. Defaults to the tab character "\t" if a tab character
|
||||
* is found in the CSV string, if not it defaults to ",".
|
||||
*
|
||||
* - lineDelimiter : String
|
||||
* Line delimiter for parsing CSV. Defaults to "\n".
|
||||
*
|
||||
* - parsed : Function
|
||||
* A callback function to access the parsed columns, the two-dimentional input data
|
||||
* array directly, before they are interpreted into series data and categories. See also
|
||||
* the complete callback, that goes in on a later stage where the raw columns are interpreted
|
||||
* into a Highcharts option structure.
|
||||
*
|
||||
* - parseDate : Function
|
||||
* A callback function to parse string representations of dates into JavaScript timestamps.
|
||||
* Return an integer on success.
|
||||
*
|
||||
* - rows : Array<Array<Mixed>>
|
||||
* The same as the columns input option, but defining rows intead of columns.
|
||||
*
|
||||
* - startColumn : Integer
|
||||
* In tabular input data, the first column (indexed by 0) to use.
|
||||
*
|
||||
* - startRow : Integer
|
||||
* In tabular input data, the first row (indexed by 0) to use.
|
||||
*
|
||||
* - switchRowsAndColumns : Boolean
|
||||
* Switch rows and columns of the input data, so that this.columns effectively becomes the
|
||||
* rows of the data set, and the rows are interpreted as series.
|
||||
*
|
||||
* - table : String|HTMLElement
|
||||
* A HTML table or the id of such to be parsed as input data. Related options ara startRow,
|
||||
* endRow, startColumn and endColumn to delimit what part of the table is used.
|
||||
*/
|
||||
|
||||
// JSLint options:
|
||||
/*global jQuery */
|
||||
|
||||
(function (Highcharts) { // docs
|
||||
|
||||
// Utilities
|
||||
var each = Highcharts.each;
|
||||
|
||||
|
||||
// The Data constructor
|
||||
var Data = function (dataOptions, chartOptions) {
|
||||
this.init(dataOptions, chartOptions);
|
||||
};
|
||||
|
||||
// Set the prototype properties
|
||||
Highcharts.extend(Data.prototype, {
|
||||
|
||||
/**
|
||||
* Initialize the Data object with the given options
|
||||
*/
|
||||
init: function (options, chartOptions) {
|
||||
this.options = options;
|
||||
this.chartOptions = chartOptions;
|
||||
this.columns = options.columns || this.rowsToColumns(options.rows) || [];
|
||||
|
||||
// No need to parse or interpret anything
|
||||
if (this.columns.length) {
|
||||
this.dataFound();
|
||||
|
||||
// Parse and interpret
|
||||
} else {
|
||||
|
||||
// Parse a CSV string if options.csv is given
|
||||
this.parseCSV();
|
||||
|
||||
// Parse a HTML table if options.table is given
|
||||
this.parseTable();
|
||||
|
||||
// Parse a Google Spreadsheet
|
||||
this.parseGoogleSpreadsheet();
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the column distribution. For example, a line series takes a single column for
|
||||
* Y values. A range series takes two columns for low and high values respectively,
|
||||
* and an OHLC series takes four columns.
|
||||
*/
|
||||
getColumnDistribution: function () {
|
||||
var chartOptions = this.chartOptions,
|
||||
getValueCount = function (type) {
|
||||
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
|
||||
},
|
||||
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
|
||||
individualCounts = [];
|
||||
|
||||
each((chartOptions && chartOptions.series) || [], function (series) {
|
||||
individualCounts.push(getValueCount(series.type || globalType));
|
||||
});
|
||||
|
||||
this.valueCount = {
|
||||
global: getValueCount(globalType),
|
||||
individual: individualCounts
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* When the data is parsed into columns, either by CSV, table, GS or direct input,
|
||||
* continue with other operations.
|
||||
*/
|
||||
dataFound: function () {
|
||||
|
||||
if (this.options.switchRowsAndColumns) {
|
||||
this.columns = this.rowsToColumns(this.columns);
|
||||
}
|
||||
|
||||
// Interpret the values into right types
|
||||
this.parseTypes();
|
||||
|
||||
// Use first row for series names?
|
||||
this.findHeaderRow();
|
||||
|
||||
// Handle columns if a handleColumns callback is given
|
||||
this.parsed();
|
||||
|
||||
// Complete if a complete callback is given
|
||||
this.complete();
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a CSV input string
|
||||
*/
|
||||
parseCSV: function () {
|
||||
var self = this,
|
||||
options = this.options,
|
||||
csv = options.csv,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE,
|
||||
itemDelimiter,
|
||||
lines,
|
||||
activeRowNo = 0;
|
||||
|
||||
if (csv) {
|
||||
|
||||
lines = csv
|
||||
.replace(/\r\n/g, "\n") // Unix
|
||||
.replace(/\r/g, "\n") // Mac
|
||||
.split(options.lineDelimiter || "\n");
|
||||
|
||||
itemDelimiter = options.itemDelimiter || (csv.indexOf('\t') !== -1 ? '\t' : ',');
|
||||
|
||||
each(lines, function (line, rowNo) {
|
||||
var trimmed = self.trim(line),
|
||||
isComment = trimmed.indexOf('#') === 0,
|
||||
isBlank = trimmed === '',
|
||||
items;
|
||||
|
||||
if (rowNo >= startRow && rowNo <= endRow && !isComment && !isBlank) {
|
||||
items = line.split(itemDelimiter);
|
||||
each(items, function (item, colNo) {
|
||||
if (colNo >= startColumn && colNo <= endColumn) {
|
||||
if (!columns[colNo - startColumn]) {
|
||||
columns[colNo - startColumn] = [];
|
||||
}
|
||||
|
||||
columns[colNo - startColumn][activeRowNo] = item;
|
||||
}
|
||||
});
|
||||
activeRowNo += 1;
|
||||
}
|
||||
});
|
||||
|
||||
this.dataFound();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a HTML table
|
||||
*/
|
||||
parseTable: function () {
|
||||
var options = this.options,
|
||||
table = options.table,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE;
|
||||
|
||||
if (table) {
|
||||
|
||||
if (typeof table === 'string') {
|
||||
table = document.getElementById(table);
|
||||
}
|
||||
|
||||
each(table.getElementsByTagName('tr'), function (tr, rowNo) {
|
||||
if (rowNo >= startRow && rowNo <= endRow) {
|
||||
each(tr.children, function (item, colNo) {
|
||||
if ((item.tagName === 'TD' || item.tagName === 'TH') && colNo >= startColumn && colNo <= endColumn) {
|
||||
if (!columns[colNo - startColumn]) {
|
||||
columns[colNo - startColumn] = [];
|
||||
}
|
||||
|
||||
columns[colNo - startColumn][rowNo - startRow] = item.innerHTML;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.dataFound(); // continue
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
*/
|
||||
parseGoogleSpreadsheet: function () {
|
||||
var self = this,
|
||||
options = this.options,
|
||||
googleSpreadsheetKey = options.googleSpreadsheetKey,
|
||||
columns = this.columns,
|
||||
startRow = options.startRow || 0,
|
||||
endRow = options.endRow || Number.MAX_VALUE,
|
||||
startColumn = options.startColumn || 0,
|
||||
endColumn = options.endColumn || Number.MAX_VALUE,
|
||||
gr, // google row
|
||||
gc; // google column
|
||||
|
||||
if (googleSpreadsheetKey) {
|
||||
jQuery.ajax({
|
||||
dataType: 'json',
|
||||
url: 'https://spreadsheets.google.com/feeds/cells/' +
|
||||
googleSpreadsheetKey + '/' + (options.googleSpreadsheetWorksheet || 'od6') +
|
||||
'/public/values?alt=json-in-script&callback=?',
|
||||
error: options.error,
|
||||
success: function (json) {
|
||||
// Prepare the data from the spreadsheat
|
||||
var cells = json.feed.entry,
|
||||
cell,
|
||||
cellCount = cells.length,
|
||||
colCount = 0,
|
||||
rowCount = 0,
|
||||
i;
|
||||
|
||||
// First, find the total number of columns and rows that
|
||||
// are actually filled with data
|
||||
for (i = 0; i < cellCount; i++) {
|
||||
cell = cells[i];
|
||||
colCount = Math.max(colCount, cell.gs$cell.col);
|
||||
rowCount = Math.max(rowCount, cell.gs$cell.row);
|
||||
}
|
||||
|
||||
// Set up arrays containing the column data
|
||||
for (i = 0; i < colCount; i++) {
|
||||
if (i >= startColumn && i <= endColumn) {
|
||||
// Create new columns with the length of either end-start or rowCount
|
||||
columns[i - startColumn] = [];
|
||||
|
||||
// Setting the length to avoid jslint warning
|
||||
columns[i - startColumn].length = Math.min(rowCount, endRow - startRow);
|
||||
}
|
||||
}
|
||||
|
||||
// Loop over the cells and assign the value to the right
|
||||
// place in the column arrays
|
||||
for (i = 0; i < cellCount; i++) {
|
||||
cell = cells[i];
|
||||
gr = cell.gs$cell.row - 1; // rows start at 1
|
||||
gc = cell.gs$cell.col - 1; // columns start at 1
|
||||
|
||||
// If both row and col falls inside start and end
|
||||
// set the transposed cell value in the newly created columns
|
||||
if (gc >= startColumn && gc <= endColumn &&
|
||||
gr >= startRow && gr <= endRow) {
|
||||
columns[gc - startColumn][gr - startRow] = cell.content.$t;
|
||||
}
|
||||
}
|
||||
self.dataFound();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Find the header row. For now, we just check whether the first row contains
|
||||
* numbers or strings. Later we could loop down and find the first row with
|
||||
* numbers.
|
||||
*/
|
||||
findHeaderRow: function () {
|
||||
var headerRow = 0;
|
||||
each(this.columns, function (column) {
|
||||
if (typeof column[0] !== 'string') {
|
||||
headerRow = null;
|
||||
}
|
||||
});
|
||||
this.headerRow = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Trim a string from whitespace
|
||||
*/
|
||||
trim: function (str) {
|
||||
return typeof str === 'string' ? str.replace(/^\s+|\s+$/g, '') : str;
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse numeric cells in to number types and date types in to true dates.
|
||||
*/
|
||||
parseTypes: function () {
|
||||
var columns = this.columns,
|
||||
col = columns.length,
|
||||
row,
|
||||
val,
|
||||
floatVal,
|
||||
trimVal,
|
||||
dateVal;
|
||||
|
||||
while (col--) {
|
||||
row = columns[col].length;
|
||||
while (row--) {
|
||||
val = columns[col][row];
|
||||
floatVal = parseFloat(val);
|
||||
trimVal = this.trim(val);
|
||||
|
||||
/*jslint eqeq: true*/
|
||||
if (trimVal == floatVal) { // is numeric
|
||||
/*jslint eqeq: false*/
|
||||
columns[col][row] = floatVal;
|
||||
|
||||
// If the number is greater than milliseconds in a year, assume datetime
|
||||
if (floatVal > 365 * 24 * 3600 * 1000) {
|
||||
columns[col].isDatetime = true;
|
||||
} else {
|
||||
columns[col].isNumeric = true;
|
||||
}
|
||||
|
||||
} else { // string, continue to determine if it is a date string or really a string
|
||||
dateVal = this.parseDate(val);
|
||||
|
||||
if (col === 0 && typeof dateVal === 'number' && !isNaN(dateVal)) { // is date
|
||||
columns[col][row] = dateVal;
|
||||
columns[col].isDatetime = true;
|
||||
|
||||
} else { // string
|
||||
columns[col][row] = trimVal === '' ? null : trimVal;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* A collection of available date formats, extendable from the outside to support
|
||||
* custom date formats.
|
||||
*/
|
||||
dateFormats: {
|
||||
'YYYY-mm-dd': {
|
||||
regex: '^([0-9]{4})-([0-9]{2})-([0-9]{2})$',
|
||||
parser: function (match) {
|
||||
return Date.UTC(+match[1], match[2] - 1, +match[3]);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Parse a date and return it as a number. Overridable through options.parseDate.
|
||||
*/
|
||||
parseDate: function (val) {
|
||||
var parseDate = this.options.parseDate,
|
||||
ret,
|
||||
key,
|
||||
format,
|
||||
match;
|
||||
|
||||
if (parseDate) {
|
||||
ret = parseDate(val);
|
||||
}
|
||||
|
||||
if (typeof val === 'string') {
|
||||
for (key in this.dateFormats) {
|
||||
format = this.dateFormats[key];
|
||||
match = val.match(format.regex);
|
||||
if (match) {
|
||||
ret = format.parser(match);
|
||||
}
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
|
||||
/**
|
||||
* Reorganize rows into columns
|
||||
*/
|
||||
rowsToColumns: function (rows) {
|
||||
var row,
|
||||
rowsLength,
|
||||
col,
|
||||
colsLength,
|
||||
columns;
|
||||
|
||||
if (rows) {
|
||||
columns = [];
|
||||
rowsLength = rows.length;
|
||||
for (row = 0; row < rowsLength; row++) {
|
||||
colsLength = rows[row].length;
|
||||
for (col = 0; col < colsLength; col++) {
|
||||
if (!columns[col]) {
|
||||
columns[col] = [];
|
||||
}
|
||||
columns[col][row] = rows[row][col];
|
||||
}
|
||||
}
|
||||
}
|
||||
return columns;
|
||||
},
|
||||
|
||||
/**
|
||||
* A hook for working directly on the parsed columns
|
||||
*/
|
||||
parsed: function () {
|
||||
if (this.options.parsed) {
|
||||
this.options.parsed.call(this, this.columns);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* If a complete callback function is provided in the options, interpret the
|
||||
* columns into a Highcharts options object.
|
||||
*/
|
||||
complete: function () {
|
||||
|
||||
var columns = this.columns,
|
||||
firstCol,
|
||||
type,
|
||||
options = this.options,
|
||||
valueCount,
|
||||
series,
|
||||
data,
|
||||
i,
|
||||
j,
|
||||
seriesIndex,
|
||||
chartOptions;
|
||||
|
||||
|
||||
if (options.complete || options.afterComplete) {
|
||||
|
||||
this.getColumnDistribution();
|
||||
|
||||
// Use first column for X data or categories?
|
||||
if (columns.length > 1) {
|
||||
firstCol = columns.shift();
|
||||
if (this.headerRow === 0) {
|
||||
firstCol.shift(); // remove the first cell
|
||||
}
|
||||
|
||||
|
||||
if (firstCol.isDatetime) {
|
||||
type = 'datetime';
|
||||
} else if (!firstCol.isNumeric) {
|
||||
type = 'category';
|
||||
}
|
||||
}
|
||||
|
||||
// Get the names and shift the top row
|
||||
for (i = 0; i < columns.length; i++) {
|
||||
if (this.headerRow === 0) {
|
||||
columns[i].name = columns[i].shift();
|
||||
}
|
||||
}
|
||||
|
||||
// Use the next columns for series
|
||||
series = [];
|
||||
for (i = 0, seriesIndex = 0; i < columns.length; seriesIndex++) {
|
||||
|
||||
// This series' value count
|
||||
valueCount = Highcharts.pick(this.valueCount.individual[seriesIndex], this.valueCount.global);
|
||||
|
||||
// Iterate down the cells of each column and add data to the series
|
||||
data = [];
|
||||
|
||||
// Only loop and fill the data series if there are columns available.
|
||||
// We need this check to avoid reading outside the array bounds.
|
||||
if (i + valueCount <= columns.length) {
|
||||
for (j = 0; j < columns[i].length; j++) {
|
||||
data[j] = [
|
||||
firstCol[j],
|
||||
columns[i][j] !== undefined ? columns[i][j] : null
|
||||
];
|
||||
if (valueCount > 1) {
|
||||
data[j].push(columns[i + 1][j] !== undefined ? columns[i + 1][j] : null);
|
||||
}
|
||||
if (valueCount > 2) {
|
||||
data[j].push(columns[i + 2][j] !== undefined ? columns[i + 2][j] : null);
|
||||
}
|
||||
if (valueCount > 3) {
|
||||
data[j].push(columns[i + 3][j] !== undefined ? columns[i + 3][j] : null);
|
||||
}
|
||||
if (valueCount > 4) {
|
||||
data[j].push(columns[i + 4][j] !== undefined ? columns[i + 4][j] : null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add the series
|
||||
series[seriesIndex] = {
|
||||
name: columns[i].name,
|
||||
data: data
|
||||
};
|
||||
|
||||
i += valueCount;
|
||||
}
|
||||
|
||||
// Do the callback
|
||||
chartOptions = {
|
||||
xAxis: {
|
||||
type: type
|
||||
},
|
||||
series: series
|
||||
};
|
||||
if (options.complete) {
|
||||
options.complete(chartOptions);
|
||||
}
|
||||
// The afterComplete hook is used internally to avoid conflict with the externally
|
||||
// available complete option.
|
||||
if (options.afterComplete) {
|
||||
options.afterComplete(chartOptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Register the Data prototype and data function on Highcharts
|
||||
Highcharts.Data = Data;
|
||||
Highcharts.data = function (options, chartOptions) {
|
||||
return new Data(options, chartOptions);
|
||||
};
|
||||
|
||||
// Extend Chart.init so that the Chart constructor accepts a new configuration
|
||||
// option group, data.
|
||||
Highcharts.wrap(Highcharts.Chart.prototype, 'init', function (proceed, userOptions, callback) {
|
||||
var chart = this;
|
||||
|
||||
if (userOptions && userOptions.data) {
|
||||
Highcharts.data(Highcharts.extend(userOptions.data, {
|
||||
afterComplete: function (dataOptions) {
|
||||
var i, series;
|
||||
|
||||
// Merge series configs
|
||||
if (userOptions.hasOwnProperty('series')) {
|
||||
if (typeof userOptions.series === 'object') {
|
||||
i = Math.max(userOptions.series.length, dataOptions.series.length);
|
||||
while (i--) {
|
||||
series = userOptions.series[i] || {};
|
||||
userOptions.series[i] = Highcharts.merge(series, dataOptions.series[i]);
|
||||
}
|
||||
} else { // Allow merging in dataOptions.series (#2856)
|
||||
delete userOptions.series;
|
||||
}
|
||||
}
|
||||
|
||||
// Do the merge
|
||||
userOptions = Highcharts.merge(dataOptions, userOptions);
|
||||
|
||||
proceed.call(chart, userOptions, callback);
|
||||
}
|
||||
}), userOptions);
|
||||
} else {
|
||||
proceed.call(chart, userOptions, callback);
|
||||
}
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,14 @@
|
||||
(function(g){function s(a,b,d){return"rgba("+[Math.round(a[0]+(b[0]-a[0])*d),Math.round(a[1]+(b[1]-a[1])*d),Math.round(a[2]+(b[2]-a[2])*d),a[3]+(b[3]-a[3])*d].join(",")+")"}var t=function(){},o=g.getOptions(),i=g.each,p=g.extend,x=g.format,y=g.pick,q=g.wrap,l=g.Chart,n=g.seriesTypes,u=n.pie,m=n.column,v=HighchartsAdapter.fireEvent,z=HighchartsAdapter.inArray;p(o.lang,{drillUpText:"◁ Back to {series.name}"});o.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},
|
||||
activeDataLabelStyle:{cursor:"pointer",color:"#0d233a",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};g.SVGRenderer.prototype.Element.prototype.fadeIn=function(a){this.attr({opacity:0.1,visibility:"inherit"}).animate({opacity:y(this.newOpacity,1)},a||{duration:250})};l.prototype.addSeriesAsDrilldown=function(a,b){this.addSingleSeriesAsDrilldown(a,b);this.applyDrilldown()};l.prototype.addSingleSeriesAsDrilldown=function(a,
|
||||
b){var d=a.series,c=d.xAxis,f=d.yAxis,h;h=a.color||d.color;var e,w=[],g=[],k;k=d.levelNumber||0;b=p({color:h},b);e=z(a,d.points);i(d.chart.series,function(a){if(a.xAxis===c)w.push(a),g.push(a.userOptions),a.levelNumber=a.levelNumber||0});h={levelNumber:k,seriesOptions:d.userOptions,levelSeriesOptions:g,levelSeries:w,shapeArgs:a.shapeArgs,bBox:a.graphic.getBBox(),color:h,lowerSeriesOptions:b,pointOptions:d.options.data[e],pointIndex:e,oldExtremes:{xMin:c&&c.userMin,xMax:c&&c.userMax,yMin:f&&f.userMin,
|
||||
yMax:f&&f.userMax}};if(!this.drilldownLevels)this.drilldownLevels=[];this.drilldownLevels.push(h);h=h.lowerSeries=this.addSeries(b,!1);h.levelNumber=k+1;if(c)c.oldPos=c.pos,c.userMin=c.userMax=null,f.userMin=f.userMax=null;if(d.type===h.type)h.animate=h.animateDrilldown||t,h.options.animation=!0};l.prototype.applyDrilldown=function(){var a=this.drilldownLevels,b=a[a.length-1].levelNumber;i(this.drilldownLevels,function(a){a.levelNumber===b&&i(a.levelSeries,function(a){a.levelNumber===b&&a.remove(!1)})});
|
||||
this.redraw();this.showDrillUpButton()};l.prototype.getDrilldownBackText=function(){var a=this.drilldownLevels[this.drilldownLevels.length-1];a.series=a.seriesOptions;return x(this.options.lang.drillUpText,a)};l.prototype.showDrillUpButton=function(){var a=this,b=this.getDrilldownBackText(),d=a.options.drilldown.drillUpButton,c,f;this.drillUpButton?this.drillUpButton.attr({text:b}).align():(f=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(b,null,null,function(){a.drillUp()},c,f&&f.hover,
|
||||
f&&f.select).attr({align:d.position.align,zIndex:9}).add().align(d.position,!1,d.relativeTo||"plotBox"))};l.prototype.drillUp=function(){for(var a=this,b=a.drilldownLevels,d=b[b.length-1].levelNumber,c=b.length,f=a.series,h=f.length,e,g,j,k,l=function(b){var c;i(f,function(a){a.userOptions===b&&(c=a)});c=c||a.addSeries(b,!1);if(c.type===g.type&&c.animateDrillupTo)c.animate=c.animateDrillupTo;b===e.seriesOptions&&(j=c)};c--;)if(e=b[c],e.levelNumber===d){b.pop();g=e.lowerSeries;if(!g.chart)for(;h--;)if(f[h].options.id===
|
||||
e.lowerSeriesOptions.id){g=f[h];break}g.xData=[];i(e.levelSeriesOptions,l);v(a,"drillup",{seriesOptions:e.seriesOptions});if(j.type===g.type)j.drilldownLevel=e,j.options.animation=a.options.drilldown.animation,g.animateDrillupFrom&&g.animateDrillupFrom(e);j.levelNumber=d;g.remove(!1);if(j.xAxis)k=e.oldExtremes,j.xAxis.setExtremes(k.xMin,k.xMax,!1),j.yAxis.setExtremes(k.yMin,k.yMax,!1)}this.redraw();this.drilldownLevels.length===0?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align()};
|
||||
m.prototype.supportsDrilldown=!0;m.prototype.animateDrillupTo=function(a){if(!a){var b=this,d=b.drilldownLevel;i(this.points,function(a){a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){i(b.points,function(a,b){var h=b===(d&&d.pointIndex)?"show":"fadeIn",e=h==="show"?!0:void 0;a.graphic[h](e);if(a.dataLabel)a.dataLabel[h](e);if(a.connector)a.connector[h](e)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=t}};m.prototype.animateDrilldown=
|
||||
function(a){var b=this,d=this.chart.drilldownLevels,c=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1].shapeArgs,f=this.chart.options.drilldown.animation;if(!a)i(d,function(a){if(b.userOptions===a.lowerSeriesOptions)c=a.shapeArgs}),c.x+=this.xAxis.oldPos-this.xAxis.pos,i(this.points,function(a){a.graphic&&a.graphic.attr(c).animate(a.shapeArgs,f);a.dataLabel&&a.dataLabel.fadeIn(f)}),this.animate=null};m.prototype.animateDrillupFrom=function(a){var b=this.chart.options.drilldown.animation,
|
||||
d=this.group,c=this;i(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;i(this.points,function(c){var h=c.graphic,e=g.Color(c.color).rgba,i=g.Color(a.color).rgba,j=function(){h.destroy();d&&(d=d.destroy())};h&&(delete c.graphic,b?h.animate(a.shapeArgs,g.merge(b,{step:function(a,b){b.prop==="start"&&e.length===4&&i.length===4&&this.attr({fill:s(e,i,b.pos)})},complete:j})):(h.attr(a.shapeArgs),j()))})};u&&p(u.prototype,{supportsDrilldown:!0,animateDrillupTo:m.prototype.animateDrillupTo,
|
||||
animateDrillupFrom:m.prototype.animateDrillupFrom,animateDrilldown:function(a){var b=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=this.chart.options.drilldown.animation,c=b.shapeArgs,f=c.start,h=(c.end-f)/this.points.length,e=g.Color(b.color).rgba;if(!a)i(this.points,function(a,b){var i=g.Color(a.color).rgba;a.graphic.attr(g.merge(c,{start:f+b*h,end:f+(b+1)*h}))[d?"animate":"attr"](a.shapeArgs,g.merge(d,{step:function(a,b){b.prop==="start"&&e.length===4&&i.length===4&&this.attr({fill:s(e,
|
||||
i,b.pos)})}}))}),this.animate=null}});g.Point.prototype.doDrilldown=function(a){for(var b=this.series.chart,d=b.options.drilldown,c=(d.series||[]).length,f;c--&&!f;)d.series[c].id===this.drilldown&&(f=d.series[c]);v(b,"drilldown",{point:this,seriesOptions:f});f&&(a?b.addSingleSeriesAsDrilldown(this,f):b.addSeriesAsDrilldown(this,f))};q(g.Point.prototype,"init",function(a,b,d,c){var f=a.call(this,b,d,c),h=b.chart,e=(a=b.xAxis&&b.xAxis.ticks[c])&&a.label;if(f.drilldown){if(g.addEvent(f,"click",function(){f.doDrilldown()}),
|
||||
e){if(!e._basicStyle)e._basicStyle=e.element.getAttribute("style");e.addClass("highcharts-drilldown-axis-label").css(h.options.drilldown.activeAxisLabelStyle).on("click",function(){i(e.ddPoints,function(a){a.doDrilldown&&a.doDrilldown(!0)});h.applyDrilldown()});if(!e.ddPoints)e.ddPoints=[];e.ddPoints.push(f)}}else e&&e._basicStyle&&e.element.setAttribute("style",e._basicStyle);return f});q(g.Series.prototype,"drawDataLabels",function(a){var b=this.chart.options.drilldown.activeDataLabelStyle;a.call(this);
|
||||
i(this.points,function(a){if(a.drilldown&&a.dataLabel)a.dataLabel.attr({"class":"highcharts-drilldown-data-label"}).css(b).on("click",function(){a.doDrilldown()})})});var r,o=function(a){a.call(this);i(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.attr({"class":"highcharts-drilldown-point"}).css({cursor:"pointer"})})};for(r in n)n[r].prototype.supportsDrilldown&&q(n[r].prototype,"drawTracker",o)})(Highcharts);
|
||||
@@ -0,0 +1,586 @@
|
||||
/**
|
||||
* Highcharts Drilldown plugin
|
||||
*
|
||||
* Author: Torstein Honsi
|
||||
* License: MIT License
|
||||
*
|
||||
* Demo: http://jsfiddle.net/highcharts/Vf3yT/
|
||||
*/
|
||||
|
||||
/*global HighchartsAdapter*/
|
||||
(function (H) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var noop = function () {},
|
||||
defaultOptions = H.getOptions(),
|
||||
each = H.each,
|
||||
extend = H.extend,
|
||||
format = H.format,
|
||||
pick = H.pick,
|
||||
wrap = H.wrap,
|
||||
Chart = H.Chart,
|
||||
seriesTypes = H.seriesTypes,
|
||||
PieSeries = seriesTypes.pie,
|
||||
ColumnSeries = seriesTypes.column,
|
||||
fireEvent = HighchartsAdapter.fireEvent,
|
||||
inArray = HighchartsAdapter.inArray;
|
||||
|
||||
// Utilities
|
||||
function tweenColors(startColor, endColor, pos) {
|
||||
var rgba = [
|
||||
Math.round(startColor[0] + (endColor[0] - startColor[0]) * pos),
|
||||
Math.round(startColor[1] + (endColor[1] - startColor[1]) * pos),
|
||||
Math.round(startColor[2] + (endColor[2] - startColor[2]) * pos),
|
||||
startColor[3] + (endColor[3] - startColor[3]) * pos
|
||||
];
|
||||
return 'rgba(' + rgba.join(',') + ')';
|
||||
}
|
||||
|
||||
// Add language
|
||||
extend(defaultOptions.lang, {
|
||||
drillUpText: '◁ Back to {series.name}'
|
||||
});
|
||||
defaultOptions.drilldown = {
|
||||
activeAxisLabelStyle: {
|
||||
cursor: 'pointer',
|
||||
color: '#0d233a',
|
||||
fontWeight: 'bold',
|
||||
textDecoration: 'underline'
|
||||
},
|
||||
activeDataLabelStyle: {
|
||||
cursor: 'pointer',
|
||||
color: '#0d233a',
|
||||
fontWeight: 'bold',
|
||||
textDecoration: 'underline'
|
||||
},
|
||||
animation: {
|
||||
duration: 500
|
||||
},
|
||||
drillUpButton: {
|
||||
position: {
|
||||
align: 'right',
|
||||
x: -10,
|
||||
y: 10
|
||||
}
|
||||
// relativeTo: 'plotBox'
|
||||
// theme
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A general fadeIn method
|
||||
*/
|
||||
H.SVGRenderer.prototype.Element.prototype.fadeIn = function (animation) {
|
||||
this
|
||||
.attr({
|
||||
opacity: 0.1,
|
||||
visibility: 'inherit'
|
||||
})
|
||||
.animate({
|
||||
opacity: pick(this.newOpacity, 1) // newOpacity used in maps
|
||||
}, animation || {
|
||||
duration: 250
|
||||
});
|
||||
};
|
||||
|
||||
Chart.prototype.addSeriesAsDrilldown = function (point, ddOptions) {
|
||||
this.addSingleSeriesAsDrilldown(point, ddOptions);
|
||||
this.applyDrilldown();
|
||||
};
|
||||
Chart.prototype.addSingleSeriesAsDrilldown = function (point, ddOptions) {
|
||||
var oldSeries = point.series,
|
||||
xAxis = oldSeries.xAxis,
|
||||
yAxis = oldSeries.yAxis,
|
||||
newSeries,
|
||||
color = point.color || oldSeries.color,
|
||||
pointIndex,
|
||||
levelSeries = [],
|
||||
levelSeriesOptions = [],
|
||||
level,
|
||||
levelNumber;
|
||||
|
||||
levelNumber = oldSeries.levelNumber || 0;
|
||||
|
||||
ddOptions = extend({
|
||||
color: color
|
||||
}, ddOptions);
|
||||
pointIndex = inArray(point, oldSeries.points);
|
||||
|
||||
// Record options for all current series
|
||||
each(oldSeries.chart.series, function (series) {
|
||||
if (series.xAxis === xAxis) {
|
||||
levelSeries.push(series);
|
||||
levelSeriesOptions.push(series.userOptions);
|
||||
series.levelNumber = series.levelNumber || 0;
|
||||
}
|
||||
});
|
||||
|
||||
// Add a record of properties for each drilldown level
|
||||
level = {
|
||||
levelNumber: levelNumber,
|
||||
seriesOptions: oldSeries.userOptions,
|
||||
levelSeriesOptions: levelSeriesOptions,
|
||||
levelSeries: levelSeries,
|
||||
shapeArgs: point.shapeArgs,
|
||||
bBox: point.graphic.getBBox(),
|
||||
color: color,
|
||||
lowerSeriesOptions: ddOptions,
|
||||
pointOptions: oldSeries.options.data[pointIndex],
|
||||
pointIndex: pointIndex,
|
||||
oldExtremes: {
|
||||
xMin: xAxis && xAxis.userMin,
|
||||
xMax: xAxis && xAxis.userMax,
|
||||
yMin: yAxis && yAxis.userMin,
|
||||
yMax: yAxis && yAxis.userMax
|
||||
}
|
||||
};
|
||||
|
||||
// Generate and push it to a lookup array
|
||||
if (!this.drilldownLevels) {
|
||||
this.drilldownLevels = [];
|
||||
}
|
||||
this.drilldownLevels.push(level);
|
||||
|
||||
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
|
||||
newSeries.levelNumber = levelNumber + 1;
|
||||
if (xAxis) {
|
||||
xAxis.oldPos = xAxis.pos;
|
||||
xAxis.userMin = xAxis.userMax = null;
|
||||
yAxis.userMin = yAxis.userMax = null;
|
||||
}
|
||||
|
||||
// Run fancy cross-animation on supported and equal types
|
||||
if (oldSeries.type === newSeries.type) {
|
||||
newSeries.animate = newSeries.animateDrilldown || noop;
|
||||
newSeries.options.animation = true;
|
||||
}
|
||||
};
|
||||
|
||||
Chart.prototype.applyDrilldown = function () {
|
||||
var drilldownLevels = this.drilldownLevels,
|
||||
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
|
||||
|
||||
each(this.drilldownLevels, function (level) {
|
||||
if (level.levelNumber === levelToRemove) {
|
||||
each(level.levelSeries, function (series) {
|
||||
if (series.levelNumber === levelToRemove) { // Not removed, not added as part of a multi-series drilldown
|
||||
series.remove(false);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.redraw();
|
||||
this.showDrillUpButton();
|
||||
};
|
||||
|
||||
Chart.prototype.getDrilldownBackText = function () {
|
||||
var lastLevel = this.drilldownLevels[this.drilldownLevels.length - 1];
|
||||
lastLevel.series = lastLevel.seriesOptions;
|
||||
return format(this.options.lang.drillUpText, lastLevel);
|
||||
|
||||
};
|
||||
|
||||
Chart.prototype.showDrillUpButton = function () {
|
||||
var chart = this,
|
||||
backText = this.getDrilldownBackText(),
|
||||
buttonOptions = chart.options.drilldown.drillUpButton,
|
||||
attr,
|
||||
states;
|
||||
|
||||
|
||||
if (!this.drillUpButton) {
|
||||
attr = buttonOptions.theme;
|
||||
states = attr && attr.states;
|
||||
|
||||
this.drillUpButton = this.renderer.button(
|
||||
backText,
|
||||
null,
|
||||
null,
|
||||
function () {
|
||||
chart.drillUp();
|
||||
},
|
||||
attr,
|
||||
states && states.hover,
|
||||
states && states.select
|
||||
)
|
||||
.attr({
|
||||
align: buttonOptions.position.align,
|
||||
zIndex: 9
|
||||
})
|
||||
.add()
|
||||
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
|
||||
} else {
|
||||
this.drillUpButton.attr({
|
||||
text: backText
|
||||
})
|
||||
.align();
|
||||
}
|
||||
};
|
||||
|
||||
Chart.prototype.drillUp = function () {
|
||||
var chart = this,
|
||||
drilldownLevels = chart.drilldownLevels,
|
||||
levelNumber = drilldownLevels[drilldownLevels.length - 1].levelNumber,
|
||||
i = drilldownLevels.length,
|
||||
chartSeries = chart.series,
|
||||
seriesI = chartSeries.length,
|
||||
level,
|
||||
oldSeries,
|
||||
newSeries,
|
||||
oldExtremes,
|
||||
addSeries = function (seriesOptions) {
|
||||
var addedSeries;
|
||||
each(chartSeries, function (series) {
|
||||
if (series.userOptions === seriesOptions) {
|
||||
addedSeries = series;
|
||||
}
|
||||
});
|
||||
|
||||
addedSeries = addedSeries || chart.addSeries(seriesOptions, false);
|
||||
if (addedSeries.type === oldSeries.type && addedSeries.animateDrillupTo) {
|
||||
addedSeries.animate = addedSeries.animateDrillupTo;
|
||||
}
|
||||
if (seriesOptions === level.seriesOptions) {
|
||||
newSeries = addedSeries;
|
||||
}
|
||||
};
|
||||
|
||||
while (i--) {
|
||||
|
||||
level = drilldownLevels[i];
|
||||
if (level.levelNumber === levelNumber) {
|
||||
drilldownLevels.pop();
|
||||
|
||||
// Get the lower series by reference or id
|
||||
oldSeries = level.lowerSeries;
|
||||
if (!oldSeries.chart) { // #2786
|
||||
while (seriesI--) {
|
||||
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id) {
|
||||
oldSeries = chartSeries[seriesI];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
oldSeries.xData = []; // Overcome problems with minRange (#2898)
|
||||
|
||||
each(level.levelSeriesOptions, addSeries);
|
||||
|
||||
fireEvent(chart, 'drillup', { seriesOptions: level.seriesOptions });
|
||||
|
||||
if (newSeries.type === oldSeries.type) {
|
||||
newSeries.drilldownLevel = level;
|
||||
newSeries.options.animation = chart.options.drilldown.animation;
|
||||
|
||||
if (oldSeries.animateDrillupFrom) {
|
||||
oldSeries.animateDrillupFrom(level);
|
||||
}
|
||||
}
|
||||
newSeries.levelNumber = levelNumber;
|
||||
|
||||
oldSeries.remove(false);
|
||||
|
||||
// Reset the zoom level of the upper series
|
||||
if (newSeries.xAxis) {
|
||||
oldExtremes = level.oldExtremes;
|
||||
newSeries.xAxis.setExtremes(oldExtremes.xMin, oldExtremes.xMax, false);
|
||||
newSeries.yAxis.setExtremes(oldExtremes.yMin, oldExtremes.yMax, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.redraw();
|
||||
|
||||
if (this.drilldownLevels.length === 0) {
|
||||
this.drillUpButton = this.drillUpButton.destroy();
|
||||
} else {
|
||||
this.drillUpButton.attr({
|
||||
text: this.getDrilldownBackText()
|
||||
})
|
||||
.align();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
ColumnSeries.prototype.supportsDrilldown = true;
|
||||
|
||||
/**
|
||||
* When drilling up, keep the upper series invisible until the lower series has
|
||||
* moved into place
|
||||
*/
|
||||
ColumnSeries.prototype.animateDrillupTo = function (init) {
|
||||
if (!init) {
|
||||
var newSeries = this,
|
||||
level = newSeries.drilldownLevel;
|
||||
|
||||
each(this.points, function (point) {
|
||||
point.graphic.hide();
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel.hide();
|
||||
}
|
||||
if (point.connector) {
|
||||
point.connector.hide();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// Do dummy animation on first point to get to complete
|
||||
setTimeout(function () {
|
||||
each(newSeries.points, function (point, i) {
|
||||
// Fade in other points
|
||||
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
|
||||
inherit = verb === 'show' ? true : undefined;
|
||||
point.graphic[verb](inherit);
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel[verb](inherit);
|
||||
}
|
||||
if (point.connector) {
|
||||
point.connector[verb](inherit);
|
||||
}
|
||||
});
|
||||
}, Math.max(this.chart.options.drilldown.animation.duration - 50, 0));
|
||||
|
||||
// Reset
|
||||
this.animate = noop;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
ColumnSeries.prototype.animateDrilldown = function (init) {
|
||||
var series = this,
|
||||
drilldownLevels = this.chart.drilldownLevels,
|
||||
animateFrom = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1].shapeArgs,
|
||||
animationOptions = this.chart.options.drilldown.animation;
|
||||
|
||||
if (!init) {
|
||||
each(drilldownLevels, function (level) {
|
||||
if (series.userOptions === level.lowerSeriesOptions) {
|
||||
animateFrom = level.shapeArgs;
|
||||
}
|
||||
});
|
||||
|
||||
animateFrom.x += (this.xAxis.oldPos - this.xAxis.pos);
|
||||
|
||||
each(this.points, function (point) {
|
||||
if (point.graphic) {
|
||||
point.graphic
|
||||
.attr(animateFrom)
|
||||
.animate(point.shapeArgs, animationOptions);
|
||||
}
|
||||
if (point.dataLabel) {
|
||||
point.dataLabel.fadeIn(animationOptions);
|
||||
}
|
||||
});
|
||||
this.animate = null;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* When drilling up, pull out the individual point graphics from the lower series
|
||||
* and animate them into the origin point in the upper series.
|
||||
*/
|
||||
ColumnSeries.prototype.animateDrillupFrom = function (level) {
|
||||
var animationOptions = this.chart.options.drilldown.animation,
|
||||
group = this.group,
|
||||
series = this;
|
||||
|
||||
// Cancel mouse events on the series group (#2787)
|
||||
each(series.trackerGroups, function (key) {
|
||||
if (series[key]) { // we don't always have dataLabelsGroup
|
||||
series[key].on('mouseover');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
delete this.group;
|
||||
each(this.points, function (point) {
|
||||
var graphic = point.graphic,
|
||||
startColor = H.Color(point.color).rgba,
|
||||
endColor = H.Color(level.color).rgba,
|
||||
complete = function () {
|
||||
graphic.destroy();
|
||||
if (group) {
|
||||
group = group.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
if (graphic) {
|
||||
|
||||
delete point.graphic;
|
||||
|
||||
if (animationOptions) {
|
||||
/*jslint unparam: true*/
|
||||
graphic.animate(level.shapeArgs, H.merge(animationOptions, {
|
||||
step: function (val, fx) {
|
||||
if (fx.prop === 'start' && startColor.length === 4 && endColor.length === 4) {
|
||||
this.attr({
|
||||
fill: tweenColors(startColor, endColor, fx.pos)
|
||||
});
|
||||
}
|
||||
},
|
||||
complete: complete
|
||||
}));
|
||||
/*jslint unparam: false*/
|
||||
} else {
|
||||
graphic.attr(level.shapeArgs);
|
||||
complete();
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
if (PieSeries) {
|
||||
extend(PieSeries.prototype, {
|
||||
supportsDrilldown: true,
|
||||
animateDrillupTo: ColumnSeries.prototype.animateDrillupTo,
|
||||
animateDrillupFrom: ColumnSeries.prototype.animateDrillupFrom,
|
||||
|
||||
animateDrilldown: function (init) {
|
||||
var level = this.chart.drilldownLevels[this.chart.drilldownLevels.length - 1],
|
||||
animationOptions = this.chart.options.drilldown.animation,
|
||||
animateFrom = level.shapeArgs,
|
||||
start = animateFrom.start,
|
||||
angle = animateFrom.end - start,
|
||||
startAngle = angle / this.points.length,
|
||||
startColor = H.Color(level.color).rgba;
|
||||
|
||||
if (!init) {
|
||||
each(this.points, function (point, i) {
|
||||
var endColor = H.Color(point.color).rgba;
|
||||
|
||||
/*jslint unparam: true*/
|
||||
point.graphic
|
||||
.attr(H.merge(animateFrom, {
|
||||
start: start + i * startAngle,
|
||||
end: start + (i + 1) * startAngle
|
||||
}))[animationOptions ? 'animate' : 'attr'](point.shapeArgs, H.merge(animationOptions, {
|
||||
step: function (val, fx) {
|
||||
if (fx.prop === 'start' && startColor.length === 4 && endColor.length === 4) {
|
||||
this.attr({
|
||||
fill: tweenColors(startColor, endColor, fx.pos)
|
||||
});
|
||||
}
|
||||
}
|
||||
}));
|
||||
/*jslint unparam: false*/
|
||||
});
|
||||
this.animate = null;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
H.Point.prototype.doDrilldown = function (_holdRedraw) {
|
||||
var series = this.series,
|
||||
chart = series.chart,
|
||||
drilldown = chart.options.drilldown,
|
||||
i = (drilldown.series || []).length,
|
||||
seriesOptions;
|
||||
|
||||
while (i-- && !seriesOptions) {
|
||||
if (drilldown.series[i].id === this.drilldown) {
|
||||
seriesOptions = drilldown.series[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Fire the event. If seriesOptions is undefined, the implementer can check for
|
||||
// seriesOptions, and call addSeriesAsDrilldown async if necessary.
|
||||
fireEvent(chart, 'drilldown', {
|
||||
point: this,
|
||||
seriesOptions: seriesOptions
|
||||
});
|
||||
|
||||
if (seriesOptions) {
|
||||
if (_holdRedraw) {
|
||||
chart.addSingleSeriesAsDrilldown(this, seriesOptions);
|
||||
} else {
|
||||
chart.addSeriesAsDrilldown(this, seriesOptions);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
wrap(H.Point.prototype, 'init', function (proceed, series, options, x) {
|
||||
var point = proceed.call(this, series, options, x),
|
||||
chart = series.chart,
|
||||
tick = series.xAxis && series.xAxis.ticks[x],
|
||||
tickLabel = tick && tick.label;
|
||||
|
||||
if (point.drilldown) {
|
||||
|
||||
// Add the click event to the point label
|
||||
H.addEvent(point, 'click', function () {
|
||||
point.doDrilldown();
|
||||
});
|
||||
|
||||
// Make axis labels clickable
|
||||
if (tickLabel) {
|
||||
if (!tickLabel._basicStyle) {
|
||||
tickLabel._basicStyle = tickLabel.element.getAttribute('style');
|
||||
}
|
||||
tickLabel
|
||||
.addClass('highcharts-drilldown-axis-label')
|
||||
.css(chart.options.drilldown.activeAxisLabelStyle)
|
||||
.on('click', function () {
|
||||
each(tickLabel.ddPoints, function (point) {
|
||||
if (point.doDrilldown) {
|
||||
point.doDrilldown(true);
|
||||
}
|
||||
});
|
||||
chart.applyDrilldown();
|
||||
});
|
||||
if (!tickLabel.ddPoints) {
|
||||
tickLabel.ddPoints = [];
|
||||
}
|
||||
tickLabel.ddPoints.push(point);
|
||||
|
||||
}
|
||||
} else if (tickLabel && tickLabel._basicStyle) {
|
||||
tickLabel.element.setAttribute('style', tickLabel._basicStyle);
|
||||
}
|
||||
|
||||
return point;
|
||||
});
|
||||
|
||||
wrap(H.Series.prototype, 'drawDataLabels', function (proceed) {
|
||||
var css = this.chart.options.drilldown.activeDataLabelStyle;
|
||||
|
||||
proceed.call(this);
|
||||
|
||||
each(this.points, function (point) {
|
||||
if (point.drilldown && point.dataLabel) {
|
||||
point.dataLabel
|
||||
.attr({
|
||||
'class': 'highcharts-drilldown-data-label'
|
||||
})
|
||||
.css(css)
|
||||
.on('click', function () {
|
||||
point.doDrilldown();
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// Mark the trackers with a pointer
|
||||
var type,
|
||||
drawTrackerWrapper = function (proceed) {
|
||||
proceed.call(this);
|
||||
each(this.points, function (point) {
|
||||
if (point.drilldown && point.graphic) {
|
||||
point.graphic
|
||||
.attr({
|
||||
'class': 'highcharts-drilldown-point'
|
||||
})
|
||||
.css({ cursor: 'pointer' });
|
||||
}
|
||||
});
|
||||
};
|
||||
for (type in seriesTypes) {
|
||||
if (seriesTypes[type].prototype.supportsDrilldown) {
|
||||
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
Exporting module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(f){var A=f.Chart,t=f.addEvent,B=f.removeEvent,l=f.createElement,o=f.discardElement,v=f.css,k=f.merge,r=f.each,p=f.extend,D=Math.max,j=document,C=window,E=f.isTouchDevice,F=f.Renderer.prototype.symbols,s=f.getOptions(),y;p(s.lang,{printChart:"Print chart",downloadPNG:"Download PNG image",downloadJPEG:"Download JPEG image",downloadPDF:"Download PDF document",downloadSVG:"Download SVG vector image",contextButtonTitle:"Chart context menu"});s.navigation={menuStyle:{border:"1px solid #A0A0A0",
|
||||
background:"#FFFFFF",padding:"5px 0"},menuItemStyle:{padding:"0 10px",background:"none",color:"#303030",fontSize:E?"14px":"11px"},menuItemHoverStyle:{background:"#4572A5",color:"#FFFFFF"},buttonOptions:{symbolFill:"#E0E0E0",symbolSize:14,symbolStroke:"#666",symbolStrokeWidth:3,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,theme:{fill:"white",stroke:"none"},verticalAlign:"top",width:24}};s.exporting={type:"image/png",url:"http://export.highcharts.com/",buttons:{contextButton:{menuClassName:"highcharts-contextmenu",
|
||||
symbol:"menu",_titleKey:"contextButtonTitle",menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChart()}},{textKey:"downloadJPEG",onclick:function(){this.exportChart({type:"image/jpeg"})}},{textKey:"downloadPDF",onclick:function(){this.exportChart({type:"application/pdf"})}},{textKey:"downloadSVG",onclick:function(){this.exportChart({type:"image/svg+xml"})}}]}}};f.post=function(b,a,d){var c,b=l("form",k({method:"post",
|
||||
action:b,enctype:"multipart/form-data"},d),{display:"none"},j.body);for(c in a)l("input",{type:"hidden",name:c,value:a[c]},null,b);b.submit();o(b)};p(A.prototype,{getSVG:function(b){var a=this,d,c,z,h,g=k(a.options,b);if(!j.createElementNS)j.createElementNS=function(a,b){return j.createElement(b)};b=l("div",null,{position:"absolute",top:"-9999em",width:a.chartWidth+"px",height:a.chartHeight+"px"},j.body);c=a.renderTo.style.width;h=a.renderTo.style.height;c=g.exporting.sourceWidth||g.chart.width||
|
||||
/px$/.test(c)&&parseInt(c,10)||600;h=g.exporting.sourceHeight||g.chart.height||/px$/.test(h)&&parseInt(h,10)||400;p(g.chart,{animation:!1,renderTo:b,forExport:!0,width:c,height:h});g.exporting.enabled=!1;g.series=[];r(a.series,function(a){z=k(a.options,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});z.isInternal||g.series.push(z)});d=new f.Chart(g,a.callback);r(["xAxis","yAxis"],function(b){r(a[b],function(a,c){var g=d[b][c],f=a.getExtremes(),h=f.userMin,f=f.userMax;g&&(h!==
|
||||
void 0||f!==void 0)&&g.setExtremes(h,f,!0,!1)})});c=d.container.innerHTML;g=null;d.destroy();o(b);c=c.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ href=/g," xlink:href=").replace(/\n/," ").replace(/<\/svg>.*?$/,"</svg>").replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g,'$1="rgb($2)" $1-opacity="$3"').replace(/ /g,
|
||||
" ").replace(/­/g,"").replace(/<IMG /g,"<image ").replace(/height=([^" ]+)/g,'height="$1"').replace(/width=([^" ]+)/g,'width="$1"').replace(/hc-svg-href="([^"]+)">/g,'xlink:href="$1"/>').replace(/id=([^" >]+)/g,'id="$1"').replace(/class=([^" >]+)/g,'class="$1"').replace(/ transform /g," ").replace(/:(path|rect)/g,"$1").replace(/style="([^"]+)"/g,function(a){return a.toLowerCase()});return c=c.replace(/(url\(#highcharts-[0-9]+)"/g,"$1").replace(/"/g,"'")},exportChart:function(b,a){var b=
|
||||
b||{},d=this.options.exporting,d=this.getSVG(k({chart:{borderRadius:0}},d.chartOptions,a,{exporting:{sourceWidth:b.sourceWidth||d.sourceWidth,sourceHeight:b.sourceHeight||d.sourceHeight}})),b=k(this.options.exporting,b);f.post(b.url,{filename:b.filename||"chart",type:b.type,width:b.width||0,scale:b.scale||2,svg:d},b.formAttributes)},print:function(){var b=this,a=b.container,d=[],c=a.parentNode,f=j.body,h=f.childNodes;if(!b.isPrinting)b.isPrinting=!0,r(h,function(a,b){if(a.nodeType===1)d[b]=a.style.display,
|
||||
a.style.display="none"}),f.appendChild(a),C.focus(),C.print(),setTimeout(function(){c.appendChild(a);r(h,function(a,b){if(a.nodeType===1)a.style.display=d[b]});b.isPrinting=!1},1E3)},contextMenu:function(b,a,d,c,f,h,g){var e=this,k=e.options.navigation,q=k.menuItemStyle,m=e.chartWidth,n=e.chartHeight,j="cache-"+b,i=e[j],u=D(f,h),w,x,o,s=function(a){e.pointer.inClass(a.target,b)||x()};if(!i)e[j]=i=l("div",{className:b},{position:"absolute",zIndex:1E3,padding:u+"px"},e.container),w=l("div",null,p({MozBoxShadow:"3px 3px 10px #888",
|
||||
WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},k.menuStyle),i),x=function(){v(i,{display:"none"});g&&g.setState(0);e.openMenu=!1},t(i,"mouseleave",function(){o=setTimeout(x,500)}),t(i,"mouseenter",function(){clearTimeout(o)}),t(document,"mouseup",s),t(e,"destroy",function(){B(document,"mouseup",s)}),r(a,function(a){if(a){var b=a.separator?l("hr",null,null,w):l("div",{onmouseover:function(){v(this,k.menuItemHoverStyle)},onmouseout:function(){v(this,q)},onclick:function(){x();a.onclick.apply(e,
|
||||
arguments)},innerHTML:a.text||e.options.lang[a.textKey]},p({cursor:"pointer"},q),w);e.exportDivElements.push(b)}}),e.exportDivElements.push(w,i),e.exportMenuWidth=i.offsetWidth,e.exportMenuHeight=i.offsetHeight;a={display:"block"};d+e.exportMenuWidth>m?a.right=m-d-f-u+"px":a.left=d-u+"px";c+h+e.exportMenuHeight>n&&g.alignOptions.verticalAlign!=="top"?a.bottom=n-c-u+"px":a.top=c+h-u+"px";v(i,a);e.openMenu=!0},addButton:function(b){var a=this,d=a.renderer,c=k(a.options.navigation.buttonOptions,b),j=
|
||||
c.onclick,h=c.menuItems,g,e,l={stroke:c.symbolStroke,fill:c.symbolFill},q=c.symbolSize||12;if(!a.btnCount)a.btnCount=0;if(!a.exportDivElements)a.exportDivElements=[],a.exportSVGElements=[];if(c.enabled!==!1){var m=c.theme,n=m.states,o=n&&n.hover,n=n&&n.select,i;delete m.states;j?i=function(){j.apply(a,arguments)}:h&&(i=function(){a.contextMenu(e.menuClassName,h,e.translateX,e.translateY,e.width,e.height,e);e.setState(2)});c.text&&c.symbol?m.paddingLeft=f.pick(m.paddingLeft,25):c.text||p(m,{width:c.width,
|
||||
height:c.height,padding:0});e=d.button(c.text,0,0,i,m,o,n).attr({title:a.options.lang[c._titleKey],"stroke-linecap":"round"});e.menuClassName=b.menuClassName||"highcharts-menu-"+a.btnCount++;c.symbol&&(g=d.symbol(c.symbol,c.symbolX-q/2,c.symbolY-q/2,q,q).attr(p(l,{"stroke-width":c.symbolStrokeWidth||1,zIndex:1})).add(e));e.add().align(p(c,{width:e.width,x:f.pick(c.x,y)}),!0,"spacingBox");y+=(e.width+c.buttonSpacing)*(c.align==="right"?-1:1);a.exportSVGElements.push(e,g)}},destroyExport:function(b){var b=
|
||||
b.target,a,d;for(a=0;a<b.exportSVGElements.length;a++)if(d=b.exportSVGElements[a])d.onclick=d.ontouchstart=null,b.exportSVGElements[a]=d.destroy();for(a=0;a<b.exportDivElements.length;a++)d=b.exportDivElements[a],B(d,"mouseleave"),b.exportDivElements[a]=d.onmouseout=d.onmouseover=d.ontouchstart=d.onclick=null,o(d)}});F.menu=function(b,a,d,c){return["M",b,a+2.5,"L",b+d,a+2.5,"M",b,a+c/2+0.5,"L",b+d,a+c/2+0.5,"M",b,a+c-1.5,"L",b+d,a+c-1.5]};A.prototype.callbacks.push(function(b){var a,d=b.options.exporting,
|
||||
c=d.buttons;y=0;if(d.enabled!==!1){for(a in c)b.addButton(c[a]);t(b,"destroy",b.destroyExport)}})})(Highcharts);
|
||||
@@ -0,0 +1,719 @@
|
||||
/**
|
||||
* @license Highcharts JS v4.0.3 (2014-07-03)
|
||||
* Exporting module
|
||||
*
|
||||
* (c) 2010-2014 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
// JSLint options:
|
||||
/*global Highcharts, document, window, Math, setTimeout */
|
||||
|
||||
(function (Highcharts) { // encapsulate
|
||||
|
||||
// create shortcuts
|
||||
var Chart = Highcharts.Chart,
|
||||
addEvent = Highcharts.addEvent,
|
||||
removeEvent = Highcharts.removeEvent,
|
||||
createElement = Highcharts.createElement,
|
||||
discardElement = Highcharts.discardElement,
|
||||
css = Highcharts.css,
|
||||
merge = Highcharts.merge,
|
||||
each = Highcharts.each,
|
||||
extend = Highcharts.extend,
|
||||
math = Math,
|
||||
mathMax = math.max,
|
||||
doc = document,
|
||||
win = window,
|
||||
isTouchDevice = Highcharts.isTouchDevice,
|
||||
M = 'M',
|
||||
L = 'L',
|
||||
DIV = 'div',
|
||||
HIDDEN = 'hidden',
|
||||
NONE = 'none',
|
||||
PREFIX = 'highcharts-',
|
||||
ABSOLUTE = 'absolute',
|
||||
PX = 'px',
|
||||
UNDEFINED,
|
||||
symbols = Highcharts.Renderer.prototype.symbols,
|
||||
defaultOptions = Highcharts.getOptions(),
|
||||
buttonOffset;
|
||||
|
||||
// Add language
|
||||
extend(defaultOptions.lang, {
|
||||
printChart: 'Print chart',
|
||||
downloadPNG: 'Download PNG image',
|
||||
downloadJPEG: 'Download JPEG image',
|
||||
downloadPDF: 'Download PDF document',
|
||||
downloadSVG: 'Download SVG vector image',
|
||||
contextButtonTitle: 'Chart context menu'
|
||||
});
|
||||
|
||||
// Buttons and menus are collected in a separate config option set called 'navigation'.
|
||||
// This can be extended later to add control buttons like zoom and pan right click menus.
|
||||
defaultOptions.navigation = {
|
||||
menuStyle: {
|
||||
border: '1px solid #A0A0A0',
|
||||
background: '#FFFFFF',
|
||||
padding: '5px 0'
|
||||
},
|
||||
menuItemStyle: {
|
||||
padding: '0 10px',
|
||||
background: NONE,
|
||||
color: '#303030',
|
||||
fontSize: isTouchDevice ? '14px' : '11px'
|
||||
},
|
||||
menuItemHoverStyle: {
|
||||
background: '#4572A5',
|
||||
color: '#FFFFFF'
|
||||
},
|
||||
|
||||
buttonOptions: {
|
||||
symbolFill: '#E0E0E0',
|
||||
symbolSize: 14,
|
||||
symbolStroke: '#666',
|
||||
symbolStrokeWidth: 3,
|
||||
symbolX: 12.5,
|
||||
symbolY: 10.5,
|
||||
align: 'right',
|
||||
buttonSpacing: 3,
|
||||
height: 22,
|
||||
// text: null,
|
||||
theme: {
|
||||
fill: 'white', // capture hover
|
||||
stroke: 'none'
|
||||
},
|
||||
verticalAlign: 'top',
|
||||
width: 24
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
// Add the export related options
|
||||
defaultOptions.exporting = {
|
||||
//enabled: true,
|
||||
//filename: 'chart',
|
||||
type: 'image/png',
|
||||
url: 'http://export.highcharts.com/',
|
||||
//width: undefined,
|
||||
//scale: 2
|
||||
buttons: {
|
||||
contextButton: {
|
||||
menuClassName: PREFIX + 'contextmenu',
|
||||
//x: -10,
|
||||
symbol: 'menu',
|
||||
_titleKey: 'contextButtonTitle',
|
||||
menuItems: [{
|
||||
textKey: 'printChart',
|
||||
onclick: function () {
|
||||
this.print();
|
||||
}
|
||||
}, {
|
||||
separator: true
|
||||
}, {
|
||||
textKey: 'downloadPNG',
|
||||
onclick: function () {
|
||||
this.exportChart();
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadJPEG',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadPDF',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'application/pdf'
|
||||
});
|
||||
}
|
||||
}, {
|
||||
textKey: 'downloadSVG',
|
||||
onclick: function () {
|
||||
this.exportChart({
|
||||
type: 'image/svg+xml'
|
||||
});
|
||||
}
|
||||
}
|
||||
// Enable this block to add "View SVG" to the dropdown menu
|
||||
/*
|
||||
,{
|
||||
|
||||
text: 'View SVG',
|
||||
onclick: function () {
|
||||
var svg = this.getSVG()
|
||||
.replace(/</g, '\n<')
|
||||
.replace(/>/g, '>');
|
||||
|
||||
doc.body.innerHTML = '<pre>' + svg + '</pre>';
|
||||
}
|
||||
} // */
|
||||
]
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Add the Highcharts.post utility
|
||||
Highcharts.post = function (url, data, formAttributes) {
|
||||
var name,
|
||||
form;
|
||||
|
||||
// create the form
|
||||
form = createElement('form', merge({
|
||||
method: 'post',
|
||||
action: url,
|
||||
enctype: 'multipart/form-data'
|
||||
}, formAttributes), {
|
||||
display: NONE
|
||||
}, doc.body);
|
||||
|
||||
// add the data
|
||||
for (name in data) {
|
||||
createElement('input', {
|
||||
type: HIDDEN,
|
||||
name: name,
|
||||
value: data[name]
|
||||
}, null, form);
|
||||
}
|
||||
|
||||
// submit
|
||||
form.submit();
|
||||
|
||||
// clean up
|
||||
discardElement(form);
|
||||
};
|
||||
|
||||
extend(Chart.prototype, {
|
||||
|
||||
/**
|
||||
* Return an SVG representation of the chart
|
||||
*
|
||||
* @param additionalOptions {Object} Additional chart options for the generated SVG representation
|
||||
*/
|
||||
getSVG: function (additionalOptions) {
|
||||
var chart = this,
|
||||
chartCopy,
|
||||
sandbox,
|
||||
svg,
|
||||
seriesOptions,
|
||||
sourceWidth,
|
||||
sourceHeight,
|
||||
cssWidth,
|
||||
cssHeight,
|
||||
options = merge(chart.options, additionalOptions); // copy the options and add extra options
|
||||
|
||||
// IE compatibility hack for generating SVG content that it doesn't really understand
|
||||
if (!doc.createElementNS) {
|
||||
/*jslint unparam: true*//* allow unused parameter ns in function below */
|
||||
doc.createElementNS = function (ns, tagName) {
|
||||
return doc.createElement(tagName);
|
||||
};
|
||||
/*jslint unparam: false*/
|
||||
}
|
||||
|
||||
// create a sandbox where a new chart will be generated
|
||||
sandbox = createElement(DIV, null, {
|
||||
position: ABSOLUTE,
|
||||
top: '-9999em',
|
||||
width: chart.chartWidth + PX,
|
||||
height: chart.chartHeight + PX
|
||||
}, doc.body);
|
||||
|
||||
// get the source size
|
||||
cssWidth = chart.renderTo.style.width;
|
||||
cssHeight = chart.renderTo.style.height;
|
||||
sourceWidth = options.exporting.sourceWidth ||
|
||||
options.chart.width ||
|
||||
(/px$/.test(cssWidth) && parseInt(cssWidth, 10)) ||
|
||||
600;
|
||||
sourceHeight = options.exporting.sourceHeight ||
|
||||
options.chart.height ||
|
||||
(/px$/.test(cssHeight) && parseInt(cssHeight, 10)) ||
|
||||
400;
|
||||
|
||||
// override some options
|
||||
extend(options.chart, {
|
||||
animation: false,
|
||||
renderTo: sandbox,
|
||||
forExport: true,
|
||||
width: sourceWidth,
|
||||
height: sourceHeight
|
||||
});
|
||||
options.exporting.enabled = false; // hide buttons in print
|
||||
|
||||
// prepare for replicating the chart
|
||||
options.series = [];
|
||||
each(chart.series, function (serie) {
|
||||
seriesOptions = merge(serie.options, {
|
||||
animation: false, // turn off animation
|
||||
enableMouseTracking: false,
|
||||
showCheckbox: false,
|
||||
visible: serie.visible
|
||||
});
|
||||
|
||||
if (!seriesOptions.isInternal) { // used for the navigator series that has its own option set
|
||||
options.series.push(seriesOptions);
|
||||
}
|
||||
});
|
||||
|
||||
// generate the chart copy
|
||||
chartCopy = new Highcharts.Chart(options, chart.callback);
|
||||
|
||||
// reflect axis extremes in the export
|
||||
each(['xAxis', 'yAxis'], function (axisType) {
|
||||
each(chart[axisType], function (axis, i) {
|
||||
var axisCopy = chartCopy[axisType][i],
|
||||
extremes = axis.getExtremes(),
|
||||
userMin = extremes.userMin,
|
||||
userMax = extremes.userMax;
|
||||
|
||||
if (axisCopy && (userMin !== UNDEFINED || userMax !== UNDEFINED)) {
|
||||
axisCopy.setExtremes(userMin, userMax, true, false);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// get the SVG from the container's innerHTML
|
||||
svg = chartCopy.container.innerHTML;
|
||||
|
||||
// free up memory
|
||||
options = null;
|
||||
chartCopy.destroy();
|
||||
discardElement(sandbox);
|
||||
|
||||
// sanitize
|
||||
svg = svg
|
||||
.replace(/zIndex="[^"]+"/g, '')
|
||||
.replace(/isShadow="[^"]+"/g, '')
|
||||
.replace(/symbolName="[^"]+"/g, '')
|
||||
.replace(/jQuery[0-9]+="[^"]+"/g, '')
|
||||
.replace(/url\([^#]+#/g, 'url(#')
|
||||
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
|
||||
.replace(/ href=/g, ' xlink:href=')
|
||||
.replace(/\n/, ' ')
|
||||
// Any HTML added to the container after the SVG (#894)
|
||||
.replace(/<\/svg>.*?$/, '</svg>')
|
||||
// Batik doesn't support rgba fills and strokes (#3095)
|
||||
.replace(/(fill|stroke)="rgba\(([ 0-9]+,[ 0-9]+,[ 0-9]+),([ 0-9\.]+)\)"/g, '$1="rgb($2)" $1-opacity="$3"')
|
||||
/* This fails in IE < 8
|
||||
.replace(/([0-9]+)\.([0-9]+)/g, function(s1, s2, s3) { // round off to save weight
|
||||
return s2 +'.'+ s3[0];
|
||||
})*/
|
||||
|
||||
// Replace HTML entities, issue #347
|
||||
.replace(/ /g, '\u00A0') // no-break space
|
||||
.replace(/­/g, '\u00AD') // soft hyphen
|
||||
|
||||
// IE specific
|
||||
.replace(/<IMG /g, '<image ')
|
||||
.replace(/height=([^" ]+)/g, 'height="$1"')
|
||||
.replace(/width=([^" ]+)/g, 'width="$1"')
|
||||
.replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
|
||||
.replace(/id=([^" >]+)/g, 'id="$1"')
|
||||
.replace(/class=([^" >]+)/g, 'class="$1"')
|
||||
.replace(/ transform /g, ' ')
|
||||
.replace(/:(path|rect)/g, '$1')
|
||||
.replace(/style="([^"]+)"/g, function (s) {
|
||||
return s.toLowerCase();
|
||||
});
|
||||
|
||||
// IE9 beta bugs with innerHTML. Test again with final IE9.
|
||||
svg = svg.replace(/(url\(#highcharts-[0-9]+)"/g, '$1')
|
||||
.replace(/"/g, "'");
|
||||
|
||||
return svg;
|
||||
},
|
||||
|
||||
/**
|
||||
* Submit the SVG representation of the chart to the server
|
||||
* @param {Object} options Exporting options. Possible members are url, type, width and formAttributes.
|
||||
* @param {Object} chartOptions Additional chart options for the SVG representation of the chart
|
||||
*/
|
||||
exportChart: function (options, chartOptions) {
|
||||
options = options || {};
|
||||
|
||||
var chart = this,
|
||||
chartExportingOptions = chart.options.exporting,
|
||||
svg = chart.getSVG(merge(
|
||||
{ chart: { borderRadius: 0 } },
|
||||
chartExportingOptions.chartOptions,
|
||||
chartOptions,
|
||||
{
|
||||
exporting: {
|
||||
sourceWidth: options.sourceWidth || chartExportingOptions.sourceWidth,
|
||||
sourceHeight: options.sourceHeight || chartExportingOptions.sourceHeight
|
||||
}
|
||||
}
|
||||
));
|
||||
|
||||
// merge the options
|
||||
options = merge(chart.options.exporting, options);
|
||||
|
||||
// do the post
|
||||
Highcharts.post(options.url, {
|
||||
filename: options.filename || 'chart',
|
||||
type: options.type,
|
||||
width: options.width || 0, // IE8 fails to post undefined correctly, so use 0
|
||||
scale: options.scale || 2,
|
||||
svg: svg
|
||||
}, options.formAttributes);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Print the chart
|
||||
*/
|
||||
print: function () {
|
||||
|
||||
var chart = this,
|
||||
container = chart.container,
|
||||
origDisplay = [],
|
||||
origParent = container.parentNode,
|
||||
body = doc.body,
|
||||
childNodes = body.childNodes;
|
||||
|
||||
if (chart.isPrinting) { // block the button while in printing mode
|
||||
return;
|
||||
}
|
||||
|
||||
chart.isPrinting = true;
|
||||
|
||||
// hide all body content
|
||||
each(childNodes, function (node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
origDisplay[i] = node.style.display;
|
||||
node.style.display = NONE;
|
||||
}
|
||||
});
|
||||
|
||||
// pull out the chart
|
||||
body.appendChild(container);
|
||||
|
||||
// print
|
||||
win.focus(); // #1510
|
||||
win.print();
|
||||
|
||||
// allow the browser to prepare before reverting
|
||||
setTimeout(function () {
|
||||
|
||||
// put the chart back in
|
||||
origParent.appendChild(container);
|
||||
|
||||
// restore all body content
|
||||
each(childNodes, function (node, i) {
|
||||
if (node.nodeType === 1) {
|
||||
node.style.display = origDisplay[i];
|
||||
}
|
||||
});
|
||||
|
||||
chart.isPrinting = false;
|
||||
|
||||
}, 1000);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Display a popup menu for choosing the export type
|
||||
*
|
||||
* @param {String} className An identifier for the menu
|
||||
* @param {Array} items A collection with text and onclicks for the items
|
||||
* @param {Number} x The x position of the opener button
|
||||
* @param {Number} y The y position of the opener button
|
||||
* @param {Number} width The width of the opener button
|
||||
* @param {Number} height The height of the opener button
|
||||
*/
|
||||
contextMenu: function (className, items, x, y, width, height, button) {
|
||||
var chart = this,
|
||||
navOptions = chart.options.navigation,
|
||||
menuItemStyle = navOptions.menuItemStyle,
|
||||
chartWidth = chart.chartWidth,
|
||||
chartHeight = chart.chartHeight,
|
||||
cacheName = 'cache-' + className,
|
||||
menu = chart[cacheName],
|
||||
menuPadding = mathMax(width, height), // for mouse leave detection
|
||||
boxShadow = '3px 3px 10px #888',
|
||||
innerMenu,
|
||||
hide,
|
||||
hideTimer,
|
||||
menuStyle,
|
||||
docMouseUpHandler = function (e) {
|
||||
if (!chart.pointer.inClass(e.target, className)) {
|
||||
hide();
|
||||
}
|
||||
};
|
||||
|
||||
// create the menu only the first time
|
||||
if (!menu) {
|
||||
|
||||
// create a HTML element above the SVG
|
||||
chart[cacheName] = menu = createElement(DIV, {
|
||||
className: className
|
||||
}, {
|
||||
position: ABSOLUTE,
|
||||
zIndex: 1000,
|
||||
padding: menuPadding + PX
|
||||
}, chart.container);
|
||||
|
||||
innerMenu = createElement(DIV, null,
|
||||
extend({
|
||||
MozBoxShadow: boxShadow,
|
||||
WebkitBoxShadow: boxShadow,
|
||||
boxShadow: boxShadow
|
||||
}, navOptions.menuStyle), menu);
|
||||
|
||||
// hide on mouse out
|
||||
hide = function () {
|
||||
css(menu, { display: NONE });
|
||||
if (button) {
|
||||
button.setState(0);
|
||||
}
|
||||
chart.openMenu = false;
|
||||
};
|
||||
|
||||
// Hide the menu some time after mouse leave (#1357)
|
||||
addEvent(menu, 'mouseleave', function () {
|
||||
hideTimer = setTimeout(hide, 500);
|
||||
});
|
||||
addEvent(menu, 'mouseenter', function () {
|
||||
clearTimeout(hideTimer);
|
||||
});
|
||||
|
||||
|
||||
// Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
|
||||
addEvent(document, 'mouseup', docMouseUpHandler);
|
||||
addEvent(chart, 'destroy', function () {
|
||||
removeEvent(document, 'mouseup', docMouseUpHandler);
|
||||
});
|
||||
|
||||
|
||||
// create the items
|
||||
each(items, function (item) {
|
||||
if (item) {
|
||||
var element = item.separator ?
|
||||
createElement('hr', null, null, innerMenu) :
|
||||
createElement(DIV, {
|
||||
onmouseover: function () {
|
||||
css(this, navOptions.menuItemHoverStyle);
|
||||
},
|
||||
onmouseout: function () {
|
||||
css(this, menuItemStyle);
|
||||
},
|
||||
onclick: function () {
|
||||
hide();
|
||||
item.onclick.apply(chart, arguments);
|
||||
},
|
||||
innerHTML: item.text || chart.options.lang[item.textKey]
|
||||
}, extend({
|
||||
cursor: 'pointer'
|
||||
}, menuItemStyle), innerMenu);
|
||||
|
||||
|
||||
// Keep references to menu divs to be able to destroy them
|
||||
chart.exportDivElements.push(element);
|
||||
}
|
||||
});
|
||||
|
||||
// Keep references to menu and innerMenu div to be able to destroy them
|
||||
chart.exportDivElements.push(innerMenu, menu);
|
||||
|
||||
chart.exportMenuWidth = menu.offsetWidth;
|
||||
chart.exportMenuHeight = menu.offsetHeight;
|
||||
}
|
||||
|
||||
menuStyle = { display: 'block' };
|
||||
|
||||
// if outside right, right align it
|
||||
if (x + chart.exportMenuWidth > chartWidth) {
|
||||
menuStyle.right = (chartWidth - x - width - menuPadding) + PX;
|
||||
} else {
|
||||
menuStyle.left = (x - menuPadding) + PX;
|
||||
}
|
||||
// if outside bottom, bottom align it
|
||||
if (y + height + chart.exportMenuHeight > chartHeight && button.alignOptions.verticalAlign !== 'top') {
|
||||
menuStyle.bottom = (chartHeight - y - menuPadding) + PX;
|
||||
} else {
|
||||
menuStyle.top = (y + height - menuPadding) + PX;
|
||||
}
|
||||
|
||||
css(menu, menuStyle);
|
||||
chart.openMenu = true;
|
||||
},
|
||||
|
||||
/**
|
||||
* Add the export button to the chart
|
||||
*/
|
||||
addButton: function (options) {
|
||||
var chart = this,
|
||||
renderer = chart.renderer,
|
||||
btnOptions = merge(chart.options.navigation.buttonOptions, options),
|
||||
onclick = btnOptions.onclick,
|
||||
menuItems = btnOptions.menuItems,
|
||||
symbol,
|
||||
button,
|
||||
symbolAttr = {
|
||||
stroke: btnOptions.symbolStroke,
|
||||
fill: btnOptions.symbolFill
|
||||
},
|
||||
symbolSize = btnOptions.symbolSize || 12;
|
||||
if (!chart.btnCount) {
|
||||
chart.btnCount = 0;
|
||||
}
|
||||
|
||||
// Keeps references to the button elements
|
||||
if (!chart.exportDivElements) {
|
||||
chart.exportDivElements = [];
|
||||
chart.exportSVGElements = [];
|
||||
}
|
||||
|
||||
if (btnOptions.enabled === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var attr = btnOptions.theme,
|
||||
states = attr.states,
|
||||
hover = states && states.hover,
|
||||
select = states && states.select,
|
||||
callback;
|
||||
|
||||
delete attr.states;
|
||||
|
||||
if (onclick) {
|
||||
callback = function () {
|
||||
onclick.apply(chart, arguments);
|
||||
};
|
||||
|
||||
} else if (menuItems) {
|
||||
callback = function () {
|
||||
chart.contextMenu(
|
||||
button.menuClassName,
|
||||
menuItems,
|
||||
button.translateX,
|
||||
button.translateY,
|
||||
button.width,
|
||||
button.height,
|
||||
button
|
||||
);
|
||||
button.setState(2);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
if (btnOptions.text && btnOptions.symbol) {
|
||||
attr.paddingLeft = Highcharts.pick(attr.paddingLeft, 25);
|
||||
|
||||
} else if (!btnOptions.text) {
|
||||
extend(attr, {
|
||||
width: btnOptions.width,
|
||||
height: btnOptions.height,
|
||||
padding: 0
|
||||
});
|
||||
}
|
||||
|
||||
button = renderer.button(btnOptions.text, 0, 0, callback, attr, hover, select)
|
||||
.attr({
|
||||
title: chart.options.lang[btnOptions._titleKey],
|
||||
'stroke-linecap': 'round'
|
||||
});
|
||||
button.menuClassName = options.menuClassName || PREFIX + 'menu-' + chart.btnCount++;
|
||||
|
||||
if (btnOptions.symbol) {
|
||||
symbol = renderer.symbol(
|
||||
btnOptions.symbol,
|
||||
btnOptions.symbolX - (symbolSize / 2),
|
||||
btnOptions.symbolY - (symbolSize / 2),
|
||||
symbolSize,
|
||||
symbolSize
|
||||
)
|
||||
.attr(extend(symbolAttr, {
|
||||
'stroke-width': btnOptions.symbolStrokeWidth || 1,
|
||||
zIndex: 1
|
||||
})).add(button);
|
||||
}
|
||||
|
||||
button.add()
|
||||
.align(extend(btnOptions, {
|
||||
width: button.width,
|
||||
x: Highcharts.pick(btnOptions.x, buttonOffset) // #1654
|
||||
}), true, 'spacingBox');
|
||||
|
||||
buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
|
||||
|
||||
chart.exportSVGElements.push(button, symbol);
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* Destroy the buttons.
|
||||
*/
|
||||
destroyExport: function (e) {
|
||||
var chart = e.target,
|
||||
i,
|
||||
elem;
|
||||
|
||||
// Destroy the extra buttons added
|
||||
for (i = 0; i < chart.exportSVGElements.length; i++) {
|
||||
elem = chart.exportSVGElements[i];
|
||||
|
||||
// Destroy and null the svg/vml elements
|
||||
if (elem) { // #1822
|
||||
elem.onclick = elem.ontouchstart = null;
|
||||
chart.exportSVGElements[i] = elem.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
// Destroy the divs for the menu
|
||||
for (i = 0; i < chart.exportDivElements.length; i++) {
|
||||
elem = chart.exportDivElements[i];
|
||||
|
||||
// Remove the event handler
|
||||
removeEvent(elem, 'mouseleave');
|
||||
|
||||
// Remove inline events
|
||||
chart.exportDivElements[i] = elem.onmouseout = elem.onmouseover = elem.ontouchstart = elem.onclick = null;
|
||||
|
||||
// Destroy the div by moving to garbage bin
|
||||
discardElement(elem);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
symbols.menu = function (x, y, width, height) {
|
||||
var arr = [
|
||||
M, x, y + 2.5,
|
||||
L, x + width, y + 2.5,
|
||||
M, x, y + height / 2 + 0.5,
|
||||
L, x + width, y + height / 2 + 0.5,
|
||||
M, x, y + height - 1.5,
|
||||
L, x + width, y + height - 1.5
|
||||
];
|
||||
return arr;
|
||||
};
|
||||
|
||||
// Add the buttons on chart load
|
||||
Chart.prototype.callbacks.push(function (chart) {
|
||||
var n,
|
||||
exportingOptions = chart.options.exporting,
|
||||
buttons = exportingOptions.buttons;
|
||||
|
||||
buttonOffset = 0;
|
||||
|
||||
if (exportingOptions.enabled !== false) {
|
||||
|
||||
for (n in buttons) {
|
||||
chart.addButton(buttons[n]);
|
||||
}
|
||||
|
||||
// Destroy the export elements at chart destroy
|
||||
addEvent(chart, 'destroy', chart.destroyExport);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
|
||||
Highcharts funnel module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(b){var d=b.getOptions(),v=d.plotOptions,q=b.seriesTypes,E=b.merge,D=function(){},A=b.each;v.funnel=E(v.pie,{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,dataLabels:{connectorWidth:1,connectorColor:"#606060"},size:!0,states:{select:{color:"#C0C0C0",borderColor:"#000000",shadow:!1}}});q.funnel=b.extendClass(q.pie,{type:"funnel",animate:D,singularTooltips:!0,translate:function(){var a=function(j,a){return/%$/.test(j)?a*parseInt(j,
|
||||
10)/100:parseInt(j,10)},B=0,f=this.chart,c=this.options,g=c.reversed,b=f.plotWidth,n=f.plotHeight,o=0,f=c.center,h=a(f[0],b),d=a(f[0],n),q=a(c.width,b),k,r,e=a(c.height,n),s=a(c.neckWidth,b),t=a(c.neckHeight,n),w=e-t,a=this.data,x,y,v=c.dataLabels.position==="left"?1:0,z,l,C,p,i,u,m;this.getWidthAt=r=function(j){return j>e-t||e===t?s:s+(q-s)*((e-t-j)/(e-t))};this.getX=function(j,a){return h+(a?-1:1)*(r(g?n-j:j)/2+c.dataLabels.distance)};this.center=[h,d,e];this.centerX=h;A(a,function(a){B+=a.y});
|
||||
A(a,function(a){m=null;y=B?a.y/B:0;l=d-e/2+o*e;i=l+y*e;k=r(l);z=h-k/2;C=z+k;k=r(i);p=h-k/2;u=p+k;l>w?(z=p=h-s/2,C=u=h+s/2):i>w&&(m=i,k=r(w),p=h-k/2,u=p+k,i=w);g&&(l=e-l,i=e-i,m=m?e-m:null);x=["M",z,l,"L",C,l,u,i];m&&x.push(u,m,p,m);x.push(p,i,"Z");a.shapeType="path";a.shapeArgs={d:x};a.percentage=y*100;a.plotX=h;a.plotY=(l+(m||i))/2;a.tooltipPos=[h,a.plotY];a.slice=D;a.half=v;o+=y})},drawPoints:function(){var a=this,b=a.options,f=a.chart.renderer;A(a.data,function(c){var g=c.graphic,d=c.shapeArgs;
|
||||
g?g.animate(d):c.graphic=f.path(d).attr({fill:c.color,stroke:b.borderColor,"stroke-width":b.borderWidth}).add(a.group)})},sortByAngle:function(a){a.sort(function(a,b){return a.plotY-b.plotY})},drawDataLabels:function(){var a=this.data,b=this.options.dataLabels.distance,f,c,g,d=a.length,n,o;for(this.center[2]-=2*b;d--;)g=a[d],c=(f=g.half)?1:-1,o=g.plotY,n=this.getX(o,f),g.labelPos=[0,o,n+(b-5)*c,o,n+b*c,o,f?"right":"left",0];q.pie.prototype.drawDataLabels.call(this)}});d.plotOptions.pyramid=b.merge(d.plotOptions.funnel,
|
||||
{neckWidth:"0%",neckHeight:"0%",reversed:!0});b.seriesTypes.pyramid=b.extendClass(b.seriesTypes.funnel,{type:"pyramid"})})(Highcharts);
|
||||
@@ -0,0 +1,310 @@
|
||||
/**
|
||||
* @license
|
||||
* Highcharts funnel module
|
||||
*
|
||||
* (c) 2010-2014 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/*global Highcharts */
|
||||
(function (Highcharts) {
|
||||
|
||||
'use strict';
|
||||
|
||||
// create shortcuts
|
||||
var defaultOptions = Highcharts.getOptions(),
|
||||
defaultPlotOptions = defaultOptions.plotOptions,
|
||||
seriesTypes = Highcharts.seriesTypes,
|
||||
merge = Highcharts.merge,
|
||||
noop = function () {},
|
||||
each = Highcharts.each;
|
||||
|
||||
// set default options
|
||||
defaultPlotOptions.funnel = merge(defaultPlotOptions.pie, {
|
||||
animation: false,
|
||||
center: ['50%', '50%'],
|
||||
width: '90%',
|
||||
neckWidth: '30%',
|
||||
height: '100%',
|
||||
neckHeight: '25%',
|
||||
reversed: false,
|
||||
dataLabels: {
|
||||
//position: 'right',
|
||||
connectorWidth: 1,
|
||||
connectorColor: '#606060'
|
||||
},
|
||||
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
|
||||
states: {
|
||||
select: {
|
||||
color: '#C0C0C0',
|
||||
borderColor: '#000000',
|
||||
shadow: false
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
seriesTypes.funnel = Highcharts.extendClass(seriesTypes.pie, {
|
||||
|
||||
type: 'funnel',
|
||||
animate: noop,
|
||||
singularTooltips: true,
|
||||
|
||||
/**
|
||||
* Overrides the pie translate method
|
||||
*/
|
||||
translate: function () {
|
||||
|
||||
var
|
||||
// Get positions - either an integer or a percentage string must be given
|
||||
getLength = function (length, relativeTo) {
|
||||
return (/%$/).test(length) ?
|
||||
relativeTo * parseInt(length, 10) / 100 :
|
||||
parseInt(length, 10);
|
||||
},
|
||||
|
||||
sum = 0,
|
||||
series = this,
|
||||
chart = series.chart,
|
||||
options = series.options,
|
||||
reversed = options.reversed,
|
||||
plotWidth = chart.plotWidth,
|
||||
plotHeight = chart.plotHeight,
|
||||
cumulative = 0, // start at top
|
||||
center = options.center,
|
||||
centerX = getLength(center[0], plotWidth),
|
||||
centerY = getLength(center[0], plotHeight),
|
||||
width = getLength(options.width, plotWidth),
|
||||
tempWidth,
|
||||
getWidthAt,
|
||||
height = getLength(options.height, plotHeight),
|
||||
neckWidth = getLength(options.neckWidth, plotWidth),
|
||||
neckHeight = getLength(options.neckHeight, plotHeight),
|
||||
neckY = height - neckHeight,
|
||||
data = series.data,
|
||||
path,
|
||||
fraction,
|
||||
half = options.dataLabels.position === 'left' ? 1 : 0,
|
||||
|
||||
x1,
|
||||
y1,
|
||||
x2,
|
||||
x3,
|
||||
y3,
|
||||
x4,
|
||||
y5;
|
||||
|
||||
// Return the width at a specific y coordinate
|
||||
series.getWidthAt = getWidthAt = function (y) {
|
||||
return y > height - neckHeight || height === neckHeight ?
|
||||
neckWidth :
|
||||
neckWidth + (width - neckWidth) * ((height - neckHeight - y) / (height - neckHeight));
|
||||
};
|
||||
series.getX = function (y, half) {
|
||||
return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? plotHeight - y : y) / 2) + options.dataLabels.distance);
|
||||
};
|
||||
|
||||
// Expose
|
||||
series.center = [centerX, centerY, height];
|
||||
series.centerX = centerX;
|
||||
|
||||
/*
|
||||
* Individual point coordinate naming:
|
||||
*
|
||||
* x1,y1 _________________ x2,y1
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* \ /
|
||||
* x3,y3 _________ x4,y3
|
||||
*
|
||||
* Additional for the base of the neck:
|
||||
*
|
||||
* | |
|
||||
* | |
|
||||
* | |
|
||||
* x3,y5 _________ x4,y5
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
// get the total sum
|
||||
each(data, function (point) {
|
||||
sum += point.y;
|
||||
});
|
||||
|
||||
each(data, function (point) {
|
||||
// set start and end positions
|
||||
y5 = null;
|
||||
fraction = sum ? point.y / sum : 0;
|
||||
y1 = centerY - height / 2 + cumulative * height;
|
||||
y3 = y1 + fraction * height;
|
||||
//tempWidth = neckWidth + (width - neckWidth) * ((height - neckHeight - y1) / (height - neckHeight));
|
||||
tempWidth = getWidthAt(y1);
|
||||
x1 = centerX - tempWidth / 2;
|
||||
x2 = x1 + tempWidth;
|
||||
tempWidth = getWidthAt(y3);
|
||||
x3 = centerX - tempWidth / 2;
|
||||
x4 = x3 + tempWidth;
|
||||
|
||||
// the entire point is within the neck
|
||||
if (y1 > neckY) {
|
||||
x1 = x3 = centerX - neckWidth / 2;
|
||||
x2 = x4 = centerX + neckWidth / 2;
|
||||
|
||||
// the base of the neck
|
||||
} else if (y3 > neckY) {
|
||||
y5 = y3;
|
||||
|
||||
tempWidth = getWidthAt(neckY);
|
||||
x3 = centerX - tempWidth / 2;
|
||||
x4 = x3 + tempWidth;
|
||||
|
||||
y3 = neckY;
|
||||
}
|
||||
|
||||
if (reversed) {
|
||||
y1 = height - y1;
|
||||
y3 = height - y3;
|
||||
y5 = (y5 ? height - y5 : null);
|
||||
}
|
||||
// save the path
|
||||
path = [
|
||||
'M',
|
||||
x1, y1,
|
||||
'L',
|
||||
x2, y1,
|
||||
x4, y3
|
||||
];
|
||||
if (y5) {
|
||||
path.push(x4, y5, x3, y5);
|
||||
}
|
||||
path.push(x3, y3, 'Z');
|
||||
|
||||
// prepare for using shared dr
|
||||
point.shapeType = 'path';
|
||||
point.shapeArgs = { d: path };
|
||||
|
||||
|
||||
// for tooltips and data labels
|
||||
point.percentage = fraction * 100;
|
||||
point.plotX = centerX;
|
||||
point.plotY = (y1 + (y5 || y3)) / 2;
|
||||
|
||||
// Placement of tooltips and data labels
|
||||
point.tooltipPos = [
|
||||
centerX,
|
||||
point.plotY
|
||||
];
|
||||
|
||||
// Slice is a noop on funnel points
|
||||
point.slice = noop;
|
||||
|
||||
// Mimicking pie data label placement logic
|
||||
point.half = half;
|
||||
|
||||
cumulative += fraction;
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Draw a single point (wedge)
|
||||
* @param {Object} point The point object
|
||||
* @param {Object} color The color of the point
|
||||
* @param {Number} brightness The brightness relative to the color
|
||||
*/
|
||||
drawPoints: function () {
|
||||
var series = this,
|
||||
options = series.options,
|
||||
chart = series.chart,
|
||||
renderer = chart.renderer;
|
||||
|
||||
each(series.data, function (point) {
|
||||
|
||||
var graphic = point.graphic,
|
||||
shapeArgs = point.shapeArgs;
|
||||
|
||||
if (!graphic) { // Create the shapes
|
||||
point.graphic = renderer.path(shapeArgs).
|
||||
attr({
|
||||
fill: point.color,
|
||||
stroke: options.borderColor,
|
||||
'stroke-width': options.borderWidth
|
||||
}).
|
||||
add(series.group);
|
||||
|
||||
} else { // Update the shapes
|
||||
graphic.animate(shapeArgs);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Funnel items don't have angles (#2289)
|
||||
*/
|
||||
sortByAngle: function (points) {
|
||||
points.sort(function (a, b) {
|
||||
return a.plotY - b.plotY;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Extend the pie data label method
|
||||
*/
|
||||
drawDataLabels: function () {
|
||||
var data = this.data,
|
||||
labelDistance = this.options.dataLabels.distance,
|
||||
leftSide,
|
||||
sign,
|
||||
point,
|
||||
i = data.length,
|
||||
x,
|
||||
y;
|
||||
|
||||
// In the original pie label anticollision logic, the slots are distributed
|
||||
// from one labelDistance above to one labelDistance below the pie. In funnels
|
||||
// we don't want this.
|
||||
this.center[2] -= 2 * labelDistance;
|
||||
|
||||
// Set the label position array for each point.
|
||||
while (i--) {
|
||||
point = data[i];
|
||||
leftSide = point.half;
|
||||
sign = leftSide ? 1 : -1;
|
||||
y = point.plotY;
|
||||
x = this.getX(y, leftSide);
|
||||
|
||||
// set the anchor point for data labels
|
||||
point.labelPos = [
|
||||
0, // first break of connector
|
||||
y, // a/a
|
||||
x + (labelDistance - 5) * sign, // second break, right outside point shape
|
||||
y, // a/a
|
||||
x + labelDistance * sign, // landing point for connector
|
||||
y, // a/a
|
||||
leftSide ? 'right' : 'left', // alignment
|
||||
0 // center angle
|
||||
];
|
||||
}
|
||||
|
||||
seriesTypes.pie.prototype.drawDataLabels.call(this);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* Pyramid series type.
|
||||
* A pyramid series is a special type of funnel, without neck and reversed by default.
|
||||
*/
|
||||
defaultOptions.plotOptions.pyramid = Highcharts.merge(defaultOptions.plotOptions.funnel, {
|
||||
neckWidth: '0%',
|
||||
neckHeight: '0%',
|
||||
reversed: true
|
||||
});
|
||||
Highcharts.seriesTypes.pyramid = Highcharts.extendClass(Highcharts.seriesTypes.funnel, {
|
||||
type: 'pyramid'
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
|
||||
(c) 2011-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(h){var j=h.Axis,y=h.Chart,p=h.Color,z=h.Legend,t=h.LegendSymbolMixin,u=h.Series,v=h.SVGRenderer,w=h.getOptions(),k=h.each,q=h.extend,A=h.extendClass,l=h.merge,m=h.pick,x=h.numberFormat,o=h.seriesTypes,r=h.wrap,n=function(){},s=h.ColorAxis=function(){this.isColorAxis=!0;this.init.apply(this,arguments)};q(s.prototype,j.prototype);q(s.prototype,{defaultColorAxisOptions:{lineWidth:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},color:"gray",
|
||||
width:0.01},labels:{overflow:"justify"},minColor:"#EFEFFF",maxColor:"#003875",tickLength:5},init:function(b,a){var c=b.options.legend.layout!=="vertical",d;d=l(this.defaultColorAxisOptions,{side:c?2:1,reversed:!c},a,{isX:c,opposite:!c,showEmpty:!1,title:null,isColor:!0});j.prototype.init.call(this,b,d);a.dataClasses&&this.initDataClasses(a);this.initStops(a);this.isXAxis=!0;this.horiz=c;this.zoomEnabled=!1},tweenColors:function(b,a,c){var d=a.rgba[3]!==1||b.rgba[3]!==1;return(d?"rgba(":"rgb(")+Math.round(a.rgba[0]+
|
||||
(b.rgba[0]-a.rgba[0])*(1-c))+","+Math.round(a.rgba[1]+(b.rgba[1]-a.rgba[1])*(1-c))+","+Math.round(a.rgba[2]+(b.rgba[2]-a.rgba[2])*(1-c))+(d?","+(a.rgba[3]+(b.rgba[3]-a.rgba[3])*(1-c)):"")+")"},initDataClasses:function(b){var a=this,c=this.chart,d,e=0,f=this.options;this.dataClasses=d=[];this.legendItems=[];k(b.dataClasses,function(g,i){var h,g=l(g);d.push(g);if(!g.color)f.dataClassColor==="category"?(h=c.options.colors,g.color=h[e++],e===h.length&&(e=0)):g.color=a.tweenColors(p(f.minColor),p(f.maxColor),
|
||||
i/(b.dataClasses.length-1))})},initStops:function(b){this.stops=b.stops||[[0,this.options.minColor],[1,this.options.maxColor]];k(this.stops,function(a){a.color=p(a[1])})},setOptions:function(b){j.prototype.setOptions.call(this,b);this.options.crosshair=this.options.marker;this.coll="colorAxis"},setAxisSize:function(){var b=this.legendSymbol,a=this.chart,c,d,e;if(b)this.left=c=b.attr("x"),this.top=d=b.attr("y"),this.width=e=b.attr("width"),this.height=b=b.attr("height"),this.right=a.chartWidth-c-e,
|
||||
this.bottom=a.chartHeight-d-b,this.len=this.horiz?e:b,this.pos=this.horiz?c:d},toColor:function(b,a){var c,d=this.stops,e,f=this.dataClasses,g,i;if(f)for(i=f.length;i--;){if(g=f[i],e=g.from,d=g.to,(e===void 0||b>=e)&&(d===void 0||b<=d)){c=g.color;if(a)a.dataClass=i;break}}else{this.isLog&&(b=this.val2lin(b));c=1-(this.max-b)/(this.max-this.min||1);for(i=d.length;i--;)if(c>d[i][0])break;e=d[i]||d[i+1];d=d[i+1]||e;c=1-(d[0]-c)/(d[0]-e[0]||1);c=this.tweenColors(e.color,d.color,c)}return c},getOffset:function(){var b=
|
||||
this.legendGroup,a=this.chart.axisOffset[this.side];if(b){j.prototype.getOffset.call(this);if(!this.axisGroup.parentGroup)this.axisGroup.add(b),this.gridGroup.add(b),this.labelGroup.add(b),this.added=!0;this.chart.axisOffset[this.side]=a}},setLegendColor:function(){var b,a=this.options;b=this.horiz?[0,0,1,0]:[0,0,0,1];this.legendColor={linearGradient:{x1:b[0],y1:b[1],x2:b[2],y2:b[3]},stops:a.stops||[[0,a.minColor],[1,a.maxColor]]}},drawLegendSymbol:function(b,a){var c=b.padding,d=b.options,e=this.horiz,
|
||||
f=m(d.symbolWidth,e?200:12),g=m(d.symbolHeight,e?12:200),i=m(d.labelPadding,e?16:30),d=m(d.itemDistance,10);this.setLegendColor();a.legendSymbol=this.chart.renderer.rect(0,b.baseline-11,f,g).attr({zIndex:1}).add(a.legendGroup);a.legendSymbol.getBBox();this.legendItemWidth=f+c+(e?d:i);this.legendItemHeight=g+c+(e?i:0)},setState:n,visible:!0,setVisible:n,getSeriesExtremes:function(){var b;if(this.series.length)b=this.series[0],this.dataMin=b.valueMin,this.dataMax=b.valueMax},drawCrosshair:function(b,
|
||||
a){var c=!this.cross,d=a&&a.plotX,e=a&&a.plotY,f,g=this.pos,i=this.len;if(a)f=this.toPixels(a.value),f<g?f=g-2:f>g+i&&(f=g+i+2),a.plotX=f,a.plotY=this.len-f,j.prototype.drawCrosshair.call(this,b,a),a.plotX=d,a.plotY=e,!c&&this.cross&&this.cross.attr({fill:this.crosshair.color}).add(this.labelGroup)},getPlotLinePath:function(b,a,c,d,e){return e?this.horiz?["M",e-4,this.top-6,"L",e+4,this.top-6,e,this.top,"Z"]:["M",this.left,e,"L",this.left-6,e+6,this.left-6,e-6,"Z"]:j.prototype.getPlotLinePath.call(this,
|
||||
b,a,c,d)},update:function(b,a){k(this.series,function(a){a.isDirtyData=!0});j.prototype.update.call(this,b,a);this.legendItem&&(this.setLegendColor(),this.chart.legend.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var b=this,a=this.chart,c=this.legendItems,d=a.options.legend,e=d.valueDecimals,f=d.valueSuffix||"",g;c.length||k(this.dataClasses,function(d,h){var j=!0,l=d.from,m=d.to;g="";l===void 0?g="< ":m===void 0&&(g="> ");l!==void 0&&(g+=x(l,e)+f);l!==void 0&&m!==void 0&&(g+=" - ");
|
||||
m!==void 0&&(g+=x(m,e)+f);c.push(q({chart:a,name:g,options:{},drawLegendSymbol:t.drawRectangle,visible:!0,setState:n,setVisible:function(){j=this.visible=!j;k(b.series,function(a){k(a.points,function(a){a.dataClass===h&&a.setVisible(j)})});a.legend.colorizeItem(this,j)}},d))});return c},name:""});r(y.prototype,"getAxes",function(b){var a=this.options.colorAxis;b.call(this);this.colorAxis=[];a&&new s(this,a)});r(z.prototype,"getAllItems",function(b){var a=[],c=this.chart.colorAxis[0];c&&(c.options.dataClasses?
|
||||
a=a.concat(c.getDataClassLegendSymbols()):a.push(c),k(c.series,function(a){a.options.showInLegend=!1}));return a.concat(b.call(this))});h={pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",dashstyle:"dashStyle"},pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:n,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var b=this,a=this.options.nullColor,
|
||||
c=this.colorAxis,d=this.colorKey;k(this.data,function(e){var f=e[d];if(f=f===null?a:c&&f!==void 0?c.toColor(f,e):e.color||b.color)e.color=f})}};r(v.prototype,"buildText",function(b,a){var c=a.styles&&a.styles.HcTextStroke;b.call(this,a);c&&a.applyTextStroke&&a.applyTextStroke(c)});v.prototype.Element.prototype.applyTextStroke=function(b){var a=this.element,c,d,b=b.split(" ");c=a.getElementsByTagName("tspan");d=a.firstChild;this.ySetter=this.xSetter;k([].slice.call(c),function(c,f){var g;f===0&&(c.setAttribute("x",
|
||||
a.getAttribute("x")),(f=a.getAttribute("y"))!==null&&c.setAttribute("y",f));g=c.cloneNode(1);g.setAttribute("stroke",b[1]);g.setAttribute("stroke-width",b[0]);g.setAttribute("stroke-linejoin","round");a.insertBefore(g,d)})};w.plotOptions.heatmap=l(w.plotOptions.scatter,{animation:!1,borderWidth:0,nullColor:"#F8F8F8",dataLabels:{formatter:function(){return this.point.value},verticalAlign:"middle",crop:!1,overflow:!1,style:{color:"white",fontWeight:"bold",HcTextStroke:"1px rgba(0,0,0,0.5)"}},marker:null,
|
||||
tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{brightness:0.2}}});o.heatmap=A(o.scatter,l(h,{type:"heatmap",pointArrayMap:["y","value"],hasPointSpecificOptions:!0,supportsDrilldown:!0,getExtremesFromAll:!0,init:function(){o.scatter.prototype.init.apply(this,arguments);this.pointRange=this.options.colsize||1;this.yAxis.axisPointRange=this.options.rowsize||1},translate:function(){var b=this.options,a=this.xAxis,c=this.yAxis;this.generatePoints();
|
||||
k(this.points,function(d){var e=(b.colsize||1)/2,f=(b.rowsize||1)/2,g=Math.round(a.len-a.translate(d.x-e,0,1,0,1)),e=Math.round(a.len-a.translate(d.x+e,0,1,0,1)),h=Math.round(c.translate(d.y-f,0,1,0,1)),f=Math.round(c.translate(d.y+f,0,1,0,1));d.plotX=(g+e)/2;d.plotY=(h+f)/2;d.shapeType="rect";d.shapeArgs={x:Math.min(g,e),y:Math.min(h,f),width:Math.abs(e-g),height:Math.abs(f-h)}});this.translateColors();this.chart.hasRendered&&k(this.points,function(a){a.shapeArgs.fill=a.color})},drawPoints:o.column.prototype.drawPoints,
|
||||
animate:n,getBox:n,drawLegendSymbol:t.drawRectangle,getExtremes:function(){u.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;u.prototype.getExtremes.call(this)}}))})(Highcharts);
|
||||
@@ -0,0 +1,675 @@
|
||||
/**
|
||||
* @license Highcharts JS v4.0.3 (2014-07-03)
|
||||
*
|
||||
* (c) 2011-2014 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/*global HighchartsAdapter*/
|
||||
(function (Highcharts) {
|
||||
|
||||
|
||||
var UNDEFINED,
|
||||
Axis = Highcharts.Axis,
|
||||
Chart = Highcharts.Chart,
|
||||
Color = Highcharts.Color,
|
||||
Legend = Highcharts.Legend,
|
||||
LegendSymbolMixin = Highcharts.LegendSymbolMixin,
|
||||
Series = Highcharts.Series,
|
||||
SVGRenderer = Highcharts.SVGRenderer,
|
||||
|
||||
defaultOptions = Highcharts.getOptions(),
|
||||
each = Highcharts.each,
|
||||
extend = Highcharts.extend,
|
||||
extendClass = Highcharts.extendClass,
|
||||
merge = Highcharts.merge,
|
||||
pick = Highcharts.pick,
|
||||
numberFormat = Highcharts.numberFormat,
|
||||
seriesTypes = Highcharts.seriesTypes,
|
||||
wrap = Highcharts.wrap,
|
||||
noop = function () {};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The ColorAxis object for inclusion in gradient legends
|
||||
*/
|
||||
var ColorAxis = Highcharts.ColorAxis = function () {
|
||||
this.isColorAxis = true;
|
||||
this.init.apply(this, arguments);
|
||||
};
|
||||
extend(ColorAxis.prototype, Axis.prototype);
|
||||
extend(ColorAxis.prototype, {
|
||||
defaultColorAxisOptions: {
|
||||
lineWidth: 0,
|
||||
gridLineWidth: 1,
|
||||
tickPixelInterval: 72,
|
||||
startOnTick: true,
|
||||
endOnTick: true,
|
||||
offset: 0,
|
||||
marker: {
|
||||
animation: {
|
||||
duration: 50
|
||||
},
|
||||
color: 'gray',
|
||||
width: 0.01
|
||||
},
|
||||
labels: {
|
||||
overflow: 'justify'
|
||||
},
|
||||
minColor: '#EFEFFF',
|
||||
maxColor: '#003875',
|
||||
tickLength: 5
|
||||
},
|
||||
init: function (chart, userOptions) {
|
||||
var horiz = chart.options.legend.layout !== 'vertical',
|
||||
options;
|
||||
|
||||
// Build the options
|
||||
options = merge(this.defaultColorAxisOptions, {
|
||||
side: horiz ? 2 : 1,
|
||||
reversed: !horiz
|
||||
}, userOptions, {
|
||||
isX: horiz,
|
||||
opposite: !horiz,
|
||||
showEmpty: false,
|
||||
title: null,
|
||||
isColor: true
|
||||
});
|
||||
|
||||
Axis.prototype.init.call(this, chart, options);
|
||||
|
||||
// Base init() pushes it to the xAxis array, now pop it again
|
||||
//chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
|
||||
|
||||
// Prepare data classes
|
||||
if (userOptions.dataClasses) {
|
||||
this.initDataClasses(userOptions);
|
||||
}
|
||||
this.initStops(userOptions);
|
||||
|
||||
// Override original axis properties
|
||||
this.isXAxis = true;
|
||||
this.horiz = horiz;
|
||||
this.zoomEnabled = false;
|
||||
},
|
||||
|
||||
/*
|
||||
* Return an intermediate color between two colors, according to pos where 0
|
||||
* is the from color and 1 is the to color
|
||||
*/
|
||||
tweenColors: function (from, to, pos) {
|
||||
// Check for has alpha, because rgba colors perform worse due to lack of
|
||||
// support in WebKit.
|
||||
var hasAlpha = (to.rgba[3] !== 1 || from.rgba[3] !== 1);
|
||||
return (hasAlpha ? 'rgba(' : 'rgb(') +
|
||||
Math.round(to.rgba[0] + (from.rgba[0] - to.rgba[0]) * (1 - pos)) + ',' +
|
||||
Math.round(to.rgba[1] + (from.rgba[1] - to.rgba[1]) * (1 - pos)) + ',' +
|
||||
Math.round(to.rgba[2] + (from.rgba[2] - to.rgba[2]) * (1 - pos)) +
|
||||
(hasAlpha ? (',' + (to.rgba[3] + (from.rgba[3] - to.rgba[3]) * (1 - pos))) : '') + ')';
|
||||
},
|
||||
|
||||
initDataClasses: function (userOptions) {
|
||||
var axis = this,
|
||||
chart = this.chart,
|
||||
dataClasses,
|
||||
colorCounter = 0,
|
||||
options = this.options;
|
||||
this.dataClasses = dataClasses = [];
|
||||
this.legendItems = [];
|
||||
|
||||
each(userOptions.dataClasses, function (dataClass, i) {
|
||||
var colors;
|
||||
|
||||
dataClass = merge(dataClass);
|
||||
dataClasses.push(dataClass);
|
||||
if (!dataClass.color) {
|
||||
if (options.dataClassColor === 'category') {
|
||||
colors = chart.options.colors;
|
||||
dataClass.color = colors[colorCounter++];
|
||||
// loop back to zero
|
||||
if (colorCounter === colors.length) {
|
||||
colorCounter = 0;
|
||||
}
|
||||
} else {
|
||||
dataClass.color = axis.tweenColors(Color(options.minColor), Color(options.maxColor), i / (userOptions.dataClasses.length - 1));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initStops: function (userOptions) {
|
||||
this.stops = userOptions.stops || [
|
||||
[0, this.options.minColor],
|
||||
[1, this.options.maxColor]
|
||||
];
|
||||
each(this.stops, function (stop) {
|
||||
stop.color = Color(stop[1]);
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Extend the setOptions method to process extreme colors and color
|
||||
* stops.
|
||||
*/
|
||||
setOptions: function (userOptions) {
|
||||
Axis.prototype.setOptions.call(this, userOptions);
|
||||
|
||||
this.options.crosshair = this.options.marker;
|
||||
this.coll = 'colorAxis';
|
||||
},
|
||||
|
||||
setAxisSize: function () {
|
||||
var symbol = this.legendSymbol,
|
||||
chart = this.chart,
|
||||
x,
|
||||
y,
|
||||
width,
|
||||
height;
|
||||
|
||||
if (symbol) {
|
||||
this.left = x = symbol.attr('x');
|
||||
this.top = y = symbol.attr('y');
|
||||
this.width = width = symbol.attr('width');
|
||||
this.height = height = symbol.attr('height');
|
||||
this.right = chart.chartWidth - x - width;
|
||||
this.bottom = chart.chartHeight - y - height;
|
||||
|
||||
this.len = this.horiz ? width : height;
|
||||
this.pos = this.horiz ? x : y;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Translate from a value to a color
|
||||
*/
|
||||
toColor: function (value, point) {
|
||||
var pos,
|
||||
stops = this.stops,
|
||||
from,
|
||||
to,
|
||||
color,
|
||||
dataClasses = this.dataClasses,
|
||||
dataClass,
|
||||
i;
|
||||
|
||||
if (dataClasses) {
|
||||
i = dataClasses.length;
|
||||
while (i--) {
|
||||
dataClass = dataClasses[i];
|
||||
from = dataClass.from;
|
||||
to = dataClass.to;
|
||||
if ((from === UNDEFINED || value >= from) && (to === UNDEFINED || value <= to)) {
|
||||
color = dataClass.color;
|
||||
if (point) {
|
||||
point.dataClass = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (this.isLog) {
|
||||
value = this.val2lin(value);
|
||||
}
|
||||
pos = 1 - ((this.max - value) / ((this.max - this.min) || 1));
|
||||
i = stops.length;
|
||||
while (i--) {
|
||||
if (pos > stops[i][0]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
from = stops[i] || stops[i + 1];
|
||||
to = stops[i + 1] || from;
|
||||
|
||||
// The position within the gradient
|
||||
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
|
||||
|
||||
color = this.tweenColors(
|
||||
from.color,
|
||||
to.color,
|
||||
pos
|
||||
);
|
||||
}
|
||||
return color;
|
||||
},
|
||||
|
||||
getOffset: function () {
|
||||
var group = this.legendGroup,
|
||||
sideOffset = this.chart.axisOffset[this.side];
|
||||
|
||||
if (group) {
|
||||
|
||||
Axis.prototype.getOffset.call(this);
|
||||
|
||||
if (!this.axisGroup.parentGroup) {
|
||||
|
||||
// Move the axis elements inside the legend group
|
||||
this.axisGroup.add(group);
|
||||
this.gridGroup.add(group);
|
||||
this.labelGroup.add(group);
|
||||
|
||||
this.added = true;
|
||||
}
|
||||
// Reset it to avoid color axis reserving space
|
||||
this.chart.axisOffset[this.side] = sideOffset;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Create the color gradient
|
||||
*/
|
||||
setLegendColor: function () {
|
||||
var grad,
|
||||
horiz = this.horiz,
|
||||
options = this.options;
|
||||
|
||||
grad = horiz ? [0, 0, 1, 0] : [0, 0, 0, 1];
|
||||
this.legendColor = {
|
||||
linearGradient: { x1: grad[0], y1: grad[1], x2: grad[2], y2: grad[3] },
|
||||
stops: options.stops || [
|
||||
[0, options.minColor],
|
||||
[1, options.maxColor]
|
||||
]
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* The color axis appears inside the legend and has its own legend symbol
|
||||
*/
|
||||
drawLegendSymbol: function (legend, item) {
|
||||
var padding = legend.padding,
|
||||
legendOptions = legend.options,
|
||||
horiz = this.horiz,
|
||||
box,
|
||||
width = pick(legendOptions.symbolWidth, horiz ? 200 : 12),
|
||||
height = pick(legendOptions.symbolHeight, horiz ? 12 : 200),
|
||||
labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30),
|
||||
itemDistance = pick(legendOptions.itemDistance, 10);
|
||||
|
||||
this.setLegendColor();
|
||||
|
||||
// Create the gradient
|
||||
item.legendSymbol = this.chart.renderer.rect(
|
||||
0,
|
||||
legend.baseline - 11,
|
||||
width,
|
||||
height
|
||||
).attr({
|
||||
zIndex: 1
|
||||
}).add(item.legendGroup);
|
||||
box = item.legendSymbol.getBBox();
|
||||
|
||||
// Set how much space this legend item takes up
|
||||
this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
|
||||
this.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
|
||||
},
|
||||
/**
|
||||
* Fool the legend
|
||||
*/
|
||||
setState: noop,
|
||||
visible: true,
|
||||
setVisible: noop,
|
||||
getSeriesExtremes: function () {
|
||||
var series;
|
||||
if (this.series.length) {
|
||||
series = this.series[0];
|
||||
this.dataMin = series.valueMin;
|
||||
this.dataMax = series.valueMax;
|
||||
}
|
||||
},
|
||||
drawCrosshair: function (e, point) {
|
||||
var newCross = !this.cross,
|
||||
plotX = point && point.plotX,
|
||||
plotY = point && point.plotY,
|
||||
crossPos,
|
||||
axisPos = this.pos,
|
||||
axisLen = this.len;
|
||||
|
||||
if (point) {
|
||||
crossPos = this.toPixels(point.value);
|
||||
if (crossPos < axisPos) {
|
||||
crossPos = axisPos - 2;
|
||||
} else if (crossPos > axisPos + axisLen) {
|
||||
crossPos = axisPos + axisLen + 2;
|
||||
}
|
||||
|
||||
point.plotX = crossPos;
|
||||
point.plotY = this.len - crossPos;
|
||||
Axis.prototype.drawCrosshair.call(this, e, point);
|
||||
point.plotX = plotX;
|
||||
point.plotY = plotY;
|
||||
|
||||
if (!newCross && this.cross) {
|
||||
this.cross
|
||||
.attr({
|
||||
fill: this.crosshair.color
|
||||
})
|
||||
.add(this.labelGroup);
|
||||
}
|
||||
}
|
||||
},
|
||||
getPlotLinePath: function (a, b, c, d, pos) {
|
||||
if (pos) { // crosshairs only
|
||||
return this.horiz ?
|
||||
['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] :
|
||||
['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z'];
|
||||
} else {
|
||||
return Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
|
||||
}
|
||||
},
|
||||
|
||||
update: function (newOptions, redraw) {
|
||||
each(this.series, function (series) {
|
||||
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
|
||||
});
|
||||
Axis.prototype.update.call(this, newOptions, redraw);
|
||||
if (this.legendItem) {
|
||||
this.setLegendColor();
|
||||
this.chart.legend.colorizeItem(this, true);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Get the legend item symbols for data classes
|
||||
*/
|
||||
getDataClassLegendSymbols: function () {
|
||||
var axis = this,
|
||||
chart = this.chart,
|
||||
legendItems = this.legendItems,
|
||||
legendOptions = chart.options.legend,
|
||||
valueDecimals = legendOptions.valueDecimals,
|
||||
valueSuffix = legendOptions.valueSuffix || '',
|
||||
name;
|
||||
|
||||
if (!legendItems.length) {
|
||||
each(this.dataClasses, function (dataClass, i) {
|
||||
var vis = true,
|
||||
from = dataClass.from,
|
||||
to = dataClass.to;
|
||||
|
||||
// Assemble the default name. This can be overridden by legend.options.labelFormatter
|
||||
name = '';
|
||||
if (from === UNDEFINED) {
|
||||
name = '< ';
|
||||
} else if (to === UNDEFINED) {
|
||||
name = '> ';
|
||||
}
|
||||
if (from !== UNDEFINED) {
|
||||
name += numberFormat(from, valueDecimals) + valueSuffix;
|
||||
}
|
||||
if (from !== UNDEFINED && to !== UNDEFINED) {
|
||||
name += ' - ';
|
||||
}
|
||||
if (to !== UNDEFINED) {
|
||||
name += numberFormat(to, valueDecimals) + valueSuffix;
|
||||
}
|
||||
|
||||
// Add a mock object to the legend items
|
||||
legendItems.push(extend({
|
||||
chart: chart,
|
||||
name: name,
|
||||
options: {},
|
||||
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
|
||||
visible: true,
|
||||
setState: noop,
|
||||
setVisible: function () {
|
||||
vis = this.visible = !vis;
|
||||
each(axis.series, function (series) {
|
||||
each(series.points, function (point) {
|
||||
if (point.dataClass === i) {
|
||||
point.setVisible(vis);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
chart.legend.colorizeItem(this, vis);
|
||||
}
|
||||
}, dataClass));
|
||||
});
|
||||
}
|
||||
return legendItems;
|
||||
},
|
||||
name: '' // Prevents 'undefined' in legend in IE8
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Extend the chart getAxes method to also get the color axis
|
||||
*/
|
||||
wrap(Chart.prototype, 'getAxes', function (proceed) {
|
||||
|
||||
var options = this.options,
|
||||
colorAxisOptions = options.colorAxis;
|
||||
|
||||
proceed.call(this);
|
||||
|
||||
this.colorAxis = [];
|
||||
if (colorAxisOptions) {
|
||||
proceed = new ColorAxis(this, colorAxisOptions); // Fake assignment for jsLint
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* Wrap the legend getAllItems method to add the color axis. This also removes the
|
||||
* axis' own series to prevent them from showing up individually.
|
||||
*/
|
||||
wrap(Legend.prototype, 'getAllItems', function (proceed) {
|
||||
var allItems = [],
|
||||
colorAxis = this.chart.colorAxis[0];
|
||||
|
||||
if (colorAxis) {
|
||||
|
||||
// Data classes
|
||||
if (colorAxis.options.dataClasses) {
|
||||
allItems = allItems.concat(colorAxis.getDataClassLegendSymbols());
|
||||
// Gradient legend
|
||||
} else {
|
||||
// Add this axis on top
|
||||
allItems.push(colorAxis);
|
||||
}
|
||||
|
||||
// Don't add the color axis' series
|
||||
each(colorAxis.series, function (series) {
|
||||
series.options.showInLegend = false;
|
||||
});
|
||||
}
|
||||
|
||||
return allItems.concat(proceed.call(this));
|
||||
});/**
|
||||
* Mixin for maps and heatmaps
|
||||
*/
|
||||
var colorSeriesMixin = {
|
||||
|
||||
pointAttrToOptions: { // mapping between SVG attributes and the corresponding options
|
||||
stroke: 'borderColor',
|
||||
'stroke-width': 'borderWidth',
|
||||
fill: 'color',
|
||||
dashstyle: 'dashStyle'
|
||||
},
|
||||
pointArrayMap: ['value'],
|
||||
axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
|
||||
optionalAxis: 'colorAxis',
|
||||
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
|
||||
getSymbol: noop,
|
||||
parallelArrays: ['x', 'y', 'value'],
|
||||
colorKey: 'value',
|
||||
|
||||
/**
|
||||
* In choropleth maps, the color is a result of the value, so this needs translation too
|
||||
*/
|
||||
translateColors: function () {
|
||||
var series = this,
|
||||
nullColor = this.options.nullColor,
|
||||
colorAxis = this.colorAxis,
|
||||
colorKey = this.colorKey;
|
||||
|
||||
each(this.data, function (point) {
|
||||
var value = point[colorKey],
|
||||
color;
|
||||
|
||||
color = value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color;
|
||||
|
||||
if (color) {
|
||||
point.color = color;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Wrap the buildText method and add the hook for add text stroke
|
||||
*/
|
||||
wrap(SVGRenderer.prototype, 'buildText', function (proceed, wrapper) {
|
||||
|
||||
var textStroke = wrapper.styles && wrapper.styles.HcTextStroke;
|
||||
|
||||
proceed.call(this, wrapper);
|
||||
|
||||
// Apply the text stroke
|
||||
if (textStroke && wrapper.applyTextStroke) {
|
||||
wrapper.applyTextStroke(textStroke);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Apply an outside text stroke to data labels, based on the custom CSS property, HcTextStroke.
|
||||
* Consider moving this to Highcharts core, also makes sense on stacked columns etc.
|
||||
*/
|
||||
SVGRenderer.prototype.Element.prototype.applyTextStroke = function (textStroke) {
|
||||
var elem = this.element,
|
||||
tspans,
|
||||
firstChild;
|
||||
|
||||
textStroke = textStroke.split(' ');
|
||||
tspans = elem.getElementsByTagName('tspan');
|
||||
firstChild = elem.firstChild;
|
||||
|
||||
// In order to get the right y position of the clones,
|
||||
// copy over the y setter
|
||||
this.ySetter = this.xSetter;
|
||||
|
||||
each([].slice.call(tspans), function (tspan, y) {
|
||||
var clone;
|
||||
if (y === 0) {
|
||||
tspan.setAttribute('x', elem.getAttribute('x'));
|
||||
if ((y = elem.getAttribute('y')) !== null) {
|
||||
tspan.setAttribute('y', y);
|
||||
}
|
||||
}
|
||||
clone = tspan.cloneNode(1);
|
||||
clone.setAttribute('stroke', textStroke[1]);
|
||||
clone.setAttribute('stroke-width', textStroke[0]);
|
||||
clone.setAttribute('stroke-linejoin', 'round');
|
||||
elem.insertBefore(clone, firstChild);
|
||||
});
|
||||
};
|
||||
/**
|
||||
* Extend the default options with map options
|
||||
*/
|
||||
defaultOptions.plotOptions.heatmap = merge(defaultOptions.plotOptions.scatter, {
|
||||
animation: false,
|
||||
borderWidth: 0,
|
||||
nullColor: '#F8F8F8',
|
||||
dataLabels: {
|
||||
formatter: function () { // #2945
|
||||
return this.point.value;
|
||||
},
|
||||
verticalAlign: 'middle',
|
||||
crop: false,
|
||||
overflow: false,
|
||||
style: {
|
||||
color: 'white',
|
||||
fontWeight: 'bold',
|
||||
HcTextStroke: '1px rgba(0,0,0,0.5)'
|
||||
}
|
||||
},
|
||||
marker: null,
|
||||
tooltip: {
|
||||
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
|
||||
},
|
||||
states: {
|
||||
normal: {
|
||||
animation: true
|
||||
},
|
||||
hover: {
|
||||
brightness: 0.2
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// The Heatmap series type
|
||||
seriesTypes.heatmap = extendClass(seriesTypes.scatter, merge(colorSeriesMixin, {
|
||||
type: 'heatmap',
|
||||
pointArrayMap: ['y', 'value'],
|
||||
hasPointSpecificOptions: true,
|
||||
supportsDrilldown: true,
|
||||
getExtremesFromAll: true,
|
||||
init: function () {
|
||||
seriesTypes.scatter.prototype.init.apply(this, arguments);
|
||||
this.pointRange = this.options.colsize || 1;
|
||||
this.yAxis.axisPointRange = this.options.rowsize || 1; // general point range
|
||||
},
|
||||
translate: function () {
|
||||
var series = this,
|
||||
options = series.options,
|
||||
xAxis = series.xAxis,
|
||||
yAxis = series.yAxis;
|
||||
|
||||
series.generatePoints();
|
||||
|
||||
each(series.points, function (point) {
|
||||
var xPad = (options.colsize || 1) / 2,
|
||||
yPad = (options.rowsize || 1) / 2,
|
||||
x1 = Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)),
|
||||
x2 = Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)),
|
||||
y1 = Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)),
|
||||
y2 = Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1));
|
||||
|
||||
// Set plotX and plotY for use in K-D-Tree and more
|
||||
point.plotX = (x1 + x2) / 2;
|
||||
point.plotY = (y1 + y2) / 2;
|
||||
|
||||
point.shapeType = 'rect';
|
||||
point.shapeArgs = {
|
||||
x: Math.min(x1, x2),
|
||||
y: Math.min(y1, y2),
|
||||
width: Math.abs(x2 - x1),
|
||||
height: Math.abs(y2 - y1)
|
||||
};
|
||||
});
|
||||
|
||||
series.translateColors();
|
||||
|
||||
// Make sure colors are updated on colorAxis update (#2893)
|
||||
if (this.chart.hasRendered) {
|
||||
each(series.points, function (point) {
|
||||
point.shapeArgs.fill = point.color;
|
||||
});
|
||||
}
|
||||
},
|
||||
drawPoints: seriesTypes.column.prototype.drawPoints,
|
||||
animate: noop,
|
||||
getBox: noop,
|
||||
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
|
||||
|
||||
getExtremes: function () {
|
||||
// Get the extremes from the value data
|
||||
Series.prototype.getExtremes.call(this, this.valueData);
|
||||
this.valueMin = this.dataMin;
|
||||
this.valueMax = this.dataMax;
|
||||
|
||||
// Get the extremes from the y data
|
||||
Series.prototype.getExtremes.call(this);
|
||||
}
|
||||
|
||||
}));
|
||||
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,12 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
Plugin for displaying a message when there is no data visible in chart.
|
||||
|
||||
(c) 2010-2014 Highsoft AS
|
||||
Author: Oystein Moseng
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(c){function f(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var d=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),i=c.extend;i(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"},attr:{},style:{fontWeight:"bold",fontSize:"12px",color:"#60606a"}};if(d.pie)d.pie.prototype.hasData=f;if(d.gauge)d.gauge.prototype.hasData=f;if(d.waterfall)d.waterfall.prototype.hasData=f;c.Series.prototype.hasData=
|
||||
function(){return this.dataMax!==void 0&&this.dataMin!==void 0};e.showNoData=function(a){var b=this.options,a=a||b.lang.noData,b=b.noData;if(!this.noDataLabel)this.noDataLabel=this.renderer.label(a,0,0,null,null,null,null,null,"no-data").attr(b.attr).css(b.style).add(),this.noDataLabel.align(i(this.noDataLabel.getBBox(),b.position),!1,"plotBox")};e.hideNoData=function(){if(this.noDataLabel)this.noDataLabel=this.noDataLabel.destroy()};e.hasData=function(){for(var a=this.series,b=a.length;b--;)if(a[b].hasData()&&
|
||||
!a[b].options.isInternal)return!0;return!1};e.callbacks.push(function(a){c.addEvent(a,"load",g);c.addEvent(a,"redraw",g)})})(Highcharts);
|
||||
@@ -0,0 +1,130 @@
|
||||
/**
|
||||
* @license Highcharts JS v4.0.3 (2014-07-03)
|
||||
* Plugin for displaying a message when there is no data visible in chart.
|
||||
*
|
||||
* (c) 2010-2014 Highsoft AS
|
||||
* Author: Oystein Moseng
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
(function (H) { // docs
|
||||
|
||||
var seriesTypes = H.seriesTypes,
|
||||
chartPrototype = H.Chart.prototype,
|
||||
defaultOptions = H.getOptions(),
|
||||
extend = H.extend;
|
||||
|
||||
// Add language option
|
||||
extend(defaultOptions.lang, {
|
||||
noData: 'No data to display'
|
||||
});
|
||||
|
||||
// Add default display options for message
|
||||
defaultOptions.noData = {
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
align: 'center',
|
||||
verticalAlign: 'middle'
|
||||
},
|
||||
attr: {
|
||||
},
|
||||
style: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
color: '#60606a'
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Define hasData functions for series. These return true if there are data points on this series within the plot area
|
||||
*/
|
||||
function hasDataPie() {
|
||||
return !!this.points.length; /* != 0 */
|
||||
}
|
||||
|
||||
if (seriesTypes.pie) {
|
||||
seriesTypes.pie.prototype.hasData = hasDataPie;
|
||||
}
|
||||
|
||||
if (seriesTypes.gauge) {
|
||||
seriesTypes.gauge.prototype.hasData = hasDataPie;
|
||||
}
|
||||
|
||||
if (seriesTypes.waterfall) {
|
||||
seriesTypes.waterfall.prototype.hasData = hasDataPie;
|
||||
}
|
||||
|
||||
H.Series.prototype.hasData = function () {
|
||||
return this.dataMax !== undefined && this.dataMin !== undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* Display a no-data message.
|
||||
*
|
||||
* @param {String} str An optional message to show in place of the default one
|
||||
*/
|
||||
chartPrototype.showNoData = function (str) {
|
||||
var chart = this,
|
||||
options = chart.options,
|
||||
text = str || options.lang.noData,
|
||||
noDataOptions = options.noData;
|
||||
|
||||
if (!chart.noDataLabel) {
|
||||
chart.noDataLabel = chart.renderer.label(text, 0, 0, null, null, null, null, null, 'no-data')
|
||||
.attr(noDataOptions.attr)
|
||||
.css(noDataOptions.style)
|
||||
.add();
|
||||
chart.noDataLabel.align(extend(chart.noDataLabel.getBBox(), noDataOptions.position), false, 'plotBox');
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Hide no-data message
|
||||
*/
|
||||
chartPrototype.hideNoData = function () {
|
||||
var chart = this;
|
||||
if (chart.noDataLabel) {
|
||||
chart.noDataLabel = chart.noDataLabel.destroy();
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns true if there are data points within the plot area now
|
||||
*/
|
||||
chartPrototype.hasData = function () {
|
||||
var chart = this,
|
||||
series = chart.series,
|
||||
i = series.length;
|
||||
|
||||
while (i--) {
|
||||
if (series[i].hasData() && !series[i].options.isInternal) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Show no-data message if there is no data in sight. Otherwise, hide it.
|
||||
*/
|
||||
function handleNoData() {
|
||||
var chart = this;
|
||||
if (chart.hasData()) {
|
||||
chart.hideNoData();
|
||||
} else {
|
||||
chart.showNoData();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add event listener to handle automatic display of no-data message
|
||||
*/
|
||||
chartPrototype.callbacks.push(function (chart) {
|
||||
H.addEvent(chart, 'load', handleNoData);
|
||||
H.addEvent(chart, 'redraw', handleNoData);
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,13 @@
|
||||
/*
|
||||
Highcharts JS v4.0.3 (2014-07-03)
|
||||
Solid angular gauge module
|
||||
|
||||
(c) 2010-2014 Torstein Honsi
|
||||
|
||||
License: www.highcharts.com/license
|
||||
*/
|
||||
(function(a){var k=a.getOptions().plotOptions,q=a.pInt,r=a.pick,l=a.each,n;k.solidgauge=a.merge(k.gauge,{colorByPoint:!0});n={initDataClasses:function(b){var h=this,e=this.chart,c,m=0,f=this.options;this.dataClasses=c=[];l(b.dataClasses,function(g,d){var i,g=a.merge(g);c.push(g);if(!g.color)f.dataClassColor==="category"?(i=e.options.colors,g.color=i[m++],m===i.length&&(m=0)):g.color=h.tweenColors(a.Color(f.minColor),a.Color(f.maxColor),d/(b.dataClasses.length-1))})},initStops:function(b){this.stops=
|
||||
b.stops||[[0,this.options.minColor],[1,this.options.maxColor]];l(this.stops,function(b){b.color=a.Color(b[1])})},toColor:function(b,h){var e,c=this.stops,a,f=this.dataClasses,g,d;if(f)for(d=f.length;d--;){if(g=f[d],a=g.from,c=g.to,(a===void 0||b>=a)&&(c===void 0||b<=c)){e=g.color;if(h)h.dataClass=d;break}}else{this.isLog&&(b=this.val2lin(b));e=1-(this.max-b)/(this.max-this.min);for(d=c.length;d--;)if(e>c[d][0])break;a=c[d]||c[d+1];c=c[d+1]||a;e=1-(c[0]-e)/(c[0]-a[0]||1);e=this.tweenColors(a.color,
|
||||
c.color,e)}return e},tweenColors:function(b,a,e){var c=a.rgba[3]!==1||b.rgba[3]!==1;return b.rgba.length===0||a.rgba.length===0?"none":(c?"rgba(":"rgb(")+Math.round(a.rgba[0]+(b.rgba[0]-a.rgba[0])*(1-e))+","+Math.round(a.rgba[1]+(b.rgba[1]-a.rgba[1])*(1-e))+","+Math.round(a.rgba[2]+(b.rgba[2]-a.rgba[2])*(1-e))+(c?","+(a.rgba[3]+(b.rgba[3]-a.rgba[3])*(1-e)):"")+")"}};a.seriesTypes.solidgauge=a.extendClass(a.seriesTypes.gauge,{type:"solidgauge",bindAxes:function(){var b;a.seriesTypes.gauge.prototype.bindAxes.call(this);
|
||||
b=this.yAxis;a.extend(b,n);b.options.dataClasses&&b.initDataClasses(b.options);b.initStops(b.options)},drawPoints:function(){var b=this,h=b.yAxis,e=h.center,c=b.options,m=b.chart.renderer;a.each(b.points,function(f){var g=f.graphic,d=h.startAngleRad+h.translate(f.y,null,null,null,!0),i=q(r(c.radius,100))*e[2]/200,o=q(r(c.innerRadius,60))*e[2]/200,p=h.toColor(f.y,f),k;if(p!=="none")k=f.color,f.color=p;c.wrap===!1&&(d=Math.max(h.startAngleRad,Math.min(h.endAngleRad,d)));var d=d*180/Math.PI,j=d/(180/
|
||||
Math.PI),l=h.startAngleRad,d=Math.min(j,l),j=Math.max(j,l);j-d>2*Math.PI&&(j=d+2*Math.PI);i={x:e[0],y:e[1],r:i,innerR:o,start:d,end:j};g?(o=i.d,g.attr({fill:f.color}).animate(i,{step:function(b,c){g.attr("fill",n.tweenColors(a.Color(k),a.Color(p),c.pos))}}),i.d=o):f.graphic=m.arc(i).attr({stroke:c.borderColor||"none","stroke-width":c.borderWidth||0,fill:f.color,"sweep-flag":0}).add(b.group)})},animate:null})})(Highcharts);
|
||||
@@ -0,0 +1,234 @@
|
||||
/**
|
||||
* @license Highcharts JS v4.0.3 (2014-07-03)
|
||||
* Solid angular gauge module
|
||||
*
|
||||
* (c) 2010-2014 Torstein Honsi
|
||||
*
|
||||
* License: www.highcharts.com/license
|
||||
*/
|
||||
|
||||
/*global Highcharts*/
|
||||
(function (H) {
|
||||
"use strict";
|
||||
|
||||
var defaultPlotOptions = H.getOptions().plotOptions,
|
||||
pInt = H.pInt,
|
||||
pick = H.pick,
|
||||
each = H.each,
|
||||
colorAxisMethods,
|
||||
UNDEFINED;
|
||||
|
||||
// The default options
|
||||
defaultPlotOptions.solidgauge = H.merge(defaultPlotOptions.gauge, {
|
||||
colorByPoint: true
|
||||
});
|
||||
|
||||
|
||||
// These methods are defined in the ColorAxis object, and copied here.
|
||||
// If we implement an AMD system we should make ColorAxis a dependency.
|
||||
colorAxisMethods = {
|
||||
|
||||
|
||||
initDataClasses: function (userOptions) {
|
||||
var axis = this,
|
||||
chart = this.chart,
|
||||
dataClasses,
|
||||
colorCounter = 0,
|
||||
options = this.options;
|
||||
this.dataClasses = dataClasses = [];
|
||||
|
||||
each(userOptions.dataClasses, function (dataClass, i) {
|
||||
var colors;
|
||||
|
||||
dataClass = H.merge(dataClass);
|
||||
dataClasses.push(dataClass);
|
||||
if (!dataClass.color) {
|
||||
if (options.dataClassColor === 'category') {
|
||||
colors = chart.options.colors;
|
||||
dataClass.color = colors[colorCounter++];
|
||||
// loop back to zero
|
||||
if (colorCounter === colors.length) {
|
||||
colorCounter = 0;
|
||||
}
|
||||
} else {
|
||||
dataClass.color = axis.tweenColors(H.Color(options.minColor), H.Color(options.maxColor), i / (userOptions.dataClasses.length - 1));
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
initStops: function (userOptions) {
|
||||
this.stops = userOptions.stops || [
|
||||
[0, this.options.minColor],
|
||||
[1, this.options.maxColor]
|
||||
];
|
||||
each(this.stops, function (stop) {
|
||||
stop.color = H.Color(stop[1]);
|
||||
});
|
||||
},
|
||||
/**
|
||||
* Translate from a value to a color
|
||||
*/
|
||||
toColor: function (value, point) {
|
||||
var pos,
|
||||
stops = this.stops,
|
||||
from,
|
||||
to,
|
||||
color,
|
||||
dataClasses = this.dataClasses,
|
||||
dataClass,
|
||||
i;
|
||||
|
||||
if (dataClasses) {
|
||||
i = dataClasses.length;
|
||||
while (i--) {
|
||||
dataClass = dataClasses[i];
|
||||
from = dataClass.from;
|
||||
to = dataClass.to;
|
||||
if ((from === UNDEFINED || value >= from) && (to === UNDEFINED || value <= to)) {
|
||||
color = dataClass.color;
|
||||
if (point) {
|
||||
point.dataClass = i;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
if (this.isLog) {
|
||||
value = this.val2lin(value);
|
||||
}
|
||||
pos = 1 - ((this.max - value) / (this.max - this.min));
|
||||
i = stops.length;
|
||||
while (i--) {
|
||||
if (pos > stops[i][0]) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
from = stops[i] || stops[i + 1];
|
||||
to = stops[i + 1] || from;
|
||||
|
||||
// The position within the gradient
|
||||
pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
|
||||
|
||||
color = this.tweenColors(
|
||||
from.color,
|
||||
to.color,
|
||||
pos
|
||||
);
|
||||
}
|
||||
return color;
|
||||
},
|
||||
tweenColors: function (from, to, pos) {
|
||||
// Check for has alpha, because rgba colors perform worse due to lack of
|
||||
// support in WebKit.
|
||||
var hasAlpha = (to.rgba[3] !== 1 || from.rgba[3] !== 1);
|
||||
|
||||
if (from.rgba.length === 0 || to.rgba.length === 0) {
|
||||
return 'none';
|
||||
}
|
||||
return (hasAlpha ? 'rgba(' : 'rgb(') +
|
||||
Math.round(to.rgba[0] + (from.rgba[0] - to.rgba[0]) * (1 - pos)) + ',' +
|
||||
Math.round(to.rgba[1] + (from.rgba[1] - to.rgba[1]) * (1 - pos)) + ',' +
|
||||
Math.round(to.rgba[2] + (from.rgba[2] - to.rgba[2]) * (1 - pos)) +
|
||||
(hasAlpha ? (',' + (to.rgba[3] + (from.rgba[3] - to.rgba[3]) * (1 - pos))) : '') + ')';
|
||||
}
|
||||
};
|
||||
|
||||
// The series prototype
|
||||
H.seriesTypes.solidgauge = H.extendClass(H.seriesTypes.gauge, {
|
||||
type: 'solidgauge',
|
||||
|
||||
bindAxes: function () {
|
||||
var axis;
|
||||
H.seriesTypes.gauge.prototype.bindAxes.call(this);
|
||||
|
||||
axis = this.yAxis;
|
||||
H.extend(axis, colorAxisMethods);
|
||||
|
||||
// Prepare data classes
|
||||
if (axis.options.dataClasses) {
|
||||
axis.initDataClasses(axis.options);
|
||||
}
|
||||
axis.initStops(axis.options);
|
||||
},
|
||||
|
||||
/**
|
||||
* Draw the points where each point is one needle
|
||||
*/
|
||||
drawPoints: function () {
|
||||
var series = this,
|
||||
yAxis = series.yAxis,
|
||||
center = yAxis.center,
|
||||
options = series.options,
|
||||
renderer = series.chart.renderer;
|
||||
|
||||
H.each(series.points, function (point) {
|
||||
var graphic = point.graphic,
|
||||
rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true),
|
||||
radius = (pInt(pick(options.radius, 100)) * center[2]) / 200,
|
||||
innerRadius = (pInt(pick(options.innerRadius, 60)) * center[2]) / 200,
|
||||
shapeArgs,
|
||||
d,
|
||||
toColor = yAxis.toColor(point.y, point),
|
||||
fromColor;
|
||||
|
||||
if (toColor !== 'none') {
|
||||
fromColor = point.color;
|
||||
point.color = toColor;
|
||||
}
|
||||
|
||||
// Handle the wrap option
|
||||
if (options.wrap === false) {
|
||||
rotation = Math.max(yAxis.startAngleRad, Math.min(yAxis.endAngleRad, rotation));
|
||||
}
|
||||
rotation = rotation * 180 / Math.PI;
|
||||
|
||||
var angle1 = rotation / (180 / Math.PI),
|
||||
angle2 = yAxis.startAngleRad,
|
||||
minAngle = Math.min(angle1, angle2),
|
||||
maxAngle = Math.max(angle1, angle2);
|
||||
|
||||
if (maxAngle - minAngle > 2 * Math.PI) {
|
||||
maxAngle = minAngle + 2 * Math.PI;
|
||||
}
|
||||
|
||||
shapeArgs = {
|
||||
x: center[0],
|
||||
y: center[1],
|
||||
r: radius,
|
||||
innerR: innerRadius,
|
||||
start: minAngle,
|
||||
end: maxAngle
|
||||
};
|
||||
|
||||
if (graphic) {
|
||||
d = shapeArgs.d;
|
||||
|
||||
/*jslint unparam: true*/
|
||||
graphic.attr({
|
||||
fill: point.color
|
||||
}).animate(shapeArgs, {
|
||||
step: function (value, fx) {
|
||||
graphic.attr('fill', colorAxisMethods.tweenColors(H.Color(fromColor), H.Color(toColor), fx.pos));
|
||||
}
|
||||
});
|
||||
/*jslint unparam: false*/
|
||||
shapeArgs.d = d; // animate alters it
|
||||
} else {
|
||||
point.graphic = renderer.arc(shapeArgs)
|
||||
.attr({
|
||||
stroke: options.borderColor || 'none',
|
||||
'stroke-width': options.borderWidth || 0,
|
||||
fill: point.color,
|
||||
'sweep-flag': 0
|
||||
})
|
||||
.add(series.group);
|
||||
}
|
||||
});
|
||||
},
|
||||
animate: null
|
||||
});
|
||||
|
||||
}(Highcharts));
|
||||
@@ -0,0 +1,254 @@
|
||||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(48, 48, 96)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,255 @@
|
||||
/**
|
||||
* Dark blue theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#55BF3B", "#DF5353", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgb(48, 96, 48)'],
|
||||
[1, 'rgb(0, 0, 0)']
|
||||
]
|
||||
},
|
||||
borderColor: '#000000',
|
||||
borderWidth: 2,
|
||||
className: 'dark-container',
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .1)',
|
||||
plotBorderColor: '#CCCCCC',
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#C0C0C0',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#333333',
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
tickColor: '#A0A0A0',
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#333333',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#A0A0A0'
|
||||
}
|
||||
},
|
||||
lineColor: '#A0A0A0',
|
||||
minorTickInterval: null,
|
||||
tickColor: '#A0A0A0',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.75)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#A0A0A0'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#444'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: 'rgb(35, 35, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#C0C0C0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,213 @@
|
||||
/**
|
||||
* Dark theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Unica+One',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#2b908f", "#90ee7e", "#f45b5b", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, '#2a2a2b'],
|
||||
[1, '#3e3e40']
|
||||
]
|
||||
},
|
||||
style: {
|
||||
fontFamily: "'Unica One', sans-serif"
|
||||
},
|
||||
plotBorderColor: '#606063'
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#E0E0E3',
|
||||
textTransform: 'uppercase',
|
||||
fontSize: '20px'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#E0E0E3',
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#707073',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#E0E0E3'
|
||||
}
|
||||
},
|
||||
lineColor: '#707073',
|
||||
minorGridLineColor: '#505053',
|
||||
tickColor: '#707073',
|
||||
title: {
|
||||
style: {
|
||||
color: '#A0A0A3'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
gridLineColor: '#707073',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#E0E0E3'
|
||||
}
|
||||
},
|
||||
lineColor: '#707073',
|
||||
minorGridLineColor: '#505053',
|
||||
tickColor: '#707073',
|
||||
tickWidth: 1,
|
||||
title: {
|
||||
style: {
|
||||
color: '#A0A0A3'
|
||||
}
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: 'rgba(0, 0, 0, 0.85)',
|
||||
style: {
|
||||
color: '#F0F0F0'
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
dataLabels: {
|
||||
color: '#B0B0B3'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
boxplot: {
|
||||
fillColor: '#505053'
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
},
|
||||
errorbar: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
color: '#E0E0E3'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#606063'
|
||||
}
|
||||
},
|
||||
credits: {
|
||||
style: {
|
||||
color: '#666'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#707073'
|
||||
}
|
||||
},
|
||||
|
||||
drilldown: {
|
||||
activeAxisLabelStyle: {
|
||||
color: '#F0F0F3'
|
||||
},
|
||||
activeDataLabelStyle: {
|
||||
color: '#F0F0F3'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
theme: {
|
||||
fill: '#505053'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: '#505053',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: '#707073',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: '#000003',
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputBoxBorderColor: '#505053',
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(255,255,255,0.1)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
},
|
||||
xAxis: {
|
||||
gridLineColor: '#505053'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: '#808083',
|
||||
barBorderColor: '#808083',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: '#606063',
|
||||
buttonBorderColor: '#606063',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: '#404043',
|
||||
trackBorderColor: '#404043'
|
||||
},
|
||||
|
||||
// special colors for some of the
|
||||
legendBackgroundColor: 'rgba(0, 0, 0, 0.5)',
|
||||
background2: '#505053',
|
||||
dataLabelsColor: '#B0B0B3',
|
||||
textColor: '#C0C0C0',
|
||||
contrastTextColor: '#F0F0F3',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,257 @@
|
||||
/**
|
||||
* Gray theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#DDDF0D", "#7798BF", "#55BF3B", "#DF5353", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(96, 96, 96)'],
|
||||
[1, 'rgb(16, 16, 16)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
borderRadius: 0,
|
||||
plotBackgroundColor: null,
|
||||
plotShadow: false,
|
||||
plotBorderWidth: 0
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#FFF',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#DDD',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#999',
|
||||
tickColor: '#999',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: null,
|
||||
minorTickInterval: null,
|
||||
gridLineColor: 'rgba(255, 255, 255, .1)',
|
||||
minorGridLineColor: 'rgba(255,255,255,0.07)',
|
||||
lineWidth: 0,
|
||||
tickWidth: 0,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#999',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#AAA',
|
||||
font: 'bold 12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#FFF'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: '#333'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgba(96, 96, 96, .8)'],
|
||||
[1, 'rgba(16, 16, 16, .8)']
|
||||
]
|
||||
},
|
||||
borderWidth: 0,
|
||||
style: {
|
||||
color: '#FFF'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
plotOptions: {
|
||||
series: {
|
||||
nullColor: '#444444'
|
||||
},
|
||||
line: {
|
||||
dataLabels: {
|
||||
color: '#CCC'
|
||||
},
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
spline: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
scatter: {
|
||||
marker: {
|
||||
lineColor: '#333'
|
||||
}
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: 'white'
|
||||
}
|
||||
},
|
||||
|
||||
toolbar: {
|
||||
itemStyle: {
|
||||
color: '#CCC'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
symbolStroke: '#DDDDDD',
|
||||
hoverSymbolStroke: '#FFFFFF',
|
||||
theme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#606060'],
|
||||
[0.6, '#333333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000'
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
// scroll charts
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: '#CCC',
|
||||
fontWeight: 'bold'
|
||||
},
|
||||
states: {
|
||||
hover: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#BBB'],
|
||||
[0.6, '#888']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'white'
|
||||
}
|
||||
},
|
||||
select: {
|
||||
fill: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.1, '#000'],
|
||||
[0.3, '#333']
|
||||
]
|
||||
},
|
||||
stroke: '#000000',
|
||||
style: {
|
||||
color: 'yellow'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
inputStyle: {
|
||||
backgroundColor: '#333',
|
||||
color: 'silver'
|
||||
},
|
||||
labelStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
|
||||
navigator: {
|
||||
handles: {
|
||||
backgroundColor: '#666',
|
||||
borderColor: '#AAA'
|
||||
},
|
||||
outlineColor: '#CCC',
|
||||
maskFill: 'rgba(16, 16, 16, 0.5)',
|
||||
series: {
|
||||
color: '#7798BF',
|
||||
lineColor: '#A6C7ED'
|
||||
}
|
||||
},
|
||||
|
||||
scrollbar: {
|
||||
barBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
barBorderColor: '#CCC',
|
||||
buttonArrowColor: '#CCC',
|
||||
buttonBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0.4, '#888'],
|
||||
[0.6, '#555']
|
||||
]
|
||||
},
|
||||
buttonBorderColor: '#CCC',
|
||||
rifleColor: '#FFF',
|
||||
trackBackgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
||||
stops: [
|
||||
[0, '#000'],
|
||||
[1, '#333']
|
||||
]
|
||||
},
|
||||
trackBorderColor: '#666'
|
||||
},
|
||||
|
||||
// special colors for some of the demo examples
|
||||
legendBackgroundColor: 'rgba(48, 48, 48, 0.8)',
|
||||
background2: 'rgb(70, 70, 70)',
|
||||
dataLabelsColor: '#444',
|
||||
textColor: '#E0E0E0',
|
||||
maskColor: 'rgba(255,255,255,0.3)'
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,74 @@
|
||||
/**
|
||||
* Grid-light theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Dosis:400,600',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#7cb5ec", "#f7a35c", "#90ee7e", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: null,
|
||||
style: {
|
||||
fontFamily: "Dosis, sans-serif"
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
fontSize: '16px',
|
||||
fontWeight: 'bold',
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
borderWidth: 0,
|
||||
backgroundColor: 'rgba(219,219,216,0.8)',
|
||||
shadow: false
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '13px'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
fontSize: '12px'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
minorTickInterval: 'auto',
|
||||
title: {
|
||||
style: {
|
||||
textTransform: 'uppercase'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
fontSize: '12px'
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
candlestick: {
|
||||
lineColor: '#404048'
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
// General
|
||||
background2: '#F0F0EA'
|
||||
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,103 @@
|
||||
/**
|
||||
* Grid theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ['#058DC7', '#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4'],
|
||||
chart: {
|
||||
backgroundColor: {
|
||||
linearGradient: { x1: 0, y1: 0, x2: 1, y2: 1 },
|
||||
stops: [
|
||||
[0, 'rgb(255, 255, 255)'],
|
||||
[1, 'rgb(240, 240, 255)']
|
||||
]
|
||||
},
|
||||
borderWidth: 2,
|
||||
plotBackgroundColor: 'rgba(255, 255, 255, .9)',
|
||||
plotShadow: true,
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: 'bold 16px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#666666',
|
||||
font: 'bold 12px "Trebuchet MS", Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 1,
|
||||
lineColor: '#000',
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
minorTickInterval: 'auto',
|
||||
lineColor: '#000',
|
||||
lineWidth: 1,
|
||||
tickWidth: 1,
|
||||
tickColor: '#000',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#000',
|
||||
font: '11px Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#333',
|
||||
fontWeight: 'bold',
|
||||
fontSize: '12px',
|
||||
fontFamily: 'Trebuchet MS, Verdana, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: 'black'
|
||||
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: '#039'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'gray'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#99b'
|
||||
}
|
||||
},
|
||||
|
||||
navigation: {
|
||||
buttonOptions: {
|
||||
theme: {
|
||||
stroke: '#CCCCCC'
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,104 @@
|
||||
/**
|
||||
* Sand-Signika theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
// Load the fonts
|
||||
Highcharts.createElement('link', {
|
||||
href: 'http://fonts.googleapis.com/css?family=Signika:400,700',
|
||||
rel: 'stylesheet',
|
||||
type: 'text/css'
|
||||
}, null, document.getElementsByTagName('head')[0]);
|
||||
|
||||
// Add the background image to the container
|
||||
Highcharts.wrap(Highcharts.Chart.prototype, 'getContainer', function (proceed) {
|
||||
proceed.call(this);
|
||||
this.container.style.background = 'url(http://www.highcharts.com/samples/graphics/sand.png)';
|
||||
});
|
||||
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#f45b5b", "#8085e9", "#8d4654", "#7798BF", "#aaeeee", "#ff0066", "#eeaaee",
|
||||
"#55BF3B", "#DF5353", "#7798BF", "#aaeeee"],
|
||||
chart: {
|
||||
backgroundColor: null,
|
||||
style: {
|
||||
fontFamily: "Signika, serif"
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: 'black',
|
||||
fontSize: '16px',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: 'black'
|
||||
}
|
||||
},
|
||||
tooltip: {
|
||||
borderWidth: 0
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
fontWeight: 'bold',
|
||||
fontSize: '13px'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
labels: {
|
||||
style: {
|
||||
color: '#6e6e70'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
labels: {
|
||||
style: {
|
||||
color: '#6e6e70'
|
||||
}
|
||||
}
|
||||
},
|
||||
plotOptions: {
|
||||
series: {
|
||||
shadow: true
|
||||
},
|
||||
candlestick: {
|
||||
lineColor: '#404048'
|
||||
},
|
||||
map: {
|
||||
shadow: false
|
||||
}
|
||||
},
|
||||
|
||||
// Highstock specific
|
||||
navigator: {
|
||||
xAxis: {
|
||||
gridLineColor: '#D0D0D8'
|
||||
}
|
||||
},
|
||||
rangeSelector: {
|
||||
buttonTheme: {
|
||||
fill: 'white',
|
||||
stroke: '#C0C0C8',
|
||||
'stroke-width': 1,
|
||||
states: {
|
||||
select: {
|
||||
fill: '#D0D0D8'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollbar: {
|
||||
trackBorderColor: '#C0C0C8'
|
||||
},
|
||||
|
||||
// General
|
||||
background2: '#E0E0E8'
|
||||
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
Highcharts.setOptions(Highcharts.theme);
|
||||
@@ -0,0 +1,89 @@
|
||||
/**
|
||||
* Skies theme for Highcharts JS
|
||||
* @author Torstein Honsi
|
||||
*/
|
||||
|
||||
Highcharts.theme = {
|
||||
colors: ["#514F78", "#42A07B", "#9B5E4A", "#72727F", "#1F949A", "#82914E", "#86777F", "#42A07B"],
|
||||
chart: {
|
||||
className: 'skies',
|
||||
borderWidth: 0,
|
||||
plotShadow: true,
|
||||
plotBackgroundImage: 'http://www.highcharts.com/demo/gfx/skies.jpg',
|
||||
plotBackgroundColor: {
|
||||
linearGradient: [0, 0, 250, 500],
|
||||
stops: [
|
||||
[0, 'rgba(255, 255, 255, 1)'],
|
||||
[1, 'rgba(255, 255, 255, 0)']
|
||||
]
|
||||
},
|
||||
plotBorderWidth: 1
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#3E576F',
|
||||
font: '16px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
subtitle: {
|
||||
style: {
|
||||
color: '#6D869F',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
},
|
||||
xAxis: {
|
||||
gridLineWidth: 0,
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
alternateGridColor: 'rgba(255, 255, 255, .5)',
|
||||
lineColor: '#C0D0E0',
|
||||
tickColor: '#C0D0E0',
|
||||
tickWidth: 1,
|
||||
labels: {
|
||||
style: {
|
||||
color: '#666',
|
||||
fontWeight: 'bold'
|
||||
}
|
||||
},
|
||||
title: {
|
||||
style: {
|
||||
color: '#666',
|
||||
font: '12px Lucida Grande, Lucida Sans Unicode, Verdana, Arial, Helvetica, sans-serif'
|
||||
}
|
||||
}
|
||||
},
|
||||
legend: {
|
||||
itemStyle: {
|
||||
font: '9pt Trebuchet MS, Verdana, sans-serif',
|
||||
color: '#3E576F'
|
||||
},
|
||||
itemHoverStyle: {
|
||||
color: 'black'
|
||||
},
|
||||
itemHiddenStyle: {
|
||||
color: 'silver'
|
||||
}
|
||||
},
|
||||
labels: {
|
||||
style: {
|
||||
color: '#3E576F'
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Apply the theme
|
||||
var highchartsOptions = Highcharts.setOptions(Highcharts.theme);
|
||||
Reference in New Issue
Block a user