From 60f8d690e995005017f741150e86e25425ea28a1 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Sun, 7 Jan 2018 14:30:28 +0100 Subject: Remove unused files --- .../js/adapters/standalone-framework.src.js | 603 - html/includes/js/highcharts-3d.src.js | 1383 -- html/includes/js/highcharts-more.src.js | 2575 --- html/includes/js/highcharts.src.js | 17737 ------------------- html/includes/js/jquery.tooltip.js | 119 - html/includes/js/jquery.tooltipster.js | 1327 -- html/includes/js/modules/canvas-tools.src.js | 3113 ---- html/includes/js/modules/data.src.js | 1025 -- html/includes/js/modules/drilldown.src.js | 606 - html/includes/js/modules/exporting.src.js | 719 - html/includes/js/modules/funnel.src.js | 310 - html/includes/js/modules/heatmap.src.js | 687 - html/includes/js/modules/no-data-to-display.src.js | 130 - html/includes/js/modules/solid-gauge.src.js | 234 - 14 files changed, 30568 deletions(-) delete mode 100644 html/includes/js/adapters/standalone-framework.src.js delete mode 100644 html/includes/js/highcharts-3d.src.js delete mode 100644 html/includes/js/highcharts-more.src.js delete mode 100644 html/includes/js/highcharts.src.js delete mode 100644 html/includes/js/jquery.tooltip.js delete mode 100644 html/includes/js/jquery.tooltipster.js delete mode 100644 html/includes/js/modules/canvas-tools.src.js delete mode 100644 html/includes/js/modules/data.src.js delete mode 100644 html/includes/js/modules/drilldown.src.js delete mode 100644 html/includes/js/modules/exporting.src.js delete mode 100644 html/includes/js/modules/funnel.src.js delete mode 100644 html/includes/js/modules/heatmap.src.js delete mode 100644 html/includes/js/modules/no-data-to-display.src.js delete mode 100644 html/includes/js/modules/solid-gauge.src.js (limited to 'html/includes/js') diff --git a/html/includes/js/adapters/standalone-framework.src.js b/html/includes/js/adapters/standalone-framework.src.js deleted file mode 100644 index f403b0d..0000000 --- a/html/includes/js/adapters/standalone-framework.src.js +++ /dev/null @@ -1,603 +0,0 @@ -/** - * @license Highcharts JS v4.0.4 (2014-09-02) - * - * Standalone Highcharts Framework - * - * License: MIT License - */ - - -/*global Highcharts */ -var HighchartsAdapter = (function () { - -var UNDEFINED, - doc = document, - emptyArray = [], - timers = [], - timerId, - animSetters = {}, - 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 - - // Animation setter defined from outside - if (animSetters[this.prop]) { - animSetters[this.prop](this); - - // Animating a path definition on SVGElement - } else 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 = 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); - }, - - /** - * Add an animation setter for a specific property - */ - addAnimSetter: function (prop, fn) { - animSetters[prop] = fn; - }, - - /** - * 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); - } -}; -}()); diff --git a/html/includes/js/highcharts-3d.src.js b/html/includes/js/highcharts-3d.src.js deleted file mode 100644 index 7cee3e5..0000000 --- a/html/includes/js/highcharts-3d.src.js +++ /dev/null @@ -1,1383 +0,0 @@ -// ==ClosureCompiler== -// @compilation_level SIMPLE_OPTIMIZATIONS - -/** - * @license Highcharts JS v4.0.4 (2014-09-02) - * - * (c) 2009-2013 Torstein Hønsi - * - * License: www.highcharts.com/license - */ - -// JSLint options: -/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console */ - -(function (Highcharts) { - /** - Shorthands for often used function -*/ -/** - * Mathematical Functionility - */ -var PI = Math.PI, - deg2rad = (PI / 180), // degrees to radians - sin = Math.sin, - cos = Math.cos, - - round = Math.round; - -function perspective(points, angle2, angle1, origin) { - angle1 *= deg2rad; - angle2 *= deg2rad; - - var result = [], - xe, - ye, - ze; - - angle1 *= -1; - - xe = origin.x; - ye = origin.y; - ze = (origin.z === 0 ? 0.0001 : origin.z) * (origin.vd || 25); - - // some kind of minimum? - ze = Math.max(500, ze); - - var s1 = sin(angle1), - c1 = cos(angle1), - s2 = sin(angle2), - c2 = cos(angle2); - - var x, y, z, p; - - Highcharts.each(points, function (point) { - x = point.x - xe; - y = point.y - ye; - z = point.z || 0; - - p = { - x: c1 * x - s1 * z, - y: -s1 * s2 * x - c1 * s2 * z + c2 * y, - z: s1 * c2 * x + c1 * c2 * z + s2 * y - }; - - p.x = p.x * ((ze - p.z) / ze) + xe; - p.y = p.y * ((ze - p.z) / ze) + ye; - - result.push({x: round(p.x), y: round(p.y), z: round(p.z)}); - }); - return result; -} -/*** - EXTENSION TO THE SVG-RENDERER TO ENABLE 3D SHAPES - ***/ -////// HELPER METHODS ////// -var dFactor = (4 * (Math.sqrt(2) - 1) / 3) / (PI / 2); - -function defined(obj) { - return obj !== undefined && obj !== null; -} - - -function curveTo(cx, cy, rx, ry, start, end, dx, dy) { - var result = []; - if ((end > start) && (end - start > PI / 2 + 0.0001)) { - result = result.concat(curveTo(cx, cy, rx, ry, start, start + (PI / 2), dx, dy)); - result = result.concat(curveTo(cx, cy, rx, ry, start + (PI / 2), end, dx, dy)); - return result; - } else if ((end < start) && (start - end > PI / 2 + 0.0001)) { - result = result.concat(curveTo(cx, cy, rx, ry, start, start - (PI / 2), dx, dy)); - result = result.concat(curveTo(cx, cy, rx, ry, start - (PI / 2), end, dx, dy)); - return result; - } else { - var arcAngle = end - start; - return [ - 'C', - cx + (rx * cos(start)) - ((rx * dFactor * arcAngle) * sin(start)) + dx, - cy + (ry * sin(start)) + ((ry * dFactor * arcAngle) * cos(start)) + dy, - cx + (rx * cos(end)) + ((rx * dFactor * arcAngle) * sin(end)) + dx, - cy + (ry * sin(end)) - ((ry * dFactor * arcAngle) * cos(end)) + dy, - - cx + (rx * cos(end)) + dx, - cy + (ry * sin(end)) + dy - ]; - } -} - -Highcharts.SVGRenderer.prototype.toLinePath = function (points, closed) { - var result = []; - - // Put "L x y" for each point - Highcharts.each(points, function (point) { - result.push('L', point.x, point.y); - }); - - // Set the first element to M - result[0] = 'M'; - - // If it is a closed line, add Z - if (closed) { - result.push('Z'); - } - - return result; -}; - -////// CUBOIDS ////// -Highcharts.SVGRenderer.prototype.cuboid = function (shapeArgs) { - - var result = this.g(), - paths = this.cuboidPath(shapeArgs); - - result.front = this.path(paths[0]).attr({zIndex: paths[3], 'stroke-linejoin': 'round'}).add(result); - result.top = this.path(paths[1]).attr({zIndex: paths[4], 'stroke-linejoin': 'round'}).add(result); - result.side = this.path(paths[2]).attr({zIndex: paths[5], 'stroke-linejoin': 'round'}).add(result); - - result.fillSetter = function (color) { - var c0 = color, - c1 = Highcharts.Color(color).brighten(0.1).get(), - c2 = Highcharts.Color(color).brighten(-0.1).get(); - - this.front.attr({fill: c0}); - this.top.attr({fill: c1}); - this.side.attr({fill: c2}); - - this.color = color; - return this; - }; - - result.opacitySetter = function (opacity) { - this.front.attr({opacity: opacity}); - this.top.attr({opacity: opacity}); - this.side.attr({opacity: opacity}); - return this; - }; - - result.attr = function (args) { - if (args.shapeArgs || defined(args.x)) { - var shapeArgs = args.shapeArgs || args; - var paths = this.renderer.cuboidPath(shapeArgs); - this.front.attr({d: paths[0], zIndex: paths[3]}); - this.top.attr({d: paths[1], zIndex: paths[4]}); - this.side.attr({d: paths[2], zIndex: paths[5]}); - } else { - Highcharts.SVGElement.prototype.attr.call(this, args); - } - - return this; - }; - - result.animate = function (args, duration, complete) { - if (defined(args.x) && defined(args.y)) { - var paths = this.renderer.cuboidPath(args); - this.front.attr({zIndex: paths[3]}).animate({d: paths[0]}, duration, complete); - this.top.attr({zIndex: paths[4]}).animate({d: paths[1]}, duration, complete); - this.side.attr({zIndex: paths[5]}).animate({d: paths[2]}, duration, complete); - } else if (args.opacity) { - this.front.animate(args, duration, complete); - this.top.animate(args, duration, complete); - this.side.animate(args, duration, complete); - } else { - Highcharts.SVGElement.prototype.animate.call(this, args, duration, complete); - } - return this; - }; - - result.destroy = function () { - this.front.destroy(); - this.top.destroy(); - this.side.destroy(); - - return null; - }; - - // Apply the Z index to the cuboid group - result.attr({ zIndex: -paths[3] }); - - return result; -}; - - -Highcharts.SVGRenderer.prototype.cuboidPath = function (shapeArgs) { - var x = shapeArgs.x, - y = shapeArgs.y, - z = shapeArgs.z, - h = shapeArgs.height, - w = shapeArgs.width, - d = shapeArgs.depth, - alpha = shapeArgs.alpha, - beta = shapeArgs.beta, - origin = shapeArgs.origin; - - var pArr = [ - {x: x, y: y, z: z}, - {x: x + w, y: y, z: z}, - {x: x + w, y: y + h, z: z}, - {x: x, y: y + h, z: z}, - {x: x, y: y + h, z: z + d}, - {x: x + w, y: y + h, z: z + d}, - {x: x + w, y: y, z: z + d}, - {x: x, y: y, z: z + d} - ]; - - pArr = perspective(pArr, alpha, beta, origin); - - var path1, // FRONT - path2, // TOP OR BOTTOM - path3; // LEFT OR RIGHT - - // front - path1 = [ - 'M', pArr[0].x, pArr[0].y, - 'L', pArr[1].x, pArr[1].y, - 'L', pArr[2].x, pArr[2].y, - 'L', pArr[3].x, pArr[3].y, - 'Z' - ]; - var z1 = (pArr[0].z + pArr[1].z + pArr[2].z + pArr[3].z) / 4; - - // top or bottom - var top = [ - 'M', pArr[0].x, pArr[0].y, - 'L', pArr[7].x, pArr[7].y, - 'L', pArr[6].x, pArr[6].y, - 'L', pArr[1].x, pArr[1].y, - 'Z' - ]; - var bottom = [ - 'M', pArr[3].x, pArr[3].y, - 'L', pArr[2].x, pArr[2].y, - 'L', pArr[5].x, pArr[5].y, - 'L', pArr[4].x, pArr[4].y, - 'Z' - ]; - if (pArr[7].y < pArr[1].y) { - path2 = top; - } else if (pArr[4].y > pArr[2].y) { - path2 = bottom; - } else { - path2 = []; - } - var z2 = (beta > 0 ? (pArr[0].z + pArr[7].z + pArr[6].z + pArr[1].z) / 4 : (pArr[3].z + pArr[2].z + pArr[5].z + pArr[4].z) / 4); - - // side - var right = [ - 'M', pArr[1].x, pArr[1].y, - 'L', pArr[2].x, pArr[2].y, - 'L', pArr[5].x, pArr[5].y, - 'L', pArr[6].x, pArr[6].y, - 'Z' - ]; - var left = [ - 'M', pArr[0].x, pArr[0].y, - 'L', pArr[7].x, pArr[7].y, - 'L', pArr[4].x, pArr[4].y, - 'L', pArr[3].x, pArr[3].y, - 'Z' - ]; - if (pArr[6].x > pArr[1].x) { - path3 = right; - } else if (pArr[7].x < pArr[0].x) { - path3 = left; - } else { - path3 = []; - } - var z3 = (alpha > 0 ? (pArr[1].z + pArr[2].z + pArr[5].z + pArr[6].z) / 4 : (pArr[0].z + pArr[7].z + pArr[4].z + pArr[3].z) / 4); - - return [path1, path2, path3, z1, z2, z3]; -}; - -////// SECTORS ////// -Highcharts.SVGRenderer.prototype.arc3d = function (shapeArgs) { - - shapeArgs.alpha *= deg2rad; - shapeArgs.beta *= deg2rad; - var result = this.g(), - paths = this.arc3dPath(shapeArgs), - renderer = result.renderer; - - var zIndex = paths.zTop * 100; - - result.shapeArgs = shapeArgs; // Store for later use - - result.top = renderer.path(paths.top).attr({zIndex: paths.zTop}).add(result); - result.side1 = renderer.path(paths.side2).attr({zIndex: paths.zSide2}); - result.side2 = renderer.path(paths.side1).attr({zIndex: paths.zSide1}); - result.inn = renderer.path(paths.inn).attr({zIndex: paths.zInn}); - result.out = renderer.path(paths.out).attr({zIndex: paths.zOut}); - - result.fillSetter = function (color) { - this.color = color; - - var c0 = color, - c2 = Highcharts.Color(color).brighten(-0.1).get(); - - this.side1.attr({fill: c2}); - this.side2.attr({fill: c2}); - this.inn.attr({fill: c2}); - this.out.attr({fill: c2}); - this.top.attr({fill: c0}); - return this; - }; - - result.translateXSetter = function (value) { - this.out.attr({translateX: value}); - this.inn.attr({translateX: value}); - this.side1.attr({translateX: value}); - this.side2.attr({translateX: value}); - this.top.attr({translateX: value}); - }; - - result.translateYSetter = function (value) { - this.out.attr({translateY: value}); - this.inn.attr({translateY: value}); - this.side1.attr({translateY: value}); - this.side2.attr({translateY: value}); - this.top.attr({translateY: value}); - }; - - result.animate = function (args, duration, complete) { - if (defined(args.end) || defined(args.start)) { - this._shapeArgs = this.shapeArgs; - - Highcharts.SVGElement.prototype.animate.call(this, { - _args: args - }, { - duration: duration, - step: function () { - var args = arguments, - fx = args[1], - result = fx.elem, - start = result._shapeArgs, - end = fx.end, - pos = fx.pos, - sA = Highcharts.merge(start, { - x: start.x + ((end.x - start.x) * pos), - y: start.y + ((end.y - start.y) * pos), - r: start.r + ((end.r - start.r) * pos), - innerR: start.innerR + ((end.innerR - start.innerR) * pos), - start: start.start + ((end.start - start.start) * pos), - end: start.end + ((end.end - start.end) * pos) - }); - - var paths = result.renderer.arc3dPath(sA); - - result.shapeArgs = sA; - - result.top.attr({d: paths.top, zIndex: paths.zTop}); - result.inn.attr({d: paths.inn, zIndex: paths.zInn}); - result.out.attr({d: paths.out, zIndex: paths.zOut}); - result.side1.attr({d: paths.side1, zIndex: paths.zSide1}); - result.side2.attr({d: paths.side2, zIndex: paths.zSide2}); - - } - }, complete); - } else { - Highcharts.SVGElement.prototype.animate.call(this, args, duration, complete); - } - return this; - }; - - result.destroy = function () { - this.top.destroy(); - this.out.destroy(); - this.inn.destroy(); - this.side1.destroy(); - this.side2.destroy(); - - Highcharts.SVGElement.prototype.destroy.call(this); - }; - result.hide = function () { - this.top.hide(); - this.out.hide(); - this.inn.hide(); - this.side1.hide(); - this.side2.hide(); - }; - result.show = function () { - this.top.show(); - this.out.show(); - this.inn.show(); - this.side1.show(); - this.side2.show(); - }; - - result.zIndex = zIndex; - result.attr({zIndex: zIndex}); - return result; -}; - - -Highcharts.SVGRenderer.prototype.arc3dPath = function (shapeArgs) { - var cx = shapeArgs.x, - cy = shapeArgs.y, - start = shapeArgs.start, - end = shapeArgs.end - 0.00001, - r = shapeArgs.r, - ir = shapeArgs.innerR, - d = shapeArgs.depth, - alpha = shapeArgs.alpha, - beta = shapeArgs.beta; - - // Some Variables - var cs = cos(start), - ss = sin(start), - ce = cos(end), - se = sin(end), - rx = r * cos(beta), - ry = r * cos(alpha), - irx = ir * cos(beta), - iry = ir * cos(alpha), - dx = d * sin(beta), - dy = d * sin(alpha); - - // TOP - var top = ['M', cx + (rx * cs), cy + (ry * ss)]; - top = top.concat(curveTo(cx, cy, rx, ry, start, end, 0, 0)); - top = top.concat([ - 'L', cx + (irx * ce), cy + (iry * se) - ]); - top = top.concat(curveTo(cx, cy, irx, iry, end, start, 0, 0)); - top = top.concat(['Z']); - - // OUTSIDE - var b = (beta > 0 ? PI / 2 : 0), - a = (alpha > 0 ? 0 : PI / 2); - - var start2 = start > -b ? start : (end > -b ? -b : start), - end2 = end < PI - a ? end : (start < PI - a ? PI - a : end); - - var out = ['M', cx + (rx * cos(start2)), cy + (ry * sin(start2))]; - out = out.concat(curveTo(cx, cy, rx, ry, start2, end2, 0, 0)); - out = out.concat([ - 'L', cx + (rx * cos(end2)) + dx, cy + (ry * sin(end2)) + dy - ]); - out = out.concat(curveTo(cx, cy, rx, ry, end2, start2, dx, dy)); - out = out.concat(['Z']); - - // INSIDE - var inn = ['M', cx + (irx * cs), cy + (iry * ss)]; - inn = inn.concat(curveTo(cx, cy, irx, iry, start, end, 0, 0)); - inn = inn.concat([ - 'L', cx + (irx * cos(end)) + dx, cy + (iry * sin(end)) + dy - ]); - inn = inn.concat(curveTo(cx, cy, irx, iry, end, start, dx, dy)); - inn = inn.concat(['Z']); - - // SIDES - var side1 = [ - 'M', cx + (rx * cs), cy + (ry * ss), - 'L', cx + (rx * cs) + dx, cy + (ry * ss) + dy, - 'L', cx + (irx * cs) + dx, cy + (iry * ss) + dy, - 'L', cx + (irx * cs), cy + (iry * ss), - 'Z' - ]; - var side2 = [ - 'M', cx + (rx * ce), cy + (ry * se), - 'L', cx + (rx * ce) + dx, cy + (ry * se) + dy, - 'L', cx + (irx * ce) + dx, cy + (iry * se) + dy, - 'L', cx + (irx * ce), cy + (iry * se), - 'Z' - ]; - - var a1 = sin((start + end) / 2), - a2 = sin(start), - a3 = sin(end); - - return { - top: top, - zTop: r, - out: out, - zOut: Math.max(a1, a2, a3) * r, - inn: inn, - zInn: Math.max(a1, a2, a3) * r, - side1: side1, - zSide1: a2 * (r * 0.99), - side2: side2, - zSide2: a3 * (r * 0.99) - }; -}; -/*** - EXTENSION FOR 3D CHARTS -***/ -// Shorthand to check the is3d flag -Highcharts.Chart.prototype.is3d = function () { - return this.options.chart.options3d && this.options.chart.options3d.enabled; -}; - -Highcharts.wrap(Highcharts.Chart.prototype, 'isInsidePlot', function (proceed) { - if (this.is3d()) { - return true; - } else { - return proceed.apply(this, [].slice.call(arguments, 1)); - } -}); - -var defaultChartOptions = Highcharts.getOptions(); -defaultChartOptions.chart.options3d = { - enabled: false, - alpha: 0, - beta: 0, - depth: 100, - viewDistance: 25, - frame: { - bottom: { size: 1, color: 'rgba(255,255,255,0)' }, - side: { size: 1, color: 'rgba(255,255,255,0)' }, - back: { size: 1, color: 'rgba(255,255,255,0)' } - } -}; - -Highcharts.wrap(Highcharts.Chart.prototype, 'init', function (proceed) { - var args = [].slice.call(arguments, 1), - plotOptions, - pieOptions; - - if (args[0].chart.options3d && args[0].chart.options3d.enabled) { - plotOptions = args[0].plotOptions || {}; - pieOptions = plotOptions.pie || {}; - - pieOptions.borderColor = Highcharts.pick(pieOptions.borderColor, undefined); - } - proceed.apply(this, args); -}); - -Highcharts.wrap(Highcharts.Chart.prototype, 'setChartSize', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - if (this.is3d()) { - var inverted = this.inverted, - clipBox = this.clipBox, - margin = this.margin, - x = inverted ? 'y' : 'x', - y = inverted ? 'x' : 'y', - w = inverted ? 'height' : 'width', - h = inverted ? 'width' : 'height'; - - clipBox[x] = -(margin[3] || 0); - clipBox[y] = -(margin[0] || 0); - clipBox[w] = this.chartWidth + (margin[3] || 0) + (margin[1] || 0); - clipBox[h] = this.chartHeight + (margin[0] || 0) + (margin[2] || 0); - } -}); - -Highcharts.wrap(Highcharts.Chart.prototype, 'redraw', function (proceed) { - if (this.is3d()) { - // Set to force a redraw of all elements - this.isDirtyBox = true; - } - proceed.apply(this, [].slice.call(arguments, 1)); -}); - -Highcharts.Chart.prototype.retrieveStacks = function (grouping, stacking) { - - var stacks = {}, - i = 1; - - if (grouping || !stacking) { return this.series; } - - Highcharts.each(this.series, function (S) { - if (!stacks[S.options.stack || 0]) { - stacks[S.options.stack || 0] = { series: [S], position: i}; - i++; - } else { - stacks[S.options.stack || 0].series.push(S); - } - }); - stacks.totalStacks = i + 1; - return stacks; -}; - -/*** - EXTENSION TO THE AXIS -***/ -Highcharts.wrap(Highcharts.Axis.prototype, 'init', function (proceed) { - var args = arguments; - if (args[1].is3d()) { - args[2].tickWidth = Highcharts.pick(args[2].tickWidth, 0); - args[2].gridLineWidth = Highcharts.pick(args[2].gridLineWidth, 1); - } - - proceed.apply(this, [].slice.call(arguments, 1)); -}); -Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return; - } - - var chart = this.chart, - renderer = chart.renderer, - options3d = chart.options.chart.options3d, - alpha = options3d.alpha, - beta = options3d.beta * (chart.yAxis[0].opposite ? -1 : 1), - frame = options3d.frame, - fbottom = frame.bottom, - fback = frame.back, - fside = frame.side, - depth = options3d.depth, - height = this.height, - width = this.width, - left = this.left, - top = this.top; - - var origin = { - x: chart.plotLeft + (chart.plotWidth / 2), - y: chart.plotTop + (chart.plotHeight / 2), - z: depth, - vd: options3d.viewDistance - }; - if (this.horiz) { - /// BOTTOM - if (this.axisLine) { - this.axisLine.hide(); - } - var bottomShape = { - x: left, - y: top + (chart.yAxis[0].reversed ? -fbottom.size : height), - z: 0, - width: width, - height: fbottom.size, - depth: depth, - alpha: alpha, - beta: beta, - origin: origin - }; - if (!this.bottomFrame) { - this.bottomFrame = renderer.cuboid(bottomShape).attr({fill: fbottom.color, zIndex: (chart.yAxis[0].reversed && alpha > 0 ? 4 : -1)}).css({stroke: fbottom.color}).add(); - } else { - this.bottomFrame.animate(bottomShape); - } - } else { - // BACK - var backShape = { - x: left, - y: top, - z: depth + 1, - width: width, - height: height + fbottom.size, - depth: fback.size, - alpha: alpha, - beta: beta, - origin: origin - }; - if (!this.backFrame) { - this.backFrame = renderer.cuboid(backShape).attr({fill: fback.color, zIndex: -3}).css({stroke: fback.color}).add(); - } else { - this.backFrame.animate(backShape); - } - // SIDE - if (this.axisLine) { - this.axisLine.hide(); - } - var sideShape = { - x: (chart.yAxis[0].opposite ? width : 0) + left - fside.size, - y: top, - z: 0, - width: fside.size, - height: height + fbottom.size, - depth: depth + fback.size, - alpha: alpha, - beta: beta, - origin: origin - }; - if (!this.sideFrame) { - this.sideFrame = renderer.cuboid(sideShape).attr({fill: fside.color, zIndex: -2}).css({stroke: fside.color}).add(); - } else { - this.sideFrame.animate(sideShape); - } - } -}); - -Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotLinePath', function (proceed) { - var path = proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return path; - } - - if (path === null) { return path; } - - var chart = this.chart, - options3d = chart.options.chart.options3d; - - var d = options3d.depth; - - options3d.origin = { - x: chart.plotLeft + (chart.plotWidth / 2), - y: chart.plotTop + (chart.plotHeight / 2), - z: d, - vd: options3d.viewDistance - }; - - var pArr = [ - { x: path[1], y: path[2], z : (this.horiz || this.opposite ? d : 0)}, - { x: path[1], y: path[2], z : d }, - { x: path[4], y: path[5], z : d }, - { x: path[4], y: path[5], z : (this.horiz || this.opposite ? 0 : d)} - ]; - - var alpha = chart.options.inverted ? options3d.beta : options3d.alpha, - beta = chart.options.inverted ? options3d.alpha : options3d.beta; - - beta *= (chart.yAxis[0].opposite ? -1 : 1); - - pArr = perspective(pArr, alpha, beta, options3d.origin); - path = this.chart.renderer.toLinePath(pArr, false); - - return path; -}); - -Highcharts.wrap(Highcharts.Axis.prototype, 'getPlotBandPath', function (proceed) { - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return proceed.apply(this, [].slice.call(arguments, 1)); - } else { - var args = arguments, - from = args[1], - to = args[2]; - - var toPath = this.getPlotLinePath(to), - path = this.getPlotLinePath(from); - - if (path && toPath) { - path.push( - toPath[7], // These two do not exist in the regular getPlotLine - toPath[8], // ---- # 3005 - toPath[4], - toPath[5], - toPath[1], - toPath[2] - ); - } else { // outside the axis area - path = null; - } - - return path; - } -}); - -/*** - EXTENSION TO THE TICKS -***/ - -Highcharts.wrap(Highcharts.Tick.prototype, 'getMarkPath', function (proceed) { - var path = proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.axis.chart.is3d()) { - return path; - } - - var chart = this.axis.chart, - options3d = chart.options.chart.options3d; - - var origin = { - x: chart.plotLeft + (chart.plotWidth / 2), - y: chart.plotTop + (chart.plotHeight / 2), - z: options3d.depth, - vd: options3d.viewDistance - }; - - var pArr = [ - {x: path[1], y: path[2], z: 0}, - {x: path[4], y: path[5], z: 0} - ]; - - var alpha = chart.inverted ? options3d.beta : options3d.alpha, - beta = chart.inverted ? options3d.alpha : options3d.beta; - - beta *= (chart.yAxis[0].opposite ? -1 : 1); - - pArr = perspective(pArr, alpha, beta, origin); - path = [ - 'M', pArr[0].x, pArr[0].y, - 'L', pArr[1].x, pArr[1].y - ]; - return path; -}); - -Highcharts.wrap(Highcharts.Tick.prototype, 'getLabelPosition', function (proceed) { - var pos = proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.axis.chart.is3d()) { - return pos; - } - - var chart = this.axis.chart, - options3d = chart.options.chart.options3d; - - var origin = { - x: chart.plotLeft + (chart.plotWidth / 2), - y: chart.plotTop + (chart.plotHeight / 2), - z: options3d.depth, - vd: options3d.viewDistance - }; - - var alpha = chart.inverted ? options3d.beta : options3d.alpha, - beta = chart.inverted ? options3d.alpha : options3d.beta; - - beta *= (chart.yAxis[0].opposite ? -1 : 1); - - pos = perspective([{x: pos.x, y: pos.y, z: 0}], alpha, beta, origin)[0]; - return pos; -}); - -Highcharts.wrap(Highcharts.Axis.prototype, 'drawCrosshair', function (proceed) { - var args = arguments; - if (this.chart.is3d()) { - if (args[2]) { - args[2] = { - plotX: args[2].plotXold || args[2].plotX, - plotY: args[2].plotYold || args[2].plotY - }; - } - } - proceed.apply(this, [].slice.call(args, 1)); -});/*** - EXTENSION FOR 3D COLUMNS -***/ -Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'translate', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return; - } - - var series = this, - chart = series.chart, - options = chart.options, - seriesOptions = series.options, - options3d = options.chart.options3d, - - depth = seriesOptions.depth || 25, - origin = { - x: chart.plotWidth / 2, - y: chart.plotHeight / 2, - z: options3d.depth, - vd: options3d.viewDistance - }, - alpha = options3d.alpha, - beta = options3d.beta * (chart.yAxis[0].opposite ? -1 : 1); - - var stack = seriesOptions.stacking ? (seriesOptions.stack || 0) : series._i; - var z = stack * (depth + (seriesOptions.groupZPadding || 1)); - - if (seriesOptions.grouping !== false) { z = 0; } - - z += (seriesOptions.groupZPadding || 1); - - Highcharts.each(series.data, function (point) { - if (point.y !== null) { - var shapeArgs = point.shapeArgs, - tooltipPos = point.tooltipPos; - - point.shapeType = 'cuboid'; - shapeArgs.alpha = alpha; - shapeArgs.beta = beta; - shapeArgs.z = z; - shapeArgs.origin = origin; - shapeArgs.depth = depth; - - // Translate the tooltip position in 3d space - tooltipPos = perspective([{ x: tooltipPos[0], y: tooltipPos[1], z: z }], alpha, beta, origin)[0]; - point.tooltipPos = [tooltipPos.x, tooltipPos.y]; - } - }); -}); - -Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'animate', function (proceed) { - if (!this.chart.is3d()) { - proceed.apply(this, [].slice.call(arguments, 1)); - } else { - var args = arguments, - init = args[1], - yAxis = this.yAxis, - series = this, - reversed = this.yAxis.reversed; - - if (Highcharts.svg) { // VML is too slow anyway - if (init) { - Highcharts.each(series.data, function (point) { - if (point.y !== null) { - point.height = point.shapeArgs.height; - point.shapey = point.shapeArgs.y; //#2968 - point.shapeArgs.height = 1; - if (!reversed) { - if (point.stackY) { - point.shapeArgs.y = point.plotY + yAxis.translate(point.stackY); - } else { - point.shapeArgs.y = point.plotY + (point.negative ? -point.height : point.height); - } - } - } - }); - - } else { // run the animation - Highcharts.each(series.data, function (point) { - if (point.y !== null) { - point.shapeArgs.height = point.height; - point.shapeArgs.y = point.shapey; //#2968 - // null value do not have a graphic - if (point.graphic) { - point.graphic.animate(point.shapeArgs, series.options.animation); - } - } - }); - - // redraw datalabels to the correct position - this.drawDataLabels(); - - // delete this function to allow it only once - series.animate = null; - } - } - } -}); - -Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'init', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - if (this.chart.is3d()) { - var seriesOptions = this.options, - grouping = seriesOptions.grouping, - stacking = seriesOptions.stacking, - z = 0; - - if (!(grouping !== undefined && !grouping) && stacking) { - var stacks = this.chart.retrieveStacks(grouping, stacking), - stack = seriesOptions.stack || 0, - i; // position within the stack - for (i = 0; i < stacks[stack].series.length; i++) { - if (stacks[stack].series[i] === this) { - break; - } - } - z = (stacks.totalStacks * 10) - (10 * (stacks.totalStacks - stacks[stack].position)) - i; - } - - seriesOptions.zIndex = z; - } -}); -function draw3DPoints(proceed) { - // Do not do this if the chart is not 3D - if (this.chart.is3d()) { - var grouping = this.chart.options.plotOptions.column.grouping; - if (grouping !== undefined && !grouping && this.group.zIndex !== undefined) { - this.group.attr({zIndex : (this.group.zIndex * 10)}); - } - - var options = this.options, - states = this.options.states; - - this.borderWidth = options.borderWidth = options.edgeWidth || 1; - - Highcharts.each(this.data, function (point) { - if (point.y !== null) { - var pointAttr = point.pointAttr; - - // Set the border color to the fill color to provide a smooth edge - this.borderColor = Highcharts.pick(options.edgeColor, pointAttr[''].fill); - - pointAttr[''].stroke = this.borderColor; - pointAttr.hover.stroke = Highcharts.pick(states.hover.edgeColor, this.borderColor); - pointAttr.select.stroke = Highcharts.pick(states.select.edgeColor, this.borderColor); - } - }); - } - - proceed.apply(this, [].slice.call(arguments, 1)); -} - -Highcharts.wrap(Highcharts.Series.prototype, 'alignDataLabel', function (proceed) { - - // Only do this for 3D columns and columnranges - if (this.chart.is3d() && (this.type === 'column' || this.type === 'columnrange')) { - var series = this, - chart = series.chart, - options = chart.options, - options3d = options.chart.options3d, - origin = { - x: chart.plotWidth / 2, - y: chart.plotHeight / 2, - z: options3d.depth, - vd: options3d.viewDistance - }, - alpha = options3d.alpha, - beta = options3d.beta * (chart.yAxis[0].opposite ? -1 : 1); - - var args = arguments, - alignTo = args[4]; - - var pos = ({x: alignTo.x, y: alignTo.y, z: 0}); - pos = perspective([pos], alpha, beta, origin)[0]; - alignTo.x = pos.x; - alignTo.y = pos.y; - } - - proceed.apply(this, [].slice.call(arguments, 1)); -}); - -if (Highcharts.seriesTypes.columnrange) { - Highcharts.wrap(Highcharts.seriesTypes.columnrange.prototype, 'drawPoints', draw3DPoints); -} - -Highcharts.wrap(Highcharts.seriesTypes.column.prototype, 'drawPoints', draw3DPoints); - -/*** - EXTENSION FOR 3D CYLINDRICAL COLUMNS - Not supported -***/ -var defaultOptions = Highcharts.getOptions(); -defaultOptions.plotOptions.cylinder = Highcharts.merge(defaultOptions.plotOptions.column); -var CylinderSeries = Highcharts.extendClass(Highcharts.seriesTypes.column, { - type: 'cylinder' -}); -Highcharts.seriesTypes.cylinder = CylinderSeries; - -Highcharts.wrap(Highcharts.seriesTypes.cylinder.prototype, 'translate', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return; - } - - var series = this, - chart = series.chart, - options = chart.options, - cylOptions = options.plotOptions.cylinder, - options3d = options.chart.options3d, - depth = cylOptions.depth || 0, - origin = { - x: chart.inverted ? chart.plotHeight / 2 : chart.plotWidth / 2, - y: chart.inverted ? chart.plotWidth / 2 : chart.plotHeight / 2, - z: options3d.depth, - vd: options3d.viewDistance - }, - alpha = options3d.alpha; - - var z = cylOptions.stacking ? (this.options.stack || 0) * depth : series._i * depth; - z += depth / 2; - - if (cylOptions.grouping !== false) { z = 0; } - - Highcharts.each(series.data, function (point) { - var shapeArgs = point.shapeArgs; - point.shapeType = 'arc3d'; - shapeArgs.x += depth / 2; - shapeArgs.z = z; - shapeArgs.start = 0; - shapeArgs.end = 2 * PI; - shapeArgs.r = depth * 0.95; - shapeArgs.innerR = 0; - shapeArgs.depth = shapeArgs.height * (1 / sin((90 - alpha) * deg2rad)) - z; - shapeArgs.alpha = 90 - alpha; - shapeArgs.beta = 0; - shapeArgs.origin = origin; - }); -}); -/*** - EXTENSION FOR 3D PIES -***/ - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'translate', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - // Do not do this if the chart is not 3D - if (!this.chart.is3d()) { - return; - } - - var series = this, - chart = series.chart, - options = chart.options, - seriesOptions = series.options, - depth = seriesOptions.depth || 0, - options3d = options.chart.options3d, - origin = { - x: chart.plotWidth / 2, - y: chart.plotHeight / 2, - z: options3d.depth - }, - alpha = options3d.alpha, - beta = options3d.beta; - - var z = seriesOptions.stacking ? (seriesOptions.stack || 0) * depth : series._i * depth; - z += depth / 2; - - if (seriesOptions.grouping !== false) { z = 0; } - - Highcharts.each(series.data, function (point) { - point.shapeType = 'arc3d'; - var shapeArgs = point.shapeArgs; - - if (point.y) { // will be false if null or 0 #3006 - shapeArgs.z = z; - shapeArgs.depth = depth * 0.75; - shapeArgs.origin = origin; - shapeArgs.alpha = alpha; - shapeArgs.beta = beta; - - var angle = (shapeArgs.end + shapeArgs.start) / 2; - - point.slicedTranslation = { - translateX : round(cos(angle) * series.options.slicedOffset * cos(alpha * deg2rad)), - translateY : round(sin(angle) * series.options.slicedOffset * cos(alpha * deg2rad)) - }; - } else { - shapeArgs = null; - } - }); -}); - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype.pointClass.prototype, 'haloPath', function (proceed) { - var args = arguments; - return this.series.chart.is3d() ? [] : proceed.call(this, args[1]); -}); - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawPoints', function (proceed) { - // Do not do this if the chart is not 3D - if (this.chart.is3d()) { - var options = this.options, - states = this.options.states; - - // Set the border color to the fill color to provide a smooth edge - this.borderWidth = options.borderWidth = options.edgeWidth || 1; - this.borderColor = options.edgeColor = Highcharts.pick(options.edgeColor, options.borderColor, undefined); - - states.hover.borderColor = Highcharts.pick(states.hover.edgeColor, this.borderColor); - states.hover.borderWidth = Highcharts.pick(states.hover.edgeWidth, this.borderWidth); - states.select.borderColor = Highcharts.pick(states.select.edgeColor, this.borderColor); - states.select.borderWidth = Highcharts.pick(states.select.edgeWidth, this.borderWidth); - - Highcharts.each(this.data, function (point) { - var pointAttr = point.pointAttr; - pointAttr[''].stroke = point.series.borderColor || point.color; - pointAttr['']['stroke-width'] = point.series.borderWidth; - pointAttr.hover.stroke = states.hover.borderColor; - pointAttr.hover['stroke-width'] = states.hover.borderWidth; - pointAttr.select.stroke = states.select.borderColor; - pointAttr.select['stroke-width'] = states.select.borderWidth; - }); - } - - proceed.apply(this, [].slice.call(arguments, 1)); - - if (this.chart.is3d()) { - var seriesGroup = this.group; - Highcharts.each(this.points, function (point) { - point.graphic.out.add(seriesGroup); - point.graphic.inn.add(seriesGroup); - point.graphic.side1.add(seriesGroup); - point.graphic.side2.add(seriesGroup); - }); - } -}); - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'drawDataLabels', function (proceed) { - if (this.chart.is3d()) { - var series = this; - Highcharts.each(series.data, function (point) { - var shapeArgs = point.shapeArgs, - r = shapeArgs.r, - d = shapeArgs.depth, - a1 = shapeArgs.alpha * deg2rad, - a2 = (shapeArgs.start + shapeArgs.end) / 2, - labelPos = point.labelPos; - - labelPos[1] += (-r * (1 - cos(a1)) * sin(a2)) + (sin(a2) > 0 ? sin(a1) * d : 0); - labelPos[3] += (-r * (1 - cos(a1)) * sin(a2)) + (sin(a2) > 0 ? sin(a1) * d : 0); - labelPos[5] += (-r * (1 - cos(a1)) * sin(a2)) + (sin(a2) > 0 ? sin(a1) * d : 0); - }); - } - - proceed.apply(this, [].slice.call(arguments, 1)); -}); - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'addPoint', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - if (this.chart.is3d()) { - // destroy (and rebuild) everything!!! - this.update(); - } -}); - -Highcharts.wrap(Highcharts.seriesTypes.pie.prototype, 'animate', function (proceed) { - if (!this.chart.is3d()) { - proceed.apply(this, [].slice.call(arguments, 1)); - } else { - var args = arguments, - init = args[1], - animation = this.options.animation, - attribs, - center = this.center, - group = this.group, - markerGroup = this.markerGroup; - - if (Highcharts.svg) { // VML is too slow anyway - - if (animation === true) { - animation = {}; - } - // Initialize the animation - if (init) { - - // Scale down the group and place it in the center - group.oldtranslateX = group.translateX; - group.oldtranslateY = group.translateY; - attribs = { - translateX: center[0], - translateY: center[1], - scaleX: 0.001, // #1499 - scaleY: 0.001 - }; - - group.attr(attribs); - if (markerGroup) { - markerGroup.attrSetters = group.attrSetters; - markerGroup.attr(attribs); - } - - // Run the animation - } else { - attribs = { - translateX: group.oldtranslateX, - translateY: group.oldtranslateY, - scaleX: 1, - scaleY: 1 - }; - group.animate(attribs, animation); - - if (markerGroup) { - markerGroup.animate(attribs, animation); - } - - // Delete this function to allow it only once - this.animate = null; - } - - } - } -});/*** - EXTENSION FOR 3D SCATTER CHART -***/ -Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'translate', function (proceed) { -//function translate3d(proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - - if (!this.chart.is3d()) { - return; - } - - var series = this, - chart = series.chart, - options3d = series.chart.options.chart.options3d, - alpha = options3d.alpha, - beta = options3d.beta, - origin = { - x: chart.inverted ? chart.plotHeight / 2 : chart.plotWidth / 2, - y: chart.inverted ? chart.plotWidth / 2 : chart.plotHeight / 2, - z: options3d.depth, - vd: options3d.viewDistance - }, - depth = options3d.depth, - zAxis = chart.options.zAxis || { min : 0, max: depth }; - - var rangeModifier = depth / (zAxis.max - zAxis.min); - - Highcharts.each(series.data, function (point) { - var pCo = { - x: point.plotX, - y: point.plotY, - z: (point.z - zAxis.min) * rangeModifier - }; - - pCo = perspective([pCo], alpha, beta, origin)[0]; - - point.plotXold = point.plotX; - point.plotYold = point.plotY; - - point.plotX = pCo.x; - point.plotY = pCo.y; - point.plotZ = pCo.z; - }); -}); - -Highcharts.wrap(Highcharts.seriesTypes.scatter.prototype, 'init', function (proceed) { - var result = proceed.apply(this, [].slice.call(arguments, 1)); - - if (this.chart.is3d()) { - // Add a third coordinate - this.pointArrayMap = ['x', 'y', 'z']; - - // Set a new default tooltip formatter - var default3dScatterTooltip = 'x: {point.x}
y: {point.y}
z: {point.z}
'; - if (this.userOptions.tooltip) { - this.tooltipOptions.pointFormat = this.userOptions.tooltip.pointFormat || default3dScatterTooltip; - } else { - this.tooltipOptions.pointFormat = default3dScatterTooltip; - } - } - return result; -});/** - * Extension to the VML Renderer - */ -if (Highcharts.VMLRenderer) { - -Highcharts.setOptions({animate: false}); - -Highcharts.VMLRenderer.prototype.cuboid = Highcharts.SVGRenderer.prototype.cuboid; -Highcharts.VMLRenderer.prototype.cuboidPath = Highcharts.SVGRenderer.prototype.cuboidPath; - -Highcharts.VMLRenderer.prototype.toLinePath = Highcharts.SVGRenderer.prototype.toLinePath; - -Highcharts.VMLRenderer.prototype.createElement3D = Highcharts.SVGRenderer.prototype.createElement3D; - -Highcharts.VMLRenderer.prototype.arc3d = function (shapeArgs) { - var result = Highcharts.SVGRenderer.prototype.arc3d.call(this, shapeArgs); - result.css({zIndex: result.zIndex}); - return result; -}; - -Highcharts.VMLRenderer.prototype.arc3dPath = Highcharts.SVGRenderer.prototype.arc3dPath; - -// Draw the series in the reverse order -Highcharts.Chart.prototype.renderSeries = function () { - var serie, - i = this.series.length; - while (i--) { - serie = this.series[i]; - serie.translate(); - if (serie.setTooltipPoints) { - serie.setTooltipPoints(); - } - serie.render(); - } -}; - -Highcharts.wrap(Highcharts.Axis.prototype, 'render', function (proceed) { - proceed.apply(this, [].slice.call(arguments, 1)); - // VML doesn't support a negative z-index - if (this.sideFrame) { - this.sideFrame.css({zIndex: 0}); - this.sideFrame.front.attr({fill: this.sideFrame.color}); - } - if (this.bottomFrame) { - this.bottomFrame.css({zIndex: 1}); - this.bottomFrame.front.attr({fill: this.bottomFrame.color}); - } - if (this.backFrame) { - this.backFrame.css({zIndex: 0}); - this.backFrame.front.attr({fill: this.backFrame.color}); - } -}); - -} - -}(Highcharts)); diff --git a/html/includes/js/highcharts-more.src.js b/html/includes/js/highcharts-more.src.js deleted file mode 100644 index df65b08..0000000 --- a/html/includes/js/highcharts-more.src.js +++ /dev/null @@ -1,2575 +0,0 @@ -// ==ClosureCompiler== -// @compilation_level SIMPLE_OPTIMIZATIONS - -/** - * @license Highcharts JS v4.0.4 (2014-09-02) - * - * (c) 2009-2014 Torstein Honsi - * - * License: www.highcharts.com/license - */ - -// JSLint options: -/*global Highcharts, HighchartsAdapter, document, window, navigator, setInterval, clearInterval, clearTimeout, setTimeout, location, jQuery, $, console */ - -(function (Highcharts, UNDEFINED) { -var arrayMin = Highcharts.arrayMin, - arrayMax = Highcharts.arrayMax, - each = Highcharts.each, - extend = Highcharts.extend, - merge = Highcharts.merge, - map = Highcharts.map, - pick = Highcharts.pick, - pInt = Highcharts.pInt, - defaultPlotOptions = Highcharts.getOptions().plotOptions, - seriesTypes = Highcharts.seriesTypes, - extendClass = Highcharts.extendClass, - splat = Highcharts.splat, - wrap = Highcharts.wrap, - Axis = Highcharts.Axis, - Tick = Highcharts.Tick, - Point = Highcharts.Point, - Pointer = Highcharts.Pointer, - CenteredSeriesMixin = Highcharts.CenteredSeriesMixin, - TrackerMixin = Highcharts.TrackerMixin, - Series = Highcharts.Series, - math = Math, - mathRound = math.round, - mathFloor = math.floor, - mathMax = math.max, - Color = Highcharts.Color, - noop = function () {};/** - * The Pane object allows options that are common to a set of X and Y axes. - * - * In the future, this can be extended to basic Highcharts and Highstock. - */ -function Pane(options, chart, firstAxis) { - this.init.call(this, options, chart, firstAxis); -} - -// Extend the Pane prototype -extend(Pane.prototype, { - - /** - * Initiate the Pane object - */ - init: function (options, chart, firstAxis) { - var pane = this, - backgroundOption, - defaultOptions = pane.defaultOptions; - - pane.chart = chart; - - // Set options - if (chart.angular) { // gauges - defaultOptions.background = {}; // gets extended by this.defaultBackgroundOptions - } - pane.options = options = merge(defaultOptions, options); - - backgroundOption = options.background; - - // To avoid having weighty logic to place, update and remove the backgrounds, - // push them to the first axis' plot bands and borrow the existing logic there. - if (backgroundOption) { - each([].concat(splat(backgroundOption)).reverse(), function (config) { - var backgroundColor = config.backgroundColor; // if defined, replace the old one (specific for gradients) - config = merge(pane.defaultBackgroundOptions, config); - if (backgroundColor) { - config.backgroundColor = backgroundColor; - } - config.color = config.backgroundColor; // due to naming in plotBands - firstAxis.options.plotBands.unshift(config); - }); - } - }, - - /** - * The default options object - */ - defaultOptions: { - // background: {conditional}, - center: ['50%', '50%'], - size: '85%', - startAngle: 0 - //endAngle: startAngle + 360 - }, - - /** - * The default background options - */ - defaultBackgroundOptions: { - shape: 'circle', - borderWidth: 1, - borderColor: 'silver', - backgroundColor: { - linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 }, - stops: [ - [0, '#FFF'], - [1, '#DDD'] - ] - }, - from: -Number.MAX_VALUE, // corrected to axis min - innerRadius: 0, - to: Number.MAX_VALUE, // corrected to axis max - outerRadius: '105%' - } - -}); -var axisProto = Axis.prototype, - tickProto = Tick.prototype; - -/** - * Augmented methods for the x axis in order to hide it completely, used for the X axis in gauges - */ -var hiddenAxisMixin = { - getOffset: noop, - redraw: function () { - this.isDirty = false; // prevent setting Y axis dirty - }, - render: function () { - this.isDirty = false; // prevent setting Y axis dirty - }, - setScale: noop, - setCategories: noop, - setTitle: noop -}; - -/** - * Augmented methods for the value axis - */ -/*jslint unparam: true*/ -var radialAxisMixin = { - isRadial: true, - - /** - * The default options extend defaultYAxisOptions - */ - defaultRadialGaugeOptions: { - labels: { - align: 'center', - x: 0, - y: null // auto - }, - minorGridLineWidth: 0, - minorTickInterval: 'auto', - minorTickLength: 10, - minorTickPosition: 'inside', - minorTickWidth: 1, - tickLength: 10, - tickPosition: 'inside', - tickWidth: 2, - title: { - rotation: 0 - }, - zIndex: 2 // behind dials, points in the series group - }, - - // Circular axis around the perimeter of a polar chart - defaultRadialXOptions: { - gridLineWidth: 1, // spokes - labels: { - align: null, // auto - distance: 15, - x: 0, - y: null // auto - }, - maxPadding: 0, - minPadding: 0, - showLastLabel: false, - tickLength: 0 - }, - - // Radial axis, like a spoke in a polar chart - defaultRadialYOptions: { - gridLineInterpolation: 'circle', - labels: { - align: 'right', - x: -3, - y: -2 - }, - showLastLabel: false, - title: { - x: 4, - text: null, - rotation: 90 - } - }, - - /** - * Merge and set options - */ - setOptions: function (userOptions) { - - var options = this.options = merge( - this.defaultOptions, - this.defaultRadialOptions, - userOptions - ); - - // Make sure the plotBands array is instanciated for each Axis (#2649) - if (!options.plotBands) { - options.plotBands = []; - } - - }, - - /** - * Wrap the getOffset method to return zero offset for title or labels in a radial - * axis - */ - getOffset: function () { - // Call the Axis prototype method (the method we're in now is on the instance) - axisProto.getOffset.call(this); - - // Title or label offsets are not counted - this.chart.axisOffset[this.side] = 0; - - // Set the center array - this.center = this.pane.center = CenteredSeriesMixin.getCenter.call(this.pane); - }, - - - /** - * Get the path for the axis line. This method is also referenced in the getPlotLinePath - * method. - */ - getLinePath: function (lineWidth, radius) { - var center = this.center; - radius = pick(radius, center[2] / 2 - this.offset); - - return this.chart.renderer.symbols.arc( - this.left + center[0], - this.top + center[1], - radius, - radius, - { - start: this.startAngleRad, - end: this.endAngleRad, - open: true, - innerR: 0 - } - ); - }, - - /** - * Override setAxisTranslation by setting the translation to the difference - * in rotation. This allows the translate method to return angle for - * any given value. - */ - setAxisTranslation: function () { - - // Call uber method - axisProto.setAxisTranslation.call(this); - - // Set transA and minPixelPadding - if (this.center) { // it's not defined the first time - if (this.isCircular) { - - this.transA = (this.endAngleRad - this.startAngleRad) / - ((this.max - this.min) || 1); - - - } else { - this.transA = (this.center[2] / 2) / ((this.max - this.min) || 1); - } - - if (this.isXAxis) { - this.minPixelPadding = this.transA * this.minPointOffset; - } else { - // This is a workaround for regression #2593, but categories still don't position correctly. - // TODO: Implement true handling of Y axis categories on gauges. - this.minPixelPadding = 0; - } - } - }, - - /** - * In case of auto connect, add one closestPointRange to the max value right before - * tickPositions are computed, so that ticks will extend passed the real max. - */ - beforeSetTickPositions: function () { - if (this.autoConnect) { - this.max += (this.categories && 1) || this.pointRange || this.closestPointRange || 0; // #1197, #2260 - } - }, - - /** - * Override the setAxisSize method to use the arc's circumference as length. This - * allows tickPixelInterval to apply to pixel lengths along the perimeter - */ - setAxisSize: function () { - - axisProto.setAxisSize.call(this); - - if (this.isRadial) { - - // Set the center array - this.center = this.pane.center = Highcharts.CenteredSeriesMixin.getCenter.call(this.pane); - - // The sector is used in Axis.translate to compute the translation of reversed axis points (#2570) - if (this.isCircular) { - this.sector = this.endAngleRad - this.startAngleRad; - } - - // Axis len is used to lay out the ticks - this.len = this.width = this.height = this.center[2] * pick(this.sector, 1) / 2; - - - } - }, - - /** - * Returns the x, y coordinate of a point given by a value and a pixel distance - * from center - */ - getPosition: function (value, length) { - return this.postTranslate( - this.isCircular ? this.translate(value) : 0, // #2848 - pick(this.isCircular ? length : this.translate(value), this.center[2] / 2) - this.offset - ); - }, - - /** - * Translate from intermediate plotX (angle), plotY (axis.len - radius) to final chart coordinates. - */ - postTranslate: function (angle, radius) { - - var chart = this.chart, - center = this.center; - - angle = this.startAngleRad + angle; - - return { - x: chart.plotLeft + center[0] + Math.cos(angle) * radius, - y: chart.plotTop + center[1] + Math.sin(angle) * radius - }; - - }, - - /** - * Find the path for plot bands along the radial axis - */ - getPlotBandPath: function (from, to, options) { - var center = this.center, - startAngleRad = this.startAngleRad, - fullRadius = center[2] / 2, - radii = [ - pick(options.outerRadius, '100%'), - options.innerRadius, - pick(options.thickness, 10) - ], - percentRegex = /%$/, - start, - end, - open, - isCircular = this.isCircular, // X axis in a polar chart - ret; - - // Polygonal plot bands - if (this.options.gridLineInterpolation === 'polygon') { - ret = this.getPlotLinePath(from).concat(this.getPlotLinePath(to, true)); - - // Circular grid bands - } else { - - // Plot bands on Y axis (radial axis) - inner and outer radius depend on to and from - if (!isCircular) { - radii[0] = this.translate(from); - radii[1] = this.translate(to); - } - - // Convert percentages to pixel values - radii = map(radii, function (radius) { - if (percentRegex.test(radius)) { - radius = (pInt(radius, 10) * fullRadius) / 100; - } - return radius; - }); - - // Handle full circle - if (options.shape === 'circle' || !isCircular) { - start = -Math.PI / 2; - end = Math.PI * 1.5; - open = true; - } else { - start = startAngleRad + this.translate(from); - end = startAngleRad + this