add all files

This commit is contained in:
Rucus
2026-02-17 09:29:34 -06:00
parent b8c8d67c67
commit 782d203799
21925 changed files with 2433086 additions and 0 deletions

View File

@@ -0,0 +1,618 @@
/* Colors for data series and points. */
/* Chart background, point stroke for markers and columns etc, */
/* Neutral colors, grayscale by default. The default colors are defined by mixing the background-color
with neutral, with a weight corresponding to the number in the name. */
/* Strong text. */
/* Main text and some strokes. */
/* Axis labels, axis title, connector fallback. */
/* Credits text, export menu stroke. */
/* Disabled texts, button strokes, crosshair etc. */
/* Grid lines etc. */
/* Minor grid lines etc. */
/* Tooltip backgroud, button fills, map null points. */
/* Colored, shades of blue by default */
/* Drilldown clickable labels, color axis max color. */
/* Selection marker, menu hover, button hover, chart border, navigator series. */
/* Navigator mask fill. */
/* Ticks and axis line. */
/* Pressed button, color axis min color. */
.highcharts-container {
position: relative;
overflow: hidden;
width: 100%;
height: 100%;
text-align: left;
line-height: normal;
z-index: 0;
/* #1072 */
-webkit-tap-highlight-color: transparent;
font-family: "Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif;
font-size: 12px; }
.highcharts-root text {
stroke-width: 0; }
.highcharts-background {
fill: #ffffff; }
.highcharts-plot-border, .highcharts-plot-background {
fill: none; }
.highcharts-label-box {
fill: none; }
.highcharts-button-box {
fill: inherit; }
/* Titles */
.highcharts-title {
fill: #333333;
font-size: 1.5em; }
.highcharts-subtitle {
fill: #666666; }
/* Axes */
.highcharts-axis-line {
fill: none;
stroke: #ccd6eb; }
.highcharts-yaxis .highcharts-axis-line {
stroke-width: 0; }
.highcharts-axis-title {
fill: #666666; }
.highcharts-axis-labels {
fill: #666666;
cursor: default;
font-size: 0.9em; }
.highcharts-grid-line {
fill: none;
stroke: #e6e6e6; }
.highcharts-xaxis-grid .highcharts-grid-line {
stroke-width: 0; }
.highcharts-tick {
stroke: #ccd6eb; }
.highcharts-yaxis .highcharts-tick {
stroke-width: 0; }
.highcharts-minor-grid-line {
stroke: #f2f2f2; }
.highcharts-crosshair-thin {
stroke-width: 1px;
stroke: #cccccc; }
.highcharts-crosshair-category {
stroke: #ccd6eb;
stroke-opacity: 0.25; }
/* Credits */
.highcharts-credits {
cursor: pointer;
fill: #999999;
font-size: 0.7em;
transition: fill 250ms, font-size 250ms; }
.highcharts-credits:hover {
fill: black;
font-size: 1em; }
/* Tooltip */
.highcharts-tooltip {
cursor: default;
pointer-events: none;
white-space: nowrap;
transition: stroke 150ms; }
.highcharts-tooltip text {
fill: #333333; }
.highcharts-tooltip .highcharts-header {
font-size: 0.85em; }
.highcharts-tooltip-box {
stroke-width: 1px;
fill: #f7f7f7;
fill-opacity: 0.85; }
.highcharts-selection-marker {
fill: #335cad;
fill-opacity: 0.25; }
.highcharts-graph {
fill: none;
stroke-width: 2px;
stroke-linecap: round;
stroke-linejoin: round; }
.highcharts-state-hover .highcharts-graph {
stroke-width: 3; }
.highcharts-state-hover path {
transition: stroke-width 50;
/* quick in */ }
.highcharts-state-normal path {
transition: stroke-width 250ms;
/* slow out */ }
/* Legend hover affects points and series */
g.highcharts-series, .highcharts-point {
transition: opacity 250ms; }
.highcharts-legend-series-active g.highcharts-series:not(.highcharts-series-hover),
.highcharts-legend-point-active .highcharts-point:not(.highcharts-point-hover) {
opacity: 0.2; }
/* Series options */
/* Default colors */
.highcharts-color-0 {
fill: #7cb5ec;
stroke: #7cb5ec; }
.highcharts-color-1 {
fill: #434348;
stroke: #434348; }
.highcharts-color-2 {
fill: #90ed7d;
stroke: #90ed7d; }
.highcharts-color-3 {
fill: #f7a35c;
stroke: #f7a35c; }
.highcharts-color-4 {
fill: #8085e9;
stroke: #8085e9; }
.highcharts-color-5 {
fill: #f15c80;
stroke: #f15c80; }
.highcharts-color-6 {
fill: #e4d354;
stroke: #e4d354; }
.highcharts-color-7 {
fill: #2b908f;
stroke: #2b908f; }
.highcharts-color-8 {
fill: #f45b5b;
stroke: #f45b5b; }
.highcharts-color-9 {
fill: #91e8e1;
stroke: #91e8e1; }
.highcharts-area {
fill-opacity: 0.75;
stroke-width: 0; }
.highcharts-markers {
stroke-width: 1px;
stroke: #ffffff; }
.highcharts-point {
stroke-width: 1px; }
.highcharts-dense-data .highcharts-point {
stroke-width: 0; }
.highcharts-data-label {
font-size: 0.9em;
font-weight: bold; }
.highcharts-data-label-box {
fill: none;
stroke-width: 0; }
.highcharts-data-label text {
fill: #333333; }
.highcharts-data-label-connector {
fill: none; }
.highcharts-halo {
fill-opacity: 0.25;
stroke-width: 0; }
.highcharts-point-select {
fill: #cccccc;
stroke: #000000; }
.highcharts-column-series .highcharts-point {
stroke: #ffffff;
transition: fill-opacity 250ms; }
.highcharts-column-series .highcharts-point-hover {
fill-opacity: 0.75;
transition: fill-opacity 50ms; }
.highcharts-pie-series .highcharts-point {
stroke-linejoin: round;
stroke: #ffffff; }
.highcharts-pie-series .highcharts-point-hover {
fill-opacity: 0.75;
transition: fill-opacity 50ms; }
.highcharts-pie-series .highcharts-point-select {
fill: inherit;
stroke: inherit; }
.highcharts-funnel-series .highcharts-point {
stroke-linejoin: round;
stroke: #ffffff; }
.highcharts-funnel-series .highcharts-point-hover {
fill-opacity: 0.75;
transition: fill-opacity 50ms; }
.highcharts-funnel-series .highcharts-point-select {
fill: inherit;
stroke: inherit; }
.highcharts-pyramid-series .highcharts-point {
stroke-linejoin: round;
stroke: #ffffff; }
.highcharts-pyramid-series .highcharts-point-hover {
fill-opacity: 0.75;
transition: fill-opacity 50ms; }
.highcharts-pyramid-series .highcharts-point-select {
fill: inherit;
stroke: inherit; }
.highcharts-solidgauge-series .highcharts-point {
stroke-width: 0; }
.highcharts-treemap-series .highcharts-point {
stroke-width: 1px;
stroke: #e6e6e6;
transition: stroke 250ms, fill 250ms, fill-opacity 250ms; }
.highcharts-treemap-series .highcharts-point-hover {
stroke: #999999;
transition: stroke 25ms, fill 25ms, fill-opacity 25ms; }
.highcharts-treemap-series .highcharts-above-level {
display: none; }
.highcharts-treemap-series .highcharts-internal-node {
fill: none; }
.highcharts-treemap-series .highcharts-internal-node-interactive {
fill-opacity: 0.15;
cursor: pointer; }
.highcharts-treemap-series .highcharts-internal-node-interactive:hover {
fill-opacity: 0.75; }
/* Legend */
.highcharts-legend-box {
fill: none;
stroke-width: 0; }
.highcharts-legend-item text {
fill: #333333;
font-weight: bold;
cursor: pointer;
stroke-width: 0; }
.highcharts-legend-item:hover text {
fill: #000000; }
.highcharts-legend-item-hidden * {
fill: #cccccc !important;
stroke: #cccccc !important;
transition: fill 250ms; }
.highcharts-legend-nav-active {
fill: #003399;
cursor: pointer; }
.highcharts-legend-nav-inactive {
fill: #cccccc; }
.highcharts-legend-title-box {
fill: none;
stroke-width: 0; }
/* Loading */
.highcharts-loading {
position: absolute;
background-color: #ffffff;
opacity: 0.5;
text-align: center;
z-index: 10;
transition: opacity 250ms; }
.highcharts-loading-hidden {
height: 0 !important;
opacity: 0;
overflow: hidden;
transition: opacity 250ms, height 250ms step-end; }
.highcharts-loading-inner {
font-weight: bold;
position: relative;
top: 45%; }
/* Plot bands and polar pane backgrounds */
.highcharts-plot-band {
fill: #000000;
fill-opacity: 0.05; }
.highcharts-plot-line {
fill: none;
stroke: #999999;
stroke-width: 1px; }
/* Highcharts More */
.highcharts-boxplot-box {
fill: #ffffff; }
.highcharts-boxplot-median {
stroke-width: 2px; }
.highcharts-bubble-series .highcharts-point {
fill-opacity: 0.5; }
.highcharts-errorbar-series .highcharts-point {
stroke: #000000; }
.highcharts-gauge-series .highcharts-data-label-box {
stroke: #cccccc;
stroke-width: 1px; }
.highcharts-gauge-series .highcharts-dial {
fill: #000000;
stroke-width: 0; }
.highcharts-polygon-series .highcharts-graph {
fill: inherit;
stroke-width: 0; }
.highcharts-waterfall-series .highcharts-graph {
stroke: #333333;
stroke-dasharray: 1, 3; }
/* Highstock */
.highcharts-navigator-mask {
fill: #6685c2;
/* navigator.maskFill option */
fill-opacity: 0.25; }
.highcharts-navigator-mask-inside {
fill: #6685c2;
/* navigator.maskFill option */
fill-opacity: 0.25;
cursor: ew-resize; }
.highcharts-navigator-outline {
stroke: #cccccc;
fill: none; }
.highcharts-navigator-handle {
stroke: #cccccc;
fill: #f2f2f2;
cursor: ew-resize; }
.highcharts-navigator-series {
fill: #335cad;
stroke: #335cad; }
.highcharts-navigator-series .highcharts-graph {
stroke-width: 1px; }
.highcharts-navigator-series .highcharts-area {
fill-opacity: 0.05; }
.highcharts-navigator-xaxis .highcharts-axis-line {
stroke-width: 0; }
.highcharts-navigator-xaxis .highcharts-grid-line {
stroke-width: 1px;
stroke: #e6e6e6; }
.highcharts-navigator-xaxis.highcharts-axis-labels {
fill: #999999; }
.highcharts-navigator-yaxis .highcharts-grid-line {
stroke-width: 0; }
.highcharts-scrollbar-thumb {
fill: #cccccc;
stroke: #cccccc;
stroke-width: 1px; }
.highcharts-scrollbar-button {
fill: #e6e6e6;
stroke: #cccccc;
stroke-width: 1px; }
.highcharts-scrollbar-arrow {
fill: #666666; }
.highcharts-scrollbar-rifles {
stroke: #666666;
stroke-width: 1px; }
.highcharts-scrollbar-track {
fill: #f2f2f2;
stroke: #f2f2f2;
stroke-width: 1px; }
.highcharts-button {
fill: #f7f7f7;
stroke: #cccccc;
cursor: default;
stroke-width: 1px;
transition: fill 250ms; }
.highcharts-button text {
fill: #333333; }
.highcharts-button-hover {
transition: fill 0ms;
fill: #e6e6e6;
stroke: #333333; }
.highcharts-button-pressed {
font-weight: bold;
fill: #e6ebf5;
stroke: #335cad; }
.highcharts-button-disabled text {
fill: #cccccc; }
.highcharts-range-selector-buttons .highcharts-button {
stroke-width: 0; }
.highcharts-range-label rect {
fill: none; }
.highcharts-range-label text {
fill: #666666; }
.highcharts-range-input rect {
fill: none; }
.highcharts-range-input text {
fill: #333333; }
input.highcharts-range-selector {
position: absolute;
border: 0;
width: 1px;
/* Chrome needs a pixel to see it */
height: 1px;
padding: 0;
text-align: center;
left: -9em;
/* #4798 */ }
.highcharts-crosshair-label text {
fill: #ffffff;
font-size: 1.1em; }
.highcharts-crosshair-label .highcharts-label-box {
fill: inherit; }
.highcharts-candlestick-series .highcharts-point {
stroke: #000000;
stroke-width: 1px; }
.highcharts-candlestick-series .highcharts-point-up {
fill: #ffffff; }
.highcharts-ohlc-series .highcharts-point-hover {
stroke-width: 3px; }
.highcharts-flags-series .highcharts-point {
stroke: #999999;
fill: #ffffff; }
.highcharts-flags-series .highcharts-point-hover {
stroke: #000000;
fill: #ccd6eb; }
.highcharts-flags-series .highcharts-point text {
fill: #000000;
font-size: 0.9em;
font-weight: bold; }
/* Highmaps */
.highcharts-map-series .highcharts-point {
transition: fill 500ms, fill-opacity 500ms, stroke-width 250ms;
stroke: #cccccc; }
.highcharts-map-series .highcharts-point-hover {
transition: fill 0ms, fill-opacity 0ms;
fill-opacity: 0.5;
stroke-width: 2px; }
.highcharts-mapline-series .highcharts-point {
fill: none; }
.highcharts-heatmap-series .highcharts-point {
stroke-width: 0; }
.highcharts-map-navigation {
font-size: 1.3em;
font-weight: bold;
text-align: center; }
.highcharts-coloraxis {
stroke-width: 0; }
.highcharts-coloraxis-marker {
fill: #999999; }
.highcharts-null-point {
fill: #f7f7f7; }
/* 3d charts */
.highcharts-3d-frame {
fill: transparent; }
.highcharts-column-series .highcharts-point {
stroke: inherit;
/* use point color */ }
/* Exporting module */
.highcharts-contextbutton {
fill: #ffffff;
/* needed to capture hover */
stroke: none;
stroke-linecap: round; }
.highcharts-contextbutton:hover {
fill: #e6e6e6;
stroke: #e6e6e6; }
.highcharts-button-symbol {
stroke: #666666;
stroke-width: 3px; }
.highcharts-menu {
border: 1px solid #999999;
background: #ffffff;
padding: 5px 0;
box-shadow: 3px 3px 10px #888; }
.highcharts-menu-item {
padding: 0.5em 1em;
background: none;
color: #333333;
cursor: pointer;
transition: background 250ms, color 250ms; }
.highcharts-menu-item:hover {
background: #335cad;
color: #ffffff; }
/* Drilldown module */
.highcharts-drilldown-point {
cursor: pointer; }
.highcharts-drilldown-data-label text, .highcharts-drilldown-axis-label {
cursor: pointer;
fill: #003399;
font-weight: bold;
text-decoration: underline; }
/* No-data module */
.highcharts-no-data text {
font-weight: bold;
font-size: 12px;
fill: #666666; }

View File

@@ -0,0 +1,49 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
3D features for Highcharts JS
@license: www.highcharts.com/license
*/
(function(E){"object"===typeof module&&module.exports?module.exports=E:E(Highcharts)})(function(E){(function(a){var r=a.deg2rad,k=a.pick;a.perspective=function(p,q,w){var n=q.options.chart.options3d,g=w?q.inverted:!1,h=q.plotWidth/2,l=q.plotHeight/2,e=n.depth/2,d=k(n.depth,1)*k(n.viewDistance,0),f=q.scale3d||1,b=r*n.beta*(g?-1:1),n=r*n.alpha*(g?-1:1),c=Math.cos(n),x=Math.cos(-b),y=Math.sin(n),z=Math.sin(-b);w||(h+=q.plotLeft,l+=q.plotTop);return a.map(p,function(b){var a,n;n=(g?b.y:b.x)-h;var k=(g?
b.x:b.y)-l,q=(b.z||0)-e;a=x*n-z*q;b=-y*z*n+c*k-x*y*q;n=c*z*n+y*k+c*x*q;k=0<d&&d<Number.POSITIVE_INFINITY?d/(n+e+d):1;a=a*k*f+h;b=b*k*f+l;return{x:g?b:a,y:g?a:b,z:n*f+e}})}})(E);(function(a){function r(b){var c=0,m,a;for(m=0;m<b.length;m++)a=(m+1)%b.length,c+=b[m].x*b[a].y-b[a].x*b[m].y;return c/2}function k(b){var c=0,m;for(m=0;m<b.length;m++)c+=b[m].z;return b.length?c/b.length:0}function p(b,c,m,a,f,d,D,e){var l=[],n=d-f;return d>f&&d-f>Math.PI/2+1E-4?(l=l.concat(p(b,c,m,a,f,f+Math.PI/2,D,e)),l=
l.concat(p(b,c,m,a,f+Math.PI/2,d,D,e))):d<f&&f-d>Math.PI/2+1E-4?(l=l.concat(p(b,c,m,a,f,f-Math.PI/2,D,e)),l=l.concat(p(b,c,m,a,f-Math.PI/2,d,D,e))):["C",b+m*Math.cos(f)-m*t*n*Math.sin(f)+D,c+a*Math.sin(f)+a*t*n*Math.cos(f)+e,b+m*Math.cos(d)+m*t*n*Math.sin(d)+D,c+a*Math.sin(d)-a*t*n*Math.cos(d)+e,b+m*Math.cos(d)+D,c+a*Math.sin(d)+e]}var q=Math.cos,w=Math.PI,n=Math.sin,g=a.animObject,h=a.charts,l=a.color,e=a.defined,d=a.deg2rad,f=a.each,b=a.extend,c=a.inArray,x=a.map,y=a.merge,z=a.perspective,F=a.pick,
A=a.SVGElement,B=a.SVGRenderer,u=a.wrap,t=4*(Math.sqrt(2)-1)/3/(w/2);B.prototype.toLinePath=function(b,c){var m=[];f(b,function(b){m.push("L",b.x,b.y)});b.length&&(m[0]="M",c&&m.push("Z"));return m};B.prototype.cuboid=function(b){var c=this.g();b=this.cuboidPath(b);c.attr({"stroke-linejoin":"round"});c.front=this.path(b[0]).attr({"class":"highcharts-3d-front",zIndex:b[3]}).add(c);c.top=this.path(b[1]).attr({"class":"highcharts-3d-top",zIndex:b[4]}).add(c);c.side=this.path(b[2]).attr({"class":"highcharts-3d-side",
zIndex:b[5]}).add(c);c.fillSetter=function(b){this.front.attr({fill:b});this.top.attr({fill:l(b).brighten(.1).get()});this.side.attr({fill:l(b).brighten(-.1).get()});this.color=b;return this};c.opacitySetter=function(b){this.front.attr({opacity:b});this.top.attr({opacity:b});this.side.attr({opacity:b});return this};c.attr=function(b){if(b.shapeArgs||e(b.x))b=this.renderer.cuboidPath(b.shapeArgs||b),this.front.attr({d:b[0],zIndex:b[3]}),this.top.attr({d:b[1],zIndex:b[4]}),this.side.attr({d:b[2],zIndex:b[5]});
else return a.SVGElement.prototype.attr.call(this,b);return this};c.animate=function(b,c,a){e(b.x)&&e(b.y)?(b=this.renderer.cuboidPath(b),this.front.attr({zIndex:b[3]}).animate({d:b[0]},c,a),this.top.attr({zIndex:b[4]}).animate({d:b[1]},c,a),this.side.attr({zIndex:b[5]}).animate({d:b[2]},c,a),this.attr({zIndex:-b[6]})):b.opacity?(this.front.animate(b,c,a),this.top.animate(b,c,a),this.side.animate(b,c,a)):A.prototype.animate.call(this,b,c,a);return this};c.destroy=function(){this.front.destroy();this.top.destroy();
this.side.destroy();return null};c.attr({zIndex:-b[6]});return c};B.prototype.cuboidPath=function(b){function c(b){return n[b]}var a=b.x,f=b.y,d=b.z,e=b.height,D=b.width,l=b.depth,n=[{x:a,y:f,z:d},{x:a+D,y:f,z:d},{x:a+D,y:f+e,z:d},{x:a,y:f+e,z:d},{x:a,y:f+e,z:d+l},{x:a+D,y:f+e,z:d+l},{x:a+D,y:f,z:d+l},{x:a,y:f,z:d+l}],n=z(n,h[this.chartIndex],b.insidePlotArea),d=function(b,a){var f=[];b=x(b,c);a=x(a,c);0>r(b)?f=b:0>r(a)&&(f=a);return f};b=d([3,2,1,0],[7,6,5,4]);a=[4,5,2,3];f=d([1,6,7,0],a);d=d([1,
2,5,6],[0,7,4,3]);return[this.toLinePath(b,!0),this.toLinePath(f,!0),this.toLinePath(d,!0),k(b),k(f),k(d),9E9*k(x(a,c))]};a.SVGRenderer.prototype.arc3d=function(a){function e(b){var a=!1,f={},d;for(d in b)-1!==c(d,h)&&(f[d]=b[d],delete b[d],a=!0);return a?f:!1}var m=this.g(),n=m.renderer,h="x y r innerR start end".split(" ");a=y(a);a.alpha*=d;a.beta*=d;m.top=n.path();m.side1=n.path();m.side2=n.path();m.inn=n.path();m.out=n.path();m.onAdd=function(){var b=m.parentGroup,a=m.attr("class");m.top.add(m);
f(["out","inn","side1","side2"],function(c){m[c].addClass(a+" highcharts-3d-side").add(b)})};m.setPaths=function(b){var a=m.renderer.arc3dPath(b),c=100*a.zTop;m.attribs=b;m.top.attr({d:a.top,zIndex:a.zTop});m.inn.attr({d:a.inn,zIndex:a.zInn});m.out.attr({d:a.out,zIndex:a.zOut});m.side1.attr({d:a.side1,zIndex:a.zSide1});m.side2.attr({d:a.side2,zIndex:a.zSide2});m.zIndex=c;m.attr({zIndex:c});b.center&&(m.top.setRadialReference(b.center),delete b.center)};m.setPaths(a);m.fillSetter=function(b){var a=
l(b).brighten(-.1).get();this.fill=b;this.side1.attr({fill:a});this.side2.attr({fill:a});this.inn.attr({fill:a});this.out.attr({fill:a});this.top.attr({fill:b});return this};f(["opacity","translateX","translateY","visibility"],function(b){m[b+"Setter"]=function(b,a){m[a]=b;f(["out","inn","side1","side2","top"],function(c){m[c].attr(a,b)})}});u(m,"attr",function(a,c,f){var d;"object"===typeof c&&(d=e(c))&&(b(m.attribs,d),m.setPaths(m.attribs));return a.call(this,c,f)});u(m,"animate",function(b,a,c,
f){var d,m=this.attribs,l;delete a.center;delete a.z;delete a.depth;delete a.alpha;delete a.beta;l=g(F(c,this.renderer.globalAnimation));if(l.duration){a=y(a);if(d=e(a))l.step=function(b,a){function c(b){return m[b]+(F(d[b],m[b])-m[b])*a.pos}a.elem.setPaths(y(m,{x:c("x"),y:c("y"),r:c("r"),innerR:c("innerR"),start:c("start"),end:c("end")}))};c=l}return b.call(this,a,c,f)});m.destroy=function(){this.top.destroy();this.out.destroy();this.inn.destroy();this.side1.destroy();this.side2.destroy();A.prototype.destroy.call(this)};
m.hide=function(){this.top.hide();this.out.hide();this.inn.hide();this.side1.hide();this.side2.hide()};m.show=function(){this.top.show();this.out.show();this.inn.show();this.side1.show();this.side2.show()};return m};B.prototype.arc3dPath=function(b){function a(b){b%=2*Math.PI;b>Math.PI&&(b=2*Math.PI-b);return b}var c=b.x,f=b.y,d=b.start,e=b.end-1E-5,l=b.r,h=b.innerR,x=b.depth,g=b.alpha,k=b.beta,y=Math.cos(d),r=Math.sin(d);b=Math.cos(e);var z=Math.sin(e),v=l*Math.cos(k),l=l*Math.cos(g),t=h*Math.cos(k),
u=h*Math.cos(g),h=x*Math.sin(k),C=x*Math.sin(g),x=["M",c+v*y,f+l*r],x=x.concat(p(c,f,v,l,d,e,0,0)),x=x.concat(["L",c+t*b,f+u*z]),x=x.concat(p(c,f,t,u,e,d,0,0)),x=x.concat(["Z"]),F=0<k?Math.PI/2:0,k=0<g?0:Math.PI/2,F=d>-F?d:e>-F?-F:d,A=e<w-k?e:d<w-k?w-k:e,B=2*w-k,g=["M",c+v*q(F),f+l*n(F)],g=g.concat(p(c,f,v,l,F,A,0,0));e>B&&d<B?(g=g.concat(["L",c+v*q(A)+h,f+l*n(A)+C]),g=g.concat(p(c,f,v,l,A,B,h,C)),g=g.concat(["L",c+v*q(B),f+l*n(B)]),g=g.concat(p(c,f,v,l,B,e,0,0)),g=g.concat(["L",c+v*q(e)+h,f+l*n(e)+
C]),g=g.concat(p(c,f,v,l,e,B,h,C)),g=g.concat(["L",c+v*q(B),f+l*n(B)]),g=g.concat(p(c,f,v,l,B,A,0,0))):e>w-k&&d<w-k&&(g=g.concat(["L",c+v*Math.cos(A)+h,f+l*Math.sin(A)+C]),g=g.concat(p(c,f,v,l,A,e,h,C)),g=g.concat(["L",c+v*Math.cos(e),f+l*Math.sin(e)]),g=g.concat(p(c,f,v,l,e,A,0,0)));g=g.concat(["L",c+v*Math.cos(A)+h,f+l*Math.sin(A)+C]);g=g.concat(p(c,f,v,l,A,F,h,C));g=g.concat(["Z"]);k=["M",c+t*y,f+u*r];k=k.concat(p(c,f,t,u,d,e,0,0));k=k.concat(["L",c+t*Math.cos(e)+h,f+u*Math.sin(e)+C]);k=k.concat(p(c,
f,t,u,e,d,h,C));k=k.concat(["Z"]);y=["M",c+v*y,f+l*r,"L",c+v*y+h,f+l*r+C,"L",c+t*y+h,f+u*r+C,"L",c+t*y,f+u*r,"Z"];c=["M",c+v*b,f+l*z,"L",c+v*b+h,f+l*z+C,"L",c+t*b+h,f+u*z+C,"L",c+t*b,f+u*z,"Z"];z=Math.atan2(C,-h);f=Math.abs(e+z);b=Math.abs(d+z);d=Math.abs((d+e)/2+z);f=a(f);b=a(b);d=a(d);d*=1E5;e=1E5*b;f*=1E5;return{top:x,zTop:1E5*Math.PI+1,out:g,zOut:Math.max(d,e,f),inn:k,zInn:Math.max(d,e,f),side1:y,zSide1:.99*f,side2:c,zSide2:.99*e}}})(E);(function(a){function r(a,e){var d=a.plotLeft,f=a.plotWidth+
d,b=a.plotTop,c=a.plotHeight+b,g=d+a.plotWidth/2,h=b+a.plotHeight/2,n=Number.MAX_VALUE,k=-Number.MAX_VALUE,q=Number.MAX_VALUE,r=-Number.MAX_VALUE,u,t=1;u=[{x:d,y:b,z:0},{x:d,y:b,z:e}];p([0,1],function(b){u.push({x:f,y:u[b].y,z:u[b].z})});p([0,1,2,3],function(b){u.push({x:u[b].x,y:c,z:u[b].z})});u=w(u,a,!1);p(u,function(b){n=Math.min(n,b.x);k=Math.max(k,b.x);q=Math.min(q,b.y);r=Math.max(r,b.y)});d>n&&(t=Math.min(t,1-Math.abs((d+g)/(n+g))%1));f<k&&(t=Math.min(t,(f-g)/(k-g)));b>q&&(t=0>q?Math.min(t,
(b+h)/(-q+b+h)):Math.min(t,1-(b+h)/(q+h)%1));c<r&&(t=Math.min(t,Math.abs((c-h)/(r-h))));return t}var k=a.Chart,p=a.each,q=a.merge,w=a.perspective,n=a.pick,g=a.wrap;k.prototype.is3d=function(){return this.options.chart.options3d&&this.options.chart.options3d.enabled};k.prototype.propsRequireDirtyBox.push("chart.options3d");k.prototype.propsRequireUpdateSeries.push("chart.options3d");a.wrap(a.Chart.prototype,"isInsidePlot",function(a){return this.is3d()||a.apply(this,[].slice.call(arguments,1))});var h=
a.getOptions();q(!0,h,{chart:{options3d:{enabled:!1,alpha:0,beta:0,depth:100,fitToPlot:!0,viewDistance:25,frame:{bottom:{size:1},side:{size:1},back:{size:1}}}}});g(k.prototype,"setClassName",function(a){a.apply(this,[].slice.call(arguments,1));this.is3d()&&(this.container.className+=" highcharts-3d-chart")});a.wrap(a.Chart.prototype,"setChartSize",function(a){var e=this.options.chart.options3d;a.apply(this,[].slice.call(arguments,1));if(this.is3d()){var d=this.inverted,f=this.clipBox,b=this.margin;
f[d?"y":"x"]=-(b[3]||0);f[d?"x":"y"]=-(b[0]||0);f[d?"height":"width"]=this.chartWidth+(b[3]||0)+(b[1]||0);f[d?"width":"height"]=this.chartHeight+(b[0]||0)+(b[2]||0);this.scale3d=1;!0===e.fitToPlot&&(this.scale3d=r(this,e.depth))}});g(k.prototype,"redraw",function(a){this.is3d()&&(this.isDirtyBox=!0);a.apply(this,[].slice.call(arguments,1))});g(k.prototype,"renderSeries",function(a){var e=this.series.length;if(this.is3d())for(;e--;)a=this.series[e],a.translate(),a.render();else a.call(this)});k.prototype.retrieveStacks=
function(a){var e=this.series,d={},f,b=1;p(this.series,function(c){f=n(c.options.stack,a?0:e.length-1-c.index);d[f]?d[f].series.push(c):(d[f]={series:[c],position:b},b++)});d.totalStacks=b+1;return d}})(E);(function(a){var r,k=a.Axis,p=a.Chart,q=a.each,w=a.extend,n=a.merge,g=a.perspective,h=a.pick,l=a.splat,e=a.Tick,d=a.wrap;d(k.prototype,"setOptions",function(a,b){var c;a.call(this,b);this.chart.is3d()&&(c=this.options,c.tickWidth=h(c.tickWidth,0),c.gridLineWidth=h(c.gridLineWidth,1))});d(k.prototype,
"render",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var b=this.chart,c=b.renderer,d=b.options.chart.options3d,e=d.frame,g=e.bottom,h=e.back,e=e.side,l=d.depth,n=this.height,k=this.width,q=this.left,p=this.top;this.isZAxis||(this.horiz?(h={x:q,y:p+(b.xAxis[0].opposite?-g.size:n),z:0,width:k,height:g.size,depth:l,insidePlotArea:!1},this.bottomFrame?this.bottomFrame.animate(h):(this.bottomFrame=c.cuboid(h).attr({"class":"highcharts-3d-frame highcharts-3d-frame-bottom",
zIndex:b.yAxis[0].reversed&&0<d.alpha?4:-1}).add(),this.bottomFrame.attr({fill:g.color||"none",stroke:g.color||"none"}))):(d={x:q+(b.yAxis[0].opposite?0:-e.size),y:p+(b.xAxis[0].opposite?-g.size:0),z:l,width:k+e.size,height:n+g.size,depth:h.size,insidePlotArea:!1},this.backFrame?this.backFrame.animate(d):(this.backFrame=c.cuboid(d).attr({"class":"highcharts-3d-frame highcharts-3d-frame-back",zIndex:-3}).add(),this.backFrame.attr({fill:h.color||"none",stroke:h.color||"none"})),b={x:q+(b.yAxis[0].opposite?
k:-e.size),y:p+(b.xAxis[0].opposite?-g.size:0),z:0,width:e.size,height:n+g.size,depth:l,insidePlotArea:!1},this.sideFrame?this.sideFrame.animate(b):(this.sideFrame=c.cuboid(b).attr({"class":"highcharts-3d-frame highcharts-3d-frame-side",zIndex:-2}).add(),this.sideFrame.attr({fill:e.color||"none",stroke:e.color||"none"}))))}});d(k.prototype,"getPlotLinePath",function(a){var b=a.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d()||null===b)return b;var c=this.chart,d=c.options.chart.options3d,
c=this.isZAxis?c.plotWidth:d.depth,d=this.opposite;this.horiz&&(d=!d);b=[this.swapZ({x:b[1],y:b[2],z:d?c:0}),this.swapZ({x:b[1],y:b[2],z:c}),this.swapZ({x:b[4],y:b[5],z:c}),this.swapZ({x:b[4],y:b[5],z:d?0:c})];b=g(b,this.chart,!1);return b=this.chart.renderer.toLinePath(b,!1)});d(k.prototype,"getLinePath",function(a){return this.chart.is3d()?[]:a.apply(this,[].slice.call(arguments,1))});d(k.prototype,"getPlotBandPath",function(a){if(!this.chart.is3d())return a.apply(this,[].slice.call(arguments,1));
var b=arguments,c=b[1],b=this.getPlotLinePath(b[2]);(c=this.getPlotLinePath(c))&&b?c.push("L",b[10],b[11],"L",b[7],b[8],"L",b[4],b[5],"L",b[1],b[2]):c=null;return c});d(e.prototype,"getMarkPath",function(a){var b=a.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return b;b=[this.axis.swapZ({x:b[1],y:b[2],z:0}),this.axis.swapZ({x:b[4],y:b[5],z:0})];b=g(b,this.axis.chart,!1);return b=["M",b[0].x,b[0].y,"L",b[1].x,b[1].y]});d(e.prototype,"getLabelPosition",function(a){var b=a.apply(this,
[].slice.call(arguments,1));this.axis.chart.is3d()&&(b=g([this.axis.swapZ({x:b.x,y:b.y,z:0})],this.axis.chart,!1)[0]);return b});a.wrap(k.prototype,"getTitlePosition",function(a){var b=this.chart.is3d(),c,d;b&&(d=this.axisTitleMargin,this.axisTitleMargin=0);c=a.apply(this,[].slice.call(arguments,1));b&&(c=g([this.swapZ({x:c.x,y:c.y,z:0})],this.chart,!1)[0],c[this.horiz?"y":"x"]+=(this.horiz?1:-1)*(this.opposite?-1:1)*d,this.axisTitleMargin=d);return c});d(k.prototype,"drawCrosshair",function(a){var b=
arguments;this.chart.is3d()&&b[2]&&(b[2]={plotX:b[2].plotXold||b[2].plotX,plotY:b[2].plotYold||b[2].plotY});a.apply(this,[].slice.call(b,1))});k.prototype.swapZ=function(a,b){if(this.isZAxis){var c=b?0:this.chart.plotLeft,d=this.chart;return{x:c+(d.yAxis[0].opposite?a.z:d.xAxis[0].width-a.z),y:a.y,z:a.x-c}}return a};r=a.ZAxis=function(){this.isZAxis=!0;this.init.apply(this,arguments)};w(r.prototype,k.prototype);w(r.prototype,{setOptions:function(a){a=n({offset:0,lineWidth:0},a);k.prototype.setOptions.call(this,
a);this.coll="zAxis"},setAxisSize:function(){k.prototype.setAxisSize.call(this);this.width=this.len=this.chart.options.chart.options3d.depth;this.right=this.chart.chartWidth-this.width-this.left},getSeriesExtremes:function(){var a=this,b=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.ignoreMinPadding=a.ignoreMaxPadding=null;a.buildStacks&&a.buildStacks();q(a.series,function(c){if(c.visible||!b.options.chart.ignoreHiddenSeries)a.hasVisibleSeries=!0,c=c.zData,c.length&&(a.dataMin=Math.min(h(a.dataMin,
c[0]),Math.min.apply(null,c)),a.dataMax=Math.max(h(a.dataMax,c[0]),Math.max.apply(null,c)))})}});d(p.prototype,"getAxes",function(a){var b=this,c=this.options,c=c.zAxis=l(c.zAxis||{});a.call(this);b.is3d()&&(this.zAxis=[],q(c,function(a,c){a.index=c;a.isX=!0;(new r(b,a)).setScale()}))})})(E);(function(a){function r(a){var e=a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&(e.stroke=this.options.edgeColor||e.fill,e["stroke-width"]=w(this.options.edgeWidth,1));return e}function k(a){if(this.chart.is3d()){var e=
this.chart.options.plotOptions.column.grouping;void 0===e||e||void 0===this.group.zIndex||this.zIndexSet||(this.group.attr({zIndex:10*this.group.zIndex}),this.zIndexSet=!0)}a.apply(this,[].slice.call(arguments,1))}var p=a.each,q=a.perspective,w=a.pick,n=a.Series,g=a.seriesTypes,h=a.svg;a=a.wrap;a(g.column.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var e=this.chart,d=this.options,f=d.depth||25,b=(d.stacking?d.stack||0:this._i)*(f+(d.groupZPadding||
1));!1!==d.grouping&&(b=0);b+=d.groupZPadding||1;p(this.data,function(a){if(null!==a.y){var d=a.shapeArgs,g=a.tooltipPos;a.shapeType="cuboid";d.z=b;d.depth=f;d.insidePlotArea=!0;g=q([{x:g[0],y:g[1],z:b}],e,!0)[0];a.tooltipPos=[g.x,g.y]}});this.z=b}});a(g.column.prototype,"animate",function(a){if(this.chart.is3d()){var e=arguments[1],d=this.yAxis,f=this,b=this.yAxis.reversed;h&&(e?p(f.data,function(a){null!==a.y&&(a.height=a.shapeArgs.height,a.shapey=a.shapeArgs.y,a.shapeArgs.height=1,b||(a.shapeArgs.y=
a.stackY?a.plotY+d.translate(a.stackY):a.plotY+(a.negative?-a.height:a.height)))}):(p(f.data,function(a){null!==a.y&&(a.shapeArgs.height=a.height,a.shapeArgs.y=a.shapey,a.graphic&&a.graphic.animate(a.shapeArgs,f.options.animation))}),this.drawDataLabels(),f.animate=null))}else a.apply(this,[].slice.call(arguments,1))});a(g.column.prototype,"init",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var e=this.options,d=e.grouping,f=e.stacking,b=w(this.yAxis.options.reversedStacks,
!0),c=0;if(void 0===d||d){d=this.chart.retrieveStacks(f);c=e.stack||0;for(f=0;f<d[c].series.length&&d[c].series[f]!==this;f++);c=10*(d.totalStacks-d[c].position)+(b?f:-f);this.xAxis.reversed||(c=10*d.totalStacks-c)}e.zIndex=c}});a(g.column.prototype,"pointAttribs",r);g.columnrange&&a(g.columnrange.prototype,"pointAttribs",r);a(n.prototype,"alignDataLabel",function(a){if(this.chart.is3d()&&("column"===this.type||"columnrange"===this.type)){var e=arguments[4],d={x:e.x,y:e.y,z:this.z},d=q([d],this.chart,
!0)[0];e.x=d.x;e.y=d.y}a.apply(this,[].slice.call(arguments,1))});g.columnrange&&a(g.columnrange.prototype,"drawPoints",k);a(g.column.prototype,"drawPoints",k)})(E);(function(a){var r=a.deg2rad,k=a.each,p=a.pick,q=a.seriesTypes,w=a.svg;a=a.wrap;a(q.pie.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var g=this,h=g.options,l=h.depth||0,e=g.chart.options.chart.options3d,d=e.alpha,f=e.beta,b=h.stacking?(h.stack||0)*l:g._i*l,b=b+l/2;!1!==h.grouping&&(b=
0);k(g.data,function(a){var e=a.shapeArgs;a.shapeType="arc3d";e.z=b;e.depth=.75*l;e.alpha=d;e.beta=f;e.center=g.center;e=(e.end+e.start)/2;a.slicedTranslation={translateX:Math.round(Math.cos(e)*h.slicedOffset*Math.cos(d*r)),translateY:Math.round(Math.sin(e)*h.slicedOffset*Math.cos(d*r))}})}});a(q.pie.prototype.pointClass.prototype,"haloPath",function(a){var g=arguments;return this.series.chart.is3d()?[]:a.call(this,g[1])});a(q.pie.prototype,"pointAttribs",function(a,g,h){a=a.call(this,g,h);h=this.options;
this.chart.is3d()&&(a.stroke=h.edgeColor||g.color||this.color,a["stroke-width"]=p(h.edgeWidth,1));return a});a(q.pie.prototype,"drawPoints",function(a){a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&k(this.points,function(a){var h=a.graphic;if(h)h[a.y&&a.visible?"show":"hide"]()})});a(q.pie.prototype,"drawDataLabels",function(a){if(this.chart.is3d()){var g=this.chart.options.chart.options3d;k(this.data,function(a){var l=a.shapeArgs,e=l.r,d=(l.start+l.end)/2,f=a.labelPos,b=-e*(1-Math.cos((l.alpha||
g.alpha)*r))*Math.sin(d),c=e*(Math.cos((l.beta||g.beta)*r)-1)*Math.cos(d);k([0,2,4],function(a){f[a]+=c;f[a+1]+=b})})}a.apply(this,[].slice.call(arguments,1))});a(q.pie.prototype,"addPoint",function(a){a.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&this.update(this.userOptions,!0)});a(q.pie.prototype,"animate",function(a){if(this.chart.is3d()){var g=arguments[1],h=this.options.animation,k=this.center,e=this.group,d=this.markerGroup;w&&(!0===h&&(h={}),g?(e.oldtranslateX=e.translateX,e.oldtranslateY=
e.translateY,g={translateX:k[0],translateY:k[1],scaleX:.001,scaleY:.001},e.attr(g),d&&(d.attrSetters=e.attrSetters,d.attr(g))):(g={translateX:e.oldtranslateX,translateY:e.oldtranslateY,scaleX:1,scaleY:1},e.animate(g,h),d&&d.animate(g,h),this.animate=null))}else a.apply(this,[].slice.call(arguments,1))})})(E);(function(a){var r=a.perspective,k=a.pick,p=a.seriesTypes;a=a.wrap;a(p.scatter.prototype,"translate",function(a){a.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var p=this.chart,
n=k(this.zAxis,p.options.zAxis[0]),g=[],h,l,e;for(e=0;e<this.data.length;e++)h=this.data[e],l=n.isLog&&n.val2lin?n.val2lin(h.z):h.z,h.plotZ=n.translate(l),h.isInside=h.isInside?l>=n.min&&l<=n.max:!1,g.push({x:h.plotX,y:h.plotY,z:h.plotZ});p=r(g,p,!0);for(e=0;e<this.data.length;e++)h=this.data[e],n=p[e],h.plotXold=h.plotX,h.plotYold=h.plotY,h.plotZold=h.plotZ,h.plotX=n.x,h.plotY=n.y,h.plotZ=n.z}});a(p.scatter.prototype,"init",function(a,k,n){k.is3d()&&(this.axisTypes=["xAxis","yAxis","zAxis"],this.pointArrayMap=
["x","y","z"],this.parallelArrays=["x","y","z"],this.directTouch=!0);a=a.apply(this,[k,n]);this.chart.is3d()&&(this.tooltipOptions.pointFormat=this.userOptions.tooltip?this.userOptions.tooltip.pointFormat||"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>":"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>");return a})})(E);(function(a){var r=a.Axis,k=a.SVGRenderer,p=a.VMLRenderer;p&&(a.setOptions({animate:!1}),p.prototype.cuboid=k.prototype.cuboid,p.prototype.cuboidPath=
k.prototype.cuboidPath,p.prototype.toLinePath=k.prototype.toLinePath,p.prototype.createElement3D=k.prototype.createElement3D,p.prototype.arc3d=function(a){a=k.prototype.arc3d.call(this,a);a.css({zIndex:a.zIndex});return a},a.VMLRenderer.prototype.arc3dPath=a.SVGRenderer.prototype.arc3dPath,a.wrap(r.prototype,"render",function(a){a.apply(this,[].slice.call(arguments,1));this.sideFrame&&(this.sideFrame.css({zIndex:0}),this.sideFrame.front.attr({fill:this.sideFrame.color}));this.bottomFrame&&(this.bottomFrame.css({zIndex:1}),
this.bottomFrame.front.attr({fill:this.bottomFrame.color}));this.backFrame&&(this.backFrame.css({zIndex:0}),this.backFrame.front.attr({fill:this.backFrame.color}))}))})(E)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,60 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(x){"object"===typeof module&&module.exports?module.exports=x:x(Highcharts)})(function(x){(function(a){function f(a,b,g){this.init(a,b,g)}var r=a.each,u=a.extend,l=a.merge,p=a.splat;u(f.prototype,{init:function(a,b,g){var d=this,n=d.defaultOptions;d.chart=b;d.options=a=l(n,b.angular?{background:{}}:void 0,a);(a=a.background)&&r([].concat(p(a)).reverse(),function(b){var c,a=g.userOptions;c=l(d.defaultBackgroundOptions,b);b.backgroundColor&&(c.backgroundColor=b.backgroundColor);c.color=c.backgroundColor;
g.options.plotBands.unshift(c);a.plotBands=a.plotBands||[];a.plotBands!==g.options.plotBands&&a.plotBands.unshift(c)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{className:"highcharts-pane",shape:"circle",borderWidth:1,borderColor:"#cccccc",backgroundColor:{linearGradient:{x1:0,y1:0,x2:0,y2:1},stops:[[0,"#ffffff"],[1,"#e6e6e6"]]},from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});a.Pane=f})(x);(function(a){var f=a.CenteredSeriesMixin,
r=a.each,u=a.extend,l=a.map,p=a.merge,q=a.noop,b=a.Pane,g=a.pick,d=a.pInt,n=a.splat,h=a.wrap,c,e,k=a.Axis.prototype;a=a.Tick.prototype;c={getOffset:q,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=!1},setScale:q,setCategories:q,setTitle:q};e={defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},
defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(d){d=this.options=p(this.defaultOptions,this.defaultRadialOptions,d);d.plotBands||(d.plotBands=[])},getOffset:function(){k.getOffset.call(this);this.chart.axisOffset[this.side]=0;this.center=this.pane.center=
f.getCenter.call(this.pane)},getLinePath:function(d,m){var b=this.center,c,a=this.chart;c=g(m,b[2]/2-this.offset);this.isCircular||void 0!==m?b=this.chart.renderer.symbols.arc(this.left+b[0],this.top+b[1],c,c,{start:this.startAngleRad,end:this.endAngleRad,open:!0,innerR:0}):(c=this.postTranslate(this.angleRad,c),b=["M",b[0]+a.plotLeft,b[1]+a.plotTop,"L",c.x,c.y]);return b},setAxisTranslation:function(){k.setAxisTranslation.call(this);this.center&&(this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/
(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.minPixelPadding=this.isXAxis?this.transA*this.minPointOffset:0)},beforeSetTickPositions:function(){if(this.autoConnect=this.isCircular&&void 0===g(this.userMax,this.options.max)&&this.endAngleRad-this.startAngleRad===2*Math.PI)this.max+=this.categories&&1||this.pointRange||this.closestPointRange||0},setAxisSize:function(){k.setAxisSize.call(this);this.isRadial&&(this.center=this.pane.center=f.getCenter.call(this.pane),this.isCircular&&
(this.sector=this.endAngleRad-this.startAngleRad),this.len=this.width=this.height=this.center[2]*g(this.sector,1)/2)},getPosition:function(d,m){return this.postTranslate(this.isCircular?this.translate(d):this.angleRad,g(this.isCircular?m:this.translate(d),this.center[2]/2)-this.offset)},postTranslate:function(d,m){var b=this.chart,c=this.center;d=this.startAngleRad+d;return{x:b.plotLeft+c[0]+Math.cos(d)*m,y:b.plotTop+c[1]+Math.sin(d)*m}},getPlotBandPath:function(b,m,c){var a=this.center,n=this.startAngleRad,
k=a[2]/2,e=[g(c.outerRadius,"100%"),c.innerRadius,g(c.thickness,10)],h=Math.min(this.offset,0),C=/%$/,q,p=this.isCircular;"polygon"===this.options.gridLineInterpolation?a=this.getPlotLinePath(b).concat(this.getPlotLinePath(m,!0)):(b=Math.max(b,this.min),m=Math.min(m,this.max),p||(e[0]=this.translate(b),e[1]=this.translate(m)),e=l(e,function(b){C.test(b)&&(b=d(b,10)*k/100);return b}),"circle"!==c.shape&&p?(b=n+this.translate(b),m=n+this.translate(m)):(b=-Math.PI/2,m=1.5*Math.PI,q=!0),e[0]-=h,e[2]-=
h,a=this.chart.renderer.symbols.arc(this.left+a[0],this.top+a[1],e[0],e[0],{start:Math.min(b,m),end:Math.max(b,m),innerR:g(e[1],e[0]-e[2]),open:q}));return a},getPlotLinePath:function(b,d){var c=this,g=c.center,a=c.chart,e=c.getPosition(b),n,k,h;c.isCircular?h=["M",g[0]+a.plotLeft,g[1]+a.plotTop,"L",e.x,e.y]:"circle"===c.options.gridLineInterpolation?(b=c.translate(b))&&(h=c.getLinePath(0,b)):(r(a.xAxis,function(b){b.pane===c.pane&&(n=b)}),h=[],b=c.translate(b),g=n.tickPositions,n.autoConnect&&(g=
g.concat([g[0]])),d&&(g=[].concat(g).reverse()),r(g,function(d,c){k=n.getPosition(d,b);h.push(c?"L":"M",k.x,k.y)}));return h},getTitlePosition:function(){var b=this.center,d=this.chart,c=this.options.title;return{x:d.plotLeft+b[0]+(c.x||0),y:d.plotTop+b[1]-{high:.5,middle:.25,low:0}[c.align]*b[2]+(c.y||0)}}};h(k,"init",function(d,m,a){var k=m.angular,h=m.polar,w=a.isX,q=k&&w,l,C=m.options,f=a.pane||0;if(k){if(u(this,q?c:e),l=!w)this.defaultRadialOptions=this.defaultRadialGaugeOptions}else h&&(u(this,
e),this.defaultRadialOptions=(l=w)?this.defaultRadialXOptions:p(this.defaultYAxisOptions,this.defaultRadialYOptions));k||h?(this.isRadial=!0,m.inverted=!1,C.chart.zoomType=null):this.isRadial=!1;d.call(this,m,a);q||!k&&!h||(d=this.options,m.panes||(m.panes=[]),this.pane=m=m.panes[f]=m.panes[f]||new b(n(C.pane)[f],m,this),m=m.options,this.angleRad=(d.angle||0)*Math.PI/180,this.startAngleRad=(m.startAngle-90)*Math.PI/180,this.endAngleRad=(g(m.endAngle,m.startAngle+360)-90)*Math.PI/180,this.offset=d.offset||
0,this.isCircular=l)});h(k,"autoLabelAlign",function(b){if(!this.isRadial)return b.apply(this,[].slice.call(arguments,1))});h(a,"getPosition",function(b,d,c,g,a){var e=this.axis;return e.getPosition?e.getPosition(c):b.call(this,d,c,g,a)});h(a,"getLabelPosition",function(b,d,c,a,e,k,n,h,q){var p=this.axis,l=k.y,f=20,r=k.align,u=(p.translate(this.pos)+p.startAngleRad+Math.PI/2)/Math.PI*180%360;p.isRadial?(b=p.getPosition(this.pos,p.center[2]/2+g(k.distance,-25)),"auto"===k.rotation?a.attr({rotation:u}):
null===l&&(l=p.chart.renderer.fontMetrics(a.styles.fontSize).b-a.getBBox().height/2),null===r&&(p.isCircular?(this.label.getBBox().width>p.len*p.tickInterval/(p.max-p.min)&&(f=0),r=u>f&&u<180-f?"left":u>180+f&&u<360-f?"right":"center"):r="center",a.attr({align:r})),b.x+=k.x,b.y+=l):b=b.call(this,d,c,a,e,k,n,h,q);return b});h(a,"getMarkPath",function(b,d,c,g,a,e,k){var n=this.axis;n.isRadial?(b=n.getPosition(this.pos,n.center[2]/2+g),d=["M",d,c,"L",b.x,b.y]):d=b.call(this,d,c,g,a,e,k);return d})})(x);
(function(a){var f=a.each,r=a.noop,u=a.pick,l=a.Series,p=a.seriesType,q=a.seriesTypes;p("arearange","area",{lineWidth:1,marker:null,threshold:null,tooltip:{pointFormat:'<span style="color:{series.color}">\u25cf</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},trackByArea:!0,dataLabels:{align:null,verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}},{pointArrayMap:["low","high"],dataLabelCollections:["dataLabel","dataLabelUpper"],toYData:function(b){return[b.low,
b.high]},pointValKey:"low",deferTranslatePolar:!0,highToXY:function(b){var g=this.chart,d=this.xAxis.postTranslate(b.rectPlotX,this.yAxis.len-b.plotHigh);b.plotHighX=d.x-g.plotLeft;b.plotHigh=d.y-g.plotTop},translate:function(){var b=this,g=b.yAxis;q.area.prototype.translate.apply(b);f(b.points,function(b){var a=b.low,h=b.high,c=b.plotY;null===h||null===a?b.isNull=!0:(b.plotLow=c,b.plotHigh=g.translate(h,0,1,0,1))});this.chart.polar&&f(this.points,function(d){b.highToXY(d)})},getGraphPath:function(b){var g=
[],d=[],a,h=q.area.prototype.getGraphPath,c,e,k;k=this.options;var v=k.step;b=b||this.points;for(a=b.length;a--;)c=b[a],c.isNull||k.connectEnds||b[a+1]&&!b[a+1].isNull||d.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1}),e={polarPlotY:c.polarPlotY,rectPlotX:c.rectPlotX,yBottom:c.yBottom,plotX:u(c.plotHighX,c.plotX),plotY:c.plotHigh,isNull:c.isNull},d.push(e),g.push(e),c.isNull||k.connectEnds||b[a-1]&&!b[a-1].isNull||d.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1});b=h.call(this,b);v&&(!0===v&&(v="left"),
k.step={left:"right",center:"center",right:"left"}[v]);g=h.call(this,g);d=h.call(this,d);k.step=v;k=[].concat(b,g);this.chart.polar||"M"!==d[0]||(d[0]="L");this.graphPath=k;this.areaPath=this.areaPath.concat(b,d);k.isArea=!0;k.xMap=b.xMap;this.areaPath.xMap=b.xMap;return k},drawDataLabels:function(){var b=this.data,g=b.length,d,a=[],h=l.prototype,c=this.options.dataLabels,e=c.align,k=c.verticalAlign,v=c.inside,m,t,q=this.chart.inverted;if(c.enabled||this._hasPointLabels){for(d=g;d--;)if(m=b[d])t=
v?m.plotHigh<m.plotLow:m.plotHigh>m.plotLow,m.y=m.high,m._plotY=m.plotY,m.plotY=m.plotHigh,a[d]=m.dataLabel,m.dataLabel=m.dataLabelUpper,m.below=t,q?e||(c.align=t?"right":"left"):k||(c.verticalAlign=t?"top":"bottom"),c.x=c.xHigh,c.y=c.yHigh;h.drawDataLabels&&h.drawDataLabels.apply(this,arguments);for(d=g;d--;)if(m=b[d])t=v?m.plotHigh<m.plotLow:m.plotHigh>m.plotLow,m.dataLabelUpper=m.dataLabel,m.dataLabel=a[d],m.y=m.low,m.plotY=m._plotY,m.below=!t,q?e||(c.align=t?"left":"right"):k||(c.verticalAlign=
t?"bottom":"top"),c.x=c.xLow,c.y=c.yLow;h.drawDataLabels&&h.drawDataLabels.apply(this,arguments)}c.align=e;c.verticalAlign=k},alignDataLabel:function(){q.column.prototype.alignDataLabel.apply(this,arguments)},setStackedPoints:r,getSymbol:r,drawPoints:r})})(x);(function(a){var f=a.seriesType;f("areasplinerange","arearange",null,{getPointSpline:a.seriesTypes.spline.prototype.getPointSpline})})(x);(function(a){var f=a.defaultPlotOptions,r=a.each,u=a.merge,l=a.noop,p=a.pick,q=a.seriesType,b=a.seriesTypes.column.prototype;
q("columnrange","arearange",u(f.column,f.arearange,{lineWidth:1,pointRange:null}),{translate:function(){var a=this,d=a.yAxis,n=a.xAxis,h=n.startAngleRad,c,e=a.chart,k=a.xAxis.isRadial,v;b.translate.apply(a);r(a.points,function(b){var t=b.shapeArgs,q=a.options.minPointLength,l,w;b.plotHigh=v=d.translate(b.high,0,1,0,1);b.plotLow=b.plotY;w=v;l=p(b.rectPlotY,b.plotY)-v;Math.abs(l)<q?(q-=l,l+=q,w-=q/2):0>l&&(l*=-1,w-=l);k?(c=b.barX+h,b.shapeType="path",b.shapeArgs={d:a.polarArc(w+l,w,c,c+b.pointWidth)}):
(t.height=l,t.y=w,b.tooltipPos=e.inverted?[d.len+d.pos-e.plotLeft-w-l/2,n.len+n.pos-e.plotTop-t.x-t.width/2,l]:[n.left-e.plotLeft+t.x+t.width/2,d.pos-e.plotTop+w+l/2,l])})},directTouch:!0,trackerGroups:["group","dataLabelsGroup"],drawGraph:l,crispCol:b.crispCol,drawPoints:b.drawPoints,drawTracker:b.drawTracker,getColumnMetrics:b.getColumnMetrics,animate:function(){return b.animate.apply(this,arguments)},polarArc:function(){return b.polarArc.apply(this,arguments)},pointAttribs:b.pointAttribs})})(x);
(function(a){var f=a.each,r=a.isNumber,u=a.merge,l=a.pick,p=a.pInt,q=a.Series,b=a.seriesType,g=a.TrackerMixin;b("gauge","line",{dataLabels:{enabled:!0,defer:!1,y:15,borderRadius:3,crop:!1,verticalAlign:"top",zIndex:2,borderWidth:1,borderColor:"#cccccc"},dial:{},pivot:{},tooltip:{headerFormat:""},showInLegend:!1},{angular:!0,directTouch:!0,drawGraph:a.noop,fixedBox:!0,forceDL:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],translate:function(){var b=this.yAxis,a=this.options,g=b.center;
this.generatePoints();f(this.points,function(c){var e=u(a.dial,c.dial),k=p(l(e.radius,80))*g[2]/200,v=p(l(e.baseLength,70))*k/100,m=p(l(e.rearLength,10))*k/100,t=e.baseWidth||3,q=e.topWidth||1,f=a.overshoot,w=b.startAngleRad+b.translate(c.y,null,null,null,!0);r(f)?(f=f/180*Math.PI,w=Math.max(b.startAngleRad-f,Math.min(b.endAngleRad+f,w))):!1===a.wrap&&(w=Math.max(b.startAngleRad,Math.min(b.endAngleRad,w)));w=180*w/Math.PI;c.shapeType="path";c.shapeArgs={d:e.path||["M",-m,-t/2,"L",v,-t/2,k,-q/2,k,
q/2,v,t/2,-m,t/2,"z"],translateX:g[0],translateY:g[1],rotation:w};c.plotX=g[0];c.plotY=g[1]})},drawPoints:function(){var b=this,a=b.yAxis.center,g=b.pivot,c=b.options,e=c.pivot,k=b.chart.renderer;f(b.points,function(a){var g=a.graphic,e=a.shapeArgs,h=e.d,n=u(c.dial,a.dial);g?(g.animate(e),e.d=h):(a.graphic=k[a.shapeType](e).attr({rotation:e.rotation,zIndex:1}).addClass("highcharts-dial").add(b.group),a.graphic.attr({stroke:n.borderColor||"none","stroke-width":n.borderWidth||0,fill:n.backgroundColor||
"#000000"}))});g?g.animate({translateX:a[0],translateY:a[1]}):(b.pivot=k.circle(0,0,l(e.radius,5)).attr({zIndex:2}).addClass("highcharts-pivot").translate(a[0],a[1]).add(b.group),b.pivot.attr({"stroke-width":e.borderWidth||0,stroke:e.borderColor||"#cccccc",fill:e.backgroundColor||"#000000"}))},animate:function(b){var a=this;b||(f(a.points,function(b){var c=b.graphic;c&&(c.attr({rotation:180*a.yAxis.startAngleRad/Math.PI}),c.animate({rotation:b.shapeArgs.rotation},a.options.animation))}),a.animate=
null)},render:function(){this.group=this.plotGroup("group","series",this.visible?"visible":"hidden",this.options.zIndex,this.chart.seriesGroup);q.prototype.render.call(this);this.group.clip(this.chart.clipRect)},setData:function(b,a){q.prototype.setData.call(this,b,!1);this.processData();this.generatePoints();l(a,!0)&&this.chart.redraw()},drawTracker:g&&g.drawTrackerPoint},{setState:function(b){this.state=b}})})(x);(function(a){var f=a.each,r=a.noop,u=a.pick,l=a.seriesType,p=a.seriesTypes;l("boxplot",
"column",{threshold:null,tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> <b> {series.name}</b><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},whiskerLength:"50%",fillColor:"#ffffff",lineWidth:1,medianWidth:2,states:{hover:{brightness:-.3}},whiskerWidth:2},{pointArrayMap:["low","q1","median","q3","high"],toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",
pointAttribs:function(a){var b=this.options;a=a&&a.color||this.color;return{fill:b.fillColor||a,stroke:b.lineColor||a,"stroke-width":b.lineWidth||0}},drawDataLabels:r,translate:function(){var a=this.yAxis,b=this.pointArrayMap;p.column.prototype.translate.apply(this);f(this.points,function(g){f(b,function(b){null!==g[b]&&(g[b+"Plot"]=a.translate(g[b],0,1,0,1))})})},drawPoints:function(){var a=this,b=a.options,g=a.chart.renderer,d,n,h,c,e,k,v=0,m,t,l,p,w=!1!==a.doQuartiles,r,x=a.options.whiskerLength;
f(a.points,function(f){var y=f.graphic,A=y?"animate":"attr",D=f.shapeArgs,z={},B={},E={},F=f.color||a.color;void 0!==f.plotY&&(m=D.width,t=Math.floor(D.x),l=t+m,p=Math.round(m/2),d=Math.floor(w?f.q1Plot:f.lowPlot),n=Math.floor(w?f.q3Plot:f.lowPlot),h=Math.floor(f.highPlot),c=Math.floor(f.lowPlot),y||(f.graphic=y=g.g("point").add(a.group),f.stem=g.path().addClass("highcharts-boxplot-stem").add(y),x&&(f.whiskers=g.path().addClass("highcharts-boxplot-whisker").add(y)),w&&(f.box=g.path(void 0).addClass("highcharts-boxplot-box").add(y)),
f.medianShape=g.path(void 0).addClass("highcharts-boxplot-median").add(y),z.stroke=f.stemColor||b.stemColor||F,z["stroke-width"]=u(f.stemWidth,b.stemWidth,b.lineWidth),z.dashstyle=f.stemDashStyle||b.stemDashStyle,f.stem.attr(z),x&&(B.stroke=f.whiskerColor||b.whiskerColor||F,B["stroke-width"]=u(f.whiskerWidth,b.whiskerWidth,b.lineWidth),f.whiskers.attr(B)),w&&(y=a.pointAttribs(f),f.box.attr(y)),E.stroke=f.medianColor||b.medianColor||F,E["stroke-width"]=u(f.medianWidth,b.medianWidth,b.lineWidth),f.medianShape.attr(E)),
k=f.stem.strokeWidth()%2/2,v=t+p+k,f.stem[A]({d:["M",v,n,"L",v,h,"M",v,d,"L",v,c]}),w&&(k=f.box.strokeWidth()%2/2,d=Math.floor(d)+k,n=Math.floor(n)+k,t+=k,l+=k,f.box[A]({d:["M",t,n,"L",t,d,"L",l,d,"L",l,n,"L",t,n,"z"]})),x&&(k=f.whiskers.strokeWidth()%2/2,h+=k,c+=k,r=/%$/.test(x)?p*parseFloat(x)/100:x/2,f.whiskers[A]({d:["M",v-r,h,"L",v+r,h,"M",v-r,c,"L",v+r,c]})),e=Math.round(f.medianPlot),k=f.medianShape.strokeWidth()%2/2,e+=k,f.medianShape[A]({d:["M",t,e,"L",l,e]}))})},setStackedPoints:r})})(x);
(function(a){var f=a.each,r=a.noop,u=a.seriesType,l=a.seriesTypes;u("errorbar","boxplot",{color:"#000000",grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},whiskerWidth:null},{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:l.arearange?function(){var a=this.pointValKey;l.arearange.prototype.drawDataLabels.call(this);
f(this.data,function(f){f.y=f[a]})}:r,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||l.column.prototype.getColumnMetrics.call(this)}})})(x);(function(a){var f=a.correctFloat,r=a.isNumber,u=a.pick,l=a.Point,p=a.Series,q=a.seriesType,b=a.seriesTypes;q("waterfall","column",{dataLabels:{inside:!0},lineWidth:1,lineColor:"#333333",dashStyle:"dot",borderColor:"#333333",states:{hover:{lineWidthPlus:0}}},{pointValKey:"y",translate:function(){var a=this.options,d=this.yAxis,
n,h,c,e,k,v,m,t,l,p=u(a.minPointLength,5),w=a.threshold,q=a.stacking;b.column.prototype.translate.apply(this);this.minPointLengthOffset=0;m=t=w;h=this.points;n=0;for(a=h.length;n<a;n++)c=h[n],v=this.processedYData[n],e=c.shapeArgs,l=(k=q&&d.stacks[(this.negStacks&&v<w?"-":"")+this.stackKey])?k[c.x].points[this.index+","+n]:[0,v],c.isSum?c.y=f(v):c.isIntermediateSum&&(c.y=f(v-t)),k=Math.max(m,m+c.y)+l[0],e.y=d.toPixels(k,!0),c.isSum?(e.y=d.toPixels(l[1],!0),e.height=Math.min(d.toPixels(l[0],!0),d.len)-
e.y+this.minPointLengthOffset):c.isIntermediateSum?(e.y=d.toPixels(l[1],!0),e.height=Math.min(d.toPixels(t,!0),d.len)-e.y+this.minPointLengthOffset,t=l[1]):(e.height=0<v?d.toPixels(m,!0)-e.y:d.toPixels(m,!0)-d.toPixels(m-v,!0),m+=v),0>e.height&&(e.y+=e.height,e.height*=-1),c.plotY=e.y=Math.round(e.y)-this.borderWidth%2/2,e.height=Math.max(Math.round(e.height),.001),c.yBottom=e.y+e.height,e.height<=p&&(e.height=p,this.minPointLengthOffset+=p),e.y-=this.minPointLengthOffset,e=c.plotY+(c.negative?e.height:
0)-this.minPointLengthOffset,this.chart.inverted?c.tooltipPos[0]=d.len-e:c.tooltipPos[1]=e},processData:function(b){var a=this.yData,n=this.options.data,h,c=a.length,e,k,l,m,t,q;k=e=l=m=this.options.threshold||0;for(q=0;q<c;q++)t=a[q],h=n&&n[q]?n[q]:{},"sum"===t||h.isSum?a[q]=f(k):"intermediateSum"===t||h.isIntermediateSum?a[q]=f(e):(k+=t,e+=t),l=Math.min(k,l),m=Math.max(k,m);p.prototype.processData.call(this,b);this.dataMin=l;this.dataMax=m},toYData:function(b){return b.isSum?0===b.x?null:"sum":
b.isIntermediateSum?0===b.x?null:"intermediateSum":b.y},pointAttribs:function(a,d){var n=this.options.upColor;n&&!a.options.color&&(a.color=0<a.y?n:null);n=b.column.prototype.pointAttribs.call(this,a,d);delete n.dashstyle;return n},getGraphPath:function(){return["M",0,0]},getCrispPath:function(){var b=this.data,a=b.length,n=this.graph.strokeWidth()+this.borderWidth,n=Math.round(n)%2/2,h=[],c,e,k;for(k=1;k<a;k++)e=b[k].shapeArgs,c=b[k-1].shapeArgs,e=["M",c.x+c.width,c.y+n,"L",e.x,c.y+n],0>b[k-1].y&&
(e[2]+=c.height,e[5]+=c.height),h=h.concat(e);return h},drawGraph:function(){p.prototype.drawGraph.call(this);this.graph.attr({d:this.getCrispPath()})},getExtremes:a.noop},{getClassName:function(){var b=l.prototype.getClassName.call(this);this.isSum?b+=" highcharts-sum":this.isIntermediateSum&&(b+=" highcharts-intermediate-sum");return b},isValid:function(){return r(this.y,!0)||this.isSum||this.isIntermediateSum}})})(x);(function(a){var f=a.Series,r=a.seriesType,u=a.seriesTypes;r("polygon","scatter",
{marker:{enabled:!1,states:{hover:{enabled:!1}}},stickyTracking:!1,tooltip:{followPointer:!0,pointFormat:""},trackByArea:!0},{type:"polygon",getGraphPath:function(){for(var a=f.prototype.getGraphPath.call(this),p=a.length+1;p--;)(p===a.length||"M"===a[p])&&0<p&&a.splice(p,0,"z");return this.areaPath=a},drawGraph:function(){this.options.fillColor=this.color;u.area.prototype.drawGraph.call(this)},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawTracker:f.prototype.drawTracker,setStackedPoints:a.noop})})(x);
(function(a){var f=a.arrayMax,r=a.arrayMin,u=a.Axis,l=a.color,p=a.each,q=a.isNumber,b=a.noop,g=a.pick,d=a.pInt,n=a.Point,h=a.Series,c=a.seriesType,e=a.seriesTypes;c("bubble","scatter",{dataLabels:{formatter:function(){return this.point.z},inside:!0,verticalAlign:"middle"},marker:{lineColor:null,lineWidth:1,radius:null,states:{hover:{radiusPlus:0}}},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,
zThreshold:0,zoneAxis:"z"},{pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,zoneAxis:"z",pointAttribs:function(b,a){var c=g(this.options.marker.fillOpacity,.5),d=h.prototype.pointAttribs.call(this,b,a);1!==c&&(d.fill=l(d.fill).setOpacity(c).get("rgba"));return d},getRadii:function(b,a,c,d){var e,g,h,n=this.zData,f=[],l=this.options,p="width"!==l.sizeBy,q=l.zThreshold,r=a-b;g=0;for(e=n.length;g<e;g++)h=n[g],l.sizeByAbsoluteValue&&null!==
h&&(h=Math.abs(h-q),a=Math.max(a-q,Math.abs(b-q)),b=0),null===h?h=null:h<b?h=c/2-1:(h=0<r?(h-b)/r:.5,p&&0<=h&&(h=Math.sqrt(h)),h=Math.ceil(c+h*(d-c))/2),f.push(h);this.radii=f},animate:function(b){var a=this.options.animation;b||(p(this.points,function(b){var c=b.graphic;b=b.shapeArgs;c&&b&&(c.attr("r",1),c.animate({r:b.r},a))}),this.animate=null)},translate:function(){var b,a=this.data,c,d,g=this.radii;e.scatter.prototype.translate.call(this);for(b=a.length;b--;)c=a[b],d=g?g[b]:0,q(d)&&d>=this.minPxSize/
2?(c.shapeType="circle",c.shapeArgs={x:c.plotX,y:c.plotY,r:d},c.dlBox={x:c.plotX-d,y:c.plotY-d,width:2*d,height:2*d}):c.shapeArgs=c.plotY=c.dlBox=void 0},drawLegendSymbol:function(b,a){var c=this.chart.renderer,d=c.fontMetrics(b.itemStyle.fontSize).f/2;a.legendSymbol=c.circle(d,b.baseline-d,d).attr({zIndex:3}).add(a.legendGroup);a.legendSymbol.isMarker=!0},drawPoints:e.column.prototype.drawPoints,alignDataLabel:e.column.prototype.alignDataLabel,buildKDTree:b,applyZones:b},{haloPath:function(){return n.prototype.haloPath.call(this,
this.shapeArgs.r+this.series.options.states.hover.halo.size)},ttBelow:!1});u.prototype.beforePadding=function(){var b=this,a=this.len,c=this.chart,e=0,h=a,n=this.isXAxis,l=n?"xData":"yData",u=this.min,x={},C=Math.min(c.plotWidth,c.plotHeight),y=Number.MAX_VALUE,A=-Number.MAX_VALUE,D=this.max-u,z=a/D,B=[];p(this.series,function(a){var e=a.options;!a.bubblePadding||!a.visible&&c.options.chart.ignoreHiddenSeries||(b.allowZoomOutside=!0,B.push(a),n&&(p(["minSize","maxSize"],function(b){var a=e[b],c=/%$/.test(a),
a=d(a);x[b]=c?C*a/100:a}),a.minPxSize=x.minSize,a.maxPxSize=x.maxSize,a=a.zData,a.length&&(y=g(e.zMin,Math.min(y,Math.max(r(a),!1===e.displayNegative?e.zThreshold:-Number.MAX_VALUE))),A=g(e.zMax,Math.max(A,f(a))))))});p(B,function(a){var c=a[l],d=c.length,g;n&&a.getRadii(y,A,a.minPxSize,a.maxPxSize);if(0<D)for(;d--;)q(c[d])&&b.dataMin<=c[d]&&c[d]<=b.dataMax&&(g=a.radii[d],e=Math.min((c[d]-u)*z-g,e),h=Math.max((c[d]-u)*z+g,h))});B.length&&0<D&&!this.isLog&&(h-=a,z*=(a+e-h)/a,p([["min","userMin",e],
["max","userMax",h]],function(a){void 0===g(b.options[a[0]],b[a[1]])&&(b[a[0]]+=a[2]/z)}))}})(x);(function(a){function f(b,a){var d=this.chart,n=this.options.animation,h=this.group,c=this.markerGroup,e=this.xAxis.center,k=d.plotLeft,f=d.plotTop;d.polar?d.renderer.isSVG&&(!0===n&&(n={}),a?(d={translateX:e[0]+k,translateY:e[1]+f,scaleX:.001,scaleY:.001},h.attr(d),c&&c.attr(d)):(d={translateX:k,translateY:f,scaleX:1,scaleY:1},h.animate(d,n),c&&c.animate(d,n),this.animate=null)):b.call(this,a)}var r=
a.each,u=a.pick,l=a.seriesTypes,p=a.wrap,q=a.Series.prototype;a=a.Pointer.prototype;q.searchPointByAngle=function(b){var a=this.chart,d=this.xAxis.pane.center;return this.searchKDTree({clientX:180+-180/Math.PI*Math.atan2(b.chartX-d[0]-a.plotLeft,b.chartY-d[1]-a.plotTop)})};p(q,"buildKDTree",function(b){this.chart.polar&&(this.kdByAngle?this.searchPoint=this.searchPointByAngle:this.kdDimensions=2);b.apply(this)});q.toXY=function(b){var a,d=this.chart,n=b.plotX;a=b.plotY;b.rectPlotX=n;b.rectPlotY=a;
a=this.xAxis.postTranslate(b.plotX,this.yAxis.len-a);b.plotX=b.polarPlotX=a.x-d.plotLeft;b.plotY=b.polarPlotY=a.y-d.plotTop;this.kdByAngle?(d=(n/Math.PI*180+this.xAxis.pane.options.startAngle)%360,0>d&&(d+=360),b.clientX=d):b.clientX=b.plotX};l.spline&&p(l.spline.prototype,"getPointSpline",function(a,g,d,n){var h,c,e,k,f,m,l;this.chart.polar?(h=d.plotX,c=d.plotY,a=g[n-1],e=g[n+1],this.connectEnds&&(a||(a=g[g.length-2]),e||(e=g[1])),a&&e&&(k=a.plotX,f=a.plotY,g=e.plotX,m=e.plotY,k=(1.5*h+k)/2.5,f=
(1.5*c+f)/2.5,e=(1.5*h+g)/2.5,l=(1.5*c+m)/2.5,g=Math.sqrt(Math.pow(k-h,2)+Math.pow(f-c,2)),m=Math.sqrt(Math.pow(e-h,2)+Math.pow(l-c,2)),k=Math.atan2(f-c,k-h),f=Math.atan2(l-c,e-h),l=Math.PI/2+(k+f)/2,Math.abs(k-l)>Math.PI/2&&(l-=Math.PI),k=h+Math.cos(l)*g,f=c+Math.sin(l)*g,e=h+Math.cos(Math.PI+l)*m,l=c+Math.sin(Math.PI+l)*m,d.rightContX=e,d.rightContY=l),n?(d=["C",a.rightContX||a.plotX,a.rightContY||a.plotY,k||h,f||c,h,c],a.rightContX=a.rightContY=null):d=["M",h,c]):d=a.call(this,g,d,n);return d});
p(q,"translate",function(a){var g=this.chart;a.call(this);if(g.polar&&(this.kdByAngle=g.tooltip&&g.tooltip.shared,!this.preventPostTranslate))for(a=this.points,g=a.length;g--;)this.toXY(a[g])});p(q,"getGraphPath",function(a,g){var d=this,f,h;if(this.chart.polar){g=g||this.points;for(f=0;f<g.length;f++)if(!g[f].isNull){h=f;break}!1!==this.options.connectEnds&&void 0!==h&&(this.connectEnds=!0,g.splice(g.length,0,g[h]));r(g,function(a){void 0===a.polarPlotY&&d.toXY(a)})}return a.apply(this,[].slice.call(arguments,
1))});p(q,"animate",f);l.column&&(l=l.column.prototype,l.polarArc=function(a,g,d,f){var h=this.xAxis.center,c=this.yAxis.len;return this.chart.renderer.symbols.arc(h[0],h[1],c-g,null,{start:d,end:f,innerR:c-u(a,c)})},p(l,"animate",f),p(l,"translate",function(a){var g=this.xAxis,d=g.startAngleRad,f,h,c;this.preventPostTranslate=!0;a.call(this);if(g.isRadial)for(f=this.points,c=f.length;c--;)h=f[c],a=h.barX+d,h.shapeType="path",h.shapeArgs={d:this.polarArc(h.yBottom,h.plotY,a,a+h.pointWidth)},this.toXY(h),
h.tooltipPos=[h.plotX,h.plotY],h.ttBelow=h.plotY>g.center[1]}),p(l,"alignDataLabel",function(a,g,d,f,h,c){this.chart.polar?(a=g.rectPlotX/Math.PI*180,null===f.align&&(f.align=20<a&&160>a?"left":200<a&&340>a?"right":"center"),null===f.verticalAlign&&(f.verticalAlign=45>a||315<a?"bottom":135<a&&225>a?"top":"middle"),q.alignDataLabel.call(this,g,d,f,h,c)):a.call(this,g,d,f,h,c)}));p(a,"getCoordinates",function(a,f){var d=this.chart,l={xAxis:[],yAxis:[]};d.polar?r(d.axes,function(a){var b=a.isXAxis,e=
a.center,k=f.chartX-e[0]-d.plotLeft,e=f.chartY-e[1]-d.plotTop;l[b?"xAxis":"yAxis"].push({axis:a,value:a.translate(b?Math.PI-Math.atan2(k,e):Math.sqrt(Math.pow(k,2)+Math.pow(e,2)),!0)})}):l=a.call(this,f);return l})})(x)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,381 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(K,a){"object"===typeof module&&module.exports?module.exports=K.document?a(K):a:K.Highcharts=a(K)})("undefined"!==typeof window?window:this,function(K){K=function(){var a=window,A=a.document,y=a.navigator&&a.navigator.userAgent||"",E=A&&A.createElementNS&&!!A.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,G=/(edge|msie|trident)/i.test(y)&&!window.opera,t=!E,g=/Firefox/.test(y),d=g&&4>parseInt(y.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",
version:"5.0.0",deg2rad:2*Math.PI/360,doc:A,hasBidiBug:d,isMS:G,isWebKit:/AppleWebKit/.test(y),isFirefox:g,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(y),SVG_NS:"http://www.w3.org/2000/svg",idCounter:0,chartCount:0,seriesTypes:{},svg:E,vml:t,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var A=[],y=a.charts,E=a.doc,G=a.win;a.error=function(a,g){var d="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(g)throw Error(d);
G.console&&console.log(d)};a.Fx=function(a,g,d){this.options=g;this.elem=a;this.prop=d};a.Fx.prototype={dSetter:function(){var a=this.paths[0],g=this.paths[1],d=[],m=this.now,r=a.length,n;if(1===m)d=this.toD;else if(r===g.length&&1>m)for(;r--;)n=parseFloat(a[r]),d[r]=isNaN(n)?a[r]:m*parseFloat(g[r]-n)+n;else d=g;this.elem.attr("d",d)},update:function(){var a=this.elem,g=this.prop,d=this.now,m=this.options.step;if(this[g+"Setter"])this[g+"Setter"]();else a.attr?a.element&&a.attr(g,d):a.style[g]=d+
this.unit;m&&m.call(a,d,this)},run:function(a,g,d){var m=this,r=function(a){return r.stopped?!1:m.step(a)},n;this.startTime=+new Date;this.start=a;this.end=g;this.unit=d;this.now=this.start;this.pos=0;r.elem=this.elem;r()&&1===A.push(r)&&(r.timerId=setInterval(function(){for(n=0;n<A.length;n++)A[n]()||A.splice(n--,1);A.length||clearInterval(r.timerId)},13))},step:function(a){var g=+new Date,d,m=this.options;d=this.elem;var r=m.complete,n=m.duration,p=m.curAnim,b;if(d.attr&&!d.element)d=!1;else if(a||
g>=n+this.startTime){this.now=this.end;this.pos=1;this.update();a=p[this.prop]=!0;for(b in p)!0!==p[b]&&(a=!1);a&&r&&r.call(d);d=!1}else this.pos=m.easing((g-this.startTime)/n),this.now=this.start+(this.end-this.start)*this.pos,this.update(),d=!0;return d},initPath:function(t,g,d){function m(a){for(l=a.length;l--;)"M"!==a[l]&&"L"!==a[l]||a.splice(l+1,0,a[l+1],a[l+2],a[l+1],a[l+2])}function r(a,f){for(;a.length<e;){a[0]=f[e-a.length];var c=a.slice(0,B);[].splice.apply(a,[0,0].concat(c));q&&(c=a.slice(a.length-
B),[].splice.apply(a,[a.length,0].concat(c)),l--)}a[0]="M"}function n(a,f){for(var b=(e-a.length)/B;0<b&&b--;)c=a.slice().splice(a.length/h-B,B*h),c[0]=f[e-B-b*B],v&&(c[B-6]=c[B-2],c[B-5]=c[B-1]),[].splice.apply(a,[a.length/h,0].concat(c)),q&&b--}g=g||"";var p,b=t.startX,k=t.endX,v=-1<g.indexOf("C"),B=v?7:3,e,c,l;g=g.split(" ");d=d.slice();var q=t.isArea,h=q?2:1,f;v&&(m(g),m(d));if(b&&k){for(l=0;l<b.length;l++)if(b[l]===k[0]){p=l;break}else if(b[0]===k[k.length-b.length+l]){p=l;f=!0;break}void 0===
p&&(g=[])}g.length&&a.isNumber(p)&&(e=d.length+p*h*B,f?(r(g,d),n(d,g)):(r(d,g),n(g,d)));return[g,d]}};a.extend=function(a,g){var d;a||(a={});for(d in g)a[d]=g[d];return a};a.merge=function(){var t,g=arguments,d,m={},r=function(n,d){var b,k;"object"!==typeof n&&(n={});for(k in d)d.hasOwnProperty(k)&&(b=d[k],a.isObject(b,!0)&&"renderTo"!==k&&"number"!==typeof b.nodeType?n[k]=r(n[k]||{},b):n[k]=d[k]);return n};!0===g[0]&&(m=g[1],g=Array.prototype.slice.call(g,2));d=g.length;for(t=0;t<d;t++)m=r(m,g[t]);
return m};a.pInt=function(a,g){return parseInt(a,g||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(t,g){return t&&"object"===typeof t&&(!g||!a.isArray(t))};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};a.erase=function(a,g){for(var d=a.length;d--;)if(a[d]===g){a.splice(d,1);break}};a.defined=function(a){return void 0!==a&&null!==a};a.attr=
function(t,g,d){var m,r;if(a.isString(g))a.defined(d)?t.setAttribute(g,d):t&&t.getAttribute&&(r=t.getAttribute(g));else if(a.defined(g)&&a.isObject(g))for(m in g)t.setAttribute(m,g[m]);return r};a.splat=function(t){return a.isArray(t)?t:[t]};a.syncTimeout=function(a,g,d){if(g)return setTimeout(a,g,d);a.call(0,d)};a.pick=function(){var a=arguments,g,d,m=a.length;for(g=0;g<m;g++)if(d=a[g],void 0!==d&&null!==d)return d};a.css=function(t,g){a.isMS&&!a.svg&&g&&void 0!==g.opacity&&(g.filter="alpha(opacity="+
100*g.opacity+")");a.extend(t.style,g)};a.createElement=function(t,g,d,m,r){t=E.createElement(t);var n=a.css;g&&a.extend(t,g);r&&n(t,{padding:0,border:"none",margin:0});d&&n(t,d);m&&m.appendChild(t);return t};a.extendClass=function(t,g){var d=function(){};d.prototype=new t;a.extend(d.prototype,g);return d};a.pad=function(a,g,d){return Array((g||2)+1-String(a).length).join(d||0)+a};a.relativeLength=function(a,g){return/%$/.test(a)?g*parseFloat(a)/100:parseFloat(a)};a.wrap=function(a,g,d){var m=a[g];
a[g]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(m);return d.apply(this,a)}};a.getTZOffset=function(t){var g=a.Date;return 6E4*(g.hcGetTimezoneOffset&&g.hcGetTimezoneOffset(t)||g.hcTimezoneOffset||0)};a.dateFormat=function(t,g,d){if(!a.defined(g)||isNaN(g))return a.defaultOptions.lang.invalidDate||"";t=a.pick(t,"%Y-%m-%d %H:%M:%S");var m=a.Date,r=new m(g-a.getTZOffset(g)),n,p=r[m.hcGetHours](),b=r[m.hcGetDay](),k=r[m.hcGetDate](),v=r[m.hcGetMonth](),B=r[m.hcGetFullYear](),e=a.defaultOptions.lang,
c=e.weekdays,l=e.shortWeekdays,q=a.pad,m=a.extend({a:l?l[b]:c[b].substr(0,3),A:c[b],d:q(k),e:q(k,2," "),w:b,b:e.shortMonths[v],B:e.months[v],m:q(v+1),y:B.toString().substr(2,2),Y:B,H:q(p),k:p,I:q(p%12||12),l:p%12||12,M:q(r[m.hcGetMinutes]()),p:12>p?"AM":"PM",P:12>p?"am":"pm",S:q(r.getSeconds()),L:q(Math.round(g%1E3),3)},a.dateFormats);for(n in m)for(;-1!==t.indexOf("%"+n);)t=t.replace("%"+n,"function"===typeof m[n]?m[n](g):m[n]);return d?t.substr(0,1).toUpperCase()+t.substr(1):t};a.formatSingle=function(t,
g){var d=/\.([0-9])/,m=a.defaultOptions.lang;/f$/.test(t)?(d=(d=t.match(d))?d[1]:-1,null!==g&&(g=a.numberFormat(g,d,m.decimalPoint,-1<t.indexOf(",")?m.thousandsSep:""))):g=a.dateFormat(t,g);return g};a.format=function(t,g){for(var d="{",m=!1,r,n,p,b,k=[],v;t;){d=t.indexOf(d);if(-1===d)break;r=t.slice(0,d);if(m){r=r.split(":");n=r.shift().split(".");b=n.length;v=g;for(p=0;p<b;p++)v=v[n[p]];r.length&&(v=a.formatSingle(r.join(":"),v));k.push(v)}else k.push(r);t=t.slice(d+1);d=(m=!m)?"}":"{"}k.push(t);
return k.join("")};a.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(t,g,d,m,r){var n,p=t;d=a.pick(d,1);n=t/d;g||(g=[1,2,2.5,5,10],!1===m&&(1===d?g=[1,2,5,10]:.1>=d&&(g=[1/d])));for(m=0;m<g.length&&!(p=g[m],r&&p*d>=t||!r&&n<=(g[m]+(g[m+1]||g[m]))/2);m++);return p*d};a.stableSort=function(a,g){var d=a.length,m,r;for(r=0;r<d;r++)a[r].safeI=r;a.sort(function(a,d){m=g(a,d);return 0===m?a.safeI-d.safeI:m});for(r=0;r<d;r++)delete a[r].safeI};
a.arrayMin=function(a){for(var g=a.length,d=a[0];g--;)a[g]<d&&(d=a[g]);return d};a.arrayMax=function(a){for(var g=a.length,d=a[0];g--;)a[g]>d&&(d=a[g]);return d};a.destroyObjectProperties=function(a,g){for(var d in a)a[d]&&a[d]!==g&&a[d].destroy&&a[d].destroy(),delete a[d]};a.discardElement=function(t){var g=a.garbageBin;g||(g=a.createElement("div"));t&&g.appendChild(t);g.innerHTML=""};a.correctFloat=function(a,g){return parseFloat(a.toPrecision(g||14))};a.setAnimation=function(t,g){g.renderer.globalAnimation=
a.pick(t,g.options.chart.animation,!0)};a.animObject=function(t){return a.isObject(t)?a.merge(t):{duration:t?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(t,g,d,m){t=+t||0;g=+g;var r=a.defaultOptions.lang,n=(t.toString().split(".")[1]||"").length,p,b,k=Math.abs(t);-1===g?g=Math.min(n,20):a.isNumber(g)||(g=2);p=String(a.pInt(k.toFixed(g)));b=3<p.length?p.length%3:0;d=a.pick(d,r.decimalPoint);m=a.pick(m,
r.thousandsSep);t=(0>t?"-":"")+(b?p.substr(0,b)+m:"");t+=p.substr(b).replace(/(\d{3})(?=\d)/g,"$1"+m);g&&(m=Math.abs(k-p+Math.pow(10,-Math.max(g,n)-1)),t+=d+m.toFixed(g).slice(2));return t};Math.easeInOutSine=function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(t,g){var d;return"width"===g?Math.min(t.offsetWidth,t.scrollWidth)-a.getStyle(t,"padding-left")-a.getStyle(t,"padding-right"):"height"===g?Math.min(t.offsetHeight,t.scrollHeight)-a.getStyle(t,"padding-top")-a.getStyle(t,"padding-bottom"):
(d=G.getComputedStyle(t,void 0))&&a.pInt(d.getPropertyValue(g))};a.inArray=function(a,g){return g.indexOf?g.indexOf(a):[].indexOf.call(g,a)};a.grep=function(a,g){return[].filter.call(a,g)};a.map=function(a,g){for(var d=[],m=0,r=a.length;m<r;m++)d[m]=g.call(a[m],a[m],m,a);return d};a.offset=function(a){var g=E.documentElement;a=a.getBoundingClientRect();return{top:a.top+(G.pageYOffset||g.scrollTop)-(g.clientTop||0),left:a.left+(G.pageXOffset||g.scrollLeft)-(g.clientLeft||0)}};a.stop=function(a){for(var g=
A.length;g--;)A[g].elem===a&&(A[g].stopped=!0)};a.each=function(a,g,d){return Array.prototype.forEach.call(a,g,d)};a.addEvent=function(a,g,d){function m(n){n.target=n.srcElement||G;d.call(a,n)}var r=a.hcEvents=a.hcEvents||{};a.addEventListener?a.addEventListener(g,d,!1):a.attachEvent&&(a.hcEventsIE||(a.hcEventsIE={}),a.hcEventsIE[d.toString()]=m,a.attachEvent("on"+g,m));r[g]||(r[g]=[]);r[g].push(d)};a.removeEvent=function(t,g,d){function m(a,b){t.removeEventListener?t.removeEventListener(a,b,!1):
t.attachEvent&&(b=t.hcEventsIE[b.toString()],t.detachEvent("on"+a,b))}function r(){var a,b;if(t.nodeName)for(b in g?(a={},a[g]=!0):a=p,a)if(p[b])for(a=p[b].length;a--;)m(b,p[b][a])}var n,p=t.hcEvents,b;p&&(g?(n=p[g]||[],d?(b=a.inArray(d,n),-1<b&&(n.splice(b,1),p[g]=n),m(g,d)):(r(),p[g]=[])):(r(),t.hcEvents={}))};a.fireEvent=function(t,g,d,m){var r;r=t.hcEvents;var n,p;d=d||{};if(E.createEvent&&(t.dispatchEvent||t.fireEvent))r=E.createEvent("Events"),r.initEvent(g,!0,!0),a.extend(r,d),t.dispatchEvent?
t.dispatchEvent(r):t.fireEvent(g,r);else if(r)for(r=r[g]||[],n=r.length,d.target||a.extend(d,{preventDefault:function(){d.defaultPrevented=!0},target:t,type:g}),g=0;g<n;g++)(p=r[g])&&!1===p.call(t,d)&&d.preventDefault();m&&!d.defaultPrevented&&m(d)};a.animate=function(t,g,d){var m,r="",n,p,b;a.isObject(d)||(m=arguments,d={duration:m[2],easing:m[3],complete:m[4]});a.isNumber(d.duration)||(d.duration=400);d.easing="function"===typeof d.easing?d.easing:Math[d.easing]||Math.easeInOutSine;d.curAnim=a.merge(g);
for(b in g)p=new a.Fx(t,d,b),n=null,"d"===b?(p.paths=p.initPath(t,t.d,g.d),p.toD=g.d,m=0,n=1):t.attr?m=t.attr(b):(m=parseFloat(a.getStyle(t,b))||0,"opacity"!==b&&(r="px")),n||(n=g[b]),n.match&&n.match("px")&&(n=n.replace(/px/g,"")),p.run(m,n,r)};a.seriesType=function(t,g,d,m,r){var n=a.getOptions(),p=a.seriesTypes;n.plotOptions[t]=a.merge(n.plotOptions[g],d);p[t]=a.extendClass(p[g]||function(){},m);p[t].prototype.type=t;r&&(p[t].prototype.pointClass=a.extendClass(a.Point,r));return p[t]};G.jQuery&&
(G.jQuery.fn.highcharts=function(){var t=[].slice.call(arguments);if(this[0])return t[0]?(new (a[a.isString(t[0])?t.shift():"Chart"])(this[0],t[0],t[1]),this):y[a.attr(this[0],"data-highcharts-chart")]});E&&!E.defaultView&&(a.getStyle=function(t,g){var d;d={width:"clientWidth",height:"clientHeight"}[g];if(t.style[g])return a.pInt(t.style[g]);"opacity"===g&&(g="filter");if(d)return t.style.zoom=1,Math.max(t[d]-2*a.getStyle(t,"padding"),0);d=t.currentStyle[g.replace(/\-(\w)/g,function(a,d){return d.toUpperCase()})];
"filter"===g&&(d=d.replace(/alpha\(opacity=([0-9]+)\)/,function(a,d){return d/100}));return""===d?1:a.pInt(d)});Array.prototype.forEach||(a.each=function(a,g,d){for(var m=0,r=a.length;m<r;m++)if(!1===g.call(d,a[m],m,a))return m});Array.prototype.indexOf||(a.inArray=function(a,g){var d,m=0;if(g)for(d=g.length;m<d;m++)if(g[m]===a)return m;return-1});Array.prototype.filter||(a.grep=function(a,g){for(var d=[],m=0,r=a.length;m<r;m++)g(a[m],m)&&d.push(a[m]);return d})})(K);(function(a){var A=a.each,y=a.isNumber,
E=a.map,G=a.merge,t=a.pInt;a.Color=function(g){if(!(this instanceof a.Color))return new a.Color(g);this.init(g)};a.Color.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[t(a[1]),t(a[2]),t(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[t(a[1],16),t(a[2],16),t(a[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,
parse:function(a){return[t(a[1]),t(a[2]),t(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(g){var d,m,r,n;if((this.input=g=this.names[g]||g)&&g.stops)this.stops=E(g.stops,function(d){return new a.Color(d[1])});else for(r=this.parsers.length;r--&&!m;)n=this.parsers[r],(d=n.regex.exec(g))&&(m=n.parse(d));this.rgba=m||[]},get:function(a){var d=this.input,m=this.rgba,r;this.stops?(r=G(d),r.stops=[].concat(r.stops),A(this.stops,function(d,p){r.stops[p]=[r.stops[p][0],d.get(a)]})):r=m&&
y(m[0])?"rgb"===a||!a&&1===m[3]?"rgb("+m[0]+","+m[1]+","+m[2]+")":"a"===a?m[3]:"rgba("+m.join(",")+")":d;return r},brighten:function(a){var d,m=this.rgba;if(this.stops)A(this.stops,function(d){d.brighten(a)});else if(y(a)&&0!==a)for(d=0;3>d;d++)m[d]+=t(255*a),0>m[d]&&(m[d]=0),255<m[d]&&(m[d]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};a.color=function(g){return new a.Color(g)}})(K);(function(a){var A,y,E=a.addEvent,G=a.animate,t=a.attr,g=a.charts,d=a.color,m=a.css,r=a.createElement,
n=a.defined,p=a.deg2rad,b=a.destroyObjectProperties,k=a.doc,v=a.each,B=a.extend,e=a.erase,c=a.grep,l=a.hasTouch,q=a.isArray,h=a.isFirefox,f=a.isMS,u=a.isObject,D=a.isString,H=a.isWebKit,F=a.merge,I=a.noop,C=a.pick,w=a.pInt,J=a.removeEvent,M=a.stop,x=a.svg,z=a.SVG_NS,N=a.win;A=a.SVGElement=function(){return this};A.prototype={opacity:1,SVG_NS:z,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textShadow".split(" "),init:function(a,f){this.element=
"span"===f?r(f):k.createElementNS(this.SVG_NS,f);this.renderer=a},animate:function(a,f,L){f=C(f,this.renderer.globalAnimation,!0);M(this);f?(L&&(f.complete=L),G(this,a,f)):this.attr(a,null,L);return this},colorGradient:function(O,f,L){var c=this.renderer,x,z,e,u,b,h,l,D,d,C,k,w=[],H;O.linearGradient?z="linearGradient":O.radialGradient&&(z="radialGradient");if(z){e=O[z];b=c.gradients;l=O.stops;C=L.radialReference;q(e)&&(O[z]=e={x1:e[0],y1:e[1],x2:e[2],y2:e[3],gradientUnits:"userSpaceOnUse"});"radialGradient"===
z&&C&&!n(e.gradientUnits)&&(u=e,e=F(e,c.getRadialAttr(C,u),{gradientUnits:"userSpaceOnUse"}));for(k in e)"id"!==k&&w.push(k,e[k]);for(k in l)w.push(l[k]);w=w.join(",");b[w]?C=b[w].attr("id"):(e.id=C="highcharts-"+a.idCounter++,b[w]=h=c.createElement(z).attr(e).add(c.defs),h.radAttr=u,h.stops=[],v(l,function(O){0===O[1].indexOf("rgba")?(x=a.color(O[1]),D=x.get("rgb"),d=x.get("a")):(D=O[1],d=1);O=c.createElement("stop").attr({offset:O[0],"stop-color":D,"stop-opacity":d}).add(h);h.stops.push(O)}));H=
"url("+c.url+"#"+C+")";L.setAttribute(f,H);L.gradient=w;O.toString=function(){return H}}},applyTextShadow:function(a){var c=this.element,L,x=-1!==a.indexOf("contrast"),z={},e=this.renderer.forExport,u=this.renderer.forExport||void 0!==c.style.textShadow&&!f;x&&(z.textShadow=a=a.replace(/contrast/g,this.renderer.getContrast(c.style.fill)));if(H||e)z.textRendering="geometricPrecision";u?this.css(z):(this.fakeTS=!0,this.ySetter=this.xSetter,L=[].slice.call(c.getElementsByTagName("tspan")),v(a.split(/\s?,\s?/g),
function(a){var O=c.firstChild,f,x;a=a.split(" ");f=a[a.length-1];(x=a[a.length-2])&&v(L,function(a,L){var z;0===L&&(a.setAttribute("x",c.getAttribute("x")),L=c.getAttribute("y"),a.setAttribute("y",L||0),null===L&&c.setAttribute("y",0));z=a.cloneNode(1);t(z,{"class":"highcharts-text-shadow",fill:f,stroke:f,"stroke-opacity":1/Math.max(w(x),3),"stroke-width":x,"stroke-linejoin":"round"});c.insertBefore(z,O)})}))},attr:function(a,f,L){var c,x=this.element,z,e=this,u;"string"===typeof a&&void 0!==f&&
(c=a,a={},a[c]=f);if("string"===typeof a)e=(this[a+"Getter"]||this._defaultGetter).call(this,a,x);else{for(c in a)f=a[c],u=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(c)&&(z||(this.symbolAttr(a),z=!0),u=!0),!this.rotation||"x"!==c&&"y"!==c||(this.doTransform=!0),u||(u=this[c+"Setter"]||this._defaultSetter,u.call(this,f,c,x),this.shadows&&/^(width|height|visibility|x|y|d|transform|cx|cy|r)$/.test(c)&&this.updateShadows(c,f,u));this.doTransform&&(this.updateTransform(),
this.doTransform=!1)}L&&L();return e},updateShadows:function(a,f,c){for(var x=this.shadows,z=x.length;z--;)c.call(x[z],"height"===a?Math.max(f-(x[z].cutHeight||0),0):"d"===a?this.d:f,a,x[z])},addClass:function(a,f){var c=this.attr("class")||"";-1===c.indexOf(a)&&(f||(a=(c+(c?" ":"")+a).replace(" "," ")),this.attr("class",a));return this},hasClass:function(a){return-1!==t(this.element,"class").indexOf(a)},removeClass:function(a){t(this.element,"class",(t(this.element,"class")||"").replace(a,""));
return this},symbolAttr:function(a){var f=this;v("x y r start end width height innerR anchorX anchorY".split(" "),function(c){f[c]=C(a[c],f[c])});f.attr({d:f.renderer.symbols[f.symbolName](f.x,f.y,f.width,f.height,f)})},clip:function(a){return this.attr("clip-path",a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,f){var c,x={},z;f=f||a.strokeWidth||0;z=Math.round(f)%2/2;a.x=Math.floor(a.x||this.x||0)+z;a.y=Math.floor(a.y||this.y||0)+z;a.width=Math.floor((a.width||this.width||0)-2*
z);a.height=Math.floor((a.height||this.height||0)-2*z);n(a.strokeWidth)&&(a.strokeWidth=f);for(c in a)this[c]!==a[c]&&(this[c]=x[c]=a[c]);return x},css:function(a){var c=this.styles,L={},z=this.element,e,u,b="";e=!c;a&&a.color&&(a.fill=a.color);if(c)for(u in a)a[u]!==c[u]&&(L[u]=a[u],e=!0);if(e){e=this.textWidth=a&&a.width&&"text"===z.nodeName.toLowerCase()&&w(a.width)||this.textWidth;c&&(a=B(c,L));this.styles=a;e&&!x&&this.renderer.forExport&&delete a.width;if(f&&!x)m(this.element,a);else{c=function(a,
O){return"-"+O.toLowerCase()};for(u in a)b+=u.replace(/([A-Z])/g,c)+":"+a[u]+";";t(z,"style",b)}this.added&&e&&this.renderer.buildText(this)}return this},strokeWidth:function(){return this["stroke-width"]||0},on:function(a,f){var c=this,x=c.element;l&&"click"===a?(x.ontouchstart=function(a){c.touchEventFired=Date.now();a.preventDefault();f.call(x,a)},x.onclick=function(a){(-1===N.navigator.userAgent.indexOf("Android")||1100<Date.now()-(c.touchEventFired||0))&&f.call(x,a)}):x["on"+a]=f;return this},
setRadialReference:function(a){var f=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;f&&f.radAttr&&f.animate(this.renderer.getRadialAttr(a,f.radAttr));return this},translate:function(a,f){return this.attr({translateX:a,translateY:f})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,f=this.translateY||0,c=this.scaleX,x=this.scaleY,z=this.inverted,e=this.rotation,u=this.element;z&&(a+=this.attr("width"),
f+=this.attr("height"));a=["translate("+a+","+f+")"];z?a.push("rotate(90) scale(-1,1)"):e&&a.push("rotate("+e+" "+(u.getAttribute("x")||0)+" "+(u.getAttribute("y")||0)+")");(n(c)||n(x))&&a.push("scale("+C(c,1)+" "+C(x,1)+")");a.length&&u.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,f,c){var x,z,u,b,h={};z=this.renderer;u=z.alignedObjects;var l,q;if(a){if(this.alignOptions=a,this.alignByTranslate=f,!c||D(c))this.alignTo=
x=c||"renderer",e(u,this),u.push(this),c=null}else a=this.alignOptions,f=this.alignByTranslate,x=this.alignTo;c=C(c,z[x],z);x=a.align;z=a.verticalAlign;u=(c.x||0)+(a.x||0);b=(c.y||0)+(a.y||0);"right"===x?l=1:"center"===x&&(l=2);l&&(u+=(c.width-(a.width||0))/l);h[f?"translateX":"x"]=Math.round(u);"bottom"===z?q=1:"middle"===z&&(q=2);q&&(b+=(c.height-(a.height||0))/q);h[f?"translateY":"y"]=Math.round(b);this[this.placed?"animate":"attr"](h);this.placed=!0;this.alignAttr=h;return this},getBBox:function(a,
c){var x,z=this.renderer,u,e,b,l=this.element,D=this.styles,q=this.textStr,F,d=l.style,k,w=z.cache,H=z.cacheKeys,n;e=C(c,this.rotation);b=e*p;u=D&&D.fontSize;void 0!==q&&(n=q.toString().replace(/[0-9]/g,"0")+["",e||0,u,l.style.width].join());n&&!a&&(x=w[n]);if(!x){if(l.namespaceURI===this.SVG_NS||z.forExport){try{k=this.fakeTS&&function(a){v(l.querySelectorAll(".highcharts-text-shadow"),function(f){f.style.display=a})},h&&d.textShadow?(F=d.textShadow,d.textShadow=""):k&&k("none"),x=l.getBBox?B({},
l.getBBox()):{width:l.offsetWidth,height:l.offsetHeight},F?d.textShadow=F:k&&k("")}catch(r){}if(!x||0>x.width)x={width:0,height:0}}else x=this.htmlGetBBox();z.isSVG&&(z=x.width,u=x.height,f&&D&&"11px"===D.fontSize&&"16.9"===u.toPrecision(3)&&(x.height=u=14),e&&(x.width=Math.abs(u*Math.sin(b))+Math.abs(z*Math.cos(b)),x.height=Math.abs(u*Math.cos(b))+Math.abs(z*Math.sin(b))));if(n&&0<x.height){for(;250<H.length;)delete w[H.shift()];w[n]||H.push(n);w[n]=x}}return x},show:function(a){return this.attr({visibility:a?
"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var f=this;f.animate({opacity:0},{duration:a||150,complete:function(){f.attr({y:-9999})}})},add:function(a){var f=this.renderer,c=this.element,x;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&f.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)x=this.zIndexSetter();x||(a?a.element:f.box).appendChild(c);if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var f=
a.parentNode;f&&f.removeChild(a)},destroy:function(){var a=this.element||{},f=this.renderer.isSVG&&"SPAN"===a.nodeName&&this.parentGroup,c,x;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=a.point=null;M(this);this.clipPath&&(this.clipPath=this.clipPath.destroy());if(this.stops){for(x=0;x<this.stops.length;x++)this.stops[x]=this.stops[x].destroy();this.stops=null}this.safeRemoveChild(a);for(this.destroyShadows();f&&f.div&&0===f.div.childNodes.length;)a=f.parentGroup,this.safeRemoveChild(f.div),
delete f.div,f=a;this.alignTo&&e(this.renderer.alignedObjects,this);for(c in this)delete this[c];return null},shadow:function(a,f,c){var x=[],z,u,e=this.element,b,l,h,D;if(!a)this.destroyShadows();else if(!this.shadows){l=C(a.width,3);h=(a.opacity||.15)/l;D=this.parentInverted?"(-1,-1)":"("+C(a.offsetX,1)+", "+C(a.offsetY,1)+")";for(z=1;z<=l;z++)u=e.cloneNode(0),b=2*l+1-2*z,t(u,{isShadow:"true",stroke:a.color||"#000000","stroke-opacity":h*z,"stroke-width":b,transform:"translate"+D,fill:"none"}),c&&
(t(u,"height",Math.max(t(u,"height")-b,0)),u.cutHeight=b),f?f.element.appendChild(u):e.parentNode.insertBefore(u,e),x.push(u);this.shadows=x}return this},destroyShadows:function(){v(this.shadows||[],function(a){this.safeRemoveChild(a)},this);this.shadows=void 0},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=C(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));
return a},dSetter:function(a,f,c){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");c.setAttribute(f,a);this[f]=a},dashstyleSetter:function(a){var f,c=this["stroke-width"];"inherit"===c&&(c=1);if(a=a&&a.toLowerCase()){a=a.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot","1,1,").replace("shortdash","3,1,").replace("longdash","8,3,").replace(/dot/g,"1,3,").replace("dash","4,3,").replace(/,$/,"").split(",");for(f=a.length;f--;)a[f]=w(a[f])*
c;a=a.join(",").replace(/NaN/g,"none");this.element.setAttribute("stroke-dasharray",a)}},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},titleSetter:function(a){var f=this.element.getElementsByTagName("title")[0];f||(f=k.createElementNS(this.SVG_NS,"title"),this.element.appendChild(f));f.firstChild&&f.removeChild(f.firstChild);f.appendChild(k.createTextNode(String(C(a),"").replace(/<[^>]*>/g,"")))},textSetter:function(a){a!==this.textStr&&
(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},fillSetter:function(a,f,c){"string"===typeof a?c.setAttribute(f,a):a&&this.colorGradient(a,f,c)},visibilitySetter:function(a,f,c){"inherit"===a?c.removeAttribute(f):c.setAttribute(f,a)},zIndexSetter:function(a,f){var c=this.renderer,x=this.parentGroup,c=(x||c).element||c.box,z,u,e=this.element,b;z=this.added;var l;n(a)&&(e.zIndex=a,a=+a,this[f]===a&&(z=!1),this[f]=a);if(z){(a=this.zIndex)&&x&&(x.handleZ=!0);x=c.childNodes;
for(l=0;l<x.length&&!b;l++)z=x[l],u=z.zIndex,z!==e&&(w(u)>a||!n(a)&&n(u))&&(c.insertBefore(e,z),b=!0);b||c.appendChild(e)}return b},_defaultSetter:function(a,f,c){c.setAttribute(f,a)}};A.prototype.yGetter=A.prototype.xGetter;A.prototype.translateXSetter=A.prototype.translateYSetter=A.prototype.rotationSetter=A.prototype.verticalAlignSetter=A.prototype.scaleXSetter=A.prototype.scaleYSetter=function(a,f){this[f]=a;this.doTransform=!0};A.prototype.opacitySetter=A.prototype.displaySetter=function(a,f,
c){this[f]=a;c.setAttribute(f,a)};A.prototype["stroke-widthSetter"]=A.prototype.strokeSetter=function(a,f,c){this[f]=a;this.stroke&&this["stroke-width"]?(A.prototype.fillSetter.call(this,this.stroke,"stroke",c),c.setAttribute("stroke-width",this["stroke-width"]),this.hasStroke=!0):"stroke-width"===f&&0===a&&this.hasStroke&&(c.removeAttribute("stroke"),this.hasStroke=!1)};y=a.SVGRenderer=function(){this.init.apply(this,arguments)};y.prototype={Element:A,SVG_NS:z,init:function(a,f,c,x,z,u){var e;x=
this.createElement("svg").attr({version:"1.1","class":"highcharts-root"}).css(this.getStyle(x));e=x.element;a.appendChild(e);-1===a.innerHTML.indexOf("xmlns")&&t(e,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=e;this.boxWrapper=x;this.alignedObjects=[];this.url=(h||H)&&k.getElementsByTagName("base").length?N.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(k.createTextNode("Created with Highcharts 5.0.0"));this.defs=
this.createElement("defs").add();this.allowHTML=u;this.forExport=z;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(f,c,!1);var b;h&&a.getBoundingClientRect&&(this.subPixelFix=f=function(){m(a,{left:0,top:0});b=a.getBoundingClientRect();m(a,{left:Math.ceil(b.left)-b.left+"px",top:Math.ceil(b.top)-b.top+"px"})},f(),E(N,"resize",f))},getStyle:function(a){return this.style=B({fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Arial, Helvetica, sans-serif',fontSize:"12px"},
a)},setStyle:function(a){this.boxWrapper.css(this.getStyle(a))},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();b(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.subPixelFix&&J(N,"resize",this.subPixelFix);return this.alignedObjects=null},createElement:function(a){var f=new this.Element;f.init(this,a);return f},draw:I,getRadialAttr:function(a,f){return{cx:a[0]-a[2]/2+f.cx*
a[2],cy:a[1]-a[2]/2+f.cy*a[2],r:f.r*a[2]}},buildText:function(a){for(var f=a.element,u=this,e=u.forExport,b=C(a.textStr,"").toString(),l=-1!==b.indexOf("<"),h=f.childNodes,D,q,F,d,n=t(f,"x"),H=a.styles,r=a.textWidth,J=H&&H.lineHeight,p=H&&H.textShadow,g=H&&"ellipsis"===H.textOverflow,N=h.length,B=r&&!a.added&&this.box,M=function(a){var f;f=/(px|em)$/.test(a&&a.style.fontSize)?a.style.fontSize:H&&H.fontSize||u.style.fontSize||12;return J?w(J):u.fontMetrics(f,a).h};N--;)f.removeChild(h[N]);l||p||g||
r||-1!==b.indexOf(" ")?(D=/<.*class="([^"]+)".*>/,q=/<.*style="([^"]+)".*>/,F=/<.*href="(http[^"]+)".*>/,B&&B.appendChild(f),b=l?b.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):[b],b=c(b,function(a){return""!==a}),v(b,function(c,b){var l,h=0;c=c.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");l=c.split("|||");
v(l,function(c){if(""!==c||1===l.length){var C={},w=k.createElementNS(u.SVG_NS,"tspan"),v,J;D.test(c)&&(v=c.match(D)[1],t(w,"class",v));q.test(c)&&(J=c.match(q)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),t(w,"style",J));F.test(c)&&!e&&(t(w,"onclick",'location.href="'+c.match(F)[1]+'"'),m(w,{cursor:"pointer"}));c=(c.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(" "!==c){w.appendChild(k.createTextNode(c));h?C.dx=0:b&&null!==n&&(C.x=n);t(w,C);f.appendChild(w);!h&&b&&(!x&&
e&&m(w,{display:"block"}),t(w,"dy",M(w)));if(r){C=c.replace(/([^\^])-/g,"$1- ").split(" ");v="nowrap"===H.whiteSpace;for(var p=1<l.length||b||1<C.length&&!v,N,B,Q=[],T=M(w),I=a.rotation,P=c,y=P.length;(p||g)&&(C.length||Q.length);)a.rotation=0,N=a.getBBox(!0),B=N.width,!x&&u.forExport&&(B=u.measureSpanWidth(w.firstChild.data,a.styles)),N=B>r,void 0===d&&(d=N),g&&d?(y/=2,""===P||!N&&.5>y?C=[]:(P=c.substring(0,P.length+(N?-1:1)*Math.ceil(y)),C=[P+(3<r?"\u2026":"")],w.removeChild(w.firstChild))):N&&
1!==C.length?(w.removeChild(w.firstChild),Q.unshift(C.pop())):(C=Q,Q=[],C.length&&!v&&(w=k.createElementNS(z,"tspan"),t(w,{dy:T,x:n}),J&&t(w,"style",J),f.appendChild(w)),B>r&&(r=B)),C.length&&w.appendChild(k.createTextNode(C.join(" ").replace(/- /g,"-")));a.rotation=I}h++}}})}),d&&a.attr("title",a.textStr),B&&B.removeChild(f),p&&a.applyTextShadow&&a.applyTextShadow(p)):f.appendChild(k.createTextNode(b.replace(/&lt;/g,"<").replace(/&gt;/g,">")))},getContrast:function(a){a=d(a).rgba;return 510<a[0]+
a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,c,x,z,u,e,b,l,h){var D=this.label(a,c,x,h,null,null,null,null,"button"),q=0;D.attr(F({padding:8,r:2},u));var C,w,d,k;u=F({fill:"#f7f7f7",stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontWeight:"normal"}},u);C=u.style;delete u.style;e=F(u,{fill:"#e6e6e6"},e);w=e.style;delete e.style;b=F(u,{fill:"#e6ebf5",style:{color:"#000000",fontWeight:"bold"}},b);d=b.style;delete b.style;l=F(u,{style:{color:"#cccccc"}},l);k=l.style;delete l.style;
E(D.element,f?"mouseover":"mouseenter",function(){3!==q&&D.setState(1)});E(D.element,f?"mouseout":"mouseleave",function(){3!==q&&D.setState(q)});D.setState=function(a){1!==a&&(D.state=q=a);D.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][a||0]);D.attr([u,e,b,l][a||0]).css([C,w,d,k][a||0])};D.attr(u).css(B({cursor:"default"},C));return D.on("click",function(a){3!==q&&z.call(D,a)})},crispLine:function(a,f){a[1]===
a[4]&&(a[1]=a[4]=Math.round(a[1])-f%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+f%2/2);return a},path:function(a){var f={fill:"none"};q(a)?f.d=a:u(a)&&B(f,a);return this.createElement("path").attr(f)},circle:function(a,f,c){a=u(a)?a:{x:a,y:f,r:c};f=this.createElement("circle");f.xSetter=f.ySetter=function(a,f,c){c.setAttribute("c"+f,a)};return f.attr(a)},arc:function(a,f,c,x,z,e){u(a)&&(f=a.y,c=a.r,x=a.innerR,z=a.start,e=a.end,a=a.x);a=this.symbol("arc",a||0,f||0,c||0,c||0,{innerR:x||0,start:z||
0,end:e||0});a.r=c;return a},rect:function(a,f,c,x,z,e){z=u(a)?a.r:z;var b=this.createElement("rect");a=u(a)?a:void 0===a?{}:{x:a,y:f,width:Math.max(c,0),height:Math.max(x,0)};void 0!==e&&(a.strokeWidth=e,a=b.crisp(a));a.fill="none";z&&(a.r=z);b.rSetter=function(a,f,c){t(c,{rx:a,ry:a})};return b.attr(a)},setSize:function(a,f,c){var x=this.alignedObjects,z=x.length;this.width=a;this.height=f;for(this.boxWrapper.animate({width:a,height:f},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+
" "+this.attr("height")})},duration:C(c,!0)?void 0:0});z--;)x[z].align()},g:function(a){var f=this.createElement("g");return a?f.attr({"class":"highcharts-"+a}):f},image:function(a,f,c,x,z){var u={preserveAspectRatio:"none"};1<arguments.length&&B(u,{x:f,y:c,width:x,height:z});u=this.createElement("image").attr(u);u.element.setAttributeNS?u.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):u.element.setAttribute("hc-svg-href",a);return u},symbol:function(a,f,c,x,z,u){var e=this,b,l=this.symbols[a],
D=n(f)&&l&&l(Math.round(f),Math.round(c),x,z,u),h=/^url\((.*?)\)$/,q,w,d={};l?(b=this.path(D),b.attr("fill","none"),B(b,{symbolName:a,x:f,y:c,width:x,height:z}),u&&B(b,u)):h.test(a)&&(q=a.match(h)[1],b=this.image(q),b.imgwidth=C(d[q]&&d[q].width,u&&u.width),b.imgheight=C(d[q]&&d[q].height,u&&u.height),w=function(){b.attr({width:b.width,height:b.height})},v(["width","height"],function(a){b[a+"Setter"]=function(a,f){var c={},x=this["img"+f];this[f]=a;n(x)&&(this.element&&this.element.setAttribute(f,
x),this.alignByTranslate||(c["width"===f?"translateX":"translateY"]=(this[f]-x)/2,this.attr(c)))}}),n(f)&&b.attr({x:f,y:c}),b.isImg=!0,n(b.imgwidth)&&n(b.imgheight)?w():(b.attr({width:0,height:0}),r("img",{onload:function(){var a=g[e.chartIndex];0===this.width&&(m(this,{position:"absolute",top:"-999em"}),k.body.appendChild(this));d[q]={width:this.width,height:this.height};b.imgwidth=this.width;b.imgheight=this.height;b.element&&w();this.parentNode&&this.parentNode.removeChild(this);e.imgCount--;if(!e.imgCount&&
a&&a.onload)a.onload()},src:q}),this.imgCount++));return b},symbols:{circle:function(a,f,c,x){var z=.166*c;return["M",a+c/2,f,"C",a+c+z,f,a+c+z,f+x,a+c/2,f+x,"C",a-z,f+x,a-z,f,a+c/2,f,"Z"]},square:function(a,f,c,x){return["M",a,f,"L",a+c,f,a+c,f+x,a,f+x,"Z"]},triangle:function(a,f,c,x){return["M",a+c/2,f,"L",a+c,f+x,a,f+x,"Z"]},"triangle-down":function(a,f,c,x){return["M",a,f,"L",a+c,f,a+c/2,f+x,"Z"]},diamond:function(a,f,c,x){return["M",a+c/2,f,"L",a+c,f+x/2,a+c/2,f+x,a,f+x/2,"Z"]},arc:function(a,
f,c,x,z){var u=z.start;c=z.r||c||x;var b=z.end-.001;x=z.innerR;var e=z.open,l=Math.cos(u),D=Math.sin(u),h=Math.cos(b),b=Math.sin(b);z=z.end-u<Math.PI?0:1;return["M",a+c*l,f+c*D,"A",c,c,0,z,1,a+c*h,f+c*b,e?"M":"L",a+x*h,f+x*b,"A",x,x,0,z,0,a+x*l,f+x*D,e?"":"Z"]},callout:function(a,f,c,x,z){var u=Math.min(z&&z.r||0,c,x),b=u+6,e=z&&z.anchorX;z=z&&z.anchorY;var l;l=["M",a+u,f,"L",a+c-u,f,"C",a+c,f,a+c,f,a+c,f+u,"L",a+c,f+x-u,"C",a+c,f+x,a+c,f+x,a+c-u,f+x,"L",a+u,f+x,"C",a,f+x,a,f+x,a,f+x-u,"L",a,f+u,
"C",a,f,a,f,a+u,f];e&&e>c&&z>f+b&&z<f+x-b?l.splice(13,3,"L",a+c,z-6,a+c+6,z,a+c,z+6,a+c,f+x-u):e&&0>e&&z>f+b&&z<f+x-b?l.splice(33,3,"L",a,z+6,a-6,z,a,z-6,a,f+u):z&&z>x&&e>a+b&&e<a+c-b?l.splice(23,3,"L",e+6,f+x,e,f+x+6,e-6,f+x,a+u,f+x):z&&0>z&&e>a+b&&e<a+c-b&&l.splice(3,3,"L",e-6,f,e,f-6,e+6,f,c-u,f);return l}},clipRect:function(f,c,x,z){var u="highcharts-"+a.idCounter++,b=this.createElement("clipPath").attr({id:u}).add(this.defs);f=this.rect(f,c,x,z,0).add(b);f.id=u;f.clipPath=b;f.count=0;return f},
text:function(a,f,c,z){var u=!x&&this.forExport,b={};if(z&&(this.allowHTML||!this.forExport))return this.html(a,f,c);b.x=Math.round(f||0);c&&(b.y=Math.round(c));if(a||0===a)b.text=a;a=this.createElement("text").attr(b);u&&a.css({position:"absolute"});z||(a.xSetter=function(a,f,c){var x=c.getElementsByTagName("tspan"),z,u=c.getAttribute(f),b;for(b=0;b<x.length;b++)z=x[b],z.getAttribute(f)===u&&z.setAttribute(f,a);c.setAttribute(f,a)});return a},fontMetrics:function(a,f){var c;a=a||this.style&&this.style.fontSize;
a=/px/.test(a)?w(a):/em/.test(a)?12*parseFloat(a):12;c=24>a?a+3:Math.round(1.2*a);return{h:c,b:Math.round(.8*c),f:a}},rotCorr:function(a,f,c){var x=a;f&&c&&(x=Math.max(x*Math.cos(f*p),4));return{x:-a/3*Math.sin(f*p),y:x}},label:function(a,f,c,x,z,u,b,e,l){var D=this,h=D.g("button"!==l&&"label"),q=h.text=D.text("",0,0,b).attr({zIndex:1}),C,w,d=0,k=3,H=0,r,p,g,N,m,M={},I,t,y=/^url\((.*?)\)$/.test(x),E=y,G,K,X,V;l&&h.addClass("highcharts-"+l);E=y;G=function(){return(I||0)%2/2};K=function(){var a=q.element.style,
f={};w=(void 0===r||void 0===p||m)&&n(q.textStr)&&q.getBBox();h.width=(r||w.width||0)+2*k+H;h.height=(p||w.height||0)+2*k;t=k+D.fontMetrics(a&&a.fontSize,q).b;E&&(C||(h.box=C=D.symbols[x]||y?D.symbol(x):D.rect(),C.addClass(("button"===l?"":"highcharts-label-box")+(l?" highcharts-"+l+"-box":"")),C.add(h),a=G(),f.x=a,f.y=(e?-t:0)+a),f.width=Math.round(h.width),f.height=Math.round(h.height),C.attr(B(f,M)),M={})};X=function(){var a=H+k,f;f=e?0:t;n(r)&&w&&("center"===m||"right"===m)&&(a+={center:.5,right:1}[m]*
(r-w.width));if(a!==q.x||f!==q.y)q.attr("x",a),void 0!==f&&q.attr("y",f);q.x=a;q.y=f};V=function(a,f){C?C.attr(a,f):M[a]=f};h.onAdd=function(){q.add(h);h.attr({text:a||0===a?a:"",x:f,y:c});C&&n(z)&&h.attr({anchorX:z,anchorY:u})};h.widthSetter=function(a){r=a};h.heightSetter=function(a){p=a};h["text-alignSetter"]=function(a){m=a};h.paddingSetter=function(a){n(a)&&a!==k&&(k=h.padding=a,X())};h.paddingLeftSetter=function(a){n(a)&&a!==H&&(H=a,X())};h.alignSetter=function(a){a={left:0,center:.5,right:1}[a];
a!==d&&(d=a,w&&h.attr({x:g}))};h.textSetter=function(a){void 0!==a&&q.textSetter(a);K();X()};h["stroke-widthSetter"]=function(a,f){a&&(E=!0);I=this["stroke-width"]=a;V(f,a)};h.strokeSetter=h.fillSetter=h.rSetter=function(a,f){"fill"===f&&a&&(E=!0);V(f,a)};h.anchorXSetter=function(a,f){z=a;V(f,Math.round(a)-G()-g)};h.anchorYSetter=function(a,f){u=a;V(f,a-N)};h.xSetter=function(a){h.x=a;d&&(a-=d*((r||w.width)+2*k));g=Math.round(a);h.attr("translateX",g)};h.ySetter=function(a){N=h.y=Math.round(a);h.attr("translateY",
N)};var ba=h.css;return B(h,{css:function(a){if(a){var f={};a=F(a);v(h.textProps,function(c){void 0!==a[c]&&(f[c]=a[c],delete a[c])});q.css(f)}return ba.call(h,a)},getBBox:function(){return{width:w.width+2*k,height:w.height+2*k,x:w.x-k,y:w.y-k}},shadow:function(a){a&&(K(),C&&C.shadow(a));return h},destroy:function(){J(h.element,"mouseenter");J(h.element,"mouseleave");q&&(q=q.destroy());C&&(C=C.destroy());A.prototype.destroy.call(h);h=D=K=X=V=null}})}};a.Renderer=y})(K);(function(a){var A=a.attr,y=
a.createElement,E=a.css,G=a.defined,t=a.each,g=a.extend,d=a.isFirefox,m=a.isMS,r=a.isWebKit,n=a.pInt,p=a.SVGRenderer,b=a.win,k=a.wrap;g(a.SVGElement.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&"SPAN"===b.tagName&&a.width)delete a.width,this.textWidth=b,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=g(this.styles,a);E(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position=
"absolute");return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=this.renderer,b=this.element,e=this.translateX||0,c=this.translateY||0,l=this.x||0,q=this.y||0,h=this.textAlign||"left",f={left:0,center:.5,right:1}[h],u=this.styles;E(b,{marginLeft:e,marginTop:c});this.shadows&&t(this.shadows,function(a){E(a,{marginLeft:e+1,marginTop:c+1})});this.inverted&&t(b.childNodes,function(f){a.invertChild(f,b)});if("SPAN"===b.tagName){var D=
this.rotation,d=n(this.textWidth),k=u&&u.whiteSpace,p=[D,h,b.innerHTML,this.textWidth,this.textAlign].join();p!==this.cTT&&(u=a.fontMetrics(b.style.fontSize).b,G(D)&&this.setSpanRotation(D,f,u),E(b,{width:"",whiteSpace:k||"nowrap"}),b.offsetWidth>d&&/[ \-]/.test(b.textContent||b.innerText)&&E(b,{width:d+"px",display:"block",whiteSpace:k||"normal"}),this.getSpanCorrection(b.offsetWidth,u,f,D,h));E(b,{left:l+(this.xCorr||0)+"px",top:q+(this.yCorr||0)+"px"});r&&(u=b.offsetHeight);this.cTT=p}}else this.alignOnAdd=
!0},setSpanRotation:function(a,k,e){var c={},l=m?"-ms-transform":r?"-webkit-transform":d?"MozTransform":b.opera?"-o-transform":"";c[l]=c.transform="rotate("+a+"deg)";c[l+(d?"Origin":"-origin")]=c.transformOrigin=100*k+"% "+e+"px";E(this.element,c)},getSpanCorrection:function(a,b,e){this.xCorr=-a*e;this.yCorr=-b}});g(p.prototype,{html:function(a,b,e){var c=this.createElement("span"),l=c.element,q=c.renderer,h=q.isSVG,f=function(a,f){t(["display","opacity","visibility"],function(c){k(a,c+"Setter",function(a,
c,b,u){a.call(this,c,b,u);f[b]=c})})};c.textSetter=function(a){a!==l.innerHTML&&delete this.bBox;l.innerHTML=this.textStr=a;c.htmlUpdateTransform()};h&&f(c,c.element.style);c.xSetter=c.ySetter=c.alignSetter=c.rotationSetter=function(a,f){"align"===f&&(f="textAlign");c[f]=a;c.htmlUpdateTransform()};c.attr({text:a,x:Math.round(b),y:Math.round(e)}).css({fontFamily:this.style.fontFamily,fontSize:this.style.fontSize,position:"absolute"});l.style.whiteSpace="nowrap";c.css=c.htmlCss;h&&(c.add=function(a){var b,
e=q.box.parentNode,h=[];if(this.parentGroup=a){if(b=a.div,!b){for(;a;)h.push(a),a=a.parentGroup;t(h.reverse(),function(a){var c,u=A(a.element,"class");u&&(u={className:u});b=a.div=a.div||y("div",u,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},b||e);c=b.style;g(a,{translateXSetter:function(f,b){c.left=f+"px";a[b]=f;a.doTransform=!0},translateYSetter:function(f,b){c.top=f+"px";a[b]=f;a.doTransform=
!0}});f(a,c)})}}else b=e;b.appendChild(l);c.added=!0;c.alignOnAdd&&c.htmlUpdateTransform();return c});return c}})})(K);(function(a){var A,y,E=a.createElement,G=a.css,t=a.defined,g=a.deg2rad,d=a.discardElement,m=a.doc,r=a.each,n=a.erase,p=a.extend;A=a.extendClass;var b=a.isArray,k=a.isNumber,v=a.isObject,B=a.merge;y=a.noop;var e=a.pick,c=a.pInt,l=a.SVGElement,q=a.SVGRenderer,h=a.win;a.svg||(y={docMode8:m&&8===m.documentMode,init:function(a,c){var b=["<",c,' filled="f" stroked="f"'],e=["position: ",
"absolute",";"],h="div"===c;("shape"===c||h)&&e.push("left:0;top:0;width:1px;height:1px;");e.push("visibility: ",h?"hidden":"visible");b.push(' style="',e.join(""),'"/>');c&&(b=h||"span"===c||"img"===c?b.join(""):a.prepVML(b),this.element=E(b));this.renderer=a},add:function(a){var c=this.renderer,b=this.element,e=c.box,h=a&&a.inverted,e=a?a.element||a:e;a&&(this.parentGroup=a);h&&c.invertChild(b,e);e.appendChild(b);this.added=!0;this.alignOnAdd&&!this.deferUpdateTransform&&this.updateTransform();
if(this.onAdd)this.onAdd();this.className&&this.attr("class",this.className);return this},updateTransform:l.prototype.htmlUpdateTransform,setSpanRotation:function(){var a=this.rotation,c=Math.cos(a*g),b=Math.sin(a*g);G(this.element,{filter:a?["progid:DXImageTransform.Microsoft.Matrix(M11=",c,", M12=",-b,", M21=",b,", M22=",c,", sizingMethod='auto expand')"].join(""):"none"})},getSpanCorrection:function(a,c,b,h,l){var q=h?Math.cos(h*g):1,d=h?Math.sin(h*g):0,w=e(this.elemHeight,this.element.offsetHeight),
k;this.xCorr=0>q&&-a;this.yCorr=0>d&&-w;k=0>q*d;this.xCorr+=d*c*(k?1-b:b);this.yCorr-=q*c*(h?k?b:1-b:1);l&&"left"!==l&&(this.xCorr-=a*b*(0>q?-1:1),h&&(this.yCorr-=w*b*(0>d?-1:1)),G(this.element,{textAlign:l}))},pathToVML:function(a){for(var c=a.length,b=[];c--;)k(a[c])?b[c]=Math.round(10*a[c])-5:"Z"===a[c]?b[c]="x":(b[c]=a[c],!a.isArc||"wa"!==a[c]&&"at"!==a[c]||(b[c+5]===b[c+7]&&(b[c+7]+=a[c+7]>a[c+5]?1:-1),b[c+6]===b[c+8]&&(b[c+8]+=a[c+8]>a[c+6]?1:-1)));return b.join(" ")||"x"},clip:function(a){var c=
this,b;a?(b=a.members,n(b,c),b.push(c),c.destroyClip=function(){n(b,c)},a=a.getCSS(c)):(c.destroyClip&&c.destroyClip(),a={clip:c.docMode8?"inherit":"rect(auto)"});return c.css(a)},css:l.prototype.htmlCss,safeRemoveChild:function(a){a.parentNode&&d(a)},destroy:function(){this.destroyClip&&this.destroyClip();return l.prototype.destroy.apply(this)},on:function(a,c){this.element["on"+a]=function(){var a=h.event;a.target=a.srcElement;c(a)};return this},cutOffPath:function(a,b){var e;a=a.split(/[ ,]/);
e=a.length;if(9===e||11===e)a[e-4]=a[e-2]=c(a[e-2])-10*b;return a.join(" ")},shadow:function(a,b,h){var l=[],q,d=this.element,k=this.renderer,w,n=d.style,r,x=d.path,z,p,v,g;x&&"string"!==typeof x.value&&(x="x");p=x;if(a){v=e(a.width,3);g=(a.opacity||.15)/v;for(q=1;3>=q;q++)z=2*v+1-2*q,h&&(p=this.cutOffPath(x.value,z+.5)),r=['<shape isShadow="true" strokeweight="',z,'" filled="false" path="',p,'" coordsize="10 10" style="',d.style.cssText,'" />'],w=E(k.prepVML(r),null,{left:c(n.left)+e(a.offsetX,1),
top:c(n.top)+e(a.offsetY,1)}),h&&(w.cutOff=z+1),r=['<stroke color="',a.color||"#000000",'" opacity="',g*q,'"/>'],E(k.prepVML(r),null,null,w),b?b.element.appendChild(w):d.parentNode.insertBefore(w,d),l.push(w);this.shadows=l}return this},updateShadows:y,setAttr:function(a,c){this.docMode8?this.element[a]=c:this.element.setAttribute(a,c)},classSetter:function(a){(this.added?this.element:this).className=a},dashstyleSetter:function(a,c,b){(b.getElementsByTagName("stroke")[0]||E(this.renderer.prepVML(["<stroke/>"]),
null,null,b))[c]=a||"solid";this[c]=a},dSetter:function(a,c,b){var e=this.shadows;a=a||[];this.d=a.join&&a.join(" ");b.path=a=this.pathToVML(a);if(e)for(b=e.length;b--;)e[b].path=e[b].cutOff?this.cutOffPath(a,e[b].cutOff):a;this.setAttr(c,a)},fillSetter:function(a,c,b){var e=b.nodeName;"SPAN"===e?b.style.color=a:"IMG"!==e&&(b.filled="none"!==a,this.setAttr("fillcolor",this.renderer.color(a,b,c,this)))},"fill-opacitySetter":function(a,c,b){E(this.renderer.prepVML(["<",c.split("-")[0],' opacity="',
a,'"/>']),null,null,b)},opacitySetter:y,rotationSetter:function(a,c,b){b=b.style;this[c]=b[c]=a;b.left=-Math.round(Math.sin(a*g)+1)+"px";b.top=Math.round(Math.cos(a*g))+"px"},strokeSetter:function(a,c,b){this.setAttr("strokecolor",this.renderer.color(a,b,c,this))},"stroke-widthSetter":function(a,c,b){b.stroked=!!a;this[c]=a;k(a)&&(a+="px");this.setAttr("strokeweight",a)},titleSetter:function(a,c){this.setAttr(c,a)},visibilitySetter:function(a,c,b){"inherit"===a&&(a="visible");this.shadows&&r(this.shadows,
function(b){b.style[c]=a});"DIV"===b.nodeName&&(a="hidden"===a?"-999em":0,this.docMode8||(b.style[c]=a?"visible":"hidden"),c="top");b.style[c]=a},displaySetter:function(a,c,b){b.style[c]=a},xSetter:function(a,c,b){this[c]=a;"x"===c?c="left":"y"===c&&(c="top");this.updateClipping?(this[c]=a,this.updateClipping()):b.style[c]=a},zIndexSetter:function(a,c,b){b.style[c]=a}},y["stroke-opacitySetter"]=y["fill-opacitySetter"],a.VMLElement=y=A(l,y),y.prototype.ySetter=y.prototype.widthSetter=y.prototype.heightSetter=
y.prototype.xSetter,y={Element:y,isIE8:-1<h.navigator.userAgent.indexOf("MSIE 8.0"),init:function(a,c,b){var e,h;this.alignedObjects=[];e=this.createElement("div").css({position:"relative"});h=e.element;a.appendChild(e.element);this.isVML=!0;this.box=h;this.boxWrapper=e;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(c,b,!1);if(!m.namespaces.hcv){m.namespaces.add("hcv","urn:schemas-microsoft-com:vml");try{m.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}catch(l){m.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,c,b,e){var h=this.createElement(),l=v(a);return p(h,{members:[],count:0,left:(l?a.x:a)+1,top:(l?a.y:c)+1,width:(l?a.width:b)-1,height:(l?a.height:e)-1,getCSS:function(a){var c=a.element,f=c.nodeName,b=a.inverted,x=this.top-("shape"===f?c.offsetTop:0),z=this.left,c=z+this.width,e=x+this.height,x={clip:"rect("+Math.round(b?
z:x)+"px,"+Math.round(b?e:c)+"px,"+Math.round(b?c:e)+"px,"+Math.round(b?x:z)+"px)"};!b&&a.docMode8&&"DIV"===f&&p(x,{width:c+"px",height:e+"px"});return x},updateClipping:function(){r(h.members,function(a){a.element&&a.css(h.getCSS(a))})}})},color:function(c,b,e,h){var l=this,q,d=/^rgba/,k,n,p="none";c&&c.linearGradient?n="gradient":c&&c.radialGradient&&(n="pattern");if(n){var x,z,v=c.linearGradient||c.radialGradient,g,m,L,B,t,Q="";c=c.stops;var P,Y=[],y=function(){k=['<fill colors="'+Y.join(",")+
'" opacity="',L,'" o:opacity2="',m,'" type="',n,'" ',Q,'focus="100%" method="any" />'];E(l.prepVML(k),null,null,b)};g=c[0];P=c[c.length-1];0<g[0]&&c.unshift([0,g[1]]);1>P[0]&&c.push([1,P[1]]);r(c,function(c,f){d.test(c[1])?(q=a.color(c[1]),x=q.get("rgb"),z=q.get("a")):(x=c[1],z=1);Y.push(100*c[0]+"% "+x);f?(L=z,B=x):(m=z,t=x)});if("fill"===e)if("gradient"===n)e=v.x1||v[0]||0,c=v.y1||v[1]||0,g=v.x2||v[2]||0,v=v.y2||v[3]||0,Q='angle="'+(90-180*Math.atan((v-c)/(g-e))/Math.PI)+'"',y();else{var p=v.r,
A=2*p,G=2*p,Z=v.cx,aa=v.cy,W=b.radialReference,U,p=function(){W&&(U=h.getBBox(),Z+=(W[0]-U.x)/U.width-.5,aa+=(W[1]-U.y)/U.height-.5,A*=W[2]/U.width,G*=W[2]/U.height);Q='src="'+a.getOptions().global.VMLRadialGradientURL+'" size="'+A+","+G+'" origin="0.5,0.5" position="'+Z+","+aa+'" color2="'+t+'" ';y()};h.added?p():h.onAdd=p;p=B}else p=x}else d.test(c)&&"IMG"!==b.tagName?(q=a.color(c),h[e+"-opacitySetter"](q.get("a"),e,b),p=q.get("rgb")):(p=b.getElementsByTagName(e),p.length&&(p[0].opacity=1,p[0].type=
"solid"),p=c);return p},prepVML:function(a){var c=this.isIE8;a=a.join("");c?(a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />'),a=-1===a.indexOf('style="')?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:q.prototype.html,path:function(a){var c={coordsize:"10 10"};b(a)?c.d=a:v(a)&&p(c,a);return this.createElement("shape").attr(c)},circle:function(a,
c,b){var e=this.symbol("circle");v(a)&&(b=a.r,c=a.y,a=a.x);e.isCircle=!0;e.r=b;return e.attr({x:a,y:c})},g:function(a){var c;a&&(c={className:"highcharts-"+a,"class":"highcharts-"+a});return this.createElement("div").attr(c)},image:function(a,c,b,e,h){var l=this.createElement("img").attr({src:a});1<arguments.length&&l.attr({x:c,y:b,width:e,height:h});return l},createElement:function(a){return"rect"===a?this.symbol(a):q.prototype.createElement.call(this,a)},invertChild:function(a,b){var e=this,h=b.style,
l="IMG"===a.tagName&&a.style;G(a,{flip:"x",left:c(h.width)-(l?c(l.top):1),top:c(h.height)-(l?c(l.left):1),rotation:-90});r(a.childNodes,function(c){e.invertChild(c,a)})},symbols:{arc:function(a,c,b,e,h){var l=h.start,q=h.end,d=h.r||b||e;b=h.innerR;e=Math.cos(l);var k=Math.sin(l),n=Math.cos(q),x=Math.sin(q);if(0===q-l)return["x"];l=["wa",a-d,c-d,a+d,c+d,a+d*e,c+d*k,a+d*n,c+d*x];h.open&&!b&&l.push("e","M",a,c);l.push("at",a-b,c-b,a+b,c+b,a+b*n,c+b*x,a+b*e,c+b*k,"x","e");l.isArc=!0;return l},circle:function(a,
c,b,e,h){h&&t(h.r)&&(b=e=2*h.r);h&&h.isCircle&&(a-=b/2,c-=e/2);return["wa",a,c,a+b,c+e,a+b,c+e/2,a+b,c+e/2,"e"]},rect:function(a,c,b,e,h){return q.prototype.symbols[t(h)&&h.r?"callout":"square"].call(0,a,c,b,e,h)}}},a.VMLRenderer=A=function(){this.init.apply(this,arguments)},A.prototype=B(q.prototype,y),a.Renderer=A);q.prototype.measureSpanWidth=function(a,c){var b=m.createElement("span"),e;e=m.createTextNode(a);b.appendChild(e);G(b,c);this.box.appendChild(b);e=b.offsetWidth;d(b);return e}})(K);(function(a){function A(){var m=
a.defaultOptions.global,r,n=m.useUTC,p=n?"getUTC":"get",b=n?"setUTC":"set";a.Date=r=m.Date||d.Date;r.hcTimezoneOffset=n&&m.timezoneOffset;r.hcGetTimezoneOffset=n&&m.getTimezoneOffset;r.hcMakeTime=function(a,b,d,e,c,l){var q;n?(q=r.UTC.apply(0,arguments),q+=G(q)):q=(new r(a,b,g(d,1),g(e,0),g(c,0),g(l,0))).getTime();return q};E("Minutes Hours Day Date Month FullYear".split(" "),function(a){r["hcGet"+a]=p+a});E("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),function(a){r["hcSet"+
a]=b+a})}var y=a.color,E=a.each,G=a.getTZOffset,t=a.merge,g=a.pick,d=a.win;a.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:{useUTC:!0,VMLRadialGradientURL:"http://code.highcharts.com@product.cdnpath@/5.0.0/gfx/vml-radial-gradient.png"},chart:{borderRadius:0,defaultSeriesType:"line",ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:20},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,style:{color:"#333333",fontSize:"18px"},widthAdjust:-44},subtitle:{text:"",align:"center",style:{color:"#666666"},widthAdjust:-44},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{activeColor:"#003399",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",fontSize:"12px",fontWeight:"bold"},
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:a.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:a.isTouchDevice?25:10,backgroundColor:y("#f7f7f7").setOpacity(.85).get(),borderWidth:1,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/>',shadow:!0,style:{color:"#333333",cursor:"default",fontSize:"12px",
pointerEvents:"none",whiteSpace:"nowrap"}},credits:{enabled:!0,href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"9px"},text:"Highcharts.com"}};a.setOptions=function(d){a.defaultOptions=t(!0,a.defaultOptions,d);A();return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;A()})(K);(function(a){var A=a.arrayMax,y=a.arrayMin,E=a.defined,G=a.destroyObjectProperties,
t=a.each,g=a.erase,d=a.merge,m=a.pick;a.PlotLineOrBand=function(a,d){this.axis=a;d&&(this.options=d,this.id=d.id)};a.PlotLineOrBand.prototype={render:function(){var a=this,n=a.axis,p=n.horiz,b=a.options,k=b.label,v=a.label,g=b.to,e=b.from,c=b.value,l=E(e)&&E(g),q=E(c),h=a.svgElem,f=!h,u=[],D,H=b.color,F=m(b.zIndex,0),t=b.events,u={"class":"highcharts-plot-"+(l?"band ":"line ")+(b.className||"")},C={},w=n.chart.renderer,J=l?"bands":"lines",M=n.log2lin;n.isLog&&(e=M(e),g=M(g),c=M(c));q?(u={stroke:H,
"stroke-width":b.width},b.dashStyle&&(u.dashstyle=b.dashStyle)):l&&(H&&(u.fill=H),b.borderWidth&&(u.stroke=b.borderColor,u["stroke-width"]=b.borderWidth));C.zIndex=F;J+="-"+F;(H=n[J])||(n[J]=H=w.g("plot-"+J).attr(C).add());f&&(a.svgElem=h=w.path().attr(u).add(H));if(q)u=n.getPlotLinePath(c,h.strokeWidth());else if(l)u=n.getPlotBandPath(e,g,b);else return;if(f&&u&&u.length){if(h.attr({d:u}),t)for(D in b=function(c){h.on(c,function(b){t[c].apply(a,[b])})},t)b(D)}else h&&(u?(h.show(),h.animate({d:u})):
(h.hide(),v&&(a.label=v=v.destroy())));k&&E(k.text)&&u&&u.length&&0<n.width&&0<n.height&&!u.flat?(k=d({align:p&&l&&"center",x:p?!l&&4:10,verticalAlign:!p&&l&&"middle",y:p?l?16:10:l?6:-4,rotation:p&&!l&&90},k),this.renderLabel(k,u,l,F)):v&&v.hide();return a},renderLabel:function(a,d,p,b){var k=this.label,v=this.axis.chart.renderer;k||(k={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(p?"band":"line")+"-label "+(a.className||"")},k.zIndex=b,this.label=k=v.text(a.text,0,0,
a.useHTML).attr(k).add(),k.css(a.style));b=[d[1],d[4],p?d[6]:d[1]];d=[d[2],d[5],p?d[7]:d[2]];p=y(b);v=y(d);k.align(a,!1,{x:p,y:v,width:A(b)-p,height:A(d)-v});k.show()},destroy:function(){g(this.axis.plotLinesAndBands,this);delete this.axis;G(this)}};a.AxisPlotLineOrBandExtension={getPlotBandPath:function(a,d){var p=this.getPlotLinePath(d,null,null,!0),b=this.getPlotLinePath(a,null,null,!0);b&&p?(b.flat=b.toString()===p.toString(),b.push(p[4],p[5],p[1],p[2])):b=null;return b},addPlotBand:function(a){return this.addPlotBandOrLine(a,
"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(d,n){var p=(new a.PlotLineOrBand(this,d)).render(),b=this.userOptions;p&&(n&&(b[n]=b[n]||[],b[n].push(d)),this.plotLinesAndBands.push(p));return p},removePlotBandOrLine:function(a){for(var d=this.plotLinesAndBands,p=this.options,b=this.userOptions,k=d.length;k--;)d[k].id===a&&d[k].destroy();t([p.plotLines||[],b.plotLines||[],p.plotBands||[],b.plotBands||[]],function(b){for(k=b.length;k--;)b[k].id===
a&&g(b,b[k])})}}})(K);(function(a){var A=a.correctFloat,y=a.defined,E=a.destroyObjectProperties,G=a.isNumber,t=a.merge,g=a.pick,d=a.stop,m=a.deg2rad;a.Tick=function(a,d,p,b){this.axis=a;this.pos=d;this.type=p||"";this.isNew=!0;p||b||this.addLabel()};a.Tick.prototype={addLabel:function(){var a=this.axis,d=a.options,p=a.chart,b=a.categories,k=a.names,v=this.pos,m=d.labels,e=a.tickPositions,c=v===e[0],l=v===e[e.length-1],k=b?g(b[v],k[v],v):v,b=this.label,e=e.info,q;a.isDatetimeAxis&&e&&(q=d.dateTimeLabelFormats[e.higherRanks[v]||
e.unitName]);this.isFirst=c;this.isLast=l;d=a.labelFormatter.call({axis:a,chart:p,isFirst:c,isLast:l,dateTimeLabelFormat:q,value:a.isLog?A(a.lin2log(k)):k});y(b)?b&&b.attr({text:d}):(this.labelLength=(this.label=b=y(d)&&m.enabled?p.renderer.text(d,0,0,m.useHTML).css(t(m.style)).add(a.labelGroup):null)&&b.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var d=this.axis,p=a.x,b=d.chart.chartWidth,
k=d.chart.spacing,v=g(d.labelLeft,Math.min(d.pos,k[3])),k=g(d.labelRight,Math.max(d.pos+d.len,b-k[1])),B=this.label,e=this.rotation,c={left:0,center:.5,right:1}[d.labelAlign],l=B.getBBox().width,q=d.getSlotWidth(),h=q,f=1,u,D={};if(e)0>e&&p-c*l<v?u=Math.round(p/Math.cos(e*m)-v):0<e&&p+c*l>k&&(u=Math.round((b-p)/Math.cos(e*m)));else if(b=p+(1-c)*l,p-c*l<v?h=a.x+h*(1-c)-v:b>k&&(h=k-a.x+h*c,f=-1),h=Math.min(q,h),h<q&&"center"===d.labelAlign&&(a.x+=f*(q-h-c*(q-Math.min(l,h)))),l>h||d.autoRotation&&(B.styles||
{}).width)u=h;u&&(D.width=u,(d.options.labels.style||{}).textOverflow||(D.textOverflow="ellipsis"),B.css(D))},getPosition:function(a,d,p,b){var k=this.axis,v=k.chart,g=b&&v.oldChartHeight||v.chartHeight;return{x:a?k.translate(d+p,null,null,b)+k.transB:k.left+k.offset+(k.opposite?(b&&v.oldChartWidth||v.chartWidth)-k.right-k.left:0),y:a?g-k.bottom+k.offset-(k.opposite?k.height:0):g-k.translate(d+p,null,null,b)-k.transB}},getLabelPosition:function(a,d,p,b,k,v,g,e){var c=this.axis,l=c.transA,q=c.reversed,
h=c.staggerLines,f=c.tickRotCorr||{x:0,y:0},u=k.y;y(u)||(u=0===c.side?p.rotation?-8:-p.getBBox().height:2===c.side?f.y+8:Math.cos(p.rotation*m)*(f.y-p.getBBox(!1,0).height/2));a=a+k.x+f.x-(v&&b?v*l*(q?-1:1):0);d=d+u-(v&&!b?v*l*(q?1:-1):0);h&&(p=g/(e||1)%h,c.opposite&&(p=h-p-1),d+=c.labelOffset/h*p);return{x:a,y:Math.round(d)}},getMarkPath:function(a,d,p,b,k,v){return v.crispLine(["M",a,d,"L",a+(k?0:-p),d+(k?p:0)],b)},render:function(a,n,p){var b=this.axis,k=b.options,v=b.chart.renderer,m=b.horiz,
e=this.type,c=this.label,l=this.pos,q=k.labels,h=this.gridLine,f=e?e+"Tick":"tick",u=b.tickSize(f),D=this.mark,H=!D,F=q.step,t={},C=!0,w=b.tickmarkOffset,J=this.getPosition(m,l,w,n),M=J.x,J=J.y,x=m&&M===b.pos+b.len||!m&&J===b.pos?-1:1,z=e?e+"Grid":"grid",N=k[z+"LineWidth"],O=k[z+"LineColor"],S=k[z+"LineDashStyle"],z=g(k[f+"Width"],!e&&b.isXAxis?1:0),f=k[f+"Color"];p=g(p,1);this.isActive=!0;h||(t.stroke=O,t["stroke-width"]=N,S&&(t.dashstyle=S),e||(t.zIndex=1),n&&(t.opacity=0),this.gridLine=h=v.path().attr(t).addClass("highcharts-"+
(e?e+"-":"")+"grid-line").add(b.gridGroup));if(!n&&h&&(l=b.getPlotLinePath(l+w,h.strokeWidth()*x,n,!0)))h[this.isNew?"attr":"animate"]({d:l,opacity:p});u&&(b.opposite&&(u[0]=-u[0]),H&&(this.mark=D=v.path().addClass("highcharts-"+(e?e+"-":"")+"tick").add(b.axisGroup),D.attr({stroke:f,"stroke-width":z})),D[H?"attr":"animate"]({d:this.getMarkPath(M,J,u[0],D.strokeWidth()*x,m,v),opacity:p}));c&&G(M)&&(c.xy=J=this.getLabelPosition(M,J,c,m,q,w,a,F),this.isFirst&&!this.isLast&&!g(k.showFirstLabel,1)||this.isLast&&
!this.isFirst&&!g(k.showLastLabel,1)?C=!1:!m||b.isRadial||q.step||q.rotation||n||0===p||this.handleOverflow(J),F&&a%F&&(C=!1),C&&G(J.y)?(J.opacity=p,c[this.isNew?"attr":"animate"](J)):(d(c),c.attr("y",-9999)),this.isNew=!1)},destroy:function(){E(this,this.axis)}}})(K);(function(a){var A=a.addEvent,y=a.animObject,E=a.arrayMax,G=a.arrayMin,t=a.AxisPlotLineOrBandExtension,g=a.color,d=a.correctFloat,m=a.defaultOptions,r=a.defined,n=a.deg2rad,p=a.destroyObjectProperties,b=a.each,k=a.error,v=a.extend,B=
a.fireEvent,e=a.format,c=a.getMagnitude,l=a.grep,q=a.inArray,h=a.isArray,f=a.isNumber,u=a.isString,D=a.merge,H=a.normalizeTickInterval,F=a.pick,I=a.PlotLineOrBand,C=a.removeEvent,w=a.splat,J=a.syncTimeout,M=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.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,labels:{enabled:!0,style:{color:"#666666",
cursor:"default",fontSize:"11px"},x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,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,tickPixelInterval:72,showLastLabel:!0,
labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"#000000",textShadow:"1px 1px contrast, -1px -1px contrast, -1px 1px contrast, 1px -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},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,c){var b=c.isX;this.chart=a;this.horiz=a.inverted?!b:b;this.isXAxis=b;this.coll=this.coll||(b?"xAxis":"yAxis");this.opposite=c.opposite;this.side=c.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(c);var f=this.options,e=f.type;this.labelFormatter=f.labels.formatter||this.defaultLabelFormatter;this.userOptions=c;this.minPixelPadding=0;this.reversed=f.reversed;this.visible=
!1!==f.visible;this.zoomEnabled=!1!==f.zoomEnabled;this.hasNames="category"===e||!0===f.categories;this.categories=f.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===e;this.isDatetimeAxis="datetime"===e;this.isLinked=r(f.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands={};this.len=0;this.minRange=this.userMinRange=f.minRange||f.maxZoom;this.range=f.range;this.offset=f.offset||0;this.stacks={};this.oldStacks={};
this.stacksTouched=0;this.min=this.max=null;this.crosshair=F(f.crosshair,w(a.options.tooltip.crosshairs)[b?0:1],!1);var h,f=this.options.events;-1===q(this,a.axes)&&(b?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&b&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=this.removePlotBandOrLine;for(h in f)A(this,h,f[h]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=
D(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],D(m[this.coll],a))},defaultLabelFormatter:function(){var c=this.axis,b=this.value,f=c.categories,h=this.dateTimeLabelFormat,l=m.lang.numericSymbols,q=l&&l.length,d,u=c.options.labels.format,c=c.isLog?b:c.tickInterval;if(u)d=e(u,this);else if(f)d=b;else if(h)d=a.dateFormat(h,b);else if(q&&1E3<=c)for(;q--&&
void 0===d;)f=Math.pow(1E3,q+1),c>=f&&0===10*b%f&&null!==l[q]&&0!==b&&(d=a.numberFormat(b/f,-1)+l[q]);void 0===d&&(d=1E4<=Math.abs(b)?a.numberFormat(b,-1):a.numberFormat(b,-1,void 0,""));return d},getSeriesExtremes:function(){var a=this,c=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&a.buildStacks();b(a.series,function(b){if(b.visible||!c.options.chart.ignoreHiddenSeries){var e=b.options,h=e.threshold,d;a.hasVisibleSeries=!0;a.isLog&&
0>=h&&(h=null);if(a.isXAxis)e=b.xData,e.length&&(b=G(e),f(b)||b instanceof Date||(e=l(e,function(a){return f(a)}),b=G(e)),a.dataMin=Math.min(F(a.dataMin,e[0]),b),a.dataMax=Math.max(F(a.dataMax,e[0]),E(e)));else if(b.getExtremes(),d=b.dataMax,b=b.dataMin,r(b)&&r(d)&&(a.dataMin=Math.min(F(a.dataMin,b),b),a.dataMax=Math.max(F(a.dataMax,d),d)),r(h)&&(a.threshold=h),!e.softThreshold||a.isLog)a.softThreshold=!1}})},translate:function(a,c,b,e,h,l){var d=this.linkedParent||this,q=1,u=0,k=e?d.oldTransA:d.transA;
e=e?d.oldMin:d.min;var w=d.minPixelPadding;h=(d.isOrdinal||d.isBroken||d.isLog&&h)&&d.lin2val;k||(k=d.transA);b&&(q*=-1,u=d.len);d.reversed&&(q*=-1,u-=q*(d.sector||d.len));c?(a=(a*q+u-w)/k+e,h&&(a=d.lin2val(a))):(h&&(a=d.val2lin(a)),"between"===l&&(l=.5),a=q*(a-e)*k+u+q*w+(f(l)?k*l*d.pointRange:0));return a},toPixels:function(a,c){return this.translate(a,!1,!this.horiz,null,!0)+(c?0:this.pos)},toValue:function(a,c){return this.translate(a-(c?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,
c,b,e,h){var l=this.chart,d=this.left,q=this.top,u,k,w=b&&l.oldChartHeight||l.chartHeight,C=b&&l.oldChartWidth||l.chartWidth,p;u=this.transB;var v=function(a,c,b){if(a<c||a>b)e?a=Math.min(Math.max(c,a),b):p=!0;return a};h=F(h,this.translate(a,null,null,b));a=b=Math.round(h+u);u=k=Math.round(w-h-u);f(h)?this.horiz?(u=q,k=w-this.bottom,a=b=v(a,d,d+this.width)):(a=d,b=C-this.right,u=k=v(u,q,q+this.height)):p=!0;return p&&!e?null:l.renderer.crispLine(["M",a,u,"L",b,k],c||1)},getLinearTickPositions:function(a,
c,b){var e,h=d(Math.floor(c/a)*a),l=d(Math.ceil(b/a)*a),q=[];if(c===b&&f(c))return[c];for(c=h;c<=l;){q.push(c);c=d(c+a);if(c===e)break;e=c}return q},getMinorTickPositions:function(){var a=this.options,c=this.tickPositions,b=this.minorTickInterval,f=[],e,h=this.pointRangePadding||0;e=this.min-h;var h=this.max+h,l=h-e;if(l&&l/b<this.len/3)if(this.isLog)for(h=c.length,e=1;e<h;e++)f=f.concat(this.getLogTickPositions(b,c[e-1],c[e],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)f=f.concat(this.getTimeTicks(this.normalizeTimeTickInterval(b),
e,h,a.startOfWeek));else for(c=e+(c[0]-e)%b;c<=h;c+=b)f.push(c);0!==f.length&&this.trimTicks(f,a.startOnTick,a.endOnTick);return f},adjustForMinRange:function(){var a=this.options,c=this.min,f=this.max,e,h=this.dataMax-this.dataMin>=this.minRange,l,d,q,u,k,w;this.isXAxis&&void 0===this.minRange&&!this.isLog&&(r(a.min)||r(a.max)?this.minRange=null:(b(this.series,function(a){u=a.xData;for(d=k=a.xIncrement?1:u.length-1;0<d;d--)if(q=u[d]-u[d-1],void 0===l||q<l)l=q}),this.minRange=Math.min(5*l,this.dataMax-
this.dataMin)));f-c<this.minRange&&(w=this.minRange,e=(w-f+c)/2,e=[c-e,F(a.min,c-e)],h&&(e[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),c=E(e),f=[c+w,F(a.max,c+w)],h&&(f[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),f=G(f),f-c<w&&(e[0]=f-w,e[1]=F(a.min,f-w),c=E(e)));this.min=c;this.max=f},getClosest:function(){var a;this.categories?a=1:b(this.series,function(c){var b=c.closestPointRange;!c.noSharedTooltip&&r(b)&&(a=r(a)?Math.min(a,b):b)});return a},nameToX:function(a){var c=h(this.categories),
b=c?this.categories:this.names,f=a.options.x,e;a.series.requireSorting=!1;r(f)||(f=!1===this.options.nameToX?a.series.autoIncrement():q(a.name,b));-1===f?c||(e=b.length):e=f;this.names[e]=a.name;return e},updateNames:function(){var a=this;0<this.names.length&&(this.names.length=0,this.minRange=void 0,b(this.series||[],function(c){c.processedXData||(c.processData(),c.generatePoints());b(c.points,function(b,f){var e;b.options&&void 0===b.options.x&&(e=a.nameToX(b),e!==b.x&&(b.x=e,c.xData[f]=e))})}))},
setAxisTranslation:function(a){var c=this,f=c.max-c.min,e=c.axisPointRange||0,h,l=0,d=0,q=c.linkedParent,k=!!c.categories,w=c.transA,C=c.isXAxis;if(C||k||e)q?(l=q.minPointOffset,d=q.pointRangePadding):(h=c.getClosest(),b(c.series,function(a){var b=k?1:C?F(a.options.pointRange,h,0):c.axisPointRange||0;a=a.options.pointPlacement;e=Math.max(e,b);c.single||(l=Math.max(l,u(a)?0:b/2),d=Math.max(d,"on"===a?0:b))})),q=c.ordinalSlope&&h?c.ordinalSlope/h:1,c.minPointOffset=l*=q,c.pointRangePadding=d*=q,c.pointRange=
Math.min(e,f),C&&(c.closestPointRange=h);a&&(c.oldTransA=w);c.translationSlope=c.transA=w=c.len/(f+d||1);c.transB=c.horiz?c.left:c.bottom;c.minPixelPadding=w*l},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var e=this,h=e.chart,l=e.options,q=e.isLog,u=e.log2lin,w=e.isDatetimeAxis,C=e.isXAxis,p=e.isLinked,v=l.maxPadding,g=l.minPadding,D=l.tickInterval,n=l.tickPixelInterval,J=e.categories,m=e.threshold,M=e.softThreshold,t,I,y,A;w||J||p||this.getTickAmount();y=F(e.userMin,
l.min);A=F(e.userMax,l.max);p?(e.linkedParent=h[e.coll][l.linkedTo],h=e.linkedParent.getExtremes(),e.min=F(h.min,h.dataMin),e.max=F(h.max,h.dataMax),l.type!==e.linkedParent.options.type&&k(11,1)):(!M&&r(m)&&(e.dataMin>=m?(t=m,g=0):e.dataMax<=m&&(I=m,v=0)),e.min=F(y,t,e.dataMin),e.max=F(A,I,e.dataMax));q&&(!a&&0>=Math.min(e.min,F(e.dataMin,e.min))&&k(10,1),e.min=d(u(e.min),15),e.max=d(u(e.max),15));e.range&&r(e.max)&&(e.userMin=e.min=y=Math.max(e.min,e.minFromRange()),e.userMax=A=e.max,e.range=null);
B(e,"foundExtremes");e.beforePadding&&e.beforePadding();e.adjustForMinRange();!(J||e.axisPointRange||e.usePercentage||p)&&r(e.min)&&r(e.max)&&(u=e.max-e.min)&&(!r(y)&&g&&(e.min-=u*g),!r(A)&&v&&(e.max+=u*v));f(l.floor)&&(e.min=Math.max(e.min,l.floor));f(l.ceiling)&&(e.max=Math.min(e.max,l.ceiling));M&&r(e.dataMin)&&(m=m||0,!r(y)&&e.min<m&&e.dataMin>=m?e.min=m:!r(A)&&e.max>m&&e.dataMax<=m&&(e.max=m));e.tickInterval=e.min===e.max||void 0===e.min||void 0===e.max?1:p&&!D&&n===e.linkedParent.options.tickPixelInterval?
D=e.linkedParent.tickInterval:F(D,this.tickAmount?(e.max-e.min)/Math.max(this.tickAmount-1,1):void 0,J?1:(e.max-e.min)*n/Math.max(e.len,n));C&&!a&&b(e.series,function(a){a.processData(e.min!==e.oldMin||e.max!==e.oldMax)});e.setAxisTranslation(!0);e.beforeSetTickPositions&&e.beforeSetTickPositions();e.postProcessTickInterval&&(e.tickInterval=e.postProcessTickInterval(e.tickInterval));e.pointRange&&!D&&(e.tickInterval=Math.max(e.pointRange,e.tickInterval));a=F(l.minTickInterval,e.isDatetimeAxis&&e.closestPointRange);
!D&&e.tickInterval<a&&(e.tickInterval=a);w||q||D||(e.tickInterval=H(e.tickInterval,null,c(e.tickInterval),F(l.allowDecimals,!(.5<e.tickInterval&&5>e.tickInterval&&1E3<e.max&&9999>e.max)),!!this.tickAmount));this.tickAmount||(e.tickInterval=e.unsquish());this.setTickPositions()},setTickPositions:function(){var a=this.options,c,b=a.tickPositions,e=a.tickPositioner,f=a.startOnTick,h=a.endOnTick,l;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval=
"auto"===a.minorTickInterval&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=c=b&&b.slice();!c&&(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()]),this.tickPositions=
c,e&&(e=e.apply(this,[this.min,this.max])))&&(this.tickPositions=c=e);this.isLinked||(this.trimTicks(c,f,h),this.min===this.max&&r(this.min)&&!this.tickAmount&&(l=!0,this.min-=.5,this.max+=.5),this.single=l,b||e||this.adjustTickAmount())},trimTicks:function(a,c,b){var e=a[0],f=a[a.length-1],h=this.minPointOffset||0;if(c)this.min=e;else for(;this.min-h>a[0];)a.shift();if(b)this.max=f;else for(;this.max+h<a[a.length-1];)a.pop();0===a.length&&r(e)&&a.push((f+e)/2)},alignToOthers:function(){var a={},
c,e=this.options;!1!==this.chart.options.chart.alignTicks&&!1!==e.alignTicks&&b(this.chart[this.coll],function(b){var e=b.options,e=[b.horiz?e.left:e.top,e.width,e.height,e.pane].join();b.series.length&&(a[e]?c=!0:a[e]=1)});return c},getTickAmount:function(){var a=this.options,c=a.tickAmount,b=a.tickPixelInterval;!r(a.tickInterval)&&this.len<b&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(c=2);!c&&this.alignToOthers()&&(c=Math.ceil(this.len/b)+1);4>c&&(this.finalTickAmt=c,c=5);this.tickAmount=
c},adjustTickAmount:function(){var a=this.tickInterval,c=this.tickPositions,b=this.tickAmount,e=this.finalTickAmt,f=c&&c.length;if(f<b){for(;c.length<b;)c.push(d(c[c.length-1]+a));this.transA*=(f-1)/(b-1);this.max=c[c.length-1]}else f>b&&(this.tickInterval*=2,this.setTickPositions());if(r(e)){for(a=b=c.length;a--;)(3===e&&1===a%2||2>=e&&0<a&&a<b-1)&&c.splice(a,1);this.finalTickAmt=void 0}},setScale:function(){var a,c;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();
c=this.len!==this.oldAxisLength;b(this.series,function(c){if(c.isDirtyData||c.isDirty||c.xAxis.isDirty)a=!0});c||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=c||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},
setExtremes:function(a,c,e,f,h){var l=this,d=l.chart;e=F(e,!0);b(l.series,function(a){delete a.kdTree});h=v(h,{min:a,max:c});B(l,"setExtremes",h,function(){l.userMin=a;l.userMax=c;l.eventArgs=h;e&&d.redraw(f)})},zoom:function(a,c){var b=this.dataMin,e=this.dataMax,f=this.options,h=Math.min(b,F(f.min,b)),f=Math.max(e,F(f.max,e));this.allowZoomOutside||(r(b)&&a<=h&&(a=h),r(e)&&c>=f&&(c=f));this.displayBtn=void 0!==a||void 0!==c;this.setExtremes(a,c,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=
this.chart,c=this.options,b=c.offsetLeft||0,e=this.horiz,f=F(c.width,a.plotWidth-b+(c.offsetRight||0)),h=F(c.height,a.plotHeight),l=F(c.top,a.plotTop),c=F(c.left,a.plotLeft+b),b=/%$/;b.test(h)&&(h=Math.round(parseFloat(h)/100*a.plotHeight));b.test(l)&&(l=Math.round(parseFloat(l)/100*a.plotHeight+a.plotTop));this.left=c;this.top=l;this.width=f;this.height=h;this.bottom=a.chartHeight-h-l;this.right=a.chartWidth-f-c;this.len=Math.max(e?f:h,0);this.pos=e?c:l},getExtremes:function(){var a=this.isLog,c=
this.lin2log;return{min:a?d(c(this.min)):this.min,max:a?d(c(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var c=this.isLog,b=this.lin2log,e=c?b(this.min):this.min,c=c?b(this.max):this.max;null===a?a=e:e>a?a=e:c<a&&(a=c);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(F(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var c=this.options,b=c[a+
"Length"],e=F(c[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(e&&b)return"inside"===c[a+"Position"]&&(b=-b),[b,e]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[0]&&this.ticks[0].label)},unsquish:function(){var a=this.options.labels,c=this.horiz,e=this.tickInterval,f=e,h=this.len/(((this.categories?1:0)+this.max-this.min)/e),l,d=a.rotation,q=this.labelMetrics(),u,k=Number.MAX_VALUE,w,C=function(a){a/=h||1;a=1<
a?Math.ceil(a):1;return a*e};c?(w=!a.staggerLines&&!a.step&&(r(d)?[d]:h<F(a.autoRotationLimit,80)&&a.autoRotation))&&b(w,function(a){var c;if(a===d||a&&-90<=a&&90>=a)u=C(Math.abs(q.h/Math.sin(n*a))),c=u+Math.abs(a/360),c<k&&(k=c,l=a,f=u)}):a.step||(f=C(q.h));this.autoRotation=w;this.labelRotation=F(l,d);return f},getSlotWidth:function(){var a=this.chart,c=this.horiz,b=this.options.labels,e=Math.max(this.tickPositions.length-(this.categories?0:1),1),f=a.margin[3];return c&&2>(b.step||0)&&!b.rotation&&
(this.staggerLines||1)*a.plotWidth/e||!c&&(f&&f-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,c=a.renderer,e=this.tickPositions,f=this.ticks,h=this.options.labels,l=this.horiz,d=this.getSlotWidth(),q=Math.max(1,Math.round(d-2*(h.padding||5))),k={},w=this.labelMetrics(),C=h.style&&h.style.textOverflow,p,v=0,g,F;u(h.rotation)||(k.rotation=h.rotation||0);b(e,function(a){(a=f[a])&&a.labelLength>v&&(v=a.labelLength)});this.maxLabelLength=v;if(this.autoRotation)v>q&&v>w.h?
k.rotation=this.labelRotation:this.labelRotation=0;else if(d&&(p={width:q+"px"},!C))for(p.textOverflow="clip",g=e.length;!l&&g--;)if(F=e[g],q=f[F].label)q.styles&&"ellipsis"===q.styles.textOverflow?q.css({textOverflow:"clip"}):f[F].labelLength>d&&q.css({width:d+"px"}),q.getBBox().height>this.len/e.length-(w.h-w.f)&&(q.specCss={textOverflow:"ellipsis"});k.rotation&&(p={width:(v>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},C||(p.textOverflow="ellipsis"));if(this.labelAlign=h.align||this.autoLabelAlign(this.labelRotation))k.align=
this.labelAlign;b(e,function(a){var c=(a=f[a])&&a.label;c&&(c.attr(k),p&&c.css(D(p,c.specCss)),delete c.specCss,a.rotation=k.rotation)});this.tickRotCorr=c.rotCorr(w.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||r(this.min)&&r(this.max)&&!!this.tickPositions},getOffset:function(){var a=this,c=a.chart,e=c.renderer,f=a.options,h=a.tickPositions,l=a.ticks,d=a.horiz,q=a.side,u=c.inverted?[1,0,3,2][q]:q,k,w,C=0,p,v=0,g=f.title,D=f.labels,n=0,J=a.opposite,m=c.axisOffset,
c=c.clipOffset,H=[-1,1,1,-1][q],B,t=f.className,I=a.axisParent,y=this.tickSize("tick");k=a.hasData();a.showAxis=w=k||F(f.showEmpty,!0);a.staggerLines=a.horiz&&D.staggerLines;a.axisGroup||(a.gridGroup=e.g("grid").attr({zIndex:f.gridZIndex||1}).addClass("highcharts-"+this.coll.toLowerCase()+"-grid "+(t||"")).add(I),a.axisGroup=e.g("axis").attr({zIndex:f.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(t||"")).add(I),a.labelGroup=e.g("axis-labels").attr({zIndex:D.zIndex||7}).addClass("highcharts-"+
a.coll.toLowerCase()+"-labels "+(t||"")).add(I));if(k||a.isLinked)b(h,function(c){l[c]?l[c].addLabel():l[c]=new M(a,c)}),a.renderUnsquish(),!1===D.reserveSpace||0!==q&&2!==q&&{1:"left",3:"right"}[q]!==a.labelAlign&&"center"!==a.labelAlign||b(h,function(a){n=Math.max(l[a].getLabelSize(),n)}),a.staggerLines&&(n*=a.staggerLines,a.labelOffset=n*(a.opposite?-1:1));else for(B in l)l[B].destroy(),delete l[B];g&&g.text&&!1!==g.enabled&&(a.axisTitle||((B=g.textAlign)||(B=(d?{low:"left",middle:"center",high:"right"}:
{low:J?"right":"left",middle:"center",high:J?"left":"right"})[g.align]),a.axisTitle=e.text(g.text,0,0,g.useHTML).attr({zIndex:7,rotation:g.rotation||0,align:B}).addClass("highcharts-axis-title").css(g.style).add(a.axisGroup),a.axisTitle.isNew=!0),w&&(C=a.axisTitle.getBBox()[d?"height":"width"],p=g.offset,v=r(p)?0:F(g.margin,d?5:10)),a.axisTitle[w?"show":"hide"](!0));a.renderLine();a.offset=H*F(f.offset,m[q]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};e=0===q?-a.labelMetrics().h:2===q?a.tickRotCorr.y:
0;v=Math.abs(n)+v;n&&(v=v-e+H*(d?F(D.y,a.tickRotCorr.y+8*H):D.x));a.axisTitleMargin=F(p,v);m[q]=Math.max(m[q],a.axisTitleMargin+C+H*a.offset,v,k&&h.length&&y?y[0]:0);f=f.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);c[u]=Math.max(c[u],f)},getLinePath:function(a){var c=this.chart,b=this.opposite,e=this.offset,f=this.horiz,h=this.left+(b?this.width:0)+e,e=c.chartHeight-this.bottom-(b?this.height:0)+e;b&&(a*=-1);return c.renderer.crispLine(["M",f?this.left:h,f?e:this.top,"L",f?c.chartWidth-this.right:
h,f?e:c.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup),this.axisLine.attr({stroke:this.options.lineColor,"stroke-width":this.options.lineWidth,zIndex:7}))},getTitlePosition:function(){var a=this.horiz,c=this.left,e=this.top,b=this.len,f=this.options.title,h=a?c:e,l=this.opposite,d=this.offset,q=f.x||0,u=f.y||0,k=this.chart.renderer.fontMetrics(f.style&&f.style.fontSize,this.axisTitle).f,
b={low:h+(a?0:b),middle:h+b/2,high:h+(a?b:0)}[f.align],c=(a?e+this.height:c)+(a?1:-1)*(l?-1:1)*this.axisTitleMargin+(2===this.side?k:0);return{x:a?b+q:c+(l?this.width:0)+d+q,y:a?c+u-(l?this.height:0)+d:b+u}},render:function(){var a=this,c=a.chart,e=c.renderer,h=a.options,l=a.isLog,d=a.lin2log,q=a.isLinked,u=a.tickPositions,k=a.axisTitle,w=a.ticks,C=a.minorTicks,p=a.alternateBands,v=h.stackLabels,g=h.alternateGridColor,D=a.tickmarkOffset,F=a.axisLine,n=c.hasRendered&&f(a.oldMin),m=a.showAxis,r=y(e.globalAnimation),
H,B;a.labelEdge.length=0;a.overlap=!1;b([w,C,p],function(a){for(var c in a)a[c].isActive=!1});if(a.hasData()||q)a.minorTickInterval&&!a.categories&&b(a.getMinorTickPositions(),function(c){C[c]||(C[c]=new M(a,c,"minor"));n&&C[c].isNew&&C[c].render(null,!0);C[c].render(null,!1,1)}),u.length&&(b(u,function(c,b){if(!q||c>=a.min&&c<=a.max)w[c]||(w[c]=new M(a,c)),n&&w[c].isNew&&w[c].render(b,!0,.1),w[c].render(b)}),D&&(0===a.min||a.single)&&(w[-1]||(w[-1]=new M(a,-1,null,!0)),w[-1].render(-1))),g&&b(u,
function(b,e){B=void 0!==u[e+1]?u[e+1]+D:a.max-D;0===e%2&&b<a.max&&B<=a.max+(c.polar?-D:D)&&(p[b]||(p[b]=new I(a)),H=b+D,p[b].options={from:l?d(H):H,to:l?d(B):B,color:g},p[b].render(),p[b].isActive=!0)}),a._addedPlotLB||(b((h.plotLines||[]).concat(h.plotBands||[]),function(c){a.addPlotBandOrLine(c)}),a._addedPlotLB=!0);b([w,C,p],function(a){var b,e,f=[],h=r.duration;for(b in a)a[b].isActive||(a[b].render(b,!1,0),a[b].isActive=!1,f.push(b));J(function(){for(e=f.length;e--;)a[f[e]]&&!a[f[e]].isActive&&
(a[f[e]].destroy(),delete a[f[e]])},a!==p&&c.hasRendered&&h?h:0)});F&&(F[F.isPlaced?"animate":"attr"]({d:this.getLinePath(F.strokeWidth())}),F.isPlaced=!0,F[m?"show":"hide"](!0));k&&m&&(k[k.isNew?"attr":"animate"](a.getTitlePosition()),k.isNew=!1);v&&v.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.visible&&(this.render(),b(this.plotLinesAndBands,function(a){a.render()}));b(this.series,function(a){a.isDirty=!0})},destroy:function(a){var c=this,e=c.stacks,f,h=c.plotLinesAndBands,
l;a||C(c);for(f in e)p(e[f]),e[f]=null;b([c.ticks,c.minorTicks,c.alternateBands],function(a){p(a)});if(h)for(a=h.length;a--;)h[a].destroy();b("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "),function(a){c[a]&&(c[a]=c[a].destroy())});h=["names","series","userMax","userMin"];for(l in c)c.hasOwnProperty(l)&&-1===q(l,h)&&delete c[l]},drawCrosshair:function(a,c){var b,e=this.crosshair,f,h=this.cross;a||(a=this.cross&&this.cross.e);this.crosshair&&!1!==(r(c)||!F(e.snap,
!0))?(F(e.snap,!0)?r(c)&&(b=this.isXAxis?c.plotX:this.len-c.plotY):b=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos,b=this.isRadial?this.getPlotLinePath(this.isXAxis?c.x:F(c.stackY,c.y))||null:this.getPlotLinePath(null,null,null,null,b)||null,null===b?this.hideCrosshair():(f=this.categories&&!this.isRadial,h||(this.cross=h=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+(f?"category ":"thin ")+e.className).attr({zIndex:F(e.zIndex,2)}).add(),h.attr({stroke:e.color||
(f?g("#ccd6eb").setOpacity(.25).get():"#cccccc"),"stroke-width":F(e.width,1)}),e.dashStyle&&h.attr({dashstyle:e.dashStyle})),h.show().attr({d:b}),f&&h.attr({"stroke-width":this.transA}),this.cross.e=a)):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}};v(a.Axis.prototype,t)})(K);(function(a){var A=a.Axis,y=a.Date,E=a.defaultOptions,G=a.defined,t=a.each,g=a.extend,d=a.getMagnitude,m=a.getTZOffset,r=a.grep,n=a.normalizeTickInterval,p=a.pick,b=a.timeUnits;A.prototype.getTimeTicks=
function(a,d,n,e){var c=[],l={},q=E.global.useUTC,h,f=new y(d-m(d)),u=y.hcMakeTime,D=a.unitRange,H=a.count;if(G(d)){f[y.hcSetMilliseconds](D>=b.second?0:H*Math.floor(f.getMilliseconds()/H));if(D>=b.second)f[y.hcSetSeconds](D>=b.minute?0:H*Math.floor(f.getSeconds()/H));if(D>=b.minute)f[y.hcSetMinutes](D>=b.hour?0:H*Math.floor(f[y.hcGetMinutes]()/H));if(D>=b.hour)f[y.hcSetHours](D>=b.day?0:H*Math.floor(f[y.hcGetHours]()/H));if(D>=b.day)f[y.hcSetDate](D>=b.month?1:H*Math.floor(f[y.hcGetDate]()/H));D>=
b.month&&(f[y.hcSetMonth](D>=b.year?0:H*Math.floor(f[y.hcGetMonth]()/H)),h=f[y.hcGetFullYear]());if(D>=b.year)f[y.hcSetFullYear](h-h%H);if(D===b.week)f[y.hcSetDate](f[y.hcGetDate]()-f[y.hcGetDay]()+p(e,1));d=1;if(y.hcTimezoneOffset||y.hcGetTimezoneOffset)f=f.getTime(),f=new y(f+m(f));h=f[y.hcGetFullYear]();e=f.getTime();for(var F=f[y.hcGetMonth](),I=f[y.hcGetDate](),C=!q||!!y.hcGetTimezoneOffset,w=(b.day+(q?m(f):6E4*f.getTimezoneOffset()))%b.day;e<n;)c.push(e),e=D===b.year?u(h+d*H,0):D===b.month?
u(h,F+d*H):!C||D!==b.day&&D!==b.week?e+D*H:u(h,F,I+d*H*(D===b.day?1:7)),d++;c.push(e);t(r(c,function(a){return D<=b.hour&&a%b.day===w}),function(a){l[a]="day"})}c.info=g(a,{higherRanks:l,totalRange:D*H});return c};A.prototype.normalizeTimeTickInterval=function(a,p){var g=p||[["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]],e=g[g.length-1],c=b[e[0]],l=e[1],
q;for(q=0;q<g.length&&!(e=g[q],c=b[e[0]],l=e[1],g[q+1]&&a<=(c*l[l.length-1]+b[g[q+1][0]])/2);q++);c===b.year&&a<5*c&&(l=[1,2,5]);g=n(a/c,l,"year"===e[0]?Math.max(d(a/c),1):1);return{unitRange:c,count:g,unitName:e[0]}}})(K);(function(a){var A=a.Axis,y=a.getMagnitude,E=a.map,G=a.normalizeTickInterval,t=a.pick;A.prototype.getLogTickPositions=function(a,d,m,r){var n=this.options,p=this.len,b=this.lin2log,k=this.log2lin,v=[];r||(this._minorAutoInterval=null);if(.5<=a)a=Math.round(a),v=this.getLinearTickPositions(a,
d,m);else if(.08<=a)for(var p=Math.floor(d),B,e,c,l,q,n=.3<a?[1,2,4]:.15<a?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];p<m+1&&!q;p++)for(e=n.length,B=0;B<e&&!q;B++)c=k(b(p)*n[B]),c>d&&(!r||l<=m)&&void 0!==l&&v.push(l),l>m&&(q=!0),l=c;else d=b(d),m=b(m),a=n[r?"minorTickInterval":"tickInterval"],a=t("auto"===a?null:a,this._minorAutoInterval,n.tickPixelInterval/(r?5:1)*(m-d)/((r?p/this.tickPositions.length:p)||1)),a=G(a,null,y(a)),v=E(this.getLinearTickPositions(a,d,m),k),r||(this._minorAutoInterval=a/5);r||(this.tickInterval=
a);return v};A.prototype.log2lin=function(a){return Math.log(a)/Math.LN10};A.prototype.lin2log=function(a){return Math.pow(10,a)}})(K);(function(a){var A=a.addEvent,y=a.dateFormat,E=a.each,G=a.extend,t=a.format,g=a.isNumber,d=a.map,m=a.merge,r=a.pick,n=a.splat,p=a.stop,b=a.syncTimeout,k=a.timeUnits;a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,b){this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=b.split&&!a.inverted;
this.shared=b.shared||this.split;this.split?this.label=this.chart.renderer.g("tooltip"):(this.label=a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:b.padding,r:b.borderRadius,display:"none"}),this.label.attr({fill:b.backgroundColor,"stroke-width":b.borderWidth}).css(b.style).shadow(b.shadow));this.label.attr({zIndex:8}).add()},update:function(a){this.destroy();this.init(this.chart,m(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());
clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,e,c){var l=this,d=l.now,h=!1!==l.options.animation&&!l.isHidden&&(1<Math.abs(a-d.x)||1<Math.abs(b-d.y)),f=l.followPointer||1<l.len;G(d,{x:h?(2*d.x+a)/3:a,y:h?(d.y+b)/2:b,anchorX:f?void 0:h?(2*d.anchorX+e)/3:e,anchorY:f?void 0:h?(d.anchorY+c)/2:c});l.label.attr(d);h&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){l&&l.move(a,b,e,c)},32))},hide:function(a){var d=this;clearTimeout(this.hideTimer);
a=r(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=b(function(){d.label[a?"fadeOut":"hide"]();d.isHidden=!0},a))},getAnchor:function(a,b){var e,c=this.chart,l=c.inverted,q=c.plotTop,h=c.plotLeft,f=0,u=0,k,p;a=n(a);e=a[0].tooltipPos;this.followPointer&&b&&(void 0===b.chartX&&(b=c.pointer.normalize(b)),e=[b.chartX-c.plotLeft,b.chartY-q]);e||(E(a,function(a){k=a.series.yAxis;p=a.series.xAxis;f+=a.plotX+(!l&&p?p.left-h:0);u+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!l&&k?k.top-q:0)}),
f/=a.length,u/=a.length,e=[l?c.plotWidth-u:f,this.shared&&!l&&1<a.length&&b?b.chartY-q:l?c.plotHeight-f:u]);return d(e,Math.round)},getPosition:function(a,b,e){var c=this.chart,l=this.distance,d={},h=e.h||0,f,u=["y",c.chartHeight,b,e.plotY+c.plotTop,c.plotTop,c.plotTop+c.plotHeight],k=["x",c.chartWidth,a,e.plotX+c.plotLeft,c.plotLeft,c.plotLeft+c.plotWidth],p=!this.followPointer&&r(e.ttBelow,!c.inverted===!!e.negative),g=function(a,c,b,e,f,u){var k=b<e-l,w=e+l+b<c,C=e-l-b;e+=l;if(p&&w)d[a]=e;else if(!p&&
k)d[a]=C;else if(k)d[a]=Math.min(u-b,0>C-h?C:C-h);else if(w)d[a]=Math.max(f,e+h+b>c?e:e+h);else return!1},n=function(a,c,b,e){var f;e<l||e>c-l?f=!1:d[a]=e<b/2?1:e>c-b/2?c-b-2:e-b/2;return f},C=function(a){var c=u;u=k;k=c;f=a},w=function(){!1!==g.apply(0,u)?!1!==n.apply(0,k)||f||(C(!0),w()):f?d.x=d.y=0:(C(!0),w())};(c.inverted||1<this.len)&&C();w();return d},defaultFormatter:function(a){var b=this.points||n(this),e;e=[a.tooltipFooterHeaderFormatter(b[0])];e=e.concat(a.bodyFormatter(b));e.push(a.tooltipFooterHeaderFormatter(b[0],
!0));return e},refresh:function(a,b){var e=this.chart,c=this.label,l=this.options,d,h,f,u={},k,g=[];k=l.formatter||this.defaultFormatter;var u=e.hoverPoints,F=this.shared;clearTimeout(this.hideTimer);this.followPointer=n(a)[0].series.tooltipOptions.followPointer;f=this.getAnchor(a,b);d=f[0];h=f[1];!F||a.series&&a.series.noSharedTooltip?u=a.getLabelConfig():(e.hoverPoints=a,u&&E(u,function(a){a.setState()}),E(a,function(a){a.setState("hover");g.push(a.getLabelConfig())}),u={x:a[0].category,y:a[0].y},
u.points=g,this.len=g.length,a=a[0]);k=k.call(u,this);u=a.series;this.distance=r(u.tooltipOptions.distance,16);!1===k?this.hide():(this.isHidden&&(p(c),c.attr({opacity:1,display:"block"}).show()),this.split?this.renderSplit(k,e.hoverPoints):(c.attr({text:k.join?k.join(""):k}),c.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+r(a.colorIndex,u.colorIndex)),c.attr({stroke:l.borderColor||a.color||u.color||"#666666"}),this.updatePosition({plotX:d,plotY:h,negative:a.negative,ttBelow:a.ttBelow,
h:f[2]||0})),this.isHidden=!1)},renderSplit:function(b,d){var e=this,c=[],l=this.chart,q=l.renderer,h=!0,f=this.options,u;E(b.slice(0,b.length-1),function(a,b){var k=d[b-1]||{isHeader:!0,plotX:d[0].plotX},p=k.series||e,C=p.tt,w=k.series||{},g="highcharts-color-"+r(k.colorIndex,w.colorIndex,"none");C||(p.tt=C=q.label(null,null,null,k.isHeader&&"callout").addClass("highcharts-tooltip-box "+g).attr({padding:f.padding,r:f.borderRadius,fill:f.backgroundColor,stroke:k.color||w.color||"#333333","stroke-width":f.borderWidth}).add(e.label),
k.series&&(C.connector=q.path().addClass("highcharts-tooltip-connector "+g).attr({"stroke-width":w.options.lineWidth||2,stroke:k.color||w.color||"#666666"}).add(e.label),A(k.series,"hide",function(){var a=this.tt;a.connector=a.connector.destroy();a.destroy();this.tt=void 0})));C.isActive=!0;C.attr({text:a});w=C.getBBox();k.isHeader?(u=w.height,g=k.plotX+l.plotLeft-w.width/2):g=k.plotX+l.plotLeft-r(f.distance,16)-w.width;0>g&&(h=!1);w=(k.series&&k.series.yAxis&&k.series.yAxis.pos)+(k.plotY||0);w-=
l.plotTop;c.push({target:k.isHeader?l.plotHeight+u:w,rank:k.isHeader?1:0,size:p.tt.getBBox().height+1,point:k,x:g,tt:C})});E(l.series,function(a){var c=a.tt;c&&(c.isActive?c.isActive=!1:(c.connector=c.connector.destroy(),c.destroy(),a.tt=void 0))});a.distribute(c,l.plotHeight+u);E(c,function(a){var c=a.point,b=a.tt,e;e={display:void 0===a.pos?"none":"",x:h||c.isHeader?a.x:c.plotX+l.plotLeft+r(f.distance,16),y:a.pos+l.plotTop};c.isHeader&&(e.anchorX=c.plotX+l.plotLeft,e.anchorY=e.y-100);b.attr(e);
c.isHeader||b.connector.attr({d:["M",c.plotX+l.plotLeft,c.plotY+c.series.yAxis.pos,"L",h?c.plotX+l.plotLeft-r(f.distance,16):c.plotX+l.plotLeft+r(f.distance,16),a.pos+l.plotTop+b.getBBox().height/2]})})},updatePosition:function(a){var b=this.chart,e=this.label,e=(this.options.positioner||this.getPosition).call(this,e.width,e.height,a);this.move(Math.round(e.x),Math.round(e.y||0),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getXDateFormat:function(a,b,e){var c;b=b.dateTimeLabelFormats;var l=e&&e.closestPointRange,
d,h={millisecond:15,second:12,minute:9,hour:6,day:3},f,u="millisecond";if(l){f=y("%m-%d %H:%M:%S.%L",a.x);for(d in k){if(l===k.week&&+y("%w",a.x)===e.options.startOfWeek&&"00:00:00.000"===f.substr(6)){d="week";break}if(k[d]>l){d=u;break}if(h[d]&&f.substr(h[d])!=="01-01 00:00:00.000".substr(h[d]))break;"week"!==d&&(u=d)}d&&(c=b[d])}else c=b.day;return c||b.year},tooltipFooterHeaderFormatter:function(a,b){var e=b?"footer":"header",c=a.series,l=c.tooltipOptions,d=l.xDateFormat,h=c.xAxis,f=h&&"datetime"===
h.options.type&&g(a.key),e=l[e+"Format"];f&&!d&&(d=this.getXDateFormat(a,l,h));f&&d&&(e=e.replace("{point.key}","{point.key:"+d+"}"));return t(e,{point:a,series:c})},bodyFormatter:function(a){return d(a,function(a){var b=a.series.tooltipOptions;return(b.pointFormatter||a.point.tooltipFormatter).call(a.point,b.pointFormat)})}}})(K);(function(a){var A=a.addEvent,y=a.attr,E=a.charts,G=a.color,t=a.css,g=a.defined,d=a.doc,m=a.each,r=a.extend,n=a.fireEvent,p=a.offset,b=a.pick,k=a.removeEvent,v=a.splat,
B=a.Tooltip,e=a.win;a.hasTouch=d&&void 0!==d.documentElement.ontouchstart;a.Pointer=function(a,b){this.init(a,b)};a.Pointer.prototype={init:function(a,e){this.options=e;this.chart=a;this.runChartClick=e.chart.events&&!!e.chart.events.click;this.pinchDown=[];this.lastValidTouch={};B&&e.tooltip.enabled&&(a.tooltip=new B(a,e.tooltip),this.followTouchMove=b(e.tooltip.followTouchMove,!0));this.setDOMEvents()},zoomOption:function(){var a=this.chart,b=a.options.chart.zoomType,e=/x/.test(b),b=/y/.test(b),
a=a.inverted;this.zoomX=e;this.zoomY=b;this.zoomHor=e&&!a||b&&a;this.zoomVert=b&&!a||e&&a;this.hasZoom=e||b},normalize:function(a,b){var d,h;a=a||e.event;a.target||(a.target=a.srcElement);h=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;b||(this.chartPosition=b=p(this.chart.container));void 0===h.pageX?(d=Math.max(a.x,a.clientX-b.left),h=a.y):(d=h.pageX-b.left,h=h.pageY-b.top);return r(a,{chartX:Math.round(d),chartY:Math.round(h)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};
m(this.chart.axes,function(e){b[e.isXAxis?"xAxis":"yAxis"].push({axis:e,value:e.toValue(a[e.horiz?"chartX":"chartY"])})});return b},runPointActions:function(c){var e=this.chart,q=e.series,h=e.tooltip,f=h?h.shared:!1,u=!0,k=e.hoverPoint,p=e.hoverSeries,g,n,C,w=[],J;if(!f&&!p)for(g=0;g<q.length;g++)if(q[g].directTouch||!q[g].options.stickyTracking)q=[];p&&(f?p.noSharedTooltip:p.directTouch)&&k?w=[k]:(f||!p||p.options.stickyTracking||(q=[p]),m(q,function(a){n=a.noSharedTooltip&&f;C=!f&&a.directTouch;
a.visible&&!n&&!C&&b(a.options.enableMouseTracking,!0)&&(J=a.searchPoint(c,!n&&1===a.kdDimensions))&&J.series&&w.push(J)}),w.sort(function(a,c){var b=a.distX-c.distX,e=a.dist-c.dist;return 0!==b?b:0!==e?e:a.series.group.zIndex>c.series.group.zIndex?-1:1}));if(f)for(g=w.length;g--;)(w[g].clientX!==w[0].clientX||w[g].series.noSharedTooltip)&&w.splice(g,1);if(w[0]&&(w[0]!==this.hoverPoint||h&&h.isHidden)){if(f&&!w[0].series.noSharedTooltip){for(g=0;0<=g;g--)w[g].onMouseOver(c,w[g]!==(p&&p.directTouch&&
k||w[0]));if(p&&p.directTouch&&k&&k!==w[0])k.onMouseOver(c,!1);w.length&&h&&h.refresh(w.sort(function(a,c){return a.series.index-c.series.index}),c)}else if(h&&h.refresh(w[0],c),!p||!p.directTouch)w[0].onMouseOver(c);this.prevKDPoint=w[0];u=!1}u&&(q=p&&p.tooltipOptions.followPointer,h&&q&&!h.isHidden&&(q=h.getAnchor([{}],c),h.updatePosition({plotX:q[0],plotY:q[1]})));this._onDocumentMouseMove||(this._onDocumentMouseMove=function(c){if(E[a.hoverChartIndex])E[a.hoverChartIndex].pointer.onDocumentMouseMove(c)},
A(d,"mousemove",this._onDocumentMouseMove));m(f?w:[b(k,w[0])],function(a){m(e.axes,function(b){(!a||a.series&&a.series[b.coll]===b)&&b.drawCrosshair(c,a)})})},reset:function(a,b){var e=this.chart,h=e.hoverSeries,f=e.hoverPoint,u=e.hoverPoints,p=e.tooltip,g=p&&p.shared?u:f;a&&g&&m(v(g),function(b){b.series.isCartesian&&void 0===b.plotX&&(a=!1)});if(a)p&&g&&(p.refresh(g),f&&(f.setState(f.state,!0),m(e.axes,function(a){a.crosshair&&a.drawCrosshair(null,f)})));else{if(f)f.onMouseOut();u&&m(u,function(a){a.setState()});
if(h)h.onMouseOut();p&&p.hide(b);this._onDocumentMouseMove&&(k(d,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null);m(e.axes,function(a){a.hideCrosshair()});this.hoverX=this.prevKDPoint=e.hoverPoints=e.hoverPoint=null}},scaleGroups:function(a,b){var e=this.chart,h;m(e.series,function(f){h=a||f.getPlotBox();f.xAxis&&f.xAxis.zoomEnabled&&(f.group.attr(h),f.markerGroup&&(f.markerGroup.attr(h),f.markerGroup.clip(b?e.clipRect:null)),f.dataLabelsGroup&&f.dataLabelsGroup.attr(h))});e.clipRect.attr(b||
e.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,e=b.options.chart,h=a.chartX,f=a.chartY,d=this.zoomHor,k=this.zoomVert,p=b.plotLeft,g=b.plotTop,n=b.plotWidth,C=b.plotHeight,w,m=this.selectionMarker,v=this.mouseDownX,x=this.mouseDownY,r=e.panKey&&a[e.panKey+"Key"];m&&m.touch||(h<p?h=p:h>p+n&&(h=p+n),f<g?f=g:f>g+C&&(f=g+C),this.hasDragged=Math.sqrt(Math.pow(v-
h,2)+Math.pow(x-f,2)),10<this.hasDragged&&(w=b.isInsidePlot(v-p,x-g),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&w&&!r&&!m&&(this.selectionMarker=m=b.renderer.rect(p,g,d?1:n,k?1:C,0).attr({fill:e.selectionMarkerFill||G("#335cad").setOpacity(.25).get(),"class":"highcharts-selection-marker",zIndex:7}).add()),m&&d&&(h-=v,m.attr({width:Math.abs(h),x:(0<h?0:h)+v})),m&&k&&(h=f-x,m.attr({height:Math.abs(h),y:(0<h?0:h)+x})),w&&!m&&e.panning&&b.pan(a,e.panning)))},drop:function(a){var b=this,e=this.chart,
h=this.hasPinched;if(this.selectionMarker){var f={originalEvent:a,xAxis:[],yAxis:[]},d=this.selectionMarker,k=d.attr?d.attr("x"):d.x,p=d.attr?d.attr("y"):d.y,v=d.attr?d.attr("width"):d.width,B=d.attr?d.attr("height"):d.height,C;if(this.hasDragged||h)m(e.axes,function(e){if(e.zoomEnabled&&g(e.min)&&(h||b[{xAxis:"zoomX",yAxis:"zoomY"}[e.coll]])){var d=e.horiz,u="touchend"===a.type?e.minPixelPadding:0,q=e.toValue((d?k:p)+u),d=e.toValue((d?k+v:p+B)-u);f[e.coll].push({axis:e,min:Math.min(q,d),max:Math.max(q,
d)});C=!0}}),C&&n(e,"selection",f,function(a){e.zoom(r(a,h?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();h&&this.scaleGroups()}e&&(t(e.container,{cursor:e._cursor}),e.cancelClick=10<this.hasDragged,e.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);this.zoomOption();a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(c){E[a.hoverChartIndex]&&E[a.hoverChartIndex].pointer.drop(c)},
onDocumentMouseMove:function(a){var b=this.chart,e=this.chartPosition;a=this.normalize(a,e);!e||this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)||this.reset()},onContainerMouseLeave:function(c){var b=E[a.hoverChartIndex];b&&(c.relatedTarget||c.toElement)&&(b.pointer.reset(),b.pointer.chartPosition=null)},onContainerMouseMove:function(c){var b=this.chart;g(a.hoverChartIndex)&&E[a.hoverChartIndex]&&E[a.hoverChartIndex].mouseIsDown||(a.hoverChartIndex=
b.index);c=this.normalize(c);c.returnValue=!1;"mousedown"===b.mouseIsDown&&this.drag(c);!this.inClass(c.target,"highcharts-tracker")&&!b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop)||b.openMenu||this.runPointActions(c)},inClass:function(a,b){for(var e;a;){if(e=y(a,"class")){if(-1!==e.indexOf(b))return!0;if(-1!==e.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;if(b&&a&&!b.options.stickyTracking&&
!this.inClass(a,"highcharts-tooltip")&&!this.inClass(a,"highcharts-series-"+b.index))b.onMouseOut()},onContainerClick:function(a){var b=this.chart,e=b.hoverPoint,h=b.plotLeft,f=b.plotTop;a=this.normalize(a);b.cancelClick||(e&&this.inClass(a.target,"highcharts-tracker")?(n(e.series,"click",r(a,{point:e})),b.hoverPoint&&e.firePointEvent("click",a)):(r(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-h,a.chartY-f)&&n(b,"click",a)))},setDOMEvents:function(){var c=this,b=c.chart.container;b.onmousedown=
function(a){c.onContainerMouseDown(a)};b.onmousemove=function(a){c.onContainerMouseMove(a)};b.onclick=function(a){c.onContainerClick(a)};A(b,"mouseleave",c.onContainerMouseLeave);1===a.chartCount&&A(d,"mouseup",c.onDocumentMouseUp);a.hasTouch&&(b.ontouchstart=function(a){c.onContainerTouchStart(a)},b.ontouchmove=function(a){c.onContainerTouchMove(a)},1===a.chartCount&&A(d,"touchend",c.onDocumentTouchEnd))},destroy:function(){var c;k(this.chart.container,"mouseleave",this.onContainerMouseLeave);a.chartCount||
(k(d,"mouseup",this.onDocumentMouseUp),k(d,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(c in this)this[c]=null}}})(K);(function(a){var A=a.charts,y=a.each,E=a.extend,G=a.map,t=a.noop,g=a.pick;E(a.Pointer.prototype,{pinchTranslate:function(a,g,r,n,p,b){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,g,r,n,p,b);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,g,r,n,p,b)},pinchTranslateDirection:function(a,g,r,n,p,b,k,v){var t=this.chart,
e=a?"x":"y",c=a?"X":"Y",l="chart"+c,q=a?"width":"height",h=t["plot"+(a?"Left":"Top")],f,u,D=v||1,H=t.inverted,F=t.bounds[a?"h":"v"],I=1===g.length,C=g[0][l],w=r[0][l],J=!I&&g[1][l],M=!I&&r[1][l],x;r=function(){!I&&20<Math.abs(C-J)&&(D=v||Math.abs(w-M)/Math.abs(C-J));u=(h-w)/D+C;f=t["plot"+(a?"Width":"Height")]/D};r();g=u;g<F.min?(g=F.min,x=!0):g+f>F.max&&(g=F.max-f,x=!0);x?(w-=.8*(w-k[e][0]),I||(M-=.8*(M-k[e][1])),r()):k[e]=[w,M];H||(b[e]=u-h,b[q]=f);b=H?1/D:D;p[q]=f;p[e]=g;n[H?a?"scaleY":"scaleX":
"scale"+c]=D;n["translate"+c]=b*h+(w-b*C)},pinch:function(a){var m=this,r=m.chart,n=m.pinchDown,p=a.touches,b=p.length,k=m.lastValidTouch,v=m.hasZoom,B=m.selectionMarker,e={},c=1===b&&(m.inClass(a.target,"highcharts-tracker")&&r.runTrackerClick||m.runChartClick),l={};1<b&&(m.initiated=!0);v&&m.initiated&&!c&&a.preventDefault();G(p,function(a){return m.normalize(a)});"touchstart"===a.type?(y(p,function(a,c){n[c]={chartX:a.chartX,chartY:a.chartY}}),k.x=[n[0].chartX,n[1]&&n[1].chartX],k.y=[n[0].chartY,
n[1]&&n[1].chartY],y(r.axes,function(a){if(a.zoomEnabled){var c=r.bounds[a.horiz?"h":"v"],b=a.minPixelPadding,e=a.toPixels(g(a.options.min,a.dataMin)),d=a.toPixels(g(a.options.max,a.dataMax)),l=Math.max(e,d);c.min=Math.min(a.pos,Math.min(e,d)-b);c.max=Math.max(a.pos+a.len,l+b)}}),m.res=!0):n.length&&(B||(m.selectionMarker=B=E({destroy:t,touch:!0},r.plotBox)),m.pinchTranslate(n,p,e,B,l,k),m.hasPinched=v,m.scaleGroups(e,l),!v&&m.followTouchMove&&1===b?this.runPointActions(m.normalize(a)):m.res&&(m.res=
!1,this.reset(!1,0)))},touch:function(d,m){var r=this.chart,n;a.hoverChartIndex=r.index;1===d.touches.length?(d=this.normalize(d),r.isInsidePlot(d.chartX-r.plotLeft,d.chartY-r.plotTop)&&!r.openMenu?(m&&this.runPointActions(d),"touchmove"===d.type&&(r=this.pinchDown,n=r[0]?4<=Math.sqrt(Math.pow(r[0].chartX-d.chartX,2)+Math.pow(r[0].chartY-d.chartY,2)):!1),g(n,!0)&&this.pinch(d)):m&&this.reset()):2===d.touches.length&&this.pinch(d)},onContainerTouchStart:function(a){this.zoomOption();this.touch(a,!0)},
onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(d){A[a.hoverChartIndex]&&A[a.hoverChartIndex].pointer.drop(d)}})})(K);(function(a){var A=a.addEvent,y=a.charts,E=a.css,G=a.doc,t=a.extend,g=a.noop,d=a.Pointer,m=a.removeEvent,r=a.win,n=a.wrap;if(r.PointerEvent||r.MSPointerEvent){var p={},b=!!r.PointerEvent,k=function(){var a,b=[];b.item=function(a){return this[a]};for(a in p)p.hasOwnProperty(a)&&b.push({pageX:p[a].pageX,pageY:p[a].pageY,target:p[a].target});return b},v=function(b,
e,c,d){"touch"!==b.pointerType&&b.pointerType!==b.MSPOINTER_TYPE_TOUCH||!y[a.hoverChartIndex]||(d(b),d=y[a.hoverChartIndex].pointer,d[e]({type:c,target:b.currentTarget,preventDefault:g,touches:k()}))};t(d.prototype,{onContainerPointerDown:function(a){v(a,"onContainerTouchStart","touchstart",function(a){p[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){v(a,"onContainerTouchMove","touchmove",function(a){p[a.pointerId]={pageX:a.pageX,pageY:a.pageY};
p[a.pointerId].target||(p[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){v(a,"onDocumentTouchEnd","touchend",function(a){delete p[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,b?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,b?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(G,b?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});n(d.prototype,"init",function(a,b,c){a.call(this,b,c);this.hasZoom&&E(b.container,
{"-ms-touch-action":"none","touch-action":"none"})});n(d.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(A)});n(d.prototype,"destroy",function(a){this.batchMSEvents(m);a.call(this)})}})(K);(function(a){var A,y=a.addEvent,E=a.css,G=a.discardElement,t=a.defined,g=a.each,d=a.extend,m=a.isFirefox,r=a.marginNames,n=a.merge,p=a.pick,b=a.setAnimation,k=a.stableSort,v=a.win,B=a.wrap;A=a.Legend=function(a,c){this.init(a,c)};A.prototype={init:function(a,
c){this.chart=a;this.setOptions(c);c.enabled&&(this.render(),y(this.chart,"endResize",function(){this.legend.positionCheckboxes()}))},setOptions:function(a){var c=p(a.padding,8);this.options=a;this.itemStyle=a.itemStyle;this.itemHiddenStyle=n(this.itemStyle,a.itemHiddenStyle);this.itemMarginTop=a.itemMarginTop||0;this.initialItemX=this.padding=c;this.initialItemY=c-5;this.itemHeight=this.maxItemWidth=0;this.symbolWidth=p(a.symbolWidth,16);this.pages=[]},update:function(a,c){var b=this.chart;this.setOptions(n(!0,
this.options,a));this.destroy();b.isDirtyLegend=b.isDirtyBox=!0;p(c,!0)&&b.redraw()},colorizeItem:function(a,c){a.legendGroup[c?"removeClass":"addClass"]("highcharts-legend-item-hidden");var b=this.options,d=a.legendItem,h=a.legendLine,f=a.legendSymbol,k=this.itemHiddenStyle.color,b=c?b.itemStyle.color:k,p=c?a.color||k:k,g=a.options&&a.options.marker,n={fill:p},m;d&&d.css({fill:b,color:b});h&&h.attr({stroke:p});if(f){if(g&&f.isMarker&&(n=a.pointAttribs(),!c))for(m in n)n[m]=k;f.attr(n)}},positionItem:function(a){var c=
this.options,b=c.symbolPadding,c=!c.rtl,d=a._legendItemPos,h=d[0],d=d[1],f=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(c?h:this.legendWidth-h-2*b-4,d);f&&(f.x=h,f.y=d)},destroyItem:function(a){var c=a.checkbox;g(["legendItem","legendLine","legendSymbol","legendGroup"],function(c){a[c]&&(a[c]=a[c].destroy())});c&&G(a.checkbox)},destroy:function(){var a=this.group,c=this.box;c&&(this.box=c.destroy());g(this.getAllItems(),function(a){g(["legendItem","legendGroup"],function(c){a[c]&&(a[c]=a[c].destroy())})});
a&&(this.group=a.destroy())},positionCheckboxes:function(a){var c=this.group.alignAttr,b,d=this.clipHeight||this.legendHeight,h=this.titleHeight;c&&(b=c.translateY,g(this.allItems,function(f){var k=f.checkbox,p;k&&(p=b+h+k.y+(a||0)+3,E(k,{left:c.translateX+f.checkboxOffset+k.x-20+"px",top:p+"px",display:p>b-6&&p<b+d-6?"":"none"}))}))},renderTitle:function(){var a=this.padding,c=this.options.title,b=0;c.text&&(this.title||(this.title=this.chart.renderer.label(c.text,a-3,a-4,null,null,null,null,null,
"legend-title").attr({zIndex:1}).css(c.style).add(this.group)),a=this.title.getBBox(),b=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:b}));this.titleHeight=b},setText:function(b){var c=this.options;b.legendItem.attr({text:c.labelFormat?a.format(c.labelFormat,b):c.labelFormatter.call(b)})},renderItem:function(a){var c=this.chart,b=c.renderer,d=this.options,h="horizontal"===d.layout,f=this.symbolWidth,k=d.symbolPadding,g=this.itemStyle,m=this.itemHiddenStyle,v=this.padding,r=
h?p(d.itemDistance,20):0,C=!d.rtl,w=d.width,J=d.itemMarginBottom||0,t=this.itemMarginTop,x=this.initialItemX,z=a.legendItem,B=!a.series,O=!B&&a.series.drawLegendSymbol?a.series:a,y=O.options,y=this.createCheckboxForItem&&y&&y.showCheckbox,L=d.useHTML;z||(a.legendGroup=b.g("legend-item").addClass("highcharts-"+O.type+"-series highcharts-color-"+a.colorIndex+" "+(a.options.className||"")+(B?"highcharts-series-"+a.index:"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=z=b.text("",C?f+k:-k,this.baseline||
0,L).css(n(a.visible?g:m)).attr({align:C?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(g=g.fontSize,this.fontMetrics=b.fontMetrics(g,z),this.baseline=this.fontMetrics.f+3+t,z.attr("y",this.baseline)),O.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,z,L),y&&this.createCheckboxForItem(a));this.colorizeItem(a,a.visible);this.setText(a);b=z.getBBox();f=a.checkboxOffset=d.itemWidth||a.legendItemWidth||f+k+b.width+r+(y?20:0);this.itemHeight=k=Math.round(a.legendItemHeight||
b.height);h&&this.itemX-x+f>(w||c.chartWidth-2*v-x-d.x)&&(this.itemX=x,this.itemY+=t+this.lastLineHeight+J,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,f);this.lastItemY=t+this.itemY+J;this.lastLineHeight=Math.max(k,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];h?this.itemX+=f:(this.itemY+=t+k+J,this.lastLineHeight=k);this.offsetWidth=w||Math.max((h?this.itemX-x-r:f)+v,this.offsetWidth)},getAllItems:function(){var a=[];g(this.chart.series,function(c){var b=c&&
c.options;c&&p(b.showInLegend,t(b.linkedTo)?!1:void 0,!0)&&(a=a.concat(c.legendItems||("point"===b.legendType?c.data:c)))});return a},adjustMargins:function(a,c){var b=this.chart,d=this.options,h=d.align.charAt(0)+d.verticalAlign.charAt(0)+d.layout.charAt(0);d.floating||g([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(f,k){f.test(h)&&!t(a[k])&&(b[r[k]]=Math.max(b[r[k]],b.legend[(k+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][k]*d[k%2?"x":"y"]+p(d.margin,12)+c[k]))})},render:function(){var a=
this,c=a.chart,b=c.renderer,p=a.group,h,f,u,n,m=a.box,v=a.options,r=a.padding;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;p||(a.group=p=b.g("legend").attr({zIndex:7}).add(),a.contentGroup=b.g().attr({zIndex:1}).add(p),a.scrollGroup=b.g().add(a.contentGroup));a.renderTitle();h=a.getAllItems();k(h,function(a,c){return(a.options&&a.options.legendIndex||0)-(c.options&&c.options.legendIndex||0)});v.reversed&&h.reverse();a.allItems=h;a.display=f=!!h.length;a.lastLineHeight=
0;g(h,function(c){a.renderItem(c)});u=(v.width||a.offsetWidth)+r;n=a.lastItemY+a.lastLineHeight+a.titleHeight;n=a.handleOverflow(n);n+=r;m||(a.box=m=b.rect().addClass("highcharts-legend-box").attr({r:v.borderRadius}).add(p),m.isNew=!0);m.attr({stroke:v.borderColor,"stroke-width":v.borderWidth||0,fill:v.backgroundColor||"none"}).shadow(v.shadow);0<u&&0<n&&(m[m.isNew?"attr":"animate"](m.crisp({x:0,y:0,width:u,height:n},m.strokeWidth())),m.isNew=!1);m[f?"show":"hide"]();a.legendWidth=u;a.legendHeight=
n;g(h,function(c){a.positionItem(c)});f&&p.align(d({width:u,height:n},v),!0,"spacingBox");c.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var c=this,b=this.chart,d=b.renderer,h=this.options,f=h.y,f=b.spacingBox.height+("top"===h.verticalAlign?-f:f)-this.padding,k=h.maxHeight,n,m=this.clipRect,v=h.navigation,r=p(v.animation,!0),C=v.arrowSize||12,w=this.nav,J=this.pages,t=this.padding,x,z=this.allItems,B=function(a){m.attr({height:a});c.contentGroup.div&&(c.contentGroup.div.style.clip=
"rect("+t+"px,9999px,"+(t+a)+"px,0)")};"horizontal"===h.layout&&(f/=2);k&&(f=Math.min(f,k));J.length=0;a>f&&!1!==v.enabled?(this.clipHeight=n=Math.max(f-20-this.titleHeight-t,0),this.currentPage=p(this.currentPage,1),this.fullHeight=a,g(z,function(a,c){var b=a._legendItemPos[1],e=Math.round(a.legendItem.getBBox().height),f=J.length;if(!f||b-J[f-1]>n&&(x||b)!==J[f-1])J.push(x||b),f++;c===z.length-1&&b+e-J[f-1]>n&&J.push(b);b!==x&&(x=b)}),m||(m=c.clipRect=d.clipRect(0,t,9999,0),c.contentGroup.clip(m)),
B(n),w||(this.nav=w=d.g().attr({zIndex:1}).add(this.group),this.up=d.symbol("triangle",0,0,C,C).on("click",function(){c.scroll(-1,r)}).add(w),this.pager=d.text("",15,10).addClass("highcharts-legend-navigation").css(v.style).add(w),this.down=d.symbol("triangle-down",0,0,C,C).on("click",function(){c.scroll(1,r)}).add(w)),c.scroll(0),a=f):w&&(B(b.chartHeight),w.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,c){var d=this.pages,k=d.length,h=this.currentPage+
a,f=this.clipHeight,p=this.options.navigation,g=this.pager,n=this.padding;h>k&&(h=k);0<h&&(void 0!==c&&b(c,this.chart),this.nav.attr({translateX:n,translateY:f+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===h?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),g.attr({text:h+"/"+k}),this.down.attr({x:18+this.pager.getBBox().width,"class":h===k?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),this.up.attr({fill:1===h?p.inactiveColor:
p.activeColor}).css({cursor:1===h?"default":"pointer"}),this.down.attr({fill:h===k?p.inactiveColor:p.activeColor}).css({cursor:h===k?"default":"pointer"}),d=-d[h-1]+this.initialItemY,this.scrollGroup.animate({translateY:d}),this.currentPage=h,this.positionCheckboxes(d))}};a.LegendSymbolMixin={drawRectangle:function(a,c){var b=a.options,d=b.symbolHeight||a.fontMetrics.f,b=b.squareSymbol;c.legendSymbol=this.chart.renderer.rect(b?(a.symbolWidth-d)/2:0,a.baseline-d+1,b?d:a.symbolWidth,d,p(a.options.symbolRadius,
d/2)).addClass("highcharts-point").attr({zIndex:3}).add(c.legendGroup)},drawLineMarker:function(a){var c=this.options,b=c.marker,d=a.symbolWidth,h=this.chart.renderer,f=this.legendGroup;a=a.baseline-Math.round(.3*a.fontMetrics.b);var k;k={"stroke-width":c.lineWidth||0};c.dashStyle&&(k.dashstyle=c.dashStyle);this.legendLine=h.path(["M",0,a,"L",d,a]).addClass("highcharts-graph").attr(k).add(f);b&&!1!==b.enabled&&(c=b.radius,this.legendSymbol=b=h.symbol(this.symbol,d/2-c,a-c,2*c,2*c,b).addClass("highcharts-point").add(f),
b.isMarker=!0)}};(/Trident\/7\.0/.test(v.navigator.userAgent)||m)&&B(A.prototype,"positionItem",function(a,b){var d=this,k=function(){b._legendItemPos&&a.call(d,b)};k();setTimeout(k)})})(K);(function(a){var A=a.addEvent,y=a.animate,E=a.animObject,G=a.attr,t=a.doc,g=a.Axis,d=a.createElement,m=a.defaultOptions,r=a.discardElement,n=a.charts,p=a.css,b=a.defined,k=a.each,v=a.error,B=a.extend,e=a.fireEvent,c=a.getStyle,l=a.grep,q=a.isNumber,h=a.isObject,f=a.isString,u=a.Legend,D=a.marginNames,H=a.merge,
F=a.Pointer,I=a.pick,C=a.pInt,w=a.removeEvent,J=a.seriesTypes,M=a.splat,x=a.svg,z=a.syncTimeout,N=a.win,O=a.Renderer,S=a.Chart=function(){this.getArgs.apply(this,arguments)};a.chart=function(a,b,c){return new S(a,b,c)};S.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(f(a[0])||a[0].nodeName)this.renderTo=a.shift();this.init(a[0],a[1])},init:function(b,c){var e,f=b.series;b.series=null;e=H(m,b);e.series=b.series=f;this.userOptions=b;this.respRules=[];var f=e.chart,d=f.events;
this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.callback=c;this.isResizing=0;this.options=e;this.axes=[];this.series=[];this.hasCartesianSeries=f.showAxes;var h;this.index=n.length;n.push(this);a.chartCount++;if(d)for(h in d)A(this,h,d[h]);this.xAxis=[];this.yAxis=[];this.pointCount=this.colorCounter=this.symbolCounter=0;this.firstRender()},initSeries:function(a){var b=this.options.chart;(b=J[a.type||b.type||b.defaultSeriesType])||v(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,
b,c){var e=c?b:a;a=c?a:b;return 0<=e&&e<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(b){var c=this.axes,f=this.series,d=this.pointer,h=this.legend,p=this.isDirtyLegend,l,u,g=this.hasCartesianSeries,w=this.isDirtyBox,C=f.length,q=C,n=this.renderer,m=n.isHidden(),v=[];a.setAnimation(b,this);m&&this.cloneRenderTo();for(this.layOutTitles();q--;)if(b=f[q],b.options.stacking&&(l=!0,b.isDirty)){u=!0;break}if(u)for(q=C;q--;)b=f[q],b.options.stacking&&(b.isDirty=!0);k(f,function(a){a.isDirty&&
"point"===a.options.legendType&&(a.updateTotals&&a.updateTotals(),p=!0);a.isDirtyData&&e(a,"updatedData")});p&&h.options.enabled&&(h.render(),this.isDirtyLegend=!1);l&&this.getStacks();g&&k(c,function(a){a.updateNames();a.setScale()});this.getMargins();g&&(k(c,function(a){a.isDirty&&(w=!0)}),k(c,function(a){var b=a.min+","+a.max;a.extKey!==b&&(a.extKey=b,v.push(function(){e(a,"afterSetExtremes",B(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(w||l)&&a.redraw()}));w&&this.drawChartBox();k(f,
function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);n.draw();e(this,"redraw");m&&this.cloneRenderTo(!0);k(v,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,e,f;for(e=0;e<b.length;e++)if(b[e].options.id===a)return b[e];for(e=0;e<c.length;e++)if(c[e].options.id===a)return c[e];for(e=0;e<c.length;e++)for(f=c[e].points||[],b=0;b<f.length;b++)if(f[b].id===a)return f[b];return null},getAxes:function(){var a=this,b=this.options,c=b.xAxis=M(b.xAxis||
{}),b=b.yAxis=M(b.yAxis||{});k(c,function(a,b){a.index=b;a.isX=!0});k(b,function(a,b){a.index=b});c=c.concat(b);k(c,function(b){new g(a,b)})},getSelectedPoints:function(){var a=[];k(this.series,function(b){a=a.concat(l(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return l(this.series,function(a){return a.selected})},setTitle:function(a,b,c){var e=this,f=e.options,d;d=f.title=H(f.title,a);f=f.subtitle=H(f.subtitle,b);k([["title",a,d],["subtitle",b,f]],function(a,
b){var c=a[0],f=e[c],d=a[1],h=a[2];f&&d&&(e[c]=f=f.destroy());h&&h.text&&!f&&(e[c]=e.renderer.text(h.text,0,0,h.useHTML).attr({align:h.align,"class":"highcharts-"+c,zIndex:h.zIndex||4}).add(),e[c].update=function(a){e.setTitle(!b&&a,b&&a)},e[c].css(h.style))});e.layOutTitles(c)},layOutTitles:function(a){var b=0,c,e=this.renderer,f=this.spacingBox;k(["title","subtitle"],function(a){var c=this[a],h=this.options[a],d;c&&(d=h.style.fontSize,d=e.fontMetrics(d,c).b,c.css({width:(h.width||f.width+h.widthAdjust)+
"px"}).align(B({y:b+d+("title"===a?-3:2)},h),!1,"spacingBox"),h.floating||h.verticalAlign||(b=Math.ceil(b+c.getBBox().height)))},this);c=this.titleOffset!==b;this.titleOffset=b;!this.isDirtyBox&&c&&(this.isDirtyBox=c,this.hasRendered&&I(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,e=a.width,a=a.height,f=this.renderToClone||this.renderTo;b(e)||(this.containerWidth=c(f,"width"));b(a)||(this.containerHeight=c(f,"height"));this.chartWidth=Math.max(0,e||this.containerWidth||
600);this.chartHeight=Math.max(0,I(a,19<this.containerHeight?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);r(b);delete this.renderToClone}}else c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),p(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),
t.body.appendChild(b),c&&b.appendChild(c)},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var b,c=this.options,e=c.chart,h,k;b=this.renderTo;var l="highcharts-"+a.idCounter++,p;b||(this.renderTo=b=e.renderTo);f(b)&&(this.renderTo=b=t.getElementById(b));b||v(13,!0);h=C(G(b,"data-highcharts-chart"));q(h)&&n[h]&&n[h].hasRendered&&n[h].destroy();G(b,"data-highcharts-chart",this.index);b.innerHTML="";e.skipClone||b.offsetWidth||this.cloneRenderTo();
this.getChartSize();h=this.chartWidth;k=this.chartHeight;p=B({position:"relative",overflow:"hidden",width:h+"px",height:k+"px",textAlign:"left",lineHeight:"normal",zIndex:0,"-webkit-tap-highlight-color":"rgba(0,0,0,0)"});this.container=b=d("div",{id:l},p,this.renderToClone||b);this._cursor=b.style.cursor;this.renderer=new (a[e.renderer]||O)(b,h,k,null,e.forExport,c.exporting&&c.exporting.allowHTML);this.setClassName(e.className);this.renderer.setStyle(e.style);this.renderer.chartIndex=this.index},
getMargins:function(a){var c=this.spacing,e=this.margin,f=this.titleOffset;this.resetMargins();f&&!b(e[0])&&(this.plotTop=Math.max(this.plotTop,f+this.options.title.margin+c[0]));this.legend.display&&this.legend.adjustMargins(e,c);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,c=a.axisOffset=[0,0,0,0],e=a.margin;a.hasCartesianSeries&&k(a.axes,function(a){a.visible&&
a.getOffset()});k(D,function(f,h){b(e[h])||(a[f]+=c[h])});a.setChartSize()},reflow:function(a){var e=this,f=e.options.chart,h=e.renderTo,d=b(f.width),k=f.width||c(h,"width"),f=f.height||c(h,"height"),h=a?a.target:N;if(!d&&!e.isPrinting&&k&&f&&(h===N||h===t)){if(k!==e.containerWidth||f!==e.containerHeight)clearTimeout(e.reflowTimeout),e.reflowTimeout=z(function(){e.container&&e.setSize(void 0,void 0,!1)},a?100:0);e.containerWidth=k;e.containerHeight=f}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};
A(N,"resize",b);A(a,"destroy",function(){w(N,"resize",b)})},setSize:function(b,c,f){var h=this,d=h.renderer;h.isResizing+=1;a.setAnimation(f,h);h.oldChartHeight=h.chartHeight;h.oldChartWidth=h.chartWidth;void 0!==b&&(h.options.chart.width=b);void 0!==c&&(h.options.chart.height=c);h.getChartSize();b=d.globalAnimation;(b?y:p)(h.container,{width:h.chartWidth+"px",height:h.chartHeight+"px"},b);h.setChartSize(!0);d.setSize(h.chartWidth,h.chartHeight,f);k(h.axes,function(a){a.isDirty=!0;a.setScale()});
k(h.series,function(a){a.isDirty=!0});h.isDirtyLegend=!0;h.isDirtyBox=!0;h.layOutTitles();h.getMargins();h.setResponsive&&h.setResponsive(!1);h.redraw(f);h.oldChartHeight=null;e(h,"resize");z(function(){h&&e(h,"endResize",null,function(){--h.isResizing})},E(b).duration)},setChartSize:function(a){var b=this.inverted,c=this.renderer,e=this.chartWidth,f=this.chartHeight,h=this.options.chart,d=this.spacing,p=this.clipOffset,l,u,g,w;this.plotLeft=l=Math.round(this.plotLeft);this.plotTop=u=Math.round(this.plotTop);
this.plotWidth=g=Math.max(0,Math.round(e-l-this.marginRight));this.plotHeight=w=Math.max(0,Math.round(f-u-this.marginBottom));this.plotSizeX=b?w:g;this.plotSizeY=b?g:w;this.plotBorderWidth=h.plotBorderWidth||0;this.spacingBox=c.spacingBox={x:d[3],y:d[0],width:e-d[3]-d[1],height:f-d[0]-d[2]};this.plotBox=c.plotBox={x:l,y:u,width:g,height:w};e=2*Math.floor(this.plotBorderWidth/2);b=Math.ceil(Math.max(e,p[3])/2);c=Math.ceil(Math.max(e,p[0])/2);this.clipBox={x:b,y:c,width:Math.floor(this.plotSizeX-Math.max(e,
p[1])/2-b),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(e,p[2])/2-c))};a||k(this.axes,function(a){a.setAxisSize();a.setAxisTranslation()})},resetMargins:function(){var a=this,b=a.options.chart;k(["margin","spacing"],function(c){var e=b[c],f=h(e)?e:[e,e,e,e];k(["Top","Right","Bottom","Left"],function(e,h){a[c][h]=I(b[c+e],f[h])})});k(D,function(b,c){a[b]=I(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,b=this.renderer,
c=this.chartWidth,e=this.chartHeight,f=this.chartBackground,h=this.plotBackground,d=this.plotBorder,k,p=this.plotBGImage,l=a.backgroundColor,u=a.plotBackgroundColor,g=a.plotBackgroundImage,w,C=this.plotLeft,q=this.plotTop,n=this.plotWidth,m=this.plotHeight,v=this.plotBox,x=this.clipRect,r=this.clipBox,J="animate";f||(this.chartBackground=f=b.rect().addClass("highcharts-background").add(),J="attr");k=a.borderWidth||0;w=k+(a.shadow?8:0);l={fill:l||"none"};if(k||f["stroke-width"])l.stroke=a.borderColor,
l["stroke-width"]=k;f.attr(l).shadow(a.shadow);f[J]({x:w/2,y:w/2,width:c-w-k%2,height:e-w-k%2,r:a.borderRadius});J="animate";h||(J="attr",this.plotBackground=h=b.rect().addClass("highcharts-plot-background").add());h[J](v);h.attr({fill:u||"none"}).shadow(a.plotShadow);g&&(p?p.animate(v):this.plotBGImage=b.image(g,C,q,n,m).add());x?x.animate({width:r.width,height:r.height}):this.clipRect=b.clipRect(r);J="animate";d||(J="attr",this.plotBorder=d=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());
d.attr({stroke:a.plotBorderColor,"stroke-width":a.plotBorderWidth||0,fill:"none"});d[J](d.crisp({x:C,y:q,width:n,height:m},-d.strokeWidth()));this.isDirtyBox=!1},propFromSeries:function(){var a=this,b=a.options.chart,c,e=a.options.series,f,h;k(["inverted","angular","polar"],function(d){c=J[b.type||b.defaultSeriesType];h=b[d]||c&&c.prototype[d];for(f=e&&e.length;!h&&f--;)(c=J[e[f].type])&&c.prototype[d]&&(h=!0);a[d]=h})},linkSeries:function(){var a=this,b=a.series;k(b,function(a){a.linkedSeries.length=
0});k(b,function(b){var c=b.options.linkedTo;f(c)&&(c=":previous"===c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=I(b.options.visible,c.options.visible,b.visible))})},renderSeries:function(){k(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,b=a.options.labels;b.items&&k(b.items,function(c){var e=B(b.style,c.style),f=C(e.left)+a.plotLeft,h=C(e.top)+a.plotTop+12;delete e.left;delete e.top;a.renderer.text(c.html,
f,h).attr({zIndex:2}).css(e).add()})},render:function(){var a=this.axes,b=this.renderer,c=this.options,e,f,h;this.setTitle();this.legend=new u(this,c.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();c=this.plotWidth;e=this.plotHeight-=21;k(a,function(a){a.setScale()});this.getAxisMargins();f=1.1<c/this.plotWidth;h=1.05<e/this.plotHeight;if(f||h)k(a,function(a){(a.horiz&&f||!a.horiz&&h)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&
k(a,function(a){a.visible&&a.render()});this.seriesGroup||(this.seriesGroup=b.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=this;a=H(!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&&(N.location.href=a.href)}).attr({align:a.position.align,
zIndex:8}).css(a.style).add().align(a.position),this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var b=this,c=b.axes,f=b.series,h=b.container,d,l=h&&h.parentNode;e(b,"destroy");n[b.index]=void 0;a.chartCount--;b.renderTo.removeAttribute("data-highcharts-chart");w(b);for(d=c.length;d--;)c[d]=c[d].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(d=f.length;d--;)f[d]=f[d].destroy();k("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),
function(a){var c=b[a];c&&c.destroy&&(b[a]=c.destroy())});h&&(h.innerHTML="",w(h),l&&r(h));for(d in b)delete b[d]},isReadyToRender:function(){var a=this;return x||N!=N.top||"complete"===t.readyState?!0:(t.attachEvent("onreadystatechange",function(){t.detachEvent("onreadystatechange",a.firstRender);"complete"===t.readyState&&a.firstRender()}),!1)},firstRender:function(){var a=this,b=a.options;if(a.isReadyToRender()){a.getContainer();e(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();
a.getAxes();k(b.series||[],function(b){a.initSeries(b)});a.linkSeries();e(a,"beforeRender");F&&(a.pointer=new F(a,b));a.render();a.renderer.draw();if(!a.renderer.imgCount&&a.onload)a.onload();a.cloneRenderTo(!0)}},onload:function(){k([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);e(this,"load");this.initReflow();this.onload=null}}})(K);(function(a){var A,y=a.each,E=a.extend,G=a.erase,t=a.fireEvent,g=a.format,d=a.isArray,m=a.isNumber,r=a.pick,
n=a.removeEvent;A=a.Point=function(){};A.prototype={init:function(a,b,d){this.series=a;this.color=a.color;this.applyOptions(b,d);a.options.colorByPoint?(b=a.options.colors||a.chart.options.colors,this.color=this.color||b[a.colorCounter],b=b.length,d=a.colorCounter,a.colorCounter++,a.colorCounter===b&&(a.colorCounter=0)):d=a.colorIndex;this.colorIndex=r(this.colorIndex,d);a.chart.pointCount++;return this},applyOptions:function(a,b){var d=this.series,g=d.options.pointValKey||d.pointValKey;a=A.prototype.optionsToObject.call(this,
a);E(this,a);this.options=this.options?E(this.options,a):a;a.group&&delete this.group;g&&(this.y=this[g]);this.isNull=r(this.isValid&&!this.isValid(),null===this.x||!m(this.y,!0));"name"in this&&void 0===b&&d.xAxis&&d.xAxis.hasNames&&(this.x=d.xAxis.nameToX(this));void 0===this.x&&d&&(this.x=void 0===b?d.autoIncrement(this):b);return this},optionsToObject:function(a){var b={},k=this.series,g=k.options.keys,n=g||k.pointArrayMap||["y"],e=n.length,c=0,l=0;if(m(a)||null===a)b[n[0]]=a;else if(d(a))for(!g&&
a.length>e&&(k=typeof a[0],"string"===k?b.name=a[0]:"number"===k&&(b.x=a[0]),c++);l<e;)g&&void 0===a[c]||(b[n[l]]=a[c]),c++,l++;else"object"===typeof a&&(b=a,a.dataLabels&&(k._hasPointLabels=!0),a.marker&&(k._hasPointMarkers=!0));return b},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")},getZone:function(){var a=
this.series,b=a.zones,a=a.zoneAxis||"y",d=0,g;for(g=b[d];this[a]>=g.value;)g=b[++d];g&&g.color&&!this.options.color&&(this.color=g.color);return g},destroy:function(){var a=this.series.chart,b=a.hoverPoints,d;a.pointCount--;b&&(this.setState(),G(b,this),b.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)n(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(d in this)this[d]=null},destroyElements:function(){for(var a=["graphic",
"dataLabel","dataLabelUpper","connector","shadowGroup"],b,d=6;d--;)b=a[d],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,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,d=b.tooltipOptions,n=r(d.valueDecimals,""),m=d.valuePrefix||"",e=d.valueSuffix||"";y(b.pointArrayMap||["y"],function(b){b="{point."+b;if(m||e)a=a.replace(b+
"}",m+b+"}"+e);a=a.replace(b+"}",b+":,."+n+"f}")});return g(a,{point:this,series:this.series})},firePointEvent:function(a,b,d){var g=this,n=this.series.options;(n.point.events[a]||g.options&&g.options.events&&g.options.events[a])&&this.importEvents();"click"===a&&n.allowPointSelect&&(d=function(a){g.select&&g.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});t(this,a,b,d)},visible:!0}})(K);(function(a){var A=a.addEvent,y=a.animObject,E=a.arrayMax,G=a.arrayMin,t=a.correctFloat,g=a.Date,d=a.defaultOptions,
m=a.defaultPlotOptions,r=a.defined,n=a.each,p=a.erase,b=a.error,k=a.extend,v=a.fireEvent,B=a.grep,e=a.isArray,c=a.isNumber,l=a.isString,q=a.merge,h=a.pick,f=a.removeEvent,u=a.splat,D=a.stableSort,H=a.SVGElement,F=a.syncTimeout,I=a.win;a.Series=a.seriesType("line",null,{lineWidth:2,allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{lineWidth:0,lineColor:"#ffffff",radius:4,states:{hover:{enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"#cccccc",lineColor:"#000000",
lineWidth:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},style:{fontSize:"11px",fontWeight:"bold",color:"contrast",textShadow:"1px 1px contrast, -1px -1px contrast, -1px 1px contrast, 1px -1px contrast"},verticalAlign:"bottom",x:0,y:0,padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,
pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,b){var c=this,e,f,d=a.series,l=function(a,b){return h(a.options.index,a._i)-h(b.options.index,b._i)};c.chart=a;c.options=b=c.setOptions(b);c.linkedSeries=[];c.bindAxes();k(c,{name:b.name,state:"",visible:!1!==b.visible,selected:!0===b.selected});f=b.events;for(e in f)A(c,e,f[e]);if(f&&f.click||b.point&&b.point.events&&b.point.events.click||
b.allowPointSelect)a.runTrackerClick=!0;c.getColor();c.getSymbol();n(c.parallelArrays,function(a){c[a+"Data"]=[]});c.setData(b.data,!1);c.isCartesian&&(a.hasCartesianSeries=!0);d.push(c);c._i=d.length-1;D(d,l);this.yAxis&&D(this.yAxis.series,l);n(d,function(a,b){a.index=b;a.name=a.name||"Series "+(b+1)})},bindAxes:function(){var a=this,c=a.options,e=a.chart,f;n(a.axisTypes||[],function(h){n(e[h],function(b){f=b.options;if(c[h]===f.index||void 0!==c[h]&&c[h]===f.id||void 0===c[h]&&0===f.index)b.series.push(a),
a[h]=b,b.isDirty=!0});a[h]||a.optionalAxis===h||b(18,!0)})},updateParallelArrays:function(a,b){var e=a.series,f=arguments,h=c(b)?function(c){var f="y"===c&&e.toYData?e.toYData(a):a[c];e[c+"Data"][b]=f}:function(a){Array.prototype[b].apply(e[a+"Data"],Array.prototype.slice.call(f,2))};n(e.parallelArrays,h)},autoIncrement:function(){var a=this.options,b=this.xIncrement,c,e=a.pointIntervalUnit,b=h(b,a.pointStart,0);this.pointInterval=c=h(this.pointInterval,a.pointInterval,1);e&&(a=new g(b),"day"===e?
a=+a[g.hcSetDate](a[g.hcGetDate]()+c):"month"===e?a=+a[g.hcSetMonth](a[g.hcGetMonth]()+c):"year"===e&&(a=+a[g.hcSetFullYear](a[g.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},e=b.plotOptions||{},f=c[this.type];this.userOptions=a;c=q(f,c.series,a);this.tooltipOptions=q(d.tooltip,d.plotOptions[this.type].tooltip,b.tooltip,e.series&&e.series.tooltip,e[this.type]&&e[this.type].tooltip,a.tooltip);null===f.marker&&
delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative",color:c.negativeColor,fillColor:c.negativeFillColor});a.length&&r(a[a.length-1].value)&&a.push({color:this.color,fillColor:this.fillColor});return c},getCyclic:function(a,b,c){var e,f=this.userOptions,d=a+"Index",k=a+"Counter",l=c?c.length:h(this.chart.options.chart[a+"Count"],this.chart[a+
"Count"]);b||(e=h(f[d],f["_"+d]),r(e)||(f["_"+d]=e=this.chart[k]%l,this.chart[k]+=1),c&&(b=c[e]));void 0!==e&&(this[d]=e);this[a]=b},getColor:function(){this.options.colorByPoint?this.options.color=null:this.getCyclic("color",this.options.color||m[this.type].color,this.chart.options.colors)},getSymbol:function(){var a=this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);/^url/.test(this.symbol)&&(a.radius=0)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(a,
f,d,k){var g=this,u=g.points,p=u&&u.length||0,q,m=g.options,r=g.chart,v=null,D=g.xAxis,t=m.turboThreshold,F=this.xData,H=this.yData,B=(q=g.pointArrayMap)&&q.length;a=a||[];q=a.length;f=h(f,!0);if(!1!==k&&q&&p===q&&!g.cropped&&!g.hasGroupedData&&g.visible)n(a,function(a,b){u[b].update&&a!==m.data[b]&&u[b].update(a,!1,null,!1)});else{g.xIncrement=null;g.colorCounter=0;n(this.parallelArrays,function(a){g[a+"Data"].length=0});if(t&&q>t){for(d=0;null===v&&d<q;)v=a[d],d++;if(c(v))for(d=0;d<q;d++)F[d]=this.autoIncrement(),
H[d]=a[d];else if(e(v))if(B)for(d=0;d<q;d++)v=a[d],F[d]=v[0],H[d]=v.slice(1,B+1);else for(d=0;d<q;d++)v=a[d],F[d]=v[0],H[d]=v[1];else b(12)}else for(d=0;d<q;d++)void 0!==a[d]&&(v={series:g},g.pointClass.prototype.applyOptions.apply(v,[a[d]]),g.updateParallelArrays(v,d));l(H[0])&&b(14,!0);g.data=[];g.options.data=g.userOptions.data=a;for(d=p;d--;)u[d]&&u[d].destroy&&u[d].destroy();D&&(D.minRange=D.userMinRange);g.isDirty=r.isDirtyBox=!0;g.isDirtyData=!!u;d=!1}"point"===m.legendType&&(this.processData(),
this.generatePoints());f&&r.redraw(d)},processData:function(a){var c=this.xData,e=this.yData,f=c.length,d;d=0;var h,k,l=this.xAxis,g,u=this.options;g=u.cropThreshold;var p=this.getExtremesFromAll||u.getExtremesFromAll,q=this.isCartesian,u=l&&l.val2lin,n=l&&l.isLog,m,v;if(q&&!this.isDirty&&!l.isDirty&&!this.yAxis.isDirty&&!a)return!1;l&&(a=l.getExtremes(),m=a.min,v=a.max);if(q&&this.sorted&&!p&&(!g||f>g||this.forceCrop))if(c[f-1]<m||c[0]>v)c=[],e=[];else if(c[0]<m||c[f-1]>v)d=this.cropData(this.xData,
this.yData,m,v),c=d.xData,e=d.yData,d=d.start,h=!0;for(g=c.length||1;--g;)f=n?u(c[g])-u(c[g-1]):c[g]-c[g-1],0<f&&(void 0===k||f<k)?k=f:0>f&&this.requireSorting&&b(15);this.cropped=h;this.cropStart=d;this.processedXData=c;this.processedYData=e;this.closestPointRange=k},cropData:function(a,b,c,e){var f=a.length,d=0,k=f,l=h(this.cropShoulder,1),g;for(g=0;g<f;g++)if(a[g]>=c){d=Math.max(0,g-l);break}for(c=g;c<f;c++)if(a[c]>e){k=c+l;break}return{xData:a.slice(d,k),yData:b.slice(d,k),start:d,end:k}},generatePoints:function(){var a=
this.options.data,b=this.data,c,e=this.processedXData,f=this.processedYData,d=this.pointClass,h=e.length,k=this.cropStart||0,l,g=this.hasGroupedData,p,q=[],n;b||g||(b=[],b.length=a.length,b=this.data=b);for(n=0;n<h;n++)l=k+n,g?(q[n]=(new d).init(this,[e[n]].concat(u(f[n]))),q[n].dataGroup=this.groupMap[n]):(b[l]?p=b[l]:void 0!==a[l]&&(b[l]=p=(new d).init(this,a[l],e[n])),q[n]=p),q[n].index=l;if(b&&(h!==(c=b.length)||g))for(n=0;n<c;n++)n!==k||g||(n+=h),b[n]&&(b[n].destroyElements(),b[n].plotX=void 0);
this.data=b;this.points=q},getExtremes:function(a){var b=this.yAxis,f=this.processedXData,d,h=[],k=0;d=this.xAxis.getExtremes();var l=d.min,g=d.max,u,p,n,q;a=a||this.stackedYData||this.processedYData||[];d=a.length;for(q=0;q<d;q++)if(p=f[q],n=a[q],u=(c(n,!0)||e(n))&&(!b.isLog||n.length||0<n),p=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(f[q+1]||p)>=l&&(f[q-1]||p)<=g,u&&p)if(u=n.length)for(;u--;)null!==n[u]&&(h[k++]=n[u]);else h[k++]=n;this.dataMin=G(h);this.dataMax=E(h)},
translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,e=this.xAxis,f=e.categories,d=this.yAxis,k=this.points,l=k.length,g=!!this.modifyValue,u=a.pointPlacement,p="between"===u||c(u),n=a.threshold,q=a.startFromThreshold?n:0,m,v,D,F,H=Number.MAX_VALUE,a=0;a<l;a++){var B=k[a],I=B.x,y=B.y;v=B.low;var A=b&&d.stacks[(this.negStacks&&y<(q?0:n)?"-":"")+this.stackKey],E;d.isLog&&null!==y&&0>=y&&(B.isNull=!0);B.plotX=m=t(Math.min(Math.max(-1E5,
e.translate(I,0,0,0,1,u,"flags"===this.type)),1E5));b&&this.visible&&!B.isNull&&A&&A[I]&&(F=this.getStackIndicator(F,I,this.index),E=A[I],y=E.points[F.key],v=y[0],y=y[1],v===q&&F.key===A[I].base&&(v=h(n,d.min)),d.isLog&&0>=v&&(v=null),B.total=B.stackTotal=E.total,B.percentage=E.total&&B.y/E.total*100,B.stackY=y,E.setOffset(this.pointXOffset||0,this.barW||0));B.yBottom=r(v)?d.translate(v,0,1,0,1):null;g&&(y=this.modifyValue(y,B));B.plotY=v="number"===typeof y&&Infinity!==y?Math.min(Math.max(-1E5,d.translate(y,
0,1,0,1)),1E5):void 0;B.isInside=void 0!==v&&0<=v&&v<=d.len&&0<=m&&m<=e.len;B.clientX=p?t(e.translate(I,0,0,0,1,u)):m;B.negative=B.y<(n||0);B.category=f&&void 0!==f[B.x]?f[B.x]:B.x;B.isNull||(void 0!==D&&(H=Math.min(H,Math.abs(m-D))),D=m)}this.closestPointRangePx=H},getValidPoints:function(a,b){var c=this.chart;return B(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,e=b.renderer,f=b.inverted,
d=this.clipBox,h=d||b.clipBox,k=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,h.height,c.xAxis,c.yAxis].join(),l=b[k],g=b[k+"m"];l||(a&&(h.width=0,b[k+"m"]=g=e.clipRect(-99,f?-b.plotLeft:-b.plotTop,99,f?b.chartWidth:b.chartHeight)),b[k]=l=e.clipRect(h),l.count={length:0});a&&!l.count[this.index]&&(l.count[this.index]=!0,l.count.length+=1);!1!==c.clip&&(this.group.clip(a||d?l:b.clipRect),this.markerGroup.clip(g),this.sharedClipKey=k);a||(l.count[this.index]&&(delete l.count[this.index],
--l.count.length),0===l.count.length&&k&&b[k]&&(d||(b[k]=b[k].destroy()),b[k+"m"]&&(b[k+"m"]=b[k+"m"].destroy())))},animate:function(a){var b=this.chart,c=y(this.options.animation),e;a?this.setClip(c):(e=this.sharedClipKey,(a=b[e])&&a.animate({width:b.plotSizeX},c),b[e+"m"]&&b[e+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();v(this,"afterAnimate")},drawPoints:function(){var a=this.points,b=this.chart,e,f,d,l,g,u,p,n,q=this.options.marker,m,v,r,D=
this.markerGroup,t=h(q.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*q.radius);if(!1!==q.enabled||this._hasPointMarkers)for(d=a.length;d--;)l=a[d],e=Math.floor(l.plotX),f=l.plotY,n=l.graphic,m=l.marker||{},v=!!l.marker,g=t&&void 0===m.enabled||m.enabled,r=l.isInside,g&&c(f)&&null!==l.y?(g=q.radius,u=h(m.symbol,this.symbol),p=0===u.indexOf("url"),n?n[r?"show":"hide"](!0).animate(k({x:e-g,y:f-g},n.symbolName?{width:2*g,height:2*g}:{})):r&&(0<g||p)&&(l.graphic=n=b.renderer.symbol(u,
e-g,f-g,2*g,2*g,v?m:q).attr({r:g}).add(D)),n&&n.attr(this.pointAttribs(l,l.selected&&"select")),n&&n.addClass(l.getClassName(),!0)):n&&(l.graphic=n.destroy())},pointAttribs:function(a,b){var c=this.options.marker,e=a&&a.options,f=e&&e.marker||{},d=c.lineWidth,h=this.color,e=e&&e.color,k=a&&a.color,l,g;a&&this.zones.length&&(g=a.getZone())&&g.color&&(l=g.color);h=e||l||k||h;l=f.fillColor||c.fillColor||h;h=f.lineColor||c.lineColor||h;b&&(c=c.states[b],f=f.states&&f.states[b]||{},d=c.lineWidth||d+c.lineWidthPlus,
l=f.fillColor||c.fillColor||l,h=f.lineColor||c.lineColor||h);return{stroke:h,"stroke-width":d,fill:l}},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(I.navigator.userAgent),e,d=a.data||[],h,k,l;v(a,"destroy");f(a);n(a.axisTypes||[],function(b){(l=a[b])&&l.series&&(p(l.series,a),l.isDirty=l.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(e=d.length;e--;)(h=d[e])&&h.destroy&&h.destroy();a.points=null;clearTimeout(a.animationTimeout);for(k in a)a[k]instanceof H&&
!a[k].survive&&(e=c&&"group"===k?"hide":"destroy",a[k][e]());b.hoverSeries===a&&(b.hoverSeries=null);p(b.series,a);for(k in a)delete a[k]},getGraphPath:function(a,b,c){var e=this,f=e.options,d=f.step,h,k=[],l=[],g;a=a||e.points;(h=a.reversed)&&a.reverse();(d={right:1,center:2}[d]||d&&3)&&h&&(d=4-d);!f.connectNulls||b||c||(a=this.getValidPoints(a));n(a,function(h,u){var p=h.plotX,n=h.plotY,q=a[u-1];(h.leftCliff||q&&q.rightCliff)&&!c&&(g=!0);h.isNull&&!r(b)&&0<u?g=!f.connectNulls:h.isNull&&!b?g=!0:
(0===u||g?q=["M",h.plotX,h.plotY]:e.getPointSpline?q=e.getPointSpline(a,h,u):d?(q=1===d?["L",q.plotX,n]:2===d?["L",(q.plotX+p)/2,q.plotY,"L",(q.plotX+p)/2,n]:["L",p,q.plotY],q.push("L",p,n)):q=["L",p,n],l.push(h.x),d&&l.push(h.x),k.push.apply(k,q),g=!1)});k.xMap=l;return e.graphPath=k},drawGraph:function(){var a=this,b=this.options,c=(this.gappedPath||this.getGraphPath).call(this),e=[["graph","highcharts-graph",b.lineColor||this.color,b.dashStyle]];n(this.zones,function(c,f){e.push(["zone-graph-"+
f,"highcharts-graph highcharts-zone-graph-"+f+" "+(c.className||""),c.color||a.color,c.dashStyle||b.dashStyle])});n(e,function(e,f){var d=e[0],h=a[d];h?(h.endX=c.xMap,h.animate({d:c})):c.length&&(a[d]=a.chart.renderer.path(c).addClass(e[1]).attr({zIndex:1}).add(a.group),h={stroke:e[2],"stroke-width":b.lineWidth,fill:a.fillGraph&&a.color||"none"},e[3]?h.dashstyle=e[3]:"square"!==b.linecap&&(h["stroke-linecap"]=h["stroke-linejoin"]="round"),h=a[d].attr(h).shadow(2>f&&b.shadow));h&&(h.startX=c.xMap,
h.isArea=c.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,e=this.zones,f,d,k=this.clips||[],l,g=this.graph,u=this.area,p=Math.max(b.chartWidth,b.chartHeight),q=this[(this.zoneAxis||"y")+"Axis"],m,v,r=b.inverted,D,t,F,H,B=!1;e.length&&(g||u)&&q&&void 0!==q.min&&(v=q.reversed,D=q.horiz,g&&g.hide(),u&&u.hide(),m=q.getExtremes(),n(e,function(e,n){f=v?D?b.plotWidth:0:D?0:q.toPixels(m.min);f=Math.min(Math.max(h(d,f),0),p);d=Math.min(Math.max(Math.round(q.toPixels(h(e.value,m.max),
!0)),0),p);B&&(f=d=q.toPixels(m.max));t=Math.abs(f-d);F=Math.min(f,d);H=Math.max(f,d);q.isXAxis?(l={x:r?H:F,y:0,width:t,height:p},D||(l.x=b.plotHeight-l.x)):(l={x:0,y:r?H:F,width:p,height:t},D&&(l.y=b.plotWidth-l.y));r&&c.isVML&&(l=q.isXAxis?{x:0,y:v?F:H,height:l.width,width:b.chartWidth}:{x:l.y-b.plotLeft-b.spacingBox.x,y:0,width:l.height,height:b.chartHeight});k[n]?k[n].animate(l):(k[n]=c.clipRect(l),g&&a["zone-graph-"+n].clip(k[n]),u&&a["zone-area-"+n].clip(k[n]));B=e.value>m.max}),this.clips=
k)},invertGroups:function(a){function b(){var e={width:c.yAxis.len,height:c.xAxis.len};n(["group","markerGroup"],function(b){c[b]&&c[b].attr(e).invert(a)})}var c=this,e=c.chart;c.xAxis&&(A(e,"resize",b),A(c,"destroy",function(){f(e,"resize",b)}),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,e,f){var d=this[a],h=!d;h&&(this[a]=d=this.chart.renderer.g(b).attr({zIndex:e||.1}).add(f),d.addClass("highcharts-series-"+this.index+" highcharts-"+this.type+"-series highcharts-color-"+this.colorIndex+" "+
(this.options.className||"")));d.attr({visibility:c})[h?"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}},render:function(){var a=this,b=a.chart,c,e=a.options,f=!!a.animate&&b.renderer.isSVG&&y(e.animation).duration,d=a.visible?"inherit":"hidden",h=e.zIndex,k=a.hasRendered,l=b.seriesGroup,g=b.inverted;c=a.plotGroup("group",
"series",d,h,l);a.markerGroup=a.plotGroup("markerGroup","markers",d,h,l);f&&a.animate(!0);c.inverted=a.isCartesian?g:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(g);!1===e.clip||a.sharedClipKey||k||c.clip(b.clipRect);f&&a.animate();k||(a.animationTimeout=F(function(){a.afterAnimate()},f));a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},redraw:function(){var a=
this.chart,b=this.isDirty||this.isDirtyData,c=this.group,e=this.xAxis,f=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:h(e&&e.left,a.plotLeft),translateY:h(f&&f.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,e=this.yAxis,f=this.chart.inverted;return this.searchKDTree({clientX:f?c.len-a.chartY+c.pos:a.chartX-c.pos,plotY:f?e.len-a.chartX+
e.pos:a.chartY-e.pos},b)},buildKDTree:function(){function a(c,e,f){var d,h;if(h=c&&c.length)return d=b.kdAxisArray[e%f],c.sort(function(a,b){return a[d]-b[d]}),h=Math.floor(h/2),{point:c[h],left:a(c.slice(0,h),e+1,f),right:a(c.slice(h+1),e+1,f)}}var b=this,c=b.kdDimensions;delete b.kdTree;F(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c)},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,b,k,l){var g=b.point,u=e.kdAxisArray[k%l],q,n,p=g;n=r(a[f])&&r(g[f])?Math.pow(a[f]-
g[f],2):null;q=r(a[d])&&r(g[d])?Math.pow(a[d]-g[d],2):null;q=(n||0)+(q||0);g.dist=r(q)?Math.sqrt(q):Number.MAX_VALUE;g.distX=r(n)?Math.sqrt(n):Number.MAX_VALUE;u=a[u]-g[u];q=0>u?"left":"right";n=0>u?"right":"left";b[q]&&(q=c(a,b[q],k+1,l),p=q[h]<p[h]?q:g);b[n]&&Math.sqrt(u*u)<p[h]&&(a=c(a,b[n],k+1,l),p=a[h]<p[h]?a:p);return p}var e=this,f=this.kdAxisArray[0],d=this.kdAxisArray[1],h=b?"distX":"dist";this.kdTree||this.buildKDTree();if(this.kdTree)return c(a,this.kdTree,this.kdDimensions,this.kdDimensions)}})})(K);
(function(a){function A(a,d,b,k,g){var m=a.chart.inverted;this.axis=a;this.isNegative=b;this.options=d;this.x=k;this.total=null;this.points={};this.stack=g;this.rightCliff=this.leftCliff=0;this.alignOptions={align:d.align||(m?b?"left":"right":"center"),verticalAlign:d.verticalAlign||(m?"middle":b?"bottom":"top"),y:r(d.y,m?4:b?14:-6),x:r(d.x,m?b?-6:6:0)};this.textAlign=d.textAlign||(m?b?"right":"left":"center")}var y=a.Axis,E=a.Chart,G=a.correctFloat,t=a.defined,g=a.destroyObjectProperties,d=a.each,
m=a.format,r=a.pick;a=a.Series;A.prototype={destroy:function(){g(this,this.axis)},render:function(a){var d=this.options,b=d.format,b=b?m(b,this):d.formatter.call(this);this.label?this.label.attr({text:b,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(b,null,null,d.useHTML).css(d.style).attr({align:this.textAlign,rotation:d.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,d){var b=this.axis,k=b.chart,g=k.inverted,m=b.reversed,m=this.isNegative&&!m||!this.isNegative&&m,e=b.translate(b.usePercentage?
100:this.total,0,0,0,1),b=b.translate(0),b=Math.abs(e-b),c=k.xAxis[0].translate(this.x)+a,l=k.plotHeight,m={x:g?m?e:e-b:c,y:g?l-c-d:m?l-e-b:l-e,width:g?b:d,height:g?d:b};if(g=this.label)g.align(this.alignOptions,null,m),m=g.alignAttr,g[!1===this.options.crop||k.isInsidePlot(m.x,m.y)?"show":"hide"](!0)}};E.prototype.getStacks=function(){var a=this;d(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)});d(a.series,function(d){!d.options.stacking||!0!==d.visible&&!1!==a.options.chart.ignoreHiddenSeries||
(d.stackKey=d.type+r(d.options.stack,""))})};y.prototype.buildStacks=function(){var a=this.series,d,b=r(this.options.reversedStacks,!0),k=a.length,g;if(!this.isXAxis){this.usePercentage=!1;for(g=k;g--;)a[b?g:k-g-1].setStackedPoints();for(g=k;g--;)d=a[b?g:k-g-1],d.setStackCliffs&&d.setStackCliffs();if(this.usePercentage)for(g=0;g<k;g++)a[g].setPercentStacks()}};y.prototype.renderStackTotals=function(){var a=this.chart,d=a.renderer,b=this.stacks,k,g,m=this.stackTotalGroup;m||(this.stackTotalGroup=m=
d.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());m.translate(a.plotLeft,a.plotTop);for(k in b)for(g in a=b[k],a)a[g].render(m)};y.prototype.resetStacks=function(){var a=this.stacks,d,b;if(!this.isXAxis)for(d in a)for(b in a[d])a[d][b].touched<this.stacksTouched?(a[d][b].destroy(),delete a[d][b]):(a[d][b].total=null,a[d][b].cum=0)};y.prototype.cleanStacks=function(){var a,d,b;if(!this.isXAxis)for(d in this.oldStacks&&(a=this.stacks=this.oldStacks),a)for(b in a[d])a[d][b].cum=a[d][b].total};
a.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var a=this.processedXData,d=this.processedYData,b=[],k=d.length,g=this.options,m=g.threshold,e=g.startFromThreshold?m:0,c=g.stack,g=g.stacking,l=this.stackKey,q="-"+l,h=this.negStacks,f=this.yAxis,u=f.stacks,D=f.oldStacks,H,F,I,C,w,y,E;f.stacksTouched+=1;for(w=0;w<k;w++)y=a[w],E=d[w],H=this.getStackIndicator(H,y,this.index),C=H.key,I=(F=h&&E<(e?0:m))?q:l,u[I]||(u[I]=
{}),u[I][y]||(D[I]&&D[I][y]?(u[I][y]=D[I][y],u[I][y].total=null):u[I][y]=new A(f,f.options.stackLabels,F,y,c)),I=u[I][y],null!==E&&(I.points[C]=I.points[this.index]=[r(I.cum,e)],t(I.cum)||(I.base=C),I.touched=f.stacksTouched,0<H.index&&!1===this.singleStacks&&(I.points[C][0]=I.points[this.index+","+y+",0"][0])),"percent"===g?(F=F?l:q,h&&u[F]&&u[F][y]?(F=u[F][y],I.total=F.total=Math.max(F.total,I.total)+Math.abs(E)||0):I.total=G(I.total+(Math.abs(E)||0))):I.total=G(I.total+(E||0)),I.cum=r(I.cum,e)+
(E||0),null!==E&&(I.points[C].push(I.cum),b[w]=I.cum);"percent"===g&&(f.usePercentage=!0);this.stackedYData=b;f.oldStacks={}}};a.prototype.setPercentStacks=function(){var a=this,g=a.stackKey,b=a.yAxis.stacks,k=a.processedXData,m;d([g,"-"+g],function(d){for(var e=k.length,c,g;e--;)if(c=k[e],m=a.getStackIndicator(m,c,a.index),c=(g=b[d]&&b[d][c])&&g.points[m.key])g=g.total?100/g.total:0,c[0]=G(c[0]*g),c[1]=G(c[1]*g),a.stackedYData[e]=c[1]})};a.prototype.getStackIndicator=function(a,d,b){t(a)&&a.x===
d?a.index++:a={x:d,index:0};a.key=[b,d,a.index].join();return a}})(K);(function(a){var A=a.addEvent,y=a.animate,E=a.Axis,G=a.createElement,t=a.css,g=a.defined,d=a.each,m=a.erase,r=a.extend,n=a.fireEvent,p=a.inArray,b=a.isObject,k=a.merge,v=a.pick,B=a.Point,e=a.Series,c=a.seriesTypes,l=a.setAnimation,q=a.splat;r(a.Chart.prototype,{addSeries:function(a,b,c){var e,d=this;a&&(b=v(b,!0),n(d,"addSeries",{options:a},function(){e=d.initSeries(a);d.isDirtyLegend=!0;d.linkSeries();b&&d.redraw(c)}));return e},
addAxis:function(a,b,c,e){var d=b?"xAxis":"yAxis",g=this.options;a=k(a,{index:this[d].length,isX:b});new E(this,a);g[d]=q(g[d]||{});g[d].push(a);v(c,!0)&&this.redraw(e)},showLoading:function(a){var b=this,c=b.options,e=b.loadingDiv,d=c.loading,g=function(){e&&t(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),A(b,"redraw",g));setTimeout(function(){e.className="highcharts-loading"});b.loadingSpan.innerHTML=a||c.lang.loading;t(e,r(d.style,{zIndex:10}));t(b.loadingSpan,d.labelStyle);b.loadingShown||(t(e,{opacity:0,display:""}),y(e,{opacity:d.style.opacity||.5},{duration:d.showDuration||0}));b.loadingShown=!0;g()},hideLoading:function(){var a=this.options,b=this.loadingDiv;b&&(b.className="highcharts-loading highcharts-loading-hidden",y(b,{opacity:0},{duration:a.loading.hideDuration||100,complete:function(){t(b,
{display:"none"})}}));this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),propsRequireUpdateSeries:["chart.polar","chart.ignoreHiddenSeries","chart.type","colors","plotOptions"],update:function(a,b){var c,e={credits:"addCredits",title:"setTitle",
subtitle:"setSubtitle"},l=a.chart,m,n;if(l){k(!0,this.options.chart,l);"className"in l&&this.setClassName(l.className);if("inverted"in l||"polar"in l)this.propFromSeries(),m=!0;for(c in l)l.hasOwnProperty(c)&&(-1!==p("chart."+c,this.propsRequireUpdateSeries)&&(n=!0),-1!==p(c,this.propsRequireDirtyBox)&&(this.isDirtyBox=!0));"style"in l&&this.renderer.setStyle(l.style)}for(c in a){if(this[c]&&"function"===typeof this[c].update)this[c].update(a[c],!1);else if("function"===typeof this[e[c]])this[e[c]](a[c]);
"chart"!==c&&-1!==p(c,this.propsRequireUpdateSeries)&&(n=!0)}a.colors&&(this.options.colors=a.colors);a.plotOptions&&k(!0,this.options.plotOptions,a.plotOptions);d(["xAxis","yAxis","series"],function(b){a[b]&&d(q(a[b]),function(a){var c=g(a.id)&&this.get(a.id)||this[b][0];c&&c.coll===b&&c.update(a,!1)},this)},this);m&&d(this.axes,function(a){a.update({},!1)});n&&d(this.series,function(a){a.update({},!1)});a.loading&&k(!0,this.options.loading,a.loading);l&&("width"in l||"height"in l)?this.setSize(l.width,
l.height):v(b,!0)&&this.redraw()},setSubtitle:function(a){this.setTitle(void 0,a)}});r(B.prototype,{update:function(a,c,e,d){function g(){k.applyOptions(a);null===k.y&&q&&(k.graphic=q.destroy());b(a,!0)&&(q&&q.element&&a&&a.marker&&a.marker.symbol&&(k.graphic=q.destroy()),a&&a.dataLabels&&k.dataLabel&&(k.dataLabel=k.dataLabel.destroy()));m=k.index;l.updateParallelArrays(k,m);p.data[m]=b(p.data[m],!0)?k.options:a;l.isDirty=l.isDirtyData=!0;!l.fixedBox&&l.hasCartesianSeries&&(n.isDirtyBox=!0);"point"===
p.legendType&&(n.isDirtyLegend=!0);c&&n.redraw(e)}var k=this,l=k.series,q=k.graphic,m,n=l.chart,p=l.options;c=v(c,!0);!1===d?g():k.firePointEvent("update",{options:a},g)},remove:function(a,b){this.series.removePoint(p(this,this.series.data),a,b)}});r(e.prototype,{addPoint:function(a,b,c,e){var d=this.options,g=this.data,k=this.chart,l=this.xAxis&&this.xAxis.names,q=d.data,m,n,p=this.xData,r,t;b=v(b,!0);m={series:this};this.pointClass.prototype.applyOptions.apply(m,[a]);t=m.x;r=p.length;if(this.requireSorting&&
t<p[r-1])for(n=!0;r&&p[r-1]>t;)r--;this.updateParallelArrays(m,"splice",r,0,0);this.updateParallelArrays(m,r);l&&m.name&&(l[t]=m.name);q.splice(r,0,a);n&&(this.data.splice(r,0,null),this.processData());"point"===d.legendType&&this.generatePoints();c&&(g[0]&&g[0].remove?g[0].remove(!1):(g.shift(),this.updateParallelArrays(m,"shift"),q.shift()));this.isDirtyData=this.isDirty=!0;b&&k.redraw(e)},removePoint:function(a,b,c){var e=this,d=e.data,g=d[a],k=e.points,q=e.chart,m=function(){k&&k.length===d.length&&
k.splice(a,1);d.splice(a,1);e.options.data.splice(a,1);e.updateParallelArrays(g||{series:e},"splice",a,1);g&&g.destroy();e.isDirty=!0;e.isDirtyData=!0;b&&q.redraw()};l(c,q);b=v(b,!0);g?g.firePointEvent("remove",null,m):m()},remove:function(a,b,c){function e(){d.destroy();g.isDirtyLegend=g.isDirtyBox=!0;g.linkSeries();v(a,!0)&&g.redraw(b)}var d=this,g=d.chart;!1!==c?n(d,"remove",null,e):e()},update:function(a,b){var e=this,g=this.chart,l=this.userOptions,q=this.type,m=a.type||l.type||g.options.chart.type,
n=c[q].prototype,p=["group","markerGroup","dataLabelsGroup"],t;if(m&&m!==q||void 0!==a.zIndex)p.length=0;d(p,function(a){p[a]=e[a];delete e[a]});a=k(l,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(t in n)this[t]=void 0;r(this,c[m||q].prototype);d(p,function(a){e[a]=p[a]});this.init(g,a);g.linkSeries();v(b,!0)&&g.redraw(!1)}});r(E.prototype,{update:function(a,b){var c=this.chart;a=c.options[this.coll][this.options.index]=k(this.userOptions,
a);this.destroy(!0);this.init(c,r(a,{events:void 0}));c.isDirtyBox=!0;v(b,!0)&&c.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,g=e.length;g--;)e[g]&&e[g].remove(!1);m(b.axes,this);m(b[c],this);b.options[c].splice(this.options.index,1);d(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;v(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},b)}})})(K);(function(a){var A=a.color,y=
a.each,E=a.map,G=a.pick,t=a.Series,g=a.seriesType;g("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var a=[],g=[],r=this.xAxis,n=this.yAxis,p=n.stacks[this.stackKey],b={},k=this.points,v=this.index,t=n.series,e=t.length,c,l=G(n.options.reversedStacks,!0)?1:-1,q,h;if(this.options.stacking){for(q=0;q<k.length;q++)b[k[q].x]=k[q];for(h in p)null!==p[h].total&&g.push(h);g.sort(function(a,b){return a-b});c=E(t,function(){return this.visible});y(g,function(f,h){var k=
0,t,F;if(b[f]&&!b[f].isNull)a.push(b[f]),y([-1,1],function(a){var d=1===a?"rightNull":"leftNull",k=0,n=p[g[h+a]];if(n)for(q=v;0<=q&&q<e;)t=n.points[q],t||(q===v?b[f][d]=!0:c[q]&&(F=p[f].points[q])&&(k-=F[1]-F[0])),q+=l;b[f][1===a?"rightCliff":"leftCliff"]=k});else{for(q=v;0<=q&&q<e;){if(t=p[f].points[q]){k=t[1];break}q+=l}k=n.toPixels(k,!0);a.push({isNull:!0,plotX:r.toPixels(f,!0),plotY:k,yBottom:k})}})}return a},getGraphPath:function(a){var g=t.prototype.getGraphPath,r=this.options,n=r.stacking,
p=this.yAxis,b,k,v=[],B=[],e=this.index,c,l=p.stacks[this.stackKey],q=r.threshold,h=p.getThreshold(r.threshold),f,r=r.connectNulls||"percent"===n,u=function(b,f,g){var k=a[b];b=n&&l[k.x].points[e];var u=k[g+"Null"]||0;g=k[g+"Cliff"]||0;var m,r,k=!0;g||u?(m=(u?b[0]:b[1])+g,r=b[0]+g,k=!!u):!n&&a[f]&&a[f].isNull&&(m=r=q);void 0!==m&&(B.push({plotX:c,plotY:null===m?h:p.getThreshold(m),isNull:k}),v.push({plotX:c,plotY:null===r?h:p.getThreshold(r),doCurve:!1}))};a=a||this.points;n&&(a=this.getStackPoints());
for(b=0;b<a.length;b++)if(k=a[b].isNull,c=G(a[b].rectPlotX,a[b].plotX),f=G(a[b].yBottom,h),!k||r)r||u(b,b-1,"left"),k&&!n&&r||(B.push(a[b]),v.push({x:b,plotX:c,plotY:f})),r||u(b,b+1,"right");b=g.call(this,B,!0,!0);v.reversed=!0;k=g.call(this,v,!0,!0);k.length&&(k[0]="L");k=b.concat(k);g=g.call(this,B,!1,r);k.xMap=b.xMap;this.areaPath=k;return g},drawGraph:function(){this.areaPath=[];t.prototype.drawGraph.apply(this);var a=this,g=this.areaPath,r=this.options,n=[["area","highcharts-area",this.color,
r.fillColor]];y(this.zones,function(g,b){n.push(["zone-area-"+b,"highcharts-area highcharts-zone-area-"+b+" "+g.className,g.color||a.color,g.fillColor||r.fillColor])});y(n,function(n){var b=n[0],k=a[b];k?(k.endX=g.xMap,k.animate({d:g})):(k=a[b]=a.chart.renderer.path(g).addClass(n[1]).attr({fill:G(n[3],A(n[2]).setOpacity(G(r.fillOpacity,.75)).get()),zIndex:0}).add(a.group),k.isArea=!0);k.startX=g.xMap;k.shiftUnit=r.step?2:1})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(K);(function(a){var A=
a.extendClass,y=a.merge,E=a.pick,G=a.Series,t=a.seriesTypes;a.defaultPlotOptions.spline=y(a.defaultPlotOptions.line);t.spline=A(G,{type:"spline",getPointSpline:function(a,d,m){var r=d.plotX,n=d.plotY,p=a[m-1];m=a[m+1];var b,k,v,t;if(p&&!p.isNull&&!1!==p.doCurve&&m&&!m.isNull&&!1!==m.doCurve){a=p.plotY;v=m.plotX;m=m.plotY;var e=0;b=(1.5*r+p.plotX)/2.5;k=(1.5*n+a)/2.5;v=(1.5*r+v)/2.5;t=(1.5*n+m)/2.5;v!==b&&(e=(t-k)*(v-r)/(v-b)+n-t);k+=e;t+=e;k>a&&k>n?(k=Math.max(a,n),t=2*n-k):k<a&&k<n&&(k=Math.min(a,
n),t=2*n-k);t>m&&t>n?(t=Math.max(m,n),k=2*n-t):t<m&&t<n&&(t=Math.min(m,n),k=2*n-t);d.rightContX=v;d.rightContY=t}d=["C",E(p.rightContX,p.plotX),E(p.rightContY,p.plotY),E(b,r),E(k,n),r,n];p.rightContX=p.rightContY=null;return d}})})(K);(function(a){var A=a.seriesTypes.area.prototype,y=a.seriesType;y("areaspline","spline",a.defaultPlotOptions.area,{getStackPoints:A.getStackPoints,getGraphPath:A.getGraphPath,setStackCliffs:A.setStackCliffs,drawGraph:A.drawGraph,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(K);
(function(a){var A=a.animObject,y=a.color,E=a.each,G=a.extend,t=a.isNumber,g=a.merge,d=a.pick,m=a.Series,r=a.seriesType,n=a.stop,p=a.svg;r("column","line",{borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1,brightness:.1,shadow:!1},select:{color:"#cccccc",borderColor:"#000000",shadow:!1}},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(){m.prototype.init.apply(this,arguments);var a=this,d=a.chart;d.hasRendered&&E(d.series,function(d){d.type===a.type&&(d.isDirty=!0)})},getColumnMetrics:function(){var a=this,g=a.options,m=a.xAxis,n=a.yAxis,e=m.reversed,c,l={},q=0;!1===g.grouping?q=1:E(a.chart.series,function(e){var d=e.options,f=e.yAxis,h;e.type===a.type&&e.visible&&n.len===f.len&&n.pos===f.pos&&(d.stacking?(c=
e.stackKey,void 0===l[c]&&(l[c]=q++),h=l[c]):!1!==d.grouping&&(h=q++),e.columnIndex=h)});var h=Math.min(Math.abs(m.transA)*(m.ordinalSlope||g.pointRange||m.closestPointRange||m.tickInterval||1),m.len),f=h*g.groupPadding,u=(h-2*f)/q,g=Math.min(g.maxPointWidth||m.len,d(g.pointWidth,u*(1-2*g.pointPadding)));a.columnMetrics={width:g,offset:(u-g)/2+(f+((a.columnIndex||0)+(e?1:0))*u-h/2)*(e?-1:1)};return a.columnMetrics},crispCol:function(a,d,g,m){var e=this.chart,c=this.borderWidth,l=-(c%2?.5:0),c=c%2?
.5:1;e.inverted&&e.renderer.isVML&&(c+=1);g=Math.round(a+g)+l;a=Math.round(a)+l;m=Math.round(d+m)+c;l=.5>=Math.abs(d)&&.5<m;d=Math.round(d)+c;m-=d;l&&m&&(--d,m+=1);return{x:a,y:d,width:g-a,height:m}},translate:function(){var a=this,g=a.chart,n=a.options,p=a.dense=2>a.closestPointRange*a.xAxis.transA,p=a.borderWidth=d(n.borderWidth,p?0:1),e=a.yAxis,c=a.translatedThreshold=e.getThreshold(n.threshold),l=d(n.minPointLength,5),q=a.getColumnMetrics(),h=q.width,f=a.barW=Math.max(h,1+2*p),u=a.pointXOffset=
q.offset;g.inverted&&(c-=.5);n.pointPadding&&(f=Math.ceil(f));m.prototype.translate.apply(a);E(a.points,function(q){var m=d(q.yBottom,c),n=999+Math.abs(m),n=Math.min(Math.max(-n,q.plotY),e.len+n),p=q.plotX+u,r=f,t=Math.min(n,m),v,B=Math.max(n,m)-t;Math.abs(B)<l&&l&&(B=l,v=!e.reversed&&!q.negative||e.reversed&&q.negative,t=Math.abs(t-c)>l?m-l:c-(v?l:0));q.barX=p;q.pointWidth=h;q.tooltipPos=g.inverted?[e.len+e.pos-g.plotLeft-n,a.xAxis.len-p-r/2,B]:[p+r/2,n+e.pos-g.plotTop,B];q.shapeType="rect";q.shapeArgs=
a.crispCol.apply(a,q.isNull?[q.plotX,e.len/2,0,0]:[p,t,r,B])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},pointAttribs:function(a,d){var g=this.options,m,e,c=this.pointAttrToOptions||{};e=c.stroke||"borderColor";var l=c["stroke-width"]||"borderWidth",q=a&&a.color||this.color,h=g[e]||this.color||q,c=g.dashStyle,f;a&&this.zones.length&&(q=(m=a.getZone())&&m.color||a.options.color||
this.color);d&&(m=g.states[d],f=m.brightness,q=m.color||void 0!==f&&y(q).brighten(m.brightness).get()||q,h=m[e]||h,c=m.dashStyle||c);e={fill:q,stroke:h,"stroke-width":a[l]||g[l]||this[l]||0};g.borderRadius&&(e.r=g.borderRadius);c&&(e.dashstyle=c);return e},drawPoints:function(){var a=this,d=this.chart,m=a.options,p=d.renderer,e=m.animationLimit||250,c;E(a.points,function(l){var q=l.graphic;t(l.plotY)&&null!==l.y?(c=l.shapeArgs,q?(n(q),q[d.pointCount<e?"animate":"attr"](g(c))):l.graphic=q=p[l.shapeType](c).attr({"class":l.getClassName()}).add(l.group||
a.group),q.attr(a.pointAttribs(l,l.selected&&"select")).shadow(m.shadow,null,m.stacking&&!m.borderRadius)):q&&(l.graphic=q.destroy())})},animate:function(a){var d=this,g=this.yAxis,m=d.options,e=this.chart.inverted,c={};p&&(a?(c.scaleY=.001,a=Math.min(g.pos+g.len,Math.max(g.pos,g.toPixels(m.threshold))),e?c.translateX=a-g.len:c.translateY=a,d.group.attr(c)):(c[e?"translateX":"translateY"]=g.pos,d.group.animate(c,G(A(d.options.animation),{step:function(a,b){d.group.attr({scaleY:Math.max(.001,b.pos)})}})),
d.animate=null))},remove:function(){var a=this,d=a.chart;d.hasRendered&&E(d.series,function(d){d.type===a.type&&(d.isDirty=!0)});m.prototype.remove.apply(a,arguments)}})})(K);(function(a){a=a.seriesType;a("bar","column",null,{inverted:!0})})(K);(function(a){var A=a.Series;a=a.seriesType;a("scatter","line",{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 0.85em"> {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,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&A.prototype.drawGraph.call(this)}})})(K);(function(a){var A=a.pick,y=a.relativeLength;a.CenteredSeriesMixin={getCenter:function(){var a=this.options,G=this.chart,t=2*(a.slicedOffset||0),g=G.plotWidth-2*t,G=G.plotHeight-2*t,d=a.center,d=[A(d[0],"50%"),A(d[1],"50%"),a.size||"100%",a.innerSize||0],m=Math.min(g,G),r,
n;for(r=0;4>r;++r)n=d[r],a=2>r||2===r&&/%$/.test(n),d[r]=y(n,[g,G,m,d[2]][r])+(a?t:0);d[3]>d[2]&&(d[3]=d[2]);return d}}})(K);(function(a){var A=a.addEvent,y=a.defined,E=a.each,G=a.extend,t=a.inArray,g=a.noop,d=a.pick,m=a.Point,r=a.Series,n=a.seriesType,p=a.setAnimation;n("pie","line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,
slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0},borderColor:"#ffffff",borderWidth:1,states:{hover:{brightness:.1,shadow:!1}}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var d=this,g=d.points,m=d.startAngleRad;a||(E(g,function(a){var b=a.graphic,g=a.shapeArgs;b&&(b.attr({r:a.startR||d.center[3]/2,start:m,end:m}),b.animate({r:g.r,start:g.start,
end:g.end},d.options.animation))}),d.animate=null)},updateTotals:function(){var a,d=0,g=this.points,m=g.length,e,c=this.options.ignoreHiddenPoint;for(a=0;a<m;a++)e=g[a],0>e.y&&(e.y=null),d+=c&&!e.visible?0:e.y;this.total=d;for(a=0;a<m;a++)e=g[a],e.percentage=0<d&&(e.visible||!c)?e.y/d*100:0,e.total=d},generatePoints:function(){r.prototype.generatePoints.call(this);this.updateTotals()},translate:function(a){this.generatePoints();var g=0,m=this.options,n=m.slicedOffset,e=n+(m.borderWidth||0),c,l,q,
h=m.startAngle||0,f=this.startAngleRad=Math.PI/180*(h-90),h=(this.endAngleRad=Math.PI/180*(d(m.endAngle,h+360)-90))-f,u=this.points,p=m.dataLabels.distance,m=m.ignoreHiddenPoint,r,t=u.length,y;a||(this.center=a=this.getCenter());this.getX=function(c,e){q=Math.asin(Math.min((c-a[1])/(a[2]/2+p),1));return a[0]+(e?-1:1)*Math.cos(q)*(a[2]/2+p)};for(r=0;r<t;r++){y=u[r];c=f+g*h;if(!m||y.visible)g+=y.percentage/100;l=f+g*h;y.shapeType="arc";y.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*
c)/1E3,end:Math.round(1E3*l)/1E3};q=(l+c)/2;q>1.5*Math.PI?q-=2*Math.PI:q<-Math.PI/2&&(q+=2*Math.PI);y.slicedTranslation={translateX:Math.round(Math.cos(q)*n),translateY:Math.round(Math.sin(q)*n)};c=Math.cos(q)*a[2]/2;l=Math.sin(q)*a[2]/2;y.tooltipPos=[a[0]+.7*c,a[1]+.7*l];y.half=q<-Math.PI/2||q>Math.PI/2?1:0;y.angle=q;e=Math.min(e,p/5);y.labelPos=[a[0]+c+Math.cos(q)*p,a[1]+l+Math.sin(q)*p,a[0]+c+Math.cos(q)*e,a[1]+l+Math.sin(q)*e,a[0]+c,a[1]+l,0>p?"center":y.half?"right":"left",q]}},drawGraph:null,
drawPoints:function(){var a=this,d=a.chart.renderer,g,m,e,c,l=a.options.shadow;l&&!a.shadowGroup&&(a.shadowGroup=d.g("shadow").add(a.group));E(a.points,function(q){if(null!==q.y){m=q.graphic;c=q.shapeArgs;g=q.sliced?q.slicedTranslation:{};var h=q.shadowGroup;l&&!h&&(h=q.shadowGroup=d.g("shadow").add(a.shadowGroup));h&&h.attr(g);e=a.pointAttribs(q,q.selected&&"select");m?m.setRadialReference(a.center).attr(e).animate(G(c,g)):(q.graphic=m=d[q.shapeType](c).addClass(q.getClassName()).setRadialReference(a.center).attr(g).add(a.group),
q.visible||m.attr({visibility:"hidden"}),m.attr(e).attr({"stroke-linejoin":"round"}).shadow(l,h))}})},searchPoint:g,sortByAngle:function(a,d){a.sort(function(a,b){return void 0!==a.angle&&(b.angle-a.angle)*d})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:g},{init:function(){m.prototype.init.apply(this,arguments);var a=this,g;a.name=d(a.name,"Slice");g=function(d){a.slice("select"===d.type)};A(a,"select",g);A(a,"unselect",g);return a},setVisible:function(a,
g){var m=this,n=m.series,e=n.chart,c=n.options.ignoreHiddenPoint;g=d(g,c);a!==m.visible&&(m.visible=m.options.visible=a=void 0===a?!m.visible:a,n.options.data[t(m,n.data)]=m.options,E(["graphic","dataLabel","connector","shadowGroup"],function(c){if(m[c])m[c][a?"show":"hide"](!0)}),m.legendItem&&e.legend.colorizeItem(m,a),a||"hover"!==m.state||m.setState(""),c&&(n.isDirty=!0),g&&e.redraw())},slice:function(a,g,m){var n=this.series;p(m,n.chart);d(g,!0);this.sliced=this.options.sliced=a=y(a)?a:!this.sliced;
n.options.data[t(this,n.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 d=this.shapeArgs,g=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(g.plotLeft+d.x,g.plotTop+d.y,d.r+a,d.r+a,{innerR:this.shapeArgs.r,start:d.start,end:d.end})}})})(K);(function(a){var A=a.addEvent,y=a.arrayMax,E=a.defined,G=a.each,t=a.extend,g=a.format,d=a.map,
m=a.merge,r=a.noop,n=a.pick,p=a.relativeLength,b=a.Series,k=a.seriesTypes,v=a.stableSort,B=a.stop;a.distribute=function(a,b){function g(a,b){return a.target-b.target}var k,h=!0,f=a,m=[],n;n=0;for(k=a.length;k--;)n+=a[k].size;if(n>b){v(a,function(a,b){return(b.rank||0)-(a.rank||0)});for(n=k=0;n<=b;)n+=a[k].size,k++;m=a.splice(k-1,a.length)}v(a,g);for(a=d(a,function(a){return{size:a.size,targets:[a.target]}});h;){for(k=a.length;k--;)h=a[k],n=(Math.min.apply(0,h.targets)+Math.max.apply(0,h.targets))/
2,h.pos=Math.min(Math.max(0,n-h.size/2),b-h.size);k=a.length;for(h=!1;k--;)0<k&&a[k-1].pos+a[k-1].size>a[k].pos&&(a[k-1].size+=a[k].size,a[k-1].targets=a[k-1].targets.concat(a[k].targets),a[k-1].pos+a[k-1].size>b&&(a[k-1].pos=b-a[k-1].size),a.splice(k,1),h=!0)}k=0;G(a,function(a){var b=0;G(a.targets,function(){f[k].pos=a.pos+b;b+=f[k].size;k++})});f.push.apply(f,m);v(f,g)};b.prototype.drawDataLabels=function(){var a=this,b=a.options,d=b.dataLabels,k=a.points,h,f,u=a.hasRendered||0,p,r,v=n(d.defer,
!0),y=a.chart.renderer;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),r=a.plotGroup("dataLabelsGroup","data-labels",v&&!u?"hidden":"visible",d.zIndex||6),v&&(r.attr({opacity:+u}),u||A(a,"afterAnimate",function(){a.visible&&r.show(!0);r[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),f=d,G(k,function(k){var u,q=k.dataLabel,v,x,F=k.connector,B=!0,A,G={};h=k.dlOptions||k.options&&k.options.dataLabels;u=n(h&&h.enabled,f.enabled)&&null!==k.y;if(q&&!u)k.dataLabel=
q.destroy();else if(u){d=m(f,h);A=d.style;u=d.rotation;v=k.getLabelConfig();p=d.format?g(d.format,v):d.formatter.call(v,d);A.color=n(d.color,A.color,a.color,"#000000");if(q)E(p)?(q.attr({text:p}),B=!1):(k.dataLabel=q=q.destroy(),F&&(k.connector=F.destroy()));else if(E(p)){q={fill:d.backgroundColor,stroke:d.borderColor,"stroke-width":d.borderWidth,r:d.borderRadius||0,rotation:u,padding:d.padding,zIndex:1};"contrast"===A.color&&(G.color=d.inside||0>d.distance||b.stacking?y.getContrast(k.color||a.color):
"#000000");b.cursor&&(G.cursor=b.cursor);for(x in q)void 0===q[x]&&delete q[x];q=k.dataLabel=y[u?"text":"label"](p,0,-9999,d.shape,null,null,d.useHTML,null,"data-label").attr(q);q.addClass("highcharts-data-label-color-"+k.colorIndex+" "+(d.className||""));q.css(t(A,G));q.add(r);q.shadow(d.shadow)}q&&a.alignDataLabel(k,q,d,null,B)}})};b.prototype.alignDataLabel=function(a,b,d,g,h){var f=this.chart,k=f.inverted,m=n(a.plotX,-9999),p=n(a.plotY,-9999),r=b.getBBox(),v,y=d.rotation,w=d.align,A=this.visible&&
(a.series.forceDL||f.isInsidePlot(m,Math.round(p),k)||g&&f.isInsidePlot(m,k?g.x+1:g.y+g.height-1,k)),E="justify"===n(d.overflow,"justify");A&&(v=d.style.fontSize,v=f.renderer.fontMetrics(v,b).b,g=t({x:k?f.plotWidth-p:m,y:Math.round(k?f.plotHeight-m:p),width:0,height:0},g),t(d,{width:r.width,height:r.height}),y?(E=!1,k=f.renderer.rotCorr(v,y),k={x:g.x+d.x+g.width/2+k.x,y:g.y+d.y+{top:0,middle:.5,bottom:1}[d.verticalAlign]*g.height},b[h?"attr":"animate"](k).attr({align:w}),m=(y+720)%360,m=180<m&&360>
m,"left"===w?k.y-=m?r.height:0:"center"===w?(k.x-=r.width/2,k.y-=r.height/2):"right"===w&&(k.x-=r.width,k.y-=m?0:r.height)):(b.align(d,null,g),k=b.alignAttr),E?this.justifyDataLabel(b,d,k,r,g,h):n(d.crop,!0)&&(A=f.isInsidePlot(k.x,k.y)&&f.isInsidePlot(k.x+r.width,k.y+r.height)),d.shape&&!y&&b.attr({anchorX:a.plotX,anchorY:a.plotY}));A||(B(b),b.attr({y:-9999}),b.placed=!1)};b.prototype.justifyDataLabel=function(a,b,d,g,h,f){var k=this.chart,m=b.align,n=b.verticalAlign,p,r,t=a.box?0:a.padding||0;p=
d.x+t;0>p&&("right"===m?b.align="left":b.x=-p,r=!0);p=d.x+g.width-t;p>k.plotWidth&&("left"===m?b.align="right":b.x=k.plotWidth-p,r=!0);p=d.y+t;0>p&&("bottom"===n?b.verticalAlign="top":b.y=-p,r=!0);p=d.y+g.height-t;p>k.plotHeight&&("top"===n?b.verticalAlign="bottom":b.y=k.plotHeight-p,r=!0);r&&(a.placed=!f,a.align(b,null,h))};k.pie&&(k.pie.prototype.drawDataLabels=function(){var e=this,c=e.data,g,k=e.chart,h=e.options.dataLabels,f=n(h.connectorPadding,10),m=n(h.connectorWidth,1),p=k.plotWidth,r=k.plotHeight,
t,v=h.distance,C=e.center,w=C[2]/2,B=C[1],A=0<v,x,z,E,K,S=[[],[]],L,R,T,Q,P=[0,0,0,0];e.visible&&(h.enabled||e._hasPointLabels)&&(b.prototype.drawDataLabels.apply(e),G(c,function(a){a.dataLabel&&a.visible&&(S[a.half].push(a),a.dataLabel._pos=null)}),G(S,function(b,c){var m,n,u=b.length,t,y,F;if(u)for(e.sortByAngle(b,c-.5),0<v&&(m=Math.max(0,B-w-v),n=Math.min(B+w+v,k.plotHeight),t=d(b,function(a){if(a.dataLabel)return F=a.dataLabel.getBBox().height||21,{target:a.labelPos[1]-m+F/2,size:F,rank:a.y}}),
a.distribute(t,n+F-m)),Q=0;Q<u;Q++)g=b[Q],E=g.labelPos,x=g.dataLabel,T=!1===g.visible?"hidden":"inherit",y=E[1],t?void 0===t[Q].pos?T="hidden":(K=t[Q].size,R=m+t[Q].pos):R=y,L=h.justify?C[0]+(c?-1:1)*(w+v):e.getX(R<m+2||R>n-2?y:R,c),x._attr={visibility:T,align:E[6]},x._pos={x:L+h.x+({left:f,right:-f}[E[6]]||0),y:R+h.y-10},E.x=L,E.y=R,null===e.options.size&&(z=x.width,L-z<f?P[3]=Math.max(Math.round(z-L+f),P[3]):L+z>p-f&&(P[1]=Math.max(Math.round(L+z-p+f),P[1])),0>R-K/2?P[0]=Math.max(Math.round(-R+
K/2),P[0]):R+K/2>r&&(P[2]=Math.max(Math.round(R+K/2-r),P[2])))}),0===y(P)||this.verifyDataLabelOverflow(P))&&(this.placeDataLabels(),A&&m&&G(this.points,function(a){var b;t=a.connector;if((x=a.dataLabel)&&x._pos&&a.visible){T=x._attr.visibility;if(b=!t)a.connector=t=k.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex).add(e.dataLabelsGroup),t.attr({"stroke-width":m,stroke:h.connectorColor||a.color||"#666666"});t[b?"attr":"animate"]({d:e.connectorPath(a.labelPos)});
t.attr("visibility",T)}else t&&(a.connector=t.destroy())}))},k.pie.prototype.connectorPath=function(a){var b=a.x,d=a.y;return n(this.options.softConnector,!0)?["M",b+("left"===a[6]?5:-5),d,"C",b,d,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",b+("left"===a[6]?5:-5),d,"L",a[2],a[3],"L",a[4],a[5]]},k.pie.prototype.placeDataLabels=function(){G(this.points,function(a){var b=a.dataLabel;b&&a.visible&&((a=b._pos)?(b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999}))})},
k.pie.prototype.alignDataLabel=r,k.pie.prototype.verifyDataLabelOverflow=function(a){var b=this.center,d=this.options,g=d.center,h=d.minSize||80,f,k;null!==g[0]?f=Math.max(b[2]-Math.max(a[1],a[3]),h):(f=Math.max(b[2]-a[1]-a[3],h),b[0]+=(a[3]-a[1])/2);null!==g[1]?f=Math.max(Math.min(f,b[2]-Math.max(a[0],a[2])),h):(f=Math.max(Math.min(f,b[2]-a[0]-a[2]),h),b[1]+=(a[0]-a[2])/2);f<b[2]?(b[2]=f,b[3]=Math.min(p(d.innerSize||0,f),f),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):k=!0;return k});
k.column&&(k.column.prototype.alignDataLabel=function(a,c,d,g,h){var f=this.chart.inverted,k=a.series,p=a.dlBox||a.shapeArgs,r=n(a.below,a.plotY>n(this.translatedThreshold,k.yAxis.len)),t=n(d.inside,!!this.options.stacking);p&&(g=m(p),0>g.y&&(g.height+=g.y,g.y=0),p=g.y+g.height-k.yAxis.len,0<p&&(g.height-=p),f&&(g={x:k.yAxis.len-g.y-g.height,y:k.xAxis.len-g.x-g.width,width:g.height,height:g.width}),t||(f?(g.x+=r?0:g.width,g.width=0):(g.y+=r?g.height:0,g.height=0)));d.align=n(d.align,!f||t?"center":
r?"right":"left");d.verticalAlign=n(d.verticalAlign,f||t?"middle":r?"top":"bottom");b.prototype.alignDataLabel.call(this,a,c,d,g,h)})})(K);(function(a){var A=a.Chart,y=a.each,E=a.pick,G=a.addEvent;A.prototype.callbacks.push(function(a){function g(){var d=[];y(a.series,function(a){var g=a.options.dataLabels,n=a.dataLabelCollections||["dataLabel"];(g.enabled||a._hasPointLabels)&&!g.allowOverlap&&a.visible&&y(n,function(g){y(a.points,function(a){a[g]&&(a[g].labelrank=E(a.labelrank,a.shapeArgs&&a.shapeArgs.height),
d.push(a[g]))})})});a.hideOverlappingLabels(d)}g();G(a,"redraw",g)});A.prototype.hideOverlappingLabels=function(a){var g=a.length,d,m,r,n,p,b,k,v,B,e=function(a,b,d,e,f,g,k,m){return!(f>a+d||f+k<a||g>b+e||g+m<b)};for(m=0;m<g;m++)if(d=a[m])d.oldOpacity=d.opacity,d.newOpacity=1;a.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(m=0;m<g;m++)for(r=a[m],d=m+1;d<g;++d)if(n=a[d],r&&n&&r.placed&&n.placed&&0!==r.newOpacity&&0!==n.newOpacity&&(p=r.alignAttr,b=n.alignAttr,k=r.parentGroup,v=n.parentGroup,
B=2*(r.box?0:r.padding),p=e(p.x+k.translateX,p.y+k.translateY,r.width-B,r.height-B,b.x+v.translateX,b.y+v.translateY,n.width-B,n.height-B)))(r.labelrank<n.labelrank?r:n).newOpacity=0;y(a,function(a){var b,d;a&&(d=a.newOpacity,a.oldOpacity!==d&&a.placed&&(d?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=d,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(K);(function(a){var A=a.addEvent,y=a.Chart,E=a.createElement,G=a.css,t=a.defaultOptions,g=a.defaultPlotOptions,d=a.each,m=
a.extend,r=a.fireEvent,n=a.hasTouch,p=a.inArray,b=a.isObject,k=a.Legend,v=a.merge,B=a.pick,e=a.Point,c=a.Series,l=a.seriesTypes,q=a.svg;a=a.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,e=function(a){for(var c=a.target,d;c&&!d;)d=c.point,c=c.parentNode;if(void 0!==d&&d!==b.hoverPoint)d.onMouseOver(a)};d(a.points,function(a){a.graphic&&(a.graphic.element.point=a);a.dataLabel&&(a.dataLabel.element.point=a)});a._hasTracking||(d(a.trackerGroups,function(b){if(a[b]){a[b].addClass("highcharts-tracker").on("mouseover",
e).on("mouseout",function(a){c.onTrackerMouseOut(a)});if(n)a[b].on("touchstart",e);a.options.cursor&&a[b].css(G).css({cursor:a.options.cursor})}}),a._hasTracking=!0)},drawTrackerGraph:function(){var a=this,b=a.options,c=b.trackByArea,e=[].concat(c?a.areaPath:a.graphPath),g=e.length,k=a.chart,m=k.pointer,l=k.renderer,p=k.options.tooltip.snap,r=a.tracker,t,v=function(){if(k.hoverSeries!==a)a.onMouseOver()},y="rgba(192,192,192,"+(q?1E-4:.002)+")";if(g&&!c)for(t=g+1;t--;)"M"===e[t]&&e.splice(t+1,0,e[t+
1]-p,e[t+2],"L"),(t&&"M"===e[t]||t===g)&&e.splice(t,0,"L",e[t-2]+p,e[t-1]);r?r.attr({d:e}):a.graph&&(a.tracker=l.path(e).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:y,fill:c?y:"none","stroke-width":a.graph.strokeWidth()+(c?0:2*p),zIndex:2}).add(a.group),d([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",v).on("mouseout",function(a){m.onTrackerMouseOut(a)});b.cursor&&a.css({cursor:b.cursor});if(n)a.on("touchstart",v)}))}};l.column&&
(l.column.prototype.drawTracker=a.drawTrackerPoint);l.pie&&(l.pie.prototype.drawTracker=a.drawTrackerPoint);l.scatter&&(l.scatter.prototype.drawTracker=a.drawTrackerPoint);m(k.prototype,{setItemEvents:function(a,b,c){var d=this,e=d.chart,g="highcharts-legend-"+(a.series?"point":"series")+"-active";(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");e.seriesGroup.addClass(g);b.css(d.options.itemHoverStyle)}).on("mouseout",function(){b.css(a.visible?d.itemStyle:d.itemHiddenStyle);e.seriesGroup.removeClass(g);
a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible()};b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):r(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=E("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);A(a.checkbox,"click",function(b){r(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});t.legend.itemStyle.cursor=
"pointer";m(y.prototype,{showResetZoom:function(){var a=this,b=t.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,g="chart"===c.relativeTo?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}).addClass("highcharts-reset-zoom").add().align(c.position,!1,g)},zoomOut:function(){var a=this;r(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var c,e=this.pointer,
g=!1,k;!a||a.resetSelection?d(this.axes,function(a){c=a.zoom()}):d(a.xAxis.concat(a.yAxis),function(a){var b=a.axis,d=b.isXAxis;if(e[d?"zoomX":"zoomY"]||e[d?"pinchX":"pinchY"])c=b.zoom(a.min,a.max),b.displayBtn&&(g=!0)});k=this.resetZoomButton;g&&!k?this.showResetZoom():!g&&b(k)&&(this.resetZoomButton=k.destroy());c&&this.redraw(B(this.options.chart.animation,a&&a.animation,100>this.pointCount))},pan:function(a,b){var c=this,e=c.hoverPoints,g;e&&d(e,function(a){a.setState()});d("xy"===b?[1,0]:[1],
function(b){b=c[b?"xAxis":"yAxis"][0];var d=b.horiz,e=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",f=c[d],k=(b.pointRange||0)/2,m=b.getExtremes(),l=b.toValue(f-e,!0)+k,k=b.toValue(f+b.len-e,!0)-k,f=f>e;b.series.length&&(f||l>Math.min(m.dataMin,m.min))&&(!f||k<Math.max(m.dataMax,m.max))&&(b.setExtremes(l,k,!1,!1,{trigger:"pan"}),g=!0);c[d]=e});g&&c.redraw(!1);G(c.container,{cursor:"move"})}});m(e.prototype,{select:function(a,b){var c=this,e=c.series,g=e.chart;a=B(a,!c.selected);c.firePointEvent(a?
"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;e.options.data[p(c,e.data)]=c.options;c.setState(a&&"select");b||d(g.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,e.options.data[p(a,e.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},onMouseOver:function(a,b){var c=this.series,d=c.chart,e=d.tooltip,g=d.hoverPoint;if(d.hoverSeries!==c)c.onMouseOver();if(g&&g!==this)g.onMouseOut();this.series&&(this.firePointEvent("mouseOver"),
!e||e.shared&&!c.noSharedTooltip||e.refresh(this,a),this.setState("hover"),b||(d.hoverPoint=this))},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");b&&-1!==p(this,b)||(this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var a=v(this.series.options.point,this.options).events,b;this.events=a;for(b in a)A(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=Math.floor(this.plotX),d=this.plotY,e=this.series,
k=e.options.states[a]||{},l=g[e.type].marker&&e.options.marker||{},n=!1===l.enabled,p=l.states&&l.states[a]||{},q=!1===p.enabled,r=e.stateMarkerGraphic,t=this.marker||{},y=e.chart,A=e.halo;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===k.enabled||a&&(q||n&&!1===p.enabled)||a&&t.states&&t.states[a]&&!1===t.states[a].enabled)){l=p.radius||l.radius+(p.radiusPlus||0);if(this.graphic)this.state&&this.graphic.removeClass("highcharts-point-"+this.state),a&&this.graphic.addClass("highcharts-point-"+
a),c=l?{x:c-l,y:d-l,width:2*l,height:2*l}:{},c=v(e.pointAttribs(this,a),c),this.graphic.attr(c),r&&r.hide();else{if(a&&p){p=t.symbol||e.symbol;r&&r.currentSymbol!==p&&(r=r.destroy());if(r)r[b?"animate":"attr"]({x:c-l,y:d-l});else p&&(e.stateMarkerGraphic=r=y.renderer.symbol(p,c-l,d-l,2*l,2*l).add(e.markerGroup),r.currentSymbol=p);r&&r.attr(e.pointAttribs(this,a))}r&&(r[a&&y.isInsidePlot(c,d,y.inverted)?"show":"hide"](),r.element.point=this)}(k=k.halo)&&k.size?(A||(e.halo=A=y.renderer.path().add(y.seriesGroup)),
A[b?"animate":"attr"]({d:this.haloPath(k.size)}),A.attr({"class":"highcharts-halo highcharts-color-"+B(this.colorIndex,e.colorIndex)}),A.attr(m({fill:this.color||e.color,"fill-opacity":k.opacity,zIndex:-1},k.attributes))[b?"animate":"attr"]({d:this.haloPath(k.size)})):A&&A.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted,g=Math.floor(this.plotX);return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:g)-a,d.translateY+(e?b.xAxis.len-
g:this.plotY)-a,2*a,2*a)}});m(c.prototype,{onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(b&&b!==this)b.onMouseOut();this.options.events.mouseOver&&r(this,"mouseOver");this.setState("hover");a.hoverSeries=this},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;b.hoverSeries=null;if(d)d.onMouseOut();this&&a.events.mouseOut&&r(this,"mouseOut");!c||a.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();this.setState()},setState:function(a){var b=this,c=
b.options,e=b.graph,g=c.states,k=c.lineWidth,c=0;a=a||"";if(b.state!==a&&(d([b.group,b.markerGroup],function(c){c&&(b.state&&c.removeClass("highcharts-series-"+b.state),a&&c.addClass("highcharts-series-"+a))}),b.state=a,!g[a]||!1!==g[a].enabled)&&(a&&(k=g[a].lineWidth||k+(g[a].lineWidthPlus||0)),e&&!e.dashstyle))for(g={"stroke-width":k},e.attr(g);b["zone-graph-"+c];)b["zone-graph-"+c].attr(g),c+=1},setVisible:function(a,b){var c=this,e=c.chart,g=c.legendItem,k,l=e.options.chart.ignoreHiddenSeries,
m=c.visible;k=(c.visible=a=c.options.visible=c.userOptions.visible=void 0===a?!m:a)?"show":"hide";d(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][k]()});if(e.hoverSeries===c||(e.hoverPoint&&e.hoverPoint.series)===c)c.onMouseOut();g&&e.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&d(e.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});d(c.linkedSeries,function(b){b.setVisible(a,!1)});l&&(e.isDirtyBox=!0);!1!==b&&e.redraw();r(c,k)},show:function(){this.setVisible(!0)},
hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=void 0===a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);r(this,a?"select":"unselect")},drawTracker:a.drawTrackerGraph})})(K);(function(a){var A=a.Chart,y=a.each,E=a.inArray,G=a.isObject,t=a.pick,g=a.splat;A.prototype.setResponsive=function(a){var g=this.options.responsive;g&&g.rules&&y(g.rules,function(g){this.matchResponsiveRule(g,a)},this)};A.prototype.matchResponsiveRule=function(d,g){var r=this.respRules,n=d.condition,
p;p=d.callback||function(){return this.chartWidth<=t(n.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=t(n.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=t(n.minWidth,0)&&this.chartHeight>=t(n.minHeight,0)};void 0===d._id&&(d._id=a.idCounter++);p=p.call(this);!r[d._id]&&p?d.chartOptions&&(r[d._id]=this.currentOptions(d.chartOptions),this.update(d.chartOptions,g)):r[d._id]&&!p&&(this.update(r[d._id],g),delete r[d._id])};A.prototype.currentOptions=function(a){function m(a,d,b){var k,r;for(k in a)if(-1<
E(k,["series","xAxis","yAxis"]))for(a[k]=g(a[k]),b[k]=[],r=0;r<a[k].length;r++)b[k][r]={},m(a[k][r],d[k][r],b[k][r]);else G(a[k])?(b[k]={},m(a[k],d[k]||{},b[k])):b[k]=d[k]||null}var r={};m(a,this.options,r);return r}})(K);return K});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,47 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
3D features for Highcharts JS
@license: www.highcharts.com/license
*/
(function(u){"object"===typeof module&&module.exports?module.exports=u:u(Highcharts)})(function(u){(function(b){var r=b.deg2rad,l=b.pick;b.perspective=function(p,t,y){var h=t.options.chart.options3d,n=y?t.inverted:!1,k=t.plotWidth/2,f=t.plotHeight/2,c=h.depth/2,g=l(h.depth,1)*l(h.viewDistance,0),e=t.scale3d||1,a=r*h.beta*(n?-1:1),h=r*h.alpha*(n?-1:1),d=Math.cos(h),q=Math.cos(-a),z=Math.sin(h),A=Math.sin(-a);y||(k+=t.plotLeft,f+=t.plotTop);return b.map(p,function(a){var b,h;h=(n?a.y:a.x)-k;var l=(n?
a.x:a.y)-f,p=(a.z||0)-c;b=q*h-A*p;a=-z*A*h+d*l-q*z*p;h=d*A*h+z*l+d*q*p;l=0<g&&g<Number.POSITIVE_INFINITY?g/(h+c+g):1;b=b*l*e+k;a=a*l*e+f;return{x:n?a:b,y:n?b:a,z:h*e+c}})}})(u);(function(b){function r(a){var b=0,m,e;for(m=0;m<a.length;m++)e=(m+1)%a.length,b+=a[m].x*a[e].y-a[e].x*a[m].y;return b/2}function l(a){var b=0,m;for(m=0;m<a.length;m++)b+=a[m].z;return a.length?b/a.length:0}function p(a,b,m,e,d,f,E,h){var c=[],g=f-d;return f>d&&f-d>Math.PI/2+1E-4?(c=c.concat(p(a,b,m,e,d,d+Math.PI/2,E,h)),c=
c.concat(p(a,b,m,e,d+Math.PI/2,f,E,h))):f<d&&d-f>Math.PI/2+1E-4?(c=c.concat(p(a,b,m,e,d,d-Math.PI/2,E,h)),c=c.concat(p(a,b,m,e,d-Math.PI/2,f,E,h))):["C",a+m*Math.cos(d)-m*v*g*Math.sin(d)+E,b+e*Math.sin(d)+e*v*g*Math.cos(d)+h,a+m*Math.cos(f)+m*v*g*Math.sin(f)+E,b+e*Math.sin(f)-e*v*g*Math.cos(f)+h,a+m*Math.cos(f)+E,b+e*Math.sin(f)+h]}var t=Math.cos,y=Math.PI,h=Math.sin,n=b.animObject,k=b.charts,f=b.color,c=b.defined,g=b.deg2rad,e=b.each,a=b.extend,d=b.inArray,q=b.map,z=b.merge,A=b.perspective,u=b.pick,
D=b.SVGElement,C=b.SVGRenderer,w=b.wrap,v=4*(Math.sqrt(2)-1)/3/(y/2);w(C.prototype,"init",function(a){a.apply(this,[].slice.call(arguments,1));e([{name:"darker",slope:.6},{name:"brighter",slope:1.4}],function(a){this.definition({tagName:"filter",id:"highcharts-"+a.name,children:[{tagName:"feComponentTransfer",children:[{tagName:"feFuncR",type:"linear",slope:a.slope},{tagName:"feFuncG",type:"linear",slope:a.slope},{tagName:"feFuncB",type:"linear",slope:a.slope}]}]})},this)});C.prototype.toLinePath=
function(a,b){var m=[];e(a,function(a){m.push("L",a.x,a.y)});a.length&&(m[0]="M",b&&m.push("Z"));return m};C.prototype.cuboid=function(a){var e=this.g();a=this.cuboidPath(a);e.front=this.path(a[0]).attr({"class":"highcharts-3d-front",zIndex:a[3]}).add(e);e.top=this.path(a[1]).attr({"class":"highcharts-3d-top",zIndex:a[4]}).add(e);e.side=this.path(a[2]).attr({"class":"highcharts-3d-side",zIndex:a[5]}).add(e);e.fillSetter=function(a){this.front.attr({fill:a});this.top.attr({fill:f(a).brighten(.1).get()});
this.side.attr({fill:f(a).brighten(-.1).get()});this.color=a;return this};e.opacitySetter=function(a){this.front.attr({opacity:a});this.top.attr({opacity:a});this.side.attr({opacity:a});return this};e.attr=function(a){if(a.shapeArgs||c(a.x))a=this.renderer.cuboidPath(a.shapeArgs||a),this.front.attr({d:a[0],zIndex:a[3]}),this.top.attr({d:a[1],zIndex:a[4]}),this.side.attr({d:a[2],zIndex:a[5]});else return b.SVGElement.prototype.attr.call(this,a);return this};e.animate=function(a,e,b){c(a.x)&&c(a.y)?
(a=this.renderer.cuboidPath(a),this.front.attr({zIndex:a[3]}).animate({d:a[0]},e,b),this.top.attr({zIndex:a[4]}).animate({d:a[1]},e,b),this.side.attr({zIndex:a[5]}).animate({d:a[2]},e,b),this.attr({zIndex:-a[6]})):a.opacity?(this.front.animate(a,e,b),this.top.animate(a,e,b),this.side.animate(a,e,b)):D.prototype.animate.call(this,a,e,b);return this};e.destroy=function(){this.front.destroy();this.top.destroy();this.side.destroy();return null};e.attr({zIndex:-a[6]});return e};C.prototype.cuboidPath=
function(a){function e(a){return g[a]}var b=a.x,d=a.y,f=a.z,h=a.height,E=a.width,c=a.depth,g=[{x:b,y:d,z:f},{x:b+E,y:d,z:f},{x:b+E,y:d+h,z:f},{x:b,y:d+h,z:f},{x:b,y:d+h,z:f+c},{x:b+E,y:d+h,z:f+c},{x:b+E,y:d,z:f+c},{x:b,y:d,z:f+c}],g=A(g,k[this.chartIndex],a.insidePlotArea),f=function(a,b){var d=[];a=q(a,e);b=q(b,e);0>r(a)?d=a:0>r(b)&&(d=b);return d};a=f([3,2,1,0],[7,6,5,4]);b=[4,5,2,3];d=f([1,6,7,0],b);f=f([1,2,5,6],[0,7,4,3]);return[this.toLinePath(a,!0),this.toLinePath(d,!0),this.toLinePath(f,!0),
l(a),l(d),l(f),9E9*l(q(b,e))]};b.SVGRenderer.prototype.arc3d=function(b){function h(a){var b=!1,e={},f;for(f in a)-1!==d(f,k)&&(e[f]=a[f],delete a[f],b=!0);return b?e:!1}var m=this.g(),c=m.renderer,k="x y r innerR start end".split(" ");b=z(b);b.alpha*=g;b.beta*=g;m.top=c.path();m.side1=c.path();m.side2=c.path();m.inn=c.path();m.out=c.path();m.onAdd=function(){var a=m.parentGroup,b=m.attr("class");m.top.add(m);e(["out","inn","side1","side2"],function(e){m[e].addClass(b+" highcharts-3d-side").add(a)})};
m.setPaths=function(a){var b=m.renderer.arc3dPath(a),e=100*b.zTop;m.attribs=a;m.top.attr({d:b.top,zIndex:b.zTop});m.inn.attr({d:b.inn,zIndex:b.zInn});m.out.attr({d:b.out,zIndex:b.zOut});m.side1.attr({d:b.side1,zIndex:b.zSide1});m.side2.attr({d:b.side2,zIndex:b.zSide2});m.zIndex=e;m.attr({zIndex:e});a.center&&(m.top.setRadialReference(a.center),delete a.center)};m.setPaths(b);m.fillSetter=function(a){var b=f(a).brighten(-.1).get();this.fill=a;this.side1.attr({fill:b});this.side2.attr({fill:b});this.inn.attr({fill:b});
this.out.attr({fill:b});this.top.attr({fill:a});return this};e(["opacity","translateX","translateY","visibility"],function(a){m[a+"Setter"]=function(a,b){m[b]=a;e(["out","inn","side1","side2","top"],function(e){m[e].attr(b,a)})}});w(m,"attr",function(b,e,d){var f;"object"===typeof e&&(f=h(e))&&(a(m.attribs,f),m.setPaths(m.attribs));return b.call(this,e,d)});w(m,"animate",function(a,b,e,d){var f,m=this.attribs,c;delete b.center;delete b.z;delete b.depth;delete b.alpha;delete b.beta;c=n(u(e,this.renderer.globalAnimation));
if(c.duration){b=z(b);if(f=h(b))c.step=function(a,b){function e(a){return m[a]+(u(f[a],m[a])-m[a])*b.pos}b.elem.setPaths(z(m,{x:e("x"),y:e("y"),r:e("r"),innerR:e("innerR"),start:e("start"),end:e("end")}))};e=c}return a.call(this,b,e,d)});m.destroy=function(){this.top.destroy();this.out.destroy();this.inn.destroy();this.side1.destroy();this.side2.destroy();D.prototype.destroy.call(this)};m.hide=function(){this.top.hide();this.out.hide();this.inn.hide();this.side1.hide();this.side2.hide()};m.show=function(){this.top.show();
this.out.show();this.inn.show();this.side1.show();this.side2.show()};return m};C.prototype.arc3dPath=function(a){function b(a){a%=2*Math.PI;a>Math.PI&&(a=2*Math.PI-a);return a}var e=a.x,d=a.y,f=a.start,c=a.end-1E-5,g=a.r,k=a.innerR,l=a.depth,q=a.alpha,n=a.beta,z=Math.cos(f),r=Math.sin(f);a=Math.cos(c);var A=Math.sin(c),x=g*Math.cos(n),g=g*Math.cos(q),v=k*Math.cos(n),w=k*Math.cos(q),k=l*Math.sin(n),B=l*Math.sin(q),l=["M",e+x*z,d+g*r],l=l.concat(p(e,d,x,g,f,c,0,0)),l=l.concat(["L",e+v*a,d+w*A]),l=l.concat(p(e,
d,v,w,c,f,0,0)),l=l.concat(["Z"]),C=0<n?Math.PI/2:0,n=0<q?0:Math.PI/2,C=f>-C?f:c>-C?-C:f,u=c<y-n?c:f<y-n?y-n:c,D=2*y-n,q=["M",e+x*t(C),d+g*h(C)],q=q.concat(p(e,d,x,g,C,u,0,0));c>D&&f<D?(q=q.concat(["L",e+x*t(u)+k,d+g*h(u)+B]),q=q.concat(p(e,d,x,g,u,D,k,B)),q=q.concat(["L",e+x*t(D),d+g*h(D)]),q=q.concat(p(e,d,x,g,D,c,0,0)),q=q.concat(["L",e+x*t(c)+k,d+g*h(c)+B]),q=q.concat(p(e,d,x,g,c,D,k,B)),q=q.concat(["L",e+x*t(D),d+g*h(D)]),q=q.concat(p(e,d,x,g,D,u,0,0))):c>y-n&&f<y-n&&(q=q.concat(["L",e+x*Math.cos(u)+
k,d+g*Math.sin(u)+B]),q=q.concat(p(e,d,x,g,u,c,k,B)),q=q.concat(["L",e+x*Math.cos(c),d+g*Math.sin(c)]),q=q.concat(p(e,d,x,g,c,u,0,0)));q=q.concat(["L",e+x*Math.cos(u)+k,d+g*Math.sin(u)+B]);q=q.concat(p(e,d,x,g,u,C,k,B));q=q.concat(["Z"]);n=["M",e+v*z,d+w*r];n=n.concat(p(e,d,v,w,f,c,0,0));n=n.concat(["L",e+v*Math.cos(c)+k,d+w*Math.sin(c)+B]);n=n.concat(p(e,d,v,w,c,f,k,B));n=n.concat(["Z"]);z=["M",e+x*z,d+g*r,"L",e+x*z+k,d+g*r+B,"L",e+v*z+k,d+w*r+B,"L",e+v*z,d+w*r,"Z"];e=["M",e+x*a,d+g*A,"L",e+x*a+
k,d+g*A+B,"L",e+v*a+k,d+w*A+B,"L",e+v*a,d+w*A,"Z"];A=Math.atan2(B,-k);d=Math.abs(c+A);a=Math.abs(f+A);f=Math.abs((f+c)/2+A);d=b(d);a=b(a);f=b(f);f*=1E5;c=1E5*a;d*=1E5;return{top:l,zTop:1E5*Math.PI+1,out:q,zOut:Math.max(f,c,d),inn:n,zInn:Math.max(f,c,d),side1:z,zSide1:.99*d,side2:e,zSide2:.99*c}}})(u);(function(b){function r(b,c){var g=b.plotLeft,e=b.plotWidth+g,a=b.plotTop,d=b.plotHeight+a,h=g+b.plotWidth/2,k=a+b.plotHeight/2,n=Number.MAX_VALUE,l=-Number.MAX_VALUE,r=Number.MAX_VALUE,t=-Number.MAX_VALUE,
w,v=1;w=[{x:g,y:a,z:0},{x:g,y:a,z:c}];p([0,1],function(a){w.push({x:e,y:w[a].y,z:w[a].z})});p([0,1,2,3],function(a){w.push({x:w[a].x,y:d,z:w[a].z})});w=y(w,b,!1);p(w,function(a){n=Math.min(n,a.x);l=Math.max(l,a.x);r=Math.min(r,a.y);t=Math.max(t,a.y)});g>n&&(v=Math.min(v,1-Math.abs((g+h)/(n+h))%1));e<l&&(v=Math.min(v,(e-h)/(l-h)));a>r&&(v=0>r?Math.min(v,(a+k)/(-r+a+k)):Math.min(v,1-(a+k)/(r+k)%1));d<t&&(v=Math.min(v,Math.abs((d-k)/(t-k))));return v}var l=b.Chart,p=b.each,t=b.merge,y=b.perspective,
h=b.pick,n=b.wrap;l.prototype.is3d=function(){return this.options.chart.options3d&&this.options.chart.options3d.enabled};l.prototype.propsRequireDirtyBox.push("chart.options3d");l.prototype.propsRequireUpdateSeries.push("chart.options3d");b.wrap(b.Chart.prototype,"isInsidePlot",function(b){return this.is3d()||b.apply(this,[].slice.call(arguments,1))});var k=b.getOptions();t(!0,k,{chart:{options3d:{enabled:!1,alpha:0,beta:0,depth:100,fitToPlot:!0,viewDistance:25,frame:{bottom:{size:1},side:{size:1},
back:{size:1}}}},defs:{style:{textContent:k.defs.style.textContent+"\n.highcharts-3d-top{filter: url(#highcharts-brighter)}\n.highcharts-3d-side{filter: url(#highcharts-darker)}"}}});n(l.prototype,"setClassName",function(b){b.apply(this,[].slice.call(arguments,1));this.is3d()&&(this.container.className+=" highcharts-3d-chart")});b.wrap(b.Chart.prototype,"setChartSize",function(b){var c=this.options.chart.options3d;b.apply(this,[].slice.call(arguments,1));if(this.is3d()){var g=this.inverted,e=this.clipBox,
a=this.margin;e[g?"y":"x"]=-(a[3]||0);e[g?"x":"y"]=-(a[0]||0);e[g?"height":"width"]=this.chartWidth+(a[3]||0)+(a[1]||0);e[g?"width":"height"]=this.chartHeight+(a[0]||0)+(a[2]||0);this.scale3d=1;!0===c.fitToPlot&&(this.scale3d=r(this,c.depth))}});n(l.prototype,"redraw",function(b){this.is3d()&&(this.isDirtyBox=!0);b.apply(this,[].slice.call(arguments,1))});n(l.prototype,"renderSeries",function(b){var c=this.series.length;if(this.is3d())for(;c--;)b=this.series[c],b.translate(),b.render();else b.call(this)});
l.prototype.retrieveStacks=function(b){var c=this.series,g={},e,a=1;p(this.series,function(d){e=h(d.options.stack,b?0:c.length-1-d.index);g[e]?g[e].series.push(d):(g[e]={series:[d],position:a},a++)});g.totalStacks=a+1;return g}})(u);(function(b){var r,l=b.Axis,p=b.Chart,t=b.each,y=b.extend,h=b.merge,n=b.perspective,k=b.pick,f=b.splat,c=b.Tick,g=b.wrap;g(l.prototype,"setOptions",function(b,a){var d;b.call(this,a);this.chart.is3d()&&(d=this.options,d.tickWidth=k(d.tickWidth,0),d.gridLineWidth=k(d.gridLineWidth,
1))});g(l.prototype,"render",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var a=this.chart,d=a.renderer,c=a.options.chart.options3d,f=c.frame,g=f.bottom,h=f.back,f=f.side,k=c.depth,n=this.height,l=this.width,p=this.left,y=this.top;this.isZAxis||(this.horiz?(g={x:p,y:y+(a.xAxis[0].opposite?-g.size:n),z:0,width:l,height:g.size,depth:k,insidePlotArea:!1},this.bottomFrame?this.bottomFrame.animate(g):this.bottomFrame=d.cuboid(g).attr({"class":"highcharts-3d-frame highcharts-3d-frame-bottom",
zIndex:a.yAxis[0].reversed&&0<c.alpha?4:-1}).add()):(c={x:p+(a.yAxis[0].opposite?0:-f.size),y:y+(a.xAxis[0].opposite?-g.size:0),z:k,width:l+f.size,height:n+g.size,depth:h.size,insidePlotArea:!1},this.backFrame?this.backFrame.animate(c):this.backFrame=d.cuboid(c).attr({"class":"highcharts-3d-frame highcharts-3d-frame-back",zIndex:-3}).add(),a={x:p+(a.yAxis[0].opposite?l:-f.size),y:y+(a.xAxis[0].opposite?-g.size:0),z:0,width:f.size,height:n+g.size,depth:k,insidePlotArea:!1},this.sideFrame?this.sideFrame.animate(a):
this.sideFrame=d.cuboid(a).attr({"class":"highcharts-3d-frame highcharts-3d-frame-side",zIndex:-2}).add()))}});g(l.prototype,"getPlotLinePath",function(b){var a=b.apply(this,[].slice.call(arguments,1));if(!this.chart.is3d()||null===a)return a;var d=this.chart,c=d.options.chart.options3d,d=this.isZAxis?d.plotWidth:c.depth,c=this.opposite;this.horiz&&(c=!c);a=[this.swapZ({x:a[1],y:a[2],z:c?d:0}),this.swapZ({x:a[1],y:a[2],z:d}),this.swapZ({x:a[4],y:a[5],z:d}),this.swapZ({x:a[4],y:a[5],z:c?0:d})];a=n(a,
this.chart,!1);return a=this.chart.renderer.toLinePath(a,!1)});g(l.prototype,"getLinePath",function(b){return this.chart.is3d()?[]:b.apply(this,[].slice.call(arguments,1))});g(l.prototype,"getPlotBandPath",function(b){if(!this.chart.is3d())return b.apply(this,[].slice.call(arguments,1));var a=arguments,d=a[1],a=this.getPlotLinePath(a[2]);(d=this.getPlotLinePath(d))&&a?d.push("L",a[10],a[11],"L",a[7],a[8],"L",a[4],a[5],"L",a[1],a[2]):d=null;return d});g(c.prototype,"getMarkPath",function(b){var a=
b.apply(this,[].slice.call(arguments,1));if(!this.axis.chart.is3d())return a;a=[this.axis.swapZ({x:a[1],y:a[2],z:0}),this.axis.swapZ({x:a[4],y:a[5],z:0})];a=n(a,this.axis.chart,!1);return a=["M",a[0].x,a[0].y,"L",a[1].x,a[1].y]});g(c.prototype,"getLabelPosition",function(b){var a=b.apply(this,[].slice.call(arguments,1));this.axis.chart.is3d()&&(a=n([this.axis.swapZ({x:a.x,y:a.y,z:0})],this.axis.chart,!1)[0]);return a});b.wrap(l.prototype,"getTitlePosition",function(b){var a=this.chart.is3d(),d,c;
a&&(c=this.axisTitleMargin,this.axisTitleMargin=0);d=b.apply(this,[].slice.call(arguments,1));a&&(d=n([this.swapZ({x:d.x,y:d.y,z:0})],this.chart,!1)[0],d[this.horiz?"y":"x"]+=(this.horiz?1:-1)*(this.opposite?-1:1)*c,this.axisTitleMargin=c);return d});g(l.prototype,"drawCrosshair",function(b){var a=arguments;this.chart.is3d()&&a[2]&&(a[2]={plotX:a[2].plotXold||a[2].plotX,plotY:a[2].plotYold||a[2].plotY});b.apply(this,[].slice.call(a,1))});l.prototype.swapZ=function(b,a){if(this.isZAxis){var d=a?0:
this.chart.plotLeft,c=this.chart;return{x:d+(c.yAxis[0].opposite?b.z:c.xAxis[0].width-b.z),y:b.y,z:b.x-d}}return b};r=b.ZAxis=function(){this.isZAxis=!0;this.init.apply(this,arguments)};y(r.prototype,l.prototype);y(r.prototype,{setOptions:function(b){b=h({offset:0,lineWidth:0},b);l.prototype.setOptions.call(this,b);this.coll="zAxis"},setAxisSize:function(){l.prototype.setAxisSize.call(this);this.width=this.len=this.chart.options.chart.options3d.depth;this.right=this.chart.chartWidth-this.width-this.left},
getSeriesExtremes:function(){var b=this,a=b.chart;b.hasVisibleSeries=!1;b.dataMin=b.dataMax=b.ignoreMinPadding=b.ignoreMaxPadding=null;b.buildStacks&&b.buildStacks();t(b.series,function(d){if(d.visible||!a.options.chart.ignoreHiddenSeries)b.hasVisibleSeries=!0,d=d.zData,d.length&&(b.dataMin=Math.min(k(b.dataMin,d[0]),Math.min.apply(null,d)),b.dataMax=Math.max(k(b.dataMax,d[0]),Math.max.apply(null,d)))})}});g(p.prototype,"getAxes",function(b){var a=this,d=this.options,d=d.zAxis=f(d.zAxis||{});b.call(this);
a.is3d()&&(this.zAxis=[],t(d,function(b,d){b.index=d;b.isX=!0;(new r(a,b)).setScale()}))})})(u);(function(b){function r(b){if(this.chart.is3d()){var f=this.chart.options.plotOptions.column.grouping;void 0===f||f||void 0===this.group.zIndex||this.zIndexSet||(this.group.attr({zIndex:10*this.group.zIndex}),this.zIndexSet=!0)}b.apply(this,[].slice.call(arguments,1))}var l=b.each,p=b.perspective,t=b.pick,y=b.Series,h=b.seriesTypes,n=b.svg;b=b.wrap;b(h.column.prototype,"translate",function(b){b.apply(this,
[].slice.call(arguments,1));if(this.chart.is3d()){var f=this.chart,c=this.options,g=c.depth||25,e=(c.stacking?c.stack||0:this._i)*(g+(c.groupZPadding||1));!1!==c.grouping&&(e=0);e+=c.groupZPadding||1;l(this.data,function(a){if(null!==a.y){var b=a.shapeArgs,c=a.tooltipPos;a.shapeType="cuboid";b.z=e;b.depth=g;b.insidePlotArea=!0;c=p([{x:c[0],y:c[1],z:e}],f,!0)[0];a.tooltipPos=[c.x,c.y]}});this.z=e}});b(h.column.prototype,"animate",function(b){if(this.chart.is3d()){var f=arguments[1],c=this.yAxis,g=
this,e=this.yAxis.reversed;n&&(f?l(g.data,function(a){null!==a.y&&(a.height=a.shapeArgs.height,a.shapey=a.shapeArgs.y,a.shapeArgs.height=1,e||(a.shapeArgs.y=a.stackY?a.plotY+c.translate(a.stackY):a.plotY+(a.negative?-a.height:a.height)))}):(l(g.data,function(a){null!==a.y&&(a.shapeArgs.height=a.height,a.shapeArgs.y=a.shapey,a.graphic&&a.graphic.animate(a.shapeArgs,g.options.animation))}),this.drawDataLabels(),g.animate=null))}else b.apply(this,[].slice.call(arguments,1))});b(h.column.prototype,"init",
function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var f=this.options,c=f.grouping,g=f.stacking,e=t(this.yAxis.options.reversedStacks,!0),a=0;if(void 0===c||c){c=this.chart.retrieveStacks(g);a=f.stack||0;for(g=0;g<c[a].series.length&&c[a].series[g]!==this;g++);a=10*(c.totalStacks-c[a].position)+(e?g:-g);this.xAxis.reversed||(a=10*c.totalStacks-a)}f.zIndex=a}});b(y.prototype,"alignDataLabel",function(b){if(this.chart.is3d()&&("column"===this.type||"columnrange"===this.type)){var f=
arguments[4],c={x:f.x,y:f.y,z:this.z},c=p([c],this.chart,!0)[0];f.x=c.x;f.y=c.y}b.apply(this,[].slice.call(arguments,1))});h.columnrange&&b(h.columnrange.prototype,"drawPoints",r);b(h.column.prototype,"drawPoints",r)})(u);(function(b){var r=b.deg2rad,l=b.each,p=b.seriesTypes,t=b.svg;b=b.wrap;b(p.pie.prototype,"translate",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var h=this,n=h.options,k=n.depth||0,f=h.chart.options.chart.options3d,c=f.alpha,g=f.beta,e=n.stacking?(n.stack||
0)*k:h._i*k,e=e+k/2;!1!==n.grouping&&(e=0);l(h.data,function(a){var b=a.shapeArgs;a.shapeType="arc3d";b.z=e;b.depth=.75*k;b.alpha=c;b.beta=g;b.center=h.center;b=(b.end+b.start)/2;a.slicedTranslation={translateX:Math.round(Math.cos(b)*n.slicedOffset*Math.cos(c*r)),translateY:Math.round(Math.sin(b)*n.slicedOffset*Math.cos(c*r))}})}});b(p.pie.prototype.pointClass.prototype,"haloPath",function(b){var h=arguments;return this.series.chart.is3d()?[]:b.call(this,h[1])});b(p.pie.prototype,"drawPoints",function(b){b.apply(this,
[].slice.call(arguments,1));this.chart.is3d()&&l(this.points,function(b){var n=b.graphic;if(n)n[b.y&&b.visible?"show":"hide"]()})});b(p.pie.prototype,"drawDataLabels",function(b){if(this.chart.is3d()){var h=this.chart.options.chart.options3d;l(this.data,function(b){var k=b.shapeArgs,f=k.r,c=(k.start+k.end)/2,g=b.labelPos,e=-f*(1-Math.cos((k.alpha||h.alpha)*r))*Math.sin(c),a=f*(Math.cos((k.beta||h.beta)*r)-1)*Math.cos(c);l([0,2,4],function(b){g[b]+=a;g[b+1]+=e})})}b.apply(this,[].slice.call(arguments,
1))});b(p.pie.prototype,"addPoint",function(b){b.apply(this,[].slice.call(arguments,1));this.chart.is3d()&&this.update(this.userOptions,!0)});b(p.pie.prototype,"animate",function(b){if(this.chart.is3d()){var h=arguments[1],n=this.options.animation,k=this.center,f=this.group,c=this.markerGroup;t&&(!0===n&&(n={}),h?(f.oldtranslateX=f.translateX,f.oldtranslateY=f.translateY,h={translateX:k[0],translateY:k[1],scaleX:.001,scaleY:.001},f.attr(h),c&&(c.attrSetters=f.attrSetters,c.attr(h))):(h={translateX:f.oldtranslateX,
translateY:f.oldtranslateY,scaleX:1,scaleY:1},f.animate(h,n),c&&c.animate(h,n),this.animate=null))}else b.apply(this,[].slice.call(arguments,1))})})(u);(function(b){var r=b.perspective,l=b.pick,p=b.seriesTypes;b=b.wrap;b(p.scatter.prototype,"translate",function(b){b.apply(this,[].slice.call(arguments,1));if(this.chart.is3d()){var p=this.chart,h=l(this.zAxis,p.options.zAxis[0]),n=[],k,f,c;for(c=0;c<this.data.length;c++)k=this.data[c],f=h.isLog&&h.val2lin?h.val2lin(k.z):k.z,k.plotZ=h.translate(f),k.isInside=
k.isInside?f>=h.min&&f<=h.max:!1,n.push({x:k.plotX,y:k.plotY,z:k.plotZ});p=r(n,p,!0);for(c=0;c<this.data.length;c++)k=this.data[c],h=p[c],k.plotXold=k.plotX,k.plotYold=k.plotY,k.plotZold=k.plotZ,k.plotX=h.x,k.plotY=h.y,k.plotZ=h.z}});b(p.scatter.prototype,"init",function(b,l,h){l.is3d()&&(this.axisTypes=["xAxis","yAxis","zAxis"],this.pointArrayMap=["x","y","z"],this.parallelArrays=["x","y","z"],this.directTouch=!0);b=b.apply(this,[l,h]);this.chart.is3d()&&(this.tooltipOptions.pointFormat=this.userOptions.tooltip?
this.userOptions.tooltip.pointFormat||"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>":"x: <b>{point.x}</b><br/>y: <b>{point.y}</b><br/>z: <b>{point.z}</b><br/>");return b})})(u)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,56 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(v){"object"===typeof module&&module.exports?module.exports=v:v(Highcharts)})(function(v){(function(a){function f(a,b,h){this.init(a,b,h)}var n=a.each,q=a.extend,l=a.merge,r=a.splat;q(f.prototype,{init:function(a,b,h){var d=this,p=d.defaultOptions;d.chart=b;d.options=a=l(p,b.angular?{background:{}}:void 0,a);(a=a.background)&&n([].concat(r(a)).reverse(),function(b){var c=h.userOptions;b=l(d.defaultBackgroundOptions,b);h.options.plotBands.unshift(b);c.plotBands=c.plotBands||[];c.plotBands!==
h.options.plotBands&&c.plotBands.unshift(b)})},defaultOptions:{center:["50%","50%"],size:"85%",startAngle:0},defaultBackgroundOptions:{className:"highcharts-pane",shape:"circle",from:-Number.MAX_VALUE,innerRadius:0,to:Number.MAX_VALUE,outerRadius:"105%"}});a.Pane=f})(v);(function(a){var f=a.CenteredSeriesMixin,n=a.each,q=a.extend,l=a.map,r=a.merge,k=a.noop,b=a.Pane,h=a.pick,d=a.pInt,p=a.splat,g=a.wrap,c,e,m=a.Axis.prototype;a=a.Tick.prototype;c={getOffset:k,redraw:function(){this.isDirty=!1},render:function(){this.isDirty=
!1},setScale:k,setCategories:k,setTitle:k};e={defaultRadialGaugeOptions:{labels:{align:"center",x:0,y:null},minorGridLineWidth:0,minorTickInterval:"auto",minorTickLength:10,minorTickPosition:"inside",minorTickWidth:1,tickLength:10,tickPosition:"inside",tickWidth:2,title:{rotation:0},zIndex:2},defaultRadialXOptions:{gridLineWidth:1,labels:{align:null,distance:15,x:0,y:null},maxPadding:0,minPadding:0,showLastLabel:!1,tickLength:0},defaultRadialYOptions:{gridLineInterpolation:"circle",labels:{align:"right",
x:-3,y:-2},showLastLabel:!1,title:{x:4,text:null,rotation:90}},setOptions:function(c){c=this.options=r(this.defaultOptions,this.defaultRadialOptions,c);c.plotBands||(c.plotBands=[])},getOffset:function(){m.getOffset.call(this);this.chart.axisOffset[this.side]=0;this.center=this.pane.center=f.getCenter.call(this.pane)},getLinePath:function(c,d){var b=this.center,e,a=this.chart;e=h(d,b[2]/2-this.offset);this.isCircular||void 0!==d?b=this.chart.renderer.symbols.arc(this.left+b[0],this.top+b[1],e,e,{start:this.startAngleRad,
end:this.endAngleRad,open:!0,innerR:0}):(e=this.postTranslate(this.angleRad,e),b=["M",b[0]+a.plotLeft,b[1]+a.plotTop,"L",e.x,e.y]);return b},setAxisTranslation:function(){m.setAxisTranslation.call(this);this.center&&(this.transA=this.isCircular?(this.endAngleRad-this.startAngleRad)/(this.max-this.min||1):this.center[2]/2/(this.max-this.min||1),this.minPixelPadding=this.isXAxis?this.transA*this.minPointOffset:0)},beforeSetTickPositions:function(){if(this.autoConnect=this.isCircular&&void 0===h(this.userMax,
this.options.max)&&this.endAngleRad-this.startAngleRad===2*Math.PI)this.max+=this.categories&&1||this.pointRange||this.closestPointRange||0},setAxisSize:function(){m.setAxisSize.call(this);this.isRadial&&(this.center=this.pane.center=f.getCenter.call(this.pane),this.isCircular&&(this.sector=this.endAngleRad-this.startAngleRad),this.len=this.width=this.height=this.center[2]*h(this.sector,1)/2)},getPosition:function(c,b){return this.postTranslate(this.isCircular?this.translate(c):this.angleRad,h(this.isCircular?
b:this.translate(c),this.center[2]/2)-this.offset)},postTranslate:function(c,b){var d=this.chart,h=this.center;c=this.startAngleRad+c;return{x:d.plotLeft+h[0]+Math.cos(c)*b,y:d.plotTop+h[1]+Math.sin(c)*b}},getPlotBandPath:function(c,b,e){var a=this.center,m=this.startAngleRad,p=a[2]/2,g=[h(e.outerRadius,"100%"),e.innerRadius,h(e.thickness,10)],r=Math.min(this.offset,0),k=/%$/,f,n=this.isCircular;"polygon"===this.options.gridLineInterpolation?a=this.getPlotLinePath(c).concat(this.getPlotLinePath(b,
!0)):(c=Math.max(c,this.min),b=Math.min(b,this.max),n||(g[0]=this.translate(c),g[1]=this.translate(b)),g=l(g,function(c){k.test(c)&&(c=d(c,10)*p/100);return c}),"circle"!==e.shape&&n?(c=m+this.translate(c),b=m+this.translate(b)):(c=-Math.PI/2,b=1.5*Math.PI,f=!0),g[0]-=r,g[2]-=r,a=this.chart.renderer.symbols.arc(this.left+a[0],this.top+a[1],g[0],g[0],{start:Math.min(c,b),end:Math.max(c,b),innerR:h(g[1],g[0]-g[2]),open:f}));return a},getPlotLinePath:function(c,b){var d=this,h=d.center,e=d.chart,a=d.getPosition(c),
g,m,p;d.isCircular?p=["M",h[0]+e.plotLeft,h[1]+e.plotTop,"L",a.x,a.y]:"circle"===d.options.gridLineInterpolation?(c=d.translate(c))&&(p=d.getLinePath(0,c)):(n(e.xAxis,function(c){c.pane===d.pane&&(g=c)}),p=[],c=d.translate(c),h=g.tickPositions,g.autoConnect&&(h=h.concat([h[0]])),b&&(h=[].concat(h).reverse()),n(h,function(b,d){m=g.getPosition(b,c);p.push(d?"L":"M",m.x,m.y)}));return p},getTitlePosition:function(){var c=this.center,b=this.chart,d=this.options.title;return{x:b.plotLeft+c[0]+(d.x||0),
y:b.plotTop+c[1]-{high:.5,middle:.25,low:0}[d.align]*c[2]+(d.y||0)}}};g(m,"init",function(d,a,g){var m=a.angular,z=a.polar,x=g.isX,l=m&&x,f,k=a.options,n=g.pane||0;if(m){if(q(this,l?c:e),f=!x)this.defaultRadialOptions=this.defaultRadialGaugeOptions}else z&&(q(this,e),this.defaultRadialOptions=(f=x)?this.defaultRadialXOptions:r(this.defaultYAxisOptions,this.defaultRadialYOptions));m||z?(this.isRadial=!0,a.inverted=!1,k.chart.zoomType=null):this.isRadial=!1;d.call(this,a,g);l||!m&&!z||(d=this.options,
a.panes||(a.panes=[]),this.pane=a=a.panes[n]=a.panes[n]||new b(p(k.pane)[n],a,this),a=a.options,this.angleRad=(d.angle||0)*Math.PI/180,this.startAngleRad=(a.startAngle-90)*Math.PI/180,this.endAngleRad=(h(a.endAngle,a.startAngle+360)-90)*Math.PI/180,this.offset=d.offset||0,this.isCircular=f)});g(m,"autoLabelAlign",function(c){if(!this.isRadial)return c.apply(this,[].slice.call(arguments,1))});g(a,"getPosition",function(c,d,b,h,e){var a=this.axis;return a.getPosition?a.getPosition(b):c.call(this,d,
b,h,e)});g(a,"getLabelPosition",function(c,b,d,e,a,g,m,p,r){var l=this.axis,f=g.y,k=20,n=g.align,q=(l.translate(this.pos)+l.startAngleRad+Math.PI/2)/Math.PI*180%360;l.isRadial?(c=l.getPosition(this.pos,l.center[2]/2+h(g.distance,-25)),"auto"===g.rotation?e.attr({rotation:q}):null===f&&(f=l.chart.renderer.fontMetrics(e.styles.fontSize).b-e.getBBox().height/2),null===n&&(l.isCircular?(this.label.getBBox().width>l.len*l.tickInterval/(l.max-l.min)&&(k=0),n=q>k&&q<180-k?"left":q>180+k&&q<360-k?"right":
"center"):n="center",e.attr({align:n})),c.x+=g.x,c.y+=f):c=c.call(this,b,d,e,a,g,m,p,r);return c});g(a,"getMarkPath",function(c,b,d,h,e,a,g){var m=this.axis;m.isRadial?(c=m.getPosition(this.pos,m.center[2]/2+h),b=["M",b,d,"L",c.x,c.y]):b=c.call(this,b,d,h,e,a,g);return b})})(v);(function(a){var f=a.each,n=a.noop,q=a.pick,l=a.Series,r=a.seriesType,k=a.seriesTypes;r("arearange","area",{marker:null,threshold:null,tooltip:{pointFormat:'<span class="highcharts-color-{series.colorIndex}">\u25cf</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},
trackByArea:!0,dataLabels:{align:null,verticalAlign:null,xLow:0,xHigh:0,yLow:0,yHigh:0},states:{hover:{halo:!1}}},{pointArrayMap:["low","high"],dataLabelCollections:["dataLabel","dataLabelUpper"],toYData:function(b){return[b.low,b.high]},pointValKey:"low",deferTranslatePolar:!0,highToXY:function(b){var h=this.chart,d=this.xAxis.postTranslate(b.rectPlotX,this.yAxis.len-b.plotHigh);b.plotHighX=d.x-h.plotLeft;b.plotHigh=d.y-h.plotTop},translate:function(){var b=this,h=b.yAxis;k.area.prototype.translate.apply(b);
f(b.points,function(b){var a=b.low,g=b.high,c=b.plotY;null===g||null===a?b.isNull=!0:(b.plotLow=c,b.plotHigh=h.translate(g,0,1,0,1))});this.chart.polar&&f(this.points,function(d){b.highToXY(d)})},getGraphPath:function(b){var h=[],d=[],a,g=k.area.prototype.getGraphPath,c,e,m;m=this.options;var u=m.step;b=b||this.points;for(a=b.length;a--;)c=b[a],c.isNull||m.connectEnds||b[a+1]&&!b[a+1].isNull||d.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1}),e={polarPlotY:c.polarPlotY,rectPlotX:c.rectPlotX,yBottom:c.yBottom,
plotX:q(c.plotHighX,c.plotX),plotY:c.plotHigh,isNull:c.isNull},d.push(e),h.push(e),c.isNull||m.connectEnds||b[a-1]&&!b[a-1].isNull||d.push({plotX:c.plotX,plotY:c.plotY,doCurve:!1});b=g.call(this,b);u&&(!0===u&&(u="left"),m.step={left:"right",center:"center",right:"left"}[u]);h=g.call(this,h);d=g.call(this,d);m.step=u;m=[].concat(b,h);this.chart.polar||"M"!==d[0]||(d[0]="L");this.graphPath=m;this.areaPath=this.areaPath.concat(b,d);m.isArea=!0;m.xMap=b.xMap;this.areaPath.xMap=b.xMap;return m},drawDataLabels:function(){var b=
this.data,a=b.length,d,p=[],g=l.prototype,c=this.options.dataLabels,e=c.align,m=c.verticalAlign,u=c.inside,t,w,r=this.chart.inverted;if(c.enabled||this._hasPointLabels){for(d=a;d--;)if(t=b[d])w=u?t.plotHigh<t.plotLow:t.plotHigh>t.plotLow,t.y=t.high,t._plotY=t.plotY,t.plotY=t.plotHigh,p[d]=t.dataLabel,t.dataLabel=t.dataLabelUpper,t.below=w,r?e||(c.align=w?"right":"left"):m||(c.verticalAlign=w?"top":"bottom"),c.x=c.xHigh,c.y=c.yHigh;g.drawDataLabels&&g.drawDataLabels.apply(this,arguments);for(d=a;d--;)if(t=
b[d])w=u?t.plotHigh<t.plotLow:t.plotHigh>t.plotLow,t.dataLabelUpper=t.dataLabel,t.dataLabel=p[d],t.y=t.low,t.plotY=t._plotY,t.below=!w,r?e||(c.align=w?"left":"right"):m||(c.verticalAlign=w?"bottom":"top"),c.x=c.xLow,c.y=c.yLow;g.drawDataLabels&&g.drawDataLabels.apply(this,arguments)}c.align=e;c.verticalAlign=m},alignDataLabel:function(){k.column.prototype.alignDataLabel.apply(this,arguments)},setStackedPoints:n,getSymbol:n,drawPoints:n})})(v);(function(a){var f=a.seriesType;f("areasplinerange","arearange",
null,{getPointSpline:a.seriesTypes.spline.prototype.getPointSpline})})(v);(function(a){var f=a.defaultPlotOptions,n=a.each,q=a.merge,l=a.noop,r=a.pick,k=a.seriesType,b=a.seriesTypes.column.prototype;k("columnrange","arearange",q(f.column,f.arearange,{lineWidth:1,pointRange:null}),{translate:function(){var a=this,d=a.yAxis,p=a.xAxis,g=p.startAngleRad,c,e=a.chart,m=a.xAxis.isRadial,u;b.translate.apply(a);n(a.points,function(b){var w=b.shapeArgs,l=a.options.minPointLength,k,f;b.plotHigh=u=d.translate(b.high,
0,1,0,1);b.plotLow=b.plotY;f=u;k=r(b.rectPlotY,b.plotY)-u;Math.abs(k)<l?(l-=k,k+=l,f-=l/2):0>k&&(k*=-1,f-=k);m?(c=b.barX+g,b.shapeType="path",b.shapeArgs={d:a.polarArc(f+k,f,c,c+b.pointWidth)}):(w.height=k,w.y=f,b.tooltipPos=e.inverted?[d.len+d.pos-e.plotLeft-f-k/2,p.len+p.pos-e.plotTop-w.x-w.width/2,k]:[p.left-e.plotLeft+w.x+w.width/2,d.pos-e.plotTop+f+k/2,k])})},directTouch:!0,trackerGroups:["group","dataLabelsGroup"],drawGraph:l,crispCol:b.crispCol,drawPoints:b.drawPoints,drawTracker:b.drawTracker,
getColumnMetrics:b.getColumnMetrics,animate:function(){return b.animate.apply(this,arguments)},polarArc:function(){return b.polarArc.apply(this,arguments)},pointAttribs:b.pointAttribs})})(v);(function(a){var f=a.each,n=a.isNumber,q=a.merge,l=a.pick,r=a.pInt,k=a.Series,b=a.seriesType,h=a.TrackerMixin;b("gauge","line",{dataLabels:{enabled:!0,defer:!1,y:15,borderRadius:3,crop:!1,verticalAlign:"top",zIndex:2},dial:{},pivot:{},tooltip:{headerFormat:""},showInLegend:!1},{angular:!0,directTouch:!0,drawGraph:a.noop,
fixedBox:!0,forceDL:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],translate:function(){var b=this.yAxis,a=this.options,h=b.center;this.generatePoints();f(this.points,function(c){var e=q(a.dial,c.dial),m=r(l(e.radius,80))*h[2]/200,u=r(l(e.baseLength,70))*m/100,t=r(l(e.rearLength,10))*m/100,w=e.baseWidth||3,k=e.topWidth||1,f=a.overshoot,x=b.startAngleRad+b.translate(c.y,null,null,null,!0);n(f)?(f=f/180*Math.PI,x=Math.max(b.startAngleRad-f,Math.min(b.endAngleRad+f,x))):!1===a.wrap&&
(x=Math.max(b.startAngleRad,Math.min(b.endAngleRad,x)));x=180*x/Math.PI;c.shapeType="path";c.shapeArgs={d:e.path||["M",-t,-w/2,"L",u,-w/2,m,-k/2,m,k/2,u,w/2,-t,w/2,"z"],translateX:h[0],translateY:h[1],rotation:x};c.plotX=h[0];c.plotY=h[1]})},drawPoints:function(){var b=this,a=b.yAxis.center,h=b.pivot,c=b.options,e=c.pivot,m=b.chart.renderer;f(b.points,function(a){var h=a.graphic,e=a.shapeArgs,g=e.d;q(c.dial,a.dial);h?(h.animate(e),e.d=g):a.graphic=m[a.shapeType](e).attr({rotation:e.rotation,zIndex:1}).addClass("highcharts-dial").add(b.group)});
h?h.animate({translateX:a[0],translateY:a[1]}):b.pivot=m.circle(0,0,l(e.radius,5)).attr({zIndex:2}).addClass("highcharts-pivot").translate(a[0],a[1]).add(b.group)},animate:function(b){var a=this;b||(f(a.points,function(b){var c=b.graphic;c&&(c.attr({rotation:180*a.yAxis.startAngleRad/Math.PI}),c.animate({rotation:b.shapeArgs.rotation},a.options.animation))}),a.animate=null)},render:function(){this.group=this.plotGroup("group","series",this.visible?"visible":"hidden",this.options.zIndex,this.chart.seriesGroup);
k.prototype.render.call(this);this.group.clip(this.chart.clipRect)},setData:function(b,a){k.prototype.setData.call(this,b,!1);this.processData();this.generatePoints();l(a,!0)&&this.chart.redraw()},drawTracker:h&&h.drawTrackerPoint},{setState:function(b){this.state=b}})})(v);(function(a){var f=a.each,n=a.noop,q=a.seriesType,l=a.seriesTypes;q("boxplot","column",{threshold:null,tooltip:{pointFormat:'<span class="highcharts-color-{point.colorIndex}">\u25cf</span> <b> {series.name}</b><br/>Maximum: {point.high}<br/>Upper quartile: {point.q3}<br/>Median: {point.median}<br/>Lower quartile: {point.q1}<br/>Minimum: {point.low}<br/>'},
whiskerLength:"50%"},{pointArrayMap:["low","q1","median","q3","high"],toYData:function(a){return[a.low,a.q1,a.median,a.q3,a.high]},pointValKey:"high",drawDataLabels:n,translate:function(){var a=this.yAxis,k=this.pointArrayMap;l.column.prototype.translate.apply(this);f(this.points,function(b){f(k,function(h){null!==b[h]&&(b[h+"Plot"]=a.translate(b[h],0,1,0,1))})})},drawPoints:function(){var a=this,k=a.chart.renderer,b,h,d,p,g,c,e=0,m,u,t,l,B=!1!==a.doQuartiles,n,q=a.options.whiskerLength;f(a.points,
function(f){var v=f.graphic,y=v?"animate":"attr",A=f.shapeArgs;void 0!==f.plotY&&(m=A.width,u=Math.floor(A.x),t=u+m,l=Math.round(m/2),b=Math.floor(B?f.q1Plot:f.lowPlot),h=Math.floor(B?f.q3Plot:f.lowPlot),d=Math.floor(f.highPlot),p=Math.floor(f.lowPlot),v||(f.graphic=v=k.g("point").add(a.group),f.stem=k.path().addClass("highcharts-boxplot-stem").add(v),q&&(f.whiskers=k.path().addClass("highcharts-boxplot-whisker").add(v)),B&&(f.box=k.path(void 0).addClass("highcharts-boxplot-box").add(v)),f.medianShape=
k.path(void 0).addClass("highcharts-boxplot-median").add(v)),c=f.stem.strokeWidth()%2/2,e=u+l+c,f.stem[y]({d:["M",e,h,"L",e,d,"M",e,b,"L",e,p]}),B&&(c=f.box.strokeWidth()%2/2,b=Math.floor(b)+c,h=Math.floor(h)+c,u+=c,t+=c,f.box[y]({d:["M",u,h,"L",u,b,"L",t,b,"L",t,h,"L",u,h,"z"]})),q&&(c=f.whiskers.strokeWidth()%2/2,d+=c,p+=c,n=/%$/.test(q)?l*parseFloat(q)/100:q/2,f.whiskers[y]({d:["M",e-n,d,"L",e+n,d,"M",e-n,p,"L",e+n,p]})),g=Math.round(f.medianPlot),c=f.medianShape.strokeWidth()%2/2,g+=c,f.medianShape[y]({d:["M",
u,g,"L",t,g]}))})},setStackedPoints:n})})(v);(function(a){var f=a.each,n=a.noop,q=a.seriesType,l=a.seriesTypes;q("errorbar","boxplot",{grouping:!1,linkedTo:":previous",tooltip:{pointFormat:'<span style="color:{point.color}">\u25cf</span> {series.name}: <b>{point.low}</b> - <b>{point.high}</b><br/>'},whiskerWidth:null},{type:"errorbar",pointArrayMap:["low","high"],toYData:function(a){return[a.low,a.high]},pointValKey:"high",doQuartiles:!1,drawDataLabels:l.arearange?function(){var a=this.pointValKey;
l.arearange.prototype.drawDataLabels.call(this);f(this.data,function(f){f.y=f[a]})}:n,getColumnMetrics:function(){return this.linkedParent&&this.linkedParent.columnMetrics||l.column.prototype.getColumnMetrics.call(this)}})})(v);(function(a){var f=a.correctFloat,n=a.isNumber,q=a.pick,l=a.Point,r=a.Series,k=a.seriesType,b=a.seriesTypes;k("waterfall","column",{dataLabels:{inside:!0}},{pointValKey:"y",translate:function(){var a=this.options,d=this.yAxis,p,g,c,e,m,u,l,k,n,r=q(a.minPointLength,5),v=a.threshold,
D=a.stacking;b.column.prototype.translate.apply(this);this.minPointLengthOffset=0;l=k=v;g=this.points;p=0;for(a=g.length;p<a;p++)c=g[p],u=this.processedYData[p],e=c.shapeArgs,n=(m=D&&d.stacks[(this.negStacks&&u<v?"-":"")+this.stackKey])?m[c.x].points[this.index+","+p]:[0,u],c.isSum?c.y=f(u):c.isIntermediateSum&&(c.y=f(u-k)),m=Math.max(l,l+c.y)+n[0],e.y=d.toPixels(m,!0),c.isSum?(e.y=d.toPixels(n[1],!0),e.height=Math.min(d.toPixels(n[0],!0),d.len)-e.y+this.minPointLengthOffset):c.isIntermediateSum?
(e.y=d.toPixels(n[1],!0),e.height=Math.min(d.toPixels(k,!0),d.len)-e.y+this.minPointLengthOffset,k=n[1]):(e.height=0<u?d.toPixels(l,!0)-e.y:d.toPixels(l,!0)-d.toPixels(l-u,!0),l+=u),0>e.height&&(e.y+=e.height,e.height*=-1),c.plotY=e.y=Math.round(e.y)-this.borderWidth%2/2,e.height=Math.max(Math.round(e.height),.001),c.yBottom=e.y+e.height,e.height<=r&&(e.height=r,this.minPointLengthOffset+=r),e.y-=this.minPointLengthOffset,e=c.plotY+(c.negative?e.height:0)-this.minPointLengthOffset,this.chart.inverted?
c.tooltipPos[0]=d.len-e:c.tooltipPos[1]=e},processData:function(b){var a=this.yData,p=this.options.data,g,c=a.length,e,m,l,k,n,q;m=e=l=k=this.options.threshold||0;for(q=0;q<c;q++)n=a[q],g=p&&p[q]?p[q]:{},"sum"===n||g.isSum?a[q]=f(m):"intermediateSum"===n||g.isIntermediateSum?a[q]=f(e):(m+=n,e+=n),l=Math.min(m,l),k=Math.max(m,k);r.prototype.processData.call(this,b);this.dataMin=l;this.dataMax=k},toYData:function(b){return b.isSum?0===b.x?null:"sum":b.isIntermediateSum?0===b.x?null:"intermediateSum":
b.y},getGraphPath:function(){return["M",0,0]},getCrispPath:function(){var b=this.data,a=b.length,f=this.graph.strokeWidth()+this.borderWidth,f=Math.round(f)%2/2,g=[],c,e,m;for(m=1;m<a;m++)e=b[m].shapeArgs,c=b[m-1].shapeArgs,e=["M",c.x+c.width,c.y+f,"L",e.x,c.y+f],0>b[m-1].y&&(e[2]+=c.height,e[5]+=c.height),g=g.concat(e);return g},drawGraph:function(){r.prototype.drawGraph.call(this);this.graph.attr({d:this.getCrispPath()})},getExtremes:a.noop},{getClassName:function(){var b=l.prototype.getClassName.call(this);
this.isSum?b+=" highcharts-sum":this.isIntermediateSum&&(b+=" highcharts-intermediate-sum");return b},isValid:function(){return n(this.y,!0)||this.isSum||this.isIntermediateSum}})})(v);(function(a){var f=a.Series,n=a.seriesType,q=a.seriesTypes;n("polygon","scatter",{marker:{enabled:!1,states:{hover:{enabled:!1}}},stickyTracking:!1,tooltip:{followPointer:!0,pointFormat:""},trackByArea:!0},{type:"polygon",getGraphPath:function(){for(var a=f.prototype.getGraphPath.call(this),n=a.length+1;n--;)(n===a.length||
"M"===a[n])&&0<n&&a.splice(n,0,"z");return this.areaPath=a},drawGraph:function(){q.area.prototype.drawGraph.call(this)},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawTracker:f.prototype.drawTracker,setStackedPoints:a.noop})})(v);(function(a){var f=a.arrayMax,n=a.arrayMin,q=a.Axis,l=a.each,r=a.isNumber,k=a.noop,b=a.pick,h=a.pInt,d=a.Point,p=a.seriesType,g=a.seriesTypes;p("bubble","scatter",{dataLabels:{formatter:function(){return this.point.z},inside:!0,verticalAlign:"middle"},marker:{radius:null,
states:{hover:{radiusPlus:0}}},minSize:8,maxSize:"20%",softThreshold:!1,states:{hover:{halo:{size:5}}},tooltip:{pointFormat:"({point.x}, {point.y}), Size: {point.z}"},turboThreshold:0,zThreshold:0,zoneAxis:"z"},{pointArrayMap:["y","z"],parallelArrays:["x","y","z"],trackerGroups:["group","dataLabelsGroup"],bubblePadding:!0,zoneAxis:"z",getRadii:function(b,a,d,h){var g,f,p,l=this.zData,k=[],n=this.options,q="width"!==n.sizeBy,r=n.zThreshold,v=a-b;f=0;for(g=l.length;f<g;f++)p=l[f],n.sizeByAbsoluteValue&&
null!==p&&(p=Math.abs(p-r),a=Math.max(a-r,Math.abs(b-r)),b=0),null===p?p=null:p<b?p=d/2-1:(p=0<v?(p-b)/v:.5,q&&0<=p&&(p=Math.sqrt(p)),p=Math.ceil(d+p*(h-d))/2),k.push(p);this.radii=k},animate:function(b){var a=this.options.animation;b||(l(this.points,function(b){var c=b.graphic;b=b.shapeArgs;c&&b&&(c.attr("r",1),c.animate({r:b.r},a))}),this.animate=null)},translate:function(){var b,a=this.data,d,h,f=this.radii;g.scatter.prototype.translate.call(this);for(b=a.length;b--;)d=a[b],h=f?f[b]:0,r(h)&&h>=
this.minPxSize/2?(d.shapeType="circle",d.shapeArgs={x:d.plotX,y:d.plotY,r:h},d.dlBox={x:d.plotX-h,y:d.plotY-h,width:2*h,height:2*h}):d.shapeArgs=d.plotY=d.dlBox=void 0},drawLegendSymbol:function(b,a){var d=this.chart.renderer,h=d.fontMetrics(b.itemStyle.fontSize).f/2;a.legendSymbol=d.circle(h,b.baseline-h,h).attr({zIndex:3}).add(a.legendGroup);a.legendSymbol.isMarker=!0},drawPoints:g.column.prototype.drawPoints,alignDataLabel:g.column.prototype.alignDataLabel,buildKDTree:k,applyZones:k},{haloPath:function(){return d.prototype.haloPath.call(this,
this.shapeArgs.r+this.series.options.states.hover.halo.size)},ttBelow:!1});q.prototype.beforePadding=function(){var a=this,d=this.len,g=this.chart,p=0,k=d,q=this.isXAxis,v=q?"xData":"yData",z=this.min,x={},D=Math.min(g.plotWidth,g.plotHeight),E=Number.MAX_VALUE,y=-Number.MAX_VALUE,A=this.max-z,C=d/A,F=[];l(this.series,function(d){var e=d.options;!d.bubblePadding||!d.visible&&g.options.chart.ignoreHiddenSeries||(a.allowZoomOutside=!0,F.push(d),q&&(l(["minSize","maxSize"],function(b){var a=e[b],c=/%$/.test(a),
a=h(a);x[b]=c?D*a/100:a}),d.minPxSize=x.minSize,d.maxPxSize=x.maxSize,d=d.zData,d.length&&(E=b(e.zMin,Math.min(E,Math.max(n(d),!1===e.displayNegative?e.zThreshold:-Number.MAX_VALUE))),y=b(e.zMax,Math.max(y,f(d))))))});l(F,function(b){var d=b[v],h=d.length,e;q&&b.getRadii(E,y,b.minPxSize,b.maxPxSize);if(0<A)for(;h--;)r(d[h])&&a.dataMin<=d[h]&&d[h]<=a.dataMax&&(e=b.radii[h],p=Math.min((d[h]-z)*C-e,p),k=Math.max((d[h]-z)*C+e,k))});F.length&&0<A&&!this.isLog&&(k-=d,C*=(d+p-k)/d,l([["min","userMin",p],
["max","userMax",k]],function(d){void 0===b(a.options[d[0]],a[d[1]])&&(a[d[0]]+=d[2]/C)}))}})(v);(function(a){function f(b,a){var d=this.chart,f=this.options.animation,g=this.group,c=this.markerGroup,e=this.xAxis.center,m=d.plotLeft,k=d.plotTop;d.polar?d.renderer.isSVG&&(!0===f&&(f={}),a?(d={translateX:e[0]+m,translateY:e[1]+k,scaleX:.001,scaleY:.001},g.attr(d),c&&c.attr(d)):(d={translateX:m,translateY:k,scaleX:1,scaleY:1},g.animate(d,f),c&&c.animate(d,f),this.animate=null)):b.call(this,a)}var n=
a.each,q=a.pick,l=a.seriesTypes,r=a.wrap,k=a.Series.prototype;a=a.Pointer.prototype;k.searchPointByAngle=function(b){var a=this.chart,d=this.xAxis.pane.center;return this.searchKDTree({clientX:180+-180/Math.PI*Math.atan2(b.chartX-d[0]-a.plotLeft,b.chartY-d[1]-a.plotTop)})};r(k,"buildKDTree",function(b){this.chart.polar&&(this.kdByAngle?this.searchPoint=this.searchPointByAngle:this.kdDimensions=2);b.apply(this)});k.toXY=function(b){var a,d=this.chart,f=b.plotX;a=b.plotY;b.rectPlotX=f;b.rectPlotY=a;
a=this.xAxis.postTranslate(b.plotX,this.yAxis.len-a);b.plotX=b.polarPlotX=a.x-d.plotLeft;b.plotY=b.polarPlotY=a.y-d.plotTop;this.kdByAngle?(d=(f/Math.PI*180+this.xAxis.pane.options.startAngle)%360,0>d&&(d+=360),b.clientX=d):b.clientX=b.plotX};l.spline&&r(l.spline.prototype,"getPointSpline",function(b,a,d,f){var g,c,e,m,k,l,n;this.chart.polar?(g=d.plotX,c=d.plotY,b=a[f-1],e=a[f+1],this.connectEnds&&(b||(b=a[a.length-2]),e||(e=a[1])),b&&e&&(m=b.plotX,k=b.plotY,a=e.plotX,l=e.plotY,m=(1.5*g+m)/2.5,k=
(1.5*c+k)/2.5,e=(1.5*g+a)/2.5,n=(1.5*c+l)/2.5,a=Math.sqrt(Math.pow(m-g,2)+Math.pow(k-c,2)),l=Math.sqrt(Math.pow(e-g,2)+Math.pow(n-c,2)),m=Math.atan2(k-c,m-g),k=Math.atan2(n-c,e-g),n=Math.PI/2+(m+k)/2,Math.abs(m-n)>Math.PI/2&&(n-=Math.PI),m=g+Math.cos(n)*a,k=c+Math.sin(n)*a,e=g+Math.cos(Math.PI+n)*l,n=c+Math.sin(Math.PI+n)*l,d.rightContX=e,d.rightContY=n),f?(d=["C",b.rightContX||b.plotX,b.rightContY||b.plotY,m||g,k||c,g,c],b.rightContX=b.rightContY=null):d=["M",g,c]):d=b.call(this,a,d,f);return d});
r(k,"translate",function(a){var h=this.chart;a.call(this);if(h.polar&&(this.kdByAngle=h.tooltip&&h.tooltip.shared,!this.preventPostTranslate))for(a=this.points,h=a.length;h--;)this.toXY(a[h])});r(k,"getGraphPath",function(a,h){var d=this,f,g;if(this.chart.polar){h=h||this.points;for(f=0;f<h.length;f++)if(!h[f].isNull){g=f;break}!1!==this.options.connectEnds&&void 0!==g&&(this.connectEnds=!0,h.splice(h.length,0,h[g]));n(h,function(a){void 0===a.polarPlotY&&d.toXY(a)})}return a.apply(this,[].slice.call(arguments,
1))});r(k,"animate",f);l.column&&(l=l.column.prototype,l.polarArc=function(a,h,d,f){var g=this.xAxis.center,c=this.yAxis.len;return this.chart.renderer.symbols.arc(g[0],g[1],c-h,null,{start:d,end:f,innerR:c-q(a,c)})},r(l,"animate",f),r(l,"translate",function(a){var h=this.xAxis,d=h.startAngleRad,f,g,c;this.preventPostTranslate=!0;a.call(this);if(h.isRadial)for(f=this.points,c=f.length;c--;)g=f[c],a=g.barX+d,g.shapeType="path",g.shapeArgs={d:this.polarArc(g.yBottom,g.plotY,a,a+g.pointWidth)},this.toXY(g),
g.tooltipPos=[g.plotX,g.plotY],g.ttBelow=g.plotY>h.center[1]}),r(l,"alignDataLabel",function(a,f,d,l,g,c){this.chart.polar?(a=f.rectPlotX/Math.PI*180,null===l.align&&(l.align=20<a&&160>a?"left":200<a&&340>a?"right":"center"),null===l.verticalAlign&&(l.verticalAlign=45>a||315<a?"bottom":135<a&&225>a?"top":"middle"),k.alignDataLabel.call(this,f,d,l,g,c)):a.call(this,f,d,l,g,c)}));r(a,"getCoordinates",function(a,f){var d=this.chart,k={xAxis:[],yAxis:[]};d.polar?n(d.axes,function(a){var b=a.isXAxis,e=
a.center,l=f.chartX-e[0]-d.plotLeft,e=f.chartY-e[1]-d.plotTop;k[b?"xAxis":"yAxis"].push({axis:a,value:a.translate(b?Math.PI-Math.atan2(l,e):Math.sqrt(Math.pow(l,2)+Math.pow(e,2)),!0)})}):k=a.call(this,f);return k})})(v)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,343 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(J,a){"object"===typeof module&&module.exports?module.exports=J.document?a(J):a:J.Highcharts=a(J)})("undefined"!==typeof window?window:this,function(J){J=function(){var a=window,D=a.document,C=a.navigator&&a.navigator.userAgent||"",G=D&&D.createElementNS&&!!D.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,H=/(edge|msie|trident)/i.test(C)&&!window.opera,p=!G,f=/Firefox/.test(C),d=f&&4>parseInt(C.split("Firefox/")[1],10);return a.Highcharts?a.Highcharts.error(16,!0):{product:"Highcharts",
version:"5.0.0",deg2rad:2*Math.PI/360,doc:D,hasBidiBug:d,isMS:H,isWebKit:/AppleWebKit/.test(C),isFirefox:f,isTouchDevice:/(Mobile|Android|Windows Phone)/.test(C),SVG_NS:"http://www.w3.org/2000/svg",idCounter:0,chartCount:0,seriesTypes:{},svg:G,vml:p,win:a,charts:[],marginNames:["plotTop","marginRight","marginBottom","plotLeft"],noop:function(){}}}();(function(a){var D=[],C=a.charts,G=a.doc,H=a.win;a.error=function(a,f){var d="Highcharts error #"+a+": www.highcharts.com/errors/"+a;if(f)throw Error(d);
H.console&&console.log(d)};a.Fx=function(a,f,d){this.options=f;this.elem=a;this.prop=d};a.Fx.prototype={dSetter:function(){var a=this.paths[0],f=this.paths[1],d=[],h=this.now,k=a.length,l;if(1===h)d=this.toD;else if(k===f.length&&1>h)for(;k--;)l=parseFloat(a[k]),d[k]=isNaN(l)?a[k]:h*parseFloat(f[k]-l)+l;else d=f;this.elem.attr("d",d)},update:function(){var a=this.elem,f=this.prop,d=this.now,h=this.options.step;if(this[f+"Setter"])this[f+"Setter"]();else a.attr?a.element&&a.attr(f,d):a.style[f]=d+
this.unit;h&&h.call(a,d,this)},run:function(a,f,d){var h=this,k=function(a){return k.stopped?!1:h.step(a)},l;this.startTime=+new Date;this.start=a;this.end=f;this.unit=d;this.now=this.start;this.pos=0;k.elem=this.elem;k()&&1===D.push(k)&&(k.timerId=setInterval(function(){for(l=0;l<D.length;l++)D[l]()||D.splice(l--,1);D.length||clearInterval(k.timerId)},13))},step:function(a){var f=+new Date,d,h=this.options;d=this.elem;var k=h.complete,l=h.duration,e=h.curAnim,b;if(d.attr&&!d.element)d=!1;else if(a||
f>=l+this.startTime){this.now=this.end;this.pos=1;this.update();a=e[this.prop]=!0;for(b in e)!0!==e[b]&&(a=!1);a&&k&&k.call(d);d=!1}else this.pos=h.easing((f-this.startTime)/l),this.now=this.start+(this.end-this.start)*this.pos,this.update(),d=!0;return d},initPath:function(p,f,d){function h(a){for(n=a.length;n--;)"M"!==a[n]&&"L"!==a[n]||a.splice(n+1,0,a[n+1],a[n+2],a[n+1],a[n+2])}function k(a,g){for(;a.length<c;){a[0]=g[c-a.length];var e=a.slice(0,B);[].splice.apply(a,[0,0].concat(e));m&&(e=a.slice(a.length-
B),[].splice.apply(a,[a.length,0].concat(e)),n--)}a[0]="M"}function l(a,e){for(var b=(c-a.length)/B;0<b&&b--;)g=a.slice().splice(a.length/u-B,B*u),g[0]=e[c-B-b*B],z&&(g[B-6]=g[B-2],g[B-5]=g[B-1]),[].splice.apply(a,[a.length/u,0].concat(g)),m&&b--}f=f||"";var e,b=p.startX,q=p.endX,z=-1<f.indexOf("C"),B=z?7:3,c,g,n;f=f.split(" ");d=d.slice();var m=p.isArea,u=m?2:1,A;z&&(h(f),h(d));if(b&&q){for(n=0;n<b.length;n++)if(b[n]===q[0]){e=n;break}else if(b[0]===q[q.length-b.length+n]){e=n;A=!0;break}void 0===
e&&(f=[])}f.length&&a.isNumber(e)&&(c=d.length+e*u*B,A?(k(f,d),l(d,f)):(k(d,f),l(f,d)));return[f,d]}};a.extend=function(a,f){var d;a||(a={});for(d in f)a[d]=f[d];return a};a.merge=function(){var p,f=arguments,d,h={},k=function(f,e){var b,d;"object"!==typeof f&&(f={});for(d in e)e.hasOwnProperty(d)&&(b=e[d],a.isObject(b,!0)&&"renderTo"!==d&&"number"!==typeof b.nodeType?f[d]=k(f[d]||{},b):f[d]=e[d]);return f};!0===f[0]&&(h=f[1],f=Array.prototype.slice.call(f,2));d=f.length;for(p=0;p<d;p++)h=k(h,f[p]);
return h};a.pInt=function(a,f){return parseInt(a,f||10)};a.isString=function(a){return"string"===typeof a};a.isArray=function(a){a=Object.prototype.toString.call(a);return"[object Array]"===a||"[object Array Iterator]"===a};a.isObject=function(p,f){return p&&"object"===typeof p&&(!f||!a.isArray(p))};a.isNumber=function(a){return"number"===typeof a&&!isNaN(a)};a.erase=function(a,f){for(var d=a.length;d--;)if(a[d]===f){a.splice(d,1);break}};a.defined=function(a){return void 0!==a&&null!==a};a.attr=
function(p,f,d){var h,k;if(a.isString(f))a.defined(d)?p.setAttribute(f,d):p&&p.getAttribute&&(k=p.getAttribute(f));else if(a.defined(f)&&a.isObject(f))for(h in f)p.setAttribute(h,f[h]);return k};a.splat=function(p){return a.isArray(p)?p:[p]};a.syncTimeout=function(a,f,d){if(f)return setTimeout(a,f,d);a.call(0,d)};a.pick=function(){var a=arguments,f,d,h=a.length;for(f=0;f<h;f++)if(d=a[f],void 0!==d&&null!==d)return d};a.css=function(p,f){a.isMS&&!a.svg&&f&&void 0!==f.opacity&&(f.filter="alpha(opacity="+
100*f.opacity+")");a.extend(p.style,f)};a.createElement=function(p,f,d,h,k){p=G.createElement(p);var l=a.css;f&&a.extend(p,f);k&&l(p,{padding:0,border:"none",margin:0});d&&l(p,d);h&&h.appendChild(p);return p};a.extendClass=function(p,f){var d=function(){};d.prototype=new p;a.extend(d.prototype,f);return d};a.pad=function(a,f,d){return Array((f||2)+1-String(a).length).join(d||0)+a};a.relativeLength=function(a,f){return/%$/.test(a)?f*parseFloat(a)/100:parseFloat(a)};a.wrap=function(a,f,d){var h=a[f];
a[f]=function(){var a=Array.prototype.slice.call(arguments);a.unshift(h);return d.apply(this,a)}};a.getTZOffset=function(p){var f=a.Date;return 6E4*(f.hcGetTimezoneOffset&&f.hcGetTimezoneOffset(p)||f.hcTimezoneOffset||0)};a.dateFormat=function(p,f,d){if(!a.defined(f)||isNaN(f))return a.defaultOptions.lang.invalidDate||"";p=a.pick(p,"%Y-%m-%d %H:%M:%S");var h=a.Date,k=new h(f-a.getTZOffset(f)),l,e=k[h.hcGetHours](),b=k[h.hcGetDay](),q=k[h.hcGetDate](),z=k[h.hcGetMonth](),B=k[h.hcGetFullYear](),c=a.defaultOptions.lang,
g=c.weekdays,n=c.shortWeekdays,m=a.pad,h=a.extend({a:n?n[b]:g[b].substr(0,3),A:g[b],d:m(q),e:m(q,2," "),w:b,b:c.shortMonths[z],B:c.months[z],m:m(z+1),y:B.toString().substr(2,2),Y:B,H:m(e),k:e,I:m(e%12||12),l:e%12||12,M:m(k[h.hcGetMinutes]()),p:12>e?"AM":"PM",P:12>e?"am":"pm",S:m(k.getSeconds()),L:m(Math.round(f%1E3),3)},a.dateFormats);for(l in h)for(;-1!==p.indexOf("%"+l);)p=p.replace("%"+l,"function"===typeof h[l]?h[l](f):h[l]);return d?p.substr(0,1).toUpperCase()+p.substr(1):p};a.formatSingle=function(p,
f){var d=/\.([0-9])/,h=a.defaultOptions.lang;/f$/.test(p)?(d=(d=p.match(d))?d[1]:-1,null!==f&&(f=a.numberFormat(f,d,h.decimalPoint,-1<p.indexOf(",")?h.thousandsSep:""))):f=a.dateFormat(p,f);return f};a.format=function(p,f){for(var d="{",h=!1,k,l,e,b,q=[],z;p;){d=p.indexOf(d);if(-1===d)break;k=p.slice(0,d);if(h){k=k.split(":");l=k.shift().split(".");b=l.length;z=f;for(e=0;e<b;e++)z=z[l[e]];k.length&&(z=a.formatSingle(k.join(":"),z));q.push(z)}else q.push(k);p=p.slice(d+1);d=(h=!h)?"}":"{"}q.push(p);
return q.join("")};a.getMagnitude=function(a){return Math.pow(10,Math.floor(Math.log(a)/Math.LN10))};a.normalizeTickInterval=function(p,f,d,h,k){var l,e=p;d=a.pick(d,1);l=p/d;f||(f=[1,2,2.5,5,10],!1===h&&(1===d?f=[1,2,5,10]:.1>=d&&(f=[1/d])));for(h=0;h<f.length&&!(e=f[h],k&&e*d>=p||!k&&l<=(f[h]+(f[h+1]||f[h]))/2);h++);return e*d};a.stableSort=function(a,f){var d=a.length,h,k;for(k=0;k<d;k++)a[k].safeI=k;a.sort(function(a,e){h=f(a,e);return 0===h?a.safeI-e.safeI:h});for(k=0;k<d;k++)delete a[k].safeI};
a.arrayMin=function(a){for(var f=a.length,d=a[0];f--;)a[f]<d&&(d=a[f]);return d};a.arrayMax=function(a){for(var f=a.length,d=a[0];f--;)a[f]>d&&(d=a[f]);return d};a.destroyObjectProperties=function(a,f){for(var d in a)a[d]&&a[d]!==f&&a[d].destroy&&a[d].destroy(),delete a[d]};a.discardElement=function(p){var f=a.garbageBin;f||(f=a.createElement("div"));p&&f.appendChild(p);f.innerHTML=""};a.correctFloat=function(a,f){return parseFloat(a.toPrecision(f||14))};a.setAnimation=function(p,f){f.renderer.globalAnimation=
a.pick(p,f.options.chart.animation,!0)};a.animObject=function(p){return a.isObject(p)?a.merge(p):{duration:p?500:0}};a.timeUnits={millisecond:1,second:1E3,minute:6E4,hour:36E5,day:864E5,week:6048E5,month:24192E5,year:314496E5};a.numberFormat=function(p,f,d,h){p=+p||0;f=+f;var k=a.defaultOptions.lang,l=(p.toString().split(".")[1]||"").length,e,b,q=Math.abs(p);-1===f?f=Math.min(l,20):a.isNumber(f)||(f=2);e=String(a.pInt(q.toFixed(f)));b=3<e.length?e.length%3:0;d=a.pick(d,k.decimalPoint);h=a.pick(h,
k.thousandsSep);p=(0>p?"-":"")+(b?e.substr(0,b)+h:"");p+=e.substr(b).replace(/(\d{3})(?=\d)/g,"$1"+h);f&&(h=Math.abs(q-e+Math.pow(10,-Math.max(f,l)-1)),p+=d+h.toFixed(f).slice(2));return p};Math.easeInOutSine=function(a){return-.5*(Math.cos(Math.PI*a)-1)};a.getStyle=function(p,f){var d;return"width"===f?Math.min(p.offsetWidth,p.scrollWidth)-a.getStyle(p,"padding-left")-a.getStyle(p,"padding-right"):"height"===f?Math.min(p.offsetHeight,p.scrollHeight)-a.getStyle(p,"padding-top")-a.getStyle(p,"padding-bottom"):
(d=H.getComputedStyle(p,void 0))&&a.pInt(d.getPropertyValue(f))};a.inArray=function(a,f){return f.indexOf?f.indexOf(a):[].indexOf.call(f,a)};a.grep=function(a,f){return[].filter.call(a,f)};a.map=function(a,f){for(var d=[],h=0,k=a.length;h<k;h++)d[h]=f.call(a[h],a[h],h,a);return d};a.offset=function(a){var f=G.documentElement;a=a.getBoundingClientRect();return{top:a.top+(H.pageYOffset||f.scrollTop)-(f.clientTop||0),left:a.left+(H.pageXOffset||f.scrollLeft)-(f.clientLeft||0)}};a.stop=function(a){for(var f=
D.length;f--;)D[f].elem===a&&(D[f].stopped=!0)};a.each=function(a,f,d){return Array.prototype.forEach.call(a,f,d)};a.addEvent=function(a,f,d){function h(f){f.target=f.srcElement||H;d.call(a,f)}var k=a.hcEvents=a.hcEvents||{};a.addEventListener?a.addEventListener(f,d,!1):a.attachEvent&&(a.hcEventsIE||(a.hcEventsIE={}),a.hcEventsIE[d.toString()]=h,a.attachEvent("on"+f,h));k[f]||(k[f]=[]);k[f].push(d)};a.removeEvent=function(p,f,d){function h(a,e){p.removeEventListener?p.removeEventListener(a,e,!1):
p.attachEvent&&(e=p.hcEventsIE[e.toString()],p.detachEvent("on"+a,e))}function k(){var a,b;if(p.nodeName)for(b in f?(a={},a[f]=!0):a=e,a)if(e[b])for(a=e[b].length;a--;)h(b,e[b][a])}var l,e=p.hcEvents,b;e&&(f?(l=e[f]||[],d?(b=a.inArray(d,l),-1<b&&(l.splice(b,1),e[f]=l),h(f,d)):(k(),e[f]=[])):(k(),p.hcEvents={}))};a.fireEvent=function(p,f,d,h){var k;k=p.hcEvents;var l,e;d=d||{};if(G.createEvent&&(p.dispatchEvent||p.fireEvent))k=G.createEvent("Events"),k.initEvent(f,!0,!0),a.extend(k,d),p.dispatchEvent?
p.dispatchEvent(k):p.fireEvent(f,k);else if(k)for(k=k[f]||[],l=k.length,d.target||a.extend(d,{preventDefault:function(){d.defaultPrevented=!0},target:p,type:f}),f=0;f<l;f++)(e=k[f])&&!1===e.call(p,d)&&d.preventDefault();h&&!d.defaultPrevented&&h(d)};a.animate=function(p,f,d){var h,k="",l,e,b;a.isObject(d)||(h=arguments,d={duration:h[2],easing:h[3],complete:h[4]});a.isNumber(d.duration)||(d.duration=400);d.easing="function"===typeof d.easing?d.easing:Math[d.easing]||Math.easeInOutSine;d.curAnim=a.merge(f);
for(b in f)e=new a.Fx(p,d,b),l=null,"d"===b?(e.paths=e.initPath(p,p.d,f.d),e.toD=f.d,h=0,l=1):p.attr?h=p.attr(b):(h=parseFloat(a.getStyle(p,b))||0,"opacity"!==b&&(k="px")),l||(l=f[b]),l.match&&l.match("px")&&(l=l.replace(/px/g,"")),e.run(h,l,k)};a.seriesType=function(p,f,d,h,k){var l=a.getOptions(),e=a.seriesTypes;l.plotOptions[p]=a.merge(l.plotOptions[f],d);e[p]=a.extendClass(e[f]||function(){},h);e[p].prototype.type=p;k&&(e[p].prototype.pointClass=a.extendClass(a.Point,k));return e[p]};H.jQuery&&
(H.jQuery.fn.highcharts=function(){var p=[].slice.call(arguments);if(this[0])return p[0]?(new (a[a.isString(p[0])?p.shift():"Chart"])(this[0],p[0],p[1]),this):C[a.attr(this[0],"data-highcharts-chart")]});G&&!G.defaultView&&(a.getStyle=function(p,f){var d;d={width:"clientWidth",height:"clientHeight"}[f];if(p.style[f])return a.pInt(p.style[f]);"opacity"===f&&(f="filter");if(d)return p.style.zoom=1,Math.max(p[d]-2*a.getStyle(p,"padding"),0);d=p.currentStyle[f.replace(/\-(\w)/g,function(a,f){return f.toUpperCase()})];
"filter"===f&&(d=d.replace(/alpha\(opacity=([0-9]+)\)/,function(a,f){return f/100}));return""===d?1:a.pInt(d)});Array.prototype.forEach||(a.each=function(a,f,d){for(var h=0,k=a.length;h<k;h++)if(!1===f.call(d,a[h],h,a))return h});Array.prototype.indexOf||(a.inArray=function(a,f){var d,h=0;if(f)for(d=f.length;h<d;h++)if(f[h]===a)return h;return-1});Array.prototype.filter||(a.grep=function(a,f){for(var d=[],h=0,k=a.length;h<k;h++)f(a[h],h)&&d.push(a[h]);return d})})(J);(function(a){var D=a.each,C=a.isNumber,
G=a.map,H=a.merge,p=a.pInt;a.Color=function(f){if(!(this instanceof a.Color))return new a.Color(f);this.init(f)};a.Color.prototype={parsers:[{regex:/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]?(?:\.[0-9]+)?)\s*\)/,parse:function(a){return[p(a[1]),p(a[2]),p(a[3]),parseFloat(a[4],10)]}},{regex:/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,parse:function(a){return[p(a[1],16),p(a[2],16),p(a[3],16),1]}},{regex:/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/,
parse:function(a){return[p(a[1]),p(a[2]),p(a[3]),1]}}],names:{white:"#ffffff",black:"#000000"},init:function(f){var d,h,k,l;if((this.input=f=this.names[f]||f)&&f.stops)this.stops=G(f.stops,function(e){return new a.Color(e[1])});else for(k=this.parsers.length;k--&&!h;)l=this.parsers[k],(d=l.regex.exec(f))&&(h=l.parse(d));this.rgba=h||[]},get:function(a){var d=this.input,h=this.rgba,k;this.stops?(k=H(d),k.stops=[].concat(k.stops),D(this.stops,function(d,e){k.stops[e]=[k.stops[e][0],d.get(a)]})):k=h&&
C(h[0])?"rgb"===a||!a&&1===h[3]?"rgb("+h[0]+","+h[1]+","+h[2]+")":"a"===a?h[3]:"rgba("+h.join(",")+")":d;return k},brighten:function(a){var d,h=this.rgba;if(this.stops)D(this.stops,function(d){d.brighten(a)});else if(C(a)&&0!==a)for(d=0;3>d;d++)h[d]+=p(255*a),0>h[d]&&(h[d]=0),255<h[d]&&(h[d]=255);return this},setOpacity:function(a){this.rgba[3]=a;return this}};a.color=function(f){return new a.Color(f)}})(J);(function(a){var D,C,G=a.addEvent,H=a.animate,p=a.attr,f=a.charts,d=a.color,h=a.css,k=a.createElement,
l=a.defined,e=a.deg2rad,b=a.destroyObjectProperties,q=a.doc,z=a.each,B=a.extend,c=a.erase,g=a.grep,n=a.hasTouch,m=a.isArray,u=a.isFirefox,A=a.isMS,w=a.isObject,I=a.isString,y=a.isWebKit,F=a.merge,t=a.noop,v=a.pick,E=a.pInt,K=a.removeEvent,r=a.splat,x=a.stop,M=a.svg,N=a.SVG_NS,P=a.win;D=a.SVGElement=function(){return this};D.prototype={opacity:1,SVG_NS:N,textProps:"direction fontSize fontWeight fontFamily fontStyle color lineHeight width textDecoration textOverflow textShadow".split(" "),init:function(a,
c){this.element="span"===c?k(c):q.createElementNS(this.SVG_NS,c);this.renderer=a},animate:function(a,c,r){c=v(c,this.renderer.globalAnimation,!0);x(this);c?(r&&(c.complete=r),H(this,a,c)):this.attr(a,null,r);return this},colorGradient:function(L,c,r){var x=this.renderer,g,e,b,n,u,t,f,d,h,v,w,A=[],k;L.linearGradient?e="linearGradient":L.radialGradient&&(e="radialGradient");if(e){b=L[e];u=x.gradients;f=L.stops;v=r.radialReference;m(b)&&(L[e]=b={x1:b[0],y1:b[1],x2:b[2],y2:b[3],gradientUnits:"userSpaceOnUse"});
"radialGradient"===e&&v&&!l(b.gradientUnits)&&(n=b,b=F(b,x.getRadialAttr(v,n),{gradientUnits:"userSpaceOnUse"}));for(w in b)"id"!==w&&A.push(w,b[w]);for(w in f)A.push(f[w]);A=A.join(",");u[A]?v=u[A].attr("id"):(b.id=v="highcharts-"+a.idCounter++,u[A]=t=x.createElement(e).attr(b).add(x.defs),t.radAttr=n,t.stops=[],z(f,function(L){0===L[1].indexOf("rgba")?(g=a.color(L[1]),d=g.get("rgb"),h=g.get("a")):(d=L[1],h=1);L=x.createElement("stop").attr({offset:L[0],"stop-color":d,"stop-opacity":h}).add(t);t.stops.push(L)}));
k="url("+x.url+"#"+v+")";r.setAttribute(c,k);r.gradient=A;L.toString=function(){return k}}},applyTextShadow:function(a){var c=this.element,r,x=-1!==a.indexOf("contrast"),b={},g=this.renderer.forExport,e=this.renderer.forExport||void 0!==c.style.textShadow&&!A;x&&(b.textShadow=a=a.replace(/contrast/g,this.renderer.getContrast(c.style.fill)));if(y||g)b.textRendering="geometricPrecision";e?this.css(b):(this.fakeTS=!0,this.ySetter=this.xSetter,r=[].slice.call(c.getElementsByTagName("tspan")),z(a.split(/\s?,\s?/g),
function(a){var L=c.firstChild,x,b;a=a.split(" ");x=a[a.length-1];(b=a[a.length-2])&&z(r,function(a,r){var g;0===r&&(a.setAttribute("x",c.getAttribute("x")),r=c.getAttribute("y"),a.setAttribute("y",r||0),null===r&&c.setAttribute("y",0));g=a.cloneNode(1);p(g,{"class":"highcharts-text-shadow",fill:x,stroke:x,"stroke-opacity":1/Math.max(E(b),3),"stroke-width":b,"stroke-linejoin":"round"});c.insertBefore(g,L)})}))},attr:function(a,c,r){var x,b=this.element,g,e=this,m;"string"===typeof a&&void 0!==c&&
(x=a,a={},a[x]=c);if("string"===typeof a)e=(this[a+"Getter"]||this._defaultGetter).call(this,a,b);else{for(x in a)c=a[x],m=!1,this.symbolName&&/^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(x)&&(g||(this.symbolAttr(a),g=!0),m=!0),!this.rotation||"x"!==x&&"y"!==x||(this.doTransform=!0),m||(m=this[x+"Setter"]||this._defaultSetter,m.call(this,c,x,b));this.doTransform&&(this.updateTransform(),this.doTransform=!1)}r&&r();return e},addClass:function(a,c){var r=this.attr("class")||"";-1===
r.indexOf(a)&&(c||(a=(r+(r?" ":"")+a).replace(" "," ")),this.attr("class",a));return this},hasClass:function(a){return-1!==p(this.element,"class").indexOf(a)},removeClass:function(a){p(this.element,"class",(p(this.element,"class")||"").replace(a,""));return this},symbolAttr:function(a){var c=this;z("x y r start end width height innerR anchorX anchorY".split(" "),function(r){c[r]=v(a[r],c[r])});c.attr({d:c.renderer.symbols[c.symbolName](c.x,c.y,c.width,c.height,c)})},clip:function(a){return this.attr("clip-path",
a?"url("+this.renderer.url+"#"+a.id+")":"none")},crisp:function(a,c){var r,x={},b;c=c||a.strokeWidth||0;b=Math.round(c)%2/2;a.x=Math.floor(a.x||this.x||0)+b;a.y=Math.floor(a.y||this.y||0)+b;a.width=Math.floor((a.width||this.width||0)-2*b);a.height=Math.floor((a.height||this.height||0)-2*b);l(a.strokeWidth)&&(a.strokeWidth=c);for(r in a)this[r]!==a[r]&&(this[r]=x[r]=a[r]);return x},css:function(a){var c=this.styles,r={},x=this.element,b,g,e="";b=!c;a&&a.color&&(a.fill=a.color);if(c)for(g in a)a[g]!==
c[g]&&(r[g]=a[g],b=!0);if(b){b=this.textWidth=a&&a.width&&"text"===x.nodeName.toLowerCase()&&E(a.width)||this.textWidth;c&&(a=B(c,r));this.styles=a;b&&!M&&this.renderer.forExport&&delete a.width;if(A&&!M)h(this.element,a);else{c=function(a,L){return"-"+L.toLowerCase()};for(g in a)e+=g.replace(/([A-Z])/g,c)+":"+a[g]+";";p(x,"style",e)}this.added&&b&&this.renderer.buildText(this)}return this},getStyle:function(a){return P.getComputedStyle(this.element||this,"").getPropertyValue(a)},strokeWidth:function(){var a=
this.getStyle("stroke-width"),c;a.indexOf("px")===a.length-2?a=E(a):(c=q.createElementNS(N,"rect"),p(c,{width:a,"stroke-width":0}),this.element.parentNode.appendChild(c),a=c.getBBox().width,c.parentNode.removeChild(c));return a},on:function(a,c){var r=this,x=r.element;n&&"click"===a?(x.ontouchstart=function(a){r.touchEventFired=Date.now();a.preventDefault();c.call(x,a)},x.onclick=function(a){(-1===P.navigator.userAgent.indexOf("Android")||1100<Date.now()-(r.touchEventFired||0))&&c.call(x,a)}):x["on"+
a]=c;return this},setRadialReference:function(a){var c=this.renderer.gradients[this.element.gradient];this.element.radialReference=a;c&&c.radAttr&&c.animate(this.renderer.getRadialAttr(a,c.radAttr));return this},translate:function(a,c){return this.attr({translateX:a,translateY:c})},invert:function(a){this.inverted=a;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,c=this.translateY||0,r=this.scaleX,x=this.scaleY,b=this.inverted,g=this.rotation,e=this.element;
b&&(a+=this.attr("width"),c+=this.attr("height"));a=["translate("+a+","+c+")"];b?a.push("rotate(90) scale(-1,1)"):g&&a.push("rotate("+g+" "+(e.getAttribute("x")||0)+" "+(e.getAttribute("y")||0)+")");(l(r)||l(x))&&a.push("scale("+v(r,1)+" "+v(x,1)+")");a.length&&e.setAttribute("transform",a.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,r,x){var b,g,e,m,n={};g=this.renderer;e=g.alignedObjects;var u,t;if(a){if(this.alignOptions=a,this.alignByTranslate=
r,!x||I(x))this.alignTo=b=x||"renderer",c(e,this),e.push(this),x=null}else a=this.alignOptions,r=this.alignByTranslate,b=this.alignTo;x=v(x,g[b],g);b=a.align;g=a.verticalAlign;e=(x.x||0)+(a.x||0);m=(x.y||0)+(a.y||0);"right"===b?u=1:"center"===b&&(u=2);u&&(e+=(x.width-(a.width||0))/u);n[r?"translateX":"x"]=Math.round(e);"bottom"===g?t=1:"middle"===g&&(t=2);t&&(m+=(x.height-(a.height||0))/t);n[r?"translateY":"y"]=Math.round(m);this[this.placed?"animate":"attr"](n);this.placed=!0;this.alignAttr=n;return this},
getBBox:function(a,c){var r,x=this.renderer,b,g,m,n=this.element,t=this.styles,f=this.textStr,d,h=n.style,w,k=x.cache,l=x.cacheKeys,E;g=v(c,this.rotation);m=g*e;b=n&&D.prototype.getStyle.call(n,"font-size");void 0!==f&&(E=f.toString().replace(/[0-9]/g,"0")+["",g||0,b,n.style.width].join());E&&!a&&(r=k[E]);if(!r){if(n.namespaceURI===this.SVG_NS||x.forExport){try{w=this.fakeTS&&function(a){z(n.querySelectorAll(".highcharts-text-shadow"),function(c){c.style.display=a})},u&&h.textShadow?(d=h.textShadow,
h.textShadow=""):w&&w("none"),r=n.getBBox?B({},n.getBBox()):{width:n.offsetWidth,height:n.offsetHeight},d?h.textShadow=d:w&&w("")}catch(y){}if(!r||0>r.width)r={width:0,height:0}}else r=this.htmlGetBBox();x.isSVG&&(x=r.width,b=r.height,A&&t&&"11px"===t.fontSize&&"16.9"===b.toPrecision(3)&&(r.height=b=14),g&&(r.width=Math.abs(b*Math.sin(m))+Math.abs(x*Math.cos(m)),r.height=Math.abs(b*Math.cos(m))+Math.abs(x*Math.sin(m))));if(E&&0<r.height){for(;250<l.length;)delete k[l.shift()];k[E]||l.push(E);k[E]=
r}}return r},show:function(a){return this.attr({visibility:a?"inherit":"visible"})},hide:function(){return this.attr({visibility:"hidden"})},fadeOut:function(a){var c=this;c.animate({opacity:0},{duration:a||150,complete:function(){c.attr({y:-9999})}})},add:function(a){var c=this.renderer,r=this.element,x;a&&(this.parentGroup=a);this.parentInverted=a&&a.inverted;void 0!==this.textStr&&c.buildText(this);this.added=!0;if(!a||a.handleZ||this.zIndex)x=this.zIndexSetter();x||(a?a.element:c.box).appendChild(r);
if(this.onAdd)this.onAdd();return this},safeRemoveChild:function(a){var c=a.parentNode;c&&c.removeChild(a)},destroy:function(){var a=this.element||{},r=this.renderer.isSVG&&"SPAN"===a.nodeName&&this.parentGroup,b,g;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=a.point=null;x(this);this.clipPath&&(this.clipPath=this.clipPath.destroy());if(this.stops){for(g=0;g<this.stops.length;g++)this.stops[g]=this.stops[g].destroy();this.stops=null}for(this.safeRemoveChild(a);r&&r.div&&0===r.div.childNodes.length;)a=
r.parentGroup,this.safeRemoveChild(r.div),delete r.div,r=a;this.alignTo&&c(this.renderer.alignedObjects,this);for(b in this)delete this[b];return null},xGetter:function(a){"circle"===this.element.nodeName&&("x"===a?a="cx":"y"===a&&(a="cy"));return this._defaultGetter(a)},_defaultGetter:function(a){a=v(this[a],this.element?this.element.getAttribute(a):null,0);/^[\-0-9\.]+$/.test(a)&&(a=parseFloat(a));return a},dSetter:function(a,c,r){a&&a.join&&(a=a.join(" "));/(NaN| {2}|^$)/.test(a)&&(a="M 0 0");
r.setAttribute(c,a);this[c]=a},alignSetter:function(a){this.element.setAttribute("text-anchor",{left:"start",center:"middle",right:"end"}[a])},titleSetter:function(a){var c=this.element.getElementsByTagName("title")[0];c||(c=q.createElementNS(this.SVG_NS,"title"),this.element.appendChild(c));c.firstChild&&c.removeChild(c.firstChild);c.appendChild(q.createTextNode(String(v(a),"").replace(/<[^>]*>/g,"")))},textSetter:function(a){a!==this.textStr&&(delete this.bBox,this.textStr=a,this.added&&this.renderer.buildText(this))},
fillSetter:function(a,c,r){"string"===typeof a?r.setAttribute(c,a):a&&this.colorGradient(a,c,r)},visibilitySetter:function(a,c,r){"inherit"===a?r.removeAttribute(c):r.setAttribute(c,a)},zIndexSetter:function(a,c){var r=this.renderer,x=this.parentGroup,r=(x||r).element||r.box,b,g,e=this.element,m;b=this.added;var n;l(a)&&(e.zIndex=a,a=+a,this[c]===a&&(b=!1),this[c]=a);if(b){(a=this.zIndex)&&x&&(x.handleZ=!0);x=r.childNodes;for(n=0;n<x.length&&!m;n++)b=x[n],g=b.zIndex,b!==e&&(E(g)>a||!l(a)&&l(g))&&
(r.insertBefore(e,b),m=!0);m||r.appendChild(e)}return m},_defaultSetter:function(a,c,r){r.setAttribute(c,a)}};D.prototype.yGetter=D.prototype.xGetter;D.prototype.translateXSetter=D.prototype.translateYSetter=D.prototype.rotationSetter=D.prototype.verticalAlignSetter=D.prototype.scaleXSetter=D.prototype.scaleYSetter=function(a,c){this[c]=a;this.doTransform=!0};D.prototype.opacitySetter=D.prototype.displaySetter=function(a,c,r){this[c]=a;r.setAttribute(c,a)};C=a.SVGRenderer=function(){this.init.apply(this,
arguments)};C.prototype={Element:D,SVG_NS:N,init:function(a,c,r,x,b,g){var e;x=this.createElement("svg").attr({version:"1.1","class":"highcharts-root"});e=x.element;a.appendChild(e);-1===a.innerHTML.indexOf("xmlns")&&p(e,"xmlns",this.SVG_NS);this.isSVG=!0;this.box=e;this.boxWrapper=x;this.alignedObjects=[];this.url=(u||y)&&q.getElementsByTagName("base").length?P.location.href.replace(/#.*?$/,"").replace(/([\('\)])/g,"\\$1").replace(/ /g,"%20"):"";this.createElement("desc").add().element.appendChild(q.createTextNode("Created with Highcharts 5.0.0"));
this.defs=this.createElement("defs").add();this.allowHTML=g;this.forExport=b;this.gradients={};this.cache={};this.cacheKeys=[];this.imgCount=0;this.setSize(c,r,!1);var m;u&&a.getBoundingClientRect&&(this.subPixelFix=c=function(){h(a,{left:0,top:0});m=a.getBoundingClientRect();h(a,{left:Math.ceil(m.left)-m.left+"px",top:Math.ceil(m.top)-m.top+"px"})},c(),G(P,"resize",c))},definition:function(a){function c(a,L){var b;z(r(a),function(a){var r=x.createElement(a.tagName),g,e={};for(g in a)"tagName"!==
g&&"children"!==g&&"textContent"!==g&&(e[g]=a[g]);r.attr(e);r.add(L||x.defs);a.textContent&&r.element.appendChild(q.createTextNode(a.textContent));c(a.children||[],r);b=r});return b}var x=this;return c(a)},isHidden:function(){return!this.boxWrapper.getBBox().width},destroy:function(){var a=this.defs;this.box=null;this.boxWrapper=this.boxWrapper.destroy();b(this.gradients||{});this.gradients=null;a&&(this.defs=a.destroy());this.subPixelFix&&K(P,"resize",this.subPixelFix);return this.alignedObjects=
null},createElement:function(a){var c=new this.Element;c.init(this,a);return c},draw:t,getRadialAttr:function(a,c){return{cx:a[0]-a[2]/2+c.cx*a[2],cy:a[1]-a[2]/2+c.cy*a[2],r:c.r*a[2]}},buildText:function(a){for(var c=a.element,r=this,x=r.forExport,b=v(a.textStr,"").toString(),e=-1!==b.indexOf("<"),m=c.childNodes,n,u,t,f,d=p(c,"x"),w=a.styles,A=a.textWidth,k=w&&w.lineHeight,l=w&&w.textShadow,y=w&&"ellipsis"===w.textOverflow,B=m.length,I=A&&!a.added&&this.box,K=function(a){return k?E(k):r.fontMetrics(void 0,
a).h};B--;)c.removeChild(m[B]);e||l||y||A||-1!==b.indexOf(" ")?(n=/<.*class="([^"]+)".*>/,u=/<.*style="([^"]+)".*>/,t=/<.*href="(http[^"]+)".*>/,I&&I.appendChild(c),b=e?b.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):[b],b=g(b,function(a){return""!==a}),z(b,function(b,g){var e,m=0;b=b.replace(/^\s+|\s+$/g,"").replace(/<span/g,"|||<span").replace(/<\/span>/g,
"</span>|||");e=b.split("|||");z(e,function(b){if(""!==b||1===e.length){var v={},k=q.createElementNS(r.SVG_NS,"tspan"),l,z;n.test(b)&&(l=b.match(n)[1],p(k,"class",l));u.test(b)&&(z=b.match(u)[1].replace(/(;| |^)color([ :])/,"$1fill$2"),p(k,"style",z));t.test(b)&&!x&&(p(k,"onclick",'location.href="'+b.match(t)[1]+'"'),h(k,{cursor:"pointer"}));b=(b.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(" "!==b){k.appendChild(q.createTextNode(b));m?v.dx=0:g&&null!==d&&(v.x=d);p(k,
v);c.appendChild(k);!m&&g&&(!M&&x&&h(k,{display:"block"}),p(k,"dy",K(k)));if(A){v=b.replace(/([^\^])-/g,"$1- ").split(" ");l="nowrap"===w.whiteSpace;for(var E=1<e.length||g||1<v.length&&!l,B,I,F=[],P=K(k),R=a.rotation,O=b,U=O.length;(E||y)&&(v.length||F.length);)a.rotation=0,B=a.getBBox(!0),I=B.width,!M&&r.forExport&&(I=r.measureSpanWidth(k.firstChild.data,a.styles)),B=I>A,void 0===f&&(f=B),y&&f?(U/=2,""===O||!B&&.5>U?v=[]:(O=b.substring(0,O.length+(B?-1:1)*Math.ceil(U)),v=[O+(3<A?"\u2026":"")],k.removeChild(k.firstChild))):
B&&1!==v.length?(k.removeChild(k.firstChild),F.unshift(v.pop())):(v=F,F=[],v.length&&!l&&(k=q.createElementNS(N,"tspan"),p(k,{dy:P,x:d}),z&&p(k,"style",z),c.appendChild(k)),I>A&&(A=I)),v.length&&k.appendChild(q.createTextNode(v.join(" ").replace(/- /g,"-")));a.rotation=R}m++}}})}),f&&a.attr("title",a.textStr),I&&I.removeChild(c),l&&a.applyTextShadow&&a.applyTextShadow(l)):c.appendChild(q.createTextNode(b.replace(/&lt;/g,"<").replace(/&gt;/g,">")))},getContrast:function(a){a=d(a).rgba;return 510<a[0]+
a[1]+a[2]?"#000000":"#FFFFFF"},button:function(a,c,r,x,b,g,e,m,n){var u=this.label(a,c,r,n,null,null,null,null,"button"),t=0;u.attr(F({padding:8,r:2},b));G(u.element,A?"mouseover":"mouseenter",function(){3!==t&&u.setState(1)});G(u.element,A?"mouseout":"mouseleave",function(){3!==t&&u.setState(t)});u.setState=function(a){1!==a&&(u.state=t=a);u.removeClass(/highcharts-button-(normal|hover|pressed|disabled)/).addClass("highcharts-button-"+["normal","hover","pressed","disabled"][a||0])};return u.on("click",
function(a){3!==t&&x.call(u,a)})},crispLine:function(a,c){a[1]===a[4]&&(a[1]=a[4]=Math.round(a[1])-c%2/2);a[2]===a[5]&&(a[2]=a[5]=Math.round(a[2])+c%2/2);return a},path:function(a){var c={};m(a)?c.d=a:w(a)&&B(c,a);return this.createElement("path").attr(c)},circle:function(a,c,r){a=w(a)?a:{x:a,y:c,r:r};c=this.createElement("circle");c.xSetter=c.ySetter=function(a,c,r){r.setAttribute("c"+c,a)};return c.attr(a)},arc:function(a,c,r,x,b,g){w(a)&&(c=a.y,r=a.r,x=a.innerR,b=a.start,g=a.end,a=a.x);a=this.symbol("arc",
a||0,c||0,r||0,r||0,{innerR:x||0,start:b||0,end:g||0});a.r=r;return a},rect:function(a,c,r,x,b,g){b=w(a)?a.r:b;g=this.createElement("rect");a=w(a)?a:void 0===a?{}:{x:a,y:c,width:Math.max(r,0),height:Math.max(x,0)};b&&(a.r=b);g.rSetter=function(a,c,r){p(r,{rx:a,ry:a})};return g.attr(a)},setSize:function(a,c,r){var x=this.alignedObjects,b=x.length;this.width=a;this.height=c;for(this.boxWrapper.animate({width:a,height:c},{step:function(){this.attr({viewBox:"0 0 "+this.attr("width")+" "+this.attr("height")})},
duration:v(r,!0)?void 0:0});b--;)x[b].align()},g:function(a){var c=this.createElement("g");return a?c.attr({"class":"highcharts-"+a}):c},image:function(a,c,r,x,b){var g={preserveAspectRatio:"none"};1<arguments.length&&B(g,{x:c,y:r,width:x,height:b});g=this.createElement("image").attr(g);g.element.setAttributeNS?g.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):g.element.setAttribute("hc-svg-href",a);return g},symbol:function(a,c,r,x,b,g){var e=this,m,n=this.symbols[a],u=l(c)&&n&&n(Math.round(c),
Math.round(r),x,b,g),t=/^url\((.*?)\)$/,d,w,A={};n?(m=this.path(u),B(m,{symbolName:a,x:c,y:r,width:x,height:b}),g&&B(m,g)):t.test(a)&&(d=a.match(t)[1],m=this.image(d),m.imgwidth=v(A[d]&&A[d].width,g&&g.width),m.imgheight=v(A[d]&&A[d].height,g&&g.height),w=function(){m.attr({width:m.width,height:m.height})},z(["width","height"],function(a){m[a+"Setter"]=function(a,c){var r={},x=this["img"+c];this[c]=a;l(x)&&(this.element&&this.element.setAttribute(c,x),this.alignByTranslate||(r["width"===c?"translateX":
"translateY"]=(this[c]-x)/2,this.attr(r)))}}),l(c)&&m.attr({x:c,y:r}),m.isImg=!0,l(m.imgwidth)&&l(m.imgheight)?w():(m.attr({width:0,height:0}),k("img",{onload:function(){var a=f[e.chartIndex];0===this.width&&(h(this,{position:"absolute",top:"-999em"}),q.body.appendChild(this));A[d]={width:this.width,height:this.height};m.imgwidth=this.width;m.imgheight=this.height;m.element&&w();this.parentNode&&this.parentNode.removeChild(this);e.imgCount--;if(!e.imgCount&&a&&a.onload)a.onload()},src:d}),this.imgCount++));
return m},symbols:{circle:function(a,c,r,x){var b=.166*r;return["M",a+r/2,c,"C",a+r+b,c,a+r+b,c+x,a+r/2,c+x,"C",a-b,c+x,a-b,c,a+r/2,c,"Z"]},square:function(a,c,r,x){return["M",a,c,"L",a+r,c,a+r,c+x,a,c+x,"Z"]},triangle:function(a,c,r,x){return["M",a+r/2,c,"L",a+r,c+x,a,c+x,"Z"]},"triangle-down":function(a,c,r,x){return["M",a,c,"L",a+r,c,a+r/2,c+x,"Z"]},diamond:function(a,c,r,x){return["M",a+r/2,c,"L",a+r,c+x/2,a+r/2,c+x,a,c+x/2,"Z"]},arc:function(a,c,r,x,b){var g=b.start;r=b.r||r||x;var e=b.end-.001;
x=b.innerR;var m=b.open,n=Math.cos(g),u=Math.sin(g),t=Math.cos(e),e=Math.sin(e);b=b.end-g<Math.PI?0:1;return["M",a+r*n,c+r*u,"A",r,r,0,b,1,a+r*t,c+r*e,m?"M":"L",a+x*t,c+x*e,"A",x,x,0,b,0,a+x*n,c+x*u,m?"":"Z"]},callout:function(a,c,r,x,b){var g=Math.min(b&&b.r||0,r,x),e=g+6,m=b&&b.anchorX;b=b&&b.anchorY;var n;n=["M",a+g,c,"L",a+r-g,c,"C",a+r,c,a+r,c,a+r,c+g,"L",a+r,c+x-g,"C",a+r,c+x,a+r,c+x,a+r-g,c+x,"L",a+g,c+x,"C",a,c+x,a,c+x,a,c+x-g,"L",a,c+g,"C",a,c,a,c,a+g,c];m&&m>r&&b>c+e&&b<c+x-e?n.splice(13,
3,"L",a+r,b-6,a+r+6,b,a+r,b+6,a+r,c+x-g):m&&0>m&&b>c+e&&b<c+x-e?n.splice(33,3,"L",a,b+6,a-6,b,a,b-6,a,c+g):b&&b>x&&m>a+e&&m<a+r-e?n.splice(23,3,"L",m+6,c+x,m,c+x+6,m-6,c+x,a+g,c+x):b&&0>b&&m>a+e&&m<a+r-e&&n.splice(3,3,"L",m-6,c,m,c-6,m+6,c,r-g,c);return n}},clipRect:function(c,r,x,b){var g="highcharts-"+a.idCounter++,e=this.createElement("clipPath").attr({id:g}).add(this.defs);c=this.rect(c,r,x,b,0).add(e);c.id=g;c.clipPath=e;c.count=0;return c},text:function(a,c,r,x){var b=!M&&this.forExport,g={};
if(x&&(this.allowHTML||!this.forExport))return this.html(a,c,r);g.x=Math.round(c||0);r&&(g.y=Math.round(r));if(a||0===a)g.text=a;a=this.createElement("text").attr(g);b&&a.css({position:"absolute"});x||(a.xSetter=function(a,c,r){var x=r.getElementsByTagName("tspan"),b,g=r.getAttribute(c),e;for(e=0;e<x.length;e++)b=x[e],b.getAttribute(c)===g&&b.setAttribute(c,a);r.setAttribute(c,a)});return a},fontMetrics:function(a,c){var r;a=c&&D.prototype.getStyle.call(c,"font-size");a=/px/.test(a)?E(a):/em/.test(a)?
12*parseFloat(a):12;r=24>a?a+3:Math.round(1.2*a);return{h:r,b:Math.round(.8*r),f:a}},rotCorr:function(a,c,r){var x=a;c&&r&&(x=Math.max(x*Math.cos(c*e),4));return{x:-a/3*Math.sin(c*e),y:x}},label:function(a,c,r,x,b,g,e,m,n){var u=this,t=u.g("button"!==n&&"label"),d=t.text=u.text("",0,0,e).attr({zIndex:1}),f,h,w=0,v=3,k=0,A,E,y,I,M,q={},N,p=/^url\((.*?)\)$/.test(x),P=p,C,G,H,J;n&&t.addClass("highcharts-"+n);P=!0;C=function(){return f.strokeWidth()%2/2};G=function(){var a=d.element.style,c={};h=(void 0===
A||void 0===E||M)&&l(d.textStr)&&d.getBBox();t.width=(A||h.width||0)+2*v+k;t.height=(E||h.height||0)+2*v;N=v+u.fontMetrics(a&&a.fontSize,d).b;P&&(f||(t.box=f=u.symbols[x]||p?u.symbol(x):u.rect(),f.addClass(("button"===n?"":"highcharts-label-box")+(n?" highcharts-"+n+"-box":"")),f.add(t),a=C(),c.x=a,c.y=(m?-N:0)+a),c.width=Math.round(t.width),c.height=Math.round(t.height),f.attr(B(c,q)),q={})};H=function(){var a=k+v,c;c=m?0:N;l(A)&&h&&("center"===M||"right"===M)&&(a+={center:.5,right:1}[M]*(A-h.width));
if(a!==d.x||c!==d.y)d.attr("x",a),void 0!==c&&d.attr("y",c);d.x=a;d.y=c};J=function(a,c){f?f.attr(a,c):q[a]=c};t.onAdd=function(){d.add(t);t.attr({text:a||0===a?a:"",x:c,y:r});f&&l(b)&&t.attr({anchorX:b,anchorY:g})};t.widthSetter=function(a){A=a};t.heightSetter=function(a){E=a};t["text-alignSetter"]=function(a){M=a};t.paddingSetter=function(a){l(a)&&a!==v&&(v=t.padding=a,H())};t.paddingLeftSetter=function(a){l(a)&&a!==k&&(k=a,H())};t.alignSetter=function(a){a={left:0,center:.5,right:1}[a];a!==w&&
(w=a,h&&t.attr({x:y}))};t.textSetter=function(a){void 0!==a&&d.textSetter(a);G();H()};t["stroke-widthSetter"]=function(a,c){a&&(P=!0);this["stroke-width"]=a;J(c,a)};t.rSetter=function(a,c){J(c,a)};t.anchorXSetter=function(a,c){b=a;J(c,Math.round(a)-C()-y)};t.anchorYSetter=function(a,c){g=a;J(c,a-I)};t.xSetter=function(a){t.x=a;w&&(a-=w*((A||h.width)+2*v));y=Math.round(a);t.attr("translateX",y)};t.ySetter=function(a){I=t.y=Math.round(a);t.attr("translateY",I)};var V=t.css;return B(t,{css:function(a){if(a){var c=
{};a=F(a);z(t.textProps,function(r){void 0!==a[r]&&(c[r]=a[r],delete a[r])});d.css(c)}return V.call(t,a)},getBBox:function(){return{width:h.width+2*v,height:h.height+2*v,x:h.x-v,y:h.y-v}},destroy:function(){K(t.element,"mouseenter");K(t.element,"mouseleave");d&&(d=d.destroy());f&&(f=f.destroy());D.prototype.destroy.call(t);t=u=G=H=J=null}})}};a.Renderer=C})(J);(function(a){var D=a.attr,C=a.createElement,G=a.css,H=a.defined,p=a.each,f=a.extend,d=a.isFirefox,h=a.isMS,k=a.isWebKit,l=a.pInt,e=a.SVGRenderer,
b=a.win,q=a.wrap;f(a.SVGElement.prototype,{htmlCss:function(a){var b=this.element;if(b=a&&"SPAN"===b.tagName&&a.width)delete a.width,this.textWidth=b,this.updateTransform();a&&"ellipsis"===a.textOverflow&&(a.whiteSpace="nowrap",a.overflow="hidden");this.styles=f(this.styles,a);G(this.element,a);return this},htmlGetBBox:function(){var a=this.element;"text"===a.nodeName&&(a.style.position="absolute");return{x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}},htmlUpdateTransform:function(){if(this.added){var a=
this.renderer,b=this.element,c=this.x||0,g=this.y||0,e=this.textAlign||"left",m={left:0,center:.5,right:1}[e],u=this.styles;G(b,{marginLeft:this.translateX||0,marginTop:this.translateY||0});this.inverted&&p(b.childNodes,function(c){a.invertChild(c,b)});if("SPAN"===b.tagName){var d=this.rotation,f=l(this.textWidth),h=u&&u.whiteSpace,y=[d,e,b.innerHTML,this.textWidth,this.textAlign].join();y!==this.cTT&&(u=a.fontMetrics(b.style.fontSize).b,H(d)&&this.setSpanRotation(d,m,u),G(b,{width:"",whiteSpace:h||
"nowrap"}),b.offsetWidth>f&&/[ \-]/.test(b.textContent||b.innerText)&&G(b,{width:f+"px",display:"block",whiteSpace:h||"normal"}),this.getSpanCorrection(b.offsetWidth,u,m,d,e));G(b,{left:c+(this.xCorr||0)+"px",top:g+(this.yCorr||0)+"px"});k&&(u=b.offsetHeight);this.cTT=y}}else this.alignOnAdd=!0},setSpanRotation:function(a,e,c){var g={},n=h?"-ms-transform":k?"-webkit-transform":d?"MozTransform":b.opera?"-o-transform":"";g[n]=g.transform="rotate("+a+"deg)";g[n+(d?"Origin":"-origin")]=g.transformOrigin=
100*e+"% "+c+"px";G(this.element,g)},getSpanCorrection:function(a,b,c){this.xCorr=-a*c;this.yCorr=-b}});f(e.prototype,{html:function(a,b,c){var g=this.createElement("span"),e=g.element,m=g.renderer,u=m.isSVG,d=function(a,c){p(["display","opacity","visibility"],function(b){q(a,b+"Setter",function(a,b,g,e){a.call(this,b,g,e);c[g]=b})})};g.textSetter=function(a){a!==e.innerHTML&&delete this.bBox;e.innerHTML=this.textStr=a;g.htmlUpdateTransform()};u&&d(g,g.element.style);g.xSetter=g.ySetter=g.alignSetter=
g.rotationSetter=function(a,c){"align"===c&&(c="textAlign");g[c]=a;g.htmlUpdateTransform()};g.attr({text:a,x:Math.round(b),y:Math.round(c)}).css({position:"absolute"});e.style.whiteSpace="nowrap";g.css=g.htmlCss;u&&(g.add=function(a){var c,b=m.box.parentNode,u=[];if(this.parentGroup=a){if(c=a.div,!c){for(;a;)u.push(a),a=a.parentGroup;p(u.reverse(),function(a){var g,e=D(a.element,"class");e&&(e={className:e});c=a.div=a.div||C("div",e,{position:"absolute",left:(a.translateX||0)+"px",top:(a.translateY||
0)+"px",display:a.display,opacity:a.opacity,pointerEvents:a.styles&&a.styles.pointerEvents},c||b);g=c.style;f(a,{translateXSetter:function(c,r){g.left=c+"px";a[r]=c;a.doTransform=!0},translateYSetter:function(c,r){g.top=c+"px";a[r]=c;a.doTransform=!0}});d(a,g)})}}else c=b;c.appendChild(e);g.added=!0;g.alignOnAdd&&g.htmlUpdateTransform();return g});return g}})})(J);(function(a){function D(){var d=a.defaultOptions.global,h,k=d.useUTC,l=k?"getUTC":"get",e=k?"setUTC":"set";a.Date=h=d.Date||f.Date;h.hcTimezoneOffset=
k&&d.timezoneOffset;h.hcGetTimezoneOffset=k&&d.getTimezoneOffset;h.hcMakeTime=function(a,e,d,f,c,g){var n;k?(n=h.UTC.apply(0,arguments),n+=G(n)):n=(new h(a,e,p(d,1),p(f,0),p(c,0),p(g,0))).getTime();return n};C("Minutes Hours Day Date Month FullYear".split(" "),function(a){h["hcGet"+a]=l+a});C("Milliseconds Seconds Minutes Hours Date Month FullYear".split(" "),function(a){h["hcSet"+a]=e+a})}var C=a.each,G=a.getTZOffset,H=a.merge,p=a.pick,f=a.win;a.defaultOptions={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:{useUTC:!0},chart:{borderRadius:0,colorCount:10,defaultSeriesType:"line",
ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{zIndex:20},position:{align:"right",x:-10,y:10}},width:null,height:null},defs:{dropShadow:{tagName:"filter",id:"drop-shadow",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"}]}]},style:{tagName:"style",
textContent:".highcharts-tooltip{filter:url(#drop-shadow)}"}},title:{text:"Chart title",align:"center",margin:15,widthAdjust:-44},subtitle:{text:"",align:"center",widthAdjust:-44},plotOptions:{},labels:{style:{position:"absolute",color:"#333333"}},legend:{enabled:!0,align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{},itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",
x:0,y:0,title:{}},loading:{},tooltip:{enabled:!0,animation:a.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:a.isTouchDevice?25:10,headerFormat:'<span class="highcharts-header">{point.key}</span><br/>',pointFormat:'<span class="highcharts-color-{point.colorIndex}">\u25cf</span> {series.name}: <b>{point.y}</b><br/>'},
credits:{enabled:!0,href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},text:"Highcharts.com"}};a.setOptions=function(d){a.defaultOptions=H(!0,a.defaultOptions,d);D();return a.defaultOptions};a.getOptions=function(){return a.defaultOptions};a.defaultPlotOptions=a.defaultOptions.plotOptions;D()})(J);(function(a){var D=a.arrayMax,C=a.arrayMin,G=a.defined,H=a.destroyObjectProperties,p=a.each,f=a.erase,d=a.merge,h=a.pick;a.PlotLineOrBand=function(a,d){this.axis=
a;d&&(this.options=d,this.id=d.id)};a.PlotLineOrBand.prototype={render:function(){var a=this,f=a.axis,e=f.horiz,b=a.options,q=b.label,z=a.label,B=b.to,c=b.from,g=b.value,n=G(c)&&G(B),m=G(g),u=a.svgElem,A=!u,w=[],I,y=h(b.zIndex,0),F=b.events,w={"class":"highcharts-plot-"+(n?"band ":"line ")+(b.className||"")},t={},v=f.chart.renderer,E=n?"bands":"lines",K;K=f.log2lin;f.isLog&&(c=K(c),B=K(B),g=K(g));t.zIndex=y;E+="-"+y;(K=f[E])||(f[E]=K=v.g("plot-"+E).attr(t).add());A&&(a.svgElem=u=v.path().attr(w).add(K));
if(m)w=f.getPlotLinePath(g,u.strokeWidth());else if(n)w=f.getPlotBandPath(c,B,b);else return;if(A&&w&&w.length){if(u.attr({d:w}),F)for(I in b=function(c){u.on(c,function(b){F[c].apply(a,[b])})},F)b(I)}else u&&(w?(u.show(),u.animate({d:w})):(u.hide(),z&&(a.label=z=z.destroy())));q&&G(q.text)&&w&&w.length&&0<f.width&&0<f.height&&!w.flat?(q=d({align:e&&n&&"center",x:e?!n&&4:10,verticalAlign:!e&&n&&"middle",y:e?n?16:10:n?6:-4,rotation:e&&!n&&90},q),this.renderLabel(q,w,n,y)):z&&z.hide();return a},renderLabel:function(a,
d,e,b){var f=this.label,h=this.axis.chart.renderer;f||(f={align:a.textAlign||a.align,rotation:a.rotation,"class":"highcharts-plot-"+(e?"band":"line")+"-label "+(a.className||"")},f.zIndex=b,this.label=f=h.text(a.text,0,0,a.useHTML).attr(f).add());b=[d[1],d[4],e?d[6]:d[1]];d=[d[2],d[5],e?d[7]:d[2]];e=C(b);h=C(d);f.align(a,!1,{x:e,y:h,width:D(b)-e,height:D(d)-h});f.show()},destroy:function(){f(this.axis.plotLinesAndBands,this);delete this.axis;H(this)}};a.AxisPlotLineOrBandExtension={getPlotBandPath:function(a,
d){var e=this.getPlotLinePath(d,null,null,!0),b=this.getPlotLinePath(a,null,null,!0);b&&e?(b.flat=b.toString()===e.toString(),b.push(e[4],e[5],e[1],e[2])):b=null;return b},addPlotBand:function(a){return this.addPlotBandOrLine(a,"plotBands")},addPlotLine:function(a){return this.addPlotBandOrLine(a,"plotLines")},addPlotBandOrLine:function(d,f){var e=(new a.PlotLineOrBand(this,d)).render(),b=this.userOptions;e&&(f&&(b[f]=b[f]||[],b[f].push(d)),this.plotLinesAndBands.push(e));return e},removePlotBandOrLine:function(a){for(var d=
this.plotLinesAndBands,e=this.options,b=this.userOptions,h=d.length;h--;)d[h].id===a&&d[h].destroy();p([e.plotLines||[],b.plotLines||[],e.plotBands||[],b.plotBands||[]],function(b){for(h=b.length;h--;)b[h].id===a&&f(b,b[h])})}}})(J);(function(a){var D=a.correctFloat,C=a.defined,G=a.destroyObjectProperties,H=a.isNumber,p=a.pick,f=a.stop,d=a.deg2rad;a.Tick=function(a,d,f,e){this.axis=a;this.pos=d;this.type=f||"";this.isNew=!0;f||e||this.addLabel()};a.Tick.prototype={addLabel:function(){var a=this.axis,
d=a.options,f=a.chart,e=a.categories,b=a.names,q=this.pos,z=d.labels,B=a.tickPositions,c=q===B[0],g=q===B[B.length-1],b=e?p(e[q],b[q],q):q,e=this.label,B=B.info,n;a.isDatetimeAxis&&B&&(n=d.dateTimeLabelFormats[B.higherRanks[q]||B.unitName]);this.isFirst=c;this.isLast=g;d=a.labelFormatter.call({axis:a,chart:f,isFirst:c,isLast:g,dateTimeLabelFormat:n,value:a.isLog?D(a.lin2log(b)):b});C(e)?e&&e.attr({text:d}):(this.labelLength=(this.label=e=C(d)&&z.enabled?f.renderer.text(d,0,0,z.useHTML).add(a.labelGroup):
null)&&e.getBBox().width,this.rotation=0)},getLabelSize:function(){return this.label?this.label.getBBox()[this.axis.horiz?"height":"width"]:0},handleOverflow:function(a){var f=this.axis,l=a.x,e=f.chart.chartWidth,b=f.chart.spacing,q=p(f.labelLeft,Math.min(f.pos,b[3])),b=p(f.labelRight,Math.max(f.pos+f.len,e-b[1])),z=this.label,B=this.rotation,c={left:0,center:.5,right:1}[f.labelAlign],g=z.getBBox().width,n=f.getSlotWidth(),m=n,u=1,A,w={};if(B)0>B&&l-c*g<q?A=Math.round(l/Math.cos(B*d)-q):0<B&&l+c*
g>b&&(A=Math.round((e-l)/Math.cos(B*d)));else if(e=l+(1-c)*g,l-c*g<q?m=a.x+m*(1-c)-q:e>b&&(m=b-a.x+m*c,u=-1),m=Math.min(n,m),m<n&&"center"===f.labelAlign&&(a.x+=u*(n-m-c*(n-Math.min(g,m)))),g>m||f.autoRotation&&(z.styles||{}).width)A=m;A&&(w.width=A,(f.options.labels.style||{}).textOverflow||(w.textOverflow="ellipsis"),z.css(w))},getPosition:function(a,d,f,e){var b=this.axis,q=b.chart,z=e&&q.oldChartHeight||q.chartHeight;return{x:a?b.translate(d+f,null,null,e)+b.transB:b.left+b.offset+(b.opposite?
(e&&q.oldChartWidth||q.chartWidth)-b.right-b.left:0),y:a?z-b.bottom+b.offset-(b.opposite?b.height:0):z-b.translate(d+f,null,null,e)-b.transB}},getLabelPosition:function(a,f,l,e,b,q,z,B){var c=this.axis,g=c.transA,n=c.reversed,m=c.staggerLines,u=c.tickRotCorr||{x:0,y:0},A=b.y;C(A)||(A=0===c.side?l.rotation?-8:-l.getBBox().height:2===c.side?u.y+8:Math.cos(l.rotation*d)*(u.y-l.getBBox(!1,0).height/2));a=a+b.x+u.x-(q&&e?q*g*(n?-1:1):0);f=f+A-(q&&!e?q*g*(n?1:-1):0);m&&(l=z/(B||1)%m,c.opposite&&(l=m-l-
1),f+=c.labelOffset/m*l);return{x:a,y:Math.round(f)}},getMarkPath:function(a,f,d,e,b,q){return q.crispLine(["M",a,f,"L",a+(b?0:-d),f+(b?d:0)],e)},render:function(a,d,l){var e=this.axis,b=e.options,q=e.chart.renderer,z=e.horiz,B=this.type,c=this.label,g=this.pos,n=b.labels,m=this.gridLine,u=e.tickSize(B?B+"Tick":"tick"),A=this.mark,w=!A,I=n.step,y={},F=!0,t=e.tickmarkOffset,v=this.getPosition(z,g,t,d),E=v.x,v=v.y,K=z&&E===e.pos+e.len||!z&&v===e.pos?-1:1;l=p(l,1);this.isActive=!0;m||(B||(y.zIndex=1),
d&&(y.opacity=0),this.gridLine=m=q.path().attr(y).addClass("highcharts-"+(B?B+"-":"")+"grid-line").add(e.gridGroup));if(!d&&m&&(g=e.getPlotLinePath(g+t,m.strokeWidth()*K,d,!0)))m[this.isNew?"attr":"animate"]({d:g,opacity:l});u&&(e.opposite&&(u[0]=-u[0]),w&&(this.mark=A=q.path().addClass("highcharts-"+(B?B+"-":"")+"tick").add(e.axisGroup)),A[w?"attr":"animate"]({d:this.getMarkPath(E,v,u[0],A.strokeWidth()*K,z,q),opacity:l}));c&&H(E)&&(c.xy=v=this.getLabelPosition(E,v,c,z,n,t,a,I),this.isFirst&&!this.isLast&&
!p(b.showFirstLabel,1)||this.isLast&&!this.isFirst&&!p(b.showLastLabel,1)?F=!1:!z||e.isRadial||n.step||n.rotation||d||0===l||this.handleOverflow(v),I&&a%I&&(F=!1),F&&H(v.y)?(v.opacity=l,c[this.isNew?"attr":"animate"](v)):(f(c),c.attr("y",-9999)),this.isNew=!1)},destroy:function(){G(this,this.axis)}}})(J);(function(a){var D=a.addEvent,C=a.animObject,G=a.arrayMax,H=a.arrayMin,p=a.AxisPlotLineOrBandExtension,f=a.correctFloat,d=a.defaultOptions,h=a.defined,k=a.deg2rad,l=a.destroyObjectProperties,e=a.each,
b=a.error,q=a.extend,z=a.fireEvent,B=a.format,c=a.getMagnitude,g=a.grep,n=a.inArray,m=a.isArray,u=a.isNumber,A=a.isString,w=a.merge,I=a.normalizeTickInterval,y=a.pick,F=a.PlotLineOrBand,t=a.removeEvent,v=a.splat,E=a.syncTimeout,K=a.Tick;a.Axis=function(){this.init.apply(this,arguments)};a.Axis.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,labels:{enabled:!0,
x:0},minPadding:.01,maxPadding:.01,minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:!1,tickLength:10,tickmarkPlacement:"between",tickPixelInterval:100,tickPosition:"outside",title:{align:"middle"},type:"linear"},defaultYAxisOptions:{endOnTick:!0,tickPixelInterval:72,showLastLabel:!0,labels:{x:-8},maxPadding:.05,minPadding:.05,startOnTick:!0,title:{rotation:270,text:"Values"},stackLabels:{enabled:!1,formatter:function(){return a.numberFormat(this.total,-1)}}},defaultLeftAxisOptions:{labels:{x:-15},
title:{rotation:270}},defaultRightAxisOptions:{labels:{x:15},title:{rotation:90}},defaultBottomAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},defaultTopAxisOptions:{labels:{autoRotation:[-45],x:0},title:{rotation:0}},init:function(a,c){var b=c.isX;this.chart=a;this.horiz=a.inverted?!b:b;this.isXAxis=b;this.coll=this.coll||(b?"xAxis":"yAxis");this.opposite=c.opposite;this.side=c.side||(this.horiz?this.opposite?0:2:this.opposite?1:3);this.setOptions(c);var g=this.options,e=g.type;
this.labelFormatter=g.labels.formatter||this.defaultLabelFormatter;this.userOptions=c;this.minPixelPadding=0;this.reversed=g.reversed;this.visible=!1!==g.visible;this.zoomEnabled=!1!==g.zoomEnabled;this.hasNames="category"===e||!0===g.categories;this.categories=g.categories||this.hasNames;this.names=this.names||[];this.isLog="logarithmic"===e;this.isDatetimeAxis="datetime"===e;this.isLinked=h(g.linkedTo);this.ticks={};this.labelEdge=[];this.minorTicks={};this.plotLinesAndBands=[];this.alternateBands=
{};this.len=0;this.minRange=this.userMinRange=g.minRange||g.maxZoom;this.range=g.range;this.offset=g.offset||0;this.stacks={};this.oldStacks={};this.stacksTouched=0;this.min=this.max=null;this.crosshair=y(g.crosshair,v(a.options.tooltip.crosshairs)[b?0:1],!1);var m,g=this.options.events;-1===n(this,a.axes)&&(b?a.axes.splice(a.xAxis.length,0,this):a.axes.push(this),a[this.coll].push(this));this.series=this.series||[];a.inverted&&b&&void 0===this.reversed&&(this.reversed=!0);this.removePlotLine=this.removePlotBand=
this.removePlotBandOrLine;for(m in g)D(this,m,g[m]);this.isLog&&(this.val2lin=this.log2lin,this.lin2val=this.lin2log)},setOptions:function(a){this.options=w(this.defaultOptions,"yAxis"===this.coll&&this.defaultYAxisOptions,[this.defaultTopAxisOptions,this.defaultRightAxisOptions,this.defaultBottomAxisOptions,this.defaultLeftAxisOptions][this.side],w(d[this.coll],a))},defaultLabelFormatter:function(){var c=this.axis,b=this.value,g=c.categories,e=this.dateTimeLabelFormat,m=d.lang.numericSymbols,f=m&&
m.length,n,u=c.options.labels.format,c=c.isLog?b:c.tickInterval;if(u)n=B(u,this);else if(g)n=b;else if(e)n=a.dateFormat(e,b);else if(f&&1E3<=c)for(;f--&&void 0===n;)g=Math.pow(1E3,f+1),c>=g&&0===10*b%g&&null!==m[f]&&0!==b&&(n=a.numberFormat(b/g,-1)+m[f]);void 0===n&&(n=1E4<=Math.abs(b)?a.numberFormat(b,-1):a.numberFormat(b,-1,void 0,""));return n},getSeriesExtremes:function(){var a=this,c=a.chart;a.hasVisibleSeries=!1;a.dataMin=a.dataMax=a.threshold=null;a.softThreshold=!a.isXAxis;a.buildStacks&&
a.buildStacks();e(a.series,function(b){if(b.visible||!c.options.chart.ignoreHiddenSeries){var e=b.options,m=e.threshold,f;a.hasVisibleSeries=!0;a.isLog&&0>=m&&(m=null);if(a.isXAxis)e=b.xData,e.length&&(b=H(e),u(b)||b instanceof Date||(e=g(e,function(a){return u(a)}),b=H(e)),a.dataMin=Math.min(y(a.dataMin,e[0]),b),a.dataMax=Math.max(y(a.dataMax,e[0]),G(e)));else if(b.getExtremes(),f=b.dataMax,b=b.dataMin,h(b)&&h(f)&&(a.dataMin=Math.min(y(a.dataMin,b),b),a.dataMax=Math.max(y(a.dataMax,f),f)),h(m)&&
(a.threshold=m),!e.softThreshold||a.isLog)a.softThreshold=!1}})},translate:function(a,c,b,g,e,m){var f=this.linkedParent||this,n=1,d=0,t=g?f.oldTransA:f.transA;g=g?f.oldMin:f.min;var v=f.minPixelPadding;e=(f.isOrdinal||f.isBroken||f.isLog&&e)&&f.lin2val;t||(t=f.transA);b&&(n*=-1,d=f.len);f.reversed&&(n*=-1,d-=n*(f.sector||f.len));c?(a=(a*n+d-v)/t+g,e&&(a=f.lin2val(a))):(e&&(a=f.val2lin(a)),"between"===m&&(m=.5),a=n*(a-g)*t+d+n*v+(u(m)?t*m*f.pointRange:0));return a},toPixels:function(a,c){return this.translate(a,
!1,!this.horiz,null,!0)+(c?0:this.pos)},toValue:function(a,c){return this.translate(a-(c?0:this.pos),!0,!this.horiz,null,!0)},getPlotLinePath:function(a,c,b,g,e){var m=this.chart,f=this.left,n=this.top,d,t,v=b&&m.oldChartHeight||m.chartHeight,h=b&&m.oldChartWidth||m.chartWidth,w;d=this.transB;var A=function(a,c,b){if(a<c||a>b)g?a=Math.min(Math.max(c,a),b):w=!0;return a};e=y(e,this.translate(a,null,null,b));a=b=Math.round(e+d);d=t=Math.round(v-e-d);u(e)?this.horiz?(d=n,t=v-this.bottom,a=b=A(a,f,f+
this.width)):(a=f,b=h-this.right,d=t=A(d,n,n+this.height)):w=!0;return w&&!g?null:m.renderer.crispLine(["M",a,d,"L",b,t],c||1)},getLinearTickPositions:function(a,c,b){var g,e=f(Math.floor(c/a)*a),m=f(Math.ceil(b/a)*a),d=[];if(c===b&&u(c))return[c];for(c=e;c<=m;){d.push(c);c=f(c+a);if(c===g)break;g=c}return d},getMinorTickPositions:function(){var a=this.options,c=this.tickPositions,b=this.minorTickInterval,g=[],e,m=this.pointRangePadding||0;e=this.min-m;var m=this.max+m,f=m-e;if(f&&f/b<this.len/3)if(this.isLog)for(m=
c.length,e=1;e<m;e++)g=g.concat(this.getLogTickPositions(b,c[e-1],c[e],!0));else if(this.isDatetimeAxis&&"auto"===a.minorTickInterval)g=g.concat(this.getTimeTicks(this.normalizeTimeTickInterval(b),e,m,a.startOfWeek));else for(c=e+(c[0]-e)%b;c<=m;c+=b)g.push(c);0!==g.length&&this.trimTicks(g,a.startOnTick,a.endOnTick);return g},adjustForMinRange:function(){var a=this.options,c=this.min,b=this.max,g,m=this.dataMax-this.dataMin>=this.minRange,f,d,n,t,u,v;this.isXAxis&&void 0===this.minRange&&!this.isLog&&
(h(a.min)||h(a.max)?this.minRange=null:(e(this.series,function(a){t=a.xData;for(d=u=a.xIncrement?1:t.length-1;0<d;d--)if(n=t[d]-t[d-1],void 0===f||n<f)f=n}),this.minRange=Math.min(5*f,this.dataMax-this.dataMin)));b-c<this.minRange&&(v=this.minRange,g=(v-b+c)/2,g=[c-g,y(a.min,c-g)],m&&(g[2]=this.isLog?this.log2lin(this.dataMin):this.dataMin),c=G(g),b=[c+v,y(a.max,c+v)],m&&(b[2]=this.isLog?this.log2lin(this.dataMax):this.dataMax),b=H(b),b-c<v&&(g[0]=b-v,g[1]=y(a.min,b-v),c=G(g)));this.min=c;this.max=
b},getClosest:function(){var a;this.categories?a=1:e(this.series,function(c){var b=c.closestPointRange;!c.noSharedTooltip&&h(b)&&(a=h(a)?Math.min(a,b):b)});return a},nameToX:function(a){var c=m(this.categories),b=c?this.categories:this.names,g=a.options.x,e;a.series.requireSorting=!1;h(g)||(g=!1===this.options.nameToX?a.series.autoIncrement():n(a.name,b));-1===g?c||(e=b.length):e=g;this.names[e]=a.name;return e},updateNames:function(){var a=this;0<this.names.length&&(this.names.length=0,this.minRange=
void 0,e(this.series||[],function(c){c.processedXData||(c.processData(),c.generatePoints());e(c.points,function(b,g){var e;b.options&&void 0===b.options.x&&(e=a.nameToX(b),e!==b.x&&(b.x=e,c.xData[g]=e))})}))},setAxisTranslation:function(a){var c=this,b=c.max-c.min,g=c.axisPointRange||0,m,f=0,d=0,n=c.linkedParent,t=!!c.categories,u=c.transA,v=c.isXAxis;if(v||t||g)n?(f=n.minPointOffset,d=n.pointRangePadding):(m=c.getClosest(),e(c.series,function(a){var b=t?1:v?y(a.options.pointRange,m,0):c.axisPointRange||
0;a=a.options.pointPlacement;g=Math.max(g,b);c.single||(f=Math.max(f,A(a)?0:b/2),d=Math.max(d,"on"===a?0:b))})),n=c.ordinalSlope&&m?c.ordinalSlope/m:1,c.minPointOffset=f*=n,c.pointRangePadding=d*=n,c.pointRange=Math.min(g,b),v&&(c.closestPointRange=m);a&&(c.oldTransA=u);c.translationSlope=c.transA=u=c.len/(b+d||1);c.transB=c.horiz?c.left:c.bottom;c.minPixelPadding=u*f},minFromRange:function(){return this.max-this.range},setTickInterval:function(a){var g=this,m=g.chart,d=g.options,n=g.isLog,t=g.log2lin,
v=g.isDatetimeAxis,w=g.isXAxis,A=g.isLinked,E=d.maxPadding,k=d.minPadding,l=d.tickInterval,B=d.tickPixelInterval,q=g.categories,K=g.threshold,F=g.softThreshold,p,D,C,G;v||q||A||this.getTickAmount();C=y(g.userMin,d.min);G=y(g.userMax,d.max);A?(g.linkedParent=m[g.coll][d.linkedTo],m=g.linkedParent.getExtremes(),g.min=y(m.min,m.dataMin),g.max=y(m.max,m.dataMax),d.type!==g.linkedParent.options.type&&b(11,1)):(!F&&h(K)&&(g.dataMin>=K?(p=K,k=0):g.dataMax<=K&&(D=K,E=0)),g.min=y(C,p,g.dataMin),g.max=y(G,
D,g.dataMax));n&&(!a&&0>=Math.min(g.min,y(g.dataMin,g.min))&&b(10,1),g.min=f(t(g.min),15),g.max=f(t(g.max),15));g.range&&h(g.max)&&(g.userMin=g.min=C=Math.max(g.min,g.minFromRange()),g.userMax=G=g.max,g.range=null);z(g,"foundExtremes");g.beforePadding&&g.beforePadding();g.adjustForMinRange();!(q||g.axisPointRange||g.usePercentage||A)&&h(g.min)&&h(g.max)&&(t=g.max-g.min)&&(!h(C)&&k&&(g.min-=t*k),!h(G)&&E&&(g.max+=t*E));u(d.floor)&&(g.min=Math.max(g.min,d.floor));u(d.ceiling)&&(g.max=Math.min(g.max,
d.ceiling));F&&h(g.dataMin)&&(K=K||0,!h(C)&&g.min<K&&g.dataMin>=K?g.min=K:!h(G)&&g.max>K&&g.dataMax<=K&&(g.max=K));g.tickInterval=g.min===g.max||void 0===g.min||void 0===g.max?1:A&&!l&&B===g.linkedParent.options.tickPixelInterval?l=g.linkedParent.tickInterval:y(l,this.tickAmount?(g.max-g.min)/Math.max(this.tickAmount-1,1):void 0,q?1:(g.max-g.min)*B/Math.max(g.len,B));w&&!a&&e(g.series,function(a){a.processData(g.min!==g.oldMin||g.max!==g.oldMax)});g.setAxisTranslation(!0);g.beforeSetTickPositions&&
g.beforeSetTickPositions();g.postProcessTickInterval&&(g.tickInterval=g.postProcessTickInterval(g.tickInterval));g.pointRange&&!l&&(g.tickInterval=Math.max(g.pointRange,g.tickInterval));a=y(d.minTickInterval,g.isDatetimeAxis&&g.closestPointRange);!l&&g.tickInterval<a&&(g.tickInterval=a);v||n||l||(g.tickInterval=I(g.tickInterval,null,c(g.tickInterval),y(d.allowDecimals,!(.5<g.tickInterval&&5>g.tickInterval&&1E3<g.max&&9999>g.max)),!!this.tickAmount));this.tickAmount||(g.tickInterval=g.unsquish());
this.setTickPositions()},setTickPositions:function(){var a=this.options,c,g=a.tickPositions,b=a.tickPositioner,e=a.startOnTick,m=a.endOnTick,d;this.tickmarkOffset=this.categories&&"between"===a.tickmarkPlacement&&1===this.tickInterval?.5:0;this.minorTickInterval="auto"===a.minorTickInterval&&this.tickInterval?this.tickInterval/5:a.minorTickInterval;this.tickPositions=c=g&&g.slice();!c&&(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()]),this.tickPositions=c,b&&(b=b.apply(this,[this.min,this.max])))&&(this.tickPositions=c=b);this.isLinked||(this.trimTicks(c,e,m),this.min===this.max&&h(this.min)&&!this.tickAmount&&(d=!0,this.min-=.5,this.max+=.5),this.single=d,g||b||this.adjustTickAmount())},trimTicks:function(a,
c,g){var b=a[0],e=a[a.length-1],m=this.minPointOffset||0;if(c)this.min=b;else for(;this.min-m>a[0];)a.shift();if(g)this.max=e;else for(;this.max+m<a[a.length-1];)a.pop();0===a.length&&h(b)&&a.push((e+b)/2)},alignToOthers:function(){var a={},c,g=this.options;!1!==this.chart.options.chart.alignTicks&&!1!==g.alignTicks&&e(this.chart[this.coll],function(g){var b=g.options,b=[g.horiz?b.left:b.top,b.width,b.height,b.pane].join();g.series.length&&(a[b]?c=!0:a[b]=1)});return c},getTickAmount:function(){var a=
this.options,c=a.tickAmount,g=a.tickPixelInterval;!h(a.tickInterval)&&this.len<g&&!this.isRadial&&!this.isLog&&a.startOnTick&&a.endOnTick&&(c=2);!c&&this.alignToOthers()&&(c=Math.ceil(this.len/g)+1);4>c&&(this.finalTickAmt=c,c=5);this.tickAmount=c},adjustTickAmount:function(){var a=this.tickInterval,c=this.tickPositions,g=this.tickAmount,b=this.finalTickAmt,e=c&&c.length;if(e<g){for(;c.length<g;)c.push(f(c[c.length-1]+a));this.transA*=(e-1)/(g-1);this.max=c[c.length-1]}else e>g&&(this.tickInterval*=
2,this.setTickPositions());if(h(b)){for(a=g=c.length;a--;)(3===b&&1===a%2||2>=b&&0<a&&a<g-1)&&c.splice(a,1);this.finalTickAmt=void 0}},setScale:function(){var a,c;this.oldMin=this.min;this.oldMax=this.max;this.oldAxisLength=this.len;this.setAxisSize();c=this.len!==this.oldAxisLength;e(this.series,function(c){if(c.isDirtyData||c.isDirty||c.xAxis.isDirty)a=!0});c||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=c||this.min!==this.oldMin||this.max!==this.oldMax)):this.cleanStacks&&this.cleanStacks()},setExtremes:function(a,c,g,b,m){var d=this,f=d.chart;g=y(g,!0);e(d.series,function(a){delete a.kdTree});m=q(m,{min:a,max:c});z(d,"setExtremes",m,function(){d.userMin=a;d.userMax=c;d.eventArgs=m;g&&f.redraw(b)})},zoom:function(a,c){var g=this.dataMin,
b=this.dataMax,e=this.options,m=Math.min(g,y(e.min,g)),e=Math.max(b,y(e.max,b));this.allowZoomOutside||(h(g)&&a<=m&&(a=m),h(b)&&c>=e&&(c=e));this.displayBtn=void 0!==a||void 0!==c;this.setExtremes(a,c,!1,void 0,{trigger:"zoom"});return!0},setAxisSize:function(){var a=this.chart,c=this.options,g=c.offsetLeft||0,b=this.horiz,e=y(c.width,a.plotWidth-g+(c.offsetRight||0)),m=y(c.height,a.plotHeight),d=y(c.top,a.plotTop),c=y(c.left,a.plotLeft+g),g=/%$/;g.test(m)&&(m=Math.round(parseFloat(m)/100*a.plotHeight));
g.test(d)&&(d=Math.round(parseFloat(d)/100*a.plotHeight+a.plotTop));this.left=c;this.top=d;this.width=e;this.height=m;this.bottom=a.chartHeight-m-d;this.right=a.chartWidth-e-c;this.len=Math.max(b?e:m,0);this.pos=b?c:d},getExtremes:function(){var a=this.isLog,c=this.lin2log;return{min:a?f(c(this.min)):this.min,max:a?f(c(this.max)):this.max,dataMin:this.dataMin,dataMax:this.dataMax,userMin:this.userMin,userMax:this.userMax}},getThreshold:function(a){var c=this.isLog,g=this.lin2log,b=c?g(this.min):this.min,
c=c?g(this.max):this.max;null===a?a=b:b>a?a=b:c<a&&(a=c);return this.translate(a,0,1,0,1)},autoLabelAlign:function(a){a=(y(a,0)-90*this.side+720)%360;return 15<a&&165>a?"right":195<a&&345>a?"left":"center"},tickSize:function(a){var c=this.options,g=c[a+"Length"],b=y(c[a+"Width"],"tick"===a&&this.isXAxis?1:0);if(b&&g)return"inside"===c[a+"Position"]&&(g=-g),[g,b]},labelMetrics:function(){return this.chart.renderer.fontMetrics(this.options.labels.style&&this.options.labels.style.fontSize,this.ticks[0]&&
this.ticks[0].label)},unsquish:function(){var a=this.options.labels,c=this.horiz,g=this.tickInterval,b=g,m=this.len/(((this.categories?1:0)+this.max-this.min)/g),d,f=a.rotation,n=this.labelMetrics(),t,u=Number.MAX_VALUE,v,A=function(a){a/=m||1;a=1<a?Math.ceil(a):1;return a*g};c?(v=!a.staggerLines&&!a.step&&(h(f)?[f]:m<y(a.autoRotationLimit,80)&&a.autoRotation))&&e(v,function(a){var c;if(a===f||a&&-90<=a&&90>=a)t=A(Math.abs(n.h/Math.sin(k*a))),c=t+Math.abs(a/360),c<u&&(u=c,d=a,b=t)}):a.step||(b=A(n.h));
this.autoRotation=v;this.labelRotation=y(d,f);return b},getSlotWidth:function(){var a=this.chart,c=this.horiz,g=this.options.labels,b=Math.max(this.tickPositions.length-(this.categories?0:1),1),e=a.margin[3];return c&&2>(g.step||0)&&!g.rotation&&(this.staggerLines||1)*a.plotWidth/b||!c&&(e&&e-a.spacing[3]||.33*a.chartWidth)},renderUnsquish:function(){var a=this.chart,c=a.renderer,g=this.tickPositions,b=this.ticks,m=this.options.labels,d=this.horiz,f=this.getSlotWidth(),n=Math.max(1,Math.round(f-2*
(m.padding||5))),t={},u=this.labelMetrics(),v=m.style&&m.style.textOverflow,h,E=0,y,l;A(m.rotation)||(t.rotation=m.rotation||0);e(g,function(a){(a=b[a])&&a.labelLength>E&&(E=a.labelLength)});this.maxLabelLength=E;if(this.autoRotation)E>n&&E>u.h?t.rotation=this.labelRotation:this.labelRotation=0;else if(f&&(h={width:n+"px"},!v))for(h.textOverflow="clip",y=g.length;!d&&y--;)if(l=g[y],n=b[l].label)n.styles&&"ellipsis"===n.styles.textOverflow?n.css({textOverflow:"clip"}):b[l].labelLength>f&&n.css({width:f+
"px"}),n.getBBox().height>this.len/g.length-(u.h-u.f)&&(n.specCss={textOverflow:"ellipsis"});t.rotation&&(h={width:(E>.5*a.chartHeight?.33*a.chartHeight:a.chartHeight)+"px"},v||(h.textOverflow="ellipsis"));if(this.labelAlign=m.align||this.autoLabelAlign(this.labelRotation))t.align=this.labelAlign;e(g,function(a){var c=(a=b[a])&&a.label;c&&(c.attr(t),h&&c.css(w(h,c.specCss)),delete c.specCss,a.rotation=t.rotation)});this.tickRotCorr=c.rotCorr(u.b,this.labelRotation||0,0!==this.side)},hasData:function(){return this.hasVisibleSeries||
h(this.min)&&h(this.max)&&!!this.tickPositions},getOffset:function(){var a=this,c=a.chart,g=c.renderer,b=a.options,m=a.tickPositions,d=a.ticks,f=a.horiz,n=a.side,t=c.inverted?[1,0,3,2][n]:n,u,v,A=0,w,E=0,l=b.title,z=b.labels,k=0,B=a.opposite,I=c.axisOffset,c=c.clipOffset,q=[-1,1,1,-1][n],F,p=b.className,D=a.axisParent,C=this.tickSize("tick");u=a.hasData();a.showAxis=v=u||y(b.showEmpty,!0);a.staggerLines=a.horiz&&z.staggerLines;a.axisGroup||(a.gridGroup=g.g("grid").attr({zIndex:b.gridZIndex||1}).addClass("highcharts-"+
this.coll.toLowerCase()+"-grid "+(p||"")).add(D),a.axisGroup=g.g("axis").attr({zIndex:b.zIndex||2}).addClass("highcharts-"+this.coll.toLowerCase()+" "+(p||"")).add(D),a.labelGroup=g.g("axis-labels").attr({zIndex:z.zIndex||7}).addClass("highcharts-"+a.coll.toLowerCase()+"-labels "+(p||"")).add(D));if(u||a.isLinked)e(m,function(c){d[c]?d[c].addLabel():d[c]=new K(a,c)}),a.renderUnsquish(),!1===z.reserveSpace||0!==n&&2!==n&&{1:"left",3:"right"}[n]!==a.labelAlign&&"center"!==a.labelAlign||e(m,function(a){k=
Math.max(d[a].getLabelSize(),k)}),a.staggerLines&&(k*=a.staggerLines,a.labelOffset=k*(a.opposite?-1:1));else for(F in d)d[F].destroy(),delete d[F];l&&l.text&&!1!==l.enabled&&(a.axisTitle||((F=l.textAlign)||(F=(f?{low:"left",middle:"center",high:"right"}:{low:B?"right":"left",middle:"center",high:B?"left":"right"})[l.align]),a.axisTitle=g.text(l.text,0,0,l.useHTML).attr({zIndex:7,rotation:l.rotation||0,align:F}).addClass("highcharts-axis-title").add(a.axisGroup),a.axisTitle.isNew=!0),v&&(A=a.axisTitle.getBBox()[f?
"height":"width"],w=l.offset,E=h(w)?0:y(l.margin,f?5:10)),a.axisTitle[v?"show":"hide"](!0));a.renderLine();a.offset=q*y(b.offset,I[n]);a.tickRotCorr=a.tickRotCorr||{x:0,y:0};g=0===n?-a.labelMetrics().h:2===n?a.tickRotCorr.y:0;E=Math.abs(k)+E;k&&(E=E-g+q*(f?y(z.y,a.tickRotCorr.y+8*q):z.x));a.axisTitleMargin=y(w,E);I[n]=Math.max(I[n],a.axisTitleMargin+A+q*a.offset,E,u&&m.length&&C?C[0]:0);b=b.offset?0:2*Math.floor(a.axisLine.strokeWidth()/2);c[t]=Math.max(c[t],b)},getLinePath:function(a){var c=this.chart,
g=this.opposite,b=this.offset,e=this.horiz,m=this.left+(g?this.width:0)+b,b=c.chartHeight-this.bottom-(g?this.height:0)+b;g&&(a*=-1);return c.renderer.crispLine(["M",e?this.left:m,e?b:this.top,"L",e?c.chartWidth-this.right:m,e?b:c.chartHeight-this.bottom],a)},renderLine:function(){this.axisLine||(this.axisLine=this.chart.renderer.path().addClass("highcharts-axis-line").add(this.axisGroup))},getTitlePosition:function(){var a=this.horiz,c=this.left,g=this.top,b=this.len,e=this.options.title,m=a?c:g,
d=this.opposite,f=this.offset,n=e.x||0,t=e.y||0,u=this.chart.renderer.fontMetrics(e.style&&e.style.fontSize,this.axisTitle).f,b={low:m+(a?0:b),middle:m+b/2,high:m+(a?b:0)}[e.align],c=(a?g+this.height:c)+(a?1:-1)*(d?-1:1)*this.axisTitleMargin+(2===this.side?u:0);return{x:a?b+n:c+(d?this.width:0)+f+n,y:a?c+t-(d?this.height:0)+f:b+t}},render:function(){var a=this,c=a.chart,g=c.renderer,b=a.options,m=a.isLog,d=a.lin2log,f=a.isLinked,n=a.tickPositions,t=a.axisTitle,v=a.ticks,h=a.minorTicks,A=a.alternateBands,
w=b.stackLabels,y=b.alternateGridColor,l=a.tickmarkOffset,z=a.axisLine,k=c.hasRendered&&u(a.oldMin),B=a.showAxis,I=C(g.globalAnimation),q,p;a.labelEdge.length=0;a.overlap=!1;e([v,h,A],function(a){for(var c in a)a[c].isActive=!1});if(a.hasData()||f)a.minorTickInterval&&!a.categories&&e(a.getMinorTickPositions(),function(c){h[c]||(h[c]=new K(a,c,"minor"));k&&h[c].isNew&&h[c].render(null,!0);h[c].render(null,!1,1)}),n.length&&(e(n,function(c,g){if(!f||c>=a.min&&c<=a.max)v[c]||(v[c]=new K(a,c)),k&&v[c].isNew&&
v[c].render(g,!0,.1),v[c].render(g)}),l&&(0===a.min||a.single)&&(v[-1]||(v[-1]=new K(a,-1,null,!0)),v[-1].render(-1))),y&&e(n,function(g,b){p=void 0!==n[b+1]?n[b+1]+l:a.max-l;0===b%2&&g<a.max&&p<=a.max+(c.polar?-l:l)&&(A[g]||(A[g]=new F(a)),q=g+l,A[g].options={from:m?d(q):q,to:m?d(p):p,color:y},A[g].render(),A[g].isActive=!0)}),a._addedPlotLB||(e((b.plotLines||[]).concat(b.plotBands||[]),function(c){a.addPlotBandOrLine(c)}),a._addedPlotLB=!0);e([v,h,A],function(a){var g,b,e=[],m=I.duration;for(g in a)a[g].isActive||
(a[g].render(g,!1,0),a[g].isActive=!1,e.push(g));E(function(){for(b=e.length;b--;)a[e[b]]&&!a[e[b]].isActive&&(a[e[b]].destroy(),delete a[e[b]])},a!==A&&c.hasRendered&&m?m:0)});z&&(z[z.isPlaced?"animate":"attr"]({d:this.getLinePath(z.strokeWidth())}),z.isPlaced=!0,z[B?"show":"hide"](!0));t&&B&&(t[t.isNew?"attr":"animate"](a.getTitlePosition()),t.isNew=!1);w&&w.enabled&&a.renderStackTotals();a.isDirty=!1},redraw:function(){this.visible&&(this.render(),e(this.plotLinesAndBands,function(a){a.render()}));
e(this.series,function(a){a.isDirty=!0})},destroy:function(a){var c=this,g=c.stacks,b,m=c.plotLinesAndBands,d;a||t(c);for(b in g)l(g[b]),g[b]=null;e([c.ticks,c.minorTicks,c.alternateBands],function(a){l(a)});if(m)for(a=m.length;a--;)m[a].destroy();e("stackTotalGroup axisLine axisTitle axisGroup gridGroup labelGroup cross".split(" "),function(a){c[a]&&(c[a]=c[a].destroy())});m=["names","series","userMax","userMin"];for(d in c)c.hasOwnProperty(d)&&-1===n(d,m)&&delete c[d]},drawCrosshair:function(a,
c){var g,b=this.crosshair,e,m=this.cross;a||(a=this.cross&&this.cross.e);this.crosshair&&!1!==(h(c)||!y(b.snap,!0))?(y(b.snap,!0)?h(c)&&(g=this.isXAxis?c.plotX:this.len-c.plotY):g=this.horiz?a.chartX-this.pos:this.len-a.chartY+this.pos,g=this.isRadial?this.getPlotLinePath(this.isXAxis?c.x:y(c.stackY,c.y))||null:this.getPlotLinePath(null,null,null,null,g)||null,null===g?this.hideCrosshair():(e=this.categories&&!this.isRadial,m||(this.cross=m=this.chart.renderer.path().addClass("highcharts-crosshair highcharts-crosshair-"+
(e?"category ":"thin ")+b.className).attr({zIndex:y(b.zIndex,2)}).add()),m.show().attr({d:g}),e&&m.attr({"stroke-width":this.transA}),this.cross.e=a)):this.hideCrosshair()},hideCrosshair:function(){this.cross&&this.cross.hide()}};q(a.Axis.prototype,p)})(J);(function(a){var D=a.Axis,C=a.Date,G=a.defaultOptions,H=a.defined,p=a.each,f=a.extend,d=a.getMagnitude,h=a.getTZOffset,k=a.grep,l=a.normalizeTickInterval,e=a.pick,b=a.timeUnits;D.prototype.getTimeTicks=function(a,d,l,c){var g=[],n={},m=G.global.useUTC,
u,A=new C(d-h(d)),w=C.hcMakeTime,I=a.unitRange,y=a.count;if(H(d)){A[C.hcSetMilliseconds](I>=b.second?0:y*Math.floor(A.getMilliseconds()/y));if(I>=b.second)A[C.hcSetSeconds](I>=b.minute?0:y*Math.floor(A.getSeconds()/y));if(I>=b.minute)A[C.hcSetMinutes](I>=b.hour?0:y*Math.floor(A[C.hcGetMinutes]()/y));if(I>=b.hour)A[C.hcSetHours](I>=b.day?0:y*Math.floor(A[C.hcGetHours]()/y));if(I>=b.day)A[C.hcSetDate](I>=b.month?1:y*Math.floor(A[C.hcGetDate]()/y));I>=b.month&&(A[C.hcSetMonth](I>=b.year?0:y*Math.floor(A[C.hcGetMonth]()/
y)),u=A[C.hcGetFullYear]());if(I>=b.year)A[C.hcSetFullYear](u-u%y);if(I===b.week)A[C.hcSetDate](A[C.hcGetDate]()-A[C.hcGetDay]()+e(c,1));d=1;if(C.hcTimezoneOffset||C.hcGetTimezoneOffset)A=A.getTime(),A=new C(A+h(A));u=A[C.hcGetFullYear]();c=A.getTime();for(var F=A[C.hcGetMonth](),t=A[C.hcGetDate](),v=!m||!!C.hcGetTimezoneOffset,E=(b.day+(m?h(A):6E4*A.getTimezoneOffset()))%b.day;c<l;)g.push(c),c=I===b.year?w(u+d*y,0):I===b.month?w(u,F+d*y):!v||I!==b.day&&I!==b.week?c+I*y:w(u,F,t+d*y*(I===b.day?1:7)),
d++;g.push(c);p(k(g,function(a){return I<=b.hour&&a%b.day===E}),function(a){n[a]="day"})}g.info=f(a,{higherRanks:n,totalRange:I*y});return g};D.prototype.normalizeTimeTickInterval=function(a,e){var f=e||[["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]],c=f[f.length-1],g=b[c[0]],n=c[1],m;for(m=0;m<f.length&&!(c=f[m],g=b[c[0]],n=c[1],f[m+1]&&a<=(g*n[n.length-
1]+b[f[m+1][0]])/2);m++);g===b.year&&a<5*g&&(n=[1,2,5]);f=l(a/g,n,"year"===c[0]?Math.max(d(a/g),1):1);return{unitRange:g,count:f,unitName:c[0]}}})(J);(function(a){var D=a.Axis,C=a.getMagnitude,G=a.map,H=a.normalizeTickInterval,p=a.pick;D.prototype.getLogTickPositions=function(a,d,h,k){var l=this.options,e=this.len,b=this.lin2log,q=this.log2lin,z=[];k||(this._minorAutoInterval=null);if(.5<=a)a=Math.round(a),z=this.getLinearTickPositions(a,d,h);else if(.08<=a)for(var e=Math.floor(d),B,c,g,n,m,l=.3<
a?[1,2,4]:.15<a?[1,2,4,6,8]:[1,2,3,4,5,6,7,8,9];e<h+1&&!m;e++)for(c=l.length,B=0;B<c&&!m;B++)g=q(b(e)*l[B]),g>d&&(!k||n<=h)&&void 0!==n&&z.push(n),n>h&&(m=!0),n=g;else d=b(d),h=b(h),a=l[k?"minorTickInterval":"tickInterval"],a=p("auto"===a?null:a,this._minorAutoInterval,l.tickPixelInterval/(k?5:1)*(h-d)/((k?e/this.tickPositions.length:e)||1)),a=H(a,null,C(a)),z=G(this.getLinearTickPositions(a,d,h),q),k||(this._minorAutoInterval=a/5);k||(this.tickInterval=a);return z};D.prototype.log2lin=function(a){return Math.log(a)/
Math.LN10};D.prototype.lin2log=function(a){return Math.pow(10,a)}})(J);(function(a){var D=a.addEvent,C=a.dateFormat,G=a.each,H=a.extend,p=a.format,f=a.isNumber,d=a.map,h=a.merge,k=a.pick,l=a.splat,e=a.stop,b=a.syncTimeout,q=a.timeUnits;a.Tooltip=function(){this.init.apply(this,arguments)};a.Tooltip.prototype={init:function(a,b){this.chart=a;this.options=b;this.crosshairs=[];this.now={x:0,y:0};this.isHidden=!0;this.split=b.split&&!a.inverted;this.shared=b.shared||this.split;this.label=this.split?this.chart.renderer.g("tooltip"):
a.renderer.label("",0,0,b.shape||"callout",null,null,b.useHTML,null,"tooltip").attr({padding:b.padding,r:b.borderRadius,display:"none"});this.label.attr({zIndex:8}).add()},update:function(a){this.destroy();this.init(this.chart,h(!0,this.options,a))},destroy:function(){this.label&&(this.label=this.label.destroy());clearTimeout(this.hideTimer);clearTimeout(this.tooltipTimeout)},move:function(a,b,c,g){var e=this,m=e.now,d=!1!==e.options.animation&&!e.isHidden&&(1<Math.abs(a-m.x)||1<Math.abs(b-m.y)),
f=e.followPointer||1<e.len;H(m,{x:d?(2*m.x+a)/3:a,y:d?(m.y+b)/2:b,anchorX:f?void 0:d?(2*m.anchorX+c)/3:c,anchorY:f?void 0:d?(m.anchorY+g)/2:g});e.label.attr(m);d&&(clearTimeout(this.tooltipTimeout),this.tooltipTimeout=setTimeout(function(){e&&e.move(a,b,c,g)},32))},hide:function(a){var e=this;clearTimeout(this.hideTimer);a=k(a,this.options.hideDelay,500);this.isHidden||(this.hideTimer=b(function(){e.label[a?"fadeOut":"hide"]();e.isHidden=!0},a))},getAnchor:function(a,b){var c,g=this.chart,e=g.inverted,
m=g.plotTop,f=g.plotLeft,h=0,w=0,k,y;a=l(a);c=a[0].tooltipPos;this.followPointer&&b&&(void 0===b.chartX&&(b=g.pointer.normalize(b)),c=[b.chartX-g.plotLeft,b.chartY-m]);c||(G(a,function(a){k=a.series.yAxis;y=a.series.xAxis;h+=a.plotX+(!e&&y?y.left-f:0);w+=(a.plotLow?(a.plotLow+a.plotHigh)/2:a.plotY)+(!e&&k?k.top-m:0)}),h/=a.length,w/=a.length,c=[e?g.plotWidth-w:h,this.shared&&!e&&1<a.length&&b?b.chartY-m:e?g.plotHeight-h:w]);return d(c,Math.round)},getPosition:function(a,b,c){var g=this.chart,e=this.distance,
m={},d=c.h||0,f,h=["y",g.chartHeight,b,c.plotY+g.plotTop,g.plotTop,g.plotTop+g.plotHeight],l=["x",g.chartWidth,a,c.plotX+g.plotLeft,g.plotLeft,g.plotLeft+g.plotWidth],y=!this.followPointer&&k(c.ttBelow,!g.inverted===!!c.negative),q=function(a,c,b,g,f,t){var v=b<g-e,h=g+e+b<c,A=g-e-b;g+=e;if(y&&h)m[a]=g;else if(!y&&v)m[a]=A;else if(v)m[a]=Math.min(t-b,0>A-d?A:A-d);else if(h)m[a]=Math.max(f,g+d+b>c?g:g+d);else return!1},t=function(a,c,g,b){var d;b<e||b>c-e?d=!1:m[a]=b<g/2?1:b>c-g/2?c-g-2:b-g/2;return d},
v=function(a){var c=h;h=l;l=c;f=a},E=function(){!1!==q.apply(0,h)?!1!==t.apply(0,l)||f||(v(!0),E()):f?m.x=m.y=0:(v(!0),E())};(g.inverted||1<this.len)&&v();E();return m},defaultFormatter:function(a){var b=this.points||l(this),c;c=[a.tooltipFooterHeaderFormatter(b[0])];c=c.concat(a.bodyFormatter(b));c.push(a.tooltipFooterHeaderFormatter(b[0],!0));return c},refresh:function(a,b){var c=this.chart,g=this.label,d,m,f,h={},w,I=[];w=this.options.formatter||this.defaultFormatter;var h=c.hoverPoints,y=this.shared;
clearTimeout(this.hideTimer);this.followPointer=l(a)[0].series.tooltipOptions.followPointer;f=this.getAnchor(a,b);d=f[0];m=f[1];!y||a.series&&a.series.noSharedTooltip?h=a.getLabelConfig():(c.hoverPoints=a,h&&G(h,function(a){a.setState()}),G(a,function(a){a.setState("hover");I.push(a.getLabelConfig())}),h={x:a[0].category,y:a[0].y},h.points=I,this.len=I.length,a=a[0]);w=w.call(h,this);h=a.series;this.distance=k(h.tooltipOptions.distance,16);!1===w?this.hide():(this.isHidden&&(e(g),g.attr({opacity:1,
display:"block"}).show()),this.split?this.renderSplit(w,c.hoverPoints):(g.attr({text:w.join?w.join(""):w}),g.removeClass(/highcharts-color-[\d]+/g).addClass("highcharts-color-"+k(a.colorIndex,h.colorIndex)),this.updatePosition({plotX:d,plotY:m,negative:a.negative,ttBelow:a.ttBelow,h:f[2]||0})),this.isHidden=!1)},renderSplit:function(b,e){var c=this,g=[],d=this.chart,m=d.renderer,f=!0,h=this.options,w;G(b.slice(0,b.length-1),function(a,b){var l=e[b-1]||{isHeader:!0,plotX:e[0].plotX},t=l.series||c,
v=t.tt,E="highcharts-color-"+k(l.colorIndex,(l.series||{}).colorIndex,"none"),q;v||(t.tt=v=m.label(null,null,null,l.isHeader&&"callout").addClass("highcharts-tooltip-box "+E).attr({padding:h.padding,r:h.borderRadius}).add(c.label),l.series&&(v.connector=m.path().addClass("highcharts-tooltip-connector "+E).add(c.label),D(l.series,"hide",function(){var a=this.tt;a.connector=a.connector.destroy();a.destroy();this.tt=void 0})));v.isActive=!0;v.attr({text:a});E=v.getBBox();l.isHeader?(w=E.height,q=l.plotX+
d.plotLeft-E.width/2):q=l.plotX+d.plotLeft-k(h.distance,16)-E.width;0>q&&(f=!1);E=(l.series&&l.series.yAxis&&l.series.yAxis.pos)+(l.plotY||0);E-=d.plotTop;g.push({target:l.isHeader?d.plotHeight+w:E,rank:l.isHeader?1:0,size:t.tt.getBBox().height+1,point:l,x:q,tt:v})});G(d.series,function(a){var c=a.tt;c&&(c.isActive?c.isActive=!1:(c.connector=c.connector.destroy(),c.destroy(),a.tt=void 0))});a.distribute(g,d.plotHeight+w);G(g,function(a){var c=a.point,b=a.tt,g;g={display:void 0===a.pos?"none":"",x:f||
c.isHeader?a.x:c.plotX+d.plotLeft+k(h.distance,16),y:a.pos+d.plotTop};c.isHeader&&(g.anchorX=c.plotX+d.plotLeft,g.anchorY=g.y-100);b.attr(g);c.isHeader||b.connector.attr({d:["M",c.plotX+d.plotLeft,c.plotY+c.series.yAxis.pos,"L",f?c.plotX+d.plotLeft-k(h.distance,16):c.plotX+d.plotLeft+k(h.distance,16),a.pos+d.plotTop+b.getBBox().height/2]})})},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(Math.round(c.x),
Math.round(c.y||0),a.plotX+b.plotLeft,a.plotY+b.plotTop)},getXDateFormat:function(a,b,c){var g;b=b.dateTimeLabelFormats;var e=c&&c.closestPointRange,m,d={millisecond:15,second:12,minute:9,hour:6,day:3},f,h="millisecond";if(e){f=C("%m-%d %H:%M:%S.%L",a.x);for(m in q){if(e===q.week&&+C("%w",a.x)===c.options.startOfWeek&&"00:00:00.000"===f.substr(6)){m="week";break}if(q[m]>e){m=h;break}if(d[m]&&f.substr(d[m])!=="01-01 00:00:00.000".substr(d[m]))break;"week"!==m&&(h=m)}m&&(g=b[m])}else g=b.day;return g||
b.year},tooltipFooterHeaderFormatter:function(a,b){var c=b?"footer":"header",g=a.series,e=g.tooltipOptions,m=e.xDateFormat,d=g.xAxis,h=d&&"datetime"===d.options.type&&f(a.key),c=e[c+"Format"];h&&!m&&(m=this.getXDateFormat(a,e,d));h&&m&&(c=c.replace("{point.key}","{point.key:"+m+"}"));return p(c,{point:a,series:g})},bodyFormatter:function(a){return d(a,function(a){var c=a.series.tooltipOptions;return(c.pointFormatter||a.point.tooltipFormatter).call(a.point,c.pointFormat)})}}})(J);(function(a){var D=
a.addEvent,C=a.attr,G=a.charts,H=a.css,p=a.defined,f=a.doc,d=a.each,h=a.extend,k=a.fireEvent,l=a.offset,e=a.pick,b=a.removeEvent,q=a.splat,z=a.Tooltip,B=a.win;a.hasTouch=f&&void 0!==f.documentElement.ontouchstart;a.Pointer=function(a,b){this.init(a,b)};a.Pointer.prototype={init:function(a,b){this.options=b;this.chart=a;this.runChartClick=b.chart.events&&!!b.chart.events.click;this.pinchDown=[];this.lastValidTouch={};z&&b.tooltip.enabled&&(a.tooltip=new z(a,b.tooltip),this.followTouchMove=e(b.tooltip.followTouchMove,
!0));this.setDOMEvents()},zoomOption:function(){var a=this.chart,b=a.options.chart.zoomType,e=/x/.test(b),b=/y/.test(b),a=a.inverted;this.zoomX=e;this.zoomY=b;this.zoomHor=e&&!a||b&&a;this.zoomVert=b&&!a||e&&a;this.hasZoom=e||b},normalize:function(a,b){var e,m;a=a||B.event;a.target||(a.target=a.srcElement);m=a.touches?a.touches.length?a.touches.item(0):a.changedTouches[0]:a;b||(this.chartPosition=b=l(this.chart.container));void 0===m.pageX?(e=Math.max(a.x,a.clientX-b.left),m=a.y):(e=m.pageX-b.left,
m=m.pageY-b.top);return h(a,{chartX:Math.round(e),chartY:Math.round(m)})},getCoordinates:function(a){var b={xAxis:[],yAxis:[]};d(this.chart.axes,function(e){b[e.isXAxis?"xAxis":"yAxis"].push({axis:e,value:e.toValue(a[e.horiz?"chartX":"chartY"])})});return b},runPointActions:function(c){var b=this.chart,n=b.series,m=b.tooltip,u=m?m.shared:!1,h=!0,w=b.hoverPoint,l=b.hoverSeries,k,q,t,v=[],E;if(!u&&!l)for(k=0;k<n.length;k++)if(n[k].directTouch||!n[k].options.stickyTracking)n=[];l&&(u?l.noSharedTooltip:
l.directTouch)&&w?v=[w]:(u||!l||l.options.stickyTracking||(n=[l]),d(n,function(a){q=a.noSharedTooltip&&u;t=!u&&a.directTouch;a.visible&&!q&&!t&&e(a.options.enableMouseTracking,!0)&&(E=a.searchPoint(c,!q&&1===a.kdDimensions))&&E.series&&v.push(E)}),v.sort(function(a,c){var b=a.distX-c.distX,g=a.dist-c.dist;return 0!==b?b:0!==g?g:a.series.group.zIndex>c.series.group.zIndex?-1:1}));if(u)for(k=v.length;k--;)(v[k].clientX!==v[0].clientX||v[k].series.noSharedTooltip)&&v.splice(k,1);if(v[0]&&(v[0]!==this.hoverPoint||
m&&m.isHidden)){if(u&&!v[0].series.noSharedTooltip){for(k=0;0<=k;k--)v[k].onMouseOver(c,v[k]!==(l&&l.directTouch&&w||v[0]));if(l&&l.directTouch&&w&&w!==v[0])w.onMouseOver(c,!1);v.length&&m&&m.refresh(v.sort(function(a,c){return a.series.index-c.series.index}),c)}else if(m&&m.refresh(v[0],c),!l||!l.directTouch)v[0].onMouseOver(c);this.prevKDPoint=v[0];h=!1}h&&(n=l&&l.tooltipOptions.followPointer,m&&n&&!m.isHidden&&(n=m.getAnchor([{}],c),m.updatePosition({plotX:n[0],plotY:n[1]})));this._onDocumentMouseMove||
(this._onDocumentMouseMove=function(c){if(G[a.hoverChartIndex])G[a.hoverChartIndex].pointer.onDocumentMouseMove(c)},D(f,"mousemove",this._onDocumentMouseMove));d(u?v:[e(w,v[0])],function(a){d(b.axes,function(b){(!a||a.series&&a.series[b.coll]===b)&&b.drawCrosshair(c,a)})})},reset:function(a,g){var e=this.chart,m=e.hoverSeries,u=e.hoverPoint,h=e.hoverPoints,l=e.tooltip,k=l&&l.shared?h:u;a&&k&&d(q(k),function(b){b.series.isCartesian&&void 0===b.plotX&&(a=!1)});if(a)l&&k&&(l.refresh(k),u&&(u.setState(u.state,
!0),d(e.axes,function(a){a.crosshair&&a.drawCrosshair(null,u)})));else{if(u)u.onMouseOut();h&&d(h,function(a){a.setState()});if(m)m.onMouseOut();l&&l.hide(g);this._onDocumentMouseMove&&(b(f,"mousemove",this._onDocumentMouseMove),this._onDocumentMouseMove=null);d(e.axes,function(a){a.hideCrosshair()});this.hoverX=this.prevKDPoint=e.hoverPoints=e.hoverPoint=null}},scaleGroups:function(a,b){var e=this.chart,m;d(e.series,function(d){m=a||d.getPlotBox();d.xAxis&&d.xAxis.zoomEnabled&&(d.group.attr(m),d.markerGroup&&
(d.markerGroup.attr(m),d.markerGroup.clip(b?e.clipRect:null)),d.dataLabelsGroup&&d.dataLabelsGroup.attr(m))});e.clipRect.attr(b||e.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,e=b.options.chart,m=a.chartX,d=a.chartY,f=this.zoomHor,h=this.zoomVert,l=b.plotLeft,k=b.plotTop,q=b.plotWidth,t=b.plotHeight,v,E=this.selectionMarker,p=this.mouseDownX,r=this.mouseDownY,
x=e.panKey&&a[e.panKey+"Key"];E&&E.touch||(m<l?m=l:m>l+q&&(m=l+q),d<k?d=k:d>k+t&&(d=k+t),this.hasDragged=Math.sqrt(Math.pow(p-m,2)+Math.pow(r-d,2)),10<this.hasDragged&&(v=b.isInsidePlot(p-l,r-k),b.hasCartesianSeries&&(this.zoomX||this.zoomY)&&v&&!x&&!E&&(this.selectionMarker=E=b.renderer.rect(l,k,f?1:q,h?1:t,0).attr({"class":"highcharts-selection-marker",zIndex:7}).add()),E&&f&&(m-=p,E.attr({width:Math.abs(m),x:(0<m?0:m)+p})),E&&h&&(m=d-r,E.attr({height:Math.abs(m),y:(0<m?0:m)+r})),v&&!E&&e.panning&&
b.pan(a,e.panning)))},drop:function(a){var b=this,e=this.chart,m=this.hasPinched;if(this.selectionMarker){var f={originalEvent:a,xAxis:[],yAxis:[]},l=this.selectionMarker,w=l.attr?l.attr("x"):l.x,q=l.attr?l.attr("y"):l.y,y=l.attr?l.attr("width"):l.width,z=l.attr?l.attr("height"):l.height,t;if(this.hasDragged||m)d(e.axes,function(e){if(e.zoomEnabled&&p(e.min)&&(m||b[{xAxis:"zoomX",yAxis:"zoomY"}[e.coll]])){var d=e.horiz,n="touchend"===a.type?e.minPixelPadding:0,h=e.toValue((d?w:q)+n),d=e.toValue((d?
w+y:q+z)-n);f[e.coll].push({axis:e,min:Math.min(h,d),max:Math.max(h,d)});t=!0}}),t&&k(e,"selection",f,function(a){e.zoom(h(a,m?{animation:!1}:null))});this.selectionMarker=this.selectionMarker.destroy();m&&this.scaleGroups()}e&&(H(e.container,{cursor:e._cursor}),e.cancelClick=10<this.hasDragged,e.mouseIsDown=this.hasDragged=this.hasPinched=!1,this.pinchDown=[])},onContainerMouseDown:function(a){a=this.normalize(a);this.zoomOption();a.preventDefault&&a.preventDefault();this.dragStart(a)},onDocumentMouseUp:function(c){G[a.hoverChartIndex]&&
G[a.hoverChartIndex].pointer.drop(c)},onDocumentMouseMove:function(a){var b=this.chart,e=this.chartPosition;a=this.normalize(a,e);!e||this.inClass(a.target,"highcharts-tracker")||b.isInsidePlot(a.chartX-b.plotLeft,a.chartY-b.plotTop)||this.reset()},onContainerMouseLeave:function(c){var b=G[a.hoverChartIndex];b&&(c.relatedTarget||c.toElement)&&(b.pointer.reset(),b.pointer.chartPosition=null)},onContainerMouseMove:function(c){var b=this.chart;p(a.hoverChartIndex)&&G[a.hoverChartIndex]&&G[a.hoverChartIndex].mouseIsDown||
(a.hoverChartIndex=b.index);c=this.normalize(c);c.returnValue=!1;"mousedown"===b.mouseIsDown&&this.drag(c);!this.inClass(c.target,"highcharts-tracker")&&!b.isInsidePlot(c.chartX-b.plotLeft,c.chartY-b.plotTop)||b.openMenu||this.runPointActions(c)},inClass:function(a,b){for(var e;a;){if(e=C(a,"class")){if(-1!==e.indexOf(b))return!0;if(-1!==e.indexOf("highcharts-container"))return!1}a=a.parentNode}},onTrackerMouseOut:function(a){var b=this.chart.hoverSeries;a=a.relatedTarget||a.toElement;if(b&&a&&!b.options.stickyTracking&&
!this.inClass(a,"highcharts-tooltip")&&!this.inClass(a,"highcharts-series-"+b.index))b.onMouseOut()},onContainerClick:function(a){var b=this.chart,e=b.hoverPoint,d=b.plotLeft,f=b.plotTop;a=this.normalize(a);b.cancelClick||(e&&this.inClass(a.target,"highcharts-tracker")?(k(e.series,"click",h(a,{point:e})),b.hoverPoint&&e.firePointEvent("click",a)):(h(a,this.getCoordinates(a)),b.isInsidePlot(a.chartX-d,a.chartY-f)&&k(b,"click",a)))},setDOMEvents:function(){var c=this,b=c.chart.container;b.onmousedown=
function(a){c.onContainerMouseDown(a)};b.onmousemove=function(a){c.onContainerMouseMove(a)};b.onclick=function(a){c.onContainerClick(a)};D(b,"mouseleave",c.onContainerMouseLeave);1===a.chartCount&&D(f,"mouseup",c.onDocumentMouseUp);a.hasTouch&&(b.ontouchstart=function(a){c.onContainerTouchStart(a)},b.ontouchmove=function(a){c.onContainerTouchMove(a)},1===a.chartCount&&D(f,"touchend",c.onDocumentTouchEnd))},destroy:function(){var c;b(this.chart.container,"mouseleave",this.onContainerMouseLeave);a.chartCount||
(b(f,"mouseup",this.onDocumentMouseUp),b(f,"touchend",this.onDocumentTouchEnd));clearInterval(this.tooltipTimeout);for(c in this)this[c]=null}}})(J);(function(a){var D=a.charts,C=a.each,G=a.extend,H=a.map,p=a.noop,f=a.pick;G(a.Pointer.prototype,{pinchTranslate:function(a,f,k,l,e,b){(this.zoomHor||this.pinchHor)&&this.pinchTranslateDirection(!0,a,f,k,l,e,b);(this.zoomVert||this.pinchVert)&&this.pinchTranslateDirection(!1,a,f,k,l,e,b)},pinchTranslateDirection:function(a,f,k,l,e,b,q,p){var B=this.chart,
c=a?"x":"y",g=a?"X":"Y",n="chart"+g,m=a?"width":"height",u=B["plot"+(a?"Left":"Top")],A,w,I=p||1,y=B.inverted,F=B.bounds[a?"h":"v"],t=1===f.length,v=f[0][n],E=k[0][n],K=!t&&f[1][n],r=!t&&k[1][n],x;k=function(){!t&&20<Math.abs(v-K)&&(I=p||Math.abs(E-r)/Math.abs(v-K));w=(u-E)/I+v;A=B["plot"+(a?"Width":"Height")]/I};k();f=w;f<F.min?(f=F.min,x=!0):f+A>F.max&&(f=F.max-A,x=!0);x?(E-=.8*(E-q[c][0]),t||(r-=.8*(r-q[c][1])),k()):q[c]=[E,r];y||(b[c]=w-u,b[m]=A);b=y?1/I:I;e[m]=A;e[c]=f;l[y?a?"scaleY":"scaleX":
"scale"+g]=I;l["translate"+g]=b*u+(E-b*v)},pinch:function(a){var h=this,k=h.chart,l=h.pinchDown,e=a.touches,b=e.length,q=h.lastValidTouch,z=h.hasZoom,B=h.selectionMarker,c={},g=1===b&&(h.inClass(a.target,"highcharts-tracker")&&k.runTrackerClick||h.runChartClick),n={};1<b&&(h.initiated=!0);z&&h.initiated&&!g&&a.preventDefault();H(e,function(a){return h.normalize(a)});"touchstart"===a.type?(C(e,function(a,c){l[c]={chartX:a.chartX,chartY:a.chartY}}),q.x=[l[0].chartX,l[1]&&l[1].chartX],q.y=[l[0].chartY,
l[1]&&l[1].chartY],C(k.axes,function(a){if(a.zoomEnabled){var c=k.bounds[a.horiz?"h":"v"],b=a.minPixelPadding,g=a.toPixels(f(a.options.min,a.dataMin)),e=a.toPixels(f(a.options.max,a.dataMax)),d=Math.max(g,e);c.min=Math.min(a.pos,Math.min(g,e)-b);c.max=Math.max(a.pos+a.len,d+b)}}),h.res=!0):l.length&&(B||(h.selectionMarker=B=G({destroy:p,touch:!0},k.plotBox)),h.pinchTranslate(l,e,c,B,n,q),h.hasPinched=z,h.scaleGroups(c,n),!z&&h.followTouchMove&&1===b?this.runPointActions(h.normalize(a)):h.res&&(h.res=
!1,this.reset(!1,0)))},touch:function(d,h){var k=this.chart,l;a.hoverChartIndex=k.index;1===d.touches.length?(d=this.normalize(d),k.isInsidePlot(d.chartX-k.plotLeft,d.chartY-k.plotTop)&&!k.openMenu?(h&&this.runPointActions(d),"touchmove"===d.type&&(k=this.pinchDown,l=k[0]?4<=Math.sqrt(Math.pow(k[0].chartX-d.chartX,2)+Math.pow(k[0].chartY-d.chartY,2)):!1),f(l,!0)&&this.pinch(d)):h&&this.reset()):2===d.touches.length&&this.pinch(d)},onContainerTouchStart:function(a){this.zoomOption();this.touch(a,!0)},
onContainerTouchMove:function(a){this.touch(a)},onDocumentTouchEnd:function(d){D[a.hoverChartIndex]&&D[a.hoverChartIndex].pointer.drop(d)}})})(J);(function(a){var D=a.addEvent,C=a.charts,G=a.css,H=a.doc,p=a.extend,f=a.noop,d=a.Pointer,h=a.removeEvent,k=a.win,l=a.wrap;if(k.PointerEvent||k.MSPointerEvent){var e={},b=!!k.PointerEvent,q=function(){var a,c=[];c.item=function(a){return this[a]};for(a in e)e.hasOwnProperty(a)&&c.push({pageX:e[a].pageX,pageY:e[a].pageY,target:e[a].target});return c},z=function(b,
c,g,e){"touch"!==b.pointerType&&b.pointerType!==b.MSPOINTER_TYPE_TOUCH||!C[a.hoverChartIndex]||(e(b),e=C[a.hoverChartIndex].pointer,e[c]({type:g,target:b.currentTarget,preventDefault:f,touches:q()}))};p(d.prototype,{onContainerPointerDown:function(a){z(a,"onContainerTouchStart","touchstart",function(a){e[a.pointerId]={pageX:a.pageX,pageY:a.pageY,target:a.currentTarget}})},onContainerPointerMove:function(a){z(a,"onContainerTouchMove","touchmove",function(a){e[a.pointerId]={pageX:a.pageX,pageY:a.pageY};
e[a.pointerId].target||(e[a.pointerId].target=a.currentTarget)})},onDocumentPointerUp:function(a){z(a,"onDocumentTouchEnd","touchend",function(a){delete e[a.pointerId]})},batchMSEvents:function(a){a(this.chart.container,b?"pointerdown":"MSPointerDown",this.onContainerPointerDown);a(this.chart.container,b?"pointermove":"MSPointerMove",this.onContainerPointerMove);a(H,b?"pointerup":"MSPointerUp",this.onDocumentPointerUp)}});l(d.prototype,"init",function(a,c,b){a.call(this,c,b);this.hasZoom&&G(c.container,
{"-ms-touch-action":"none","touch-action":"none"})});l(d.prototype,"setDOMEvents",function(a){a.apply(this);(this.hasZoom||this.followTouchMove)&&this.batchMSEvents(D)});l(d.prototype,"destroy",function(a){this.batchMSEvents(h);a.call(this)})}})(J);(function(a){var D,C=a.addEvent,G=a.css,H=a.discardElement,p=a.defined,f=a.each,d=a.extend,h=a.isFirefox,k=a.marginNames,l=a.merge,e=a.pick,b=a.setAnimation,q=a.stableSort,z=a.win,B=a.wrap;D=a.Legend=function(a,b){this.init(a,b)};D.prototype={init:function(a,
b){this.chart=a;this.setOptions(b);b.enabled&&(this.render(),C(this.chart,"endResize",function(){this.legend.positionCheckboxes()}))},setOptions:function(a){var b=e(a.padding,8);this.options=a;this.itemMarginTop=a.itemMarginTop||0;this.initialItemX=this.padding=b;this.initialItemY=b-5;this.itemHeight=this.maxItemWidth=0;this.symbolWidth=e(a.symbolWidth,16);this.pages=[]},update:function(a,b){var d=this.chart;this.setOptions(l(!0,this.options,a));this.destroy();d.isDirtyLegend=d.isDirtyBox=!0;e(b,
!0)&&d.redraw()},colorizeItem:function(a,b){a.legendGroup[b?"removeClass":"addClass"]("highcharts-legend-item-hidden")},positionItem:function(a){var b=this.options,e=b.symbolPadding,b=!b.rtl,d=a._legendItemPos,f=d[0],d=d[1],h=a.checkbox;(a=a.legendGroup)&&a.element&&a.translate(b?f:this.legendWidth-f-2*e-4,d);h&&(h.x=f,h.y=d)},destroyItem:function(a){var b=a.checkbox;f(["legendItem","legendLine","legendSymbol","legendGroup"],function(b){a[b]&&(a[b]=a[b].destroy())});b&&H(a.checkbox)},destroy:function(){var a=
this.group,b=this.box;b&&(this.box=b.destroy());f(this.getAllItems(),function(a){f(["legendItem","legendGroup"],function(c){a[c]&&(a[c]=a[c].destroy())})});a&&(this.group=a.destroy())},positionCheckboxes:function(a){var b=this.group.alignAttr,e,d=this.clipHeight||this.legendHeight,h=this.titleHeight;b&&(e=b.translateY,f(this.allItems,function(f){var l=f.checkbox,k;l&&(k=e+h+l.y+(a||0)+3,G(l,{left:b.translateX+f.checkboxOffset+l.x-20+"px",top:k+"px",display:k>e-6&&k<e+d-6?"":"none"}))}))},renderTitle:function(){var a=
this.padding,b=this.options.title,e=0;b.text&&(this.title||(this.title=this.chart.renderer.label(b.text,a-3,a-4,null,null,null,null,null,"legend-title").attr({zIndex:1}).add(this.group)),a=this.title.getBBox(),e=a.height,this.offsetWidth=a.width,this.contentGroup.attr({translateY:e}));this.titleHeight=e},setText:function(c){var b=this.options;c.legendItem.attr({text:b.labelFormat?a.format(b.labelFormat,c):b.labelFormatter.call(c)})},renderItem:function(a){var b=this.chart,d=b.renderer,m=this.options,
f="horizontal"===m.layout,h=this.symbolWidth,l=m.symbolPadding,k=this.padding,q=f?e(m.itemDistance,20):0,p=!m.rtl,t=m.width,v=m.itemMarginBottom||0,E=this.itemMarginTop,z=this.initialItemX,r=a.legendItem,x=!a.series,B=!x&&a.series.drawLegendSymbol?a.series:a,N=B.options,N=this.createCheckboxForItem&&N&&N.showCheckbox,D=m.useHTML;r||(a.legendGroup=d.g("legend-item").addClass("highcharts-"+B.type+"-series highcharts-color-"+a.colorIndex+" "+(a.options.className||"")+(x?"highcharts-series-"+a.index:
"")).attr({zIndex:1}).add(this.scrollGroup),a.legendItem=r=d.text("",p?h+l:-l,this.baseline||0,D).attr({align:p?"left":"right",zIndex:2}).add(a.legendGroup),this.baseline||(this.fontMetrics=d.fontMetrics(12,r),this.baseline=this.fontMetrics.f+3+E,r.attr("y",this.baseline)),B.drawLegendSymbol(this,a),this.setItemEvents&&this.setItemEvents(a,r,D),N&&this.createCheckboxForItem(a));this.colorizeItem(a,a.visible);this.setText(a);d=r.getBBox();h=a.checkboxOffset=m.itemWidth||a.legendItemWidth||h+l+d.width+
q+(N?20:0);this.itemHeight=l=Math.round(a.legendItemHeight||d.height);f&&this.itemX-z+h>(t||b.chartWidth-2*k-z-m.x)&&(this.itemX=z,this.itemY+=E+this.lastLineHeight+v,this.lastLineHeight=0);this.maxItemWidth=Math.max(this.maxItemWidth,h);this.lastItemY=E+this.itemY+v;this.lastLineHeight=Math.max(l,this.lastLineHeight);a._legendItemPos=[this.itemX,this.itemY];f?this.itemX+=h:(this.itemY+=E+l+v,this.lastLineHeight=l);this.offsetWidth=t||Math.max((f?this.itemX-z-q:h)+k,this.offsetWidth)},getAllItems:function(){var a=
[];f(this.chart.series,function(b){var d=b&&b.options;b&&e(d.showInLegend,p(d.linkedTo)?!1:void 0,!0)&&(a=a.concat(b.legendItems||("point"===d.legendType?b.data:b)))});return a},adjustMargins:function(a,b){var d=this.chart,m=this.options,h=m.align.charAt(0)+m.verticalAlign.charAt(0)+m.layout.charAt(0);m.floating||f([/(lth|ct|rth)/,/(rtv|rm|rbv)/,/(rbh|cb|lbh)/,/(lbv|lm|ltv)/],function(f,l){f.test(h)&&!p(a[l])&&(d[k[l]]=Math.max(d[k[l]],d.legend[(l+1)%2?"legendHeight":"legendWidth"]+[1,-1,-1,1][l]*
m[l%2?"x":"y"]+e(m.margin,12)+b[l]))})},render:function(){var a=this,b=a.chart,e=b.renderer,m=a.group,h,l,k,p,y=a.box,z=a.options,t=a.padding;a.itemX=a.initialItemX;a.itemY=a.initialItemY;a.offsetWidth=0;a.lastItemY=0;m||(a.group=m=e.g("legend").attr({zIndex:7}).add(),a.contentGroup=e.g().attr({zIndex:1}).add(m),a.scrollGroup=e.g().add(a.contentGroup));a.renderTitle();h=a.getAllItems();q(h,function(a,b){return(a.options&&a.options.legendIndex||0)-(b.options&&b.options.legendIndex||0)});z.reversed&&
h.reverse();a.allItems=h;a.display=l=!!h.length;a.lastLineHeight=0;f(h,function(b){a.renderItem(b)});k=(z.width||a.offsetWidth)+t;p=a.lastItemY+a.lastLineHeight+a.titleHeight;p=a.handleOverflow(p);p+=t;y||(a.box=y=e.rect().addClass("highcharts-legend-box").attr({r:z.borderRadius}).add(m),y.isNew=!0);0<k&&0<p&&(y[y.isNew?"attr":"animate"](y.crisp({x:0,y:0,width:k,height:p},y.strokeWidth())),y.isNew=!1);y[l?"show":"hide"]();"none"===m.getStyle("display")&&(k=p=0);a.legendWidth=k;a.legendHeight=p;f(h,
function(b){a.positionItem(b)});l&&m.align(d({width:k,height:p},z),!0,"spacingBox");b.isResizing||this.positionCheckboxes()},handleOverflow:function(a){var b=this,d=this.chart,m=d.renderer,h=this.options,l=h.y,l=d.spacingBox.height+("top"===h.verticalAlign?-l:l)-this.padding,k=h.maxHeight,q,y=this.clipRect,p=h.navigation,t=e(p.animation,!0),v=p.arrowSize||12,E=this.nav,z=this.pages,r=this.padding,x,B=this.allItems,N=function(a){y.attr({height:a});b.contentGroup.div&&(b.contentGroup.div.style.clip=
"rect("+r+"px,9999px,"+(r+a)+"px,0)")};"horizontal"===h.layout&&(l/=2);k&&(l=Math.min(l,k));z.length=0;a>l&&!1!==p.enabled?(this.clipHeight=q=Math.max(l-20-this.titleHeight-r,0),this.currentPage=e(this.currentPage,1),this.fullHeight=a,f(B,function(a,b){var c=a._legendItemPos[1],e=Math.round(a.legendItem.getBBox().height),g=z.length;if(!g||c-z[g-1]>q&&(x||c)!==z[g-1])z.push(x||c),g++;b===B.length-1&&c+e-z[g-1]>q&&z.push(c);c!==x&&(x=c)}),y||(y=b.clipRect=m.clipRect(0,r,9999,0),b.contentGroup.clip(y)),
N(q),E||(this.nav=E=m.g().attr({zIndex:1}).add(this.group),this.up=m.symbol("triangle",0,0,v,v).on("click",function(){b.scroll(-1,t)}).add(E),this.pager=m.text("",15,10).addClass("highcharts-legend-navigation").add(E),this.down=m.symbol("triangle-down",0,0,v,v).on("click",function(){b.scroll(1,t)}).add(E)),b.scroll(0),a=l):E&&(N(d.chartHeight),E.hide(),this.scrollGroup.attr({translateY:1}),this.clipHeight=0);return a},scroll:function(a,e){var d=this.pages,m=d.length,f=this.currentPage+a,h=this.clipHeight,
l=this.pager,k=this.padding;f>m&&(f=m);0<f&&(void 0!==e&&b(e,this.chart),this.nav.attr({translateX:k,translateY:h+this.padding+7+this.titleHeight,visibility:"visible"}),this.up.attr({"class":1===f?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),l.attr({text:f+"/"+m}),this.down.attr({x:18+this.pager.getBBox().width,"class":f===m?"highcharts-legend-nav-inactive":"highcharts-legend-nav-active"}),d=-d[f-1]+this.initialItemY,this.scrollGroup.animate({translateY:d}),this.currentPage=f,
this.positionCheckboxes(d))}};a.LegendSymbolMixin={drawRectangle:function(a,b){var d=a.options,m=d.symbolHeight||a.fontMetrics.f,d=d.squareSymbol;b.legendSymbol=this.chart.renderer.rect(d?(a.symbolWidth-m)/2:0,a.baseline-m+1,d?m:a.symbolWidth,m,e(a.options.symbolRadius,m/2)).addClass("highcharts-point").attr({zIndex:3}).add(b.legendGroup)},drawLineMarker:function(a){var b=this.options.marker,e=a.symbolWidth,d=this.chart.renderer,f=this.legendGroup,h=a.baseline-Math.round(.3*a.fontMetrics.b);this.legendLine=
d.path(["M",0,h,"L",e,h]).addClass("highcharts-graph").attr({}).add(f);b&&!1!==b.enabled&&(a=b.radius,this.legendSymbol=b=d.symbol(this.symbol,e/2-a,h-a,2*a,2*a,b).addClass("highcharts-point").add(f),b.isMarker=!0)}};(/Trident\/7\.0/.test(z.navigator.userAgent)||h)&&B(D.prototype,"positionItem",function(a,b){var e=this,d=function(){b._legendItemPos&&a.call(e,b)};d();setTimeout(d)})})(J);(function(a){var D=a.addEvent,C=a.animObject,G=a.attr,H=a.doc,p=a.Axis,f=a.createElement,d=a.defaultOptions,h=a.discardElement,
k=a.charts,l=a.css,e=a.defined,b=a.each,q=a.error,z=a.extend,B=a.fireEvent,c=a.getStyle,g=a.grep,n=a.isNumber,m=a.isObject,u=a.isString,A=a.Legend,w=a.marginNames,I=a.merge,y=a.Pointer,F=a.pick,t=a.pInt,v=a.removeEvent,E=a.seriesTypes,K=a.splat,r=a.svg,x=a.syncTimeout,M=a.win,N=a.Renderer,P=a.Chart=function(){this.getArgs.apply(this,arguments)};a.chart=function(a,b,c){return new P(a,b,c)};P.prototype={callbacks:[],getArgs:function(){var a=[].slice.call(arguments);if(u(a[0])||a[0].nodeName)this.renderTo=
a.shift();this.init(a[0],a[1])},init:function(b,c){var e,g=b.series;b.series=null;e=I(d,b);e.series=b.series=g;this.userOptions=b;this.respRules=[];var g=e.chart,f=g.events;this.margin=[];this.spacing=[];this.bounds={h:{},v:{}};this.callback=c;this.isResizing=0;this.options=e;this.axes=[];this.series=[];this.hasCartesianSeries=g.showAxes;var m;this.index=k.length;k.push(this);a.chartCount++;if(f)for(m in f)D(this,m,f[m]);this.xAxis=[];this.yAxis=[];this.pointCount=this.colorCounter=this.symbolCounter=
0;this.firstRender()},initSeries:function(a){var b=this.options.chart;(b=E[a.type||b.type||b.defaultSeriesType])||q(17,!0);b=new b;b.init(this,a);return b},isInsidePlot:function(a,b,c){var e=c?b:a;a=c?a:b;return 0<=e&&e<=this.plotWidth&&0<=a&&a<=this.plotHeight},redraw:function(c){var e=this.axes,g=this.series,d=this.pointer,f=this.legend,m=this.isDirtyLegend,t,h,l=this.hasCartesianSeries,v=this.isDirtyBox,r=g.length,u=r,k=this.renderer,n=k.isHidden(),E=[];a.setAnimation(c,this);n&&this.cloneRenderTo();
for(this.layOutTitles();u--;)if(c=g[u],c.options.stacking&&(t=!0,c.isDirty)){h=!0;break}if(h)for(u=r;u--;)c=g[u],c.options.stacking&&(c.isDirty=!0);b(g,function(a){a.isDirty&&"point"===a.options.legendType&&(a.updateTotals&&a.updateTotals(),m=!0);a.isDirtyData&&B(a,"updatedData")});m&&f.options.enabled&&(f.render(),this.isDirtyLegend=!1);t&&this.getStacks();l&&b(e,function(a){a.updateNames();a.setScale()});this.getMargins();l&&(b(e,function(a){a.isDirty&&(v=!0)}),b(e,function(a){var b=a.min+","+a.max;
a.extKey!==b&&(a.extKey=b,E.push(function(){B(a,"afterSetExtremes",z(a.eventArgs,a.getExtremes()));delete a.eventArgs}));(v||t)&&a.redraw()}));v&&this.drawChartBox();b(g,function(a){a.isDirty&&a.visible&&(!a.isCartesian||a.xAxis)&&a.redraw()});d&&d.reset(!0);k.draw();B(this,"redraw");n&&this.cloneRenderTo(!0);b(E,function(a){a.call()})},get:function(a){var b=this.axes,c=this.series,e,g;for(e=0;e<b.length;e++)if(b[e].options.id===a)return b[e];for(e=0;e<c.length;e++)if(c[e].options.id===a)return c[e];
for(e=0;e<c.length;e++)for(g=c[e].points||[],b=0;b<g.length;b++)if(g[b].id===a)return g[b];return null},getAxes:function(){var a=this,c=this.options,e=c.xAxis=K(c.xAxis||{}),c=c.yAxis=K(c.yAxis||{});b(e,function(a,b){a.index=b;a.isX=!0});b(c,function(a,b){a.index=b});e=e.concat(c);b(e,function(b){new p(a,b)})},getSelectedPoints:function(){var a=[];b(this.series,function(b){a=a.concat(g(b.points||[],function(a){return a.selected}))});return a},getSelectedSeries:function(){return g(this.series,function(a){return a.selected})},
setTitle:function(a,c,e){var g=this,d=g.options,f;f=d.title=I(d.title,a);d=d.subtitle=I(d.subtitle,c);b([["title",a,f],["subtitle",c,d]],function(a,b){var c=a[0],e=g[c],d=a[1],f=a[2];e&&d&&(g[c]=e=e.destroy());f&&f.text&&!e&&(g[c]=g.renderer.text(f.text,0,0,f.useHTML).attr({align:f.align,"class":"highcharts-"+c,zIndex:f.zIndex||4}).add(),g[c].update=function(a){g.setTitle(!b&&a,b&&a)})});g.layOutTitles(e)},layOutTitles:function(a){var c=0,e,g=this.renderer,d=this.spacingBox;b(["title","subtitle"],
function(a){var b=this[a],e=this.options[a],f;b&&(f=g.fontMetrics(f,b).b,b.css({width:(e.width||d.width+e.widthAdjust)+"px"}).align(z({y:c+f+("title"===a?-3:2)},e),!1,"spacingBox"),e.floating||e.verticalAlign||(c=Math.ceil(c+b.getBBox().height)))},this);e=this.titleOffset!==c;this.titleOffset=c;!this.isDirtyBox&&e&&(this.isDirtyBox=e,this.hasRendered&&F(a,!0)&&this.isDirtyBox&&this.redraw())},getChartSize:function(){var a=this.options.chart,b=a.width,a=a.height,g=this.renderToClone||this.renderTo;
e(b)||(this.containerWidth=c(g,"width"));e(a)||(this.containerHeight=c(g,"height"));this.chartWidth=Math.max(0,b||this.containerWidth||600);this.chartHeight=Math.max(0,F(a,19<this.containerHeight?this.containerHeight:400))},cloneRenderTo:function(a){var b=this.renderToClone,c=this.container;if(a){if(b){for(;b.childNodes.length;)this.renderTo.appendChild(b.firstChild);h(b);delete this.renderToClone}}else c&&c.parentNode===this.renderTo&&this.renderTo.removeChild(c),this.renderToClone=b=this.renderTo.cloneNode(0),
l(b,{position:"absolute",top:"-9999px",display:"block"}),b.style.setProperty&&b.style.setProperty("display","block","important"),H.body.appendChild(b),c&&b.appendChild(c)},setClassName:function(a){this.container.className="highcharts-container "+(a||"")},getContainer:function(){var b,c=this.options,e=c.chart,g,d;b=this.renderTo;var m="highcharts-"+a.idCounter++,h;b||(this.renderTo=b=e.renderTo);u(b)&&(this.renderTo=b=H.getElementById(b));b||q(13,!0);g=t(G(b,"data-highcharts-chart"));n(g)&&k[g]&&k[g].hasRendered&&
k[g].destroy();G(b,"data-highcharts-chart",this.index);b.innerHTML="";e.skipClone||b.offsetWidth||this.cloneRenderTo();this.getChartSize();g=this.chartWidth;d=this.chartHeight;this.container=b=f("div",{id:m},void 0,this.renderToClone||b);this._cursor=b.style.cursor;this.renderer=new (a[e.renderer]||N)(b,g,d,null,e.forExport,c.exporting&&c.exporting.allowHTML);this.setClassName(e.className);for(h in c.defs)this.renderer.definition(c.defs[h]);this.renderer.chartIndex=this.index},getMargins:function(a){var b=
this.spacing,c=this.margin,g=this.titleOffset;this.resetMargins();g&&!e(c[0])&&(this.plotTop=Math.max(this.plotTop,g+this.options.title.margin+b[0]));this.legend.display&&this.legend.adjustMargins(c,b);this.extraBottomMargin&&(this.marginBottom+=this.extraBottomMargin);this.extraTopMargin&&(this.plotTop+=this.extraTopMargin);a||this.getAxisMargins()},getAxisMargins:function(){var a=this,c=a.axisOffset=[0,0,0,0],g=a.margin;a.hasCartesianSeries&&b(a.axes,function(a){a.visible&&a.getOffset()});b(w,function(b,
d){e(g[d])||(a[b]+=c[d])});a.setChartSize()},reflow:function(a){var b=this,g=b.options.chart,d=b.renderTo,f=e(g.width),m=g.width||c(d,"width"),g=g.height||c(d,"height"),d=a?a.target:M;if(!f&&!b.isPrinting&&m&&g&&(d===M||d===H)){if(m!==b.containerWidth||g!==b.containerHeight)clearTimeout(b.reflowTimeout),b.reflowTimeout=x(function(){b.container&&b.setSize(void 0,void 0,!1)},a?100:0);b.containerWidth=m;b.containerHeight=g}},initReflow:function(){var a=this,b=function(b){a.reflow(b)};D(M,"resize",b);
D(a,"destroy",function(){v(M,"resize",b)})},setSize:function(c,e,g){var d=this,f=d.renderer;d.isResizing+=1;a.setAnimation(g,d);d.oldChartHeight=d.chartHeight;d.oldChartWidth=d.chartWidth;void 0!==c&&(d.options.chart.width=c);void 0!==e&&(d.options.chart.height=e);d.getChartSize();d.setChartSize(!0);f.setSize(d.chartWidth,d.chartHeight,g);b(d.axes,function(a){a.isDirty=!0;a.setScale()});b(d.series,function(a){a.isDirty=!0});d.isDirtyLegend=!0;d.isDirtyBox=!0;d.layOutTitles();d.getMargins();d.setResponsive&&
d.setResponsive(!1);d.redraw(g);d.oldChartHeight=null;B(d,"resize");x(function(){d&&B(d,"endResize",null,function(){--d.isResizing})},C(void 0).duration)},setChartSize:function(a){var c=this.inverted,e=this.renderer,g=this.chartWidth,d=this.chartHeight,f=this.options.chart,m=this.spacing,t=this.clipOffset,h,l,v,r;this.plotLeft=h=Math.round(this.plotLeft);this.plotTop=l=Math.round(this.plotTop);this.plotWidth=v=Math.max(0,Math.round(g-h-this.marginRight));this.plotHeight=r=Math.max(0,Math.round(d-
l-this.marginBottom));this.plotSizeX=c?r:v;this.plotSizeY=c?v:r;this.plotBorderWidth=f.plotBorderWidth||0;this.spacingBox=e.spacingBox={x:m[3],y:m[0],width:g-m[3]-m[1],height:d-m[0]-m[2]};this.plotBox=e.plotBox={x:h,y:l,width:v,height:r};g=2*Math.floor(this.plotBorderWidth/2);c=Math.ceil(Math.max(g,t[3])/2);e=Math.ceil(Math.max(g,t[0])/2);this.clipBox={x:c,y:e,width:Math.floor(this.plotSizeX-Math.max(g,t[1])/2-c),height:Math.max(0,Math.floor(this.plotSizeY-Math.max(g,t[2])/2-e))};a||b(this.axes,function(a){a.setAxisSize();
a.setAxisTranslation()})},resetMargins:function(){var a=this,c=a.options.chart;b(["margin","spacing"],function(e){var g=c[e],d=m(g)?g:[g,g,g,g];b(["Top","Right","Bottom","Left"],function(b,g){a[e][g]=F(c[e+b],d[g])})});b(w,function(b,c){a[b]=F(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,b=this.renderer,c=this.chartWidth,e=this.chartHeight,g=this.chartBackground,d=this.plotBackground,f=this.plotBorder,m,t,h=this.plotLeft,
l=this.plotTop,v=this.plotWidth,r=this.plotHeight,u=this.plotBox,k=this.clipRect,n=this.clipBox,E="animate";g||(this.chartBackground=g=b.rect().addClass("highcharts-background").add(),E="attr");m=t=g.strokeWidth();g[E]({x:t/2,y:t/2,width:c-t-m%2,height:e-t-m%2,r:a.borderRadius});E="animate";d||(E="attr",this.plotBackground=d=b.rect().addClass("highcharts-plot-background").add());d[E](u);k?k.animate({width:n.width,height:n.height}):this.clipRect=b.clipRect(n);E="animate";f||(E="attr",this.plotBorder=
f=b.rect().addClass("highcharts-plot-border").attr({zIndex:1}).add());f[E](f.crisp({x:h,y:l,width:v,height:r},-f.strokeWidth()));this.isDirtyBox=!1},propFromSeries:function(){var a=this,c=a.options.chart,e,g=a.options.series,d,f;b(["inverted","angular","polar"],function(b){e=E[c.type||c.defaultSeriesType];f=c[b]||e&&e.prototype[b];for(d=g&&g.length;!f&&d--;)(e=E[g[d].type])&&e.prototype[b]&&(f=!0);a[b]=f})},linkSeries:function(){var a=this,c=a.series;b(c,function(a){a.linkedSeries.length=0});b(c,
function(b){var c=b.options.linkedTo;u(c)&&(c=":previous"===c?a.series[b.index-1]:a.get(c))&&c.linkedParent!==b&&(c.linkedSeries.push(b),b.linkedParent=c,b.visible=F(b.options.visible,c.options.visible,b.visible))})},renderSeries:function(){b(this.series,function(a){a.translate();a.render()})},renderLabels:function(){var a=this,c=a.options.labels;c.items&&b(c.items,function(b){var e=z(c.style,b.style),g=t(e.left)+a.plotLeft,d=t(e.top)+a.plotTop+12;delete e.left;delete e.top;a.renderer.text(b.html,
g,d).attr({zIndex:2}).css(e).add()})},render:function(){var a=this.axes,c=this.renderer,e=this.options,g,d,f;this.setTitle();this.legend=new A(this,e.legend);this.getStacks&&this.getStacks();this.getMargins(!0);this.setChartSize();e=this.plotWidth;g=this.plotHeight-=21;b(a,function(a){a.setScale()});this.getAxisMargins();d=1.1<e/this.plotWidth;f=1.05<g/this.plotHeight;if(d||f)b(a,function(a){(a.horiz&&d||!a.horiz&&f)&&a.setTickInterval(!0)}),this.getMargins();this.drawChartBox();this.hasCartesianSeries&&
b(a,function(a){a.visible&&a.render()});this.seriesGroup||(this.seriesGroup=c.g("series-group").attr({zIndex:3}).add());this.renderSeries();this.renderLabels();this.addCredits();this.setResponsive&&this.setResponsive();this.hasRendered=!0},addCredits:function(a){var b=this;a=I(!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&&(M.location.href=a.href)}).attr({align:a.position.align,
zIndex:8}).add().align(a.position),this.credits.update=function(a){b.credits=b.credits.destroy();b.addCredits(a)})},destroy:function(){var c=this,e=c.axes,g=c.series,d=c.container,f,m=d&&d.parentNode;B(c,"destroy");k[c.index]=void 0;a.chartCount--;c.renderTo.removeAttribute("data-highcharts-chart");v(c);for(f=e.length;f--;)e[f]=e[f].destroy();this.scroller&&this.scroller.destroy&&this.scroller.destroy();for(f=g.length;f--;)g[f]=g[f].destroy();b("title subtitle chartBackground plotBackground plotBGImage plotBorder seriesGroup clipRect credits pointer rangeSelector legend resetZoomButton tooltip renderer".split(" "),
function(a){var b=c[a];b&&b.destroy&&(c[a]=b.destroy())});d&&(d.innerHTML="",v(d),m&&h(d));for(f in c)delete c[f]},isReadyToRender:function(){var a=this;return r||M!=M.top||"complete"===H.readyState?!0:(H.attachEvent("onreadystatechange",function(){H.detachEvent("onreadystatechange",a.firstRender);"complete"===H.readyState&&a.firstRender()}),!1)},firstRender:function(){var a=this,c=a.options;if(a.isReadyToRender()){a.getContainer();B(a,"init");a.resetMargins();a.setChartSize();a.propFromSeries();
a.getAxes();b(c.series||[],function(b){a.initSeries(b)});a.linkSeries();B(a,"beforeRender");y&&(a.pointer=new y(a,c));a.render();a.renderer.draw();if(!a.renderer.imgCount&&a.onload)a.onload();a.cloneRenderTo(!0)}},onload:function(){b([this.callback].concat(this.callbacks),function(a){a&&void 0!==this.index&&a.apply(this,[this])},this);B(this,"load");this.initReflow();this.onload=null}}})(J);(function(a){var D,C=a.each,G=a.extend,H=a.erase,p=a.fireEvent,f=a.format,d=a.isArray,h=a.isNumber,k=a.pick,
l=a.removeEvent;D=a.Point=function(){};D.prototype={init:function(a,b,d){var f=a.chart.options.chart.colorCount;this.series=a;this.applyOptions(b,d);a.options.colorByPoint?(b=a.colorCounter,a.colorCounter++,a.colorCounter===f&&(a.colorCounter=0)):b=a.colorIndex;this.colorIndex=k(this.colorIndex,b);a.chart.pointCount++;return this},applyOptions:function(a,b){var d=this.series,f=d.options.pointValKey||d.pointValKey;a=D.prototype.optionsToObject.call(this,a);G(this,a);this.options=this.options?G(this.options,
a):a;a.group&&delete this.group;f&&(this.y=this[f]);this.isNull=k(this.isValid&&!this.isValid(),null===this.x||!h(this.y,!0));"name"in this&&void 0===b&&d.xAxis&&d.xAxis.hasNames&&(this.x=d.xAxis.nameToX(this));void 0===this.x&&d&&(this.x=void 0===b?d.autoIncrement(this):b);return this},optionsToObject:function(a){var b={},f=this.series,l=f.options.keys,k=l||f.pointArrayMap||["y"],c=k.length,g=0,n=0;if(h(a)||null===a)b[k[0]]=a;else if(d(a))for(!l&&a.length>c&&(f=typeof a[0],"string"===f?b.name=a[0]:
"number"===f&&(b.x=a[0]),g++);n<c;)l&&void 0===a[g]||(b[k[n]]=a[g]),g++,n++;else"object"===typeof a&&(b=a,a.dataLabels&&(f._hasPointLabels=!0),a.marker&&(f._hasPointMarkers=!0));return b},getClassName:function(){return"highcharts-point"+(this.selected?" highcharts-point-select":"")+(this.negative?" highcharts-negative":"")+(void 0!==this.colorIndex?" highcharts-color-"+this.colorIndex:"")+(this.options.className?" "+this.options.className:"")},getZone:function(){var a=this.series,b=a.zones,a=a.zoneAxis||
"y",d=0,f;for(f=b[d];this[a]>=f.value;)f=b[++d];f&&f.color&&!this.options.color&&(this.color=f.color);return f},destroy:function(){var a=this.series.chart,b=a.hoverPoints,d;a.pointCount--;b&&(this.setState(),H(b,this),b.length||(a.hoverPoints=null));if(this===a.hoverPoint)this.onMouseOut();if(this.graphic||this.dataLabel)l(this),this.destroyElements();this.legendItem&&a.legend.destroyItem(this);for(d in this)this[d]=null},destroyElements:function(){for(var a=["graphic","dataLabel","dataLabelUpper",
"connector","shadowGroup"],b,d=6;d--;)b=a[d],this[b]&&(this[b]=this[b].destroy())},getLabelConfig:function(){return{x:this.category,y:this.y,color:this.color,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,d=b.tooltipOptions,h=k(d.valueDecimals,""),l=d.valuePrefix||"",c=d.valueSuffix||"";C(b.pointArrayMap||["y"],function(b){b="{point."+b;if(l||c)a=a.replace(b+"}",l+b+"}"+c);a=a.replace(b+
"}",b+":,."+h+"f}")});return f(a,{point:this,series:this.series})},firePointEvent:function(a,b,d){var f=this,h=this.series.options;(h.point.events[a]||f.options&&f.options.events&&f.options.events[a])&&this.importEvents();"click"===a&&h.allowPointSelect&&(d=function(a){f.select&&f.select(null,a.ctrlKey||a.metaKey||a.shiftKey)});p(this,a,b,d)},visible:!0}})(J);(function(a){var D=a.addEvent,C=a.animObject,G=a.arrayMax,H=a.arrayMin,p=a.correctFloat,f=a.Date,d=a.defaultOptions,h=a.defined,k=a.each,l=
a.erase,e=a.error,b=a.extend,q=a.fireEvent,z=a.grep,B=a.isArray,c=a.isNumber,g=a.isString,n=a.merge,m=a.pick,u=a.removeEvent,A=a.splat,w=a.stableSort,I=a.SVGElement,y=a.syncTimeout,F=a.win;a.Series=a.seriesType("line",null,{allowPointSelect:!1,showCheckbox:!1,animation:{duration:1E3},events:{},marker:{radius:4,states:{hover:{enabled:!0,radiusPlus:2}}},point:{events:{}},dataLabels:{align:"center",formatter:function(){return null===this.y?"":a.numberFormat(this.y,-1)},verticalAlign:"bottom",x:0,y:0,
padding:5},cropThreshold:300,pointRange:0,softThreshold:!0,states:{hover:{lineWidthPlus:1,marker:{},halo:{size:10}},select:{marker:{}}},stickyTracking:!0,turboThreshold:1E3},{isCartesian:!0,pointClass:a.Point,sorted:!0,requireSorting:!0,directTouch:!1,axisTypes:["xAxis","yAxis"],colorCounter:0,parallelArrays:["x","y"],coll:"series",init:function(a,c){var e=this,g,d,f=a.series,h=function(a,b){return m(a.options.index,a._i)-m(b.options.index,b._i)};e.chart=a;e.options=c=e.setOptions(c);e.linkedSeries=
[];e.bindAxes();b(e,{name:c.name,state:"",visible:!1!==c.visible,selected:!0===c.selected});d=c.events;for(g in d)D(e,g,d[g]);if(d&&d.click||c.point&&c.point.events&&c.point.events.click||c.allowPointSelect)a.runTrackerClick=!0;e.getColor();e.getSymbol();k(e.parallelArrays,function(a){e[a+"Data"]=[]});e.setData(c.data,!1);e.isCartesian&&(a.hasCartesianSeries=!0);f.push(e);e._i=f.length-1;w(f,h);this.yAxis&&w(this.yAxis.series,h);k(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,g;k(a.axisTypes||[],function(d){k(c[d],function(c){g=c.options;if(b[d]===g.index||void 0!==b[d]&&b[d]===g.id||void 0===b[d]&&0===g.index)c.series.push(a),a[d]=c,c.isDirty=!0});a[d]||a.optionalAxis===d||e(18,!0)})},updateParallelArrays:function(a,b){var e=a.series,g=arguments,d=c(b)?function(c){var g="y"===c&&e.toYData?e.toYData(a):a[c];e[c+"Data"][b]=g}:function(a){Array.prototype[b].apply(e[a+"Data"],Array.prototype.slice.call(g,2))};k(e.parallelArrays,d)},autoIncrement:function(){var a=
this.options,b=this.xIncrement,c,e=a.pointIntervalUnit,b=m(b,a.pointStart,0);this.pointInterval=c=m(this.pointInterval,a.pointInterval,1);e&&(a=new f(b),"day"===e?a=+a[f.hcSetDate](a[f.hcGetDate]()+c):"month"===e?a=+a[f.hcSetMonth](a[f.hcGetMonth]()+c):"year"===e&&(a=+a[f.hcSetFullYear](a[f.hcGetFullYear]()+c)),c=a-b);this.xIncrement=b+c;return b},setOptions:function(a){var b=this.chart,c=b.options.plotOptions,b=b.userOptions||{},e=b.plotOptions||{},g=c[this.type];this.userOptions=a;c=n(g,c.series,
a);this.tooltipOptions=n(d.tooltip,d.plotOptions[this.type].tooltip,b.tooltip,e.series&&e.series.tooltip,e[this.type]&&e[this.type].tooltip,a.tooltip);null===g.marker&&delete c.marker;this.zoneAxis=c.zoneAxis;a=this.zones=(c.zones||[]).slice();!c.negativeColor&&!c.negativeFillColor||c.zones||a.push({value:c[this.zoneAxis+"Threshold"]||c.threshold||0,className:"highcharts-negative"});a.length&&h(a[a.length-1].value)&&a.push({});return c},getCyclic:function(a,b,c){var e,g=this.userOptions,d=a+"Index",
f=a+"Counter",l=c?c.length:m(this.chart.options.chart[a+"Count"],this.chart[a+"Count"]);b||(e=m(g[d],g["_"+d]),h(e)||(g["_"+d]=e=this.chart[f]%l,this.chart[f]+=1),c&&(b=c[e]));void 0!==e&&(this[d]=e);this[a]=b},getColor:function(){this.getCyclic("color")},getSymbol:function(){var a=this.options.marker;this.getCyclic("symbol",a.symbol,this.chart.options.symbols);/^url/.test(this.symbol)&&(a.radius=0)},drawLegendSymbol:a.LegendSymbolMixin.drawLineMarker,setData:function(a,b,d,f){var h=this,l=h.points,
u=l&&l.length||0,n,w=h.options,A=h.chart,q=null,y=h.xAxis,p=w.turboThreshold,z=this.xData,I=this.yData,F=(n=h.pointArrayMap)&&n.length;a=a||[];n=a.length;b=m(b,!0);if(!1!==f&&n&&u===n&&!h.cropped&&!h.hasGroupedData&&h.visible)k(a,function(a,b){l[b].update&&a!==w.data[b]&&l[b].update(a,!1,null,!1)});else{h.xIncrement=null;h.colorCounter=0;k(this.parallelArrays,function(a){h[a+"Data"].length=0});if(p&&n>p){for(d=0;null===q&&d<n;)q=a[d],d++;if(c(q))for(d=0;d<n;d++)z[d]=this.autoIncrement(),I[d]=a[d];
else if(B(q))if(F)for(d=0;d<n;d++)q=a[d],z[d]=q[0],I[d]=q.slice(1,F+1);else for(d=0;d<n;d++)q=a[d],z[d]=q[0],I[d]=q[1];else e(12)}else for(d=0;d<n;d++)void 0!==a[d]&&(q={series:h},h.pointClass.prototype.applyOptions.apply(q,[a[d]]),h.updateParallelArrays(q,d));g(I[0])&&e(14,!0);h.data=[];h.options.data=h.userOptions.data=a;for(d=u;d--;)l[d]&&l[d].destroy&&l[d].destroy();y&&(y.minRange=y.userMinRange);h.isDirty=A.isDirtyBox=!0;h.isDirtyData=!!l;d=!1}"point"===w.legendType&&(this.processData(),this.generatePoints());
b&&A.redraw(d)},processData:function(a){var b=this.xData,c=this.yData,g=b.length,d;d=0;var f,m,h=this.xAxis,l,u=this.options;l=u.cropThreshold;var k=this.getExtremesFromAll||u.getExtremesFromAll,n=this.isCartesian,u=h&&h.val2lin,w=h&&h.isLog,q,A;if(n&&!this.isDirty&&!h.isDirty&&!this.yAxis.isDirty&&!a)return!1;h&&(a=h.getExtremes(),q=a.min,A=a.max);if(n&&this.sorted&&!k&&(!l||g>l||this.forceCrop))if(b[g-1]<q||b[0]>A)b=[],c=[];else if(b[0]<q||b[g-1]>A)d=this.cropData(this.xData,this.yData,q,A),b=d.xData,
c=d.yData,d=d.start,f=!0;for(l=b.length||1;--l;)g=w?u(b[l])-u(b[l-1]):b[l]-b[l-1],0<g&&(void 0===m||g<m)?m=g:0>g&&this.requireSorting&&e(15);this.cropped=f;this.cropStart=d;this.processedXData=b;this.processedYData=c;this.closestPointRange=m},cropData:function(a,b,c,e){var g=a.length,d=0,f=g,h=m(this.cropShoulder,1),l;for(l=0;l<g;l++)if(a[l]>=c){d=Math.max(0,l-h);break}for(c=l;c<g;c++)if(a[c]>e){f=c+h;break}return{xData:a.slice(d,f),yData:b.slice(d,f),start:d,end:f}},generatePoints:function(){var a=
this.options.data,b=this.data,c,e=this.processedXData,g=this.processedYData,d=this.pointClass,f=e.length,m=this.cropStart||0,h,l=this.hasGroupedData,u,k=[],n;b||l||(b=[],b.length=a.length,b=this.data=b);for(n=0;n<f;n++)h=m+n,l?(k[n]=(new d).init(this,[e[n]].concat(A(g[n]))),k[n].dataGroup=this.groupMap[n]):(b[h]?u=b[h]:void 0!==a[h]&&(b[h]=u=(new d).init(this,a[h],e[n])),k[n]=u),k[n].index=h;if(b&&(f!==(c=b.length)||l))for(n=0;n<c;n++)n!==m||l||(n+=f),b[n]&&(b[n].destroyElements(),b[n].plotX=void 0);
this.data=b;this.points=k},getExtremes:function(a){var b=this.yAxis,e=this.processedXData,g,d=[],f=0;g=this.xAxis.getExtremes();var m=g.min,h=g.max,l,n,u,k;a=a||this.stackedYData||this.processedYData||[];g=a.length;for(k=0;k<g;k++)if(n=e[k],u=a[k],l=(c(u,!0)||B(u))&&(!b.isLog||u.length||0<u),n=this.getExtremesFromAll||this.options.getExtremesFromAll||this.cropped||(e[k+1]||n)>=m&&(e[k-1]||n)<=h,l&&n)if(l=u.length)for(;l--;)null!==u[l]&&(d[f++]=u[l]);else d[f++]=u;this.dataMin=H(d);this.dataMax=G(d)},
translate:function(){this.processedXData||this.processData();this.generatePoints();for(var a=this.options,b=a.stacking,e=this.xAxis,g=e.categories,d=this.yAxis,f=this.points,l=f.length,u=!!this.modifyValue,n=a.pointPlacement,k="between"===n||c(n),w=a.threshold,q=a.startFromThreshold?w:0,A,y,z,I,B=Number.MAX_VALUE,a=0;a<l;a++){var F=f[a],D=F.x,C=F.y;y=F.low;var G=b&&d.stacks[(this.negStacks&&C<(q?0:w)?"-":"")+this.stackKey],H;d.isLog&&null!==C&&0>=C&&(F.isNull=!0);F.plotX=A=p(Math.min(Math.max(-1E5,
e.translate(D,0,0,0,1,n,"flags"===this.type)),1E5));b&&this.visible&&!F.isNull&&G&&G[D]&&(I=this.getStackIndicator(I,D,this.index),H=G[D],C=H.points[I.key],y=C[0],C=C[1],y===q&&I.key===G[D].base&&(y=m(w,d.min)),d.isLog&&0>=y&&(y=null),F.total=F.stackTotal=H.total,F.percentage=H.total&&F.y/H.total*100,F.stackY=C,H.setOffset(this.pointXOffset||0,this.barW||0));F.yBottom=h(y)?d.translate(y,0,1,0,1):null;u&&(C=this.modifyValue(C,F));F.plotY=y="number"===typeof C&&Infinity!==C?Math.min(Math.max(-1E5,d.translate(C,
0,1,0,1)),1E5):void 0;F.isInside=void 0!==y&&0<=y&&y<=d.len&&0<=A&&A<=e.len;F.clientX=k?p(e.translate(D,0,0,0,1,n)):A;F.negative=F.y<(w||0);F.category=g&&void 0!==g[F.x]?g[F.x]:F.x;F.isNull||(void 0!==z&&(B=Math.min(B,Math.abs(A-z))),z=A)}this.closestPointRangePx=B},getValidPoints:function(a,b){var c=this.chart;return z(a||this.points||[],function(a){return b&&!c.isInsidePlot(a.plotX,a.plotY,c.inverted)?!1:!a.isNull})},setClip:function(a){var b=this.chart,c=this.options,e=b.renderer,g=b.inverted,
d=this.clipBox,f=d||b.clipBox,m=this.sharedClipKey||["_sharedClip",a&&a.duration,a&&a.easing,f.height,c.xAxis,c.yAxis].join(),h=b[m],l=b[m+"m"];h||(a&&(f.width=0,b[m+"m"]=l=e.clipRect(-99,g?-b.plotLeft:-b.plotTop,99,g?b.chartWidth:b.chartHeight)),b[m]=h=e.clipRect(f),h.count={length:0});a&&!h.count[this.index]&&(h.count[this.index]=!0,h.count.length+=1);!1!==c.clip&&(this.group.clip(a||d?h:b.clipRect),this.markerGroup.clip(l),this.sharedClipKey=m);a||(h.count[this.index]&&(delete h.count[this.index],
--h.count.length),0===h.count.length&&m&&b[m]&&(d||(b[m]=b[m].destroy()),b[m+"m"]&&(b[m+"m"]=b[m+"m"].destroy())))},animate:function(a){var b=this.chart,c=C(this.options.animation),e;a?this.setClip(c):(e=this.sharedClipKey,(a=b[e])&&a.animate({width:b.plotSizeX},c),b[e+"m"]&&b[e+"m"].animate({width:b.plotSizeX+99},c),this.animate=null)},afterAnimate:function(){this.setClip();q(this,"afterAnimate")},drawPoints:function(){var a=this.points,e=this.chart,g,d,f,h,l,n,u,k,w=this.options.marker,q,A,y,p=
this.markerGroup,z=m(w.enabled,this.xAxis.isRadial?!0:null,this.closestPointRangePx>2*w.radius);if(!1!==w.enabled||this._hasPointMarkers)for(f=a.length;f--;)h=a[f],g=Math.floor(h.plotX),d=h.plotY,k=h.graphic,q=h.marker||{},A=!!h.marker,l=z&&void 0===q.enabled||q.enabled,y=h.isInside,l&&c(d)&&null!==h.y?(l=w.radius,n=m(q.symbol,this.symbol),u=0===n.indexOf("url"),k?k[y?"show":"hide"](!0).animate(b({x:g-l,y:d-l},k.symbolName?{width:2*l,height:2*l}:{})):y&&(0<l||u)&&(h.graphic=k=e.renderer.symbol(n,
g-l,d-l,2*l,2*l,A?q:w).attr({r:l}).add(p)),k&&k.addClass(h.getClassName(),!0)):k&&(h.graphic=k.destroy())},destroy:function(){var a=this,b=a.chart,c=/AppleWebKit\/533/.test(F.navigator.userAgent),e,g=a.data||[],d,f,m;q(a,"destroy");u(a);k(a.axisTypes||[],function(b){(m=a[b])&&m.series&&(l(m.series,a),m.isDirty=m.forceRedraw=!0)});a.legendItem&&a.chart.legend.destroyItem(a);for(e=g.length;e--;)(d=g[e])&&d.destroy&&d.destroy();a.points=null;clearTimeout(a.animationTimeout);for(f in a)a[f]instanceof
I&&!a[f].survive&&(e=c&&"group"===f?"hide":"destroy",a[f][e]());b.hoverSeries===a&&(b.hoverSeries=null);l(b.series,a);for(f in a)delete a[f]},getGraphPath:function(a,b,c){var e=this,g=e.options,d=g.step,f,m=[],l=[],n;a=a||e.points;(f=a.reversed)&&a.reverse();(d={right:1,center:2}[d]||d&&3)&&f&&(d=4-d);!g.connectNulls||b||c||(a=this.getValidPoints(a));k(a,function(f,u){var k=f.plotX,w=f.plotY,q=a[u-1];(f.leftCliff||q&&q.rightCliff)&&!c&&(n=!0);f.isNull&&!h(b)&&0<u?n=!g.connectNulls:f.isNull&&!b?n=
!0:(0===u||n?q=["M",f.plotX,f.plotY]:e.getPointSpline?q=e.getPointSpline(a,f,u):d?(q=1===d?["L",q.plotX,w]:2===d?["L",(q.plotX+k)/2,q.plotY,"L",(q.plotX+k)/2,w]:["L",k,q.plotY],q.push("L",k,w)):q=["L",k,w],l.push(f.x),d&&l.push(f.x),m.push.apply(m,q),n=!1)});m.xMap=l;return e.graphPath=m},drawGraph:function(){var a=this,b=(this.gappedPath||this.getGraphPath).call(this),c=[["graph","highcharts-graph"]];k(this.zones,function(a,b){c.push(["zone-graph-"+b,"highcharts-graph highcharts-zone-graph-"+b+" "+
(a.className||"")])});k(c,function(c,e){var d=c[0],g=a[d];g?(g.endX=b.xMap,g.animate({d:b})):b.length&&(a[d]=a.chart.renderer.path(b).addClass(c[1]).attr({zIndex:1}).add(a.group));g&&(g.startX=b.xMap,g.isArea=b.isArea)})},applyZones:function(){var a=this,b=this.chart,c=b.renderer,e=this.zones,d,g,f=this.clips||[],h,l=this.graph,n=this.area,u=Math.max(b.chartWidth,b.chartHeight),w=this[(this.zoneAxis||"y")+"Axis"],q,A,y=b.inverted,p,z,I,F,B=!1;e.length&&(l||n)&&w&&void 0!==w.min&&(A=w.reversed,p=w.horiz,
l&&l.hide(),n&&n.hide(),q=w.getExtremes(),k(e,function(e,k){d=A?p?b.plotWidth:0:p?0:w.toPixels(q.min);d=Math.min(Math.max(m(g,d),0),u);g=Math.min(Math.max(Math.round(w.toPixels(m(e.value,q.max),!0)),0),u);B&&(d=g=w.toPixels(q.max));z=Math.abs(d-g);I=Math.min(d,g);F=Math.max(d,g);w.isXAxis?(h={x:y?F:I,y:0,width:z,height:u},p||(h.x=b.plotHeight-h.x)):(h={x:0,y:y?F:I,width:u,height:z},p&&(h.y=b.plotWidth-h.y));f[k]?f[k].animate(h):(f[k]=c.clipRect(h),l&&a["zone-graph-"+k].clip(f[k]),n&&a["zone-area-"+
k].clip(f[k]));B=e.value>q.max}),this.clips=f)},invertGroups:function(a){function b(){var e={width:c.yAxis.len,height:c.xAxis.len};k(["group","markerGroup"],function(b){c[b]&&c[b].attr(e).invert(a)})}var c=this,e=c.chart;c.xAxis&&(D(e,"resize",b),D(c,"destroy",function(){u(e,"resize",b)}),b(a),c.invertGroups=b)},plotGroup:function(a,b,c,e,d){var g=this[a],f=!g;f&&(this[a]=g=this.chart.renderer.g(b).attr({zIndex:e||.1}).add(d),g.addClass("highcharts-series-"+this.index+" highcharts-"+this.type+"-series highcharts-color-"+
this.colorIndex+" "+(this.options.className||"")));g.attr({visibility:c})[f?"attr":"animate"](this.getPlotBox());return g},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}},render:function(){var a=this,b=a.chart,c,e=a.options,g=!!a.animate&&b.renderer.isSVG&&C(e.animation).duration,d=a.visible?"inherit":"hidden",f=e.zIndex,m=a.hasRendered,h=b.seriesGroup,l=b.inverted;
c=a.plotGroup("group","series",d,f,h);a.markerGroup=a.plotGroup("markerGroup","markers",d,f,h);g&&a.animate(!0);c.inverted=a.isCartesian?l:!1;a.drawGraph&&(a.drawGraph(),a.applyZones());a.drawDataLabels&&a.drawDataLabels();a.visible&&a.drawPoints();a.drawTracker&&!1!==a.options.enableMouseTracking&&a.drawTracker();a.invertGroups(l);!1===e.clip||a.sharedClipKey||m||c.clip(b.clipRect);g&&a.animate();m||(a.animationTimeout=y(function(){a.afterAnimate()},g));a.isDirty=a.isDirtyData=!1;a.hasRendered=!0},
redraw:function(){var a=this.chart,b=this.isDirty||this.isDirtyData,c=this.group,e=this.xAxis,g=this.yAxis;c&&(a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight}),c.animate({translateX:m(e&&e.left,a.plotLeft),translateY:m(g&&g.top,a.plotTop)}));this.translate();this.render();b&&delete this.kdTree},kdDimensions:1,kdAxisArray:["clientX","plotY"],searchPoint:function(a,b){var c=this.xAxis,e=this.yAxis,g=this.chart.inverted;return this.searchKDTree({clientX:g?c.len-a.chartY+c.pos:a.chartX-c.pos,
plotY:g?e.len-a.chartX+e.pos:a.chartY-e.pos},b)},buildKDTree:function(){function a(c,e,g){var d,f;if(f=c&&c.length)return d=b.kdAxisArray[e%g],c.sort(function(a,b){return a[d]-b[d]}),f=Math.floor(f/2),{point:c[f],left:a(c.slice(0,f),e+1,g),right:a(c.slice(f+1),e+1,g)}}var b=this,c=b.kdDimensions;delete b.kdTree;y(function(){b.kdTree=a(b.getValidPoints(null,!b.directTouch),c,c)},b.options.kdNow?0:1)},searchKDTree:function(a,b){function c(a,b,m,l){var n=b.point,u=e.kdAxisArray[m%l],k,w,q=n;w=h(a[g])&&
h(n[g])?Math.pow(a[g]-n[g],2):null;k=h(a[d])&&h(n[d])?Math.pow(a[d]-n[d],2):null;k=(w||0)+(k||0);n.dist=h(k)?Math.sqrt(k):Number.MAX_VALUE;n.distX=h(w)?Math.sqrt(w):Number.MAX_VALUE;u=a[u]-n[u];k=0>u?"left":"right";w=0>u?"right":"left";b[k]&&(k=c(a,b[k],m+1,l),q=k[f]<q[f]?k:n);b[w]&&Math.sqrt(u*u)<q[f]&&(a=c(a,b[w],m+1,l),q=a[f]<q[f]?a:q);return q}var e=this,g=this.kdAxisArray[0],d=this.kdAxisArray[1],f=b?"distX":"dist";this.kdTree||this.buildKDTree();if(this.kdTree)return c(a,this.kdTree,this.kdDimensions,
this.kdDimensions)}})})(J);(function(a){function D(a,e,b,d,f){var h=a.chart.inverted;this.axis=a;this.isNegative=b;this.options=e;this.x=d;this.total=null;this.points={};this.stack=f;this.rightCliff=this.leftCliff=0;this.alignOptions={align:e.align||(h?b?"left":"right":"center"),verticalAlign:e.verticalAlign||(h?"middle":b?"bottom":"top"),y:k(e.y,h?4:b?14:-6),x:k(e.x,h?b?-6:6:0)};this.textAlign=e.textAlign||(h?b?"right":"left":"center")}var C=a.Axis,G=a.Chart,H=a.correctFloat,p=a.defined,f=a.destroyObjectProperties,
d=a.each,h=a.format,k=a.pick;a=a.Series;D.prototype={destroy:function(){f(this,this.axis)},render:function(a){var e=this.options,b=e.format,b=b?h(b,this):e.formatter.call(this);this.label?this.label.attr({text:b,visibility:"hidden"}):this.label=this.axis.chart.renderer.text(b,null,null,e.useHTML).css(e.style).attr({align:this.textAlign,rotation:e.rotation,visibility:"hidden"}).add(a)},setOffset:function(a,e){var b=this.axis,d=b.chart,f=d.inverted,h=b.reversed,h=this.isNegative&&!h||!this.isNegative&&
h,c=b.translate(b.usePercentage?100:this.total,0,0,0,1),b=b.translate(0),b=Math.abs(c-b),g=d.xAxis[0].translate(this.x)+a,n=d.plotHeight,h={x:f?h?c:c-b:g,y:f?n-g-e:h?n-c-b:n-c,width:f?b:e,height:f?e:b};if(f=this.label)f.align(this.alignOptions,null,h),h=f.alignAttr,f[!1===this.options.crop||d.isInsidePlot(h.x,h.y)?"show":"hide"](!0)}};G.prototype.getStacks=function(){var a=this;d(a.yAxis,function(a){a.stacks&&a.hasVisibleSeries&&(a.oldStacks=a.stacks)});d(a.series,function(e){!e.options.stacking||
!0!==e.visible&&!1!==a.options.chart.ignoreHiddenSeries||(e.stackKey=e.type+k(e.options.stack,""))})};C.prototype.buildStacks=function(){var a=this.series,e,b=k(this.options.reversedStacks,!0),d=a.length,f;if(!this.isXAxis){this.usePercentage=!1;for(f=d;f--;)a[b?f:d-f-1].setStackedPoints();for(f=d;f--;)e=a[b?f:d-f-1],e.setStackCliffs&&e.setStackCliffs();if(this.usePercentage)for(f=0;f<d;f++)a[f].setPercentStacks()}};C.prototype.renderStackTotals=function(){var a=this.chart,e=a.renderer,b=this.stacks,
d,f,h=this.stackTotalGroup;h||(this.stackTotalGroup=h=e.g("stack-labels").attr({visibility:"visible",zIndex:6}).add());h.translate(a.plotLeft,a.plotTop);for(d in b)for(f in a=b[d],a)a[f].render(h)};C.prototype.resetStacks=function(){var a=this.stacks,e,b;if(!this.isXAxis)for(e in a)for(b in a[e])a[e][b].touched<this.stacksTouched?(a[e][b].destroy(),delete a[e][b]):(a[e][b].total=null,a[e][b].cum=0)};C.prototype.cleanStacks=function(){var a,e,b;if(!this.isXAxis)for(e in this.oldStacks&&(a=this.stacks=
this.oldStacks),a)for(b in a[e])a[e][b].cum=a[e][b].total};a.prototype.setStackedPoints=function(){if(this.options.stacking&&(!0===this.visible||!1===this.chart.options.chart.ignoreHiddenSeries)){var a=this.processedXData,e=this.processedYData,b=[],d=e.length,f=this.options,h=f.threshold,c=f.startFromThreshold?h:0,g=f.stack,f=f.stacking,n=this.stackKey,m="-"+n,u=this.negStacks,A=this.yAxis,w=A.stacks,I=A.oldStacks,y,F,t,v,E,C,r;A.stacksTouched+=1;for(E=0;E<d;E++)C=a[E],r=e[E],y=this.getStackIndicator(y,
C,this.index),v=y.key,t=(F=u&&r<(c?0:h))?m:n,w[t]||(w[t]={}),w[t][C]||(I[t]&&I[t][C]?(w[t][C]=I[t][C],w[t][C].total=null):w[t][C]=new D(A,A.options.stackLabels,F,C,g)),t=w[t][C],null!==r&&(t.points[v]=t.points[this.index]=[k(t.cum,c)],p(t.cum)||(t.base=v),t.touched=A.stacksTouched,0<y.index&&!1===this.singleStacks&&(t.points[v][0]=t.points[this.index+","+C+",0"][0])),"percent"===f?(F=F?n:m,u&&w[F]&&w[F][C]?(F=w[F][C],t.total=F.total=Math.max(F.total,t.total)+Math.abs(r)||0):t.total=H(t.total+(Math.abs(r)||
0))):t.total=H(t.total+(r||0)),t.cum=k(t.cum,c)+(r||0),null!==r&&(t.points[v].push(t.cum),b[E]=t.cum);"percent"===f&&(A.usePercentage=!0);this.stackedYData=b;A.oldStacks={}}};a.prototype.setPercentStacks=function(){var a=this,e=a.stackKey,b=a.yAxis.stacks,f=a.processedXData,h;d([e,"-"+e],function(e){for(var c=f.length,d,n;c--;)if(d=f[c],h=a.getStackIndicator(h,d,a.index),d=(n=b[e]&&b[e][d])&&n.points[h.key])n=n.total?100/n.total:0,d[0]=H(d[0]*n),d[1]=H(d[1]*n),a.stackedYData[c]=d[1]})};a.prototype.getStackIndicator=
function(a,d,b){p(a)&&a.x===d?a.index++:a={x:d,index:0};a.key=[b,d,a.index].join();return a}})(J);(function(a){var D=a.addEvent,C=a.Axis,G=a.createElement,H=a.css,p=a.defined,f=a.each,d=a.erase,h=a.extend,k=a.fireEvent,l=a.inArray,e=a.isObject,b=a.merge,q=a.pick,z=a.Point,B=a.Series,c=a.seriesTypes,g=a.setAnimation,n=a.splat;h(a.Chart.prototype,{addSeries:function(a,b,c){var d,e=this;a&&(b=q(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,c,d,e){var g=c?"xAxis":"yAxis",f=this.options;a=b(a,{index:this[g].length,isX:c});new C(this,a);f[g]=n(f[g]||{});f[g].push(a);q(d,!0)&&this.redraw(e)},showLoading:function(a){var b=this,c=b.options,d=b.loadingDiv,e=function(){d&&H(d,{left:b.plotLeft+"px",top:b.plotTop+"px",width:b.plotWidth+"px",height:b.plotHeight+"px"})};d||(b.loadingDiv=d=G("div",{className:"highcharts-loading highcharts-loading-hidden"},null,b.container),b.loadingSpan=G("span",{className:"highcharts-loading-inner"},
null,d),D(b,"redraw",e));setTimeout(function(){d.className="highcharts-loading"});b.loadingSpan.innerHTML=a||c.lang.loading;b.loadingShown=!0;e()},hideLoading:function(){var a=this.loadingDiv;a&&(a.className="highcharts-loading highcharts-loading-hidden");this.loadingShown=!1},propsRequireDirtyBox:"backgroundColor borderColor borderWidth margin marginTop marginRight marginBottom marginLeft spacing spacingTop spacingRight spacingBottom spacingLeft borderRadius plotBackgroundColor plotBackgroundImage plotBorderColor plotBorderWidth plotShadow shadow".split(" "),
propsRequireUpdateSeries:["chart.polar","chart.ignoreHiddenSeries","chart.type","colors","plotOptions"],update:function(a,c){var d,e={credits:"addCredits",title:"setTitle",subtitle:"setSubtitle"},g=a.chart,h,k;if(g){b(!0,this.options.chart,g);"className"in g&&this.setClassName(g.className);if("inverted"in g||"polar"in g)this.propFromSeries(),h=!0;for(d in g)g.hasOwnProperty(d)&&(-1!==l("chart."+d,this.propsRequireUpdateSeries)&&(k=!0),-1!==l(d,this.propsRequireDirtyBox)&&(this.isDirtyBox=!0))}for(d in a){if(this[d]&&
"function"===typeof this[d].update)this[d].update(a[d],!1);else if("function"===typeof this[e[d]])this[e[d]](a[d]);"chart"!==d&&-1!==l(d,this.propsRequireUpdateSeries)&&(k=!0)}a.plotOptions&&b(!0,this.options.plotOptions,a.plotOptions);f(["xAxis","yAxis","series"],function(b){a[b]&&f(n(a[b]),function(a){var c=p(a.id)&&this.get(a.id)||this[b][0];c&&c.coll===b&&c.update(a,!1)},this)},this);h&&f(this.axes,function(a){a.update({},!1)});k&&f(this.series,function(a){a.update({},!1)});a.loading&&b(!0,this.options.loading,
a.loading);g&&("width"in g||"height"in g)?this.setSize(g.width,g.height):q(c,!0)&&this.redraw()},setSubtitle:function(a){this.setTitle(void 0,a)}});h(z.prototype,{update:function(a,b,c,d){function g(){f.applyOptions(a);null===f.y&&l&&(f.graphic=l.destroy());e(a,!0)&&(l&&l.element&&a&&a.marker&&a.marker.symbol&&(f.graphic=l.destroy()),a&&a.dataLabels&&f.dataLabel&&(f.dataLabel=f.dataLabel.destroy()));k=f.index;h.updateParallelArrays(f,k);p.data[k]=e(p.data[k],!0)?f.options:a;h.isDirty=h.isDirtyData=
!0;!h.fixedBox&&h.hasCartesianSeries&&(n.isDirtyBox=!0);"point"===p.legendType&&(n.isDirtyLegend=!0);b&&n.redraw(c)}var f=this,h=f.series,l=f.graphic,k,n=h.chart,p=h.options;b=q(b,!0);!1===d?g():f.firePointEvent("update",{options:a},g)},remove:function(a,b){this.series.removePoint(l(this,this.series.data),a,b)}});h(B.prototype,{addPoint:function(a,b,c,d){var e=this.options,g=this.data,f=this.chart,h=this.xAxis&&this.xAxis.names,l=e.data,k,n,p=this.xData,z,B;b=q(b,!0);k={series:this};this.pointClass.prototype.applyOptions.apply(k,
[a]);B=k.x;z=p.length;if(this.requireSorting&&B<p[z-1])for(n=!0;z&&p[z-1]>B;)z--;this.updateParallelArrays(k,"splice",z,0,0);this.updateParallelArrays(k,z);h&&k.name&&(h[B]=k.name);l.splice(z,0,a);n&&(this.data.splice(z,0,null),this.processData());"point"===e.legendType&&this.generatePoints();c&&(g[0]&&g[0].remove?g[0].remove(!1):(g.shift(),this.updateParallelArrays(k,"shift"),l.shift()));this.isDirtyData=this.isDirty=!0;b&&f.redraw(d)},removePoint:function(a,b,c){var d=this,e=d.data,f=e[a],h=d.points,
l=d.chart,k=function(){h&&h.length===e.length&&h.splice(a,1);e.splice(a,1);d.options.data.splice(a,1);d.updateParallelArrays(f||{series:d},"splice",a,1);f&&f.destroy();d.isDirty=!0;d.isDirtyData=!0;b&&l.redraw()};g(c,l);b=q(b,!0);f?f.firePointEvent("remove",null,k):k()},remove:function(a,b,c){function d(){e.destroy();g.isDirtyLegend=g.isDirtyBox=!0;g.linkSeries();q(a,!0)&&g.redraw(b)}var e=this,g=e.chart;!1!==c?k(e,"remove",null,d):d()},update:function(a,d){var e=this,g=this.chart,l=this.userOptions,
k=this.type,n=a.type||l.type||g.options.chart.type,p=c[k].prototype,v=["group","markerGroup","dataLabelsGroup"],z;if(n&&n!==k||void 0!==a.zIndex)v.length=0;f(v,function(a){v[a]=e[a];delete e[a]});a=b(l,{animation:!1,index:this.index,pointStart:this.xData[0]},{data:this.options.data},a);this.remove(!1,null,!1);for(z in p)this[z]=void 0;h(this,c[n||k].prototype);f(v,function(a){e[a]=v[a]});this.init(g,a);g.linkSeries();q(d,!0)&&g.redraw(!1)}});h(C.prototype,{update:function(a,c){var d=this.chart;a=
d.options[this.coll][this.options.index]=b(this.userOptions,a);this.destroy(!0);this.init(d,h(a,{events:void 0}));d.isDirtyBox=!0;q(c,!0)&&d.redraw()},remove:function(a){for(var b=this.chart,c=this.coll,e=this.series,g=e.length;g--;)e[g]&&e[g].remove(!1);d(b.axes,this);d(b[c],this);b.options[c].splice(this.options.index,1);f(b[c],function(a,b){a.options.index=b});this.destroy();b.isDirtyBox=!0;q(a,!0)&&b.redraw()},setTitle:function(a,b){this.update({title:a},b)},setCategories:function(a,b){this.update({categories:a},
b)}})})(J);(function(a){var D=a.each,C=a.map,G=a.pick,H=a.Series,p=a.seriesType;p("area","line",{softThreshold:!1,threshold:0},{singleStacks:!1,getStackPoints:function(){var a=[],d=[],h=this.xAxis,k=this.yAxis,l=k.stacks[this.stackKey],e={},b=this.points,q=this.index,p=k.series,B=p.length,c,g=G(k.options.reversedStacks,!0)?1:-1,n,m;if(this.options.stacking){for(n=0;n<b.length;n++)e[b[n].x]=b[n];for(m in l)null!==l[m].total&&d.push(m);d.sort(function(a,b){return a-b});c=C(p,function(){return this.visible});
D(d,function(b,m){var w=0,p,y;if(e[b]&&!e[b].isNull)a.push(e[b]),D([-1,1],function(a){var f=1===a?"rightNull":"leftNull",h=0,k=l[d[m+a]];if(k)for(n=q;0<=n&&n<B;)p=k.points[n],p||(n===q?e[b][f]=!0:c[n]&&(y=l[b].points[n])&&(h-=y[1]-y[0])),n+=g;e[b][1===a?"rightCliff":"leftCliff"]=h});else{for(n=q;0<=n&&n<B;){if(p=l[b].points[n]){w=p[1];break}n+=g}w=k.toPixels(w,!0);a.push({isNull:!0,plotX:h.toPixels(b,!0),plotY:w,yBottom:w})}})}return a},getGraphPath:function(a){var d=H.prototype.getGraphPath,h=this.options,
k=h.stacking,l=this.yAxis,e,b,q=[],p=[],B=this.index,c,g=l.stacks[this.stackKey],n=h.threshold,m=l.getThreshold(h.threshold),u,h=h.connectNulls||"percent"===k,A=function(b,d,e){var h=a[b];b=k&&g[h.x].points[B];var u=h[e+"Null"]||0;e=h[e+"Cliff"]||0;var A,E,h=!0;e||u?(A=(u?b[0]:b[1])+e,E=b[0]+e,h=!!u):!k&&a[d]&&a[d].isNull&&(A=E=n);void 0!==A&&(p.push({plotX:c,plotY:null===A?m:l.getThreshold(A),isNull:h}),q.push({plotX:c,plotY:null===E?m:l.getThreshold(E),doCurve:!1}))};a=a||this.points;k&&(a=this.getStackPoints());
for(e=0;e<a.length;e++)if(b=a[e].isNull,c=G(a[e].rectPlotX,a[e].plotX),u=G(a[e].yBottom,m),!b||h)h||A(e,e-1,"left"),b&&!k&&h||(p.push(a[e]),q.push({x:e,plotX:c,plotY:u})),h||A(e,e+1,"right");e=d.call(this,p,!0,!0);q.reversed=!0;b=d.call(this,q,!0,!0);b.length&&(b[0]="L");b=e.concat(b);d=d.call(this,p,!1,h);b.xMap=e.xMap;this.areaPath=b;return d},drawGraph:function(){this.areaPath=[];H.prototype.drawGraph.apply(this);var a=this,d=this.areaPath,h=this.options,k=[["area","highcharts-area"]];D(this.zones,
function(a,d){k.push(["zone-area-"+d,"highcharts-area highcharts-zone-area-"+d+" "+a.className])});D(k,function(l){var e=l[0],b=a[e];b?(b.endX=d.xMap,b.animate({d:d})):(b=a[e]=a.chart.renderer.path(d).addClass(l[1]).attr({zIndex:0}).add(a.group),b.isArea=!0);b.startX=d.xMap;b.shiftUnit=h.step?2:1})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(J);(function(a){var D=a.extendClass,C=a.merge,G=a.pick,H=a.Series,p=a.seriesTypes;a.defaultPlotOptions.spline=C(a.defaultPlotOptions.line);p.spline=
D(H,{type:"spline",getPointSpline:function(a,d,h){var k=d.plotX,l=d.plotY,e=a[h-1];h=a[h+1];var b,q,p,B;if(e&&!e.isNull&&!1!==e.doCurve&&h&&!h.isNull&&!1!==h.doCurve){a=e.plotY;p=h.plotX;h=h.plotY;var c=0;b=(1.5*k+e.plotX)/2.5;q=(1.5*l+a)/2.5;p=(1.5*k+p)/2.5;B=(1.5*l+h)/2.5;p!==b&&(c=(B-q)*(p-k)/(p-b)+l-B);q+=c;B+=c;q>a&&q>l?(q=Math.max(a,l),B=2*l-q):q<a&&q<l&&(q=Math.min(a,l),B=2*l-q);B>h&&B>l?(B=Math.max(h,l),q=2*l-B):B<h&&B<l&&(B=Math.min(h,l),q=2*l-B);d.rightContX=p;d.rightContY=B}d=["C",G(e.rightContX,
e.plotX),G(e.rightContY,e.plotY),G(b,k),G(q,l),k,l];e.rightContX=e.rightContY=null;return d}})})(J);(function(a){var D=a.seriesTypes.area.prototype,C=a.seriesType;C("areaspline","spline",a.defaultPlotOptions.area,{getStackPoints:D.getStackPoints,getGraphPath:D.getGraphPath,setStackCliffs:D.setStackCliffs,drawGraph:D.drawGraph,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle})})(J);(function(a){var D=a.animObject,C=a.each,G=a.extend,H=a.isNumber,p=a.merge,f=a.pick,d=a.Series,h=a.seriesType,k=a.stop,
l=a.svg;h("column","line",{borderRadius:0,groupPadding:.2,marker:null,pointPadding:.1,minPointLength:0,cropThreshold:50,pointRange:null,states:{hover:{halo:!1}},dataLabels:{align:null,verticalAlign:null,y:null},softThreshold:!1,startFromThreshold:!0,stickyTracking:!1,tooltip:{distance:6},threshold:0},{cropShoulder:0,directTouch:!0,trackerGroups:["group","dataLabelsGroup"],negStacks:!0,init:function(){d.prototype.init.apply(this,arguments);var a=this,b=a.chart;b.hasRendered&&C(b.series,function(b){b.type===
a.type&&(b.isDirty=!0)})},getColumnMetrics:function(){var a=this,b=a.options,d=a.xAxis,h=a.yAxis,l=d.reversed,c,g={},k=0;!1===b.grouping?k=1:C(a.chart.series,function(b){var d=b.options,f=b.yAxis,m;b.type===a.type&&b.visible&&h.len===f.len&&h.pos===f.pos&&(d.stacking?(c=b.stackKey,void 0===g[c]&&(g[c]=k++),m=g[c]):!1!==d.grouping&&(m=k++),b.columnIndex=m)});var m=Math.min(Math.abs(d.transA)*(d.ordinalSlope||b.pointRange||d.closestPointRange||d.tickInterval||1),d.len),u=m*b.groupPadding,p=(m-2*u)/
k,b=Math.min(b.maxPointWidth||d.len,f(b.pointWidth,p*(1-2*b.pointPadding)));a.columnMetrics={width:b,offset:(p-b)/2+(u+((a.columnIndex||0)+(l?1:0))*p-m/2)*(l?-1:1)};return a.columnMetrics},crispCol:function(a,b,d,f){var h=this.chart,c=this.borderWidth,g=-(c%2?.5:0),c=c%2?.5:1;h.inverted&&h.renderer.isVML&&(c+=1);d=Math.round(a+d)+g;a=Math.round(a)+g;f=Math.round(b+f)+c;g=.5>=Math.abs(b)&&.5<f;b=Math.round(b)+c;f-=b;g&&f&&(--b,f+=1);return{x:a,y:b,width:d-a,height:f}},translate:function(){var a=this,
b=a.chart,h=a.options,l=a.dense=2>a.closestPointRange*a.xAxis.transA,l=a.borderWidth=f(h.borderWidth,l?0:1),k=a.yAxis,c=a.translatedThreshold=k.getThreshold(h.threshold),g=f(h.minPointLength,5),n=a.getColumnMetrics(),m=n.width,u=a.barW=Math.max(m,1+2*l),p=a.pointXOffset=n.offset;b.inverted&&(c-=.5);h.pointPadding&&(u=Math.ceil(u));d.prototype.translate.apply(a);C(a.points,function(d){var h=f(d.yBottom,c),l=999+Math.abs(h),l=Math.min(Math.max(-l,d.plotY),k.len+l),n=d.plotX+p,q=u,v=Math.min(l,h),z,
C=Math.max(l,h)-v;Math.abs(C)<g&&g&&(C=g,z=!k.reversed&&!d.negative||k.reversed&&d.negative,v=Math.abs(v-c)>g?h-g:c-(z?g:0));d.barX=n;d.pointWidth=m;d.tooltipPos=b.inverted?[k.len+k.pos-b.plotLeft-l,a.xAxis.len-n-q/2,C]:[n+q/2,l+k.pos-b.plotTop,C];d.shapeType="rect";d.shapeArgs=a.crispCol.apply(a,d.isNull?[d.plotX,k.len/2,0,0]:[n,v,q,C])})},getSymbol:a.noop,drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,drawGraph:function(){this.group[this.dense?"addClass":"removeClass"]("highcharts-dense-data")},
drawPoints:function(){var a=this,b=this.chart,d=b.renderer,f=a.options.animationLimit||250,h;C(a.points,function(c){var g=c.graphic;H(c.plotY)&&null!==c.y?(h=c.shapeArgs,g?(k(g),g[b.pointCount<f?"animate":"attr"](p(h))):c.graphic=d[c.shapeType](h).attr({"class":c.getClassName()}).add(c.group||a.group)):g&&(c.graphic=g.destroy())})},animate:function(a){var b=this,d=this.yAxis,f=b.options,h=this.chart.inverted,c={};l&&(a?(c.scaleY=.001,a=Math.min(d.pos+d.len,Math.max(d.pos,d.toPixels(f.threshold))),
h?c.translateX=a-d.len:c.translateY=a,b.group.attr(c)):(c[h?"translateX":"translateY"]=d.pos,b.group.animate(c,G(D(b.options.animation),{step:function(a,c){b.group.attr({scaleY:Math.max(.001,c.pos)})}})),b.animate=null))},remove:function(){var a=this,b=a.chart;b.hasRendered&&C(b.series,function(b){b.type===a.type&&(b.isDirty=!0)});d.prototype.remove.apply(a,arguments)}})})(J);(function(a){a=a.seriesType;a("bar","column",null,{inverted:!0})})(J);(function(a){var D=a.Series;a=a.seriesType;a("scatter",
"line",{lineWidth:0,marker:{enabled:!0},tooltip:{headerFormat:'<span style="color:{point.color}">\u25cf</span> <span style="font-size: 0.85em"> {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,kdDimensions:2,drawGraph:function(){this.options.lineWidth&&D.prototype.drawGraph.call(this)}})})(J);(function(a){var D=a.pick,C=a.relativeLength;
a.CenteredSeriesMixin={getCenter:function(){var a=this.options,H=this.chart,p=2*(a.slicedOffset||0),f=H.plotWidth-2*p,H=H.plotHeight-2*p,d=a.center,d=[D(d[0],"50%"),D(d[1],"50%"),a.size||"100%",a.innerSize||0],h=Math.min(f,H),k,l;for(k=0;4>k;++k)l=d[k],a=2>k||2===k&&/%$/.test(l),d[k]=C(l,[f,H,h,d[2]][k])+(a?p:0);d[3]>d[2]&&(d[3]=d[2]);return d}}})(J);(function(a){var D=a.addEvent,C=a.defined,G=a.each,H=a.extend,p=a.inArray,f=a.noop,d=a.pick,h=a.Point,k=a.Series,l=a.seriesType,e=a.setAnimation;l("pie",
"line",{center:[null,null],clip:!1,colorByPoint:!0,dataLabels:{distance:30,enabled:!0,formatter:function(){return null===this.y?void 0:this.point.name},x:0},ignoreHiddenPoint:!0,legendType:"point",marker:null,size:null,showInLegend:!1,slicedOffset:10,stickyTracking:!1,tooltip:{followPointer:!0}},{isCartesian:!1,requireSorting:!1,directTouch:!0,noSharedTooltip:!0,trackerGroups:["group","dataLabelsGroup"],axisTypes:[],pointAttribs:a.seriesTypes.column.prototype.pointAttribs,animate:function(a){var d=
this,e=d.points,f=d.startAngleRad;a||(G(e,function(a){var b=a.graphic,e=a.shapeArgs;b&&(b.attr({r:a.startR||d.center[3]/2,start:f,end:f}),b.animate({r:e.r,start:e.start,end:e.end},d.options.animation))}),d.animate=null)},updateTotals:function(){var a,d=0,e=this.points,f=e.length,c,g=this.options.ignoreHiddenPoint;for(a=0;a<f;a++)c=e[a],0>c.y&&(c.y=null),d+=g&&!c.visible?0:c.y;this.total=d;for(a=0;a<f;a++)c=e[a],c.percentage=0<d&&(c.visible||!g)?c.y/d*100:0,c.total=d},generatePoints:function(){k.prototype.generatePoints.call(this);
this.updateTotals()},translate:function(a){this.generatePoints();var e=0,f=this.options,h=f.slicedOffset,c=h+(f.borderWidth||0),g,l,m,k=f.startAngle||0,p=this.startAngleRad=Math.PI/180*(k-90),k=(this.endAngleRad=Math.PI/180*(d(f.endAngle,k+360)-90))-p,w=this.points,I=f.dataLabels.distance,f=f.ignoreHiddenPoint,y,F=w.length,t;a||(this.center=a=this.getCenter());this.getX=function(c,d){m=Math.asin(Math.min((c-a[1])/(a[2]/2+I),1));return a[0]+(d?-1:1)*Math.cos(m)*(a[2]/2+I)};for(y=0;y<F;y++){t=w[y];
g=p+e*k;if(!f||t.visible)e+=t.percentage/100;l=p+e*k;t.shapeType="arc";t.shapeArgs={x:a[0],y:a[1],r:a[2]/2,innerR:a[3]/2,start:Math.round(1E3*g)/1E3,end:Math.round(1E3*l)/1E3};m=(l+g)/2;m>1.5*Math.PI?m-=2*Math.PI:m<-Math.PI/2&&(m+=2*Math.PI);t.slicedTranslation={translateX:Math.round(Math.cos(m)*h),translateY:Math.round(Math.sin(m)*h)};g=Math.cos(m)*a[2]/2;l=Math.sin(m)*a[2]/2;t.tooltipPos=[a[0]+.7*g,a[1]+.7*l];t.half=m<-Math.PI/2||m>Math.PI/2?1:0;t.angle=m;c=Math.min(c,I/5);t.labelPos=[a[0]+g+Math.cos(m)*
I,a[1]+l+Math.sin(m)*I,a[0]+g+Math.cos(m)*c,a[1]+l+Math.sin(m)*c,a[0]+g,a[1]+l,0>I?"center":t.half?"right":"left",m]}},drawGraph:null,drawPoints:function(){var a=this,d=a.chart.renderer,e,f,c;G(a.points,function(g){null!==g.y&&(f=g.graphic,c=g.shapeArgs,e=g.sliced?g.slicedTranslation:{},f?f.setRadialReference(a.center).animate(H(c,e)):(g.graphic=f=d[g.shapeType](c).addClass(g.getClassName()).setRadialReference(a.center).attr(e).add(a.group),g.visible||f.attr({visibility:"hidden"})))})},searchPoint:f,
sortByAngle:function(a,d){a.sort(function(a,b){return void 0!==a.angle&&(b.angle-a.angle)*d})},drawLegendSymbol:a.LegendSymbolMixin.drawRectangle,getCenter:a.CenteredSeriesMixin.getCenter,getSymbol:f},{init:function(){h.prototype.init.apply(this,arguments);var a=this,e;a.name=d(a.name,"Slice");e=function(d){a.slice("select"===d.type)};D(a,"select",e);D(a,"unselect",e);return a},setVisible:function(a,e){var f=this,h=f.series,c=h.chart,g=h.options.ignoreHiddenPoint;e=d(e,g);a!==f.visible&&(f.visible=
f.options.visible=a=void 0===a?!f.visible:a,h.options.data[p(f,h.data)]=f.options,G(["graphic","dataLabel","connector","shadowGroup"],function(c){if(f[c])f[c][a?"show":"hide"](!0)}),f.legendItem&&c.legend.colorizeItem(f,a),a||"hover"!==f.state||f.setState(""),g&&(h.isDirty=!0),e&&c.redraw())},slice:function(a,f,h){var l=this.series;e(h,l.chart);d(f,!0);this.sliced=this.options.sliced=a=C(a)?a:!this.sliced;l.options.data[p(this,l.data)]=this.options;this.graphic.animate(a?this.slicedTranslation:{translateX:0,
translateY:0})},haloPath:function(a){var d=this.shapeArgs,e=this.series.chart;return this.sliced||!this.visible?[]:this.series.chart.renderer.symbols.arc(e.plotLeft+d.x,e.plotTop+d.y,d.r+a,d.r+a,{innerR:this.shapeArgs.r,start:d.start,end:d.end})}})})(J);(function(a){var D=a.addEvent,C=a.arrayMax,G=a.defined,H=a.each,p=a.extend,f=a.format,d=a.map,h=a.merge,k=a.noop,l=a.pick,e=a.relativeLength,b=a.Series,q=a.seriesTypes,z=a.stableSort,B=a.stop;a.distribute=function(a,b){function e(a,b){return a.target-
b.target}var f,h=!0,l=a,k=[],p;p=0;for(f=a.length;f--;)p+=a[f].size;if(p>b){z(a,function(a,b){return(b.rank||0)-(a.rank||0)});for(p=f=0;p<=b;)p+=a[f].size,f++;k=a.splice(f-1,a.length)}z(a,e);for(a=d(a,function(a){return{size:a.size,targets:[a.target]}});h;){for(f=a.length;f--;)h=a[f],p=(Math.min.apply(0,h.targets)+Math.max.apply(0,h.targets))/2,h.pos=Math.min(Math.max(0,p-h.size/2),b-h.size);f=a.length;for(h=!1;f--;)0<f&&a[f-1].pos+a[f-1].size>a[f].pos&&(a[f-1].size+=a[f].size,a[f-1].targets=a[f-
1].targets.concat(a[f].targets),a[f-1].pos+a[f-1].size>b&&(a[f-1].pos=b-a[f-1].size),a.splice(f,1),h=!0)}f=0;H(a,function(a){var b=0;H(a.targets,function(){l[f].pos=a.pos+b;b+=l[f].size;f++})});l.push.apply(l,k);z(l,e)};b.prototype.drawDataLabels=function(){var a=this,b=a.options,d=b.dataLabels,e=a.points,k,p,w=a.hasRendered||0,q,y,F=l(d.defer,!0),t=a.chart.renderer;if(d.enabled||a._hasPointLabels)a.dlProcessOptions&&a.dlProcessOptions(d),y=a.plotGroup("dataLabelsGroup","data-labels",F&&!w?"hidden":
"visible",d.zIndex||6),F&&(y.attr({opacity:+w}),w||D(a,"afterAnimate",function(){a.visible&&y.show(!0);y[b.animation?"animate":"attr"]({opacity:1},{duration:200})})),p=d,H(e,function(b){var e,g=b.dataLabel,m,w,F=b.connector,z=!0;k=b.dlOptions||b.options&&b.options.dataLabels;e=l(k&&k.enabled,p.enabled)&&null!==b.y;if(g&&!e)b.dataLabel=g.destroy();else if(e){d=h(p,k);e=d.rotation;m=b.getLabelConfig();q=d.format?f(d.format,m):d.formatter.call(m,d);if(g)G(q)?(g.attr({text:q}),z=!1):(b.dataLabel=g=g.destroy(),
F&&(b.connector=F.destroy()));else if(G(q)){g={r:d.borderRadius||0,rotation:e,padding:d.padding,zIndex:1};for(w in g)void 0===g[w]&&delete g[w];g=b.dataLabel=t[e?"text":"label"](q,0,-9999,d.shape,null,null,d.useHTML,null,"data-label").attr(g);g.addClass("highcharts-data-label-color-"+b.colorIndex+" "+(d.className||""));g.add(y)}g&&a.alignDataLabel(b,g,d,null,z)}})};b.prototype.alignDataLabel=function(a,b,d,e,f){var h=this.chart,k=h.inverted,q=l(a.plotX,-9999),y=l(a.plotY,-9999),F=b.getBBox(),t,v=
d.rotation,z=d.align,C=this.visible&&(a.series.forceDL||h.isInsidePlot(q,Math.round(y),k)||e&&h.isInsidePlot(q,k?e.x+1:e.y+e.height-1,k)),r="justify"===l(d.overflow,"justify");C&&(t=h.renderer.fontMetrics(void 0,b).b,e=p({x:k?h.plotWidth-y:q,y:Math.round(k?h.plotHeight-q:y),width:0,height:0},e),p(d,{width:F.width,height:F.height}),v?(r=!1,k=h.renderer.rotCorr(t,v),k={x:e.x+d.x+e.width/2+k.x,y:e.y+d.y+{top:0,middle:.5,bottom:1}[d.verticalAlign]*e.height},b[f?"attr":"animate"](k).attr({align:z}),q=
(v+720)%360,q=180<q&&360>q,"left"===z?k.y-=q?F.height:0:"center"===z?(k.x-=F.width/2,k.y-=F.height/2):"right"===z&&(k.x-=F.width,k.y-=q?0:F.height)):(b.align(d,null,e),k=b.alignAttr),r?this.justifyDataLabel(b,d,k,F,e,f):l(d.crop,!0)&&(C=h.isInsidePlot(k.x,k.y)&&h.isInsidePlot(k.x+F.width,k.y+F.height)),d.shape&&!v&&b.attr({anchorX:a.plotX,anchorY:a.plotY}));C||(B(b),b.attr({y:-9999}),b.placed=!1)};b.prototype.justifyDataLabel=function(a,b,d,e,f,h){var l=this.chart,k=b.align,p=b.verticalAlign,q,t,
v=a.box?0:a.padding||0;q=d.x+v;0>q&&("right"===k?b.align="left":b.x=-q,t=!0);q=d.x+e.width-v;q>l.plotWidth&&("left"===k?b.align="right":b.x=l.plotWidth-q,t=!0);q=d.y+v;0>q&&("bottom"===p?b.verticalAlign="top":b.y=-q,t=!0);q=d.y+e.height-v;q>l.plotHeight&&("top"===p?b.verticalAlign="bottom":b.y=l.plotHeight-q,t=!0);t&&(a.placed=!h,a.align(b,null,f))};q.pie&&(q.pie.prototype.drawDataLabels=function(){var c=this,e=c.data,f,h=c.chart,k=c.options.dataLabels,p=l(k.connectorPadding,10),q=l(k.connectorWidth,
1),z=h.plotWidth,y=h.plotHeight,F,t=k.distance,v=c.center,E=v[2]/2,B=v[1],r=0<t,x,D,G,J,L=[[],[]],S,Q,T,R,O=[0,0,0,0];c.visible&&(k.enabled||c._hasPointLabels)&&(b.prototype.drawDataLabels.apply(c),H(e,function(a){a.dataLabel&&a.visible&&(L[a.half].push(a),a.dataLabel._pos=null)}),H(L,function(b,e){var g,l,q=b.length,r,w,F;if(q)for(c.sortByAngle(b,e-.5),0<t&&(g=Math.max(0,B-E-t),l=Math.min(B+E+t,h.plotHeight),r=d(b,function(a){if(a.dataLabel)return F=a.dataLabel.getBBox().height||21,{target:a.labelPos[1]-
g+F/2,size:F,rank:a.y}}),a.distribute(r,l+F-g)),R=0;R<q;R++)f=b[R],G=f.labelPos,x=f.dataLabel,T=!1===f.visible?"hidden":"inherit",w=G[1],r?void 0===r[R].pos?T="hidden":(J=r[R].size,Q=g+r[R].pos):Q=w,S=k.justify?v[0]+(e?-1:1)*(E+t):c.getX(Q<g+2||Q>l-2?w:Q,e),x._attr={visibility:T,align:G[6]},x._pos={x:S+k.x+({left:p,right:-p}[G[6]]||0),y:Q+k.y-10},G.x=S,G.y=Q,null===c.options.size&&(D=x.width,S-D<p?O[3]=Math.max(Math.round(D-S+p),O[3]):S+D>z-p&&(O[1]=Math.max(Math.round(S+D-z+p),O[1])),0>Q-J/2?O[0]=
Math.max(Math.round(-Q+J/2),O[0]):Q+J/2>y&&(O[2]=Math.max(Math.round(Q+J/2-y),O[2])))}),0===C(O)||this.verifyDataLabelOverflow(O))&&(this.placeDataLabels(),r&&q&&H(this.points,function(a){var b;F=a.connector;if((x=a.dataLabel)&&x._pos&&a.visible){T=x._attr.visibility;if(b=!F)a.connector=F=h.renderer.path().addClass("highcharts-data-label-connector highcharts-color-"+a.colorIndex).add(c.dataLabelsGroup);F[b?"attr":"animate"]({d:c.connectorPath(a.labelPos)});F.attr("visibility",T)}else F&&(a.connector=
F.destroy())}))},q.pie.prototype.connectorPath=function(a){var b=a.x,d=a.y;return l(this.options.softConnector,!0)?["M",b+("left"===a[6]?5:-5),d,"C",b,d,2*a[2]-a[4],2*a[3]-a[5],a[2],a[3],"L",a[4],a[5]]:["M",b+("left"===a[6]?5:-5),d,"L",a[2],a[3],"L",a[4],a[5]]},q.pie.prototype.placeDataLabels=function(){H(this.points,function(a){var b=a.dataLabel;b&&a.visible&&((a=b._pos)?(b.attr(b._attr),b[b.moved?"animate":"attr"](a),b.moved=!0):b&&b.attr({y:-9999}))})},q.pie.prototype.alignDataLabel=k,q.pie.prototype.verifyDataLabelOverflow=
function(a){var b=this.center,d=this.options,f=d.center,h=d.minSize||80,l,k;null!==f[0]?l=Math.max(b[2]-Math.max(a[1],a[3]),h):(l=Math.max(b[2]-a[1]-a[3],h),b[0]+=(a[3]-a[1])/2);null!==f[1]?l=Math.max(Math.min(l,b[2]-Math.max(a[0],a[2])),h):(l=Math.max(Math.min(l,b[2]-a[0]-a[2]),h),b[1]+=(a[0]-a[2])/2);l<b[2]?(b[2]=l,b[3]=Math.min(e(d.innerSize||0,l),l),this.translate(b),this.drawDataLabels&&this.drawDataLabels()):k=!0;return k});q.column&&(q.column.prototype.alignDataLabel=function(a,d,e,f,k){var p=
this.chart.inverted,q=a.series,z=a.dlBox||a.shapeArgs,y=l(a.below,a.plotY>l(this.translatedThreshold,q.yAxis.len)),F=l(e.inside,!!this.options.stacking);z&&(f=h(z),0>f.y&&(f.height+=f.y,f.y=0),z=f.y+f.height-q.yAxis.len,0<z&&(f.height-=z),p&&(f={x:q.yAxis.len-f.y-f.height,y:q.xAxis.len-f.x-f.width,width:f.height,height:f.width}),F||(p?(f.x+=y?0:f.width,f.width=0):(f.y+=y?f.height:0,f.height=0)));e.align=l(e.align,!p||F?"center":y?"right":"left");e.verticalAlign=l(e.verticalAlign,p||F?"middle":y?"top":
"bottom");b.prototype.alignDataLabel.call(this,a,d,e,f,k)})})(J);(function(a){var D=a.Chart,C=a.each,G=a.pick,H=a.addEvent;D.prototype.callbacks.push(function(a){function f(){var d=[];C(a.series,function(a){var f=a.options.dataLabels,l=a.dataLabelCollections||["dataLabel"];(f.enabled||a._hasPointLabels)&&!f.allowOverlap&&a.visible&&C(l,function(e){C(a.points,function(a){a[e]&&(a[e].labelrank=G(a.labelrank,a.shapeArgs&&a.shapeArgs.height),d.push(a[e]))})})});a.hideOverlappingLabels(d)}f();H(a,"redraw",
f)});D.prototype.hideOverlappingLabels=function(a){var f=a.length,d,h,k,l,e,b,q,z,B,c=function(a,b,c,d,e,f,h,l){return!(e>a+c||e+h<a||f>b+d||f+l<b)};for(h=0;h<f;h++)if(d=a[h])d.oldOpacity=d.opacity,d.newOpacity=1;a.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(h=0;h<f;h++)for(k=a[h],d=h+1;d<f;++d)if(l=a[d],k&&l&&k.placed&&l.placed&&0!==k.newOpacity&&0!==l.newOpacity&&(e=k.alignAttr,b=l.alignAttr,q=k.parentGroup,z=l.parentGroup,B=2*(k.box?0:k.padding),e=c(e.x+q.translateX,e.y+q.translateY,
k.width-B,k.height-B,b.x+z.translateX,b.y+z.translateY,l.width-B,l.height-B)))(k.labelrank<l.labelrank?k:l).newOpacity=0;C(a,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(J);(function(a){var D=a.addEvent,C=a.Chart,G=a.createElement,H=a.css,p=a.defaultOptions,f=a.defaultPlotOptions,d=a.each,h=a.extend,k=a.fireEvent,l=a.hasTouch,e=a.inArray,b=a.isObject,q=
a.Legend,z=a.merge,B=a.pick,c=a.Point,g=a.Series,n=a.seriesTypes,m=a.svg;a=a.TrackerMixin={drawTrackerPoint:function(){var a=this,b=a.chart,c=b.pointer,e=function(a){for(var c=a.target,d;c&&!d;)d=c.point,c=c.parentNode;if(void 0!==d&&d!==b.hoverPoint)d.onMouseOver(a)};d(a.points,function(a){a.graphic&&(a.graphic.element.point=a);a.dataLabel&&(a.dataLabel.element.point=a)});a._hasTracking||(d(a.trackerGroups,function(b){if(a[b]&&(a[b].addClass("highcharts-tracker").on("mouseover",e).on("mouseout",
function(a){c.onTrackerMouseOut(a)}),l))a[b].on("touchstart",e)}),a._hasTracking=!0)},drawTrackerGraph:function(){var a=this,b=a.options.trackByArea,c=[].concat(b?a.areaPath:a.graphPath),e=c.length,f=a.chart,g=f.pointer,h=f.renderer,k=f.options.tooltip.snap,n=a.tracker,p,q=function(){if(f.hoverSeries!==a)a.onMouseOver()},x="rgba(192,192,192,"+(m?1E-4:.002)+")";if(e&&!b)for(p=e+1;p--;)"M"===c[p]&&c.splice(p+1,0,c[p+1]-k,c[p+2],"L"),(p&&"M"===c[p]||p===e)&&c.splice(p,0,"L",c[p-2]+k,c[p-1]);n?n.attr({d:c}):
a.graph&&(a.tracker=h.path(c).attr({"stroke-linejoin":"round",visibility:a.visible?"visible":"hidden",stroke:x,fill:b?x:"none","stroke-width":a.graph.strokeWidth()+(b?0:2*k),zIndex:2}).add(a.group),d([a.tracker,a.markerGroup],function(a){a.addClass("highcharts-tracker").on("mouseover",q).on("mouseout",function(a){g.onTrackerMouseOut(a)});if(l)a.on("touchstart",q)}))}};n.column&&(n.column.prototype.drawTracker=a.drawTrackerPoint);n.pie&&(n.pie.prototype.drawTracker=a.drawTrackerPoint);n.scatter&&(n.scatter.prototype.drawTracker=
a.drawTrackerPoint);h(q.prototype,{setItemEvents:function(a,b,c){var d=this.chart,e="highcharts-legend-"+(a.series?"point":"series")+"-active";(c?b:a.legendGroup).on("mouseover",function(){a.setState("hover");d.seriesGroup.addClass(e)}).on("mouseout",function(){d.seriesGroup.removeClass(e);a.setState()}).on("click",function(b){var c=function(){a.setVisible&&a.setVisible()};b={browserEvent:b};a.firePointEvent?a.firePointEvent("legendItemClick",b,c):k(a,"legendItemClick",b,c)})},createCheckboxForItem:function(a){a.checkbox=
G("input",{type:"checkbox",checked:a.selected,defaultChecked:a.selected},this.options.itemCheckboxStyle,this.chart.container);D(a.checkbox,"click",function(b){k(a.series||a,"checkboxClick",{checked:b.target.checked,item:a},function(){a.select()})})}});h(C.prototype,{showResetZoom:function(){var a=this,b=p.lang,c=a.options.chart.resetZoomButton,d=c.theme,e=d.states,f="chart"===c.relativeTo?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}).addClass("highcharts-reset-zoom").add().align(c.position,!1,f)},zoomOut:function(){var a=this;k(a,"selection",{resetSelection:!0},function(){a.zoom()})},zoom:function(a){var c,e=this.pointer,f=!1,g;!a||a.resetSelection?d(this.axes,function(a){c=a.zoom()}):d(a.xAxis.concat(a.yAxis),function(a){var b=a.axis,d=b.isXAxis;if(e[d?"zoomX":"zoomY"]||e[d?"pinchX":"pinchY"])c=b.zoom(a.min,a.max),b.displayBtn&&(f=!0)});g=this.resetZoomButton;f&&!g?this.showResetZoom():!f&&b(g)&&(this.resetZoomButton=
g.destroy());c&&this.redraw(B(this.options.chart.animation,a&&a.animation,100>this.pointCount))},pan:function(a,b){var c=this,e=c.hoverPoints,f;e&&d(e,function(a){a.setState()});d("xy"===b?[1,0]:[1],function(b){b=c[b?"xAxis":"yAxis"][0];var d=b.horiz,e=a[d?"chartX":"chartY"],d=d?"mouseDownX":"mouseDownY",g=c[d],h=(b.pointRange||0)/2,l=b.getExtremes(),k=b.toValue(g-e,!0)+h,h=b.toValue(g+b.len-e,!0)-h,g=g>e;b.series.length&&(g||k>Math.min(l.dataMin,l.min))&&(!g||h<Math.max(l.dataMax,l.max))&&(b.setExtremes(k,
h,!1,!1,{trigger:"pan"}),f=!0);c[d]=e});f&&c.redraw(!1);H(c.container,{cursor:"move"})}});h(c.prototype,{select:function(a,b){var c=this,f=c.series,g=f.chart;a=B(a,!c.selected);c.firePointEvent(a?"select":"unselect",{accumulate:b},function(){c.selected=c.options.selected=a;f.options.data[e(c,f.data)]=c.options;c.setState(a&&"select");b||d(g.getSelectedPoints(),function(a){a.selected&&a!==c&&(a.selected=a.options.selected=!1,f.options.data[e(a,f.data)]=a.options,a.setState(""),a.firePointEvent("unselect"))})})},
onMouseOver:function(a,b){var c=this.series,d=c.chart,e=d.tooltip,f=d.hoverPoint;if(d.hoverSeries!==c)c.onMouseOver();if(f&&f!==this)f.onMouseOut();this.series&&(this.firePointEvent("mouseOver"),!e||e.shared&&!c.noSharedTooltip||e.refresh(this,a),this.setState("hover"),b||(d.hoverPoint=this))},onMouseOut:function(){var a=this.series.chart,b=a.hoverPoints;this.firePointEvent("mouseOut");b&&-1!==e(this,b)||(this.setState(),a.hoverPoint=null)},importEvents:function(){if(!this.hasImportedEvents){var a=
z(this.series.options.point,this.options).events,b;this.events=a;for(b in a)D(this,b,a[b]);this.hasImportedEvents=!0}},setState:function(a,b){var c=Math.floor(this.plotX),d=this.plotY,e=this.series,g=e.options.states[a]||{},h=f[e.type].marker&&e.options.marker||{},l=!1===h.enabled,k=h.states&&h.states[a]||{},m=!1===k.enabled,n=e.stateMarkerGraphic,p=this.marker||{},q=e.chart,z=e.halo;a=a||"";if(!(a===this.state&&!b||this.selected&&"select"!==a||!1===g.enabled||a&&(m||l&&!1===k.enabled)||a&&p.states&&
p.states[a]&&!1===p.states[a].enabled)){h=k.radius||h.radius+(k.radiusPlus||0);if(this.graphic)this.state&&this.graphic.removeClass("highcharts-point-"+this.state),a&&this.graphic.addClass("highcharts-point-"+a),c=h?{x:c-h,y:d-h,width:2*h,height:2*h}:{},this.graphic.attr(c),n&&n.hide();else{if(a&&k)if(k=p.symbol||e.symbol,n&&n.currentSymbol!==k&&(n=n.destroy()),n)n[b?"animate":"attr"]({x:c-h,y:d-h});else k&&(e.stateMarkerGraphic=n=q.renderer.symbol(k,c-h,d-h,2*h,2*h).add(e.markerGroup),n.currentSymbol=
k);n&&(n[a&&q.isInsidePlot(c,d,q.inverted)?"show":"hide"](),n.element.point=this)}(g=g.halo)&&g.size?(z||(e.halo=z=q.renderer.path().add(q.seriesGroup)),z[b?"animate":"attr"]({d:this.haloPath(g.size)}),z.attr({"class":"highcharts-halo highcharts-color-"+B(this.colorIndex,e.colorIndex)})):z&&z.attr({d:[]});this.state=a}},haloPath:function(a){var b=this.series,c=b.chart,d=b.getPlotBox(),e=c.inverted,f=Math.floor(this.plotX);return c.renderer.symbols.circle(d.translateX+(e?b.yAxis.len-this.plotY:f)-
a,d.translateY+(e?b.xAxis.len-f:this.plotY)-a,2*a,2*a)}});h(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,d=b.hoverPoint;b.hoverSeries=null;if(d)d.onMouseOut();this&&a.events.mouseOut&&k(this,"mouseOut");!c||a.stickyTracking||c.shared&&!this.noSharedTooltip||c.hide();this.setState()},setState:function(a){var b=
this;a=a||"";b.state!==a&&(d([b.group,b.markerGroup],function(c){c&&(b.state&&c.removeClass("highcharts-series-"+b.state),a&&c.addClass("highcharts-series-"+a))}),b.state=a)},setVisible:function(a,b){var c=this,e=c.chart,f=c.legendItem,g,h=e.options.chart.ignoreHiddenSeries,l=c.visible;g=(c.visible=a=c.options.visible=c.userOptions.visible=void 0===a?!l:a)?"show":"hide";d(["group","dataLabelsGroup","markerGroup","tracker"],function(a){if(c[a])c[a][g]()});if(e.hoverSeries===c||(e.hoverPoint&&e.hoverPoint.series)===
c)c.onMouseOut();f&&e.legend.colorizeItem(c,a);c.isDirty=!0;c.options.stacking&&d(e.series,function(a){a.options.stacking&&a.visible&&(a.isDirty=!0)});d(c.linkedSeries,function(b){b.setVisible(a,!1)});h&&(e.isDirtyBox=!0);!1!==b&&e.redraw();k(c,g)},show:function(){this.setVisible(!0)},hide:function(){this.setVisible(!1)},select:function(a){this.selected=a=void 0===a?!this.selected:a;this.checkbox&&(this.checkbox.checked=a);k(this,a?"select":"unselect")},drawTracker:a.drawTrackerGraph})})(J);(function(a){var D=
a.Chart,C=a.each,G=a.inArray,H=a.isObject,p=a.pick,f=a.splat;D.prototype.setResponsive=function(a){var f=this.options.responsive;f&&f.rules&&C(f.rules,function(f){this.matchResponsiveRule(f,a)},this)};D.prototype.matchResponsiveRule=function(d,f){var k=this.respRules,l=d.condition,e;e=d.callback||function(){return this.chartWidth<=p(l.maxWidth,Number.MAX_VALUE)&&this.chartHeight<=p(l.maxHeight,Number.MAX_VALUE)&&this.chartWidth>=p(l.minWidth,0)&&this.chartHeight>=p(l.minHeight,0)};void 0===d._id&&
(d._id=a.idCounter++);e=e.call(this);!k[d._id]&&e?d.chartOptions&&(k[d._id]=this.currentOptions(d.chartOptions),this.update(d.chartOptions,f)):k[d._id]&&!e&&(this.update(k[d._id],f),delete k[d._id])};D.prototype.currentOptions=function(a){function h(a,d,b){var k,p;for(k in a)if(-1<G(k,["series","xAxis","yAxis"]))for(a[k]=f(a[k]),b[k]=[],p=0;p<a[k].length;p++)b[k][p]={},h(a[k][p],d[k][p],b[k][p]);else H(a[k])?(b[k]={},h(a[k],d[k]||{},b[k])):b[k]=d[k]||null}var k={};h(a,this.options,k);return k}})(J);
return J});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,44 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Accessibility module
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(k){"object"===typeof module&&module.exports?module.exports=k:k(Highcharts)})(function(k){(function(e){function k(a){for(var b=a.childNodes.length;b--;)a.appendChild(a.childNodes[b])}function t(a){var b;a&&a.onclick&&(b=m.createEvent("Events"),b.initEvent("click",!0,!1),a.onclick(b))}var w=e.win,m=w.document,h=e.each,y=e.erase,v=e.addEvent,z=e.removeEvent,A=e.fireEvent,B=e.dateFormat,u=e.merge,p={"default":["series","data point","data points"],line:["line","data point","data points"],spline:["line",
"data point","data points"],area:["line","data point","data points"],areaspline:["line","data point","data points"],pie:["pie","slice","slices"],column:["column series","column","columns"],bar:["bar series","bar","bars"],scatter:["scatter series","data point","data points"],boxplot:["boxplot series","box","boxes"],arearange:["arearange series","data point","data points"],areasplinerange:["areasplinerange series","data point","data points"],bubble:["bubble series","bubble","bubbles"],columnrange:["columnrange series",
"column","columns"],errorbar:["errorbar series","errorbar","errorbars"],funnel:["funnel","data point","data points"],pyramid:["pyramid","data point","data points"],waterfall:["waterfall series","column","columns"],map:["map","area","areas"],mapline:["line","data point","data points"],mappoint:["point series","data point","data points"],mapbubble:["bubble series","bubble","bubbles"]},C={boxplot:" Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile and maximum. ",
arearange:" Arearange charts are line charts displaying a range between a lower and higher value for each point. ",areasplinerange:" These charts are line charts displaying a range between a lower and higher value for each point. ",bubble:" Bubble charts are scatter charts where each data point also has a size value. ",columnrange:" Columnrange charts are column charts displaying a range between a lower and higher value for each point. ",errorbar:" Errorbar series are used to display the variability of the data. ",
funnel:" Funnel charts are used to display reduction of data in stages. ",pyramid:" Pyramid charts consist of a single pyramid with item heights corresponding to each point value. ",waterfall:" A waterfall chart is a column chart where each column contributes towards a total end value. "},D="name id category x value y".split(" "),x="z open high q3 median q1 low close".split(" ");e.setOptions({accessibility:{enabled:!0,pointDescriptionThreshold:30,keyboardNavigation:{enabled:!0}}});e.wrap(e.Series.prototype,
"render",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));this.chart.options.accessibility.enabled&&this.setA11yDescription()});e.Series.prototype.setA11yDescription=function(){var a=this.chart.options.accessibility,b=this.points&&this.points[0].graphic&&this.points[0].graphic.element,d=b&&b.parentNode||this.graph&&this.graph.element||this.group&&this.group.element;d&&(d.lastChild===b&&k(d),this.points&&(this.points.length<a.pointDescriptionThreshold||!1===a.pointDescriptionThreshold)&&
h(this.points,function(c){c.graphic&&(c.graphic.element.setAttribute("role","img"),c.graphic.element.setAttribute("tabindex","-1"),c.graphic.element.setAttribute("aria-label",a.pointDescriptionFormatter&&a.pointDescriptionFormatter(c)||c.buildPointInfoString()))}),1<this.chart.series.length||a.describeSingleSeries)&&(d.setAttribute("role","region"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-label",a.seriesDescriptionFormatter&&a.seriesDescriptionFormatter(this)||this.buildSeriesInfoString()))};
e.Series.prototype.buildSeriesInfoString=function(){var a=p[this.type]||p["default"],b=this.description||this.options.description;return(this.name?this.name+", ":"")+(1===this.chart.types.length?a[0]:"series")+" "+(this.index+1)+" of "+this.chart.series.length+(1===this.chart.types.length?" with ":". "+a[0]+" with ")+(this.points.length+" "+(1===this.points.length?a[1]:a[2]))+(b?". "+b:"")+(1<this.chart.yAxis.length&&this.yAxis?". Y axis, "+this.yAxis.getDescription():"")+(1<this.chart.xAxis.length&&
this.xAxis?". X axis, "+this.xAxis.getDescription():"")};e.Point.prototype.buildPointInfoString=function(){var a=this,b=a.series,d=b.chart.options.accessibility,c="",f=!1,g=b.xAxis&&b.xAxis.isDatetimeAxis,b=g&&B(d.pointDateFormatter&&d.pointDateFormatter(a)||d.pointDateFormat||e.Tooltip.prototype.getXDateFormat(a,b.chart.options.tooltip,b.xAxis),a.x);h(x,function(c){void 0!==a[c]&&(f=!0)});f?(g&&(c=b),h(D.concat(x),function(b){void 0===a[b]||g&&"x"===b||(c+=(c?". ":"")+b+", "+this[b])})):c=(this.name||
b||this.category||this.id||"x, "+this.x)+", "+(void 0!==this.value?this.value:this.y);return this.index+1+". "+c+"."+(this.description?" "+this.description:"")};e.Axis.prototype.getDescription=function(){return this.userOptions&&this.userOptions.description||this.axisTitle&&this.axisTitle.textStr||this.options.id||this.categories&&"categories"||"values"};e.Axis.prototype.panStep=function(a,b){var d=b||3,c=this.getExtremes(),f=(c.max-c.min)/d*a,d=c.max+f,f=c.min+f,g=d-f;0>a&&f<c.dataMin?(f=c.dataMin,
d=f+g):0<a&&d>c.dataMax&&(d=c.dataMax,f=d-g);this.setExtremes(f,d)};e.wrap(e.Series.prototype,"init",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));var b=this.chart;b.options.accessibility.enabled&&(b.types=b.types||[],0>b.types.indexOf(this.type)&&b.types.push(this.type),v(this,"remove",function(){var a=this,c=!1;h(b.series,function(f){f!==a&&0>b.types.indexOf(a.type)&&(c=!0)});c||y(b.types,a.type)}))});e.Chart.prototype.getTypeDescription=function(){var a=this.types&&this.types[0],
b=this.series[0]&&this.series[0].mapTitle;if(a){if("map"===a)return b?"Map of "+b:"Map of unspecified region.";if(1<this.types.length)return"Combination chart.";if(-1<["spline","area","areaspline"].indexOf(a))return"Line chart."}else return"Empty chart.";return a+" chart."+(C[a]||"")};e.Chart.prototype.getAxesDescription=function(){var a=this.xAxis.length,b=this.yAxis.length,d={},c;if(a)if(d.xAxis="The chart has "+a+(1<a?" X axes":" X axis")+" displaying ",2>a)d.xAxis+=this.xAxis[0].getDescription()+
".";else{for(c=0;c<a-1;++c)d.xAxis+=(c?", ":"")+this.xAxis[c].getDescription();d.xAxis+=" and "+this.xAxis[c].getDescription()+"."}if(b)if(d.yAxis="The chart has "+b+(1<b?" Y axes":" Y axis")+" displaying ",2>b)d.yAxis+=this.yAxis[0].getDescription()+".";else{for(c=0;c<b-1;++c)d.yAxis+=(c?", ":"")+this.yAxis[c].getDescription();d.yAxis+=" and "+this.yAxis[c].getDescription()+"."}return d};e.Chart.prototype.addAccessibleContextMenuAttribs=function(){var a=this.exportDivElements;a&&(h(a,function(a){"DIV"!==
a.tagName||a.children&&a.children.length||(a.setAttribute("role","menuitem"),a.setAttribute("tabindex",-1))}),a[0].parentNode.setAttribute("role","menu"),a[0].parentNode.setAttribute("aria-label","Chart export"))};e.Point.prototype.highlight=function(){var a=this.series.chart;this.graphic&&this.graphic.element.focus&&this.graphic.element.focus();this.isNull?a.tooltip.hide(0):(this.onMouseOver(),a.tooltip.refresh(a.tooltip.shared?[this]:this));a.highlightedPoint=this;return this};e.Chart.prototype.highlightAdjacentPoint=
function(a){var b=this.series,d=this.highlightedPoint;if(!b[0]||!b[0].points)return!1;if(!d)return b[0].points[0].highlight();b=b[d.series.index+(a?1:-1)];d=a?d.series.points[d.index+1]||b&&b.points[0]:d.series.points[d.index-1]||b&&b.points[b.points.length-1];return void 0===d?!1:d.isNull&&this.options.accessibility.keyboardNavigation&&this.options.accessibility.keyboardNavigation.skipNullPoints?(this.highlightedPoint=d,this.highlightAdjacentPoint(a)):d.highlight()};e.Chart.prototype.showExportMenu=
function(){this.exportSVGElements&&this.exportSVGElements[0]&&(this.exportSVGElements[0].element.onclick(),this.highlightExportItem(0))};e.Chart.prototype.highlightExportItem=function(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItem];if(b&&"DIV"===b.tagName&&(!b.children||!b.children.length)){b.focus&&b.focus();if(d&&d.onmouseout)d.onmouseout();if(b.onmouseover)b.onmouseover();this.highlightedExportItem=a;return!0}};
e.Chart.prototype.highlightRangeSelectorButton=function(a){var b=this.rangeSelector.buttons;b[this.highlightedRangeSelectorItemIx]&&b[this.highlightedRangeSelectorItemIx].setState(this.oldRangeSelectorItemState||0);this.highlightedRangeSelectorItemIx=a;return b[a]?(b[a].element.focus&&b[a].element.focus(),this.oldRangeSelectorItemState=b[a].state,b[a].setState(2),!0):!1};e.Chart.prototype.hideExportMenu=function(){var a=this.exportDivElements;if(a){h(a,function(a){A(a,"mouseleave")});if(a[this.highlightedExportItem]&&
a[this.highlightedExportItem].onmouseout)a[this.highlightedExportItem].onmouseout();this.highlightedExportItem=0;this.renderTo.focus()}};e.Chart.prototype.addKeyboardNavEvents=function(){function a(c){this.keyCodeMap=c.keyCodeMap;this.move=c.move;this.validate=c.validate;this.init=c.init;this.transformTabs=!1!==c.transformTabs}function b(b,g){return new a(u({keyCodeMap:b,move:function(a){c.keyboardNavigationModuleIndex+=a;var b=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];if(b){if(b.validate&&
!b.validate())return this.move(a);if(b.init)return b.init(a),!0}c.keyboardNavigationModuleIndex=0;c.slipNextTab=!0;return!1}},g))}function d(a){a=a||w.event;var b=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];9===(a.which||a.keyCode)&&c.slipNextTab?c.slipNextTab=!1:(c.slipNextTab=!1,b&&b.run(a)&&a.preventDefault())}var c=this;a.prototype={run:function(c){var a=this,b=c.which||c.keyCode,d=!1,b=this.transformTabs&&9===b?c.shiftKey?37:39:b;h(this.keyCodeMap,function(e){-1<e[0].indexOf(b)&&
(d=!1===e[1].call(a,b,c)?!1:!0)});return d}};c.keyboardNavigationModules=[b([[[37,39],function(a){if(!c.highlightAdjacentPoint(39===a))return this.move(39===a?1:-1)}],[[38,40],function(a){var b;if(c.highlightedPoint)if((b=c.series[c.highlightedPoint.series.index+(38===a?-1:1)])&&b.points[0])b.points[0].highlight();else return this.move(40===a?1:-1)}],[[13,32],function(){c.highlightedPoint&&c.highlightedPoint.firePointEvent("click")}]],{init:function(a){var b=c.series&&c.series[c.series.length-1],
b=b&&b.points&&b.points[b.points.length-1];0>a&&b&&b.highlight()}}),b([[[37,38],function(){for(var a=c.highlightedExportItem||0,b=!0,d=c.series;a--;)if(c.highlightExportItem(a)){b=!1;break}if(b)return c.hideExportMenu(),d&&d.length&&(a=d[d.length-1],a.points.length&&a.points[a.points.length-1].highlight()),this.move(-1)}],[[39,40],function(){for(var a=!0,b=(c.highlightedExportItem||0)+1;b<c.exportDivElements.length;++b)if(c.highlightExportItem(b)){a=!1;break}if(a)return c.hideExportMenu(),this.move(1)}],
[[13,32],function(){t(c.exportDivElements[c.highlightedExportItem])}]],{validate:function(){return c.exportChart&&!(c.options.exporting&&!1===c.options.exporting.enabled)},init:function(a){c.highlightedPoint=null;c.showExportMenu();if(0>a&&c.exportDivElements)for(a=c.exportDivElements.length;-1<a&&!c.highlightExportItem(a);--a);}}),b([[[38,40,37,39],function(a){c[38===a||40===a?"yAxis":"xAxis"][0].panStep(39>a?-1:1)}],[[9],function(a,b){var d;c.mapNavButtons[c.focusedMapNavButtonIx].setState(0);if(b.shiftKey&&
!c.focusedMapNavButtonIx||!b.shiftKey&&c.focusedMapNavButtonIx)return c.mapZoom(),this.move(b.shiftKey?-1:1);c.focusedMapNavButtonIx+=b.shiftKey?-1:1;d=c.mapNavButtons[c.focusedMapNavButtonIx];d.element.focus&&d.element.focus();d.setState(2)}],[[13,32],function(){t(c.mapNavButtons[c.focusedMapNavButtonIx].element)}]],{validate:function(){return c.mapZoom&&c.mapNavButtons&&2===c.mapNavButtons.length},transformTabs:!1,init:function(a){var b=c.mapNavButtons[0],d=c.mapNavButtons[1],b=0<a?b:d;h(c.mapNavButtons,
function(a,c){a.element.setAttribute("tabindex",-1);a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Zoom "+(c?"out":"")+"chart")});b.element.focus&&b.element.focus();b.setState(2);c.focusedMapNavButtonIx=0<a?0:1}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightRangeSelectorButton(c.highlightedRangeSelectorItemIx+a))return this.move(a)}],[[13,32],function(){3!==c.oldRangeSelectorItemState&&t(c.rangeSelector.buttons[c.highlightedRangeSelectorItemIx].element)}]],
{validate:function(){return c.rangeSelector&&c.rangeSelector.buttons&&c.rangeSelector.buttons.length},init:function(a){h(c.rangeSelector.buttons,function(a){a.element.setAttribute("tabindex","-1");a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Select range "+(a.text&&a.text.textStr))});c.highlightRangeSelectorButton(0<a?0:c.rangeSelector.buttons.length-1)}}),b([[[9,38,40],function(a,b){var d=9===a&&b.shiftKey||38===a?-1:1,e=c.highlightedInputRangeIx+=d;if(1<e||0>e)return this.move(d);
c.rangeSelector[e?"maxInput":"minInput"].focus()}]],{validate:function(){return c.rangeSelector&&!1!==c.options.rangeSelector.inputEnabled&&c.rangeSelector.minInput&&c.rangeSelector.maxInput},transformTabs:!1,init:function(a){h(["minInput","maxInput"],function(a,b){c.rangeSelector[a]&&(c.rangeSelector[a].setAttribute("tabindex","-1"),c.rangeSelector[a].setAttribute("role","textbox"),c.rangeSelector[a].setAttribute("aria-label","Select "+(b?"end":"start")+" date."))});c.highlightedInputRangeIx=0<a?
0:1;c.rangeSelector[c.highlightedInputRangeIx?"maxInput":"minInput"].focus()}})];c.keyboardNavigationModuleIndex=0;c.renderTo.tabIndex||c.renderTo.setAttribute("tabindex","0");v(c.renderTo,"keydown",d);v(c,"destroy",function(){z(c.renderTo,"keydown",d)})};e.Chart.prototype.addScreenReaderRegion=function(a){var b=this,d=b.series,c=b.options,e=c.accessibility,g=b.screenReaderRegion=m.createElement("div"),h=m.createElement("h3"),q=m.createElement("a"),r=m.createElement("h3"),k={position:"absolute",left:"-9999px",
top:"auto",width:"1px",height:"1px",overflow:"hidden"},l=b.types||[],l=(1===l.length&&"pie"===l[0]||"map"===l[0])&&{}||b.getAxesDescription(),n=d[0]&&p[d[0].type]||p["default"];g.setAttribute("role","region");g.setAttribute("aria-label","Chart screen reader information.");g.innerHTML=e.screenReaderSectionFormatter&&e.screenReaderSectionFormatter(b)||'<div tabindex="0">Use regions/landmarks to skip ahead to chart'+(1<d.length?" and navigate between data series":"")+".</div><h3>Summary.</h3><div>"+
(c.title.text||"Chart")+(c.subtitle&&c.subtitle.text?". "+c.subtitle.text:"")+"</div><h3>Long description.</h3><div>"+(c.chart.description||"No description available.")+"</div><h3>Structure.</h3><div>Chart type: "+(c.chart.typeDescription||b.getTypeDescription())+"</div>"+(1===d.length?"<div>"+n[0]+" with "+d[0].points.length+" "+(1===d[0].points.length?n[1]:n[2])+".</div>":"")+(l.xAxis?"<div>"+l.xAxis+"</div>":"")+(l.yAxis?"<div>"+l.yAxis+"</div>":"");b.getCSV&&(q.innerHTML="View as data table.",
q.href="#"+a,q.setAttribute("tabindex","-1"),q.onclick=e.onTableAnchorClick||function(){b.viewData();m.getElementById(a).focus()},h.appendChild(q),g.appendChild(h));r.innerHTML="Chart graphic.";b.renderTo.insertBefore(r,b.renderTo.firstChild);b.renderTo.insertBefore(g,b.renderTo.firstChild);u(!0,r.style,k);u(!0,g.style,k)};e.Chart.prototype.callbacks.push(function(a){var b=a.options,d=b.accessibility;if(d.enabled){var c=m.createElementNS("http://www.w3.org/2000/svg","title"),f=m.createElementNS("http://www.w3.org/2000/svg",
"g"),g=a.container.getElementsByTagName("desc")[0],k=a.container.getElementsByTagName("text"),q="highcharts-title-"+a.index,r="highcharts-data-table-"+a.index,p=b.title.text||"Chart",l=b.exporting&&b.exporting.csv&&b.exporting.csv.columnHeaderFormatter,n=[];c.textContent=p;c.id=q;g.parentNode.insertBefore(c,g);a.renderTo.setAttribute("role","region");a.renderTo.setAttribute("aria-label",p+". Use up and down arrows to navigate.");if(a.exportSVGElements&&a.exportSVGElements[0]&&a.exportSVGElements[0].element){var t=
a.exportSVGElements[0].element.onclick,c=a.exportSVGElements[0].element.parentNode;a.exportSVGElements[0].element.onclick=function(){t.apply(this,Array.prototype.slice.call(arguments));a.addAccessibleContextMenuAttribs();a.highlightExportItem(0)};a.exportSVGElements[0].element.setAttribute("role","button");a.exportSVGElements[0].element.setAttribute("aria-label","View export menu");f.appendChild(a.exportSVGElements[0].element);f.setAttribute("role","region");f.setAttribute("aria-label","Chart export menu");
c.appendChild(f)}h(k,function(a){a.setAttribute("aria-hidden","true")});a.addScreenReaderRegion(r);d.keyboardNavigation&&a.addKeyboardNavEvents();u(!0,b.exporting,{csv:{columnHeaderFormatter:function(a,c,b){var d=n[n.length-1];1<b&&(d&&d.text)!==a.name&&n.push({text:a.name,span:b});return l?l.call(this,a,c,b):1<b?c:a.name}}});e.wrap(a,"getTable",function(a){return a.apply(this,Array.prototype.slice.call(arguments,1)).replace("<table>",'<table id="'+r+'" summary="Table representation of chart"><caption>'+
p+"</caption>")});e.wrap(a,"viewData",function(a){if(!this.insertedTable){a.apply(this,Array.prototype.slice.call(arguments,1));var c=m.getElementById(r),b=c.getElementsByTagName("tbody")[0],d=b.firstChild.children,e="<tr><td></td>",f,g;c.setAttribute("tabindex","-1");h(b.children,function(a){f=a.firstChild;g=m.createElement("th");g.setAttribute("scope","row");g.innerHTML=f.innerHTML;f.parentNode.replaceChild(g,f)});h(d,function(a){"TH"===a.tagName&&a.setAttribute("scope","col")});n.length&&(h(n,
function(a){e+='<th scope="col" colspan="'+a.span+'">'+a.text+"</th>"}),b.insertAdjacentHTML("afterbegin",e))}})}})})(k)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(h){var q=h.defined,k=h.isNumber,p=h.inArray,v=h.isArray,w=h.merge,C=h.Chart,x=h.extend,D=h.each,r,E;E=["path","rect","circle"];r={top:0,left:0,center:.5,middle:.5,bottom:1,right:1};var F=function(){this.init.apply(this,arguments)};F.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b,f;f={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",
fill:"transparent",strokeWidth:2}}};b={circle:{params:{x:0,y:0}}};b[c]&&(f.shape=w(f.shape,b[c]));this.options=w({},f,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,l=this.options,h=l.title,k=l.shape;b||(b=this.group=c.g());!e&&k&&-1!==p(k.type,E)&&(e=this.shape=c[l.shape.type](k.params),e.add(b));!f&&h&&(f=this.title=c.label(h),f.add(b));b.add(d.annotations.group);this.linkObjects();!1!==a&&this.redraw()},redraw:function(){var a=this.options,
d=this.chart,c=this.group,b=this.title,f=this.shape,e=this.linkedObject,l=d.xAxis[a.xAxis],d=d.yAxis[a.yAxis],y=a.width,z=a.height,A=r[a.anchorY],B=r[a.anchorX],t,m,g,u;e&&(t=e instanceof h.Point?"point":e instanceof h.Series?"series":null,"point"===t?(a.xValue=e.x,a.yValue=e.y,m=e.series):"series"===t&&(m=e),c.visibility!==m.group.visibility&&c.attr({visibility:m.group.visibility}));e=q(a.xValue)?l.toPixels(a.xValue+l.minPointOffset)-l.minPixelPadding:a.x;m=q(a.yValue)?d.toPixels(a.yValue):a.y;if(k(e)&&
k(m)){b&&(b.attr(a.title),b.css(a.title.style));if(f){b=x({},a.shape.params);if("values"===a.units){for(g in b)-1<p(g,["width","x"])?b[g]=l.translate(b[g]):-1<p(g,["height","y"])&&(b[g]=d.translate(b[g]));b.width&&(b.width-=l.toPixels(0)-l.left);b.x&&(b.x+=l.minPixelPadding);if("path"===a.shape.type){g=b.d;t=e;for(var v=m,w=g.length,n=0;n<w;)k(g[n])&&k(g[n+1])?(g[n]=l.toPixels(g[n])-t,g[n+1]=d.toPixels(g[n+1])-v,n+=2):n+=1}}"circle"===a.shape.type&&(b.x+=b.r,b.y+=b.r);f.attr(b)}c.bBox=null;k(y)||
(u=c.getBBox(),y=u.width);k(z)||(u||(u=c.getBBox()),z=u.height);k(B)||(B=r.center);k(A)||(A=r.center);e-=y*B;m-=z*A;q(c.translateX)&&q(c.translateY)?c.animate({translateX:e,translateY:m}):c.translate(e,m)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);-1<c&&d.splice(c,1);D(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){x(this.options,a);this.linkObjects();this.render(d)},
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;q(b)?q(d)&&b===c||(this.linkedObject=a.get(b)):this.linkedObject=null}};x(C.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;v(a)||(a=[a]);for(e=a.length;e--;)f=new F(b,a[e]),c.push(f),f.render(d)},redraw:function(){D(this.allItems,function(a){a.redraw()})}}});C.prototype.callbacks.push(function(a){var d=a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});
c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;v(d)&&0<d.length&&a.annotations.add(a.options.annotations);h.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(p)});

View File

@@ -0,0 +1,408 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
isNumber = H.isNumber,
inArray = H.inArray,
isArray = H.isArray,
merge = H.merge,
Chart = H.Chart,
extend = H.extend,
each = H.each;
var ALIGN_FACTOR,
ALLOWED_SHAPES;
ALLOWED_SHAPES = ['path', 'rect', 'circle'];
ALIGN_FACTOR = {
top: 0,
left: 0,
center: 0.5,
middle: 0.5,
bottom: 1,
right: 1
};
function defaultOptions(shapeType) {
var shapeOptions,
options;
options = {
xAxis: 0,
yAxis: 0,
title: {
style: {},
text: '',
x: 0,
y: 0
},
shape: {
params: {
stroke: '#000000',
fill: 'transparent',
strokeWidth: 2
}
}
};
shapeOptions = {
circle: {
params: {
x: 0,
y: 0
}
}
};
if (shapeOptions[shapeType]) {
options.shape = merge(options.shape, shapeOptions[shapeType]);
}
return options;
}
function translatePath(d, xAxis, yAxis, xOffset, yOffset) {
var len = d.length,
i = 0;
while (i < len) {
if (isNumber(d[i]) && isNumber(d[i + 1])) {
d[i] = xAxis.toPixels(d[i]) - xOffset;
d[i + 1] = yAxis.toPixels(d[i + 1]) - yOffset;
i += 2;
} else {
i += 1;
}
}
return d;
}
// Define annotation prototype
var Annotation = function() {
this.init.apply(this, arguments);
};
Annotation.prototype = {
/*
* Initialize the annotation
*/
init: function(chart, options) {
var shapeType = options.shape && options.shape.type;
this.chart = chart;
this.options = merge({}, defaultOptions(shapeType), options);
},
/*
* Render the annotation
*/
render: function(redraw) {
var annotation = this,
chart = this.chart,
renderer = annotation.chart.renderer,
group = annotation.group,
title = annotation.title,
shape = annotation.shape,
options = annotation.options,
titleOptions = options.title,
shapeOptions = options.shape;
if (!group) {
group = annotation.group = renderer.g();
}
if (!shape && shapeOptions && inArray(shapeOptions.type, ALLOWED_SHAPES) !== -1) {
shape = annotation.shape = renderer[options.shape.type](shapeOptions.params);
shape.add(group);
}
if (!title && titleOptions) {
title = annotation.title = renderer.label(titleOptions);
title.add(group);
}
group.add(chart.annotations.group);
// link annotations to point or series
annotation.linkObjects();
if (redraw !== false) {
annotation.redraw();
}
},
/*
* Redraw the annotation title or shape after options update
*/
redraw: function() {
var options = this.options,
chart = this.chart,
group = this.group,
title = this.title,
shape = this.shape,
linkedTo = this.linkedObject,
xAxis = chart.xAxis[options.xAxis],
yAxis = chart.yAxis[options.yAxis],
width = options.width,
height = options.height,
anchorY = ALIGN_FACTOR[options.anchorY],
anchorX = ALIGN_FACTOR[options.anchorX],
shapeParams,
linkType,
series,
param,
bbox,
x,
y;
if (linkedTo) {
linkType = (linkedTo instanceof H.Point) ? 'point' :
(linkedTo instanceof H.Series) ? 'series' : null;
if (linkType === 'point') {
options.xValue = linkedTo.x;
options.yValue = linkedTo.y;
series = linkedTo.series;
} else if (linkType === 'series') {
series = linkedTo;
}
if (group.visibility !== series.group.visibility) {
group.attr({
visibility: series.group.visibility
});
}
}
// Based on given options find annotation pixel position
x = (defined(options.xValue) ? xAxis.toPixels(options.xValue + xAxis.minPointOffset) - xAxis.minPixelPadding : options.x);
y = defined(options.yValue) ? yAxis.toPixels(options.yValue) : options.y;
if (!isNumber(x) || !isNumber(y)) {
return;
}
if (title) {
title.attr(options.title);
title.css(options.title.style);
}
if (shape) {
shapeParams = extend({}, options.shape.params);
if (options.units === 'values') {
for (param in shapeParams) {
if (inArray(param, ['width', 'x']) > -1) {
shapeParams[param] = xAxis.translate(shapeParams[param]);
} else if (inArray(param, ['height', 'y']) > -1) {
shapeParams[param] = yAxis.translate(shapeParams[param]);
}
}
if (shapeParams.width) {
shapeParams.width -= xAxis.toPixels(0) - xAxis.left;
}
if (shapeParams.x) {
shapeParams.x += xAxis.minPixelPadding;
}
if (options.shape.type === 'path') {
translatePath(shapeParams.d, xAxis, yAxis, x, y);
}
}
// move the center of the circle to shape x/y
if (options.shape.type === 'circle') {
shapeParams.x += shapeParams.r;
shapeParams.y += shapeParams.r;
}
shape.attr(shapeParams);
}
group.bBox = null;
// If annotation width or height is not defined in options use bounding box size
if (!isNumber(width)) {
bbox = group.getBBox();
width = bbox.width;
}
if (!isNumber(height)) {
// get bbox only if it wasn't set before
if (!bbox) {
bbox = group.getBBox();
}
height = bbox.height;
}
// Calculate anchor point
if (!isNumber(anchorX)) {
anchorX = ALIGN_FACTOR.center;
}
if (!isNumber(anchorY)) {
anchorY = ALIGN_FACTOR.center;
}
// Translate group according to its dimension and anchor point
x = x - width * anchorX;
y = y - height * anchorY;
if (defined(group.translateX) && defined(group.translateY)) {
group.animate({
translateX: x,
translateY: y
});
} else {
group.translate(x, y);
}
},
/*
* Destroy the annotation
*/
destroy: function() {
var annotation = this,
chart = this.chart,
allItems = chart.annotations.allItems,
index = allItems.indexOf(annotation);
if (index > -1) {
allItems.splice(index, 1);
}
each(['title', 'shape', 'group'], function(element) {
if (annotation[element]) {
annotation[element].destroy();
annotation[element] = null;
}
});
annotation.group = annotation.title = annotation.shape = annotation.chart = annotation.options = null;
},
/*
* Update the annotation with a given options
*/
update: function(options, redraw) {
extend(this.options, options);
// update link to point or series
this.linkObjects();
this.render(redraw);
},
linkObjects: function() {
var annotation = this,
chart = annotation.chart,
linkedTo = annotation.linkedObject,
linkedId = linkedTo && (linkedTo.id || linkedTo.options.id),
options = annotation.options,
id = options.linkedTo;
if (!defined(id)) {
annotation.linkedObject = null;
} else if (!defined(linkedTo) || id !== linkedId) {
annotation.linkedObject = chart.get(id);
}
}
};
// Add annotations methods to chart prototype
extend(Chart.prototype, {
annotations: {
/*
* Unified method for adding annotations to the chart
*/
add: function(options, redraw) {
var annotations = this.allItems,
chart = this.chart,
item,
len;
if (!isArray(options)) {
options = [options];
}
len = options.length;
while (len--) {
item = new Annotation(chart, options[len]);
annotations.push(item);
item.render(redraw);
}
},
/**
* Redraw all annotations, method used in chart events
*/
redraw: function() {
each(this.allItems, function(annotation) {
annotation.redraw();
});
}
}
});
// Initialize on chart load
Chart.prototype.callbacks.push(function(chart) {
var options = chart.options.annotations,
group;
group = chart.renderer.g('annotations');
group.attr({
zIndex: 7
});
group.add();
// initialize empty array for annotations
chart.annotations.allItems = [];
// link chart object to annotations
chart.annotations.chart = chart;
// link annotations group element to the chart
chart.annotations.group = group;
if (isArray(options) && options.length > 0) {
chart.annotations.add(chart.options.annotations);
}
// update annotations after chart redraw
H.addEvent(chart, 'redraw', function() {
chart.annotations.redraw();
});
});
}(Highcharts));
}));

View File

@@ -0,0 +1,22 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Boost module
(c) 2010-2016 Highsoft AS
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){function n(a,b,c,e,h){h=h||0;e=e||5E4;for(var k=h+e,f=!0;f&&h<k&&h<a.length;)f=b(a[h],h),h+=1;f&&(h<a.length?setTimeout(function(){n(a,b,c,e,h)}):c&&c())}var x=f.win.document,U=function(){},V=f.Color,p=f.Series,d=f.seriesTypes,q=f.each,y=f.extend,W=f.addEvent,X=f.fireEvent,z=f.grep,u=f.isNumber,Y=f.merge,Z=f.pick,l=f.wrap,v=f.getOptions().plotOptions,F;q(["area","arearange","column","line",
"scatter"],function(a){v[a]&&(v[a].boostThreshold=5E3)});q(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function b(b){var e=this.options.stacking&&("translate"===a||"generatePoints"===a);if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||e)"render"===a&&this.image&&(this.image.attr({href:""}),this.animate=null),b.call(this);else if(this[a+"Canvas"])this[a+"Canvas"]()}l(p.prototype,a,b);"translate"===a&&(d.column&&l(d.column.prototype,
a,b),d.arearange&&l(d.arearange.prototype,a,b))});l(p.prototype,"getExtremes",function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});l(p.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});l(p.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});f.extend(p.prototype,{pointRange:0,allowDG:!1,hasExtremes:function(a){var b=this.options,c=this.xAxis&&
this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||Number.MAX_VALUE)&&u(e.min)&&u(e.max)&&(!a||u(c.min)&&u(c.max))},destroyGraphics:function(){var a=this,b=this.points,c,e;if(b)for(e=0;e<b.length;e+=1)(c=b[e])&&c.graphic&&(c.graphic=c.graphic.destroy());q(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,c=a.plotHeight,e=this.ctx,h=function(a,b,c,e,h,f,d){a.call(this,c,b,e,h,f,d)};this.canvas?
e.clearRect(0,0,b,c):(this.canvas=x.createElement("canvas"),this.image=a.renderer.image("",0,0,b,c).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&q(["moveTo","lineTo","rect","arc"],function(a){l(e,a,h)}));this.canvas.width=b;this.canvas.height=c;this.image.attr({width:b,height:c});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,c){a.lineTo(b,c)},renderCanvas:function(){var a=this,b=a.options,c=a.chart,e=this.xAxis,
h=this.yAxis,k,d=0,l=a.processedXData,p=a.processedYData,q=b.data,m=e.getExtremes(),v=m.min,x=m.max,m=h.getExtremes(),z=m.min,aa=m.max,G={},A,ba=!!a.sampling,H,I=b.marker&&b.marker.radius,J=this.cvsDrawPoint,B=b.lineWidth?this.cvsLineTo:!1,K=1>=I?this.cvsMarkerSquare:this.cvsMarkerCircle,ca=!1!==b.enableMouseTracking,L,m=b.threshold,r=h.getThreshold(m),M=u(m),N=r,da=this.fill,O=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),P=!!b.stacking,ea=a.cropStart||0,m=c.options.loading,fa=a.requireSorting,
Q,ga=b.connectNulls,R=!l,C,D,t,w,ha=a.fillOpacity?(new V(a.color)).setOpacity(Z(b.fillOpacity,.75)).get():a.color,S=function(){da?(k.fillStyle=ha,k.fill()):(k.strokeStyle=a.color,k.lineWidth=b.lineWidth,k.stroke())},T=function(a,b,c){0===d&&(k.beginPath(),B&&(k.lineJoin="round"));Q?k.moveTo(a,b):J?J(k,a,b,c,L):B?B(k,a,b):K&&K(k,a,b,I);d+=1;1E3===d&&(S(),d=0);L={clientX:a,plotY:b,yBottom:c}},E=function(a,b,f){ca&&!G[a+","+b]&&(G[a+","+b]=!0,c.inverted&&(a=e.len-a,b=h.len-b),H.push({clientX:a,plotX:a,
plotY:b,i:ea+f}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,c.seriesGroup);a.markerGroup=a.group;W(a,"destroy",function(){a.markerGroup=null});H=this.points=[];k=this.getContext();a.buildKDTree=U;99999<q.length&&(c.options.loading=Y(m,{labelStyle:{backgroundColor:f.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),clearTimeout(F),c.showLoading("Drawing..."),
c.options.loading=m);n(P?a.data:l||q,function(b,f){var d,g,k,l,m="undefined"===typeof c.index,n=!0;if(!m){R?(d=b[0],g=b[1]):(d=b,g=p[f]);O?(R&&(g=b.slice(1,3)),l=g[0],g=g[1]):P&&(d=b.x,g=b.stackY,l=g-b.y);k=null===g;fa||(n=g>=z&&g<=aa);if(!k&&d>=v&&d<=x&&n)if(d=Math.round(e.toPixels(d,!0)),ba){if(void 0===t||d===A){O||(l=g);if(void 0===w||g>D)D=g,w=f;if(void 0===t||l<C)C=l,t=f}d!==A&&(void 0!==t&&(g=h.toPixels(D,!0),r=h.toPixels(C,!0),T(d,M?Math.min(g,N):g,M?Math.max(r,N):r),E(d,g,w),r!==g&&E(d,r,
t)),t=w=void 0,A=d)}else g=Math.round(h.toPixels(g,!0)),T(d,g,r),E(d,g,f);Q=k&&!ga;0===f%5E4&&a.canvasToSVG()}return!m},function(){var b=c.loadingDiv,e=c.loadingShown;S();a.canvasToSVG();X(a,"renderedCanvas");e&&(y(b.style,{transition:"opacity 250ms",opacity:0}),c.loadingShown=!1,F=setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);c.loadingDiv=c.loadingSpan=null},250));a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},c.renderer.forExport?Number.MAX_VALUE:
void 0)}});d.scatter.prototype.cvsMarkerCircle=function(a,b,c,e){a.moveTo(b,c);a.arc(b,c,e,0,2*Math.PI,!1)};d.scatter.prototype.cvsMarkerSquare=function(a,b,c,e){a.rect(b-e,c-e,2*e,2*e)};d.scatter.prototype.fill=!0;y(d.area.prototype,{cvsDrawPoint:function(a,b,c,e,d){d&&b!==d.clientX&&(a.moveTo(d.clientX,d.yBottom),a.lineTo(d.clientX,d.plotY),a.lineTo(b,c),a.lineTo(b,e))},fill:!0,fillOpacity:!0,sampling:!0});y(d.column.prototype,{cvsDrawPoint:function(a,b,c,e){a.rect(b-1,c,1,e-c)},fill:!0,sampling:!0});
p.prototype.getPoint=function(a){var b=a;!a||a instanceof this.pointClass||(b=(new this.pointClass).init(this,this.options.data[a.i]),b.category=b.x,b.dist=a.dist,b.distX=a.distX,b.plotX=a.plotX,b.plotY=a.plotY);return b};l(p.prototype,"destroy",function(a){var b=this,c=b.chart;c.hoverPoints&&(c.hoverPoints=z(c.hoverPoints,function(a){return a.series===b}));c.hoverPoint&&c.hoverPoint.series===b&&(c.hoverPoint=null);a.call(this)});l(p.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,
[].slice.call(arguments,1)))})})(n)});

View File

@@ -0,0 +1,636 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Boost module
*
* (c) 2010-2016 Highsoft AS
* Author: Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* License: www.highcharts.com/license
* Author: Torstein Honsi
*
* This is an experimental Highcharts module that draws long data series on a canvas
* in order to increase performance of the initial load time and tooltip responsiveness.
*
* Compatible with HTML5 canvas compatible browsers (not IE < 9).
*
*
*
* Development plan
* - Column range.
* - Heatmap.
* - Treemap.
* - Check how it works with Highstock and data grouping. Currently it only works when navigator.adaptToUpdatedData
* is false. It is also recommended to set scrollbar.liveRedraw to false.
* - Check inverted charts.
* - Check reversed axes.
* - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
that with initial series animation).
* - Cache full-size image so we don't have to redraw on hide/show and zoom up. But k-d-tree still
* needs to be built.
* - Test IE9 and IE10.
* - Stacking is not perhaps not correct since it doesn't use the translation given in
* the translate method. If this gets to complicated, a possible way out would be to
* have a simplified renderCanvas method that simply draws the areaPath on a canvas.
*
* If this module is taken in as part of the core
* - All the loading logic should be merged with core. Update styles in the core.
* - Most of the method wraps should probably be added directly in parent methods.
*
* Notes for boost mode
* - Area lines are not drawn
* - Point markers are not drawn on line-type series
* - Lines are not drawn on scatter charts
* - Zones and negativeColor don't work
* - Columns are always one pixel wide. Don't set the threshold too low.
*
* Optimizing tips for users
* - For scatter plots, use a marker.radius of 1 or less. It results in a rectangle being drawn, which is
* considerably faster than a circle.
* - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
* - Set enableMouseTracking to false on the series to improve total rendering time.
* - The default threshold is set based on one series. If you have multiple, dense series, the combined
* number of points drawn gets higher, and you may want to set the threshold lower in order to
* use optimizations.
*/
'use strict';
var win = H.win,
doc = win.document,
noop = function() {},
Color = H.Color,
Series = H.Series,
seriesTypes = H.seriesTypes,
each = H.each,
extend = H.extend,
addEvent = H.addEvent,
fireEvent = H.fireEvent,
grep = H.grep,
isNumber = H.isNumber,
merge = H.merge,
pick = H.pick,
wrap = H.wrap,
plotOptions = H.getOptions().plotOptions,
CHUNK_SIZE = 50000,
destroyLoadingDiv;
function eachAsync(arr, fn, finalFunc, chunkSize, i) {
i = i || 0;
chunkSize = chunkSize || CHUNK_SIZE;
var threshold = i + chunkSize,
proceed = true;
while (proceed && i < threshold && i < arr.length) {
proceed = fn(arr[i], i);
i = i + 1;
}
if (proceed) {
if (i < arr.length) {
setTimeout(function() {
eachAsync(arr, fn, finalFunc, chunkSize, i);
});
} else if (finalFunc) {
finalFunc();
}
}
}
// Set default options
each(['area', 'arearange', 'column', 'line', 'scatter'], function(type) {
if (plotOptions[type]) {
plotOptions[type].boostThreshold = 5000;
}
});
/**
* Override a bunch of methods the same way. If the number of points is below the threshold,
* run the original method. If not, check for a canvas version or do nothing.
*/
each(['translate', 'generatePoints', 'drawTracker', 'drawPoints', 'render'], function(method) {
function branch(proceed) {
var letItPass = this.options.stacking && (method === 'translate' || method === 'generatePoints');
if ((this.processedXData || this.options.data).length < (this.options.boostThreshold || Number.MAX_VALUE) ||
letItPass) {
// Clear image
if (method === 'render' && this.image) {
this.image.attr({
href: ''
});
this.animate = null; // We're zooming in, don't run animation
}
proceed.call(this);
// If a canvas version of the method exists, like renderCanvas(), run
} else if (this[method + 'Canvas']) {
this[method + 'Canvas']();
}
}
wrap(Series.prototype, method, branch);
// A special case for some types - its translate method is already wrapped
if (method === 'translate') {
if (seriesTypes.column) {
wrap(seriesTypes.column.prototype, method, branch);
}
if (seriesTypes.arearange) {
wrap(seriesTypes.arearange.prototype, method, branch);
}
}
});
/**
* Do not compute extremes when min and max are set.
* If we use this in the core, we can add the hook to hasExtremes to the methods directly.
*/
wrap(Series.prototype, 'getExtremes', function(proceed) {
if (!this.hasExtremes()) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'setData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'processData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
H.extend(Series.prototype, {
pointRange: 0,
allowDG: false, // No data grouping, let boost handle large data
hasExtremes: function(checkX) {
var options = this.options,
data = options.data,
xAxis = this.xAxis && this.xAxis.options,
yAxis = this.yAxis && this.yAxis.options;
return data.length > (options.boostThreshold || Number.MAX_VALUE) && isNumber(yAxis.min) && isNumber(yAxis.max) &&
(!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
},
/**
* If implemented in the core, parts of this can probably be shared with other similar
* methods in Highcharts.
*/
destroyGraphics: function() {
var series = this,
points = this.points,
point,
i;
if (points) {
for (i = 0; i < points.length; i = i + 1) {
point = points[i];
if (point && point.graphic) {
point.graphic = point.graphic.destroy();
}
}
}
each(['graph', 'area', 'tracker'], function(prop) {
if (series[prop]) {
series[prop] = series[prop].destroy();
}
});
},
/**
* Create a hidden canvas to draw the graph on. The contents is later copied over
* to an SVG image element.
*/
getContext: function() {
var chart = this.chart,
width = chart.plotWidth,
height = chart.plotHeight,
ctx = this.ctx,
swapXY = function(proceed, x, y, a, b, c, d) {
proceed.call(this, y, x, a, b, c, d);
};
if (!this.canvas) {
this.canvas = doc.createElement('canvas');
this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
this.ctx = ctx = this.canvas.getContext('2d');
if (chart.inverted) {
each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
wrap(ctx, fn, swapXY);
});
}
} else {
ctx.clearRect(0, 0, width, height);
}
this.canvas.width = width;
this.canvas.height = height;
this.image.attr({
width: width,
height: height
});
return ctx;
},
/**
* Draw the canvas image inside an SVG image
*/
canvasToSVG: function() {
this.image.attr({
href: this.canvas.toDataURL('image/png')
});
},
cvsLineTo: function(ctx, clientX, plotY) {
ctx.lineTo(clientX, plotY);
},
renderCanvas: function() {
var series = this,
options = series.options,
chart = series.chart,
xAxis = this.xAxis,
yAxis = this.yAxis,
ctx,
c = 0,
xData = series.processedXData,
yData = series.processedYData,
rawData = options.data,
xExtremes = xAxis.getExtremes(),
xMin = xExtremes.min,
xMax = xExtremes.max,
yExtremes = yAxis.getExtremes(),
yMin = yExtremes.min,
yMax = yExtremes.max,
pointTaken = {},
lastClientX,
sampling = !!series.sampling,
points,
r = options.marker && options.marker.radius,
cvsDrawPoint = this.cvsDrawPoint,
cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
enableMouseTracking = options.enableMouseTracking !== false,
lastPoint,
threshold = options.threshold,
yBottom = yAxis.getThreshold(threshold),
hasThreshold = isNumber(threshold),
translatedThreshold = yBottom,
doFill = this.fill,
isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high',
isStacked = !!options.stacking,
cropStart = series.cropStart || 0,
loadingOptions = chart.options.loading,
requireSorting = series.requireSorting,
wasNull,
connectNulls = options.connectNulls,
useRaw = !xData,
minVal,
maxVal,
minI,
maxI,
fillColor = series.fillOpacity ?
new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() :
series.color,
stroke = function() {
if (doFill) {
ctx.fillStyle = fillColor;
ctx.fill();
} else {
ctx.strokeStyle = series.color;
ctx.lineWidth = options.lineWidth;
ctx.stroke();
}
},
drawPoint = function(clientX, plotY, yBottom) {
if (c === 0) {
ctx.beginPath();
if (cvsLineTo) {
ctx.lineJoin = 'round';
}
}
if (wasNull) {
ctx.moveTo(clientX, plotY);
} else {
if (cvsDrawPoint) {
cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint);
} else if (cvsLineTo) {
cvsLineTo(ctx, clientX, plotY);
} else if (cvsMarker) {
cvsMarker(ctx, clientX, plotY, r);
}
}
// We need to stroke the line for every 1000 pixels. It will crash the browser
// memory use if we stroke too infrequently.
c = c + 1;
if (c === 1000) {
stroke();
c = 0;
}
// Area charts need to keep track of the last point
lastPoint = {
clientX: clientX,
plotY: plotY,
yBottom: yBottom
};
},
addKDPoint = function(clientX, plotY, i) {
// The k-d tree requires series points. Reduce the amount of points, since the time to build the
// tree increases exponentially.
if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) {
pointTaken[clientX + ',' + plotY] = true;
if (chart.inverted) {
clientX = xAxis.len - clientX;
plotY = yAxis.len - plotY;
}
points.push({
clientX: clientX,
plotX: clientX,
plotY: plotY,
i: cropStart + i
});
}
};
// If we are zooming out from SVG mode, destroy the graphics
if (this.points || this.graph) {
this.destroyGraphics();
}
// The group
series.plotGroup(
'group',
'series',
series.visible ? 'visible' : 'hidden',
options.zIndex,
chart.seriesGroup
);
series.markerGroup = series.group;
addEvent(series, 'destroy', function() {
series.markerGroup = null;
});
points = this.points = [];
ctx = this.getContext();
series.buildKDTree = noop; // Do not start building while drawing
// Display a loading indicator
if (rawData.length > 99999) {
chart.options.loading = merge(loadingOptions, {
labelStyle: {
backgroundColor: H.color('#ffffff').setOpacity(0.75).get(),
padding: '1em',
borderRadius: '0.5em'
},
style: {
backgroundColor: 'none',
opacity: 1
}
});
clearTimeout(destroyLoadingDiv);
chart.showLoading('Drawing...');
chart.options.loading = loadingOptions; // reset
}
// Loop over the points
eachAsync(isStacked ? series.data : (xData || rawData), function(d, i) {
var x,
y,
clientX,
plotY,
isNull,
low,
chartDestroyed = typeof chart.index === 'undefined',
isYInside = true;
if (!chartDestroyed) {
if (useRaw) {
x = d[0];
y = d[1];
} else {
x = d;
y = yData[i];
}
// Resolve low and high for range series
if (isRange) {
if (useRaw) {
y = d.slice(1, 3);
}
low = y[0];
y = y[1];
} else if (isStacked) {
x = d.x;
y = d.stackY;
low = y - d.y;
}
isNull = y === null;
// Optimize for scatter zooming
if (!requireSorting) {
isYInside = y >= yMin && y <= yMax;
}
if (!isNull && x >= xMin && x <= xMax && isYInside) {
clientX = Math.round(xAxis.toPixels(x, true));
if (sampling) {
if (minI === undefined || clientX === lastClientX) {
if (!isRange) {
low = y;
}
if (maxI === undefined || y > maxVal) {
maxVal = y;
maxI = i;
}
if (minI === undefined || low < minVal) {
minVal = low;
minI = i;
}
}
if (clientX !== lastClientX) { // Add points and reset
if (minI !== undefined) { // then maxI is also a number
plotY = yAxis.toPixels(maxVal, true);
yBottom = yAxis.toPixels(minVal, true);
drawPoint(
clientX,
hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
);
addKDPoint(clientX, plotY, maxI);
if (yBottom !== plotY) {
addKDPoint(clientX, yBottom, minI);
}
}
minI = maxI = undefined;
lastClientX = clientX;
}
} else {
plotY = Math.round(yAxis.toPixels(y, true));
drawPoint(clientX, plotY, yBottom);
addKDPoint(clientX, plotY, i);
}
}
wasNull = isNull && !connectNulls;
if (i % CHUNK_SIZE === 0) {
series.canvasToSVG();
}
}
return !chartDestroyed;
}, function() {
var loadingDiv = chart.loadingDiv,
loadingShown = chart.loadingShown;
stroke();
series.canvasToSVG();
fireEvent(series, 'renderedCanvas');
// Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree.
// CSS animation looks good, but then it must be deleted in timeout. If we add the module to core,
// change hideLoading so we can skip this block.
if (loadingShown) {
extend(loadingDiv.style, {
transition: 'opacity 250ms',
opacity: 0
});
chart.loadingShown = false;
destroyLoadingDiv = setTimeout(function() {
if (loadingDiv.parentNode) { // In exporting it is falsy
loadingDiv.parentNode.removeChild(loadingDiv);
}
chart.loadingDiv = chart.loadingSpan = null;
}, 250);
}
// Pass tests in Pointer.
// Replace this with a single property, and replace when zooming in
// below boostThreshold.
series.directTouch = false;
series.options.stickyTracking = true;
delete series.buildKDTree; // Go back to prototype, ready to build
series.buildKDTree();
// Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it.
}, chart.renderer.forExport ? Number.MAX_VALUE : undefined);
}
});
seriesTypes.scatter.prototype.cvsMarkerCircle = function(ctx, clientX, plotY, r) {
ctx.moveTo(clientX, plotY);
ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false);
};
// Rect is twice as fast as arc, should be used for small markers
seriesTypes.scatter.prototype.cvsMarkerSquare = function(ctx, clientX, plotY, r) {
ctx.rect(clientX - r, plotY - r, r * 2, r * 2);
};
seriesTypes.scatter.prototype.fill = true;
extend(seriesTypes.area.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom, lastPoint) {
if (lastPoint && clientX !== lastPoint.clientX) {
ctx.moveTo(lastPoint.clientX, lastPoint.yBottom);
ctx.lineTo(lastPoint.clientX, lastPoint.plotY);
ctx.lineTo(clientX, plotY);
ctx.lineTo(clientX, yBottom);
}
},
fill: true,
fillOpacity: true,
sampling: true
});
extend(seriesTypes.column.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom) {
ctx.rect(clientX - 1, plotY, 1, yBottom - plotY);
},
fill: true,
sampling: true
});
/**
* Return a full Point object based on the index. The boost module uses stripped point objects
* for performance reasons.
* @param {Number} boostPoint A stripped-down point object
* @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
*/
Series.prototype.getPoint = function(boostPoint) {
var point = boostPoint;
if (boostPoint && !(boostPoint instanceof this.pointClass)) {
point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); // eslint-disable-line new-cap
point.category = point.x;
point.dist = boostPoint.dist;
point.distX = boostPoint.distX;
point.plotX = boostPoint.plotX;
point.plotY = boostPoint.plotY;
}
return point;
};
/**
* Extend series.destroy to also remove the fake k-d-tree points (#5137). Normally
* this is handled by Series.destroy that calls Point.destroy, but the fake
* search points are not registered like that.
*/
wrap(Series.prototype, 'destroy', function(proceed) {
var series = this,
chart = series.chart;
if (chart.hoverPoints) {
chart.hoverPoints = grep(chart.hoverPoints, function(point) {
return point.series === series;
});
}
if (chart.hoverPoint && chart.hoverPoint.series === series) {
chart.hoverPoint = null;
}
proceed.call(this);
});
/**
* Return a point instance from the k-d-tree
*/
wrap(Series.prototype, 'searchPoint', function(proceed) {
return this.getPoint(
proceed.apply(this, [].slice.call(arguments, 1))
);
});
}(Highcharts));
}));

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(d){function h(){return Array.prototype.slice.call(arguments,1)}function v(e){e.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,t(this.pointArrayMap,["y"]))}var t=d.pick,q=d.wrap,u=d.each,y=d.extend,w=d.fireEvent,r=d.Axis,z=d.Series;y(r.prototype,{isInBreak:function(e,g){var b=e.repeat||Infinity,c=e.from,a=e.to-e.from,b=g>=c?(g-c)%b:b-(c-g)%b;return e.inclusive?b<=a:
b<a&&0!==b},isInAnyBreak:function(e,g){var b=this.options.breaks,c=b&&b.length,a,f,n;if(c){for(;c--;)this.isInBreak(b[c],e)&&(a=!0,f||(f=t(b[c].showPoints,this.isXAxis?!1:!0)));n=a&&g?a&&!f:a}return n}});q(r.prototype,"setTickPositions",function(e){e.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var g=this.tickPositions,b=this.tickPositions.info,c=[],a;for(a=0;a<g.length;a++)this.isInAnyBreak(g[a])||c.push(g[a]);this.tickPositions=c;this.tickPositions.info=b}});q(r.prototype,
"init",function(e,g,b){b.breaks&&b.breaks.length&&(b.ordinal=!1);e.call(this,g,b);if(this.options.breaks){var c=this;c.isBroken=!0;this.val2lin=function(a){var f=a,n,b;for(b=0;b<c.breakArray.length;b++)if(n=c.breakArray[b],n.to<=a)f-=n.len;else if(n.from>=a)break;else if(c.isInBreak(n,a)){f-=a-n.from;break}return f};this.lin2val=function(a){var f,b;for(b=0;b<c.breakArray.length&&!(f=c.breakArray[b],f.from>=a);b++)f.to<a?a+=f.len:c.isInBreak(f,a)&&(a+=f.len);return a};this.setExtremes=function(a,c,
b,e,g){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(c);)c-=this.closestPointRange;r.prototype.setExtremes.call(this,a,c,b,e,g)};this.setAxisTranslation=function(a){r.prototype.setAxisTranslation.call(this,a);var b=c.options.breaks;a=[];var e=[],g=0,m,k,p=c.userMin||c.min,d=c.userMax||c.max,l,h;for(h in b)k=b[h],m=k.repeat||Infinity,c.isInBreak(k,p)&&(p+=k.to%m-p%m),c.isInBreak(k,d)&&(d-=d%m-k.from%m);for(h in b){k=b[h];l=k.from;for(m=k.repeat||Infinity;l-m>p;)l-=m;for(;l<
p;)l+=m;for(;l<d;l+=m)a.push({value:l,move:"in"}),a.push({value:l+(k.to-k.from),move:"out",size:k.breakSize})}a.sort(function(b,a){return b.value===a.value?("in"===b.move?0:1)-("in"===a.move?0:1):b.value-a.value});b=0;l=p;for(h in a)k=a[h],b+="in"===k.move?1:-1,1===b&&"in"===k.move&&(l=k.value),0===b&&(e.push({from:l,to:k.value,len:k.value-l-(k.size||0)}),g+=k.value-l-(k.size||0));c.breakArray=e;w(c,"afterBreaks");c.transA*=(d-c.min)/(d-p-g);c.min=p;c.max=d}}});q(z.prototype,"generatePoints",function(e){e.apply(this,
h(arguments));var g=this.xAxis,b=this.yAxis,c=this.points,a,f=c.length,d=this.options.connectNulls,x;if(g&&b&&(g.options.breaks||b.options.breaks))for(;f--;)a=c[f],x=null===a.y&&!1===d,x||!g.isInAnyBreak(a.x,!0)&&!b.isInAnyBreak(a.y,!0)||(c.splice(f,1),this.data[f]&&this.data[f].destroyElements())});d.Series.prototype.drawBreaks=function(e,g){var b=this,c=b.points,a,f,d,h;u(g,function(g){a=e.breakArray||[];f=e.isXAxis?e.min:t(b.options.threshold,e.min);u(c,function(b){h=t(b["stack"+g.toUpperCase()],
b[g]);u(a,function(a){d=!1;if(f<a.from&&h>a.to||f>a.from&&h<a.from)d="pointBreak";else if(f<a.from&&h>a.from&&h<a.to||f>a.from&&h>a.to&&h<a.from)d="pointInBreak";d&&w(e,d,{point:b,brk:a})})})})};q(d.seriesTypes.column.prototype,"drawPoints",v);q(d.Series.prototype,"drawPoints",v)})(h)});

View File

@@ -0,0 +1,334 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pick = H.pick,
wrap = H.wrap,
each = H.each,
extend = H.extend,
fireEvent = H.fireEvent,
Axis = H.Axis,
Series = H.Series;
function stripArguments() {
return Array.prototype.slice.call(arguments, 1);
}
extend(Axis.prototype, {
isInBreak: function(brk, val) {
var ret,
repeat = brk.repeat || Infinity,
from = brk.from,
length = brk.to - brk.from,
test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat));
if (!brk.inclusive) {
ret = test < length && test !== 0;
} else {
ret = test <= length;
}
return ret;
},
isInAnyBreak: function(val, testKeep) {
var breaks = this.options.breaks,
i = breaks && breaks.length,
inbrk,
keep,
ret;
if (i) {
while (i--) {
if (this.isInBreak(breaks[i], val)) {
inbrk = true;
if (!keep) {
keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
}
}
}
if (inbrk && testKeep) {
ret = inbrk && !keep;
} else {
ret = inbrk;
}
}
return ret;
}
});
wrap(Axis.prototype, 'setTickPositions', function(proceed) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
if (this.options.breaks) {
var axis = this,
tickPositions = this.tickPositions,
info = this.tickPositions.info,
newPositions = [],
i;
for (i = 0; i < tickPositions.length; i++) {
if (!axis.isInAnyBreak(tickPositions[i])) {
newPositions.push(tickPositions[i]);
}
}
this.tickPositions = newPositions;
this.tickPositions.info = info;
}
});
wrap(Axis.prototype, 'init', function(proceed, chart, userOptions) {
// Force Axis to be not-ordinal when breaks are defined
if (userOptions.breaks && userOptions.breaks.length) {
userOptions.ordinal = false;
}
proceed.call(this, chart, userOptions);
if (this.options.breaks) {
var axis = this;
axis.isBroken = true;
this.val2lin = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.to <= val) {
nval -= brk.len;
} else if (brk.from >= val) {
break;
} else if (axis.isInBreak(brk, val)) {
nval -= (val - brk.from);
break;
}
}
return nval;
};
this.lin2val = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.from >= nval) {
break;
} else if (brk.to < nval) {
nval += brk.len;
} else if (axis.isInBreak(brk, nval)) {
nval += brk.len;
}
}
return nval;
};
this.setExtremes = function(newMin, newMax, redraw, animation, eventArguments) {
// If trying to set extremes inside a break, extend it to before and after the break ( #3857 )
while (this.isInAnyBreak(newMin)) {
newMin -= this.closestPointRange;
}
while (this.isInAnyBreak(newMax)) {
newMax -= this.closestPointRange;
}
Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments);
};
this.setAxisTranslation = function(saveOld) {
Axis.prototype.setAxisTranslation.call(this, saveOld);
var breaks = axis.options.breaks,
breakArrayT = [], // Temporary one
breakArray = [],
length = 0,
inBrk,
repeat,
brk,
min = axis.userMin || axis.min,
max = axis.userMax || axis.max,
start,
i,
j;
// Min & max check (#4247)
for (i in breaks) {
brk = breaks[i];
repeat = brk.repeat || Infinity;
if (axis.isInBreak(brk, min)) {
min += (brk.to % repeat) - (min % repeat);
}
if (axis.isInBreak(brk, max)) {
max -= (max % repeat) - (brk.from % repeat);
}
}
// Construct an array holding all breaks in the axis
for (i in breaks) {
brk = breaks[i];
start = brk.from;
repeat = brk.repeat || Infinity;
while (start - repeat > min) {
start -= repeat;
}
while (start < min) {
start += repeat;
}
for (j = start; j < max; j += repeat) {
breakArrayT.push({
value: j,
move: 'in'
});
breakArrayT.push({
value: j + (brk.to - brk.from),
move: 'out',
size: brk.breakSize
});
}
}
breakArrayT.sort(function(a, b) {
var ret;
if (a.value === b.value) {
ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1);
} else {
ret = a.value - b.value;
}
return ret;
});
// Simplify the breaks
inBrk = 0;
start = min;
for (i in breakArrayT) {
brk = breakArrayT[i];
inBrk += (brk.move === 'in' ? 1 : -1);
if (inBrk === 1 && brk.move === 'in') {
start = brk.value;
}
if (inBrk === 0) {
breakArray.push({
from: start,
to: brk.value,
len: brk.value - start - (brk.size || 0)
});
length += brk.value - start - (brk.size || 0);
}
}
axis.breakArray = breakArray;
fireEvent(axis, 'afterBreaks');
axis.transA *= ((max - axis.min) / (max - min - length));
axis.min = min;
axis.max = max;
};
}
});
wrap(Series.prototype, 'generatePoints', function(proceed) {
proceed.apply(this, stripArguments(arguments));
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
points = series.points,
point,
i = points.length,
connectNulls = series.options.connectNulls,
nullGap;
if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
while (i--) {
point = points[i];
nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
points.splice(i, 1);
if (this.data[i]) {
this.data[i].destroyElements(); // removes the graphics for this point if they exist
}
}
}
}
});
function drawPointsWrapped(proceed) {
proceed.apply(this);
this.drawBreaks(this.xAxis, ['x']);
this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
}
H.Series.prototype.drawBreaks = function(axis, keys) {
var series = this,
points = series.points,
breaks,
threshold,
eventName,
y;
each(keys, function(key) {
breaks = axis.breakArray || [];
threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
each(points, function(point) {
y = pick(point['stack' + key.toUpperCase()], point[key]);
each(breaks, function(brk) {
eventName = false;
if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
eventName = 'pointBreak';
} else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break
eventName = 'pointInBreak';
}
if (eventName) {
fireEvent(axis, eventName, {
point: point,
brk: brk
});
}
});
});
});
};
wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped);
wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped);
}(Highcharts));
}));

View File

@@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Data module
(c) 2012-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(g){var q=g.win.document,m=g.each,A=g.pick,x=g.inArray,y=g.isNumber,B=g.splat,n,w=function(b,a){this.init(b,a)};g.extend(w.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=A(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&new RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];
this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,e=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},d=b&&b.chart&&b.chart.type,c=[],h=[],v=0,k;m(b&&b.series||[],function(b){c.push(f(b.type||d))});m(a&&a.seriesMapping||[],function(b){e.push(b.x||0)});0===e.length&&e.push(0);m(a&&a.seriesMapping||[],function(a){var e=new n,t,r=c[v]||f(d),
p=g.seriesTypes[((b&&b.series||[])[v]||{}).type||d||"line"].prototype.pointArrayMap||["y"];e.addColumnReader(a.x,"x");for(t in a)a.hasOwnProperty(t)&&"x"!==t&&e.addColumnReader(a[t],t);for(k=0;k<r;k++)e.hasReader(p[k])||e.addColumnReader(void 0,p[k]);h.push(e);v++});a=g.seriesTypes[d||"line"].prototype.pointArrayMap;void 0===a&&(a=["y"]);this.valueCount={global:f(d),xColumns:e,individual:c,seriesBuilders:h,globalPointArrayMap:a}},dataFound:function(){this.options.switchRowsAndColumns&&(this.columns=
this.rowsToColumns(this.columns));this.getColumnDistribution();this.parseTypes();!1!==this.parsed()&&this.complete()},parseCSV:function(){var b=this,a=this.options,e=a.csv,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,v=a.endColumn||Number.MAX_VALUE,k,g,z=0;e&&(g=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),k=a.itemDelimiter||(-1!==e.indexOf("\t")?"\t":","),m(g,function(a,e){var g=b.trim(a),u=0===g.indexOf("#");e>=d&&e<=c&&!u&&""!==g&&(g=
a.split(k),m(g,function(b,a){a>=h&&a<=v&&(f[a-h]||(f[a-h]=[]),f[a-h][z]=b)}),z+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,e=this.columns,f=b.startRow||0,d=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,h=b.endColumn||Number.MAX_VALUE;a&&("string"===typeof a&&(a=q.getElementById(a)),m(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=d&&m(b.children,function(b,d){("TD"===b.tagName||"TH"===b.tagName)&&d>=c&&d<=h&&(e[d-c]||(e[d-c]=[]),e[d-c][a-f]=b.innerHTML)})}),this.dataFound())},
parseGoogleSpreadsheet:function(){var b=this,a=this.options,e=a.googleSpreadsheetKey,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,k,u;e&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+e+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",error:a.error,success:function(a){a=a.feed.entry;var e,r=a.length,p=0,n=0,l;for(l=0;l<r;l++)e=a[l],p=Math.max(p,e.gs$cell.col),
n=Math.max(n,e.gs$cell.row);for(l=0;l<p;l++)l>=h&&l<=g&&(f[l-h]=[],f[l-h].length=Math.min(n,c-d));for(l=0;l<r;l++)e=a[l],k=e.gs$cell.row-1,u=e.gs$cell.col-1,u>=h&&u<=g&&k>=d&&k<=c&&(f[u-h][k-d]=e.content.$t);m(f,function(a){for(l=0;l<a.length;l++)void 0===a[l]&&(a[l]=null)});b.dataFound()}})},trim:function(b,a){"string"===typeof b&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=
this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var e=this.rawColumns,f=this.columns,d=b.length,c,h,g,k,n=this.firstRowAsNames,m=-1!==x(a,this.valueCount.xColumns),t=[],r=this.chartOptions,p,q=(this.options.columnTypes||[])[a],r=m&&(r&&r.xAxis&&"category"===B(r.xAxis)[0].type||"string"===q);for(e[a]||(e[a]=[]);d--;)c=t[d]||b[d],g=this.trim(c),k=this.trim(c,!0),h=parseFloat(k),void 0===e[a][d]&&(e[a][d]=g),r||0===d&&n?b[d]=g:+k===h?(b[d]=h,31536E6<h&&"float"!==q?b.isDatetime=
!0:b.isNumeric=!0,void 0!==b[d+1]&&(p=h>b[d+1])):(h=this.parseDate(c),m&&y(h)&&"float"!==q?(t[d]=c,b[d]=h,b.isDatetime=!0,void 0!==b[d+1]&&(c=h>b[d+1],c!==p&&void 0!==p&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,d=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0),p=c)):(b[d]=""===g?null:g,0!==d&&(b.isDatetime||b.isNumeric)&&(b.mixed=!0)));m&&b.mixed&&(f[a]=e[a]);if(m&&p&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),n&&f[a].unshift(f[a].pop())},
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])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,e,f,d=this.options.dateFormat||this.dateFormat,c;if(a)e=a(b);else if("string"===typeof b){if(d)a=this.dateFormats[d],(c=b.match(a.regex))&&(e=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=
f;this.alternativeFormat=a.alternative;e=a.parser(c);break}c||(c=Date.parse(b),"object"===typeof c&&null!==c&&c.getTime?e=c.getTime()-6E4*c.getTimezoneOffset():y(c)&&(e=c-6E4*(new Date(c)).getTimezoneOffset()))}return e},rowsToColumns:function(b){var a,e,f,d,c;if(b)for(c=[],e=b.length,a=0;a<e;a++)for(d=b[a].length,f=0;f<d;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f];return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var e,f,d=
[],c=[],h;for(f=0;f<b;f+=1)d.push(!0);for(e=0;e<a.length;e+=1)for(h=a[e].getReferencedColumnIndexes(),f=0;f<h.length;f+=1)d[h[f]]=!1;for(f=0;f<d.length;f+=1)d[f]&&c.push(f);return c},complete:function(){var b=this.columns,a,e=this.options,f,d,c,h,g=[],k;if(e.complete||e.afterComplete){for(c=0;c<b.length;c++)this.firstRowAsNames&&(b[c].name=b[c].shift());f=[];d=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)k=this.valueCount.seriesBuilders[c],
k.populateColumns(d)&&g.push(k);for(;0<d.length;){k=new n;k.addColumnReader(0,"x");c=x(0,d);-1!==c&&d.splice(c,1);for(c=0;c<this.valueCount.global;c++)k.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);k.populateColumns(d)&&g.push(k)}0<g.length&&0<g[0].readers.length&&(k=b[g[0].readers[0].columnIndex],void 0!==k&&(k.isDatetime?a="datetime":k.isNumeric||(a="category")));if("category"===a)for(c=0;c<g.length;c++)for(k=g[c],d=0;d<k.readers.length;d++)"x"===k.readers[d].configName&&(k.readers[d].configName=
"name");for(c=0;c<g.length;c++){k=g[c];d=[];for(h=0;h<b[0].length;h++)d[h]=k.read(b,h);f[c]={data:d};k.name&&(f[c].name=k.name);"category"===a&&(f[c].turboThreshold=0)}b={series:f};a&&(b.xAxis={type:a},"category"===a&&(b.xAxis.nameToX=!1));e.complete&&e.complete(b);e.afterComplete&&e.afterComplete(b)}}});g.Data=w;g.data=function(b,a){return new w(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,e){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(d){var c,h;if(a.hasOwnProperty("series"))if("object"===
typeof a.series)for(c=Math.max(a.series.length,d.series.length);c--;)h=a.series[c]||{},a.series[c]=g.merge(h,d.series[c]);else delete a.series;a=g.merge(d,a);b.call(f,a,e)}}),a):b.call(f,a,e)});n=function(){this.readers=[];this.pointIsArray=!0};n.prototype.populateColumns=function(b){var a=!0;m(this.readers,function(a){void 0===a.columnIndex&&(a.columnIndex=b.shift())});m(this.readers,function(b){void 0===b.columnIndex&&(a=!1)});return a};n.prototype.read=function(b,a){var e=this.pointIsArray,f=e?
[]:{},d;m(this.readers,function(c){var d=b[c.columnIndex][a];e?f.push(d):f[c.configName]=d});void 0===this.name&&2<=this.readers.length&&(d=this.getReferencedColumnIndexes(),2<=d.length&&(d.shift(),d.sort(),this.name=b[d.shift()].name));return f};n.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});"x"!==a&&"y"!==a&&void 0!==a&&(this.pointIsArray=!1)};n.prototype.getReferencedColumnIndexes=function(){var b,a=[],e;for(b=0;b<this.readers.length;b+=1)e=this.readers[b],
void 0!==e.columnIndex&&a.push(e.columnIndex);return a};n.prototype.hasReader=function(b){var a,e;for(a=0;a<this.readers.length;a+=1)if(e=this.readers[a],e.configName===b)return!0}})(q)});

View File

@@ -0,0 +1,981 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* global jQuery */
'use strict';
// Utilities
var win = Highcharts.win,
doc = win.document,
each = Highcharts.each,
pick = Highcharts.pick,
inArray = Highcharts.inArray,
isNumber = Highcharts.isNumber,
splat = Highcharts.splat,
SeriesBuilder;
// 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) || [];
this.firstRowAsNames = pick(options.firstRowAsNames, true);
this.decimalRegex = options.decimalPoint && new RegExp('^(-?[0-9]+)' + options.decimalPoint + '([0-9]+)$');
// This is a two-dimensional array holding the raw, trimmed string values
// with the same organisation as the columns array. It makes it possible
// for example to revert from interpreted timestamps to string-based
// categories.
this.rawColumns = [];
// 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,
options = this.options,
xColumns = [],
getValueCount = function(type) {
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
},
getPointArrayMap = function(type) {
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap;
},
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
individualCounts = [],
seriesBuilders = [],
seriesIndex = 0,
i;
each((chartOptions && chartOptions.series) || [], function(series) {
individualCounts.push(getValueCount(series.type || globalType));
});
// Collect the x-column indexes from seriesMapping
each((options && options.seriesMapping) || [], function(mapping) {
xColumns.push(mapping.x || 0);
});
// If there are no defined series with x-columns, use the first column as x column
if (xColumns.length === 0) {
xColumns.push(0);
}
// Loop all seriesMappings and constructs SeriesBuilders from
// the mapping options.
each((options && options.seriesMapping) || [], function(mapping) {
var builder = new SeriesBuilder(),
name,
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType),
seriesArr = (chartOptions && chartOptions.series) || [],
series = seriesArr[seriesIndex] || {},
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y'];
// Add an x reader from the x property or from an undefined column
// if the property is not set. It will then be auto populated later.
builder.addColumnReader(mapping.x, 'x');
// Add all column mappings
for (name in mapping) {
if (mapping.hasOwnProperty(name) && name !== 'x') {
builder.addColumnReader(mapping[name], name);
}
}
// Add missing columns
for (i = 0; i < numberOfValueColumnsNeeded; i++) {
if (!builder.hasReader(pointArrayMap[i])) {
//builder.addNextColumnReader(pointArrayMap[i]);
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, pointArrayMap[i]);
}
}
seriesBuilders.push(builder);
seriesIndex++;
});
var globalPointArrayMap = getPointArrayMap(globalType);
if (globalPointArrayMap === undefined) {
globalPointArrayMap = ['y'];
}
this.valueCount = {
global: getValueCount(globalType),
xColumns: xColumns,
individual: individualCounts,
seriesBuilders: seriesBuilders,
globalPointArrayMap: globalPointArrayMap
};
},
/**
* 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 info about series and columns
this.getColumnDistribution();
// Interpret the values into right types
this.parseTypes();
// Handle columns if a handleColumns callback is given
if (this.parsed() !== false) {
// 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 = doc.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;
}
}
// Insert null for empty spreadsheet cells (#5298)
each(columns, function(column) {
for (i = 0; i < column.length; i++) {
if (column[i] === undefined) {
column[i] = null;
}
}
});
self.dataFound();
}
});
}
},
/**
* Trim a string from whitespace
*/
trim: function(str, inside) {
if (typeof str === 'string') {
str = str.replace(/^\s+|\s+$/g, '');
// Clear white space insdie the string, like thousands separators
if (inside && /^[0-9\s]+$/.test(str)) {
str = str.replace(/\s/g, '');
}
if (this.decimalRegex) {
str = str.replace(this.decimalRegex, '$1.$2');
}
}
return str;
},
/**
* Parse numeric cells in to number types and date types in to true dates.
*/
parseTypes: function() {
var columns = this.columns,
col = columns.length;
while (col--) {
this.parseColumn(columns[col], col);
}
},
/**
* Parse a single column. Set properties like .isDatetime and .isNumeric.
*/
parseColumn: function(column, col) {
var rawColumns = this.rawColumns,
columns = this.columns,
row = column.length,
val,
floatVal,
trimVal,
trimInsideVal,
firstRowAsNames = this.firstRowAsNames,
isXColumn = inArray(col, this.valueCount.xColumns) !== -1,
dateVal,
backup = [],
diff,
chartOptions = this.chartOptions,
descending,
columnTypes = this.options.columnTypes || [],
columnType = columnTypes[col],
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string');
if (!rawColumns[col]) {
rawColumns[col] = [];
}
while (row--) {
val = backup[row] || column[row];
trimVal = this.trim(val);
trimInsideVal = this.trim(val, true);
floatVal = parseFloat(trimInsideVal);
// Set it the first time
if (rawColumns[col][row] === undefined) {
rawColumns[col][row] = trimVal;
}
// Disable number or date parsing by setting the X axis type to category
if (forceCategory || (row === 0 && firstRowAsNames)) {
column[row] = trimVal;
} else if (+trimInsideVal === floatVal) { // is numeric
column[row] = floatVal;
// If the number is greater than milliseconds in a year, assume datetime
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') {
column.isDatetime = true;
} else {
column.isNumeric = true;
}
if (column[row + 1] !== undefined) {
descending = floatVal > column[row + 1];
}
// String, continue to determine if it is a date string or really a string
} else {
dateVal = this.parseDate(val);
// Only allow parsing of dates if this column is an x-column
if (isXColumn && isNumber(dateVal) && columnType !== 'float') { // is date
backup[row] = val;
column[row] = dateVal;
column.isDatetime = true;
// Check if the dates are uniformly descending or ascending. If they
// are not, chances are that they are a different time format, so check
// for alternative.
if (column[row + 1] !== undefined) {
diff = dateVal > column[row + 1];
if (diff !== descending && descending !== undefined) {
if (this.alternativeFormat) {
this.dateFormat = this.alternativeFormat;
row = column.length;
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative;
} else {
column.unsorted = true;
}
}
descending = diff;
}
} else { // string
column[row] = trimVal === '' ? null : trimVal;
if (row !== 0 && (column.isDatetime || column.isNumeric)) {
column.mixed = true;
}
}
}
}
// If strings are intermixed with numbers or dates in a parsed column, it is an indication
// that parsing went wrong or the data was not intended to display as numbers or dates and
// parsing is too aggressive. Fall back to categories. Demonstrated in the
// highcharts/demo/column-drilldown sample.
if (isXColumn && column.mixed) {
columns[col] = rawColumns[col];
}
// If the 0 column is date or number and descending, reverse all columns.
if (isXColumn && descending && this.options.sort) {
for (col = 0; col < columns.length; col++) {
columns[col].reverse();
if (firstRowAsNames) {
columns[col].unshift(columns[col].pop());
}
}
}
},
/**
* 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]);
}
},
'dd/mm/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YYYY' // different format with the same regex
},
'mm/dd/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[1] - 1, +match[2]);
}
},
'dd/mm/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YY' // different format with the same regex
},
'mm/dd/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]);
}
}
},
/**
* Parse a date and return it as a number. Overridable through options.parseDate.
*/
parseDate: function(val) {
var parseDate = this.options.parseDate,
ret,
key,
format,
dateFormat = this.options.dateFormat || this.dateFormat,
match;
if (parseDate) {
ret = parseDate(val);
} else if (typeof val === 'string') {
// Auto-detect the date format the first time
if (!dateFormat) {
for (key in this.dateFormats) {
format = this.dateFormats[key];
match = val.match(format.regex);
if (match) {
this.dateFormat = dateFormat = key;
this.alternativeFormat = format.alternative;
ret = format.parser(match);
break;
}
}
// Next time, use the one previously found
} else {
format = this.dateFormats[dateFormat];
match = val.match(format.regex);
if (match) {
ret = format.parser(match);
}
}
// Fall back to Date.parse
if (!match) {
match = Date.parse(val);
// External tools like Date.js and MooTools extend Date object and
// returns a date.
if (typeof match === 'object' && match !== null && match.getTime) {
ret = match.getTime() - match.getTimezoneOffset() * 60000;
// Timestamp
} else if (isNumber(match)) {
ret = match - (new Date(match)).getTimezoneOffset() * 60000;
}
}
}
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) {
return this.options.parsed.call(this, this.columns);
}
},
getFreeIndexes: function(numberOfColumns, seriesBuilders) {
var s,
i,
freeIndexes = [],
freeIndexValues = [],
referencedIndexes;
// Add all columns as free
for (i = 0; i < numberOfColumns; i = i + 1) {
freeIndexes.push(true);
}
// Loop all defined builders and remove their referenced columns
for (s = 0; s < seriesBuilders.length; s = s + 1) {
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes();
for (i = 0; i < referencedIndexes.length; i = i + 1) {
freeIndexes[referencedIndexes[i]] = false;
}
}
// Collect the values for the free indexes
for (i = 0; i < freeIndexes.length; i = i + 1) {
if (freeIndexes[i]) {
freeIndexValues.push(i);
}
}
return freeIndexValues;
},
/**
* If a complete callback function is provided in the options, interpret the
* columns into a Highcharts options object.
*/
complete: function() {
var columns = this.columns,
xColumns = [],
type,
options = this.options,
series,
data,
i,
j,
r,
seriesIndex,
chartOptions,
allSeriesBuilders = [],
builder,
freeIndexes,
typeCol,
index;
xColumns.length = columns.length;
if (options.complete || options.afterComplete) {
// Get the names and shift the top row
for (i = 0; i < columns.length; i++) {
if (this.firstRowAsNames) {
columns[i].name = columns[i].shift();
}
}
// Use the next columns for series
series = [];
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders);
// Populate defined series
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) {
builder = this.valueCount.seriesBuilders[seriesIndex];
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Populate dynamic series
while (freeIndexes.length > 0) {
builder = new SeriesBuilder();
builder.addColumnReader(0, 'x');
// Mark index as used (not free)
index = inArray(0, freeIndexes);
if (index !== -1) {
freeIndexes.splice(index, 1);
}
for (i = 0; i < this.valueCount.global; i++) {
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]);
}
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Get the data-type from the first series x column
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) {
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex];
if (typeCol !== undefined) {
if (typeCol.isDatetime) {
type = 'datetime';
} else if (!typeCol.isNumeric) {
type = 'category';
}
}
}
// Axis type is category, then the "x" column should be called "name"
if (type === 'category') {
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
for (r = 0; r < builder.readers.length; r++) {
if (builder.readers[r].configName === 'x') {
builder.readers[r].configName = 'name';
}
}
}
}
// Read data for all builders
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
// Iterate down the cells of each column and add data to the series
data = [];
for (j = 0; j < columns[0].length; j++) {
data[j] = builder.read(columns, j);
}
// Add the series
series[seriesIndex] = {
data: data
};
if (builder.name) {
series[seriesIndex].name = builder.name;
}
if (type === 'category') {
series[seriesIndex].turboThreshold = 0;
}
}
// Do the callback
chartOptions = {
series: series
};
if (type) {
chartOptions.xAxis = {
type: type
};
if (type === 'category') {
chartOptions.xAxis.nameToX = false;
}
}
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);
}
});
/**
* Creates a new SeriesBuilder. A SeriesBuilder consists of a number
* of ColumnReaders that reads columns and give them a name.
* Ex: A series builder can be constructed to read column 3 as 'x' and
* column 7 and 8 as 'y1' and 'y2'.
* The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}
*
* The name of the builder is taken from the second column. In the above
* example it would be the column with index 7.
* @constructor
*/
SeriesBuilder = function() {
this.readers = [];
this.pointIsArray = true;
};
/**
* Populates readers with column indexes. A reader can be added without
* a specific index and for those readers the index is taken sequentially
* from the free columns (this is handled by the ColumnCursor instance).
* @returns {boolean}
*/
SeriesBuilder.prototype.populateColumns = function(freeIndexes) {
var builder = this,
enoughColumns = true;
// Loop each reader and give it an index if its missing.
// The freeIndexes.shift() will return undefined if there
// are no more columns.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
reader.columnIndex = freeIndexes.shift();
}
});
// Now, all readers should have columns mapped. If not
// then return false to signal that this series should
// not be added.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
enoughColumns = false;
}
});
return enoughColumns;
};
/**
* Reads a row from the dataset and returns a point or array depending
* on the names of the readers.
* @param columns
* @param rowIndex
* @returns {Array | Object}
*/
SeriesBuilder.prototype.read = function(columns, rowIndex) {
var builder = this,
pointIsArray = builder.pointIsArray,
point = pointIsArray ? [] : {},
columnIndexes;
// Loop each reader and ask it to read its value.
// Then, build an array or point based on the readers names.
each(builder.readers, function(reader) {
var value = columns[reader.columnIndex][rowIndex];
if (pointIsArray) {
point.push(value);
} else {
point[reader.configName] = value;
}
});
// The name comes from the first column (excluding the x column)
if (this.name === undefined && builder.readers.length >= 2) {
columnIndexes = builder.getReferencedColumnIndexes();
if (columnIndexes.length >= 2) {
// remove the first one (x col)
columnIndexes.shift();
// Sort the remaining
columnIndexes.sort();
// Now use the lowest index as name column
this.name = columns[columnIndexes.shift()].name;
}
}
return point;
};
/**
* Creates and adds ColumnReader from the given columnIndex and configName.
* ColumnIndex can be undefined and in that case the reader will be given
* an index when columns are populated.
* @param columnIndex {Number | undefined}
* @param configName
*/
SeriesBuilder.prototype.addColumnReader = function(columnIndex, configName) {
this.readers.push({
columnIndex: columnIndex,
configName: configName
});
if (!(configName === 'x' || configName === 'y' || configName === undefined)) {
this.pointIsArray = false;
}
};
/**
* Returns an array of column indexes that the builder will use when
* reading data.
* @returns {Array}
*/
SeriesBuilder.prototype.getReferencedColumnIndexes = function() {
var i,
referencedColumnIndexes = [],
columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.columnIndex !== undefined) {
referencedColumnIndexes.push(columnReader.columnIndex);
}
}
return referencedColumnIndexes;
};
/**
* Returns true if the builder has a reader for the given configName.
* @param configName
* @returns {boolean}
*/
SeriesBuilder.prototype.hasReader = function(configName) {
var i, columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.configName === configName) {
return true;
}
}
// Else return undefined
};
}(Highcharts));
}));

View File

@@ -0,0 +1,25 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Highcharts Drilldown module
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(e){function n(a,b,d){var c;b.rgba.length&&a.rgba.length?(a=a.rgba,b=b.rgba,c=1!==b[3]||1!==a[3],a=(c?"rgba(":"rgb(")+Math.round(b[0]+(a[0]-b[0])*(1-d))+","+Math.round(b[1]+(a[1]-b[1])*(1-d))+","+Math.round(b[2]+(a[2]-b[2])*(1-d))+(c?","+(b[3]+(a[3]-b[3])*(1-d)):"")+")"):a=b.input||"none";return a}var B=e.noop,C=e.color,u=e.defaultOptions,k=e.each,p=e.extend,H=e.format,w=e.pick,v=e.wrap,q=e.Chart,
t=e.seriesTypes,D=t.pie,r=t.column,E=e.Tick,x=e.fireEvent,F=e.inArray,G=1;k(["fill","stroke"],function(a){e.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n(C(this.start),C(this.end),this.pos))}});p(u.lang,{drillUpText:"\u25c1 Back to {series.name}"});u.drilldown={animation:{duration:500},drillUpButton:{position:{align:"right",x:-10,y:10}}};e.SVGRenderer.prototype.Element.prototype.fadeIn=function(a){this.attr({opacity:.1,visibility:"inherit"}).animate({opacity:w(this.newOpacity,1)},a||{duration:250})};
q.prototype.addSeriesAsDrilldown=function(a,b){this.addSingleSeriesAsDrilldown(a,b);this.applyDrilldown()};q.prototype.addSingleSeriesAsDrilldown=function(a,b){var d=a.series,c=d.xAxis,g=d.yAxis,f,h=[],y=[],e,m,z;z={colorIndex:w(a.colorIndex,d.colorIndex)};this.drilldownLevels||(this.drilldownLevels=[]);e=d.options._levelNumber||0;(m=this.drilldownLevels[this.drilldownLevels.length-1])&&m.levelNumber!==e&&(m=void 0);b=p(p({_ddSeriesId:G++},z),b);f=F(a,d.points);k(d.chart.series,function(a){a.xAxis!==
c||a.isDrilling||(a.options._ddSeriesId=a.options._ddSeriesId||G++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||e,m?(h=m.levelSeries,y=m.levelSeriesOptions):(h.push(a),y.push(a.options)))});f=p({levelNumber:e,seriesOptions:d.options,levelSeriesOptions:y,levelSeries:h,shapeArgs:a.shapeArgs,bBox:a.graphic?a.graphic.getBBox():{},lowerSeriesOptions:b,pointOptions:d.options.data[f],pointIndex:f,oldExtremes:{xMin:c&&c.userMin,xMax:c&&c.userMax,yMin:g&&g.userMin,
yMax:g&&g.userMax}},z);this.drilldownLevels.push(f);f=f.lowerSeries=this.addSeries(b,!1);f.options._levelNumber=e+1;c&&(c.oldPos=c.pos,c.userMin=c.userMax=null,g.userMin=g.userMax=null);d.type===f.type&&(f.animate=f.animateDrilldown||B,f.options.animation=!0)};q.prototype.applyDrilldown=function(){var a=this.drilldownLevels,b;a&&0<a.length&&(b=a[a.length-1].levelNumber,k(this.drilldownLevels,function(a){a.levelNumber===b&&k(a.levelSeries,function(a){a.options&&a.options._levelNumber===b&&a.remove(!1)})}));
this.redraw();this.showDrillUpButton()};q.prototype.getDrilldownBackText=function(){var a=this.drilldownLevels;if(a&&0<a.length)return a=a[a.length-1],a.series=a.seriesOptions,H(this.options.lang.drillUpText,a)};q.prototype.showDrillUpButton=function(){var a=this,b=this.getDrilldownBackText(),d=a.options.drilldown.drillUpButton,c,g;this.drillUpButton?this.drillUpButton.attr({text:b}).align():(g=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(b,null,null,function(){a.drillUp()},c,g&&
g.hover,g&&g.select).addClass("highcharts-drillup-button").attr({align:d.position.align,zIndex:7}).add().align(d.position,!1,d.relativeTo||"plotBox"))};q.prototype.drillUp=function(){for(var a=this,b=a.drilldownLevels,d=b[b.length-1].levelNumber,c=b.length,g=a.series,f,h,e,l,m=function(c){var b;k(g,function(a){a.options._ddSeriesId===c._ddSeriesId&&(b=a)});b=b||a.addSeries(c,!1);b.type===e.type&&b.animateDrillupTo&&(b.animate=b.animateDrillupTo);c===h.seriesOptions&&(l=b)};c--;)if(h=b[c],h.levelNumber===
d){b.pop();e=h.lowerSeries;if(!e.chart)for(f=g.length;f--;)if(g[f].options.id===h.lowerSeriesOptions.id&&g[f].options._levelNumber===d+1){e=g[f];break}e.xData=[];k(h.levelSeriesOptions,m);x(a,"drillup",{seriesOptions:h.seriesOptions});l.type===e.type&&(l.drilldownLevel=h,l.options.animation=a.options.drilldown.animation,e.animateDrillupFrom&&e.chart&&e.animateDrillupFrom(h));l.options._levelNumber=d;e.remove(!1);l.xAxis&&(f=h.oldExtremes,l.xAxis.setExtremes(f.xMin,f.xMax,!1),l.yAxis.setExtremes(f.yMin,
f.yMax,!1))}x(a,"drillupall");this.redraw();0===this.drilldownLevels.length?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};r.prototype.supportsDrilldown=!0;r.prototype.animateDrillupTo=function(a){if(!a){var b=this,d=b.drilldownLevel;k(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();a.connector&&a.connector.hide()});setTimeout(function(){b.points&&k(b.points,function(a,
b){var f=b===(d&&d.pointIndex)?"show":"fadeIn",e="show"===f?!0:void 0;if(a.graphic)a.graphic[f](e);if(a.dataLabel)a.dataLabel[f](e);if(a.connector)a.connector[f](e)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=B}};r.prototype.animateDrilldown=function(a){var b=this,d=this.chart.drilldownLevels,c,g=this.chart.options.drilldown.animation,f=this.xAxis;a||(k(d,function(a){b.options._ddSeriesId===a.lowerSeriesOptions._ddSeriesId&&(c=a.shapeArgs)}),c.x+=w(f.oldPos,f.pos)-
f.pos,k(this.points,function(a){a.graphic&&a.graphic.attr(c).animate(p(a.shapeArgs,{fill:a.color||b.color}),g);a.dataLabel&&a.dataLabel.fadeIn(g)}),this.animate=null)};r.prototype.animateDrillupFrom=function(a){var b=this.chart.options.drilldown.animation,d=this.group,c=this;k(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;k(this.points,function(c){var f=c.graphic,h=a.shapeArgs,k=function(){f.destroy();d&&(d=d.destroy())};f&&(delete c.graphic,b?f.animate(h,e.merge(b,
{complete:k})):(f.attr(h),k()))})};D&&p(D.prototype,{supportsDrilldown:!0,animateDrillupTo:r.prototype.animateDrillupTo,animateDrillupFrom:r.prototype.animateDrillupFrom,animateDrilldown:function(a){var b=this.chart.options.drilldown.animation,d=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1].shapeArgs,c=d.start,g=(d.end-c)/this.points.length;a||(k(this.points,function(a,h){var k=a.shapeArgs;if(a.graphic)a.graphic.attr(e.merge(d,{start:c+h*g,end:c+(h+1)*g}))[b?"animate":"attr"](k,
b)}),this.animate=null)}});e.Point.prototype.doDrilldown=function(a,b,d){var c=this.series.chart,e=c.options.drilldown,f=(e.series||[]).length,h;c.ddDupes||(c.ddDupes=[]);for(;f--&&!h;)e.series[f].id===this.drilldown&&-1===F(this.drilldown,c.ddDupes)&&(h=e.series[f],c.ddDupes.push(this.drilldown));x(c,"drilldown",{point:this,seriesOptions:h,category:b,originalEvent:d,points:void 0!==b&&this.series.xAxis.getDDPoints(b).slice(0)},function(b){var c=b.point.series&&b.point.series.chart,d=b.seriesOptions;
c&&d&&(a?c.addSingleSeriesAsDrilldown(b.point,d):c.addSeriesAsDrilldown(b.point,d))})};e.Axis.prototype.drilldownCategory=function(a,b){var d,c,e=this.getDDPoints(a);for(d in e)(c=e[d])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,a,b);this.chart.applyDrilldown()};e.Axis.prototype.getDDPoints=function(a){var b=[];k(this.series,function(d){var c,e=d.xData,f=d.points;for(c=0;c<e.length;c++)if(e[c]===a&&d.options.data[c].drilldown){b.push(f?f[c]:!0);break}});return b};E.prototype.drillable=
function(){var a=this.pos,b=this.label,d=this.axis,c="xAxis"===d.coll&&d.getDDPoints,e=c&&d.getDDPoints(a);c&&(b&&e.length?(b.drillable=!0,b.addClass("highcharts-drilldown-axis-label").on("click",function(b){d.drilldownCategory(a,b)})):b&&b.drillable&&(b.on("click",null),b.removeClass("highcharts-drilldown-axis-label")))};v(E.prototype,"addLabel",function(a){a.call(this);this.drillable()});v(e.Point.prototype,"init",function(a,b,d,c){var g=a.call(this,b,d,c);a=(a=b.xAxis)&&a.ticks[c];g.drilldown&&
e.addEvent(g,"click",function(a){b.xAxis&&!1===b.chart.options.drilldown.allowPointDrilldown?b.xAxis.drilldownCategory(c,a):g.doDrilldown(void 0,void 0,a)});a&&a.drillable();return g});v(e.Series.prototype,"drawDataLabels",function(a){var b=this.chart.options.drilldown.activeDataLabelStyle,d=this.chart.renderer;a.call(this);k(this.points,function(a){a.drilldown&&a.dataLabel&&("contrast"===b.color&&d.getContrast(a.color||this.color),a.dataLabel.addClass("highcharts-drilldown-data-label"))},this)});
var A,u=function(a){a.call(this);k(this.points,function(a){a.drilldown&&a.graphic&&a.graphic.addClass("highcharts-drilldown-point")})};for(A in t)t[A].prototype.supportsDrilldown&&v(t[A].prototype,"drawTracker",u)})(n)});

View File

@@ -0,0 +1,750 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
'use strict';
var noop = H.noop,
color = H.color,
defaultOptions = H.defaultOptions,
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,
Tick = H.Tick,
fireEvent = H.fireEvent,
inArray = H.inArray,
ddSeriesId = 1;
// Utilities
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color. This method is copied from ColorAxis.js
* and should always be kept updated, until we get AMD support.
*/
function tweenColors(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, tweenColors(color(this.start), color(this.end), this.pos));
};
});
// Add language
extend(defaultOptions.lang, {
drillUpText: '◁ Back to {series.name}'
});
defaultOptions.drilldown = {
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,
pointIndex,
levelSeries = [],
levelSeriesOptions = [],
level,
levelNumber,
last,
colorProp;
colorProp = {
colorIndex: pick(point.colorIndex, oldSeries.colorIndex)
};
if (!this.drilldownLevels) {
this.drilldownLevels = [];
}
levelNumber = oldSeries.options._levelNumber || 0;
// See if we can reuse the registered series from last run
last = this.drilldownLevels[this.drilldownLevels.length - 1];
if (last && last.levelNumber !== levelNumber) {
last = undefined;
}
ddOptions = extend(extend({
_ddSeriesId: ddSeriesId++
}, colorProp), ddOptions);
pointIndex = inArray(point, oldSeries.points);
// Record options for all current series
each(oldSeries.chart.series, function(series) {
if (series.xAxis === xAxis && !series.isDrilling) {
series.options._ddSeriesId = series.options._ddSeriesId || ddSeriesId++;
series.options._colorIndex = series.userOptions._colorIndex;
series.options._levelNumber = series.options._levelNumber || levelNumber; // #3182
if (last) {
levelSeries = last.levelSeries;
levelSeriesOptions = last.levelSeriesOptions;
} else {
levelSeries.push(series);
levelSeriesOptions.push(series.options);
}
}
});
// Add a record of properties for each drilldown level
level = extend({
levelNumber: levelNumber,
seriesOptions: oldSeries.options,
levelSeriesOptions: levelSeriesOptions,
levelSeries: levelSeries,
shapeArgs: point.shapeArgs,
bBox: point.graphic ? point.graphic.getBBox() : {}, // no graphic in line series with markers disabled
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
}
}, colorProp);
// Push it to the lookup array
this.drilldownLevels.push(level);
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
newSeries.options._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;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
each(this.drilldownLevels, function(level) {
if (level.levelNumber === levelToRemove) {
each(level.levelSeries, function(series) {
if (series.options && series.options._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 drilldownLevels = this.drilldownLevels,
lastLevel;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
lastLevel = drilldownLevels[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
)
.addClass('highcharts-drillup-button')
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.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,
level,
oldSeries,
newSeries,
oldExtremes,
addSeries = function(seriesOptions) {
var addedSeries;
each(chartSeries, function(series) {
if (series.options._ddSeriesId === seriesOptions._ddSeriesId) {
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
seriesI = chartSeries.length; // #2919
while (seriesI--) {
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id &&
chartSeries[seriesI].options._levelNumber === levelNumber + 1) { // #3867
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.chart) { // #2919
oldSeries.animateDrillupFrom(level);
}
}
newSeries.options._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);
}
}
}
// Fire a once-off event after all series have been drilled up (#5158)
fireEvent(chart, 'drillupall');
this.redraw();
if (this.drilldownLevels.length === 0) {
this.drillUpButton = this.drillUpButton.destroy();
} else {
this.drillUpButton.attr({
text: this.getDrilldownBackText()
})
.align();
}
this.ddDupes.length = []; // #3315
};
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) {
if (point.graphic) { // #3407
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() {
if (newSeries.points) { // May be destroyed in the meantime, #3389
each(newSeries.points, function(point, i) {
// Fade in other points
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
inherit = verb === 'show' ? true : undefined;
if (point.graphic) { // #3407
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,
animationOptions = this.chart.options.drilldown.animation,
xAxis = this.xAxis;
if (!init) {
each(drilldownLevels, function(level) {
if (series.options._ddSeriesId === level.lowerSeriesOptions._ddSeriesId) {
animateFrom = level.shapeArgs;
}
});
animateFrom.x += (pick(xAxis.oldPos, xAxis.pos) - xAxis.pos);
each(this.points, function(point) {
var animateTo = point.shapeArgs;
if (point.graphic) {
point.graphic
.attr(animateFrom)
.animate(
extend(point.shapeArgs, {
fill: point.color || series.color
}),
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,
animateTo = level.shapeArgs,
complete = function() {
graphic.destroy();
if (group) {
group = group.destroy();
}
};
if (graphic) {
delete point.graphic;
if (animationOptions) {
graphic.animate(
animateTo,
H.merge(animationOptions, {
complete: complete
})
);
} else {
graphic.attr(animateTo);
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;
if (!init) {
each(this.points, function(point, i) {
var animateTo = point.shapeArgs;
if (point.graphic) {
point.graphic
.attr(H.merge(animateFrom, {
start: start + i * startAngle,
end: start + (i + 1) * startAngle
}))[animationOptions ? 'animate' : 'attr'](
animateTo,
animationOptions
);
}
});
this.animate = null;
}
}
});
}
H.Point.prototype.doDrilldown = function(_holdRedraw, category, originalEvent) {
var series = this.series,
chart = series.chart,
drilldown = chart.options.drilldown,
i = (drilldown.series || []).length,
seriesOptions;
if (!chart.ddDupes) {
chart.ddDupes = [];
}
while (i-- && !seriesOptions) {
if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, chart.ddDupes) === -1) {
seriesOptions = drilldown.series[i];
chart.ddDupes.push(this.drilldown);
}
}
// 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,
category: category,
originalEvent: originalEvent,
points: category !== undefined && this.series.xAxis.getDDPoints(category).slice(0)
}, function(e) {
var chart = e.point.series && e.point.series.chart,
seriesOptions = e.seriesOptions;
if (chart && seriesOptions) {
if (_holdRedraw) {
chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
} else {
chart.addSeriesAsDrilldown(e.point, seriesOptions);
}
}
});
};
/**
* Drill down to a given category. This is the same as clicking on an axis label.
*/
H.Axis.prototype.drilldownCategory = function(x, e) {
var key,
point,
ddPointsX = this.getDDPoints(x);
for (key in ddPointsX) {
point = ddPointsX[key];
if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
point.doDrilldown(true, x, e);
}
}
this.chart.applyDrilldown();
};
/**
* Return drillable points for this specific X value
*/
H.Axis.prototype.getDDPoints = function(x) {
var ret = [];
each(this.series, function(series) {
var i,
xData = series.xData,
points = series.points;
for (i = 0; i < xData.length; i++) {
if (xData[i] === x && series.options.data[i].drilldown) {
ret.push(points ? points[i] : true);
break;
}
}
});
return ret;
};
/**
* Make a tick label drillable, or remove drilling on update
*/
Tick.prototype.drillable = function() {
var pos = this.pos,
label = this.label,
axis = this.axis,
isDrillable = axis.coll === 'xAxis' && axis.getDDPoints,
ddPointsX = isDrillable && axis.getDDPoints(pos);
if (isDrillable) {
if (label && ddPointsX.length) {
label.drillable = true;
label
.addClass('highcharts-drilldown-axis-label')
.on('click', function(e) {
axis.drilldownCategory(pos, e);
});
} else if (label && label.drillable) {
label.on('click', null); // #3806
label.removeClass('highcharts-drilldown-axis-label');
}
}
};
/**
* Always keep the drillability updated (#3951)
*/
wrap(Tick.prototype, 'addLabel', function(proceed) {
proceed.call(this);
this.drillable();
});
/**
* On initialization of each point, identify its label and make it clickable. Also, provide a
* list of points associated to that label.
*/
wrap(H.Point.prototype, 'init', function(proceed, series, options, x) {
var point = proceed.call(this, series, options, x),
xAxis = series.xAxis,
tick = xAxis && xAxis.ticks[x];
if (point.drilldown) {
// Add the click event to the point
H.addEvent(point, 'click', function(e) {
if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
series.xAxis.drilldownCategory(x, e);
} else {
point.doDrilldown(undefined, undefined, e);
}
});
/*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
if (!this.hasImportedEvents) {
proceed.call(this);
H.addEvent(this, 'click', function () {
this.doDrilldown();
});
}
});*/
}
// Add or remove click handler and style on the tick label
if (tick) {
tick.drillable();
}
return point;
});
wrap(H.Series.prototype, 'drawDataLabels', function(proceed) {
var css = this.chart.options.drilldown.activeDataLabelStyle,
renderer = this.chart.renderer;
proceed.call(this);
each(this.points, function(point) {
var pointCSS = {};
if (point.drilldown && point.dataLabel) {
if (css.color === 'contrast') {
pointCSS.color = renderer.getContrast(point.color || this.color);
}
point.dataLabel
.addClass('highcharts-drilldown-data-label');
}
}, this);
});
// 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.addClass('highcharts-drilldown-point');
}
});
};
for (type in seriesTypes) {
if (seriesTypes[type].prototype.supportsDrilldown) {
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
}
}
}(Highcharts));
}));

View File

@@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Exporting module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(f){var q=f.defaultOptions,w=f.doc,A=f.Chart,y=f.addEvent,F=f.removeEvent,G=f.fireEvent,x=f.createElement,B=f.discardElement,H=f.css,p=f.merge,C=f.pick,u=f.each,v=f.extend,I=f.splat,z=f.win,D=f.SVGRenderer,J=f.Renderer.prototype.symbols;v(q.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"});q.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};q.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-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(a,b,d){var e;a=x("form",p({method:"post",action:a,enctype:"multipart/form-data"},d),{display:"none"},w.body);for(e in b)x("input",{type:"hidden",name:e,value:b[e]},
null,a);a.submit();B(a)};v(A.prototype,{sanitizeSVG:function(a){return a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?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(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad")},getChartHTML:function(){this.inlineStyles();return this.container.innerHTML},getSVG:function(a){var b=this,d,e,g,E,k,c=p(b.options,a),l=c.exporting.allowHTML;w.createElementNS||(w.createElementNS=function(a,b){return w.createElement(b)});e=x("div",null,{position:"absolute",top:"-9999em",width:b.chartWidth+"px",height:b.chartHeight+"px"},w.body);g=b.renderTo.style.width;k=b.renderTo.style.height;g=c.exporting.sourceWidth||
c.chart.width||/px$/.test(g)&&parseInt(g,10)||600;k=c.exporting.sourceHeight||c.chart.height||/px$/.test(k)&&parseInt(k,10)||400;v(c.chart,{animation:!1,renderTo:e,forExport:!0,renderer:"SVGRenderer",width:g,height:k});c.exporting.enabled=!1;delete c.data;c.series=[];u(b.series,function(a){E=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});E.isInternal||c.series.push(E)});a&&u(["xAxis","yAxis"],function(b){u(I(a[b]),function(a,e){c[b][e]=p(c[b][e],a)})});d=
new f.Chart(c,b.callback);u(["xAxis","yAxis"],function(a){u(b[a],function(b,e){var c=d[a][e],l=b.getExtremes(),g=l.userMin,l=l.userMax;!c||void 0===g&&void 0===l||c.setExtremes(g,l,!0,!1)})});g=d.getChartHTML();c=null;d.destroy();B(e);l&&(e=g.match(/<\/svg>(.*?$)/))&&(e='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+e[1]+"</body></foreignObject>",g=g.replace("</svg>",e+"</svg>"));g=this.sanitizeSVG(g);return g=g.replace(/(url\(#highcharts-[0-9]+)&quot;/g,
"$1").replace(/&quot;/g,"'")},getSVGForExport:function(a,b){var d=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},d.chartOptions,b,{exporting:{sourceWidth:a&&a.sourceWidth||d.sourceWidth,sourceHeight:a&&a.sourceHeight||d.sourceHeight}}))},exportChart:function(a,b){var d=this.getSVGForExport(a,b);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:d},a.formAttributes)},print:function(){var a=this,b=a.container,
d=[],e=b.parentNode,g=w.body,f=g.childNodes,k=a.options.exporting.printMaxWidth,c,l;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);G(a,"beforePrint");if(l=k&&a.chartWidth>k)c=[a.options.chart.width,void 0,!1],a.setSize(k,void 0,!1);u(f,function(a,b){1===a.nodeType&&(d[b]=a.style.display,a.style.display="none")});g.appendChild(b);z.focus();z.print();setTimeout(function(){e.appendChild(b);u(f,function(a,b){1===a.nodeType&&(a.style.display=d[b])});a.isPrinting=!1;l&&a.setSize.apply(a,c);G(a,
"afterPrint")},1E3)}},contextMenu:function(a,b,d,e,g,f,k){var c=this,l=c.chartWidth,h=c.chartHeight,m="cache-"+a,n=c[m],r=Math.max(g,f),t,p,q,v=function(b){c.pointer.inClass(b.target,a)||p()};n||(c[m]=n=x("div",{className:a},{position:"absolute",zIndex:1E3,padding:r+"px"},c.container),t=x("div",{className:"highcharts-menu"},null,n),p=function(){H(n,{display:"none"});k&&k.setState(0);c.openMenu=!1},y(n,"mouseleave",function(){q=setTimeout(p,500)}),y(n,"mouseenter",function(){clearTimeout(q)}),y(w,
"mouseup",v),y(c,"destroy",function(){F(w,"mouseup",v)}),u(b,function(a){if(a){var b;b=a.separator?x("hr",null,null,t):x("div",{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();p();a.onclick&&a.onclick.apply(c,arguments)},innerHTML:a.text||c.options.lang[a.textKey]},null,t);c.exportDivElements.push(b)}}),c.exportDivElements.push(t,n),c.exportMenuWidth=n.offsetWidth,c.exportMenuHeight=n.offsetHeight);b={display:"block"};d+c.exportMenuWidth>l?b.right=l-d-g-r+"px":b.left=d-
r+"px";e+f+c.exportMenuHeight>h&&"top"!==k.alignOptions.verticalAlign?b.bottom=h-e-r+"px":b.top=e+f-r+"px";H(n,b);c.openMenu=!0},addButton:function(a){var b=this,d=b.renderer,e=p(b.options.navigation.buttonOptions,a),g=e.onclick,f=e.menuItems,k,c,l=e.symbolSize||12;b.btnCount||(b.btnCount=0);b.exportDivElements||(b.exportDivElements=[],b.exportSVGElements=[]);if(!1!==e.enabled){var h=e.theme,m=h.states,n=m&&m.hover,m=m&&m.select,r;delete h.states;g?r=function(a){a.stopPropagation();g.call(b,a)}:f&&
(r=function(){b.contextMenu(c.menuClassName,f,c.translateX,c.translateY,c.width,c.height,c);c.setState(2)});e.text&&e.symbol?h.paddingLeft=C(h.paddingLeft,25):e.text||v(h,{width:e.width,height:e.height,padding:0});c=d.button(e.text,0,0,r,h,n,m).addClass(a.className).attr({title:b.options.lang[e._titleKey],zIndex:3});c.menuClassName=a.menuClassName||"highcharts-menu-"+b.btnCount++;e.symbol&&(k=d.symbol(e.symbol,e.symbolX-l/2,e.symbolY-l/2,l,l).addClass("highcharts-button-symbol").attr({zIndex:1}).add(c));
c.add().align(v(e,{width:c.width,x:C(e.x,b.buttonOffset)}),!0,"spacingBox");b.buttonOffset+=(c.width+e.buttonSpacing)*("right"===e.align?-1:1);b.exportSVGElements.push(c,k)}},destroyExport:function(a){var b=a?a.target:this;a=b.exportSVGElements;var d=b.exportDivElements;a&&(u(a,function(a,d){a&&(a.onclick=a.ontouchstart=null,b.exportSVGElements[d]=a.destroy())}),a.length=0);d&&(u(d,function(a,d){F(a,"mouseleave");b.exportDivElements[d]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null;B(a)}),
d.length=0)}});D.prototype.inlineToAttributes="fill stroke strokeLinecap strokeLinejoin strokeWidth textAnchor x y".split(" ");D.prototype.inlineBlacklist=[/-/,/^(clipPath|cssText|d|height|width)$/,/^font$/,/[lL]ogical(Width|Height)$/,/perspective/,/TapHighlightColor/,/^transition/];D.prototype.unstyledElements=["clipPath","defs","desc"];A.prototype.inlineStyles=function(){function a(a){return a.replace(/([A-Z])/g,function(a,b){return"-"+b.toLowerCase()})}function b(d){var h,m,n,r="",t,v;if(1===d.nodeType&&
-1===q.indexOf(d.nodeName)){m=z.getComputedStyle(d,null);n="svg"===d.nodeName?{}:z.getComputedStyle(d.parentNode,null);k[d.nodeName]||(c||(c=w.createElementNS(f.SVG_NS,"svg"),c.setAttribute("version","1.1"),w.body.appendChild(c)),t=w.createElementNS(d.namespaceURI,d.nodeName),c.appendChild(t),k[d.nodeName]=p(z.getComputedStyle(t,null)),c.removeChild(t));for(h in m){t=!1;for(v=g.length;v--&&!t;)t=g[v].test(h)||"function"===typeof m[h];t||n[h]!==m[h]&&k[d.nodeName][h]!==m[h]&&(-1!==e.indexOf(h)?d.setAttribute(a(h),
m[h]):r+=a(h)+":"+m[h]+";")}r&&(h=d.getAttribute("style"),d.setAttribute("style",(h?h+";":"")+r));"text"!==d.nodeName&&u(d.children||d.childNodes,b)}}var d=this.renderer,e=d.inlineToAttributes,g=d.inlineBlacklist,q=d.unstyledElements,k={},c;b(this.container.querySelector("svg"));c.parentNode.removeChild(c)};J.menu=function(a,b,d,e){return["M",a,b+2.5,"L",a+d,b+2.5,"M",a,b+e/2+.5,"L",a+d,b+e/2+.5,"M",a,b+e-1.5,"L",a+d,b+e-1.5]};A.prototype.renderExporting=function(){var a,b=this.options.exporting,
d=b.buttons,e=this.isDirtyExporting||!this.exportSVGElements;this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(e&&!1!==b.enabled){for(a in d)this.addButton(d[a]);this.isDirtyExporting=!1}y(this,"destroy",this.destroyExport)};A.prototype.callbacks.push(function(a){a.renderExporting();y(a,"redraw",a.renderExporting);u(["exporting","navigation"],function(b){a[b]={update:function(d,e){a.isDirtyExporting=!0;p(!0,a.options[b],d);C(e,!0)&&a.redraw()}}})})})(q)});

View File

@@ -0,0 +1,948 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var defaultOptions = H.defaultOptions,
doc = H.doc,
Chart = H.Chart,
addEvent = H.addEvent,
removeEvent = H.removeEvent,
fireEvent = H.fireEvent,
createElement = H.createElement,
discardElement = H.discardElement,
css = H.css,
merge = H.merge,
pick = H.pick,
each = H.each,
extend = H.extend,
splat = H.splat,
isTouchDevice = H.isTouchDevice,
win = H.win,
SVGRenderer = H.SVGRenderer;
var symbols = H.Renderer.prototype.symbols;
// 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 = {
buttonOptions: {
theme: {},
symbolSize: 14,
symbolX: 12.5,
symbolY: 10.5,
align: 'right',
buttonSpacing: 3,
height: 22,
// text: null,
verticalAlign: 'top',
width: 24
}
};
// Add the export related options
defaultOptions.exporting = {
//enabled: true,
//filename: 'chart',
type: 'image/png',
url: 'https://export.highcharts.com/',
//width: undefined,
printMaxWidth: 780,
scale: 2,
buttons: {
contextButton: {
className: 'highcharts-contextbutton',
menuClassName: 'highcharts-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&lt;')
.replace(/>/g, '&gt;');
doc.body.innerHTML = '<pre>' + svg + '</pre>';
}
} // */
]
}
}
};
// Add the H.post utility
H.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, {
/**
* A collection of regex fixes on the produces SVG to account for expando properties,
* browser bugs, VML problems and other. Returns a cleaned SVG.
*/
sanitizeSVG: function(svg) {
svg = svg
.replace(/zIndex="[^"]+"/g, '')
.replace(/isShadow="[^"]+"/g, '')
.replace(/symbolName="[^"]+"/g, '')
.replace(/jQuery[0-9]+="[^"]+"/g, '')
.replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g, 'url($2)')
.replace(/url\([^#]+#/g, 'url(#')
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
.replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
.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(/&nbsp;/g, '\u00A0') // no-break space
.replace(/&shy;/g, '\u00AD'); // soft hyphen
return svg;
},
/**
* Return innerHTML of chart. Used as hook for plugins.
*/
getChartHTML: function() {
this.inlineStyles();
return this.container.innerHTML;
},
/**
* 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,
html,
options = merge(chart.options, additionalOptions), // copy the options and add extra options
allowHTML = options.exporting.allowHTML;
// IE compatibility hack for generating SVG content that it doesn't really understand
if (!doc.createElementNS) {
doc.createElementNS = function(ns, tagName) {
return doc.createElement(tagName);
};
}
// 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,
renderer: 'SVGRenderer',
width: sourceWidth,
height: sourceHeight
});
options.exporting.enabled = false; // hide buttons in print
delete options.data; // #3004
// prepare for replicating the chart
options.series = [];
each(chart.series, function(serie) {
seriesOptions = merge(serie.userOptions, { // #4912
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);
}
});
// Axis options must be merged in one by one, since it may be an array or an object (#2022, #3900)
if (additionalOptions) {
each(['xAxis', 'yAxis'], function(axisType) {
each(splat(additionalOptions[axisType]), function(axisOptions, i) {
options[axisType][i] = merge(options[axisType][i], axisOptions);
});
});
}
// generate the chart copy
chartCopy = new H.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.getChartHTML();
// free up memory
options = null;
chartCopy.destroy();
discardElement(sandbox);
// Move HTML into a foreignObject
if (allowHTML) {
html = svg.match(/<\/svg>(.*?$)/);
if (html) {
html = '<foreignObject x="0" y="0" width="200" height="200">' +
'<body xmlns="http://www.w3.org/1999/xhtml">' +
html[1] +
'</body>' +
'</foreignObject>';
svg = svg.replace('</svg>', html + '</svg>');
}
}
// sanitize
svg = this.sanitizeSVG(svg);
// IE9 beta bugs with innerHTML. Test again with final IE9.
svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
.replace(/&quot;/g, '\'');
return svg;
},
getSVGForExport: function(options, chartOptions) {
var chartExportingOptions = this.options.exporting;
return this.getSVG(merge({
chart: {
borderRadius: 0
}
},
chartExportingOptions.chartOptions,
chartOptions, {
exporting: {
sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
}
}
));
},
/**
* 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) {
var svg = this.getSVGForExport(options, chartOptions);
// merge the options
options = merge(this.options.exporting, options);
// do the post
H.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,
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,
printMaxWidth = chart.options.exporting.printMaxWidth,
resetParams,
handleMaxWidth;
if (chart.isPrinting) { // block the button while in printing mode
return;
}
chart.isPrinting = true;
chart.pointer.reset(null, 0);
fireEvent(chart, 'beforePrint');
// Handle printMaxWidth
handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
if (handleMaxWidth) {
resetParams = [chart.options.chart.width, undefined, false];
chart.setSize(printMaxWidth, undefined, false);
}
// 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;
// Reset printMaxWidth
if (handleMaxWidth) {
chart.setSize.apply(chart, resetParams);
}
fireEvent(chart, 'afterPrint');
}, 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,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
cacheName = 'cache-' + className,
menu = chart[cacheName],
menuPadding = Math.max(width, height), // for mouse leave detection
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', {
className: 'highcharts-menu'
}, null, 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(doc, 'mouseup', docMouseUpHandler);
addEvent(chart, 'destroy', function() {
removeEvent(doc, 'mouseup', docMouseUpHandler);
});
// create the items
each(items, function(item) {
if (item) {
var element;
if (item.separator) {
element = createElement('hr', null, null, innerMenu);
} else {
element = createElement('div', {
className: 'highcharts-menu-item',
onclick: function(e) {
if (e) { // IE7
e.stopPropagation();
}
hide();
if (item.onclick) {
item.onclick.apply(chart, arguments);
}
},
innerHTML: item.text || chart.options.lang[item.textKey]
}, null, 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,
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(e) {
e.stopPropagation();
onclick.call(chart, e);
};
} 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 = 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)
.addClass(options.className)
.attr({
title: chart.options.lang[btnOptions._titleKey],
zIndex: 3 // #4955
});
button.menuClassName = options.menuClassName || 'highcharts-menu-' + chart.btnCount++;
if (btnOptions.symbol) {
symbol = renderer.symbol(
btnOptions.symbol,
btnOptions.symbolX - (symbolSize / 2),
btnOptions.symbolY - (symbolSize / 2),
symbolSize,
symbolSize
)
.addClass('highcharts-button-symbol')
.attr({
zIndex: 1
}).add(button);
}
button.add()
.align(extend(btnOptions, {
width: button.width,
x: pick(btnOptions.x, chart.buttonOffset) // #1654
}), true, 'spacingBox');
chart.buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
chart.exportSVGElements.push(button, symbol);
},
/**
* Destroy the buttons.
*/
destroyExport: function(e) {
var chart = e ? e.target : this,
exportSVGElements = chart.exportSVGElements,
exportDivElements = chart.exportDivElements;
// Destroy the extra buttons added
if (exportSVGElements) {
each(exportSVGElements, function(elem, i) {
// Destroy and null the svg/vml elements
if (elem) { // #1822
elem.onclick = elem.ontouchstart = null;
chart.exportSVGElements[i] = elem.destroy();
}
});
exportSVGElements.length = 0;
}
// Destroy the divs for the menu
if (exportDivElements) {
each(exportDivElements, function(elem, 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);
});
exportDivElements.length = 0;
}
}
});
// These ones are translated to attributes rather than styles
SVGRenderer.prototype.inlineToAttributes = [
'fill',
'stroke',
'strokeLinecap',
'strokeLinejoin',
'strokeWidth',
'textAnchor',
'x',
'y'
];
// These CSS properties are not inlined. Remember camelCase.
SVGRenderer.prototype.inlineBlacklist = [
/-/, // In Firefox, both hyphened and camelCased names are listed
/^(clipPath|cssText|d|height|width)$/, // Full words
/^font$/, // more specific props are set
/[lL]ogical(Width|Height)$/,
/perspective/,
/TapHighlightColor/,
/^transition/
// /^text (border|color|cursor|height|webkitBorder)/
];
SVGRenderer.prototype.unstyledElements = [
'clipPath',
'defs',
'desc'
];
/**
* Analyze inherited styles from stylesheets and add them inline
*
* @todo: What are the border styles for text about? In general, text has a lot of properties.
* @todo: Make it work with IE9 and IE10.
*/
Chart.prototype.inlineStyles = function() {
var renderer = this.renderer,
inlineToAttributes = renderer.inlineToAttributes,
blacklist = renderer.inlineBlacklist,
unstyledElements = renderer.unstyledElements,
defaultStyles = {},
dummySVG;
/**
* Make hyphenated property names out of camelCase
*/
function hyphenate(prop) {
return prop.replace(
/([A-Z])/g,
function(a, b) {
return '-' + b.toLowerCase();
}
);
}
/**
* Call this on all elements and recurse to children
*/
function recurse(node) {
var prop,
styles,
parentStyles,
cssText = '',
dummy,
styleAttr,
blacklisted,
i;
if (node.nodeType === 1 && unstyledElements.indexOf(node.nodeName) === -1) {
styles = win.getComputedStyle(node, null);
parentStyles = node.nodeName === 'svg' ? {} : win.getComputedStyle(node.parentNode, null);
// Get default styles from the browser so that we don't have to add these
if (!defaultStyles[node.nodeName]) {
if (!dummySVG) {
dummySVG = doc.createElementNS(H.SVG_NS, 'svg');
dummySVG.setAttribute('version', '1.1');
doc.body.appendChild(dummySVG);
}
dummy = doc.createElementNS(node.namespaceURI, node.nodeName);
dummySVG.appendChild(dummy);
defaultStyles[node.nodeName] = merge(win.getComputedStyle(dummy, null)); // Copy, so we can remove the node
dummySVG.removeChild(dummy);
}
// Loop over all the computed styles and check whether they are in the
// white list for styles or atttributes.
for (prop in styles) {
// Check against blacklist
blacklisted = false;
i = blacklist.length;
while (i-- && !blacklisted) {
blacklisted = blacklist[i].test(prop) || typeof styles[prop] === 'function';
}
if (!blacklisted) {
// If parent node has the same style, it gets inherited, no need to inline it
if (parentStyles[prop] !== styles[prop] && defaultStyles[node.nodeName][prop] !== styles[prop]) {
// Attributes
if (inlineToAttributes.indexOf(prop) !== -1) {
node.setAttribute(hyphenate(prop), styles[prop]);
// Styles
} else {
cssText += hyphenate(prop) + ':' + styles[prop] + ';';
}
}
}
}
// Apply styles
if (cssText) {
styleAttr = node.getAttribute('style');
node.setAttribute('style', (styleAttr ? styleAttr + ';' : '') + cssText);
}
if (node.nodeName === 'text') {
return;
}
// Recurse
each(node.children || node.childNodes, recurse);
}
}
/**
* Remove the dummy objects used to get defaults
*/
function tearDown() {
dummySVG.parentNode.removeChild(dummySVG);
}
recurse(this.container.querySelector('svg'));
tearDown();
};
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.renderExporting = function() {
var n,
exportingOptions = this.options.exporting,
buttons = exportingOptions.buttons,
isDirty = this.isDirtyExporting || !this.exportSVGElements;
this.buttonOffset = 0;
if (this.isDirtyExporting) {
this.destroyExport();
}
if (isDirty && exportingOptions.enabled !== false) {
for (n in buttons) {
this.addButton(buttons[n]);
}
this.isDirtyExporting = false;
}
// Destroy the export elements at chart destroy
addEvent(this, 'destroy', this.destroyExport);
};
Chart.prototype.callbacks.push(function(chart) {
function update(prop, options, redraw) {
chart.isDirtyExporting = true;
merge(true, chart.options[prop], options);
if (pick(redraw, true)) {
chart.redraw();
}
}
chart.renderExporting();
addEvent(chart, 'redraw', chart.renderExporting);
// Add update methods to handle chart.update and chart.exporting.update
// and chart.navigation.update.
each(['exporting', 'navigation'], function(prop) {
chart[prop] = {
update: function(options, redraw) {
update(prop, options, redraw);
}
};
});
});
}(Highcharts));
}));

View File

@@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Highcharts funnel module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(c){"object"===typeof module&&module.exports?module.exports=c:c(Highcharts)})(function(c){(function(c){var n=c.seriesType,z=c.seriesTypes,F=c.noop,G=c.each;n("funnel","pie",{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0},{animate:F,translate:function(){var b=function(a,b){return/%$/.test(a)?b*parseInt(a,10)/100:parseInt(a,10)},c=0,e=this.chart,d=this.options,r=d.reversed,H=d.ignoreHiddenPoint,t=e.plotWidth,e=e.plotHeight,
p=0,n=d.center,f=b(n[0],t),q=b(n[1],e),z=b(d.width,t),h,v,k=b(d.height,e),w=b(d.neckWidth,t),D=b(d.neckHeight,e),x=q-k/2+k-D,b=this.data,A,B,I="left"===d.dataLabels.position?1:0,C,l,E,u,g,y,m;this.getWidthAt=v=function(a){var b=q-k/2;return a>x||k===D?w:w+(z-w)*(1-(a-b)/(k-D))};this.getX=function(a,b){return f+(b?-1:1)*(v(r?2*q-a:a)/2+d.dataLabels.distance)};this.center=[f,q,k];this.centerX=f;G(b,function(a){H&&!1===a.visible||(c+=a.y)});G(b,function(a){m=null;B=c?a.y/c:0;l=q-k/2+p*k;g=l+B*k;h=v(l);
C=f-h/2;E=C+h;h=v(g);u=f-h/2;y=u+h;l>x?(C=u=f-w/2,E=y=f+w/2):g>x&&(m=g,h=v(x),u=f-h/2,y=u+h,g=x);r&&(l=2*q-l,g=2*q-g,m=m?2*q-m:null);A=["M",C,l,"L",E,l,y,g];m&&A.push(y,m,u,m);A.push(u,g,"Z");a.shapeType="path";a.shapeArgs={d:A};a.percentage=100*B;a.plotX=f;a.plotY=(l+(m||g))/2;a.tooltipPos=[f,a.plotY];a.slice=F;a.half=I;H&&!1===a.visible||(p+=B)})},drawPoints:z.column.prototype.drawPoints,sortByAngle:function(b){b.sort(function(b,c){return b.plotY-c.plotY})},drawDataLabels:function(){var b=this.data,
c=this.options.dataLabels.distance,e,d,r,n=b.length,t,p;for(this.center[2]-=2*c;n--;)r=b[n],d=(e=r.half)?1:-1,p=r.plotY,t=this.getX(p,e),r.labelPos=[0,p,t+(c-5)*d,p,t+c*d,p,e?"right":"left",0];z.pie.prototype.drawDataLabels.call(this)}});n("pyramid","funnel",{neckWidth:"0%",neckHeight:"0%",reversed:!0})})(c)});

View File

@@ -0,0 +1,290 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var seriesType = Highcharts.seriesType,
seriesTypes = Highcharts.seriesTypes,
noop = Highcharts.noop,
each = Highcharts.each;
seriesType('funnel', 'pie', {
animation: false,
center: ['50%', '50%'],
width: '90%',
neckWidth: '30%',
height: '100%',
neckHeight: '25%',
reversed: false,
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
},
// Properties
{
animate: noop,
/**
* 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,
ignoreHiddenPoint = options.ignoreHiddenPoint,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
cumulative = 0, // start at top
center = options.center,
centerX = getLength(center[0], plotWidth),
centerY = getLength(center[1], plotHeight),
width = getLength(options.width, plotWidth),
tempWidth,
getWidthAt,
height = getLength(options.height, plotHeight),
neckWidth = getLength(options.neckWidth, plotWidth),
neckHeight = getLength(options.neckHeight, plotHeight),
neckY = (centerY - height / 2) + 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) {
var top = (centerY - height / 2);
return y > neckY || height === neckHeight ?
neckWidth :
neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight));
};
series.getX = function(y, half) {
return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - 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) {
if (!ignoreHiddenPoint || point.visible !== false) {
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 = 2 * centerY - y1;
y3 = 2 * centerY - y3;
y5 = (y5 ? 2 * centerY - 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;
if (!ignoreHiddenPoint || point.visible !== false) {
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: seriesTypes.column.prototype.drawPoints,
/**
* 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.
*/
seriesType('pyramid', 'funnel', {
neckWidth: '0%',
neckHeight: '0%',
reversed: true
});
}(Highcharts));
}));

View File

@@ -0,0 +1,24 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(b){var g=b.Axis,t=b.Chart,k=b.color,p,e=b.each,v=b.extend,w=b.isNumber,n=b.Legend,l=b.LegendSymbolMixin,x=b.noop,r=b.merge,u=b.pick,m=b.wrap;p=b.ColorAxis=function(){this.init.apply(this,arguments)};v(p.prototype,g.prototype);v(p.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},
width:.01},labels:{overflow:"justify"},minColor:"#e6ebf5",maxColor:"#003399",tickLength:5,showInLegend:!0},init:function(a,c){var d="vertical"!==a.options.legend.layout,f;this.coll="colorAxis";f=r(this.defaultColorAxisOptions,{side:d?2:1,reversed:!d},c,{opposite:!d,showEmpty:!1,title:null});g.prototype.init.call(this,a,f);c.dataClasses&&this.initDataClasses(c);this.initStops(c);this.horiz=d;this.zoomEnabled=!1;this.defaultLegendLength=200},tweenColors:function(a,c,d){var f;c.rgba.length&&a.rgba.length?
(a=a.rgba,c=c.rgba,f=1!==c[3]||1!==a[3],a=(f?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-d))+","+Math.round(c[1]+(a[1]-c[1])*(1-d))+","+Math.round(c[2]+(a[2]-c[2])*(1-d))+(f?","+(c[3]+(a[3]-c[3])*(1-d)):"")+")"):a=c.input||"none";return a},initDataClasses:function(a){var c=this,d,f=0,h=this.chart.options.chart.colorCount,b=this.options,y=a.dataClasses.length;this.dataClasses=d=[];this.legendItems=[];e(a.dataClasses,function(a,l){a=r(a);d.push(a);a.color||("category"===b.dataClassColor?(a.colorIndex=
f,f++,f===h&&(f=0)):a.color=c.tweenColors(k(b.minColor),k(b.maxColor),2>y?.5:l/(y-1)))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];e(this.stops,function(a){a.color=k(a[1])})},setOptions:function(a){g.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker},setAxisSize:function(){var a=this.legendSymbol,c=this.chart,d=c.options.legend||{},f,h;a?(this.left=d=a.attr("x"),this.top=f=a.attr("y"),this.width=h=a.attr("width"),this.height=
a=a.attr("height"),this.right=c.chartWidth-d-h,this.bottom=c.chartHeight-f-a,this.len=this.horiz?h:a,this.pos=this.horiz?d:f):this.len=(this.horiz?d.symbolWidth:d.symbolHeight)||this.defaultLegendLength},toColor:function(a,c){var d,f=this.stops,h,b=this.dataClasses,l,e;if(b)for(e=b.length;e--;){if(l=b[e],h=l.from,f=l.to,(void 0===h||a>=h)&&(void 0===f||a<=f)){d=l.color;c&&(c.dataClass=e,c.colorIndex=l.colorIndex);break}}else{this.isLog&&(a=this.val2lin(a));d=1-(this.max-a)/(this.max-this.min||1);
for(e=f.length;e--&&!(d>f[e][0]););h=f[e]||f[e+1];f=f[e+1]||h;d=1-(f[0]-d)/(f[0]-h[0]||1);d=this.tweenColors(h.color,f.color,d)}return d},getOffset:function(){var a=this.legendGroup,c=this.chart.axisOffset[this.side];a&&(this.axisParent=a,g.prototype.getOffset.call(this),this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width),this.chart.axisOffset[this.side]=c)},setLegendColor:function(){var a,c=this.options,d=this.reversed;a=d?1:0;d=d?0:1;a=this.horiz?[a,0,d,0]:[0,d,0,a];this.legendColor=
{linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]},stops:c.stops||[[0,c.minColor],[1,c.maxColor]]}},drawLegendSymbol:function(a,c){var d=a.padding,f=a.options,h=this.horiz,b=u(f.symbolWidth,h?this.defaultLegendLength:12),e=u(f.symbolHeight,h?12:this.defaultLegendLength),l=u(f.labelPadding,h?16:30),f=u(f.itemDistance,10);this.setLegendColor();c.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,b,e).attr({zIndex:1}).add(c.legendGroup);this.legendItemWidth=b+d+(h?f:l);this.legendItemHeight=e+d+(h?
l:0)},setState:x,visible:!0,setVisible:x,getSeriesExtremes:function(){var a;this.series.length&&(a=this.series[0],this.dataMin=a.valueMin,this.dataMax=a.valueMax)},drawCrosshair:function(a,c){var d=c&&c.plotX,f=c&&c.plotY,b,e=this.pos,l=this.len;c&&(b=this.toPixels(c[c.series.colorKey]),b<e?b=e-2:b>e+l&&(b=e+l+2),c.plotX=b,c.plotY=this.len-b,g.prototype.drawCrosshair.call(this,a,c),c.plotX=d,c.plotY=f,this.cross&&this.cross.addClass("highcharts-coloraxis-marker").add(this.legendGroup))},getPlotLinePath:function(a,
c,d,b,e){return w(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"]:g.prototype.getPlotLinePath.call(this,a,c,d,b)},update:function(a,c){var d=this.chart,b=d.legend;e(this.series,function(a){a.isDirtyData=!0});a.dataClasses&&b.allItems&&(e(b.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),d.isDirtyLegend=!0);d.options[this.coll]=r(this.userOptions,a);g.prototype.update.call(this,a,c);this.legendItem&&(this.setLegendColor(),
b.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a=this,c=this.chart,d=this.legendItems,f=c.options.legend,h=f.valueDecimals,p=f.valueSuffix||"",m;d.length||e(this.dataClasses,function(f,n){var g=!0,r=f.from,k=f.to;m="";void 0===r?m="< ":void 0===k&&(m="> ");void 0!==r&&(m+=b.numberFormat(r,h)+p);void 0!==r&&void 0!==k&&(m+=" - ");void 0!==k&&(m+=b.numberFormat(k,h)+p);d.push(v({chart:c,name:m,options:{},drawLegendSymbol:l.drawRectangle,visible:!0,setState:x,isDataClass:!0,setVisible:function(){g=
this.visible=!g;e(a.series,function(a){e(a.points,function(a){a.dataClass===n&&a.setVisible(g)})});c.legend.colorizeItem(this,g)}},f))});return d},name:""});e(["fill","stroke"],function(a){b.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,p.prototype.tweenColors(k(this.start),k(this.end),this.pos))}});m(t.prototype,"getAxes",function(a){var c=this.options.colorAxis;a.call(this);this.colorAxis=[];c&&new p(this,c)});m(n.prototype,"getAllItems",function(a){var c=[],d=this.chart.colorAxis[0];d&&
d.options&&(d.options.showInLegend&&(d.options.dataClasses?c=c.concat(d.getDataClassLegendSymbols()):c.push(d)),e(d.series,function(a){a.options.showInLegend=!1}));return c.concat(a.call(this))});m(n.prototype,"colorizeItem",function(a,c,d){a.call(this,c,d);d&&c.legendColor&&c.legendSymbol.attr({fill:c.legendColor})})})(q);(function(b){var g=b.defined,t=b.each,k=b.noop;b.colorPointMixin={setVisible:function(b){var e=this,g=b?"show":"hide";t(["graphic","dataLabel"],function(b){if(e[b])e[b][g]()})}};
b.colorSeriesMixin={pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:k,parallelArrays:["x","y","value"],colorKey:"value",translateColors:function(){var b=this,e=this.options.nullColor,g=this.colorAxis,k=this.colorKey;t(this.data,function(n){var l=n[k];if(l=n.options.color||(null===l?e:g&&void 0!==l?g.toColor(l,n):n.color||b.color))n.color=l})},colorAttribs:function(b){var e={};g(b.color)&&(e[this.colorProp||
"fill"]=b.color);return e}}})(q);(function(b){var g=b.colorPointMixin,t=b.each,k=b.merge,p=b.noop,e=b.pick,q=b.Series,w=b.seriesType,n=b.seriesTypes;w("heatmap","scatter",{animation:!1,borderWidth:0,dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{halo:!1,brightness:.2}}},k(b.colorSeriesMixin,{pointArrayMap:["y",
"value"],hasPointSpecificOptions:!0,supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var b;n.scatter.prototype.init.apply(this,arguments);b=this.options;b.pointRange=e(b.pointRange,b.colsize||1);this.yAxis.axisPointRange=b.rowsize||1},translate:function(){var b=this.options,e=this.xAxis,g=this.yAxis,k=function(b,a,c){return Math.min(Math.max(a,b),c)};this.generatePoints();t(this.points,function(m){var a=(b.colsize||1)/2,c=(b.rowsize||1)/2,d=k(Math.round(e.len-e.translate(m.x-
a,0,1,0,1)),-e.len,2*e.len),a=k(Math.round(e.len-e.translate(m.x+a,0,1,0,1)),-e.len,2*e.len),f=k(Math.round(g.translate(m.y-c,0,1,0,1)),-g.len,2*g.len),c=k(Math.round(g.translate(m.y+c,0,1,0,1)),-g.len,2*g.len);m.plotX=m.clientX=(d+a)/2;m.plotY=(f+c)/2;m.shapeType="rect";m.shapeArgs={x:Math.min(d,a),y:Math.min(f,c),width:Math.abs(a-d),height:Math.abs(c-f)}});this.translateColors()},drawPoints:function(){n.column.prototype.drawPoints.call(this);t(this.points,function(b){b.graphic.attr(this.colorAttribs(b,
b.state))},this)},animate:p,getBox:p,drawLegendSymbol:b.LegendSymbolMixin.drawRectangle,alignDataLabel:n.column.prototype.alignDataLabel,getExtremes:function(){q.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;q.prototype.getExtremes.call(this)}}),g)})(q)});

View File

@@ -0,0 +1,762 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var Axis = H.Axis,
Chart = H.Chart,
color = H.color,
ColorAxis,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Legend = H.Legend,
LegendSymbolMixin = H.LegendSymbolMixin,
noop = H.noop,
merge = H.merge,
pick = H.pick,
wrap = H.wrap;
/**
* The ColorAxis object for inclusion in gradient legends
*/
ColorAxis = H.ColorAxis = function() {
this.init.apply(this, arguments);
};
extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
endOnTick: true,
offset: 0,
marker: {
animation: {
duration: 50
},
width: 0.01
},
labels: {
overflow: 'justify'
},
minColor: '#e6ebf5',
maxColor: '#003399',
tickLength: 5,
showInLegend: true
},
init: function(chart, userOptions) {
var horiz = chart.options.legend.layout !== 'vertical',
options;
this.coll = 'colorAxis';
// Build the options
options = merge(this.defaultColorAxisOptions, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
opposite: !horiz,
showEmpty: false,
title: null
});
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.horiz = horiz;
this.zoomEnabled = false;
// Add default values
this.defaultLegendLength = 200;
},
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color.
* NOTE: Changes here should be copied
* to the same function in drilldown.src.js and solid-gauge-src.js.
*/
tweenColors: function(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
},
initDataClasses: function(userOptions) {
var axis = this,
chart = this.chart,
dataClasses,
colorCounter = 0,
colorCount = chart.options.chart.colorCount,
options = this.options,
len = userOptions.dataClasses.length;
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') {
dataClass.colorIndex = colorCounter;
// increase and loop back to zero
colorCounter++;
if (colorCounter === colorCount) {
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(
color(options.minColor),
color(options.maxColor),
len < 2 ? 0.5 : i / (len - 1) // #3219
);
}
}
});
},
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;
},
setAxisSize: function() {
var symbol = this.legendSymbol,
chart = this.chart,
legendOptions = chart.options.legend || {},
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;
} else {
// Fake length for disabled legend to avoid tick issues and such (#5205)
this.len = (this.horiz ? legendOptions.symbolWidth : legendOptions.symbolHeight) || this.defaultLegendLength;
}
},
/**
* 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;
point.colorIndex = dataClass.colorIndex;
}
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;
},
/**
* Override the getOffset method to add the whole axis groups inside the legend.
*/
getOffset: function() {
var group = this.legendGroup,
sideOffset = this.chart.axisOffset[this.side];
if (group) {
// Hook for the getOffset method to add groups to this parent group
this.axisParent = group;
// Call the base
Axis.prototype.getOffset.call(this);
// First time only
if (!this.added) {
this.added = true;
this.labelLeft = 0;
this.labelRight = this.width;
}
// 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,
reversed = this.reversed,
one = reversed ? 1 : 0,
zero = reversed ? 0 : 1;
grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190
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,
width = pick(legendOptions.symbolWidth, horiz ? this.defaultLegendLength : 12),
height = pick(legendOptions.symbolHeight, horiz ? 12 : this.defaultLegendLength),
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);
// 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 plotX = point && point.plotX,
plotY = point && point.plotY,
crossPos,
axisPos = this.pos,
axisLen = this.len;
if (point) {
crossPos = this.toPixels(point[point.series.colorKey]);
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 (this.cross) {
this.cross
.addClass('highcharts-coloraxis-marker')
.add(this.legendGroup);
}
}
},
getPlotLinePath: function(a, b, c, d, pos) {
return isNumber(pos) ? // crosshairs only // #3969 pos can be 0 !!
(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']) :
Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
},
update: function(newOptions, redraw) {
var chart = this.chart,
legend = chart.legend;
each(this.series, function(series) {
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
});
// When updating data classes, destroy old items and make sure new ones are created (#3207)
if (newOptions.dataClasses && legend.allItems) {
each(legend.allItems, function(item) {
if (item.isDataClass) {
item.legendGroup.destroy();
}
});
chart.isDirtyLegend = true;
}
// Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is
// not an array. (#3207)
chart.options[this.coll] = merge(this.userOptions, newOptions);
Axis.prototype.update.call(this, newOptions, redraw);
if (this.legendItem) {
this.setLegendColor();
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 += H.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== undefined && to !== undefined) {
name += ' - ';
}
if (to !== undefined) {
name += H.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,
isDataClass: true,
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
});
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, ColorAxis.prototype.tweenColors(color(this.start), color(this.end), this.pos));
};
});
/**
* 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) {
new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new
}
});
/**
* 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 && colorAxis.options) {
if (colorAxis.options.showInLegend) {
// 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));
});
wrap(Legend.prototype, 'colorizeItem', function(proceed, item, visible) {
proceed.call(this, item, visible);
if (visible && item.legendColor) {
item.legendSymbol.attr({
fill: item.legendColor
});
}
});
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
each = H.each,
noop = H.noop,
seriesTypes = H.seriesTypes;
/**
* Mixin for maps and heatmaps
*/
H.colorPointMixin = {
/**
* Set the visibility of a single point
*/
setVisible: function(vis) {
var point = this,
method = vis ? 'show' : 'hide';
// Show and hide associated elements
each(['graphic', 'dataLabel'], function(key) {
if (point[key]) {
point[key][method]();
}
});
}
};
H.colorSeriesMixin = {
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 = point.options.color ||
(value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color);
if (color) {
point.color = color;
}
});
},
/**
* Get the color attibutes to apply on the graphic
*/
colorAttribs: function(point) {
var ret = {};
if (defined(point.color)) {
ret[this.colorProp || 'fill'] = point.color;
}
return ret;
}
};
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var colorPointMixin = H.colorPointMixin,
colorSeriesMixin = H.colorSeriesMixin,
each = H.each,
LegendSymbolMixin = H.LegendSymbolMixin,
merge = H.merge,
noop = H.noop,
pick = H.pick,
Series = H.Series,
seriesType = H.seriesType,
seriesTypes = H.seriesTypes;
// The Heatmap series type
seriesType('heatmap', 'scatter', {
animation: false,
borderWidth: 0,
dataLabels: {
formatter: function() { // #2945
return this.point.value;
},
inside: true,
verticalAlign: 'middle',
crop: false,
overflow: false,
padding: 0 // #3837
},
marker: null,
pointRange: null, // dynamically set to colsize by default
tooltip: {
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
},
states: {
normal: {
animation: true
},
hover: {
halo: false, // #3406, halo is not required on heatmaps
brightness: 0.2
}
}
}, merge(colorSeriesMixin, {
pointArrayMap: ['y', 'value'],
hasPointSpecificOptions: true,
supportsDrilldown: true,
getExtremesFromAll: true,
directTouch: true,
/**
* Override the init method to add point ranges on both axes.
*/
init: function() {
var options;
seriesTypes.scatter.prototype.init.apply(this, arguments);
options = this.options;
options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData
this.yAxis.axisPointRange = options.rowsize || 1; // general point range
},
translate: function() {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
between = function(x, a, b) {
return Math.min(Math.max(a, x), b);
};
series.generatePoints();
each(series.points, function(point) {
var xPad = (options.colsize || 1) / 2,
yPad = (options.rowsize || 1) / 2,
x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len),
y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len);
// Set plotX and plotY for use in K-D-Tree and more
point.plotX = point.clientX = (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();
},
drawPoints: function() {
seriesTypes.column.prototype.drawPoints.call(this);
each(this.points, function(point) {
point.graphic.attr(this.colorAttribs(point, point.state));
}, this);
},
animate: noop,
getBox: noop,
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
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);
}
}), colorPointMixin);
}(Highcharts));
}));

View File

@@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Plugin for displaying a message when there is no data visible in chart.
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?module.exports=d:d(Highcharts)})(function(d){(function(c){function d(){return!!this.points.length}function f(){this.hasData()?this.hideNoData():this.showNoData()}var g=c.seriesTypes,e=c.Chart.prototype,h=c.getOptions(),k=c.extend,l=c.each;k(h.lang,{noData:"No data to display"});h.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"}};l(["pie","gauge","waterfall","bubble","treemap"],function(a){g[a]&&(g[a].prototype.hasData=d)});c.Series.prototype.hasData=
function(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin};e.showNoData=function(a){var b=this.options;a=a||b.lang.noData;b=b.noData;this.noDataLabel||(this.noDataLabel=this.renderer.label(a,0,0,null,null,null,b.useHTML,null,"no-data"),this.noDataLabel.add(),this.noDataLabel.align(k(this.noDataLabel.getBBox(),b.position),!1,"plotBox"))};e.hideNoData=function(){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",f);c.addEvent(a,"redraw",f)})})(d)});

View File

@@ -0,0 +1,150 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesTypes = H.seriesTypes,
chartPrototype = H.Chart.prototype,
defaultOptions = H.getOptions(),
extend = H.extend,
each = H.each;
// 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'
}
// useHTML: false
};
/**
* 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 */
}
each(['pie', 'gauge', 'waterfall', 'bubble', 'treemap'], function(type) {
if (seriesTypes[type]) {
seriesTypes[type].prototype.hasData = hasDataPie;
}
});
H.Series.prototype.hasData = function() {
return this.visible && this.dataMax !== undefined && this.dataMin !== undefined; // #3703
};
/**
* 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,
noDataOptions.useHTML,
null,
'no-data'
);
chart.noDataLabel.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));
}));

View File

@@ -0,0 +1,16 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Client side exporting module
(c) 2015 Torstein Honsi / Oystein Moseng
License: www.highcharts.com/license
*/
(function(r){"object"===typeof module&&module.exports?module.exports=r:r(Highcharts)})(function(r){(function(a){function r(e,a){var c=t.getElementsByTagName("head")[0],b=t.createElement("script");b.type="text/javascript";b.src=e;b.onload=a;c.appendChild(b)}var A=a.merge,m=a.win,q=m.navigator,t=m.document,v=m.URL||m.webkitURL||m,w=/Edge\/|Trident\/|MSIE /.test(q.userAgent),B=w?150:0;a.CanVGRenderer={};a.downloadURL=function(e,a){var c=t.createElement("a"),b;if(q.msSaveOrOpenBlob)q.msSaveOrOpenBlob(e,
a);else if(void 0!==c.download)c.href=e,c.download=a,c.target="_blank",t.body.appendChild(c),c.click(),t.body.removeChild(c);else try{if(b=m.open(e,"chart"),void 0===b||null===b)throw"Failed to open window";}catch(h){m.location.href=e}};a.svgToDataUrl=function(e){var a=-1<q.userAgent.indexOf("WebKit")&&0>q.userAgent.indexOf("Chrome");try{if(!a&&0>q.userAgent.toLowerCase().indexOf("firefox"))return v.createObjectURL(new m.Blob([e],{type:"image/svg+xml;charset-utf-16"}))}catch(c){}return"data:image/svg+xml;charset=UTF-8,"+
encodeURIComponent(e)};a.imageToDataUrl=function(a,k,c,b,h,d,l,g,p){var f=new m.Image,n,u=function(){setTimeout(function(){var d=t.createElement("canvas"),u=d.getContext&&d.getContext("2d"),g;try{if(u){d.height=f.height*b;d.width=f.width*b;u.drawImage(f,0,0,d.width,d.height);try{g=d.toDataURL(k),h(g,k,c,b)}catch(m){n(a,k,c,b)}}else l(a,k,c,b)}finally{p&&p(a,k,c,b)}},B)},z=function(){g(a,k,c,b);p&&p(a,k,c,b)};n=function(){f=new m.Image;n=d;f.crossOrigin="Anonymous";f.onload=u;f.onerror=z;f.src=a};
f.onload=u;f.onerror=z;f.src=a};a.downloadSVGLocal=function(e,k,c,b,h,d){var l,g,p=!0,f,n=a.getOptions().exporting.libURL;if("image/svg+xml"===c)try{q.msSaveOrOpenBlob?(g=new MSBlobBuilder,g.append(e),l=g.getBlob("image/svg+xml")):l=a.svgToDataUrl(e),a.downloadURL(l,k),d&&d()}catch(u){h()}else l=a.svgToDataUrl(e),f=function(){try{v.revokeObjectURL(l)}catch(a){}},a.imageToDataUrl(l,c,{},b,function(b){try{a.downloadURL(b,k),d&&d()}catch(c){h()}},function(){var g=t.createElement("canvas"),l=g.getContext("2d"),
x=e.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*b,y=e.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*b,v=function(){l.drawSvg(e,0,0,x,y);try{a.downloadURL(q.msSaveOrOpenBlob?g.msToBlob():g.toDataURL(c),k),d&&d()}catch(b){h()}finally{f()}};g.width=x;g.height=y;m.canvg?v():(p=!0,n="/"!==n.substr[-1]?n+"/":n,r(n+"rgbcolor.js",function(){r(n+"canvg.js",function(){v()})}))},h,h,function(){p&&f()})};a.Chart.prototype.getSVGForLocalExport=function(e,k,c,b){var h=this,d,l=0,g,p,f,n,m=function(a,
c,e){++l;e.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);l===d.length&&b(h.sanitizeSVG(g.innerHTML))};a.wrap(a.Chart.prototype,"getChartHTML",function(a){g=this.container.cloneNode(!0);return a.apply(this,Array.prototype.slice.call(arguments,1))});h.getSVGForExport(e,k);d=g.getElementsByTagName("image");try{if(d.length)for(f=0,n=d.length;f<n;++f)p=d[f],a.imageToDataUrl(p.getAttributeNS("http://www.w3.org/1999/xlink","href"),"image/png",{imageElement:p},e.scale,m,c,c,c);else b(h.sanitizeSVG(g.innerHTML))}catch(q){c()}};
a.Chart.prototype.exportChartLocal=function(e,k){var c=this,b=a.merge(c.options.exporting,e),h=b&&b.type||"image/png",d=function(){if(!1===b.fallbackToExportServer)if(b.error)b.error();else throw"Fallback to export server disabled";else c.exportChart(b)},l=function(c){var e=(b.filename||"chart")+"."+("image/svg+xml"===h?"svg":h.split("/")[1]);a.downloadSVGLocal(c,e,h,b.scale,d)};w&&"image/svg+xml"!==h&&c.container.getElementsByTagName("image").length?d():c.getSVGForLocalExport(b,k,d,l)};A(!0,a.getOptions().exporting,
{libURL:"http://code.highcharts.com@product.cdnpath@/5.0.0/lib/",buttons:{contextButton:{menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}}]}}})})(r)});

View File

@@ -0,0 +1,424 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
/*global MSBlobBuilder */
var merge = Highcharts.merge,
win = Highcharts.win,
nav = win.navigator,
doc = win.document,
domurl = win.URL || win.webkitURL || win,
isMSBrowser = /Edge\/|Trident\/|MSIE /.test(nav.userAgent),
loadEventDeferDelay = isMSBrowser ? 150 : 0; // Milliseconds to defer image load event handlers to offset IE bug
// Dummy object so we can reuse our canvas-tools.js without errors
Highcharts.CanVGRenderer = {};
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
function getScript(scriptLocation, callback) {
var head = doc.getElementsByTagName('head')[0],
script = doc.createElement('script');
script.type = 'text/javascript';
script.src = scriptLocation;
script.onload = callback;
head.appendChild(script);
}
// Download contents by dataURL/blob
Highcharts.downloadURL = function(dataURL, filename) {
var a = doc.createElement('a'),
windowRef;
// IE specific blob implementation
if (nav.msSaveOrOpenBlob) {
nav.msSaveOrOpenBlob(dataURL, filename);
return;
}
// Try HTML5 download attr if supported
if (a.download !== undefined) {
a.href = dataURL;
a.download = filename; // HTML5 download attribute
a.target = '_blank';
doc.body.appendChild(a);
a.click();
doc.body.removeChild(a);
} else {
// No download attr, just opening data URI
try {
windowRef = win.open(dataURL, 'chart');
if (windowRef === undefined || windowRef === null) {
throw 'Failed to open window';
}
} catch (e) {
// window.open failed, trying location.href
win.location.href = dataURL;
}
}
};
// Get blob URL from SVG code. Falls back to normal data URI.
Highcharts.svgToDataUrl = function(svg) {
var webKit = nav.userAgent.indexOf('WebKit') > -1 && nav.userAgent.indexOf('Chrome') < 0; // Webkit and not chrome
try {
// Safari requires data URI since it doesn't allow navigation to blob URLs
// Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550)
if (!webKit && nav.userAgent.toLowerCase().indexOf('firefox') < 0) {
return domurl.createObjectURL(new win.Blob([svg], {
type: 'image/svg+xml;charset-utf-16'
}));
}
} catch (e) {
// Ignore
}
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
};
// Get data:URL from image URL
// Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional.
// All callbacks receive four arguments: imageURL, imageType, callbackArgs and scale. callbackArgs is used only by callbacks and can contain whatever.
Highcharts.imageToDataUrl = function(imageURL, imageType, callbackArgs, scale, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) {
var img = new win.Image(),
taintedHandler,
loadHandler = function() {
setTimeout(function() {
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext && canvas.getContext('2d'),
dataURL;
try {
if (!ctx) {
noCanvasSupportCallback(imageURL, imageType, callbackArgs, scale);
} else {
canvas.height = img.height * scale;
canvas.width = img.width * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// Now we try to get the contents of the canvas.
try {
dataURL = canvas.toDataURL(imageType);
successCallback(dataURL, imageType, callbackArgs, scale);
} catch (e) {
taintedHandler(imageURL, imageType, callbackArgs, scale);
}
}
} finally {
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
}
}, loadEventDeferDelay); // IE bug where image is not always ready despite calling load event.
},
// Image load failed (e.g. invalid URL)
errorHandler = function() {
failedLoadCallback(imageURL, imageType, callbackArgs, scale);
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
};
// This is called on load if the image drawing to canvas failed with a security error.
// We retry the drawing with crossOrigin set to Anonymous.
taintedHandler = function() {
img = new win.Image();
taintedHandler = taintedCallback;
img.crossOrigin = 'Anonymous'; // Must be set prior to loading image source
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
// Get data URL to an image of an SVG and call download on it
Highcharts.downloadSVGLocal = function(svg, filename, imageType, scale, failCallback, successCallback) {
var svgurl,
blob,
objectURLRevoke = true,
finallyHandler,
libURL = Highcharts.getOptions().exporting.libURL;
/*
function svgToPdf(svgElement, margin) {
var width = svgElement.width.baseVal.value + 2 * margin;
var height = svgElement.height.baseVal.value + 2 * margin;
var pdf = new win.jsPDF('l', 'pt', [width, height]); // eslint-disable-line new-cap
win.svgElementToPdf(svgElement, pdf, { removeInvalid: true });
return pdf.output('datauristring');
}
*/
// Initiate download depending on file type
if (imageType === 'image/svg+xml') {
// SVG download. In this case, we want to use Microsoft specific Blob if available
try {
if (nav.msSaveOrOpenBlob) {
blob = new MSBlobBuilder();
blob.append(svg);
svgurl = blob.getBlob('image/svg+xml');
} else {
svgurl = Highcharts.svgToDataUrl(svg);
}
Highcharts.downloadURL(svgurl, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
/*} else if (imageType === 'application/pdf') {
doc.getElementsByTagName('svg')[0].id = 'svgElement';
// you should set the format dynamically, write [width, height] instead of 'a4'
if (win.jsPDF && win.svgElementToPdf) {
var dummyContainer = doc.createElement('div');
dummyContainer.innerHTML = svg;
setTimeout(function () {
var data = svgToPdf(dummyContainer.firstChild, 0);
Highcharts.downloadURL(data, filename);
if (successCallback) {
successCallback();
}
}, 100);
}*/
} else {
// PNG/JPEG download - create bitmap from SVG
svgurl = Highcharts.svgToDataUrl(svg);
finallyHandler = function() {
try {
domurl.revokeObjectURL(svgurl);
} catch (e) {
// Ignore
}
};
// First, try to get PNG by rendering on canvas
Highcharts.imageToDataUrl(svgurl, imageType, { /* args */ }, scale, function(imageURL) {
// Success
try {
Highcharts.downloadURL(imageURL, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
}, function() {
// Failed due to tainted canvas
// Create new and untainted canvas
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext('2d'),
imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
downloadWithCanVG = function() {
ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight);
try {
Highcharts.downloadURL(nav.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL(imageType), filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
} finally {
finallyHandler();
}
};
canvas.width = imageWidth;
canvas.height = imageHeight;
if (win.canvg) {
// Use preloaded canvg
downloadWithCanVG();
} else {
// Must load canVG first
objectURLRevoke = true; // Don't destroy the object URL yet since we are doing things asynchronously. A cleaner solution would be nice, but this will do for now.
libURL = libURL.substr[-1] !== '/' ? libURL + '/' : libURL; // Allow libURL to end with or without fordward slash
getScript(libURL + 'rgbcolor.js', function() { // Get RGBColor.js first
getScript(libURL + 'canvg.js', function() {
downloadWithCanVG();
});
});
}
},
// No canvas support
failCallback,
// Failed to load image
failCallback,
// Finally
function() {
if (objectURLRevoke) {
finallyHandler();
}
});
}
};
// Get SVG of chart prepared for client side export. This converts embedded images in the SVG to data URIs.
// The options and chartOptions arguments are passed to the getSVGForExport function.
Highcharts.Chart.prototype.getSVGForLocalExport = function(options, chartOptions, failCallback, successCallback) {
var chart = this,
images,
imagesEmbedded = 0,
chartCopyContainer,
el,
i,
l,
// Success handler, we converted image to base64!
embeddedSuccess = function(imageURL, imageType, callbackArgs) {
++imagesEmbedded;
// Change image href in chart copy
callbackArgs.imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageURL);
// When done with last image we have our SVG
if (imagesEmbedded === images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML));
}
};
// Hook into getSVG to get a copy of the chart copy's container
Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function(proceed) {
chartCopyContainer = this.container.cloneNode(true);
return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
// Trigger hook to get chart copy
chart.getSVGForExport(options, chartOptions);
images = chartCopyContainer.getElementsByTagName('image');
try {
// If there are no images to embed, the SVG is okay now.
if (!images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML)); // Use SVG of chart copy
return;
}
// Go through the images we want to embed
for (i = 0, l = images.length; i < l; ++i) {
el = images[i];
Highcharts.imageToDataUrl(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), 'image/png', {
imageElement: el
}, options.scale,
embeddedSuccess,
// Tainted canvas
failCallback,
// No canvas support
failCallback,
// Failed to load source
failCallback
);
}
} catch (e) {
failCallback();
}
};
/**
* Add a new method to the Chart object to perform a local download
*/
Highcharts.Chart.prototype.exportChartLocal = function(exportingOptions, chartOptions) {
var chart = this,
options = Highcharts.merge(chart.options.exporting, exportingOptions),
imageType = options && options.type || 'image/png',
fallbackToExportServer = function() {
if (options.fallbackToExportServer === false) {
if (options.error) {
options.error();
} else {
throw 'Fallback to export server disabled';
}
} else {
chart.exportChart(options);
}
},
svgSuccess = function(svg) {
var filename = (options.filename || 'chart') + '.' + (imageType === 'image/svg+xml' ? 'svg' : imageType.split('/')[1]);
Highcharts.downloadSVGLocal(svg, filename, imageType, options.scale, fallbackToExportServer);
};
// If we have embedded images and are exporting to JPEG/PNG, Microsoft browsers won't handle it, so fall back
if (isMSBrowser && imageType !== 'image/svg+xml' && chart.container.getElementsByTagName('image').length) {
fallbackToExportServer();
return;
}
chart.getSVGForLocalExport(options, chartOptions, fallbackToExportServer, svgSuccess);
};
// Extend the default options to use the local exporter logic
merge(true, Highcharts.getOptions().exporting, {
libURL: 'http://code.highcharts.com@product.cdnpath@/5.0.0/lib/',
buttons: {
contextButton: {
menuItems: [{
textKey: 'printChart',
onclick: function() {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function() {
this.exportChartLocal();
}
}, {
textKey: 'downloadJPEG',
onclick: function() {
this.exportChartLocal({
type: 'image/jpeg'
});
}
}, {
textKey: 'downloadSVG',
onclick: function() {
this.exportChartLocal({
type: 'image/svg+xml'
});
}
}
/*, {
textKey: 'downloadPDF',
onclick: function () {
this.exportChartLocal({
type: 'application/pdf'
});
}
}*/
]
}
}
});
}(Highcharts));
}));

View File

@@ -0,0 +1,10 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?module.exports=b:b(Highcharts)})(function(b){(function(b){var g=b.Chart,h=b.each,r=b.pick,t=b.addEvent;g.prototype.callbacks.push(function(l){function b(){var d=[];h(l.series,function(a){var c=a.options.dataLabels,b=a.dataLabelCollections||["dataLabel"];(c.enabled||a._hasPointLabels)&&!c.allowOverlap&&a.visible&&h(b,function(c){h(a.points,function(a){a[c]&&(a[c].labelrank=r(a.labelrank,a.shapeArgs&&a.shapeArgs.height),d.push(a[c]))})})});l.hideOverlappingLabels(d)}
b();t(l,"redraw",b)});g.prototype.hideOverlappingLabels=function(b){var m=b.length,d,a,c,e,k,n,p,q,f,g=function(a,b,c,d,e,f,g,h){return!(e>a+c||e+g<a||f>b+d||f+h<b)};for(a=0;a<m;a++)if(d=b[a])d.oldOpacity=d.opacity,d.newOpacity=1;b.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(a=0;a<m;a++)for(c=b[a],d=a+1;d<m;++d)if(e=b[d],c&&e&&c.placed&&e.placed&&0!==c.newOpacity&&0!==e.newOpacity&&(k=c.alignAttr,n=e.alignAttr,p=c.parentGroup,q=e.parentGroup,f=2*(c.box?0:c.padding),k=g(k.x+p.translateX,
k.y+p.translateY,c.width-f,c.height-f,n.x+q.translateX,n.y+q.translateY,e.width-f,e.height-f)))(c.labelrank<e.labelrank?c:e).newOpacity=0;h(b,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(b)});

View File

@@ -0,0 +1,164 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
/**
* Highcharts module to hide overlapping data labels. This module is included in Highcharts.
*/
var Chart = H.Chart,
each = H.each,
pick = H.pick,
addEvent = H.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need to be
// considered because they are usually accompanied by data labels that lie inside the columns.
Chart.prototype.callbacks.push(function(chart) {
function collectAndHide() {
var labels = [];
each(chart.series, function(series) {
var dlOptions = series.options.dataLabels,
collections = series.dataLabelCollections || ['dataLabel']; // Range series have two collections
if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866
each(collections, function(coll) {
each(series.points, function(point) {
if (point[coll]) {
point[coll].labelrank = pick(point.labelrank, point.shapeArgs && point.shapeArgs.height); // #4118
labels.push(point[coll]);
}
});
});
}
});
chart.hideOverlappingLabels(labels);
}
// Do it now ...
collectAndHide();
// ... and after each chart redraw
addEvent(chart, 'redraw', collectAndHide);
});
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
Chart.prototype.hideOverlappingLabels = function(labels) {
var len = labels.length,
label,
i,
j,
label1,
label2,
isIntersecting,
pos1,
pos2,
parent1,
parent2,
padding,
intersectRect = function(x1, y1, w1, h1, x2, y2, w2, h2) {
return !(
x2 > x1 + w1 ||
x2 + w2 < x1 ||
y2 > y1 + h1 ||
y2 + h2 < y1
);
};
// Mark with initial opacity
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
}
// Prevent a situation in a gradually rising slope, that each label
// will hide the previous one because the previous one always has
// lower rank.
labels.sort(function(a, b) {
return (b.labelrank || 0) - (a.labelrank || 0);
});
// Detect overlapping labels
for (i = 0; i < len; i++) {
label1 = labels[i];
for (j = i + 1; j < len; ++j) {
label2 = labels[j];
if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0) {
pos1 = label1.alignAttr;
pos2 = label2.alignAttr;
parent1 = label1.parentGroup; // Different panes have different positions
parent2 = label2.parentGroup;
padding = 2 * (label1.box ? 0 : label1.padding); // Substract the padding if no background or border (#4333)
isIntersecting = intersectRect(
pos1.x + parent1.translateX,
pos1.y + parent1.translateY,
label1.width - padding,
label1.height - padding,
pos2.x + parent2.translateX,
pos2.y + parent2.translateY,
label2.width - padding,
label2.height - padding
);
if (isIntersecting) {
(label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0;
}
}
}
}
// Hide or show
each(labels, function(label) {
var complete,
newOpacity;
if (label) {
newOpacity = label.newOpacity;
if (label.oldOpacity !== newOpacity && label.placed) {
// Make sure the label is completely hidden to avoid catching clicks (#4362)
if (newOpacity) {
label.show(true);
} else {
complete = function() {
label.hide();
};
}
// Animate or set the opacity
label.alignAttr.opacity = newOpacity;
label[label.isOld ? 'animate' : 'attr'](label.alignAttr, null, complete);
}
label.isOld = true;
}
});
};
}(Highcharts));
}));

View File

@@ -0,0 +1,18 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(t){"object"===typeof module&&module.exports?module.exports=t:t(Highcharts)})(function(t){(function(u){function t(d,b,a,m,c,e){d=(e-b)*(a-d)-(m-b)*(c-d);return 0<d?!0:0>d?!1:!0}function v(d,b,a,m,c,e,f,l){return t(d,b,c,e,f,l)!==t(a,m,c,e,f,l)&&t(d,b,a,m,c,e)!==t(d,b,a,m,f,l)}function y(d,b,a,m,c,e,f,l){return v(d,b,d+a,b,c,e,f,l)||v(d+a,b,d+a,b+m,c,e,f,l)||v(d,b+m,d+a,b+m,c,e,f,l)||v(d,b,d,b+m,c,e,f,l)}function z(d){var b=this;d.call(b);clearTimeout(b.seriesLabelTimer);b.seriesLabelTimer=
setTimeout(function(){b.boxesToAvoid=[];w(b.series,function(a){var d=a.options.label;d.enabled&&a.visible&&(a.graph||a.area)&&(a.interpolatedPoints=a.getPointsOnGraph(),w(d.boxesToAvoid||[],function(a){b.boxesToAvoid.push(a)}))});w(b.series,function(a){function d(a,b,c){return a>p&&a<=p+r-c.width&&b>=g&&b<=g+h-c.height}var c,e,f,l=[],k,n,p=(c=b.inverted)?a.yAxis.pos:a.xAxis.pos,g=c?a.xAxis.pos:a.yAxis.pos,r=b.inverted?a.yAxis.len:a.xAxis.len,h=b.inverted?a.xAxis.len:a.yAxis.len,q=a.interpolatedPoints;
if(a.visible&&q){a.labelBySeries||(a.labelBySeries=b.renderer.label(a.name,0,-9999,"connector").css(D({color:a.color},a.options.label.styles)).attr({padding:0,opacity:0,stroke:a.color,"stroke-width":1}).add(a.group).animate({opacity:1},{duration:200}));c=a.labelBySeries.getBBox();c.width=Math.round(c.width);for(n=q.length-1;0<n;--n)e=q[n].chartX+3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX+3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&
l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k);if(!l.length)for(e=p+r-c.width;e>=p;e-=16)for(f=g;f<g+h-c.height;f+=16)(k=a.checkClearPoint(e,f,c,!0))&&l.push(k);l.length?(l.sort(function(a,b){return b.weight-a.weight}),k=l[0],b.boxesToAvoid.push({left:k.x,right:k.x+c.width,top:k.y,bottom:k.y+c.height}),Math.round(k.x)===Math.round(a.labelBySeries.x)&&
Math.round(k.y)===Math.round(a.labelBySeries.y)||a.labelBySeries.attr({x:k.x-p,y:k.y-g,anchorX:k.connectorPoint&&k.connectorPoint.plotX,anchorY:k.connectorPoint&&k.connectorPoint.plotY,opacity:0}).animate({opacity:1})):a.labelBySeries&&(a.labelBySeries=a.labelBySeries.destroy())}})},350)}var A=u.wrap,w=u.each,D=u.extend,x=u.isNumber,B=u.Series,E=u.SVGRenderer,C=u.Chart;u.setOptions({plotOptions:{series:{label:{enabled:!0,connectorAllowed:!0,connectorNeighbourDistance:24,styles:{fontWeight:"bold"}}}}});
E.prototype.symbols.connector=function(d,b,a,m,c){var e=c&&c.anchorX;c=c&&c.anchorY;var f,l,k=a/2;x(e)&&x(c)&&(f=["M",e,c],l=b-c,0>l&&(l=-m-l),l<a&&(k=e<d+a/2?l:a-l),c>b+m?f.push("L",d+k,b+m):c<b?f.push("L",d+k,b):e<d?f.push("L",d,b+m/2):e>d+a&&f.push("L",d+a,b+m/2));return f||[]};B.prototype.getPointsOnGraph=function(){var d=this.points,b,a,m=[],c,e,f,l;e=this.graph||this.area;f=e.element;var k=(b=this.chart.inverted)?this.yAxis.pos:this.xAxis.pos,n=b?this.xAxis.pos:this.yAxis.pos;if(this.getPointSpline&&
f.getPointAtLength){e.toD&&(a=e.attr("d"),e.attr({d:e.toD}));l=f.getTotalLength();for(c=0;c<l;c+=16)b=f.getPointAtLength(c),m.push({chartX:k+b.x,chartY:n+b.y,plotX:b.x,plotY:b.y});a&&e.attr({d:a});b=d[d.length-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;m.push(b)}else for(l=d.length,c=0;c<l;c+=1){b=d[c];a=d[c-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;if(0<c&&(e=Math.abs(b.chartX-a.chartX),f=Math.abs(b.chartY-a.chartY),e=Math.max(e,f),16<e))for(e=Math.ceil(e/16),f=1;f<e;f+=1)m.push({chartX:a.chartX+f/
e*(b.chartX-a.chartX),chartY:a.chartY+f/e*(b.chartY-a.chartY),plotX:a.plotX+f/e*(b.plotX-a.plotX),plotY:a.plotY+f/e*(b.plotY-a.plotY)});x(b.plotY)&&m.push(b)}return m};B.prototype.checkClearPoint=function(d,b,a,m){var c=Number.MAX_VALUE,e=Number.MAX_VALUE,f,l,k=this.options.label.connectorAllowed,n=this.chart,p,g,r,h;for(r=0;r<n.boxesToAvoid.length;r+=1){g=n.boxesToAvoid[r];h=d+a.width;p=b;var q=b+a.height;if(!(d>g.right||h<g.left||p>g.bottom||q<g.top))return!1}for(r=0;r<n.series.length;r+=1)if(p=
n.series[r],g=p.interpolatedPoints,p.visible&&g){for(h=1;h<g.length;h+=1){if(y(d,b,a.width,a.height,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY))return!1;this===p&&!f&&m&&(f=y(d-16,b-16,a.width+32,a.height+32,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY));this!==p&&(c=Math.min(c,Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,
2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2)))}if(k&&this===p&&(m&&!f||c<Math.pow(this.options.label.connectorNeighbourDistance,2))){for(h=1;h<g.length;h+=1)f=Math.min(Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+
Math.pow(b+a.height-g[h].chartY,2)),f<e&&(e=f,l=g[h]);f=!0}}return!m||f?{x:d,y:b,weight:c-(l?e:0),connectorPoint:l}:!1};A(C.prototype,"render",z);A(C.prototype,"redraw",z)})(t)});

View File

@@ -0,0 +1,544 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/**
* EXPERIMENTAL Highcharts module to place labels next to a series in a natural position.
*
* TODO:
* - add column support (box collision detection, boxesToAvoid logic)
* - other series types, area etc.
* - avoid data labels, when data labels above, show series label below.
* - add more options (connector, format, formatter)
*
* http://jsfiddle.net/highcharts/L2u9rpwr/
* http://jsfiddle.net/highcharts/y5A37/
* http://jsfiddle.net/highcharts/264Nm/
* http://jsfiddle.net/highcharts/y5A37/
*/
'use strict';
var labelDistance = 3,
wrap = H.wrap,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Series = H.Series,
SVGRenderer = H.SVGRenderer,
Chart = H.Chart;
H.setOptions({
plotOptions: {
series: {
label: {
enabled: true,
// Allow labels to be placed distant to the graph if necessary, and
// draw a connector line to the graph
connectorAllowed: true,
connectorNeighbourDistance: 24, // If the label is closer than this to a neighbour graph, draw a connector
styles: {
fontWeight: 'bold'
}
// boxesToAvoid: []
}
}
}
});
/**
* Counter-clockwise, part of the fast line intersection logic
*/
function ccw(x1, y1, x2, y2, x3, y3) {
var cw = ((y3 - y1) * (x2 - x1)) - ((y2 - y1) * (x3 - x1));
return cw > 0 ? true : cw < 0 ? false : true;
}
/**
* Detect if two lines intersect
*/
function intersectLine(x1, y1, x2, y2, x3, y3, x4, y4) {
return ccw(x1, y1, x3, y3, x4, y4) !== ccw(x2, y2, x3, y3, x4, y4) &&
ccw(x1, y1, x2, y2, x3, y3) !== ccw(x1, y1, x2, y2, x4, y4);
}
/**
* Detect if a box intersects with a line
*/
function boxIntersectLine(x, y, w, h, x1, y1, x2, y2) {
return (
intersectLine(x, y, x + w, y, x1, y1, x2, y2) || // top of label
intersectLine(x + w, y, x + w, y + h, x1, y1, x2, y2) || // right of label
intersectLine(x, y + h, x + w, y + h, x1, y1, x2, y2) || // bottom of label
intersectLine(x, y, x, y + h, x1, y1, x2, y2) // left of label
);
}
/**
* General symbol definition for labels with connector
*/
SVGRenderer.prototype.symbols.connector = function(x, y, w, h, options) {
var anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
yOffset,
lateral = w / 2;
if (isNumber(anchorX) && isNumber(anchorY)) {
path = ['M', anchorX, anchorY];
// Prefer 45 deg connectors
yOffset = y - anchorY;
if (yOffset < 0) {
yOffset = -h - yOffset;
}
if (yOffset < w) {
lateral = anchorX < x + (w / 2) ? yOffset : w - yOffset;
}
// Anchor below label
if (anchorY > y + h) {
path.push('L', x + lateral, y + h);
// Anchor above label
} else if (anchorY < y) {
path.push('L', x + lateral, y);
// Anchor left of label
} else if (anchorX < x) {
path.push('L', x, y + h / 2);
// Anchor right of label
} else if (anchorX > x + w) {
path.push('L', x + w, y + h / 2);
}
}
return path || [];
};
/**
* Points to avoid. In addition to actual data points, the label should avoid
* interpolated positions.
*/
Series.prototype.getPointsOnGraph = function() {
var distance = 16,
points = this.points,
point,
last,
interpolated = [],
i,
deltaX,
deltaY,
delta,
len,
n,
j,
d,
graph = this.graph || this.area,
node = graph.element,
inverted = this.chart.inverted,
paneLeft = inverted ? this.yAxis.pos : this.xAxis.pos,
paneTop = inverted ? this.xAxis.pos : this.yAxis.pos;
// For splines, get the point at length (possible caveat: peaks are not correctly detected)
if (this.getPointSpline && node.getPointAtLength) {
// If it is animating towards a path definition, use that briefly, and reset
if (graph.toD) {
d = graph.attr('d');
graph.attr({
d: graph.toD
});
}
len = node.getTotalLength();
for (i = 0; i < len; i += distance) {
point = node.getPointAtLength(i);
interpolated.push({
chartX: paneLeft + point.x,
chartY: paneTop + point.y,
plotX: point.x,
plotY: point.y
});
}
if (d) {
graph.attr({
d: d
});
}
// Last point
point = points[points.length - 1];
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
interpolated.push(point);
// Interpolate
} else {
len = points.length;
for (i = 0; i < len; i += 1) {
point = points[i];
last = points[i - 1];
// Absolute coordinates so we can compare different panes
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
// Add interpolated points
if (i > 0) {
deltaX = Math.abs(point.chartX - last.chartX);
deltaY = Math.abs(point.chartY - last.chartY);
delta = Math.max(deltaX, deltaY);
if (delta > distance) {
n = Math.ceil(delta / distance);
for (j = 1; j < n; j += 1) {
interpolated.push({
chartX: last.chartX + (point.chartX - last.chartX) * (j / n),
chartY: last.chartY + (point.chartY - last.chartY) * (j / n),
plotX: last.plotX + (point.plotX - last.plotX) * (j / n),
plotY: last.plotY + (point.plotY - last.plotY) * (j / n)
});
}
}
}
// Add the real point in order to find positive and negative peaks
if (isNumber(point.plotY)) {
interpolated.push(point);
}
}
}
return interpolated;
};
/**
* Check whether a proposed label position is clear of other elements
*/
Series.prototype.checkClearPoint = function(x, y, bBox, checkDistance) {
var distToOthersSquared = Number.MAX_VALUE, // distance to other graphs
distToPointSquared = Number.MAX_VALUE,
dist,
connectorPoint,
connectorEnabled = this.options.label.connectorAllowed,
chart = this.chart,
series,
points,
leastDistance = 16,
withinRange,
i,
j;
function intersectRect(r1, r2) {
return !(r2.left > r1.right ||
r2.right < r1.left ||
r2.top > r1.bottom ||
r2.bottom < r1.top);
}
/**
* Get the weight in order to determine the ideal position. Larger distance to
* other series gives more weight. Smaller distance to the actual point (connector points only)
* gives more weight.
*/
function getWeight(distToOthersSquared, distToPointSquared) {
return distToOthersSquared - distToPointSquared;
}
// First check for collision with existing labels
for (i = 0; i < chart.boxesToAvoid.length; i += 1) {
if (intersectRect(chart.boxesToAvoid[i], {
left: x,
right: x + bBox.width,
top: y,
bottom: y + bBox.height
})) {
return false;
}
}
// For each position, check if the lines around the label intersect with any of the
// graphs
for (i = 0; i < chart.series.length; i += 1) {
series = chart.series[i];
points = series.interpolatedPoints;
if (series.visible && points) {
for (j = 1; j < points.length; j += 1) {
// If any of the box sides intersect with the line, return
if (boxIntersectLine(
x,
y,
bBox.width,
bBox.height,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
)) {
return false;
}
// But if it is too far away (a padded box doesn't intersect), also return
if (this === series && !withinRange && checkDistance) {
withinRange = boxIntersectLine(
x - leastDistance,
y - leastDistance,
bBox.width + 2 * leastDistance,
bBox.height + 2 * leastDistance,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
);
}
// Find the squared distance from the center of the label
if (this !== series) {
distToOthersSquared = Math.min(
distToOthersSquared,
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
}
}
// Do we need a connector?
if (connectorEnabled && this === series && ((checkDistance && !withinRange) ||
distToOthersSquared < Math.pow(this.options.label.connectorNeighbourDistance, 2))) {
for (j = 1; j < points.length; j += 1) {
dist = Math.min(
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
if (dist < distToPointSquared) {
distToPointSquared = dist;
connectorPoint = points[j];
}
}
withinRange = true;
}
}
}
return !checkDistance || withinRange ? {
x: x,
y: y,
weight: getWeight(distToOthersSquared, connectorPoint ? distToPointSquared : 0),
connectorPoint: connectorPoint
} : false;
};
/**
* The main initiator method that runs on chart level after initiation and redraw. It runs in
* a timeout to prevent locking, and loops over all series, taking all series and labels into
* account when placing the labels.
*/
function drawLabels(proceed) {
var chart = this;
proceed.call(chart);
clearTimeout(chart.seriesLabelTimer);
chart.seriesLabelTimer = setTimeout(function() {
chart.boxesToAvoid = [];
// Build the interpolated points
each(chart.series, function(series) {
var options = series.options.label;
if (options.enabled && series.visible && (series.graph || series.area)) {
series.interpolatedPoints = series.getPointsOnGraph();
each(options.boxesToAvoid || [], function(box) {
chart.boxesToAvoid.push(box);
});
}
});
each(chart.series, function(series) {
var bBox,
x,
y,
results = [],
clearPoint,
i,
best,
inverted = chart.inverted,
paneLeft = inverted ? series.yAxis.pos : series.xAxis.pos,
paneTop = inverted ? series.xAxis.pos : series.yAxis.pos,
paneWidth = chart.inverted ? series.yAxis.len : series.xAxis.len,
paneHeight = chart.inverted ? series.xAxis.len : series.yAxis.len,
points = series.interpolatedPoints;
function insidePane(x, y, bBox) {
return x > paneLeft && x <= paneLeft + paneWidth - bBox.width &&
y >= paneTop && y <= paneTop + paneHeight - bBox.height;
}
if (series.visible && points) {
if (!series.labelBySeries) {
series.labelBySeries = chart.renderer.label(series.name, 0, -9999, 'connector')
.css(extend({
color: series.color
}, series.options.label.styles))
.attr({
padding: 0,
opacity: 0,
stroke: series.color,
'stroke-width': 1
})
.add(series.group)
.animate({
opacity: 1
}, {
duration: 200
});
}
bBox = series.labelBySeries.getBBox();
bBox.width = Math.round(bBox.width);
// Ideal positions are centered above or below a point on right side of chart
for (i = points.length - 1; i > 0; i -= 1) {
// Right - up
x = points[i].chartX + labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Right - down
x = points[i].chartX + labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - down
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - up
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
}
// Brute force, try all positions on the chart in a 16x16 grid
if (!results.length) {
for (x = paneLeft + paneWidth - bBox.width; x >= paneLeft; x -= 16) {
for (y = paneTop; y < paneTop + paneHeight - bBox.height; y += 16) {
clearPoint = series.checkClearPoint(x, y, bBox, true);
if (clearPoint) {
results.push(clearPoint);
}
}
}
}
if (results.length) {
results.sort(function(a, b) {
return b.weight - a.weight;
});
best = results[0];
chart.boxesToAvoid.push({
left: best.x,
right: best.x + bBox.width,
top: best.y,
bottom: best.y + bBox.height
});
// Move it if needed
if (Math.round(best.x) !== Math.round(series.labelBySeries.x) || Math.round(best.y) !== Math.round(series.labelBySeries.y)) {
series.labelBySeries
.attr({
x: best.x - paneLeft,
y: best.y - paneTop,
anchorX: best.connectorPoint && best.connectorPoint.plotX,
anchorY: best.connectorPoint && best.connectorPoint.plotY,
opacity: 0
})
.animate({
opacity: 1
});
}
} else if (series.labelBySeries) {
series.labelBySeries = series.labelBySeries.destroy();
}
}
});
}, 350);
}
wrap(Chart.prototype, 'render', drawLabels);
wrap(Chart.prototype, 'redraw', drawLabels);
}(Highcharts));
}));

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Solid angular gauge module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(f){"object"===typeof module&&module.exports?module.exports=f:f(Highcharts)})(function(f){(function(b){var f=b.pInt,u=b.pick,m=b.each,v=b.isNumber,n;n={initDataClasses:function(a){var c=this,h=this.chart,e,t=0,l=this.options;this.dataClasses=e=[];m(a.dataClasses,function(g,d){var f;g=b.merge(g);e.push(g);g.color||("category"===l.dataClassColor?(f=h.options.colors,g.color=f[t++],t===f.length&&(t=0)):g.color=c.tweenColors(b.color(l.minColor),b.color(l.maxColor),d/(a.dataClasses.length-1)))})},
initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];m(this.stops,function(a){a.color=b.color(a[1])})},toColor:function(a,c){var h,e=this.stops,b,f=this.dataClasses,g,d;if(f)for(d=f.length;d--;){if(g=f[d],b=g.from,e=g.to,(void 0===b||a>=b)&&(void 0===e||a<=e)){h=g.color;c&&(c.dataClass=d);break}}else{this.isLog&&(a=this.val2lin(a));h=1-(this.max-a)/(this.max-this.min);for(d=e.length;d--&&!(h>e[d][0]););b=e[d]||e[d+1];e=e[d+1]||b;h=1-(e[0]-h)/(e[0]-b[0]||
1);h=this.tweenColors(b.color,e.color,h)}return h},tweenColors:function(a,c,b){var e;c.rgba.length&&a.rgba.length?(a=a.rgba,c=c.rgba,e=1!==c[3]||1!==a[3],a=(e?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-b))+","+Math.round(c[1]+(a[1]-c[1])*(1-b))+","+Math.round(c[2]+(a[2]-c[2])*(1-b))+(e?","+(c[3]+(a[3]-c[3])*(1-b)):"")+")"):a=c.input||"none";return a}};m(["fill","stroke"],function(a){b.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n.tweenColors(b.color(this.start),b.color(this.end),this.pos))}});
b.seriesType("solidgauge","gauge",{colorByPoint:!0},{bindAxes:function(){var a;b.seriesTypes.gauge.prototype.bindAxes.call(this);a=this.yAxis;b.extend(a,n);a.options.dataClasses&&a.initDataClasses(a.options);a.initStops(a.options)},drawPoints:function(){var a=this,c=a.yAxis,b=c.center,e=a.options,t=a.chart.renderer,l=e.overshoot,g=v(l)?l/180*Math.PI:0;m(a.points,function(d){var l=d.graphic,k=c.startAngleRad+c.translate(d.y,null,null,null,!0),m=f(u(d.options.radius,e.radius,100))*b[2]/200,p=f(u(d.options.innerRadius,
e.innerRadius,60))*b[2]/200,q=c.toColor(d.y,d),r=Math.min(c.startAngleRad,c.endAngleRad),n=Math.max(c.startAngleRad,c.endAngleRad);"none"===q&&(q=d.color||a.color||"none");"none"!==q&&(d.color=q);k=Math.max(r-g,Math.min(n+g,k));!1===e.wrap&&(k=Math.max(r,Math.min(n,k)));r=Math.min(k,c.startAngleRad);k=Math.max(k,c.startAngleRad);k-r>2*Math.PI&&(k=r+2*Math.PI);d.shapeArgs=p={x:b[0],y:b[1],r:m,innerR:p,start:r,end:k,fill:q};d.startR=m;l?(d=p.d,l.animate(p),d&&(p.d=d)):d.graphic=t.arc(p).addClass("highcharts-point").attr({fill:q,
"sweep-flag":0}).add(a.group)})},animate:function(a){a||(this.startAngleRad=this.yAxis.startAngleRad,b.seriesTypes.pie.prototype.animate.call(this,a))}})})(f)});

View File

@@ -0,0 +1,276 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pInt = H.pInt,
pick = H.pick,
each = H.each,
isNumber = H.isNumber,
colorAxisMethods;
// 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;
},
/*
* 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,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
};
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, colorAxisMethods.tweenColors(H.color(this.start), H.color(this.end), this.pos));
};
});
// The solidgauge series type
H.seriesType('solidgauge', 'gauge', {
colorByPoint: true
}, {
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,
overshoot = options.overshoot,
overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0;
each(series.points, function(point) {
var graphic = point.graphic,
rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true),
radius = (pInt(pick(point.options.radius, options.radius, 100)) * center[2]) / 200,
innerRadius = (pInt(pick(point.options.innerRadius, options.innerRadius, 60)) * center[2]) / 200,
shapeArgs,
d,
toColor = yAxis.toColor(point.y, point),
axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
minAngle,
maxAngle;
if (toColor === 'none') { // #3708
toColor = point.color || series.color || 'none';
}
if (toColor !== 'none') {
point.color = toColor;
}
// Handle overshoot and clipping to axis max/min
rotation = Math.max(axisMinAngle - overshootVal, Math.min(axisMaxAngle + overshootVal, rotation));
// Handle the wrap option
if (options.wrap === false) {
rotation = Math.max(axisMinAngle, Math.min(axisMaxAngle, rotation));
}
minAngle = Math.min(rotation, yAxis.startAngleRad);
maxAngle = Math.max(rotation, yAxis.startAngleRad);
if (maxAngle - minAngle > 2 * Math.PI) {
maxAngle = minAngle + 2 * Math.PI;
}
point.shapeArgs = shapeArgs = {
x: center[0],
y: center[1],
r: radius,
innerR: innerRadius,
start: minAngle,
end: maxAngle,
fill: toColor
};
point.startR = radius; // For PieSeries.animate
if (graphic) {
d = shapeArgs.d;
graphic.animate(shapeArgs);
if (d) {
shapeArgs.d = d; // animate alters it
}
} else {
point.graphic = renderer.arc(shapeArgs)
.addClass('highcharts-point')
.attr({
fill: toColor,
'sweep-flag': 0
})
.add(series.group);
}
});
},
/**
* Extend the pie slice animation by animating from start angle and up
*/
animate: function(init) {
if (!init) {
this.startAngleRad = this.yAxis.startAngleRad;
H.seriesTypes.pie.prototype.animate.call(this, init);
}
}
});
}(Highcharts));
}));

View File

@@ -0,0 +1,29 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2014 Highsoft AS
Authors: Jon Arild Nygard / Oystein Moseng
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(g){var p=g.seriesType,t=g.seriesTypes,D=g.map,w=g.merge,z=g.extend,A=g.noop,m=g.each,y=g.grep,k=g.pick,u=g.Series,E=g.stableSort,F=function(a,b,c){var d;c=c||this;for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)},B=function(a,b,c,d){d=d||this;a=a||[];m(a,function(e,f){c=b.call(d,c,e,f,a)});return c},x=function(a,b,c){c=c||this;a=b.call(c,a);!1!==a&&x(a,b,c)};p("treemap","scatter",{showInLegend:!1,
marker:!1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}</b><br/>"},layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}}},{pointArrayMap:["value"],axisTypes:t.heatmap?["xAxis","yAxis","colorAxis"]:["xAxis","yAxis"],optionalAxis:"colorAxis",
getSymbol:A,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:t.heatmap&&t.heatmap.prototype.translateColors,trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){var c=B(a,function(a,c,b){c=k(c.parent,"");void 0===a[c]&&(a[c]=[]);a[c].push(b);return a},{});F(c,function(a,c,f){""!==c&&-1===g.inArray(c,b)&&(m(a,function(a){f[""].push(a)}),delete f[c])});return c},getTree:function(){var a,b=this;a=D(this.data,function(a){return a.id});a=b.getListOfParents(this.data,
a);b.nodeMap=[];a=b.buildNode("",-1,0,a,null);x(this.nodeMap[this.rootNode],function(a){var d=!1,e=a.parent;a.visible=!0;if(e||""===e)d=b.nodeMap[e];return d});x(this.nodeMap[this.rootNode].children,function(a){var b=!1;m(a,function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});this.setTreeValues(a);return a},init:function(a,b){u.prototype.init.call(this,a,b);this.options.allowDrillToNode&&this.drillTo()},buildNode:function(a,b,c,d,e){var f=this,h=[],C=f.points[b],
v;m(d[a]||[],function(b){v=f.buildNode(f.points[b].id,b,c+1,d,a);h.push(v)});b={id:a,i:b,children:h,level:c,parent:e,visible:!1};f.nodeMap[b.id]=b;C&&(C.node=b);return b},setTreeValues:function(a){var b=this,c=b.options,d=0,e=[],f,h=b.points[a.i];m(a.children,function(a){a=b.setTreeValues(a);e.push(a);a.ignore?x(a.children,function(a){var b=!1;m(a,function(a){z(a,{ignore:!0,isLeaf:!1,visible:!1});a.children.length&&(b=(b||[]).concat(a.children))});return b}):d+=a.val});E(e,function(a,b){return a.sortIndex-
b.sortIndex});f=k(h&&h.options.value,d);h&&(h.value=f);z(a,{children:e,childrenTotal:d,ignore:!(k(h&&h.visible,!0)&&0<f),isLeaf:a.visible&&!d,levelDynamic:c.levelIsConstant?a.level:a.level-b.nodeMap[b.rootNode].level,name:k(h&&h.name,""),sortIndex:k(h&&h.sortIndex,-f),val:f});return a},calculateChildrenAreas:function(a,b){var c=this,d=c.options,e=this.levelMap[a.levelDynamic+1],f=k(c[e&&e.layoutAlgorithm]&&e.layoutAlgorithm,d.layoutAlgorithm),h=d.alternateStartingDirection,g=[],d=y(a.children,function(a){return!a.ignore});
e&&e.layoutStartingDirection&&(b.direction="vertical"===e.layoutStartingDirection?0:1);g=c[f](b,d);m(d,function(a,e){var d=g[e];a.values=w(d,{val:a.childrenTotal,direction:h?1-b.direction:b.direction});a.pointValues=w(d,{x:d.x/c.axisRatio,width:d.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;m(this.points,function(c){var d=c.node,e=d.pointValues,f,h;e&&d.visible?(d=Math.round(a.translate(e.x,0,0,0,1))-.5,f=Math.round(a.translate(e.x+
e.width,0,0,0,1))-.5,h=Math.round(b.translate(e.y,0,0,0,1))-.5,e=Math.round(b.translate(e.y+e.height,0,0,0,1))-.5,c.shapeType="rect",c.shapeArgs={x:Math.min(d,f),y:Math.min(h,e),width:Math.abs(f-d),height:Math.abs(e-h)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(a,b,c){var d=this,e,f;a&&(e=d.points[a.i],f=d.levelMap[a.levelDynamic],b=k(e&&e.options.color,f&&f.color,b),c=k(e&&e.options.colorIndex,
f&&f.colorIndex,c),e&&(e.color=b,e.colorIndex=c),a.children.length&&m(a.children,function(a){d.setColorRecursive(a,b,c)}))},algorithmGroup:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP={total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,b){return Math.max(a/b,b/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;0===this.direction?(this.lW=
this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=
0}},algorithmCalcPoints:function(a,b,c,d){var e,f,h,g,v=c.lW,n=c.lH,l=c.plot,k,q=0,r=c.elArr.length-1;b?(v=c.nW,n=c.nH):k=c.elArr[c.elArr.length-1];m(c.elArr,function(a){if(b||q<r)0===c.direction?(e=l.x,f=l.y,h=v,g=a/h):(e=l.x,f=l.y,g=n,h=a/g),d.push({x:e,y:f,width:h,height:g}),0===c.direction?l.y+=g:l.x+=h;q+=1});c.reset();0===c.direction?c.width-=v:c.height-=n;l.y=l.parent.y+(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);a&&(c.direction=1-c.direction);b||c.addElement(k)},algorithmLowAspectRatio:function(a,
b,c){var d=[],e=this,f,h={x:b.x,y:b.y,parent:b},g=0,k=c.length-1,n=new this.algorithmGroup(b.height,b.width,b.direction,h);m(c,function(c){f=c.val/b.val*b.height*b.width;n.addElement(f);n.lP.nR>n.lP.lR&&e.algorithmCalcPoints(a,!1,n,d,h);g===k&&e.algorithmCalcPoints(a,!0,n,d,h);g+=1});return d},algorithmFill:function(a,b,c){var d=[],e,f=b.direction,h=b.x,g=b.y,k=b.width,n=b.height,l,p,q,r;m(c,function(c){e=c.val/b.val*b.height*b.width;l=h;p=g;0===f?(r=n,q=e/r,k-=q,h+=q):(q=k,r=e/q,n-=r,g+=r);d.push({x:l,
y:p,width:q,height:r});a&&(f=1-f)});return d},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,b){return this.algorithmFill(!1,a,b)},translate:function(){var a,b;u.prototype.translate.call(this);this.rootNode=k(this.options.rootId,"");this.levelMap=B(this.options.levels,function(a,b){a[b.level]=b;return a},{});b=this.tree=this.getTree();
this.axisRatio=this.xAxis.len/this.yAxis.len;this.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100};this.nodeMap[""].values=a=w(a,{width:a.width*this.axisRatio,direction:"vertical"===this.options.layoutStartingDirection?0:1,val:b.val});this.calculateChildrenAreas(b,a);this.colorAxis?this.translateColors():this.options.colorByPoint||this.setColorRecursive(this.tree);this.options.allowDrillToNode&&(b=this.nodeMap[this.rootNode].pointValues,this.xAxis.setExtremes(b.x,b.x+b.width,!1),this.yAxis.setExtremes(b.y,
b.y+b.height,!1),this.xAxis.setScale(),this.yAxis.setScale());this.setPointValues()},drawDataLabels:function(){var a=this,b=y(a.points,function(a){return a.node.visible}),c,d;m(b,function(b){d=a.levelMap[b.node.levelDynamic];c={style:{}};b.node.isLeaf||(c.enabled=!1);d&&d.dataLabels&&(c=w(c,d.dataLabels),a._hasPointLabels=!0);b.shapeArgs&&(c.style.width=b.shapeArgs.width,b.dataLabel&&b.dataLabel.css({width:b.shapeArgs.width+"px"}));b.dlOptions=w(c,b.options.dataLabels)});u.prototype.drawDataLabels.call(this)},
alignDataLabel:function(a){t.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:a.node.zIndex+1})},drawPoints:function(){var a=this,b=y(a.points,function(a){return a.node.visible});m(b,function(b){var d="levelGroup-"+b.node.levelDynamic;a[d]||(a[d]=a.chart.renderer.g(d).attr({zIndex:1E3-b.node.levelDynamic}).add(a.group));b.group=a[d]});t.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&m(b,function(b){b.graphic&&(b.drillId=a.options.interactByLeaf?
a.drillToByLeaf(b):a.drillToByGroup(b))})},drillTo:function(){var a=this;g.addEvent(a,"click",function(b){b=b.point;var c=b.drillId,d;c&&(d=a.nodeMap[a.rootNode].name||a.rootNode,b.setState(""),a.drillToNode(c),a.showDrillUpButton(d))})},drillToByGroup:function(a){var b=!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&
(b=a.id);return b},drillUp:function(){var a=null;this.rootNode&&(a=this.nodeMap[this.rootNode],a=null!==a.parent?this.nodeMap[a.parent]:this.nodeMap[""]);null!==a&&(this.drillToNode(a.id),""===a.id?this.drillUpButton=this.drillUpButton.destroy():(a=this.nodeMap[a.parent],this.showDrillUpButton(a.name||a.id)))},drillToNode:function(a){this.options.rootId=a;this.isDirty=!0;this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||"< Back";var c=b.options.drillUpButton,d,e;c.text&&(a=c.text);
this.drillUpButton?this.drillUpButton.attr({text:a}).align():(e=(d=c.theme)&&d.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},d,e&&e.hover,e&&e.select).attr({align:c.position.align,zIndex:7}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:A,drawLegendSymbol:g.LegendSymbolMixin.drawRectangle,getExtremes:function(){u.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;u.prototype.getExtremes.call(this)},
getExtremesFromAll:!0,bindAxes:function(){var a={endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};u.prototype.bindAxes.call(this);g.extend(this.yAxis.options,a);g.extend(this.xAxis.options,a)}},{getClassName:function(){var a=g.Point.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?a+=" highcharts-above-level":this.node.isLeaf||k(c.interactByLeaf,
!c.allowDrillToNode)?this.node.isLeaf||(a+=" highcharts-internal-node"):a+=" highcharts-internal-node-interactive";return a},setState:function(a){g.Point.prototype.setState.call(this,a);this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:t.pie.prototype.pointClass.prototype.setVisible})})(p)});

View File

@@ -0,0 +1,876 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesType = H.seriesType,
seriesTypes = H.seriesTypes,
map = H.map,
merge = H.merge,
extend = H.extend,
noop = H.noop,
each = H.each,
grep = H.grep,
pick = H.pick,
Series = H.Series,
stableSort = H.stableSort,
color = H.Color,
eachObject = function(list, func, context) {
var key;
context = context || this;
for (key in list) {
if (list.hasOwnProperty(key)) {
func.call(context, list[key], key, list);
}
}
},
reduce = function(arr, func, previous, context) {
context = context || this;
arr = arr || []; // @note should each be able to handle empty values automatically?
each(arr, function(current, i) {
previous = func.call(context, previous, current, i, arr);
});
return previous;
},
// @todo find correct name for this function.
// @todo Similar to reduce, this function is likely redundant
recursive = function(item, func, context) {
var next;
context = context || this;
next = func.call(context, item);
if (next !== false) {
recursive(next, func, context);
}
};
// The Treemap series type
seriesType('treemap', 'scatter', {
showInLegend: false,
marker: false,
dataLabels: {
enabled: true,
defer: false,
verticalAlign: 'middle',
formatter: function() { // #2945
return this.point.name || this.point.id;
},
inside: true
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.name}</b>: {point.value}</b><br/>'
},
layoutAlgorithm: 'sliceAndDice',
layoutStartingDirection: 'vertical',
alternateStartingDirection: false,
levelIsConstant: true,
drillUpButton: {
position: {
align: 'right',
x: -10,
y: 10
}
},
// Prototype members
}, {
pointArrayMap: ['value'],
axisTypes: seriesTypes.heatmap ? ['xAxis', 'yAxis', 'colorAxis'] : ['xAxis', 'yAxis'],
optionalAxis: 'colorAxis',
getSymbol: noop,
parallelArrays: ['x', 'y', 'value', 'colorValue'],
colorKey: 'colorValue', // Point color option key
translateColors: seriesTypes.heatmap && seriesTypes.heatmap.prototype.translateColors,
trackerGroups: ['group', 'dataLabelsGroup'],
/**
* Creates an object map from parent id to childrens index.
* @param {Array} data List of points set in options.
* @param {string} data[].parent Parent id of point.
* @param {Array} ids List of all point ids.
* @return {Object} Map from parent id to children index in data.
*/
getListOfParents: function(data, ids) {
var listOfParents = reduce(data, function(prev, curr, i) {
var parent = pick(curr.parent, '');
if (prev[parent] === undefined) {
prev[parent] = [];
}
prev[parent].push(i);
return prev;
}, {});
// If parent does not exist, hoist parent to root of tree.
eachObject(listOfParents, function(children, parent, list) {
if ((parent !== '') && (H.inArray(parent, ids) === -1)) {
each(children, function(child) {
list[''].push(child);
});
delete list[parent];
}
});
return listOfParents;
},
/**
* Creates a tree structured object from the series points
*/
getTree: function() {
var tree,
series = this,
allIds = map(this.data, function(d) {
return d.id;
}),
parentList = series.getListOfParents(this.data, allIds);
series.nodeMap = [];
tree = series.buildNode('', -1, 0, parentList, null);
// Parents of the root node is by default visible
recursive(this.nodeMap[this.rootNode], function(node) {
var next = false,
p = node.parent;
node.visible = true;
if (p || p === '') {
next = series.nodeMap[p];
}
return next;
});
// Children of the root node is by default visible
recursive(this.nodeMap[this.rootNode].children, function(children) {
var next = false;
each(children, function(child) {
child.visible = true;
if (child.children.length) {
next = (next || []).concat(child.children);
}
});
return next;
});
this.setTreeValues(tree);
return tree;
},
init: function(chart, options) {
var series = this;
Series.prototype.init.call(series, chart, options);
if (series.options.allowDrillToNode) {
series.drillTo();
}
},
buildNode: function(id, i, level, list, parent) {
var series = this,
children = [],
point = series.points[i],
node,
child;
// Actions
each((list[id] || []), function(i) {
child = series.buildNode(series.points[i].id, i, (level + 1), list, id);
children.push(child);
});
node = {
id: id,
i: i,
children: children,
level: level,
parent: parent,
visible: false // @todo move this to better location
};
series.nodeMap[node.id] = node;
if (point) {
point.node = node;
}
return node;
},
setTreeValues: function(tree) {
var series = this,
options = series.options,
childrenTotal = 0,
children = [],
val,
point = series.points[tree.i];
// First give the children some values
each(tree.children, function(child) {
child = series.setTreeValues(child);
children.push(child);
if (!child.ignore) {
childrenTotal += child.val;
} else {
// @todo Add predicate to avoid looping already ignored children
recursive(child.children, function(children) {
var next = false;
each(children, function(node) {
extend(node, {
ignore: true,
isLeaf: false,
visible: false
});
if (node.children.length) {
next = (next || []).concat(node.children);
}
});
return next;
});
}
});
// Sort the children
stableSort(children, function(a, b) {
return a.sortIndex - b.sortIndex;
});
// Set the values
val = pick(point && point.options.value, childrenTotal);
if (point) {
point.value = val;
}
extend(tree, {
children: children,
childrenTotal: childrenTotal,
// Ignore this node if point is not visible
ignore: !(pick(point && point.visible, true) && (val > 0)),
isLeaf: tree.visible && !childrenTotal,
levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)),
name: pick(point && point.name, ''),
sortIndex: pick(point && point.sortIndex, -val),
val: val
});
return tree;
},
/**
* Recursive function which calculates the area for all children of a node.
* @param {Object} node The node which is parent to the children.
* @param {Object} area The rectangular area of the parent.
*/
calculateChildrenAreas: function(parent, area) {
var series = this,
options = series.options,
level = this.levelMap[parent.levelDynamic + 1],
algorithm = pick((series[level && level.layoutAlgorithm] && level.layoutAlgorithm), options.layoutAlgorithm),
alternate = options.alternateStartingDirection,
childrenValues = [],
children;
// Collect all children which should be included
children = grep(parent.children, function(n) {
return !n.ignore;
});
if (level && level.layoutStartingDirection) {
area.direction = level.layoutStartingDirection === 'vertical' ? 0 : 1;
}
childrenValues = series[algorithm](area, children);
each(children, function(child, index) {
var values = childrenValues[index];
child.values = merge(values, {
val: child.childrenTotal,
direction: (alternate ? 1 - area.direction : area.direction)
});
child.pointValues = merge(values, {
x: (values.x / series.axisRatio),
width: (values.width / series.axisRatio)
});
// If node has children, then call method recursively
if (child.children.length) {
series.calculateChildrenAreas(child, child.values);
}
});
},
setPointValues: function() {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis;
each(series.points, function(point) {
var node = point.node,
values = node.pointValues,
x1,
x2,
y1,
y2,
crispCorr = 0.5; // Assume 1px borderWidth for simplicity
// Points which is ignored, have no values.
if (values && node.visible) {
x1 = Math.round(xAxis.translate(values.x, 0, 0, 0, 1)) - crispCorr;
x2 = Math.round(xAxis.translate(values.x + values.width, 0, 0, 0, 1)) - crispCorr;
y1 = Math.round(yAxis.translate(values.y, 0, 0, 0, 1)) - crispCorr;
y2 = Math.round(yAxis.translate(values.y + values.height, 0, 0, 0, 1)) - crispCorr;
// Set point values
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)
};
point.plotX = point.shapeArgs.x + (point.shapeArgs.width / 2);
point.plotY = point.shapeArgs.y + (point.shapeArgs.height / 2);
} else {
// Reset visibility
delete point.plotX;
delete point.plotY;
}
});
},
setColorRecursive: function(node, color, colorIndex) {
var series = this,
point,
level;
if (node) {
point = series.points[node.i];
level = series.levelMap[node.levelDynamic];
// Select either point color, level color or inherited color.
color = pick(point && point.options.color, level && level.color, color);
colorIndex = pick(point && point.options.colorIndex, level && level.colorIndex, colorIndex);
if (point) {
point.color = color;
point.colorIndex = colorIndex;
}
// Do it all again with the children
if (node.children.length) {
each(node.children, function(child) {
series.setColorRecursive(child, color, colorIndex);
});
}
}
},
algorithmGroup: function(h, w, d, p) {
this.height = h;
this.width = w;
this.plot = p;
this.direction = d;
this.startDirection = d;
this.total = 0;
this.nW = 0;
this.lW = 0;
this.nH = 0;
this.lH = 0;
this.elArr = [];
this.lP = {
total: 0,
lH: 0,
nH: 0,
lW: 0,
nW: 0,
nR: 0,
lR: 0,
aspectRatio: function(w, h) {
return Math.max((w / h), (h / w));
}
};
this.addElement = function(el) {
this.lP.total = this.elArr[this.elArr.length - 1];
this.total = this.total + el;
if (this.direction === 0) {
// Calculate last point old aspect ratio
this.lW = this.nW;
this.lP.lH = this.lP.total / this.lW;
this.lP.lR = this.lP.aspectRatio(this.lW, this.lP.lH);
// Calculate last point new aspect ratio
this.nW = this.total / this.height;
this.lP.nH = this.lP.total / this.nW;
this.lP.nR = this.lP.aspectRatio(this.nW, this.lP.nH);
} else {
// Calculate last point old aspect ratio
this.lH = this.nH;
this.lP.lW = this.lP.total / this.lH;
this.lP.lR = this.lP.aspectRatio(this.lP.lW, this.lH);
// Calculate last point new aspect ratio
this.nH = this.total / this.width;
this.lP.nW = this.lP.total / this.nH;
this.lP.nR = this.lP.aspectRatio(this.lP.nW, this.nH);
}
this.elArr.push(el);
};
this.reset = function() {
this.nW = 0;
this.lW = 0;
this.elArr = [];
this.total = 0;
};
},
algorithmCalcPoints: function(directionChange, last, group, childrenArea) {
var pX,
pY,
pW,
pH,
gW = group.lW,
gH = group.lH,
plot = group.plot,
keep,
i = 0,
end = group.elArr.length - 1;
if (last) {
gW = group.nW;
gH = group.nH;
} else {
keep = group.elArr[group.elArr.length - 1];
}
each(group.elArr, function(p) {
if (last || (i < end)) {
if (group.direction === 0) {
pX = plot.x;
pY = plot.y;
pW = gW;
pH = p / pW;
} else {
pX = plot.x;
pY = plot.y;
pH = gH;
pW = p / pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (group.direction === 0) {
plot.y = plot.y + pH;
} else {
plot.x = plot.x + pW;
}
}
i = i + 1;
});
// Reset variables
group.reset();
if (group.direction === 0) {
group.width = group.width - gW;
} else {
group.height = group.height - gH;
}
plot.y = plot.parent.y + (plot.parent.height - group.height);
plot.x = plot.parent.x + (plot.parent.width - group.width);
if (directionChange) {
group.direction = 1 - group.direction;
}
// If not last, then add uncalculated element
if (!last) {
group.addElement(keep);
}
},
algorithmLowAspectRatio: function(directionChange, parent, children) {
var childrenArea = [],
series = this,
pTot,
plot = {
x: parent.x,
y: parent.y,
parent: parent
},
direction = parent.direction,
i = 0,
end = children.length - 1,
group = new this.algorithmGroup(parent.height, parent.width, direction, plot); // eslint-disable-line new-cap
// Loop through and calculate all areas
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
group.addElement(pTot);
if (group.lP.nR > group.lP.lR) {
series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot);
}
// If last child, then calculate all remaining areas
if (i === end) {
series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot);
}
i = i + 1;
});
return childrenArea;
},
algorithmFill: function(directionChange, parent, children) {
var childrenArea = [],
pTot,
direction = parent.direction,
x = parent.x,
y = parent.y,
width = parent.width,
height = parent.height,
pX,
pY,
pW,
pH;
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
pX = x;
pY = y;
if (direction === 0) {
pH = height;
pW = pTot / pH;
width = width - pW;
x = x + pW;
} else {
pW = width;
pH = pTot / pW;
height = height - pH;
y = y + pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (directionChange) {
direction = 1 - direction;
}
});
return childrenArea;
},
strip: function(parent, children) {
return this.algorithmLowAspectRatio(false, parent, children);
},
squarified: function(parent, children) {
return this.algorithmLowAspectRatio(true, parent, children);
},
sliceAndDice: function(parent, children) {
return this.algorithmFill(true, parent, children);
},
stripes: function(parent, children) {
return this.algorithmFill(false, parent, children);
},
translate: function() {
var pointValues,
seriesArea,
tree,
val;
// Call prototype function
Series.prototype.translate.call(this);
// Assign variables
this.rootNode = pick(this.options.rootId, '');
// Create a object map from level to options
this.levelMap = reduce(this.options.levels, function(arr, item) {
arr[item.level] = item;
return arr;
}, {});
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
// Calculate plotting values.
this.axisRatio = (this.xAxis.len / this.yAxis.len);
this.nodeMap[''].pointValues = pointValues = {
x: 0,
y: 0,
width: 100,
height: 100
};
this.nodeMap[''].values = seriesArea = merge(pointValues, {
width: (pointValues.width * this.axisRatio),
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
val: tree.val
});
this.calculateChildrenAreas(tree, seriesArea);
// Logic for point colors
if (this.colorAxis) {
this.translateColors();
} else if (!this.options.colorByPoint) {
this.setColorRecursive(this.tree);
}
// Update axis extremes according to the root node.
if (this.options.allowDrillToNode) {
val = this.nodeMap[this.rootNode].pointValues;
this.xAxis.setExtremes(val.x, val.x + val.width, false);
this.yAxis.setExtremes(val.y, val.y + val.height, false);
this.xAxis.setScale();
this.yAxis.setScale();
}
// Assign values to points.
this.setPointValues();
},
/**
* Extend drawDataLabels with logic to handle custom options related to the treemap series:
* - Points which is not a leaf node, has dataLabels disabled by default.
* - Options set on series.levels is merged in.
* - Width of the dataLabel is set to match the width of the point shape.
*/
drawDataLabels: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
}),
options,
level;
each(points, function(point) {
level = series.levelMap[point.node.levelDynamic];
// Set options to new object to avoid problems with scope
options = {
style: {}
};
// If not a leaf, then label should be disabled as default
if (!point.node.isLeaf) {
options.enabled = false;
}
// If options for level exists, include them as well
if (level && level.dataLabels) {
options = merge(options, level.dataLabels);
series._hasPointLabels = true;
}
// Set dataLabel width to the width of the point shape.
if (point.shapeArgs) {
options.style.width = point.shapeArgs.width;
if (point.dataLabel) {
point.dataLabel.css({
width: point.shapeArgs.width + 'px'
});
}
}
// Merge custom options with point options
point.dlOptions = merge(options, point.options.dataLabels);
});
Series.prototype.drawDataLabels.call(this);
},
/**
* Over the alignment method by setting z index
*/
alignDataLabel: function(point) {
seriesTypes.column.prototype.alignDataLabel.apply(this, arguments);
if (point.dataLabel) {
point.dataLabel.attr({
zIndex: point.node.zIndex + 1
});
}
},
/**
* Extending ColumnSeries drawPoints
*/
drawPoints: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
});
each(points, function(point) {
var groupKey = 'levelGroup-' + point.node.levelDynamic;
if (!series[groupKey]) {
series[groupKey] = series.chart.renderer.g(groupKey)
.attr({
zIndex: 1000 - point.node.levelDynamic // @todo Set the zIndex based upon the number of levels, instead of using 1000
})
.add(series.group);
}
point.group = series[groupKey];
});
// Call standard drawPoints
seriesTypes.column.prototype.drawPoints.call(this);
// If drillToNode is allowed, set a point cursor on clickables & add drillId to point
if (series.options.allowDrillToNode) {
each(points, function(point) {
if (point.graphic) {
point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point);
}
});
}
},
/**
* Add drilling on the suitable points
*/
drillTo: function() {
var series = this;
H.addEvent(series, 'click', function(event) {
var point = event.point,
drillId = point.drillId,
drillName;
// If a drill id is returned, add click event and cursor.
if (drillId) {
drillName = series.nodeMap[series.rootNode].name || series.rootNode;
point.setState(''); // Remove hover
series.drillToNode(drillId);
series.showDrillUpButton(drillName);
}
});
},
/**
* Finds the drill id for a parent node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByGroup: function(point) {
var series = this,
drillId = false;
if ((point.node.level - series.nodeMap[series.rootNode].level) === 1 && !point.node.isLeaf) {
drillId = point.id;
}
return drillId;
},
/**
* Finds the drill id for a leaf node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByLeaf: function(point) {
var series = this,
drillId = false,
nodeParent;
if ((point.node.parent !== series.rootNode) && (point.node.isLeaf)) {
nodeParent = point.node;
while (!drillId) {
nodeParent = series.nodeMap[nodeParent.parent];
if (nodeParent.parent === series.rootNode) {
drillId = nodeParent.id;
}
}
}
return drillId;
},
drillUp: function() {
var drillPoint = null,
node,
parent;
if (this.rootNode) {
node = this.nodeMap[this.rootNode];
if (node.parent !== null) {
drillPoint = this.nodeMap[node.parent];
} else {
drillPoint = this.nodeMap[''];
}
}
if (drillPoint !== null) {
this.drillToNode(drillPoint.id);
if (drillPoint.id === '') {
this.drillUpButton = this.drillUpButton.destroy();
} else {
parent = this.nodeMap[drillPoint.parent];
this.showDrillUpButton((parent.name || parent.id));
}
}
},
drillToNode: function(id) {
this.options.rootId = id;
this.isDirty = true; // Force redraw
this.chart.redraw();
},
showDrillUpButton: function(name) {
var series = this,
backText = (name || '< Back'),
buttonOptions = series.options.drillUpButton,
attr,
states;
if (buttonOptions.text) {
backText = buttonOptions.text;
}
if (!this.drillUpButton) {
attr = buttonOptions.theme;
states = attr && attr.states;
this.drillUpButton = this.chart.renderer.button(
backText,
null,
null,
function() {
series.drillUp();
},
attr,
states && states.hover,
states && states.select
)
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.add()
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
} else {
this.drillUpButton.attr({
text: backText
})
.align();
}
},
buildKDTree: noop,
drawLegendSymbol: H.LegendSymbolMixin.drawRectangle,
getExtremes: function() {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.colorValueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
},
getExtremesFromAll: true,
bindAxes: function() {
var treeAxis = {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 0,
min: 0,
dataMin: 0,
minPadding: 0,
max: 100,
dataMax: 100,
maxPadding: 0,
startOnTick: false,
title: null,
tickPositions: []
};
Series.prototype.bindAxes.call(this);
H.extend(this.yAxis.options, treeAxis);
H.extend(this.xAxis.options, treeAxis);
}
// Point class
}, {
getClassName: function() {
var className = H.Point.prototype.getClassName.call(this),
series = this.series,
options = series.options;
// Above the current level
if (this.node.level <= series.nodeMap[series.rootNode].level) {
className += ' highcharts-above-level';
} else if (!this.node.isLeaf && !pick(options.interactByLeaf, !options.allowDrillToNode)) {
className += ' highcharts-internal-node-interactive';
} else if (!this.node.isLeaf) {
className += ' highcharts-internal-node';
}
return className;
},
setState: function(state) {
H.Point.prototype.setState.call(this, state);
this.graphic.attr({
zIndex: state === 'hover' ? 1 : 0
});
},
setVisible: seriesTypes.pie.prototype.pointClass.prototype.setVisible
});
}(Highcharts));
}));

View File

@@ -0,0 +1,317 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,314 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,243 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,326 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Gray theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,99 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid-light theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,131 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,129 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Sand-Signika theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,112 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Skies theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,121 @@
(function(x,y){"undefined"!==typeof define&&define.amd?define("canvgModule",["rgbcolor","stackblur"],y):"undefined"!==typeof module&&module.exports&&(module.exports=y(require("rgbcolor"),require("stackblur")));x.canvg=y(x.RGBColor,x.stackBlur)})("undefined"!==typeof window?window:this,function(x,y){function A(h){var a=[0,0,0],l=function(c,b){var e=h.match(c);null!=e&&(a[b]+=e.length,h=h.replace(c," "))};h=h.replace(/:not\(([^\)]*)\)/g," $1 ");h=h.replace(/{[^]*/gm," ");l(B,1);l(C,0);l(D,1);l(E,
2);l(F,1);l(G,1);h=h.replace(/[\*\s\+>~]/g," ");h=h.replace(/[#\.]/g," ");l(H,2);return a.join("")}function I(h){var a={opts:h,FRAMERATE:30,MAX_VIRTUAL_PIXELS:3E4,log:function(a){}};1==a.opts.log&&"undefined"!=typeof console&&(a.log=function(a){console.log(a)});a.init=function(c){var b=0;a.UniqueId=function(){b++;return"canvg"+b};a.Definitions={};a.Styles={};a.StylesSpecificity={};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 null!=a&&"number"==typeof a?a:"x"==a?this.width():"y"==a?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 b;return(b=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP"))?(b.open("GET",a,!1),b.send(null),b.responseText):null};a.parseXml=function(a){if("undefined"!=typeof Windows&&"undefined"!=typeof Windows.Data&&"undefined"!=typeof Windows.Data.Xml){var b=
new Windows.Data.Xml.Dom.XmlDocument,e=new Windows.Data.Xml.Dom.XmlLoadSettings;e.prohibitDtd=!1;b.loadXml(a,e);return b}if(window.DOMParser)return(new DOMParser).parseFromString(a,"text/xml");a=a.replace(/<!DOCTYPE svg[^>]*>/,"");b=new ActiveXObject("Microsoft.XMLDOM");b.async="false";b.loadXML(a);return b};a.Property=function(a,b){this.name=a;this.value=b};a.Property.prototype.getValue=function(){return this.value};a.Property.prototype.hasValue=function(){return null!=this.value&&""!==this.value};
a.Property.prototype.numValue=function(){if(!this.hasValue())return 0;var a=parseFloat(this.value);(this.value+"").match(/%$/)&&(a/=100);return a};a.Property.prototype.valueOrDefault=function(a){return this.hasValue()?this.value:a};a.Property.prototype.numValueOrDefault=function(a){return this.hasValue()?this.numValue():a};a.Property.prototype.addOpacity=function(c){var b=this.value;if(null!=c.value&&""!=c.value&&"string"==typeof this.value){var e=new x(this.value);e.ok&&(b="rgba("+e.r+", "+e.g+", "+
e.b+", "+c.numValue()+")")}return new a.Property(this.name,b)};a.Property.prototype.getDefinition=function(){var c=this.value.match(/#([^\)'"]+)/);c&&(c=c[1]);c||(c=this.value);return a.Definitions[c]};a.Property.prototype.isUrlDefinition=function(){return 0==this.value.indexOf("url(")};a.Property.prototype.getFillStyleDefinition=function(c,b){var e=this.getDefinition();if(null!=e&&e.createGradient)return e.createGradient(a.ctx,c,b);if(null!=e&&e.createPattern){if(e.getHrefAttribute().hasValue()){var d=
e.attribute("patternTransform"),e=e.getHrefAttribute().getDefinition();d.hasValue()&&(e.attribute("patternTransform",!0).value=d.value)}return e.createPattern(a.ctx,c)}return null};a.Property.prototype.getDPI=function(a){return 96};a.Property.prototype.getEM=function(c){var b=12,e=new a.Property("fontSize",a.Font.Parse(a.ctx.font).fontSize);e.hasValue()&&(b=e.toPixels(c));return b};a.Property.prototype.getUnits=function(){return(this.value+"").replace(/[0-9\.\-]/g,"")};a.Property.prototype.toPixels=
function(c,b){if(!this.hasValue())return 0;var e=this.value+"";if(e.match(/em$/))return this.numValue()*this.getEM(c);if(e.match(/ex$/))return this.numValue()*this.getEM(c)/2;if(e.match(/px$/))return this.numValue();if(e.match(/pt$/))return this.numValue()*this.getDPI(c)*(1/72);if(e.match(/pc$/))return 15*this.numValue();if(e.match(/cm$/))return this.numValue()*this.getDPI(c)/2.54;if(e.match(/mm$/))return this.numValue()*this.getDPI(c)/25.4;if(e.match(/in$/))return this.numValue()*this.getDPI(c);
if(e.match(/%$/))return this.numValue()*a.ViewPort.ComputeSize(c);e=this.numValue();return b&&1>e?e*a.ViewPort.ComputeSize(c):e};a.Property.prototype.toMilliseconds=function(){if(!this.hasValue())return 0;var a=this.value+"";if(a.match(/s$/))return 1E3*this.numValue();a.match(/ms$/);return this.numValue()};a.Property.prototype.toRadians=function(){if(!this.hasValue())return 0;var a=this.value+"";return a.match(/deg$/)?this.numValue()*(Math.PI/180):a.match(/grad$/)?this.numValue()*(Math.PI/200):a.match(/rad$/)?
this.numValue():this.numValue()*(Math.PI/180)};var l={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"};a.Property.prototype.toTextBaseline=function(){return this.hasValue()?l[this.value]:null};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";this.CreateFont=function(b,e,d,c,f,g){g=null!=g?this.Parse(g):this.CreateFont("","","","","",a.ctx.font);return{fontFamily:f||g.fontFamily,fontSize:c||g.fontSize,fontStyle:b||g.fontStyle,fontWeight:d||g.fontWeight,fontVariant:e||g.fontVariant,toString:function(){return[this.fontStyle,this.fontVariant,this.fontWeight,this.fontSize,this.fontFamily].join(" ")}}};var c=this;this.Parse=function(b){var e={};b=a.trim(a.compressSpaces(b||
"")).split(" ");for(var d=!1,k=!1,f=!1,g=!1,m="",n=0;n<b.length;n++)k||-1==c.Styles.indexOf(b[n])?g||-1==c.Variants.indexOf(b[n])?f||-1==c.Weights.indexOf(b[n])?d?"inherit"!=b[n]&&(m+=b[n]):("inherit"!=b[n]&&(e.fontSize=b[n].split("/")[0]),k=g=f=d=!0):("inherit"!=b[n]&&(e.fontWeight=b[n]),k=g=f=!0):("inherit"!=b[n]&&(e.fontVariant=b[n]),k=g=!0):("inherit"!=b[n]&&(e.fontStyle=b[n]),k=!0);""!=m&&(e.fontFamily=m);return e}};a.ToNumberArray=function(c){c=a.trim(a.compressSpaces((c||"").replace(/,/g," "))).split(" ");
for(var b=0;b<c.length;b++)c[b]=parseFloat(c[b]);return c};a.Point=function(a,b){this.x=a;this.y=b};a.Point.prototype.angleTo=function(a){return Math.atan2(a.y-this.y,a.x-this.x)};a.Point.prototype.applyTransform=function(a){var b=this.x*a[1]+this.y*a[3]+a[5];this.x=this.x*a[0]+this.y*a[2]+a[4];this.y=b};a.CreatePoint=function(c){c=a.ToNumberArray(c);return new a.Point(c[0],c[1])};a.CreatePath=function(c){c=a.ToNumberArray(c);for(var b=[],e=0;e<c.length;e+=2)b.push(new a.Point(c[e],c[e+1]));return b};
a.BoundingBox=function(a,b,e,d){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(a,b){if(null!=a){if(isNaN(this.x1)||isNaN(this.x2))this.x2=this.x1=a;a<this.x1&&(this.x1=a);a>this.x2&&(this.x2=a)}if(null!=b){if(isNaN(this.y1)||isNaN(this.y2))this.y2=this.y1=b;b<this.y1&&(this.y1=b);b>this.y2&&(this.y2=b)}};this.addX=function(a){this.addPoint(a,
null)};this.addY=function(a){this.addPoint(null,a)};this.addBoundingBox=function(a){this.addPoint(a.x1,a.y1);this.addPoint(a.x2,a.y2)};this.addQuadraticCurve=function(a,b,e,d,c,r){e=a+2/3*(e-a);d=b+2/3*(d-b);this.addBezierCurve(a,b,e,e+1/3*(c-a),d,d+1/3*(r-b),c,r)};this.addBezierCurve=function(a,b,e,d,c,r,u,p){var t=[a,b],h=[e,d],q=[c,r],l=[u,p];this.addPoint(t[0],t[1]);this.addPoint(l[0],l[1]);for(i=0;1>=i;i++)a=function(a){return Math.pow(1-a,3)*t[i]+3*Math.pow(1-a,2)*a*h[i]+3*(1-a)*Math.pow(a,
2)*q[i]+Math.pow(a,3)*l[i]},b=6*t[i]-12*h[i]+6*q[i],e=-3*t[i]+9*h[i]-9*q[i]+3*l[i],d=3*h[i]-3*t[i],0==e?0!=b&&(b=-d/b,0<b&&1>b&&(0==i&&this.addX(a(b)),1==i&&this.addY(a(b)))):(d=Math.pow(b,2)-4*d*e,0>d||(c=(-b+Math.sqrt(d))/(2*e),0<c&&1>c&&(0==i&&this.addX(a(c)),1==i&&this.addY(a(c))),b=(-b-Math.sqrt(d))/(2*e),0<b&&1>b&&(0==i&&this.addX(a(b)),1==i&&this.addY(a(b)))))};this.isPointInBox=function(a,b){return this.x1<=a&&a<=this.x2&&this.y1<=b&&b<=this.y2};this.addPoint(a,b);this.addPoint(e,d)};a.Transform=
function(c){var b=this;this.Type={};this.Type.translate=function(b){this.p=a.CreatePoint(b);this.apply=function(a){a.translate(this.p.x||0,this.p.y||0)};this.unapply=function(a){a.translate(-1*this.p.x||0,-1*this.p.y||0)};this.applyToPoint=function(a){a.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(a){a.translate(this.cx,this.cy);a.rotate(this.angle.toRadians());
a.translate(-this.cx,-this.cy)};this.unapply=function(a){a.translate(this.cx,this.cy);a.rotate(-1*this.angle.toRadians());a.translate(-this.cx,-this.cy)};this.applyToPoint=function(a){var b=this.angle.toRadians();a.applyTransform([1,0,0,1,this.p.x||0,this.p.y||0]);a.applyTransform([Math.cos(b),Math.sin(b),-Math.sin(b),Math.cos(b),0,0]);a.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(a){a.scale(this.p.x||1,this.p.y||this.p.x||
1)};this.unapply=function(a){a.scale(1/this.p.x||1,1/this.p.y||this.p.x||1)};this.applyToPoint=function(a){a.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(a){a.transform(this.m[0],this.m[1],this.m[2],this.m[3],this.m[4],this.m[5])};this.unapply=function(a){var b=this.m[0],e=this.m[2],d=this.m[4],c=this.m[1],f=this.m[3],k=this.m[5],h=1/(b*(1*f-0*k)-e*(1*c-0*k)+d*(0*c-0*f));a.transform(h*(1*f-0*k),h*(0*k-1*c),h*(0*d-1*
e),h*(1*b-0*d),h*(e*k-d*f),h*(d*c-b*k))};this.applyToPoint=function(a){a.applyTransform(this.m)}};this.Type.SkewBase=function(e){this.base=b.Type.matrix;this.base(e);this.angle=new a.Property("angle",e)};this.Type.SkewBase.prototype=new this.Type.matrix;this.Type.skewX=function(a){this.base=b.Type.SkewBase;this.base(a);this.m=[1,0,Math.tan(this.angle.toRadians()),1,0,0]};this.Type.skewX.prototype=new this.Type.SkewBase;this.Type.skewY=function(a){this.base=b.Type.SkewBase;this.base(a);this.m=[1,Math.tan(this.angle.toRadians()),
0,1,0,0]};this.Type.skewY.prototype=new this.Type.SkewBase;this.transforms=[];this.apply=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].apply(a)};this.unapply=function(a){for(var b=this.transforms.length-1;0<=b;b--)this.transforms[b].unapply(a)};this.applyToPoint=function(a){for(var b=0;b<this.transforms.length;b++)this.transforms[b].applyToPoint(a)};c=a.trim(a.compressSpaces(c)).replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/);for(var e=0;e<
c.length;e++){var d=a.trim(c[e].split("(")[0]),k=c[e].split("(")[1].replace(")",""),k=new this.Type[d](k);k.type=d;this.transforms.push(k)}};a.AspectRatio=function(c,b,e,d,k,f,g,m,n,r){b=a.compressSpaces(b);b=b.replace(/^defer\s/,"");var h=b.split(" ")[0]||"xMidYMid";b=b.split(" ")[1]||"meet";var p=e/d,t=k/f,l=Math.min(p,t),q=Math.max(p,t);"meet"==b&&(d*=l,f*=l);"slice"==b&&(d*=q,f*=q);n=new a.Property("refX",n);r=new a.Property("refY",r);n.hasValue()&&r.hasValue()?c.translate(-l*n.toPixels("x"),
-l*r.toPixels("y")):(h.match(/^xMid/)&&("meet"==b&&l==t||"slice"==b&&q==t)&&c.translate(e/2-d/2,0),h.match(/YMid$/)&&("meet"==b&&l==p||"slice"==b&&q==p)&&c.translate(0,k/2-f/2),h.match(/^xMax/)&&("meet"==b&&l==t||"slice"==b&&q==t)&&c.translate(e-d,0),h.match(/YMax$/)&&("meet"==b&&l==p||"slice"==b&&q==p)&&c.translate(0,k-f));"none"==h?c.scale(p,t):"meet"==b?c.scale(l,l):"slice"==b&&c.scale(q,q);c.translate(null==g?0:-g,null==m?0:-m)};a.Element={};a.EmptyProperty=new a.Property("EMPTY","");a.Element.ElementBase=
function(c){this.attributes={};this.styles={};this.stylesSpecificity={};this.children=[];this.attribute=function(b,e){var d=this.attributes[b];if(null!=d)return d;1==e&&(d=new a.Property(b,""),this.attributes[b]=d);return d||a.EmptyProperty};this.getHrefAttribute=function(){for(var b in this.attributes)if("href"==b||b.match(/:href$/))return this.attributes[b];return a.EmptyProperty};this.style=function(b,e,d){var c=this.styles[b];if(null!=c)return c;var k=this.attribute(b);if(null!=k&&k.hasValue())return this.styles[b]=
k;if(1!=d&&(d=this.parent,null!=d&&(d=d.style(b),null!=d&&d.hasValue())))return d;1==e&&(c=new a.Property(b,""),this.styles[b]=c);return c||a.EmptyProperty};this.render=function(a){if("none"!=this.style("display").value&&"hidden"!=this.style("visibility").value){a.save();if(this.style("mask").hasValue()){var b=this.style("mask").getDefinition();null!=b&&b.apply(a,this)}else this.style("filter").hasValue()?(b=this.style("filter").getDefinition(),null!=b&&b.apply(a,this)):(this.setContext(a),this.renderChildren(a),
this.clearContext(a));a.restore()}};this.setContext=function(a){};this.clearContext=function(a){};this.renderChildren=function(a){for(var b=0;b<this.children.length;b++)this.children[b].render(a)};this.addChild=function(b,e){var d=b;e&&(d=a.CreateElement(b));d.parent=this;"title"!=d.type&&this.children.push(d)};this.addStylesFromStyleDefinition=function(){for(var b in a.Styles)if("@"!=b[0]&&w(c,b)){var e=a.Styles[b],d=a.StylesSpecificity[b];if(null!=e)for(var k in e){var r=this.stylesSpecificity[k];
"undefined"==typeof r&&(r="000");d>r&&(this.styles[k]=e[k],this.stylesSpecificity[k]=d)}}};if(null!=c&&1==c.nodeType){for(var b=0;b<c.attributes.length;b++){var e=c.attributes[b];this.attributes[e.nodeName]=new a.Property(e.nodeName,e.value)}this.addStylesFromStyleDefinition();if(this.attribute("style").hasValue())for(e=this.attribute("style").value.split(";"),b=0;b<e.length;b++)if(""!=a.trim(e[b])){var d=e[b].split(":"),k=a.trim(d[0]),d=a.trim(d[1]);this.styles[k]=new a.Property(k,d)}this.attribute("id").hasValue()&&
null==a.Definitions[this.attribute("id").value]&&(a.Definitions[this.attribute("id").value]=this);for(b=0;b<c.childNodes.length;b++)e=c.childNodes[b],1==e.nodeType&&this.addChild(e,!0),!this.captureTextNodes||3!=e.nodeType&&4!=e.nodeType||""!=a.compressSpaces(e.value||e.text||e.textContent||"")&&this.addChild(new a.Element.tspan(e),!1)}};a.Element.RenderedElementBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.setContext=function(b){if(this.style("fill").isUrlDefinition()){var e=
this.style("fill").getFillStyleDefinition(this,this.style("fill-opacity"));null!=e&&(b.fillStyle=e)}else this.style("fill").hasValue()&&(e=this.style("fill"),"currentColor"==e.value&&(e.value=this.style("color").value),"inherit"!=e.value&&(b.fillStyle="none"==e.value?"rgba(0,0,0,0)":e.value));this.style("fill-opacity").hasValue()&&(e=new a.Property("fill",b.fillStyle),e=e.addOpacity(this.style("fill-opacity")),b.fillStyle=e.value);this.style("stroke").isUrlDefinition()?(e=this.style("stroke").getFillStyleDefinition(this,
this.style("stroke-opacity")),null!=e&&(b.strokeStyle=e)):this.style("stroke").hasValue()&&(e=this.style("stroke"),"currentColor"==e.value&&(e.value=this.style("color").value),"inherit"!=e.value&&(b.strokeStyle="none"==e.value?"rgba(0,0,0,0)":e.value));this.style("stroke-opacity").hasValue()&&(e=new a.Property("stroke",b.strokeStyle),e=e.addOpacity(this.style("stroke-opacity")),b.strokeStyle=e.value);this.style("stroke-width").hasValue()&&(e=this.style("stroke-width").toPixels(),b.lineWidth=0==e?
.001:e);this.style("stroke-linecap").hasValue()&&(b.lineCap=this.style("stroke-linecap").value);this.style("stroke-linejoin").hasValue()&&(b.lineJoin=this.style("stroke-linejoin").value);this.style("stroke-miterlimit").hasValue()&&(b.miterLimit=this.style("stroke-miterlimit").value);this.style("stroke-dasharray").hasValue()&&"none"!=this.style("stroke-dasharray").value&&(e=a.ToNumberArray(this.style("stroke-dasharray").value),"undefined"!=typeof b.setLineDash?b.setLineDash(e):"undefined"!=typeof b.webkitLineDash?
b.webkitLineDash=e:"undefined"==typeof b.mozDash||1==e.length&&0==e[0]||(b.mozDash=e),e=this.style("stroke-dashoffset").numValueOrDefault(1),"undefined"!=typeof b.lineDashOffset?b.lineDashOffset=e:"undefined"!=typeof b.webkitLineDashOffset?b.webkitLineDashOffset=e:"undefined"!=typeof b.mozDashOffset&&(b.mozDashOffset=e));"undefined"!=typeof b.font&&(b.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").toPixels()+"px":"",this.style("font-family").value).toString());this.style("transform",!1,!0).hasValue()&&(new a.Transform(this.style("transform",!1,!0).value)).apply(b);this.style("clip-path",!1,!0).hasValue()&&(e=this.style("clip-path",!1,!0).getDefinition(),null!=e&&e.apply(b));this.style("opacity").hasValue()&&(b.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(b){null!=b&&b.beginPath();return new a.BoundingBox};this.renderChildren=function(b){this.path(b);a.Mouse.checkPath(this,b);""!=b.fillStyle&&("inherit"!=this.style("fill-rule").valueOrDefault("inherit")?b.fill(this.style("fill-rule").value):b.fill());""!=b.strokeStyle&&b.stroke();var e=this.getMarkers();if(null!=e){if(this.style("marker-start").isUrlDefinition()){var d=this.style("marker-start").getDefinition();d.render(b,e[0][0],e[0][1])}if(this.style("marker-mid").isUrlDefinition())for(var d=
this.style("marker-mid").getDefinition(),c=1;c<e.length-1;c++)d.render(b,e[c][0],e[c][1]);this.style("marker-end").isUrlDefinition()&&(d=this.style("marker-end").getDefinition(),d.render(b,e[e.length-1][0],e[e.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(b){this.baseClearContext(b);a.ViewPort.RemoveCurrent()};this.baseSetContext=this.setContext;this.setContext=function(b){b.strokeStyle="rgba(0,0,0,0)";b.lineCap="butt";b.lineJoin="miter";b.miterLimit=4;"undefined"!=typeof b.font&&"undefined"!=typeof window.getComputedStyle&&(b.font=window.getComputedStyle(b.canvas).getPropertyValue("font"));this.baseSetContext(b);this.attribute("x").hasValue()||(this.attribute("x",!0).value=0);this.attribute("y").hasValue()||(this.attribute("y",
!0).value=0);b.translate(this.attribute("x").toPixels("x"),this.attribute("y").toPixels("y"));var e=a.ViewPort.width(),d=a.ViewPort.height();this.attribute("width").hasValue()||(this.attribute("width",!0).value="100%");this.attribute("height").hasValue()||(this.attribute("height",!0).value="100%");if("undefined"==typeof this.root){var e=this.attribute("width").toPixels("x"),d=this.attribute("height").toPixels("y"),c=0,f=0;this.attribute("refX").hasValue()&&this.attribute("refY").hasValue()&&(c=-this.attribute("refX").toPixels("x"),
f=-this.attribute("refY").toPixels("y"));"visible"!=this.attribute("overflow").valueOrDefault("hidden")&&(b.beginPath(),b.moveTo(c,f),b.lineTo(e,f),b.lineTo(e,d),b.lineTo(c,d),b.closePath(),b.clip())}a.ViewPort.SetCurrent(e,d);if(this.attribute("viewBox").hasValue()){var c=a.ToNumberArray(this.attribute("viewBox").value),f=c[0],g=c[1],e=c[2],d=c[3];a.AspectRatio(b,this.attribute("preserveAspectRatio").value,a.ViewPort.width(),e,a.ViewPort.height(),d,f,g,this.attribute("refX").value,this.attribute("refY").value);
a.ViewPort.RemoveCurrent();a.ViewPort.SetCurrent(c[2],c[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(b){var e=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),c=this.attribute("width").toPixels("x"),f=this.attribute("height").toPixels("y"),g=this.attribute("rx").toPixels("x"),m=this.attribute("ry").toPixels("y");this.attribute("rx").hasValue()&&!this.attribute("ry").hasValue()&&
(m=g);this.attribute("ry").hasValue()&&!this.attribute("rx").hasValue()&&(g=m);g=Math.min(g,c/2);m=Math.min(m,f/2);null!=b&&(b.beginPath(),b.moveTo(e+g,d),b.lineTo(e+c-g,d),b.quadraticCurveTo(e+c,d,e+c,d+m),b.lineTo(e+c,d+f-m),b.quadraticCurveTo(e+c,d+f,e+c-g,d+f),b.lineTo(e+g,d+f),b.quadraticCurveTo(e,d+f,e,d+f-m),b.lineTo(e,d+m),b.quadraticCurveTo(e,d,e+g,d),b.closePath());return new a.BoundingBox(e,d,e+c,d+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(b){var e=this.attribute("cx").toPixels("x"),d=this.attribute("cy").toPixels("y"),c=this.attribute("r").toPixels();null!=b&&(b.beginPath(),b.arc(e,d,c,0,2*Math.PI,!0),b.closePath());return new a.BoundingBox(e-c,d-c,e+c,d+c)}};a.Element.circle.prototype=new a.Element.PathElementBase;a.Element.ellipse=function(c){this.base=a.Element.PathElementBase;this.base(c);this.path=function(b){var e=(Math.sqrt(2)-1)/3*4,d=this.attribute("rx").toPixels("x"),
c=this.attribute("ry").toPixels("y"),f=this.attribute("cx").toPixels("x"),g=this.attribute("cy").toPixels("y");null!=b&&(b.beginPath(),b.moveTo(f,g-c),b.bezierCurveTo(f+e*d,g-c,f+d,g-e*c,f+d,g),b.bezierCurveTo(f+d,g+e*c,f+e*d,g+c,f,g+c),b.bezierCurveTo(f-e*d,g+c,f-d,g+e*c,f-d,g),b.bezierCurveTo(f-d,g-e*c,f-e*d,g-c,f,g-c),b.closePath());return new a.BoundingBox(f-d,g-c,f+d,g+c)}};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").toPixels("x"),this.attribute("y1").toPixels("y")),new a.Point(this.attribute("x2").toPixels("x"),this.attribute("y2").toPixels("y"))]};this.path=function(b){var e=this.getPoints();null!=b&&(b.beginPath(),b.moveTo(e[0].x,e[0].y),b.lineTo(e[1].x,e[1].y));return new a.BoundingBox(e[0].x,e[0].y,e[1].x,e[1].y)};this.getMarkers=function(){var a=this.getPoints(),e=a[0].angleTo(a[1]);return[[a[0],e],[a[1],e]]}};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(b){var e=new a.BoundingBox(this.points[0].x,this.points[0].y);null!=b&&(b.beginPath(),b.moveTo(this.points[0].x,this.points[0].y));for(var d=1;d<this.points.length;d++)e.addPoint(this.points[d].x,this.points[d].y),null!=b&&b.lineTo(this.points[d].x,this.points[d].y);return e};this.getMarkers=function(){for(var a=[],
e=0;e<this.points.length-1;e++)a.push([this.points[e],this.points[e].angleTo(this.points[e+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 e=this.basePath(a);null!=a&&(a.lineTo(this.points[0].x,this.points[0].y),a.closePath());return e}};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," ");for(var b=0;2>b;b++)c=c.replace(/([MmZzLlHhVvCcSsQqTtAa])([^\s])/gm,"$1 $2");c=c.replace(/([^\s])([MmZzLlHhVvCcSsQqTtAa])/gm,"$1 $2");c=c.replace(/([0-9])([+\-])/gm,"$1 $2");for(b=0;2>b;b++)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(b){this.tokens=b.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:null!=this.tokens[this.i+1].match(/^[A-Za-z]$/)};this.isRelativeCommand=function(){switch(this.command){case "m":case "l":case "h":case "v":case "c":case "s":case "q":case "t":case "a":case "z":return!0}return!1};
this.getToken=function(){this.i++;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(){var b=new a.Point(this.getScalar(),this.getScalar());return this.makeAbsolute(b)};this.getAsControlPoint=function(){var a=this.getPoint();return this.control=a};this.getAsCurrentPoint=function(){var a=this.getPoint();return this.current=a};this.getReflectedControlPoint=
function(){return"c"!=this.previousCommand.toLowerCase()&&"s"!=this.previousCommand.toLowerCase()&&"q"!=this.previousCommand.toLowerCase()&&"t"!=this.previousCommand.toLowerCase()?this.current:new a.Point(2*this.current.x-this.control.x,2*this.current.y-this.control.y)};this.makeAbsolute=function(a){this.isRelativeCommand()&&(a.x+=this.current.x,a.y+=this.current.y);return a};this.addMarker=function(a,b,e){null!=e&&0<this.angles.length&&null==this.angles[this.angles.length-1]&&(this.angles[this.angles.length-
1]=this.points[this.points.length-1].angleTo(e));this.addMarkerAngle(a,null==b?null:b.angleTo(a))};this.addMarkerAngle=function(a,b){this.points.push(a);this.angles.push(b)};this.getMarkerPoints=function(){return this.points};this.getMarkerAngles=function(){for(var a=0;a<this.angles.length;a++)if(null==this.angles[a])for(var b=a+1;b<this.angles.length;b++)if(null!=this.angles[b]){this.angles[a]=this.angles[b];break}return this.angles}}(c);this.path=function(b){var d=this.PathParser;d.reset();var c=
new a.BoundingBox;for(null!=b&&b.beginPath();!d.isEnd();)switch(d.nextCommand(),d.command){case "M":case "m":var f=d.getAsCurrentPoint();d.addMarker(f);c.addPoint(f.x,f.y);null!=b&&b.moveTo(f.x,f.y);for(d.start=d.current;!d.isCommandOrEnd();)f=d.getAsCurrentPoint(),d.addMarker(f,d.start),c.addPoint(f.x,f.y),null!=b&&b.lineTo(f.x,f.y);break;case "L":case "l":for(;!d.isCommandOrEnd();){var g=d.current,f=d.getAsCurrentPoint();d.addMarker(f,g);c.addPoint(f.x,f.y);null!=b&&b.lineTo(f.x,f.y)}break;case "H":case "h":for(;!d.isCommandOrEnd();)f=
new a.Point((d.isRelativeCommand()?d.current.x:0)+d.getScalar(),d.current.y),d.addMarker(f,d.current),d.current=f,c.addPoint(d.current.x,d.current.y),null!=b&&b.lineTo(d.current.x,d.current.y);break;case "V":case "v":for(;!d.isCommandOrEnd();)f=new a.Point(d.current.x,(d.isRelativeCommand()?d.current.y:0)+d.getScalar()),d.addMarker(f,d.current),d.current=f,c.addPoint(d.current.x,d.current.y),null!=b&&b.lineTo(d.current.x,d.current.y);break;case "C":case "c":for(;!d.isCommandOrEnd();){var m=d.current,
g=d.getPoint(),n=d.getAsControlPoint(),f=d.getAsCurrentPoint();d.addMarker(f,n,g);c.addBezierCurve(m.x,m.y,g.x,g.y,n.x,n.y,f.x,f.y);null!=b&&b.bezierCurveTo(g.x,g.y,n.x,n.y,f.x,f.y)}break;case "S":case "s":for(;!d.isCommandOrEnd();)m=d.current,g=d.getReflectedControlPoint(),n=d.getAsControlPoint(),f=d.getAsCurrentPoint(),d.addMarker(f,n,g),c.addBezierCurve(m.x,m.y,g.x,g.y,n.x,n.y,f.x,f.y),null!=b&&b.bezierCurveTo(g.x,g.y,n.x,n.y,f.x,f.y);break;case "Q":case "q":for(;!d.isCommandOrEnd();)m=d.current,
n=d.getAsControlPoint(),f=d.getAsCurrentPoint(),d.addMarker(f,n,n),c.addQuadraticCurve(m.x,m.y,n.x,n.y,f.x,f.y),null!=b&&b.quadraticCurveTo(n.x,n.y,f.x,f.y);break;case "T":case "t":for(;!d.isCommandOrEnd();)m=d.current,n=d.getReflectedControlPoint(),d.control=n,f=d.getAsCurrentPoint(),d.addMarker(f,n,n),c.addQuadraticCurve(m.x,m.y,n.x,n.y,f.x,f.y),null!=b&&b.quadraticCurveTo(n.x,n.y,f.x,f.y);break;case "A":case "a":for(;!d.isCommandOrEnd();){var m=d.current,r=d.getScalar(),h=d.getScalar(),g=d.getScalar()*
(Math.PI/180),p=d.getScalar(),n=d.getScalar(),f=d.getAsCurrentPoint(),l=new a.Point(Math.cos(g)*(m.x-f.x)/2+Math.sin(g)*(m.y-f.y)/2,-Math.sin(g)*(m.x-f.x)/2+Math.cos(g)*(m.y-f.y)/2),v=Math.pow(l.x,2)/Math.pow(r,2)+Math.pow(l.y,2)/Math.pow(h,2);1<v&&(r*=Math.sqrt(v),h*=Math.sqrt(v));p=(p==n?-1:1)*Math.sqrt((Math.pow(r,2)*Math.pow(h,2)-Math.pow(r,2)*Math.pow(l.y,2)-Math.pow(h,2)*Math.pow(l.x,2))/(Math.pow(r,2)*Math.pow(l.y,2)+Math.pow(h,2)*Math.pow(l.x,2)));isNaN(p)&&(p=0);var q=new a.Point(p*r*l.y/
h,p*-h*l.x/r),m=new a.Point((m.x+f.x)/2+Math.cos(g)*q.x-Math.sin(g)*q.y,(m.y+f.y)/2+Math.sin(g)*q.x+Math.cos(g)*q.y),w=function(a,b){return(a[0]*b[0]+a[1]*b[1])/(Math.sqrt(Math.pow(a[0],2)+Math.pow(a[1],2))*Math.sqrt(Math.pow(b[0],2)+Math.pow(b[1],2)))},x=function(a,b){return(a[0]*b[1]<a[1]*b[0]?-1:1)*Math.acos(w(a,b))},p=x([1,0],[(l.x-q.x)/r,(l.y-q.y)/h]),v=[(l.x-q.x)/r,(l.y-q.y)/h],q=[(-l.x-q.x)/r,(-l.y-q.y)/h],l=x(v,q);-1>=w(v,q)&&(l=Math.PI);1<=w(v,q)&&(l=0);v=1-n?1:-1;q=p+l/2*v;x=new a.Point(m.x+
r*Math.cos(q),m.y+h*Math.sin(q));d.addMarkerAngle(x,q-v*Math.PI/2);d.addMarkerAngle(f,q-v*Math.PI);c.addPoint(f.x,f.y);null!=b&&(w=r>h?r:h,f=r>h?1:r/h,r=r>h?h/r:1,b.translate(m.x,m.y),b.rotate(g),b.scale(f,r),b.arc(0,0,w,p,p+l,1-n),b.scale(1/f,1/r),b.rotate(-g),b.translate(-m.x,-m.y))}break;case "Z":case "z":null!=b&&b.closePath(),d.current=d.start}return c};this.getMarkers=function(){for(var a=this.PathParser.getMarkerPoints(),b=this.PathParser.getMarkerAngles(),c=[],f=0;f<a.length;f++)c.push([a[f],
b[f]]);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(b,e){var d=this.attribute("width").toPixels("x",!0),c=this.attribute("height").toPixels("y",!0),f=new a.Element.svg;f.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);f.attributes.width=new a.Property("width",d+"px");f.attributes.height=new a.Property("height",c+"px");f.attributes.transform=new a.Property("transform",
this.attribute("patternTransform").value);f.children=this.children;var g=document.createElement("canvas");g.width=d;g.height=c;d=g.getContext("2d");this.attribute("x").hasValue()&&this.attribute("y").hasValue()&&d.translate(this.attribute("x").toPixels("x",!0),this.attribute("y").toPixels("y",!0));for(c=-1;1>=c;c++)for(var m=-1;1>=m;m++)d.save(),f.attributes.x=new a.Property("x",c*g.width),f.attributes.y=new a.Property("y",m*g.height),f.render(d),d.restore();return b.createPattern(g,"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(b,e,d){b.translate(e.x,e.y);"auto"==this.attribute("orient").valueOrDefault("auto")&&b.rotate(d);"strokeWidth"==this.attribute("markerUnits").valueOrDefault("strokeWidth")&&b.scale(b.lineWidth,b.lineWidth);b.save();var c=new a.Element.svg;c.attributes.viewBox=new a.Property("viewBox",this.attribute("viewBox").value);c.attributes.refX=new a.Property("refX",
this.attribute("refX").value);c.attributes.refY=new a.Property("refY",this.attribute("refY").value);c.attributes.width=new a.Property("width",this.attribute("markerWidth").value);c.attributes.height=new a.Property("height",this.attribute("markerHeight").value);c.attributes.fill=new a.Property("fill",this.attribute("fill").valueOrDefault("black"));c.attributes.stroke=new a.Property("stroke",this.attribute("stroke").valueOrDefault("none"));c.children=this.children;c.render(b);b.restore();"strokeWidth"==
this.attribute("markerUnits").valueOrDefault("strokeWidth")&&b.scale(1/b.lineWidth,1/b.lineWidth);"auto"==this.attribute("orient").valueOrDefault("auto")&&b.rotate(-d);b.translate(-e.x,-e.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){}};a.Element.defs.prototype=new a.Element.ElementBase;a.Element.GradientBase=function(c){this.base=a.Element.ElementBase;this.base(c);this.stops=[];for(c=0;c<this.children.length;c++){var b=
this.children[c];"stop"==b.type&&this.stops.push(b)}this.getGradient=function(){};this.gradientUnits=function(){return this.attribute("gradientUnits").valueOrDefault("objectBoundingBox")};this.attributesToInherit=["gradientUnits"];this.inheritStopContainer=function(a){for(var b=0;b<this.attributesToInherit.length;b++){var c=this.attributesToInherit[b];!this.attribute(c).hasValue()&&a.attribute(c).hasValue()&&(this.attribute(c,!0).value=a.attribute(c).value)}};this.createGradient=function(b,d,c){var f=
this;this.getHrefAttribute().hasValue()&&(f=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(f));var g=function(b){return c.hasValue()?(new a.Property("color",b)).addOpacity(c).value:b};b=this.getGradient(b,d);if(null==b)return g(f.stops[f.stops.length-1].color);for(d=0;d<f.stops.length;d++)b.addColorStop(f.stops[d].offset,g(f.stops[d].color));return this.attribute("gradientTransform").hasValue()?(f=a.ViewPort.viewPorts[0],g=new a.Element.rect,g.attributes.x=new a.Property("x",-a.MAX_VIRTUAL_PIXELS/
3),g.attributes.y=new a.Property("y",-a.MAX_VIRTUAL_PIXELS/3),g.attributes.width=new a.Property("width",a.MAX_VIRTUAL_PIXELS),g.attributes.height=new a.Property("height",a.MAX_VIRTUAL_PIXELS),d=new a.Element.g,d.attributes.transform=new a.Property("transform",this.attribute("gradientTransform").value),d.children=[g],g=new a.Element.svg,g.attributes.x=new a.Property("x",0),g.attributes.y=new a.Property("y",0),g.attributes.width=new a.Property("width",f.width),g.attributes.height=new a.Property("height",
f.height),g.children=[d],d=document.createElement("canvas"),d.width=f.width,d.height=f.height,f=d.getContext("2d"),f.fillStyle=b,g.render(f),f.createPattern(d,"no-repeat")):b}};a.Element.GradientBase.prototype=new a.Element.ElementBase;a.Element.linearGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.attributesToInherit.push("x1");this.attributesToInherit.push("y1");this.attributesToInherit.push("x2");this.attributesToInherit.push("y2");this.getGradient=function(a,e){var d="objectBoundingBox"==
this.gradientUnits()?e.getBoundingBox():null;this.attribute("x1").hasValue()||this.attribute("y1").hasValue()||this.attribute("x2").hasValue()||this.attribute("y2").hasValue()||(this.attribute("x1",!0).value=0,this.attribute("y1",!0).value=0,this.attribute("x2",!0).value=1,this.attribute("y2",!0).value=0);var c="objectBoundingBox"==this.gradientUnits()?d.x()+d.width()*this.attribute("x1").numValue():this.attribute("x1").toPixels("x"),f="objectBoundingBox"==this.gradientUnits()?d.y()+d.height()*this.attribute("y1").numValue():
this.attribute("y1").toPixels("y"),g="objectBoundingBox"==this.gradientUnits()?d.x()+d.width()*this.attribute("x2").numValue():this.attribute("x2").toPixels("x"),d="objectBoundingBox"==this.gradientUnits()?d.y()+d.height()*this.attribute("y2").numValue():this.attribute("y2").toPixels("y");return c==g&&f==d?null:a.createLinearGradient(c,f,g,d)}};a.Element.linearGradient.prototype=new a.Element.GradientBase;a.Element.radialGradient=function(c){this.base=a.Element.GradientBase;this.base(c);this.attributesToInherit.push("cx");
this.attributesToInherit.push("cy");this.attributesToInherit.push("r");this.attributesToInherit.push("fx");this.attributesToInherit.push("fy");this.getGradient=function(a,e){var c=e.getBoundingBox();this.attribute("cx").hasValue()||(this.attribute("cx",!0).value="50%");this.attribute("cy").hasValue()||(this.attribute("cy",!0).value="50%");this.attribute("r").hasValue()||(this.attribute("r",!0).value="50%");var k="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("cx").numValue():
this.attribute("cx").toPixels("x"),f="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("cy").numValue():this.attribute("cy").toPixels("y"),g=k,m=f;this.attribute("fx").hasValue()&&(g="objectBoundingBox"==this.gradientUnits()?c.x()+c.width()*this.attribute("fx").numValue():this.attribute("fx").toPixels("x"));this.attribute("fy").hasValue()&&(m="objectBoundingBox"==this.gradientUnits()?c.y()+c.height()*this.attribute("fy").numValue():this.attribute("fy").toPixels("y"));c="objectBoundingBox"==
this.gradientUnits()?(c.width()+c.height())/2*this.attribute("r").numValue():this.attribute("r").toPixels();return a.createRadialGradient(g,m,0,k,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();0>this.offset&&(this.offset=0);1<this.offset&&(this.offset=1);c=this.style("stop-color",!0);""===c.value&&(c.value="#000");this.style("stop-opacity").hasValue()&&(c=c.addOpacity(this.style("stop-opacity")));
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").toMilliseconds();this.maxDuration=this.begin+this.attribute("dur").toMilliseconds();this.getProperty=function(){var a=this.attribute("attributeType").value,c=this.attribute("attributeName").value;return"CSS"==a?this.parent.style(c,!0):this.parent.attribute(c,!0)};this.initialValue=
null;this.initialUnits="";this.removed=!1;this.calcValue=function(){return""};this.update=function(a){null==this.initialValue&&(this.initialValue=this.getProperty().value,this.initialUnits=this.getProperty().getUnits());if(this.duration>this.maxDuration){if("indefinite"==this.attribute("repeatCount").value||"indefinite"==this.attribute("repeatDur").value)this.duration=0;else if("freeze"==this.attribute("fill").valueOrDefault("remove")&&!this.frozen)this.frozen=!0,this.parent.animationFrozen=!0,this.parent.animationFrozenValue=
this.getProperty().value;else if("remove"==this.attribute("fill").valueOrDefault("remove")&&!this.removed)return this.removed=!0,this.getProperty().value=this.parent.animationFrozen?this.parent.animationFrozenValue:this.initialValue,!0;return!1}this.duration+=a;a=!1;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.from=this.attribute("from");this.to=this.attribute("to");this.values=
this.attribute("values");this.values.hasValue()&&(this.values.value=this.values.value.split(";"));this.progress=function(){var b={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(this.values.hasValue()){var c=b.progress*(this.values.value.length-1),d=Math.floor(c),k=Math.ceil(c);b.from=new a.Property("from",parseFloat(this.values.value[d]));b.to=new a.Property("to",parseFloat(this.values.value[k]));b.progress=(c-d)/(k-d)}else b.from=this.from,b.to=this.to;return b}};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.progress();return a.from.numValue()+(a.to.numValue()-a.from.numValue())*a.progress+this.initialUnits}};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=this.progress(),c=new x(a.from.value),d=new x(a.to.value);if(c.ok&&d.ok){var k=c.g+(d.g-c.g)*a.progress,
f=c.b+(d.b-c.b)*a.progress;return"rgb("+parseInt(c.r+(d.r-c.r)*a.progress,10)+","+parseInt(k,10)+","+parseInt(f,10)+")"}return this.attribute("from").value}};a.Element.animateColor.prototype=new a.Element.AnimateBase;a.Element.animateTransform=function(c){this.base=a.Element.AnimateBase;this.base(c);this.calcValue=function(){for(var b=this.progress(),c=a.ToNumberArray(b.from.value),d=a.ToNumberArray(b.to.value),k="",f=0;f<c.length;f++)k+=c[f]+(d[f]-c[f])*b.progress+" ";return k}};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 b=this.children[c];"font-face"==b.type?(this.fontFace=b,b.style("font-family").hasValue()&&(a.Definitions[b.style("font-family").value]=this)):"missing-glyph"==b.type?this.missingGlyph=b:"glyph"==b.type&&(""!=b.arabicForm?(this.isArabic=
this.isRTL=!0,"undefined"==typeof this.glyphs[b.unicode]&&(this.glyphs[b.unicode]=[]),this.glyphs[b.unicode][b.arabicForm]=b):this.glyphs[b.unicode]=b)}};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.captureTextNodes=!0;this.base=a.Element.RenderedElementBase;this.base(c);this.baseSetContext=
this.setContext;this.setContext=function(a){this.baseSetContext(a);var c=this.style("dominant-baseline").toTextBaseline();null==c&&(c=this.style("alignment-baseline").toTextBaseline());null!=c&&(a.textBaseline=c)};this.getBoundingBox=function(){var b=this.attribute("x").toPixels("x"),c=this.attribute("y").toPixels("y"),d=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize);return new a.BoundingBox(b,c-d,b+Math.floor(2*d/3)*this.children[0].getText().length,c)};this.renderChildren=
function(a){this.x=this.attribute("x").toPixels("x");this.y=this.attribute("y").toPixels("y");this.attribute("dx").hasValue()&&(this.x+=this.attribute("dx").toPixels("x"));this.attribute("dy").hasValue()&&(this.y+=this.attribute("dy").toPixels("y"));this.x+=this.getAnchorDelta(a,this,0);for(var c=0;c<this.children.length;c++)this.renderChild(a,this,c)};this.getAnchorDelta=function(a,c,d){var k=this.style("text-anchor").valueOrDefault("start");if("start"!=k){for(var f=0,g=d;g<c.children.length;g++){var m=
c.children[g];if(g>d&&m.attribute("x").hasValue())break;f+=m.measureTextRecursive(a)}return-1*("end"==k?f:f/2)}return 0};this.renderChild=function(a,c,d){var k=c.children[d];k.attribute("x").hasValue()?(k.x=k.attribute("x").toPixels("x")+c.getAnchorDelta(a,c,d),k.attribute("dx").hasValue()&&(k.x+=k.attribute("dx").toPixels("x"))):(k.attribute("dx").hasValue()&&(c.x+=k.attribute("dx").toPixels("x")),k.x=c.x);c.x=k.x+k.measureText(a);k.attribute("y").hasValue()?(k.y=k.attribute("y").toPixels("y"),k.attribute("dy").hasValue()&&
(k.y+=k.attribute("dy").toPixels("y"))):(k.attribute("dy").hasValue()&&(c.y+=k.attribute("dy").toPixels("y")),k.y=c.y);c.y=k.y;k.render(a);for(d=0;d<k.children.length;d++)c.renderChild(a,k,d)}};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,c,d){var k=c[d],f=null;if(a.isArabic){var g="isolated";(0==d||" "==c[d-1])&&d<c.length-2&&" "!=c[d+1]&&(g="terminal");0<d&&" "!=c[d-
1]&&d<c.length-2&&" "!=c[d+1]&&(g="medial");0<d&&" "!=c[d-1]&&(d==c.length-1||" "==c[d+1])&&(g="initial");"undefined"!=typeof a.glyphs[k]&&(f=a.glyphs[k][g],null==f&&"glyph"==a.glyphs[k].type&&(f=a.glyphs[k]))}else f=a.glyphs[k];null==f&&(f=a.missingGlyph);return f};this.renderChildren=function(b){var c=this.parent.style("font-family").getDefinition();if(null!=c){var d=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize),k=this.parent.style("font-style").valueOrDefault(a.Font.Parse(a.ctx.font).fontStyle),
f=this.getText();c.isRTL&&(f=f.split("").reverse().join(""));for(var g=a.ToNumberArray(this.parent.attribute("dx").value),m=0;m<f.length;m++){var n=this.getGlyph(c,f,m),h=d/c.fontFace.unitsPerEm;b.translate(this.x,this.y);b.scale(h,-h);var l=b.lineWidth;b.lineWidth=b.lineWidth*c.fontFace.unitsPerEm/d;"italic"==k&&b.transform(1,0,.4,1,0,0);n.render(b);"italic"==k&&b.transform(1,0,-.4,1,0,0);b.lineWidth=l;b.scale(1/h,-1/h);b.translate(-this.x,-this.y);this.x+=d*(n.horizAdvX||c.horizAdvX)/c.fontFace.unitsPerEm;
"undefined"==typeof g[m]||isNaN(g[m])||(this.x+=g[m])}}else""!=b.fillStyle&&b.fillText(a.compressSpaces(this.getText()),this.x,this.y),""!=b.strokeStyle&&b.strokeText(a.compressSpaces(this.getText()),this.x,this.y)};this.getText=function(){};this.measureTextRecursive=function(a){for(var c=this.measureText(a),d=0;d<this.children.length;d++)c+=this.children[d].measureTextRecursive(a);return c};this.measureText=function(b){var c=this.parent.style("font-family").getDefinition();if(null!=c){b=this.parent.style("font-size").numValueOrDefault(a.Font.Parse(a.ctx.font).fontSize);
var d=0,k=this.getText();c.isRTL&&(k=k.split("").reverse().join(""));for(var f=a.ToNumberArray(this.parent.attribute("dx").value),g=0;g<k.length;g++){var m=this.getGlyph(c,k,g),d=d+(m.horizAdvX||c.horizAdvX)*b/c.fontFace.unitsPerEm;"undefined"==typeof f[g]||isNaN(f[g])||(d+=f[g])}return d}c=a.compressSpaces(this.getText());if(!b.measureText)return 10*c.length;b.save();this.setContext(b);c=b.measureText(c).width;b.restore();return c}};a.Element.TextElementBase.prototype=new a.Element.RenderedElementBase;
a.Element.tspan=function(c){this.captureTextNodes=!0;this.base=a.Element.TextElementBase;this.base(c);this.text=a.compressSpaces(c.value||c.text||c.textContent||"");this.getText=function(){return 0<this.children.length?"":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.getHrefAttribute().getDefinition();if(null!=a)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<c.childNodes.length;for(var b=0;b<c.childNodes.length;b++)3!=c.childNodes[b].nodeType&&(this.hasText=!1);this.text=this.hasText?c.childNodes[0].value:"";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.toPixels("y"),this.x+this.measureText(b),this.y))}else 0<this.children.length&&(c=new a.Element.g,c.children=this.children,c.parent=this,c.render(b))};this.onclick=function(){window.open(this.getHrefAttribute().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);var b=this.getHrefAttribute().value;if(""!=b){var e=
b.match(/\.svg$/);a.Images.push(this);this.loaded=!1;if(e)this.img=a.ajax(b),this.loaded=!0;else{this.img=document.createElement("img");1==a.opts.useCORS&&(this.img.crossOrigin="Anonymous");var d=this;this.img.onload=function(){d.loaded=!0};this.img.onerror=function(){a.log('ERROR: image "'+b+'" not found');d.loaded=!0};this.img.src=b}this.renderChildren=function(b){var c=this.attribute("x").toPixels("x"),d=this.attribute("y").toPixels("y"),m=this.attribute("width").toPixels("x"),n=this.attribute("height").toPixels("y");
0!=m&&0!=n&&(b.save(),e?b.drawSvg(this.img,c,d,m,n):(b.translate(c,d),a.AspectRatio(b,this.attribute("preserveAspectRatio").value,m,this.img.width,n,this.img.height,0,0),b.drawImage(this.img,0,0)),b.restore())};this.getBoundingBox=function(){var b=this.attribute("x").toPixels("x"),c=this.attribute("y").toPixels("y"),d=this.attribute("width").toPixels("x"),e=this.attribute("height").toPixels("y");return new a.BoundingBox(b,c,b+d,c+e)}}};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 b=new a.BoundingBox,c=0;c<this.children.length;c++)b.addBoundingBox(this.children[c].getBoundingBox());return b}};a.Element.g.prototype=new a.Element.RenderedElementBase;a.Element.symbol=function(c){this.base=a.Element.RenderedElementBase;this.base(c);this.render=function(a){}};a.Element.symbol.prototype=new a.Element.RenderedElementBase;a.Element.style=function(c){this.base=a.Element.ElementBase;
this.base(c);for(var b="",e=0;e<c.childNodes.length;e++)b+=c.childNodes[e].data;b=b.replace(/(\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"");b=a.compressSpaces(b);c=b.split("}");for(e=0;e<c.length;e++)if(""!=a.trim(c[e]))for(var d=c[e].split("{"),b=d[0].split(","),d=d[1].split(";"),k=0;k<b.length;k++){var f=a.trim(b[k]);if(""!=f){for(var g=a.Styles[f]||{},m=0;m<d.length;m++){var n=d[m].indexOf(":"),h=d[m].substr(0,n),n=d[m].substr(n+1,d[m].length-n);null!=h&&null!=n&&(g[a.trim(h)]=
new a.Property(a.trim(h),a.trim(n)))}a.Styles[f]=g;a.StylesSpecificity[f]=A(f);if("@font-face"==f)for(f=g["font-family"].value.replace(/"/g,""),g=g.src.value.split(","),m=0;m<g.length;m++)if(0<g[m].indexOf('format("svg")'))for(h=g[m].indexOf("url"),n=g[m].indexOf(")",h),h=g[m].substr(h+5,n-h-6),h=a.parseXml(a.ajax(h)).getElementsByTagName("font"),n=0;n<h.length;n++){var l=a.CreateElement(h[n]);a.Definitions[f]=l}}}};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").toPixels("x"),0);this.attribute("y").hasValue()&&a.translate(0,this.attribute("y").toPixels("y"))};var b=this.getHrefAttribute().getDefinition();this.path=function(a){null!=b&&b.path(a)};this.getBoundingBox=function(){if(null!=b)return b.getBoundingBox()};this.renderChildren=function(c){if(null!=b){var d=b;
"symbol"==b.type&&(d=new a.Element.svg,d.type="svg",d.attributes.viewBox=new a.Property("viewBox",b.attribute("viewBox").value),d.attributes.preserveAspectRatio=new a.Property("preserveAspectRatio",b.attribute("preserveAspectRatio").value),d.attributes.overflow=new a.Property("overflow",b.attribute("overflow").value),d.children=b.children);"svg"==d.type&&(this.attribute("width").hasValue()&&(d.attributes.width=new a.Property("width",this.attribute("width").value)),this.attribute("height").hasValue()&&
(d.attributes.height=new a.Property("height",this.attribute("height").value)));var k=d.parent;d.parent=null;d.render(c);d.parent=k}}};a.Element.use.prototype=new a.Element.RenderedElementBase;a.Element.mask=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(b,c){var d=this.attribute("x").toPixels("x"),k=this.attribute("y").toPixels("y"),f=this.attribute("width").toPixels("x"),g=this.attribute("height").toPixels("y");if(0==f&&0==g){g=new a.BoundingBox;for(d=0;d<this.children.length;d++)g.addBoundingBox(this.children[d].getBoundingBox());
d=Math.floor(g.x1);k=Math.floor(g.y1);f=Math.floor(g.width());g=Math.floor(g.height())}var m=c.attribute("mask").value;c.attribute("mask").value="";var n=document.createElement("canvas");n.width=d+f;n.height=k+g;var h=n.getContext("2d");this.renderChildren(h);var l=document.createElement("canvas");l.width=d+f;l.height=k+g;var p=l.getContext("2d");c.render(p);p.globalCompositeOperation="destination-in";p.fillStyle=h.createPattern(n,"no-repeat");p.fillRect(0,0,d+f,k+g);b.fillStyle=p.createPattern(l,
"no-repeat");b.fillRect(0,0,d+f,k+g);c.attribute("mask").value=m};this.render=function(a){}};a.Element.mask.prototype=new a.Element.ElementBase;a.Element.clipPath=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(b){var c=CanvasRenderingContext2D.prototype.beginPath;CanvasRenderingContext2D.prototype.beginPath=function(){};var d=CanvasRenderingContext2D.prototype.closePath;CanvasRenderingContext2D.prototype.closePath=function(){};c.call(b);for(var k=0;k<this.children.length;k++){var f=
this.children[k];if("undefined"!=typeof f.path){var g=null;f.style("transform",!1,!0).hasValue()&&(g=new a.Transform(f.style("transform",!1,!0).value),g.apply(b));f.path(b);CanvasRenderingContext2D.prototype.closePath=d;g&&g.unapply(b)}}d.call(b);b.clip();CanvasRenderingContext2D.prototype.beginPath=c;CanvasRenderingContext2D.prototype.closePath=d};this.render=function(a){}};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,c){var d=c.getBoundingBox(),k=Math.floor(d.x1),f=Math.floor(d.y1),g=Math.floor(d.width()),d=Math.floor(d.height()),m=c.style("filter").value;c.style("filter").value="";for(var h=0,l=0,u=0;u<this.children.length;u++)var p=this.children[u].extraFilterDistance||0,h=Math.max(h,p),l=Math.max(l,p);p=document.createElement("canvas");p.width=g+2*h;p.height=d+2*l;var t=p.getContext("2d");t.translate(-k+h,-f+l);c.render(t);for(u=0;u<this.children.length;u++)"function"===typeof this.children[u].apply&&
this.children[u].apply(t,0,0,g+2*h,d+2*l);a.drawImage(p,0,0,g+2*h,d+2*l,k-h,f-l,g+2*h,d+2*l);c.style("filter",!0).value=m};this.render=function(a){}};a.Element.filter.prototype=new a.Element.ElementBase;a.Element.feMorphology=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,d,k,f){}};a.Element.feMorphology.prototype=new a.Element.ElementBase;a.Element.feComposite=function(c){this.base=a.Element.ElementBase;this.base(c);this.apply=function(a,c,d,k,f){}};a.Element.feComposite.prototype=
new a.Element.ElementBase;a.Element.feColorMatrix=function(c){function b(a,b){var c=e[a];return c*(0>c?b-255:b)}this.base=a.Element.ElementBase;this.base(c);var e=a.ToNumberArray(this.attribute("values").value);switch(this.attribute("type").valueOrDefault("matrix")){case "saturate":c=e[0];e=[.213+.787*c,.715-.715*c,.072-.072*c,0,0,.213-.213*c,.715+.285*c,.072-.072*c,0,0,.213-.213*c,.715-.715*c,.072+.928*c,0,0,0,0,0,1,0,0,0,0,0,1];break;case "hueRotate":var d=e[0]*Math.PI/180;c=function(a,b,c){return a+
Math.cos(d)*b+Math.sin(d)*c};e=[c(.213,.787,-.213),c(.715,-.715,-.715),c(.072,-.072,.928),0,0,c(.213,-.213,.143),c(.715,.285,.14),c(.072,-.072,-.283),0,0,c(.213,-.213,-.787),c(.715,-.715,.715),c(.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case "luminanceToAlpha":e=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.apply=function(a,c,d,e,h){var l=a.getImageData(0,0,e,h);for(d=0;d<h;d++)for(c=0;c<e;c++){var u=l.data[d*e*4+4*c+0],p=l.data[d*e*4+4*c+1],t=l.data[d*e*4+4*c+2],v=l.data[d*
e*4+4*c+3],q=b(0,u)+b(1,p)+b(2,t)+b(3,v)+b(4,1);l.data[d*e*4+4*c+0]=q;q=b(5,u)+b(6,p)+b(7,t)+b(8,v)+b(9,1);l.data[d*e*4+4*c+1]=q;q=b(10,u)+b(11,p)+b(12,t)+b(13,v)+b(14,1);l.data[d*e*4+4*c+2]=q;u=b(15,u)+b(16,p)+b(17,t)+b(18,v)+b(19,1);l.data[d*e*4+4*c+3]=u}a.clearRect(0,0,e,h);a.putImageData(l,0,0)}};a.Element.feColorMatrix.prototype=new a.Element.ElementBase;a.Element.feGaussianBlur=function(c){this.base=a.Element.ElementBase;this.base(c);this.extraFilterDistance=this.blurRadius=Math.floor(this.attribute("stdDeviation").numValue());
this.apply=function(b,c,d,h,f){"undefined"==typeof y.canvasRGBA?a.log("ERROR: StackBlur.js must be included for blur to work"):(b.canvas.id=a.UniqueId(),b.canvas.style.display="none",document.body.appendChild(b.canvas),y.canvasRGBA(b.canvas.id,c,d,h,f,this.blurRadius),document.body.removeChild(b.canvas))}};a.Element.feGaussianBlur.prototype=new a.Element.ElementBase;a.Element.title=function(a){};a.Element.title.prototype=new a.Element.ElementBase;a.Element.desc=function(a){};a.Element.desc.prototype=
new a.Element.ElementBase;a.Element.MISSING=function(c){a.log("ERROR: Element '"+c.nodeName+"' not yet implemented.")};a.Element.MISSING.prototype=new a.Element.ElementBase;a.CreateElement=function(c){var b=c.nodeName.replace(/^[^:]+:/,""),b=b.replace(/\-/g,""),e=null,e="undefined"!=typeof a.Element[b]?new a.Element[b](c):new a.Element.MISSING(c);e.type=c.nodeName;return e};a.load=function(c,b){a.loadXml(c,a.ajax(b))};a.loadXml=function(c,b){a.loadXmlDoc(c,a.parseXml(b))};a.loadXmlDoc=function(c,
b){a.init(c);var e=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};1!=a.opts.ignoreMouse&&(c.canvas.onclick=function(b){b=e(new a.Point(null!=b?b.clientX:event.clientX,null!=b?b.clientY:event.clientY));a.Mouse.onclick(b.x,b.y)},c.canvas.onmousemove=function(b){b=e(new a.Point(null!=b?b.clientX:event.clientX,null!=b?b.clientY:event.clientY));a.Mouse.onmousemove(b.x,b.y)});var d=
a.CreateElement(b.documentElement);d.root=!0;d.addStylesFromStyleDefinition();var h=!0,f=function(){a.ViewPort.Clear();c.canvas.parentNode&&a.ViewPort.SetCurrent(c.canvas.parentNode.clientWidth,c.canvas.parentNode.clientHeight);1!=a.opts.ignoreDimensions&&(d.style("width").hasValue()&&(c.canvas.width=d.style("width").toPixels("x"),c.canvas.style.width=c.canvas.width+"px"),d.style("height").hasValue()&&(c.canvas.height=d.style("height").toPixels("y"),c.canvas.style.height=c.canvas.height+"px"));var e=
c.canvas.clientWidth||c.canvas.width,f=c.canvas.clientHeight||c.canvas.height;1==a.opts.ignoreDimensions&&d.style("width").hasValue()&&d.style("height").hasValue()&&(e=d.style("width").toPixels("x"),f=d.style("height").toPixels("y"));a.ViewPort.SetCurrent(e,f);null!=a.opts.offsetX&&(d.attribute("x",!0).value=a.opts.offsetX);null!=a.opts.offsetY&&(d.attribute("y",!0).value=a.opts.offsetY);if(null!=a.opts.scaleWidth||null!=a.opts.scaleHeight){var g=null,l=null,p=a.ToNumberArray(d.attribute("viewBox").value);
null!=a.opts.scaleWidth&&(d.attribute("width").hasValue()?g=d.attribute("width").toPixels("x")/a.opts.scaleWidth:isNaN(p[2])||(g=p[2]/a.opts.scaleWidth));null!=a.opts.scaleHeight&&(d.attribute("height").hasValue()?l=d.attribute("height").toPixels("y")/a.opts.scaleHeight:isNaN(p[3])||(l=p[3]/a.opts.scaleHeight));null==g&&(g=l);null==l&&(l=g);d.attribute("width",!0).value=a.opts.scaleWidth;d.attribute("height",!0).value=a.opts.scaleHeight;d.style("transform",!0,!0).value+=" scale("+1/g+","+1/l+")"}1!=
a.opts.ignoreClear&&c.clearRect(0,0,e,f);d.render(c);h&&(h=!1,"function"==typeof a.opts.renderCallback&&a.opts.renderCallback(b))},g=!0;a.ImagesLoaded()&&(g=!1,f());a.intervalID=setInterval(function(){var b=!1;g&&a.ImagesLoaded()&&(g=!1,b=!0);1!=a.opts.ignoreMouse&&(b|=a.Mouse.hasEvents());if(1!=a.opts.ignoreAnimation)for(var c=0;c<a.Animations.length;c++)b|=a.Animations[c].update(1E3/a.FRAMERATE);"function"==typeof a.opts.forceRedraw&&1==a.opts.forceRedraw()&&(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 0!=this.events.length};this.onclick=function(a,b){this.events.push({type:"onclick",x:a,y:b,run:function(a){if(a.onclick)a.onclick()}})};this.onmousemove=function(a,b){this.events.push({type:"onmousemove",x:a,y:b,run:function(a){if(a.onmousemove)a.onmousemove()}})};this.eventElements=[];this.checkPath=function(a,b){for(var e=0;e<this.events.length;e++){var d=
this.events[e];b.isPointInPath&&b.isPointInPath(d.x,d.y)&&(this.eventElements[e]=a)}};this.checkBoundingBox=function(a,b){for(var e=0;e<this.events.length;e++){var d=this.events[e];b.isPointInBox(d.x,d.y)&&(this.eventElements[e]=a)}};this.runEvents=function(){a.ctx.canvas.style.cursor="";for(var c=0;c<this.events.length;c++)for(var b=this.events[c],e=this.eventElements[c];e;)b.run(e),e=e.parent;this.events=[];this.eventElements=[]}};return a}var z=function(h,a,l){if(null==h&&null==a&&null==l)for(a=
document.querySelectorAll("svg"),h=0;h<a.length;h++){l=a[h];var c=document.createElement("canvas");c.width=l.clientWidth;c.height=l.clientHeight;l.parentNode.insertBefore(c,l);l.parentNode.removeChild(l);var b=document.createElement("div");b.appendChild(l);z(c,b.innerHTML)}else{"string"==typeof h&&(h=document.getElementById(h));null!=h.svg&&h.svg.stop();l=I(l||{});if(1!=h.childNodes.length||"OBJECT"!=h.childNodes[0].nodeName)h.svg=l;h=h.getContext("2d");"undefined"!=typeof a.documentElement?l.loadXmlDoc(h,
a):"<"==a.substr(0,1)?l.loadXml(h,a):l.load(h,a)}},w;if("undefined"!=typeof Element.prototype.matches)w=function(h,a){return h.matches(a)};else if("undefined"!=typeof Element.prototype.webkitMatchesSelector)w=function(h,a){return h.webkitMatchesSelector(a)};else if("undefined"!=typeof Element.prototype.mozMatchesSelector)w=function(h,a){return h.mozMatchesSelector(a)};else if("undefined"!=typeof Element.prototype.msMatchesSelector)w=function(h,a){return h.msMatchesSelector(a)};else if("undefined"!=
typeof Element.prototype.oMatchesSelector)w=function(h,a){return h.oMatchesSelector(a)};else{if("function"===typeof jQuery||"function"===typeof Zepto)w=function(h,a){return $(h).is(a)};"undefined"===typeof w&&(w=Sizzle.matchesSelector)}var B=/(\[[^\]]+\])/g,C=/(#[^\s\+>~\.\[:]+)/g,D=/(\.[^\s\+>~\.\[:]+)/g,E=/(::[^\s\+>~\.\[:]+|:first-line|:first-letter|:before|:after)/gi,F=/(:[\w-]+\([^\)]*\))/gi,G=/(:[^\s\+>~\.\[:]+)/g,H=/([^\s\+>~\.\[:]+)/g;"undefined"!=typeof CanvasRenderingContext2D&&(CanvasRenderingContext2D.prototype.drawSvg=
function(h,a,l,c,b){z(this.canvas,h,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:a,offsetY:l,scaleWidth:c,scaleHeight:b})});return z});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,16 @@
/*
A class to parse color values
@author Stoyan Stefanov <sstoo@gmail.com>
@link http://www.phpied.com/rgb-color-parser-in-javascript/
@license Use it if you like it
*/
(function(f){function h(b){this.ok=!1;"#"==b.charAt(0)&&(b=b.substr(1,6));b=b.replace(/ /g,"");b=b.toLowerCase();var m={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"},e;for(e in m)b==e&&(b=m[e]);var g=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(a){return[parseInt(a[1]),parseInt(a[2]),parseInt(a[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,
example:["#00ff00","336699"],process:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)]}}];for(e=0;e<g.length;e++){var f=g[e].process,k=g[e].re.exec(b);k&&(channels=f(k),this.r=channels[0],this.g=channels[1],this.b=channels[2],this.ok=!0)}this.r=0>this.r||isNaN(this.r)?0:255<this.r?255:this.r;this.g=0>this.g||isNaN(this.g)?0:
255<this.g?255:this.g;this.b=0>this.b||isNaN(this.b)?0:255<this.b?255:this.b;this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"};this.toHex=function(){var a=this.r.toString(16),c=this.g.toString(16),d=this.b.toString(16);1==a.length&&(a="0"+a);1==c.length&&(c="0"+c);1==d.length&&(d="0"+d);return"#"+a+c+d};this.getHelpXML=function(){for(var a=[],c=0;c<g.length;c++)for(var d=g[c].example,b=0;b<d.length;b++)a[a.length]=d[b];for(var e in m)a[a.length]=e;d=document.createElement("ul");
d.setAttribute("id","rgbcolor-examples");for(c=0;c<a.length;c++)try{var f=document.createElement("li"),l=new h(a[c]),n=document.createElement("div");n.style.cssText="margin: 3px; border: 1px solid black; background:"+l.toHex()+"; color:"+l.toHex();n.appendChild(document.createTextNode("test"));var k=document.createTextNode(" "+a[c]+" -> "+l.toRGB()+" -> "+l.toHex());f.appendChild(n);f.appendChild(k);d.appendChild(f)}catch(p){}return d}}"undefined"!==typeof define&&define.amd?define(function(){return h}):
"undefined"!==typeof module&&module.exports&&(module.exports=h);f.RGBColor=h})("undefined"!==typeof window?window:this);

View File

@@ -0,0 +1,304 @@
/**
* @preserve A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* @link http://www.phpied.com/rgb-color-parser-in-javascript/
* @license Use it if you like it
*/
(function ( global ) {
function RGBColor(color_string)
{
this.ok = false;
// strip any leading #
if (color_string.charAt(0) == '#') { // remove # if any
color_string = color_string.substr(1,6);
}
color_string = color_string.replace(/ /g,'');
color_string = color_string.toLowerCase();
// before getting into regexps, try simple matches
// and overwrite the input
var simple_colors = {
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'
};
for (var key in simple_colors) {
if (color_string == key) {
color_string = simple_colors[key];
}
}
// emd of simple type-in colors
// array of color definition objects
var color_defs = [
{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
example: ['rgb(123, 234, 45)', 'rgb(255,234,245)'],
process: function (bits){
return [
parseInt(bits[1]),
parseInt(bits[2]),
parseInt(bits[3])
];
}
},
{
re: /^(\w{2})(\w{2})(\w{2})$/,
example: ['#00ff00', '336699'],
process: function (bits){
return [
parseInt(bits[1], 16),
parseInt(bits[2], 16),
parseInt(bits[3], 16)
];
}
},
{
re: /^(\w{1})(\w{1})(\w{1})$/,
example: ['#fb0', 'f0f'],
process: function (bits){
return [
parseInt(bits[1] + bits[1], 16),
parseInt(bits[2] + bits[2], 16),
parseInt(bits[3] + bits[3], 16)
];
}
}
];
// search through the definitions to find a match
for (var i = 0; i < color_defs.length; i++) {
var re = color_defs[i].re;
var processor = color_defs[i].process;
var bits = re.exec(color_string);
if (bits) {
channels = processor(bits);
this.r = channels[0];
this.g = channels[1];
this.b = channels[2];
this.ok = true;
}
}
// validate/cleanup values
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);
// some getters
this.toRGB = function () {
return 'rgb(' + this.r + ', ' + this.g + ', ' + this.b + ')';
}
this.toHex = function () {
var r = this.r.toString(16);
var g = this.g.toString(16);
var b = this.b.toString(16);
if (r.length == 1) r = '0' + r;
if (g.length == 1) g = '0' + g;
if (b.length == 1) b = '0' + b;
return '#' + r + g + b;
}
// help
this.getHelpXML = function () {
var examples = new Array();
// add regexps
for (var i = 0; i < color_defs.length; i++) {
var example = color_defs[i].example;
for (var j = 0; j < example.length; j++) {
examples[examples.length] = example[j];
}
}
// add type-in colors
for (var sc in simple_colors) {
examples[examples.length] = sc;
}
var xml = document.createElement('ul');
xml.setAttribute('id', 'rgbcolor-examples');
for (var i = 0; i < examples.length; i++) {
try {
var list_item = document.createElement('li');
var list_color = new RGBColor(examples[i]);
var example_div = document.createElement('div');
example_div.style.cssText =
'margin: 3px; '
+ 'border: 1px solid black; '
+ 'background:' + list_color.toHex() + '; '
+ 'color:' + list_color.toHex()
;
example_div.appendChild(document.createTextNode('test'));
var list_item_value = document.createTextNode(
' ' + examples[i] + ' -> ' + list_color.toRGB() + ' -> ' + list_color.toHex()
);
list_item.appendChild(example_div);
list_item.appendChild(list_item_value);
xml.appendChild(list_item);
} catch(e){}
}
return xml;
}
}
// export as AMD...
if ( typeof define !== 'undefined' && define.amd ) {
define( function () { return RGBColor; });
}
// ...or as browserify
else if ( typeof module !== 'undefined' && module.exports ) {
module.exports = RGBColor;
}
global.RGBColor = RGBColor;
}( typeof window !== 'undefined' ? window : this ));

View File

@@ -0,0 +1,44 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Accessibility module
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(k){"object"===typeof module&&module.exports?module.exports=k:k(Highcharts)})(function(k){(function(e){function k(a){for(var b=a.childNodes.length;b--;)a.appendChild(a.childNodes[b])}function t(a){var b;a&&a.onclick&&(b=m.createEvent("Events"),b.initEvent("click",!0,!1),a.onclick(b))}var w=e.win,m=w.document,h=e.each,y=e.erase,v=e.addEvent,z=e.removeEvent,A=e.fireEvent,B=e.dateFormat,u=e.merge,p={"default":["series","data point","data points"],line:["line","data point","data points"],spline:["line",
"data point","data points"],area:["line","data point","data points"],areaspline:["line","data point","data points"],pie:["pie","slice","slices"],column:["column series","column","columns"],bar:["bar series","bar","bars"],scatter:["scatter series","data point","data points"],boxplot:["boxplot series","box","boxes"],arearange:["arearange series","data point","data points"],areasplinerange:["areasplinerange series","data point","data points"],bubble:["bubble series","bubble","bubbles"],columnrange:["columnrange series",
"column","columns"],errorbar:["errorbar series","errorbar","errorbars"],funnel:["funnel","data point","data points"],pyramid:["pyramid","data point","data points"],waterfall:["waterfall series","column","columns"],map:["map","area","areas"],mapline:["line","data point","data points"],mappoint:["point series","data point","data points"],mapbubble:["bubble series","bubble","bubbles"]},C={boxplot:" Box plot charts are typically used to display groups of statistical data. Each data point in the chart can have up to 5 values: minimum, lower quartile, median, upper quartile and maximum. ",
arearange:" Arearange charts are line charts displaying a range between a lower and higher value for each point. ",areasplinerange:" These charts are line charts displaying a range between a lower and higher value for each point. ",bubble:" Bubble charts are scatter charts where each data point also has a size value. ",columnrange:" Columnrange charts are column charts displaying a range between a lower and higher value for each point. ",errorbar:" Errorbar series are used to display the variability of the data. ",
funnel:" Funnel charts are used to display reduction of data in stages. ",pyramid:" Pyramid charts consist of a single pyramid with item heights corresponding to each point value. ",waterfall:" A waterfall chart is a column chart where each column contributes towards a total end value. "},D="name id category x value y".split(" "),x="z open high q3 median q1 low close".split(" ");e.setOptions({accessibility:{enabled:!0,pointDescriptionThreshold:30,keyboardNavigation:{enabled:!0}}});e.wrap(e.Series.prototype,
"render",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));this.chart.options.accessibility.enabled&&this.setA11yDescription()});e.Series.prototype.setA11yDescription=function(){var a=this.chart.options.accessibility,b=this.points&&this.points[0].graphic&&this.points[0].graphic.element,d=b&&b.parentNode||this.graph&&this.graph.element||this.group&&this.group.element;d&&(d.lastChild===b&&k(d),this.points&&(this.points.length<a.pointDescriptionThreshold||!1===a.pointDescriptionThreshold)&&
h(this.points,function(c){c.graphic&&(c.graphic.element.setAttribute("role","img"),c.graphic.element.setAttribute("tabindex","-1"),c.graphic.element.setAttribute("aria-label",a.pointDescriptionFormatter&&a.pointDescriptionFormatter(c)||c.buildPointInfoString()))}),1<this.chart.series.length||a.describeSingleSeries)&&(d.setAttribute("role","region"),d.setAttribute("tabindex","-1"),d.setAttribute("aria-label",a.seriesDescriptionFormatter&&a.seriesDescriptionFormatter(this)||this.buildSeriesInfoString()))};
e.Series.prototype.buildSeriesInfoString=function(){var a=p[this.type]||p["default"],b=this.description||this.options.description;return(this.name?this.name+", ":"")+(1===this.chart.types.length?a[0]:"series")+" "+(this.index+1)+" of "+this.chart.series.length+(1===this.chart.types.length?" with ":". "+a[0]+" with ")+(this.points.length+" "+(1===this.points.length?a[1]:a[2]))+(b?". "+b:"")+(1<this.chart.yAxis.length&&this.yAxis?". Y axis, "+this.yAxis.getDescription():"")+(1<this.chart.xAxis.length&&
this.xAxis?". X axis, "+this.xAxis.getDescription():"")};e.Point.prototype.buildPointInfoString=function(){var a=this,b=a.series,d=b.chart.options.accessibility,c="",f=!1,g=b.xAxis&&b.xAxis.isDatetimeAxis,b=g&&B(d.pointDateFormatter&&d.pointDateFormatter(a)||d.pointDateFormat||e.Tooltip.prototype.getXDateFormat(a,b.chart.options.tooltip,b.xAxis),a.x);h(x,function(c){void 0!==a[c]&&(f=!0)});f?(g&&(c=b),h(D.concat(x),function(b){void 0===a[b]||g&&"x"===b||(c+=(c?". ":"")+b+", "+this[b])})):c=(this.name||
b||this.category||this.id||"x, "+this.x)+", "+(void 0!==this.value?this.value:this.y);return this.index+1+". "+c+"."+(this.description?" "+this.description:"")};e.Axis.prototype.getDescription=function(){return this.userOptions&&this.userOptions.description||this.axisTitle&&this.axisTitle.textStr||this.options.id||this.categories&&"categories"||"values"};e.Axis.prototype.panStep=function(a,b){var d=b||3,c=this.getExtremes(),f=(c.max-c.min)/d*a,d=c.max+f,f=c.min+f,g=d-f;0>a&&f<c.dataMin?(f=c.dataMin,
d=f+g):0<a&&d>c.dataMax&&(d=c.dataMax,f=d-g);this.setExtremes(f,d)};e.wrap(e.Series.prototype,"init",function(a){a.apply(this,Array.prototype.slice.call(arguments,1));var b=this.chart;b.options.accessibility.enabled&&(b.types=b.types||[],0>b.types.indexOf(this.type)&&b.types.push(this.type),v(this,"remove",function(){var a=this,c=!1;h(b.series,function(f){f!==a&&0>b.types.indexOf(a.type)&&(c=!0)});c||y(b.types,a.type)}))});e.Chart.prototype.getTypeDescription=function(){var a=this.types&&this.types[0],
b=this.series[0]&&this.series[0].mapTitle;if(a){if("map"===a)return b?"Map of "+b:"Map of unspecified region.";if(1<this.types.length)return"Combination chart.";if(-1<["spline","area","areaspline"].indexOf(a))return"Line chart."}else return"Empty chart.";return a+" chart."+(C[a]||"")};e.Chart.prototype.getAxesDescription=function(){var a=this.xAxis.length,b=this.yAxis.length,d={},c;if(a)if(d.xAxis="The chart has "+a+(1<a?" X axes":" X axis")+" displaying ",2>a)d.xAxis+=this.xAxis[0].getDescription()+
".";else{for(c=0;c<a-1;++c)d.xAxis+=(c?", ":"")+this.xAxis[c].getDescription();d.xAxis+=" and "+this.xAxis[c].getDescription()+"."}if(b)if(d.yAxis="The chart has "+b+(1<b?" Y axes":" Y axis")+" displaying ",2>b)d.yAxis+=this.yAxis[0].getDescription()+".";else{for(c=0;c<b-1;++c)d.yAxis+=(c?", ":"")+this.yAxis[c].getDescription();d.yAxis+=" and "+this.yAxis[c].getDescription()+"."}return d};e.Chart.prototype.addAccessibleContextMenuAttribs=function(){var a=this.exportDivElements;a&&(h(a,function(a){"DIV"!==
a.tagName||a.children&&a.children.length||(a.setAttribute("role","menuitem"),a.setAttribute("tabindex",-1))}),a[0].parentNode.setAttribute("role","menu"),a[0].parentNode.setAttribute("aria-label","Chart export"))};e.Point.prototype.highlight=function(){var a=this.series.chart;this.graphic&&this.graphic.element.focus&&this.graphic.element.focus();this.isNull?a.tooltip.hide(0):(this.onMouseOver(),a.tooltip.refresh(a.tooltip.shared?[this]:this));a.highlightedPoint=this;return this};e.Chart.prototype.highlightAdjacentPoint=
function(a){var b=this.series,d=this.highlightedPoint;if(!b[0]||!b[0].points)return!1;if(!d)return b[0].points[0].highlight();b=b[d.series.index+(a?1:-1)];d=a?d.series.points[d.index+1]||b&&b.points[0]:d.series.points[d.index-1]||b&&b.points[b.points.length-1];return void 0===d?!1:d.isNull&&this.options.accessibility.keyboardNavigation&&this.options.accessibility.keyboardNavigation.skipNullPoints?(this.highlightedPoint=d,this.highlightAdjacentPoint(a)):d.highlight()};e.Chart.prototype.showExportMenu=
function(){this.exportSVGElements&&this.exportSVGElements[0]&&(this.exportSVGElements[0].element.onclick(),this.highlightExportItem(0))};e.Chart.prototype.highlightExportItem=function(a){var b=this.exportDivElements&&this.exportDivElements[a],d=this.exportDivElements&&this.exportDivElements[this.highlightedExportItem];if(b&&"DIV"===b.tagName&&(!b.children||!b.children.length)){b.focus&&b.focus();if(d&&d.onmouseout)d.onmouseout();if(b.onmouseover)b.onmouseover();this.highlightedExportItem=a;return!0}};
e.Chart.prototype.highlightRangeSelectorButton=function(a){var b=this.rangeSelector.buttons;b[this.highlightedRangeSelectorItemIx]&&b[this.highlightedRangeSelectorItemIx].setState(this.oldRangeSelectorItemState||0);this.highlightedRangeSelectorItemIx=a;return b[a]?(b[a].element.focus&&b[a].element.focus(),this.oldRangeSelectorItemState=b[a].state,b[a].setState(2),!0):!1};e.Chart.prototype.hideExportMenu=function(){var a=this.exportDivElements;if(a){h(a,function(a){A(a,"mouseleave")});if(a[this.highlightedExportItem]&&
a[this.highlightedExportItem].onmouseout)a[this.highlightedExportItem].onmouseout();this.highlightedExportItem=0;this.renderTo.focus()}};e.Chart.prototype.addKeyboardNavEvents=function(){function a(c){this.keyCodeMap=c.keyCodeMap;this.move=c.move;this.validate=c.validate;this.init=c.init;this.transformTabs=!1!==c.transformTabs}function b(b,g){return new a(u({keyCodeMap:b,move:function(a){c.keyboardNavigationModuleIndex+=a;var b=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];if(b){if(b.validate&&
!b.validate())return this.move(a);if(b.init)return b.init(a),!0}c.keyboardNavigationModuleIndex=0;c.slipNextTab=!0;return!1}},g))}function d(a){a=a||w.event;var b=c.keyboardNavigationModules[c.keyboardNavigationModuleIndex];9===(a.which||a.keyCode)&&c.slipNextTab?c.slipNextTab=!1:(c.slipNextTab=!1,b&&b.run(a)&&a.preventDefault())}var c=this;a.prototype={run:function(c){var a=this,b=c.which||c.keyCode,d=!1,b=this.transformTabs&&9===b?c.shiftKey?37:39:b;h(this.keyCodeMap,function(e){-1<e[0].indexOf(b)&&
(d=!1===e[1].call(a,b,c)?!1:!0)});return d}};c.keyboardNavigationModules=[b([[[37,39],function(a){if(!c.highlightAdjacentPoint(39===a))return this.move(39===a?1:-1)}],[[38,40],function(a){var b;if(c.highlightedPoint)if((b=c.series[c.highlightedPoint.series.index+(38===a?-1:1)])&&b.points[0])b.points[0].highlight();else return this.move(40===a?1:-1)}],[[13,32],function(){c.highlightedPoint&&c.highlightedPoint.firePointEvent("click")}]],{init:function(a){var b=c.series&&c.series[c.series.length-1],
b=b&&b.points&&b.points[b.points.length-1];0>a&&b&&b.highlight()}}),b([[[37,38],function(){for(var a=c.highlightedExportItem||0,b=!0,d=c.series;a--;)if(c.highlightExportItem(a)){b=!1;break}if(b)return c.hideExportMenu(),d&&d.length&&(a=d[d.length-1],a.points.length&&a.points[a.points.length-1].highlight()),this.move(-1)}],[[39,40],function(){for(var a=!0,b=(c.highlightedExportItem||0)+1;b<c.exportDivElements.length;++b)if(c.highlightExportItem(b)){a=!1;break}if(a)return c.hideExportMenu(),this.move(1)}],
[[13,32],function(){t(c.exportDivElements[c.highlightedExportItem])}]],{validate:function(){return c.exportChart&&!(c.options.exporting&&!1===c.options.exporting.enabled)},init:function(a){c.highlightedPoint=null;c.showExportMenu();if(0>a&&c.exportDivElements)for(a=c.exportDivElements.length;-1<a&&!c.highlightExportItem(a);--a);}}),b([[[38,40,37,39],function(a){c[38===a||40===a?"yAxis":"xAxis"][0].panStep(39>a?-1:1)}],[[9],function(a,b){var d;c.mapNavButtons[c.focusedMapNavButtonIx].setState(0);if(b.shiftKey&&
!c.focusedMapNavButtonIx||!b.shiftKey&&c.focusedMapNavButtonIx)return c.mapZoom(),this.move(b.shiftKey?-1:1);c.focusedMapNavButtonIx+=b.shiftKey?-1:1;d=c.mapNavButtons[c.focusedMapNavButtonIx];d.element.focus&&d.element.focus();d.setState(2)}],[[13,32],function(){t(c.mapNavButtons[c.focusedMapNavButtonIx].element)}]],{validate:function(){return c.mapZoom&&c.mapNavButtons&&2===c.mapNavButtons.length},transformTabs:!1,init:function(a){var b=c.mapNavButtons[0],d=c.mapNavButtons[1],b=0<a?b:d;h(c.mapNavButtons,
function(a,c){a.element.setAttribute("tabindex",-1);a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Zoom "+(c?"out":"")+"chart")});b.element.focus&&b.element.focus();b.setState(2);c.focusedMapNavButtonIx=0<a?0:1}}),b([[[37,39,38,40],function(a){a=37===a||38===a?-1:1;if(!c.highlightRangeSelectorButton(c.highlightedRangeSelectorItemIx+a))return this.move(a)}],[[13,32],function(){3!==c.oldRangeSelectorItemState&&t(c.rangeSelector.buttons[c.highlightedRangeSelectorItemIx].element)}]],
{validate:function(){return c.rangeSelector&&c.rangeSelector.buttons&&c.rangeSelector.buttons.length},init:function(a){h(c.rangeSelector.buttons,function(a){a.element.setAttribute("tabindex","-1");a.element.setAttribute("role","button");a.element.setAttribute("aria-label","Select range "+(a.text&&a.text.textStr))});c.highlightRangeSelectorButton(0<a?0:c.rangeSelector.buttons.length-1)}}),b([[[9,38,40],function(a,b){var d=9===a&&b.shiftKey||38===a?-1:1,e=c.highlightedInputRangeIx+=d;if(1<e||0>e)return this.move(d);
c.rangeSelector[e?"maxInput":"minInput"].focus()}]],{validate:function(){return c.rangeSelector&&!1!==c.options.rangeSelector.inputEnabled&&c.rangeSelector.minInput&&c.rangeSelector.maxInput},transformTabs:!1,init:function(a){h(["minInput","maxInput"],function(a,b){c.rangeSelector[a]&&(c.rangeSelector[a].setAttribute("tabindex","-1"),c.rangeSelector[a].setAttribute("role","textbox"),c.rangeSelector[a].setAttribute("aria-label","Select "+(b?"end":"start")+" date."))});c.highlightedInputRangeIx=0<a?
0:1;c.rangeSelector[c.highlightedInputRangeIx?"maxInput":"minInput"].focus()}})];c.keyboardNavigationModuleIndex=0;c.renderTo.tabIndex||c.renderTo.setAttribute("tabindex","0");v(c.renderTo,"keydown",d);v(c,"destroy",function(){z(c.renderTo,"keydown",d)})};e.Chart.prototype.addScreenReaderRegion=function(a){var b=this,d=b.series,c=b.options,e=c.accessibility,g=b.screenReaderRegion=m.createElement("div"),h=m.createElement("h3"),q=m.createElement("a"),r=m.createElement("h3"),k={position:"absolute",left:"-9999px",
top:"auto",width:"1px",height:"1px",overflow:"hidden"},l=b.types||[],l=(1===l.length&&"pie"===l[0]||"map"===l[0])&&{}||b.getAxesDescription(),n=d[0]&&p[d[0].type]||p["default"];g.setAttribute("role","region");g.setAttribute("aria-label","Chart screen reader information.");g.innerHTML=e.screenReaderSectionFormatter&&e.screenReaderSectionFormatter(b)||'<div tabindex="0">Use regions/landmarks to skip ahead to chart'+(1<d.length?" and navigate between data series":"")+".</div><h3>Summary.</h3><div>"+
(c.title.text||"Chart")+(c.subtitle&&c.subtitle.text?". "+c.subtitle.text:"")+"</div><h3>Long description.</h3><div>"+(c.chart.description||"No description available.")+"</div><h3>Structure.</h3><div>Chart type: "+(c.chart.typeDescription||b.getTypeDescription())+"</div>"+(1===d.length?"<div>"+n[0]+" with "+d[0].points.length+" "+(1===d[0].points.length?n[1]:n[2])+".</div>":"")+(l.xAxis?"<div>"+l.xAxis+"</div>":"")+(l.yAxis?"<div>"+l.yAxis+"</div>":"");b.getCSV&&(q.innerHTML="View as data table.",
q.href="#"+a,q.setAttribute("tabindex","-1"),q.onclick=e.onTableAnchorClick||function(){b.viewData();m.getElementById(a).focus()},h.appendChild(q),g.appendChild(h));r.innerHTML="Chart graphic.";b.renderTo.insertBefore(r,b.renderTo.firstChild);b.renderTo.insertBefore(g,b.renderTo.firstChild);u(!0,r.style,k);u(!0,g.style,k)};e.Chart.prototype.callbacks.push(function(a){var b=a.options,d=b.accessibility;if(d.enabled){var c=m.createElementNS("http://www.w3.org/2000/svg","title"),f=m.createElementNS("http://www.w3.org/2000/svg",
"g"),g=a.container.getElementsByTagName("desc")[0],k=a.container.getElementsByTagName("text"),q="highcharts-title-"+a.index,r="highcharts-data-table-"+a.index,p=b.title.text||"Chart",l=b.exporting&&b.exporting.csv&&b.exporting.csv.columnHeaderFormatter,n=[];c.textContent=p;c.id=q;g.parentNode.insertBefore(c,g);a.renderTo.setAttribute("role","region");a.renderTo.setAttribute("aria-label",p+". Use up and down arrows to navigate.");if(a.exportSVGElements&&a.exportSVGElements[0]&&a.exportSVGElements[0].element){var t=
a.exportSVGElements[0].element.onclick,c=a.exportSVGElements[0].element.parentNode;a.exportSVGElements[0].element.onclick=function(){t.apply(this,Array.prototype.slice.call(arguments));a.addAccessibleContextMenuAttribs();a.highlightExportItem(0)};a.exportSVGElements[0].element.setAttribute("role","button");a.exportSVGElements[0].element.setAttribute("aria-label","View export menu");f.appendChild(a.exportSVGElements[0].element);f.setAttribute("role","region");f.setAttribute("aria-label","Chart export menu");
c.appendChild(f)}h(k,function(a){a.setAttribute("aria-hidden","true")});a.addScreenReaderRegion(r);d.keyboardNavigation&&a.addKeyboardNavEvents();u(!0,b.exporting,{csv:{columnHeaderFormatter:function(a,c,b){var d=n[n.length-1];1<b&&(d&&d.text)!==a.name&&n.push({text:a.name,span:b});return l?l.call(this,a,c,b):1<b?c:a.name}}});e.wrap(a,"getTable",function(a){return a.apply(this,Array.prototype.slice.call(arguments,1)).replace("<table>",'<table id="'+r+'" summary="Table representation of chart"><caption>'+
p+"</caption>")});e.wrap(a,"viewData",function(a){if(!this.insertedTable){a.apply(this,Array.prototype.slice.call(arguments,1));var c=m.getElementById(r),b=c.getElementsByTagName("tbody")[0],d=b.firstChild.children,e="<tr><td></td>",f,g;c.setAttribute("tabindex","-1");h(b.children,function(a){f=a.firstChild;g=m.createElement("th");g.setAttribute("scope","row");g.innerHTML=f.innerHTML;f.parentNode.replaceChild(g,f)});h(d,function(a){"TH"===a.tagName&&a.setAttribute("scope","col")});n.length&&(h(n,
function(a){e+='<th scope="col" colspan="'+a.span+'">'+a.text+"</th>"}),b.insertAdjacentHTML("afterbegin",e))}})}})})(k)});

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(h){var q=h.defined,k=h.isNumber,p=h.inArray,v=h.isArray,w=h.merge,C=h.Chart,x=h.extend,D=h.each,r,E;E=["path","rect","circle"];r={top:0,left:0,center:.5,middle:.5,bottom:1,right:1};var F=function(){this.init.apply(this,arguments)};F.prototype={init:function(a,d){var c=d.shape&&d.shape.type;this.chart=a;var b,f;f={xAxis:0,yAxis:0,title:{style:{},text:"",x:0,y:0},shape:{params:{stroke:"#000000",
fill:"transparent",strokeWidth:2}}};b={circle:{params:{x:0,y:0}}};b[c]&&(f.shape=w(f.shape,b[c]));this.options=w({},f,d)},render:function(a){var d=this.chart,c=this.chart.renderer,b=this.group,f=this.title,e=this.shape,l=this.options,h=l.title,k=l.shape;b||(b=this.group=c.g());!e&&k&&-1!==p(k.type,E)&&(e=this.shape=c[l.shape.type](k.params),e.add(b));!f&&h&&(f=this.title=c.label(h),f.add(b));b.add(d.annotations.group);this.linkObjects();!1!==a&&this.redraw()},redraw:function(){var a=this.options,
d=this.chart,c=this.group,b=this.title,f=this.shape,e=this.linkedObject,l=d.xAxis[a.xAxis],d=d.yAxis[a.yAxis],y=a.width,z=a.height,A=r[a.anchorY],B=r[a.anchorX],t,m,g,u;e&&(t=e instanceof h.Point?"point":e instanceof h.Series?"series":null,"point"===t?(a.xValue=e.x,a.yValue=e.y,m=e.series):"series"===t&&(m=e),c.visibility!==m.group.visibility&&c.attr({visibility:m.group.visibility}));e=q(a.xValue)?l.toPixels(a.xValue+l.minPointOffset)-l.minPixelPadding:a.x;m=q(a.yValue)?d.toPixels(a.yValue):a.y;if(k(e)&&
k(m)){b&&(b.attr(a.title),b.css(a.title.style));if(f){b=x({},a.shape.params);if("values"===a.units){for(g in b)-1<p(g,["width","x"])?b[g]=l.translate(b[g]):-1<p(g,["height","y"])&&(b[g]=d.translate(b[g]));b.width&&(b.width-=l.toPixels(0)-l.left);b.x&&(b.x+=l.minPixelPadding);if("path"===a.shape.type){g=b.d;t=e;for(var v=m,w=g.length,n=0;n<w;)k(g[n])&&k(g[n+1])?(g[n]=l.toPixels(g[n])-t,g[n+1]=d.toPixels(g[n+1])-v,n+=2):n+=1}}"circle"===a.shape.type&&(b.x+=b.r,b.y+=b.r);f.attr(b)}c.bBox=null;k(y)||
(u=c.getBBox(),y=u.width);k(z)||(u||(u=c.getBBox()),z=u.height);k(B)||(B=r.center);k(A)||(A=r.center);e-=y*B;m-=z*A;q(c.translateX)&&q(c.translateY)?c.animate({translateX:e,translateY:m}):c.translate(e,m)}},destroy:function(){var a=this,d=this.chart.annotations.allItems,c=d.indexOf(a);-1<c&&d.splice(c,1);D(["title","shape","group"],function(b){a[b]&&(a[b].destroy(),a[b]=null)});a.group=a.title=a.shape=a.chart=a.options=null},update:function(a,d){x(this.options,a);this.linkObjects();this.render(d)},
linkObjects:function(){var a=this.chart,d=this.linkedObject,c=d&&(d.id||d.options.id),b=this.options.linkedTo;q(b)?q(d)&&b===c||(this.linkedObject=a.get(b)):this.linkedObject=null}};x(C.prototype,{annotations:{add:function(a,d){var c=this.allItems,b=this.chart,f,e;v(a)||(a=[a]);for(e=a.length;e--;)f=new F(b,a[e]),c.push(f),f.render(d)},redraw:function(){D(this.allItems,function(a){a.redraw()})}}});C.prototype.callbacks.push(function(a){var d=a.options.annotations,c;c=a.renderer.g("annotations");c.attr({zIndex:7});
c.add();a.annotations.allItems=[];a.annotations.chart=a;a.annotations.group=c;v(d)&&0<d.length&&a.annotations.add(a.options.annotations);h.addEvent(a,"redraw",function(){a.annotations.redraw()})})})(p)});

View File

@@ -0,0 +1,408 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
isNumber = H.isNumber,
inArray = H.inArray,
isArray = H.isArray,
merge = H.merge,
Chart = H.Chart,
extend = H.extend,
each = H.each;
var ALIGN_FACTOR,
ALLOWED_SHAPES;
ALLOWED_SHAPES = ['path', 'rect', 'circle'];
ALIGN_FACTOR = {
top: 0,
left: 0,
center: 0.5,
middle: 0.5,
bottom: 1,
right: 1
};
function defaultOptions(shapeType) {
var shapeOptions,
options;
options = {
xAxis: 0,
yAxis: 0,
title: {
style: {},
text: '',
x: 0,
y: 0
},
shape: {
params: {
stroke: '#000000',
fill: 'transparent',
strokeWidth: 2
}
}
};
shapeOptions = {
circle: {
params: {
x: 0,
y: 0
}
}
};
if (shapeOptions[shapeType]) {
options.shape = merge(options.shape, shapeOptions[shapeType]);
}
return options;
}
function translatePath(d, xAxis, yAxis, xOffset, yOffset) {
var len = d.length,
i = 0;
while (i < len) {
if (isNumber(d[i]) && isNumber(d[i + 1])) {
d[i] = xAxis.toPixels(d[i]) - xOffset;
d[i + 1] = yAxis.toPixels(d[i + 1]) - yOffset;
i += 2;
} else {
i += 1;
}
}
return d;
}
// Define annotation prototype
var Annotation = function() {
this.init.apply(this, arguments);
};
Annotation.prototype = {
/*
* Initialize the annotation
*/
init: function(chart, options) {
var shapeType = options.shape && options.shape.type;
this.chart = chart;
this.options = merge({}, defaultOptions(shapeType), options);
},
/*
* Render the annotation
*/
render: function(redraw) {
var annotation = this,
chart = this.chart,
renderer = annotation.chart.renderer,
group = annotation.group,
title = annotation.title,
shape = annotation.shape,
options = annotation.options,
titleOptions = options.title,
shapeOptions = options.shape;
if (!group) {
group = annotation.group = renderer.g();
}
if (!shape && shapeOptions && inArray(shapeOptions.type, ALLOWED_SHAPES) !== -1) {
shape = annotation.shape = renderer[options.shape.type](shapeOptions.params);
shape.add(group);
}
if (!title && titleOptions) {
title = annotation.title = renderer.label(titleOptions);
title.add(group);
}
group.add(chart.annotations.group);
// link annotations to point or series
annotation.linkObjects();
if (redraw !== false) {
annotation.redraw();
}
},
/*
* Redraw the annotation title or shape after options update
*/
redraw: function() {
var options = this.options,
chart = this.chart,
group = this.group,
title = this.title,
shape = this.shape,
linkedTo = this.linkedObject,
xAxis = chart.xAxis[options.xAxis],
yAxis = chart.yAxis[options.yAxis],
width = options.width,
height = options.height,
anchorY = ALIGN_FACTOR[options.anchorY],
anchorX = ALIGN_FACTOR[options.anchorX],
shapeParams,
linkType,
series,
param,
bbox,
x,
y;
if (linkedTo) {
linkType = (linkedTo instanceof H.Point) ? 'point' :
(linkedTo instanceof H.Series) ? 'series' : null;
if (linkType === 'point') {
options.xValue = linkedTo.x;
options.yValue = linkedTo.y;
series = linkedTo.series;
} else if (linkType === 'series') {
series = linkedTo;
}
if (group.visibility !== series.group.visibility) {
group.attr({
visibility: series.group.visibility
});
}
}
// Based on given options find annotation pixel position
x = (defined(options.xValue) ? xAxis.toPixels(options.xValue + xAxis.minPointOffset) - xAxis.minPixelPadding : options.x);
y = defined(options.yValue) ? yAxis.toPixels(options.yValue) : options.y;
if (!isNumber(x) || !isNumber(y)) {
return;
}
if (title) {
title.attr(options.title);
title.css(options.title.style);
}
if (shape) {
shapeParams = extend({}, options.shape.params);
if (options.units === 'values') {
for (param in shapeParams) {
if (inArray(param, ['width', 'x']) > -1) {
shapeParams[param] = xAxis.translate(shapeParams[param]);
} else if (inArray(param, ['height', 'y']) > -1) {
shapeParams[param] = yAxis.translate(shapeParams[param]);
}
}
if (shapeParams.width) {
shapeParams.width -= xAxis.toPixels(0) - xAxis.left;
}
if (shapeParams.x) {
shapeParams.x += xAxis.minPixelPadding;
}
if (options.shape.type === 'path') {
translatePath(shapeParams.d, xAxis, yAxis, x, y);
}
}
// move the center of the circle to shape x/y
if (options.shape.type === 'circle') {
shapeParams.x += shapeParams.r;
shapeParams.y += shapeParams.r;
}
shape.attr(shapeParams);
}
group.bBox = null;
// If annotation width or height is not defined in options use bounding box size
if (!isNumber(width)) {
bbox = group.getBBox();
width = bbox.width;
}
if (!isNumber(height)) {
// get bbox only if it wasn't set before
if (!bbox) {
bbox = group.getBBox();
}
height = bbox.height;
}
// Calculate anchor point
if (!isNumber(anchorX)) {
anchorX = ALIGN_FACTOR.center;
}
if (!isNumber(anchorY)) {
anchorY = ALIGN_FACTOR.center;
}
// Translate group according to its dimension and anchor point
x = x - width * anchorX;
y = y - height * anchorY;
if (defined(group.translateX) && defined(group.translateY)) {
group.animate({
translateX: x,
translateY: y
});
} else {
group.translate(x, y);
}
},
/*
* Destroy the annotation
*/
destroy: function() {
var annotation = this,
chart = this.chart,
allItems = chart.annotations.allItems,
index = allItems.indexOf(annotation);
if (index > -1) {
allItems.splice(index, 1);
}
each(['title', 'shape', 'group'], function(element) {
if (annotation[element]) {
annotation[element].destroy();
annotation[element] = null;
}
});
annotation.group = annotation.title = annotation.shape = annotation.chart = annotation.options = null;
},
/*
* Update the annotation with a given options
*/
update: function(options, redraw) {
extend(this.options, options);
// update link to point or series
this.linkObjects();
this.render(redraw);
},
linkObjects: function() {
var annotation = this,
chart = annotation.chart,
linkedTo = annotation.linkedObject,
linkedId = linkedTo && (linkedTo.id || linkedTo.options.id),
options = annotation.options,
id = options.linkedTo;
if (!defined(id)) {
annotation.linkedObject = null;
} else if (!defined(linkedTo) || id !== linkedId) {
annotation.linkedObject = chart.get(id);
}
}
};
// Add annotations methods to chart prototype
extend(Chart.prototype, {
annotations: {
/*
* Unified method for adding annotations to the chart
*/
add: function(options, redraw) {
var annotations = this.allItems,
chart = this.chart,
item,
len;
if (!isArray(options)) {
options = [options];
}
len = options.length;
while (len--) {
item = new Annotation(chart, options[len]);
annotations.push(item);
item.render(redraw);
}
},
/**
* Redraw all annotations, method used in chart events
*/
redraw: function() {
each(this.allItems, function(annotation) {
annotation.redraw();
});
}
}
});
// Initialize on chart load
Chart.prototype.callbacks.push(function(chart) {
var options = chart.options.annotations,
group;
group = chart.renderer.g('annotations');
group.attr({
zIndex: 7
});
group.add();
// initialize empty array for annotations
chart.annotations.allItems = [];
// link chart object to annotations
chart.annotations.chart = chart;
// link annotations group element to the chart
chart.annotations.group = group;
if (isArray(options) && options.length > 0) {
chart.annotations.add(chart.options.annotations);
}
// update annotations after chart redraw
H.addEvent(chart, 'redraw', function() {
chart.annotations.redraw();
});
});
}(Highcharts));
}));

View File

@@ -0,0 +1,22 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Boost module
(c) 2010-2016 Highsoft AS
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(f){function n(a,b,c,e,h){h=h||0;e=e||5E4;for(var k=h+e,f=!0;f&&h<k&&h<a.length;)f=b(a[h],h),h+=1;f&&(h<a.length?setTimeout(function(){n(a,b,c,e,h)}):c&&c())}var x=f.win.document,U=function(){},V=f.Color,p=f.Series,d=f.seriesTypes,q=f.each,y=f.extend,W=f.addEvent,X=f.fireEvent,z=f.grep,u=f.isNumber,Y=f.merge,Z=f.pick,l=f.wrap,v=f.getOptions().plotOptions,F;q(["area","arearange","column","line",
"scatter"],function(a){v[a]&&(v[a].boostThreshold=5E3)});q(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function b(b){var e=this.options.stacking&&("translate"===a||"generatePoints"===a);if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||e)"render"===a&&this.image&&(this.image.attr({href:""}),this.animate=null),b.call(this);else if(this[a+"Canvas"])this[a+"Canvas"]()}l(p.prototype,a,b);"translate"===a&&(d.column&&l(d.column.prototype,
a,b),d.arearange&&l(d.arearange.prototype,a,b))});l(p.prototype,"getExtremes",function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});l(p.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});l(p.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});f.extend(p.prototype,{pointRange:0,allowDG:!1,hasExtremes:function(a){var b=this.options,c=this.xAxis&&
this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||Number.MAX_VALUE)&&u(e.min)&&u(e.max)&&(!a||u(c.min)&&u(c.max))},destroyGraphics:function(){var a=this,b=this.points,c,e;if(b)for(e=0;e<b.length;e+=1)(c=b[e])&&c.graphic&&(c.graphic=c.graphic.destroy());q(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,c=a.plotHeight,e=this.ctx,h=function(a,b,c,e,h,f,d){a.call(this,c,b,e,h,f,d)};this.canvas?
e.clearRect(0,0,b,c):(this.canvas=x.createElement("canvas"),this.image=a.renderer.image("",0,0,b,c).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&q(["moveTo","lineTo","rect","arc"],function(a){l(e,a,h)}));this.canvas.width=b;this.canvas.height=c;this.image.attr({width:b,height:c});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,c){a.lineTo(b,c)},renderCanvas:function(){var a=this,b=a.options,c=a.chart,e=this.xAxis,
h=this.yAxis,k,d=0,l=a.processedXData,p=a.processedYData,q=b.data,m=e.getExtremes(),v=m.min,x=m.max,m=h.getExtremes(),z=m.min,aa=m.max,G={},A,ba=!!a.sampling,H,I=b.marker&&b.marker.radius,J=this.cvsDrawPoint,B=b.lineWidth?this.cvsLineTo:!1,K=1>=I?this.cvsMarkerSquare:this.cvsMarkerCircle,ca=!1!==b.enableMouseTracking,L,m=b.threshold,r=h.getThreshold(m),M=u(m),N=r,da=this.fill,O=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),P=!!b.stacking,ea=a.cropStart||0,m=c.options.loading,fa=a.requireSorting,
Q,ga=b.connectNulls,R=!l,C,D,t,w,ha=a.fillOpacity?(new V(a.color)).setOpacity(Z(b.fillOpacity,.75)).get():a.color,S=function(){da?(k.fillStyle=ha,k.fill()):(k.strokeStyle=a.color,k.lineWidth=b.lineWidth,k.stroke())},T=function(a,b,c){0===d&&(k.beginPath(),B&&(k.lineJoin="round"));Q?k.moveTo(a,b):J?J(k,a,b,c,L):B?B(k,a,b):K&&K(k,a,b,I);d+=1;1E3===d&&(S(),d=0);L={clientX:a,plotY:b,yBottom:c}},E=function(a,b,f){ca&&!G[a+","+b]&&(G[a+","+b]=!0,c.inverted&&(a=e.len-a,b=h.len-b),H.push({clientX:a,plotX:a,
plotY:b,i:ea+f}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,c.seriesGroup);a.markerGroup=a.group;W(a,"destroy",function(){a.markerGroup=null});H=this.points=[];k=this.getContext();a.buildKDTree=U;99999<q.length&&(c.options.loading=Y(m,{labelStyle:{backgroundColor:f.color("#ffffff").setOpacity(.75).get(),padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),clearTimeout(F),c.showLoading("Drawing..."),
c.options.loading=m);n(P?a.data:l||q,function(b,f){var d,g,k,l,m="undefined"===typeof c.index,n=!0;if(!m){R?(d=b[0],g=b[1]):(d=b,g=p[f]);O?(R&&(g=b.slice(1,3)),l=g[0],g=g[1]):P&&(d=b.x,g=b.stackY,l=g-b.y);k=null===g;fa||(n=g>=z&&g<=aa);if(!k&&d>=v&&d<=x&&n)if(d=Math.round(e.toPixels(d,!0)),ba){if(void 0===t||d===A){O||(l=g);if(void 0===w||g>D)D=g,w=f;if(void 0===t||l<C)C=l,t=f}d!==A&&(void 0!==t&&(g=h.toPixels(D,!0),r=h.toPixels(C,!0),T(d,M?Math.min(g,N):g,M?Math.max(r,N):r),E(d,g,w),r!==g&&E(d,r,
t)),t=w=void 0,A=d)}else g=Math.round(h.toPixels(g,!0)),T(d,g,r),E(d,g,f);Q=k&&!ga;0===f%5E4&&a.canvasToSVG()}return!m},function(){var b=c.loadingDiv,e=c.loadingShown;S();a.canvasToSVG();X(a,"renderedCanvas");e&&(y(b.style,{transition:"opacity 250ms",opacity:0}),c.loadingShown=!1,F=setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);c.loadingDiv=c.loadingSpan=null},250));a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},c.renderer.forExport?Number.MAX_VALUE:
void 0)}});d.scatter.prototype.cvsMarkerCircle=function(a,b,c,e){a.moveTo(b,c);a.arc(b,c,e,0,2*Math.PI,!1)};d.scatter.prototype.cvsMarkerSquare=function(a,b,c,e){a.rect(b-e,c-e,2*e,2*e)};d.scatter.prototype.fill=!0;y(d.area.prototype,{cvsDrawPoint:function(a,b,c,e,d){d&&b!==d.clientX&&(a.moveTo(d.clientX,d.yBottom),a.lineTo(d.clientX,d.plotY),a.lineTo(b,c),a.lineTo(b,e))},fill:!0,fillOpacity:!0,sampling:!0});y(d.column.prototype,{cvsDrawPoint:function(a,b,c,e){a.rect(b-1,c,1,e-c)},fill:!0,sampling:!0});
p.prototype.getPoint=function(a){var b=a;!a||a instanceof this.pointClass||(b=(new this.pointClass).init(this,this.options.data[a.i]),b.category=b.x,b.dist=a.dist,b.distX=a.distX,b.plotX=a.plotX,b.plotY=a.plotY);return b};l(p.prototype,"destroy",function(a){var b=this,c=b.chart;c.hoverPoints&&(c.hoverPoints=z(c.hoverPoints,function(a){return a.series===b}));c.hoverPoint&&c.hoverPoint.series===b&&(c.hoverPoint=null);a.call(this)});l(p.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,
[].slice.call(arguments,1)))})})(n)});

View File

@@ -0,0 +1,636 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Boost module
*
* (c) 2010-2016 Highsoft AS
* Author: Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* License: www.highcharts.com/license
* Author: Torstein Honsi
*
* This is an experimental Highcharts module that draws long data series on a canvas
* in order to increase performance of the initial load time and tooltip responsiveness.
*
* Compatible with HTML5 canvas compatible browsers (not IE < 9).
*
*
*
* Development plan
* - Column range.
* - Heatmap.
* - Treemap.
* - Check how it works with Highstock and data grouping. Currently it only works when navigator.adaptToUpdatedData
* is false. It is also recommended to set scrollbar.liveRedraw to false.
* - Check inverted charts.
* - Check reversed axes.
* - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
that with initial series animation).
* - Cache full-size image so we don't have to redraw on hide/show and zoom up. But k-d-tree still
* needs to be built.
* - Test IE9 and IE10.
* - Stacking is not perhaps not correct since it doesn't use the translation given in
* the translate method. If this gets to complicated, a possible way out would be to
* have a simplified renderCanvas method that simply draws the areaPath on a canvas.
*
* If this module is taken in as part of the core
* - All the loading logic should be merged with core. Update styles in the core.
* - Most of the method wraps should probably be added directly in parent methods.
*
* Notes for boost mode
* - Area lines are not drawn
* - Point markers are not drawn on line-type series
* - Lines are not drawn on scatter charts
* - Zones and negativeColor don't work
* - Columns are always one pixel wide. Don't set the threshold too low.
*
* Optimizing tips for users
* - For scatter plots, use a marker.radius of 1 or less. It results in a rectangle being drawn, which is
* considerably faster than a circle.
* - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
* - Set enableMouseTracking to false on the series to improve total rendering time.
* - The default threshold is set based on one series. If you have multiple, dense series, the combined
* number of points drawn gets higher, and you may want to set the threshold lower in order to
* use optimizations.
*/
'use strict';
var win = H.win,
doc = win.document,
noop = function() {},
Color = H.Color,
Series = H.Series,
seriesTypes = H.seriesTypes,
each = H.each,
extend = H.extend,
addEvent = H.addEvent,
fireEvent = H.fireEvent,
grep = H.grep,
isNumber = H.isNumber,
merge = H.merge,
pick = H.pick,
wrap = H.wrap,
plotOptions = H.getOptions().plotOptions,
CHUNK_SIZE = 50000,
destroyLoadingDiv;
function eachAsync(arr, fn, finalFunc, chunkSize, i) {
i = i || 0;
chunkSize = chunkSize || CHUNK_SIZE;
var threshold = i + chunkSize,
proceed = true;
while (proceed && i < threshold && i < arr.length) {
proceed = fn(arr[i], i);
i = i + 1;
}
if (proceed) {
if (i < arr.length) {
setTimeout(function() {
eachAsync(arr, fn, finalFunc, chunkSize, i);
});
} else if (finalFunc) {
finalFunc();
}
}
}
// Set default options
each(['area', 'arearange', 'column', 'line', 'scatter'], function(type) {
if (plotOptions[type]) {
plotOptions[type].boostThreshold = 5000;
}
});
/**
* Override a bunch of methods the same way. If the number of points is below the threshold,
* run the original method. If not, check for a canvas version or do nothing.
*/
each(['translate', 'generatePoints', 'drawTracker', 'drawPoints', 'render'], function(method) {
function branch(proceed) {
var letItPass = this.options.stacking && (method === 'translate' || method === 'generatePoints');
if ((this.processedXData || this.options.data).length < (this.options.boostThreshold || Number.MAX_VALUE) ||
letItPass) {
// Clear image
if (method === 'render' && this.image) {
this.image.attr({
href: ''
});
this.animate = null; // We're zooming in, don't run animation
}
proceed.call(this);
// If a canvas version of the method exists, like renderCanvas(), run
} else if (this[method + 'Canvas']) {
this[method + 'Canvas']();
}
}
wrap(Series.prototype, method, branch);
// A special case for some types - its translate method is already wrapped
if (method === 'translate') {
if (seriesTypes.column) {
wrap(seriesTypes.column.prototype, method, branch);
}
if (seriesTypes.arearange) {
wrap(seriesTypes.arearange.prototype, method, branch);
}
}
});
/**
* Do not compute extremes when min and max are set.
* If we use this in the core, we can add the hook to hasExtremes to the methods directly.
*/
wrap(Series.prototype, 'getExtremes', function(proceed) {
if (!this.hasExtremes()) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'setData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
wrap(Series.prototype, 'processData', function(proceed) {
if (!this.hasExtremes(true)) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
}
});
H.extend(Series.prototype, {
pointRange: 0,
allowDG: false, // No data grouping, let boost handle large data
hasExtremes: function(checkX) {
var options = this.options,
data = options.data,
xAxis = this.xAxis && this.xAxis.options,
yAxis = this.yAxis && this.yAxis.options;
return data.length > (options.boostThreshold || Number.MAX_VALUE) && isNumber(yAxis.min) && isNumber(yAxis.max) &&
(!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
},
/**
* If implemented in the core, parts of this can probably be shared with other similar
* methods in Highcharts.
*/
destroyGraphics: function() {
var series = this,
points = this.points,
point,
i;
if (points) {
for (i = 0; i < points.length; i = i + 1) {
point = points[i];
if (point && point.graphic) {
point.graphic = point.graphic.destroy();
}
}
}
each(['graph', 'area', 'tracker'], function(prop) {
if (series[prop]) {
series[prop] = series[prop].destroy();
}
});
},
/**
* Create a hidden canvas to draw the graph on. The contents is later copied over
* to an SVG image element.
*/
getContext: function() {
var chart = this.chart,
width = chart.plotWidth,
height = chart.plotHeight,
ctx = this.ctx,
swapXY = function(proceed, x, y, a, b, c, d) {
proceed.call(this, y, x, a, b, c, d);
};
if (!this.canvas) {
this.canvas = doc.createElement('canvas');
this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
this.ctx = ctx = this.canvas.getContext('2d');
if (chart.inverted) {
each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
wrap(ctx, fn, swapXY);
});
}
} else {
ctx.clearRect(0, 0, width, height);
}
this.canvas.width = width;
this.canvas.height = height;
this.image.attr({
width: width,
height: height
});
return ctx;
},
/**
* Draw the canvas image inside an SVG image
*/
canvasToSVG: function() {
this.image.attr({
href: this.canvas.toDataURL('image/png')
});
},
cvsLineTo: function(ctx, clientX, plotY) {
ctx.lineTo(clientX, plotY);
},
renderCanvas: function() {
var series = this,
options = series.options,
chart = series.chart,
xAxis = this.xAxis,
yAxis = this.yAxis,
ctx,
c = 0,
xData = series.processedXData,
yData = series.processedYData,
rawData = options.data,
xExtremes = xAxis.getExtremes(),
xMin = xExtremes.min,
xMax = xExtremes.max,
yExtremes = yAxis.getExtremes(),
yMin = yExtremes.min,
yMax = yExtremes.max,
pointTaken = {},
lastClientX,
sampling = !!series.sampling,
points,
r = options.marker && options.marker.radius,
cvsDrawPoint = this.cvsDrawPoint,
cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
enableMouseTracking = options.enableMouseTracking !== false,
lastPoint,
threshold = options.threshold,
yBottom = yAxis.getThreshold(threshold),
hasThreshold = isNumber(threshold),
translatedThreshold = yBottom,
doFill = this.fill,
isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high',
isStacked = !!options.stacking,
cropStart = series.cropStart || 0,
loadingOptions = chart.options.loading,
requireSorting = series.requireSorting,
wasNull,
connectNulls = options.connectNulls,
useRaw = !xData,
minVal,
maxVal,
minI,
maxI,
fillColor = series.fillOpacity ?
new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() :
series.color,
stroke = function() {
if (doFill) {
ctx.fillStyle = fillColor;
ctx.fill();
} else {
ctx.strokeStyle = series.color;
ctx.lineWidth = options.lineWidth;
ctx.stroke();
}
},
drawPoint = function(clientX, plotY, yBottom) {
if (c === 0) {
ctx.beginPath();
if (cvsLineTo) {
ctx.lineJoin = 'round';
}
}
if (wasNull) {
ctx.moveTo(clientX, plotY);
} else {
if (cvsDrawPoint) {
cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint);
} else if (cvsLineTo) {
cvsLineTo(ctx, clientX, plotY);
} else if (cvsMarker) {
cvsMarker(ctx, clientX, plotY, r);
}
}
// We need to stroke the line for every 1000 pixels. It will crash the browser
// memory use if we stroke too infrequently.
c = c + 1;
if (c === 1000) {
stroke();
c = 0;
}
// Area charts need to keep track of the last point
lastPoint = {
clientX: clientX,
plotY: plotY,
yBottom: yBottom
};
},
addKDPoint = function(clientX, plotY, i) {
// The k-d tree requires series points. Reduce the amount of points, since the time to build the
// tree increases exponentially.
if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) {
pointTaken[clientX + ',' + plotY] = true;
if (chart.inverted) {
clientX = xAxis.len - clientX;
plotY = yAxis.len - plotY;
}
points.push({
clientX: clientX,
plotX: clientX,
plotY: plotY,
i: cropStart + i
});
}
};
// If we are zooming out from SVG mode, destroy the graphics
if (this.points || this.graph) {
this.destroyGraphics();
}
// The group
series.plotGroup(
'group',
'series',
series.visible ? 'visible' : 'hidden',
options.zIndex,
chart.seriesGroup
);
series.markerGroup = series.group;
addEvent(series, 'destroy', function() {
series.markerGroup = null;
});
points = this.points = [];
ctx = this.getContext();
series.buildKDTree = noop; // Do not start building while drawing
// Display a loading indicator
if (rawData.length > 99999) {
chart.options.loading = merge(loadingOptions, {
labelStyle: {
backgroundColor: H.color('#ffffff').setOpacity(0.75).get(),
padding: '1em',
borderRadius: '0.5em'
},
style: {
backgroundColor: 'none',
opacity: 1
}
});
clearTimeout(destroyLoadingDiv);
chart.showLoading('Drawing...');
chart.options.loading = loadingOptions; // reset
}
// Loop over the points
eachAsync(isStacked ? series.data : (xData || rawData), function(d, i) {
var x,
y,
clientX,
plotY,
isNull,
low,
chartDestroyed = typeof chart.index === 'undefined',
isYInside = true;
if (!chartDestroyed) {
if (useRaw) {
x = d[0];
y = d[1];
} else {
x = d;
y = yData[i];
}
// Resolve low and high for range series
if (isRange) {
if (useRaw) {
y = d.slice(1, 3);
}
low = y[0];
y = y[1];
} else if (isStacked) {
x = d.x;
y = d.stackY;
low = y - d.y;
}
isNull = y === null;
// Optimize for scatter zooming
if (!requireSorting) {
isYInside = y >= yMin && y <= yMax;
}
if (!isNull && x >= xMin && x <= xMax && isYInside) {
clientX = Math.round(xAxis.toPixels(x, true));
if (sampling) {
if (minI === undefined || clientX === lastClientX) {
if (!isRange) {
low = y;
}
if (maxI === undefined || y > maxVal) {
maxVal = y;
maxI = i;
}
if (minI === undefined || low < minVal) {
minVal = low;
minI = i;
}
}
if (clientX !== lastClientX) { // Add points and reset
if (minI !== undefined) { // then maxI is also a number
plotY = yAxis.toPixels(maxVal, true);
yBottom = yAxis.toPixels(minVal, true);
drawPoint(
clientX,
hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
);
addKDPoint(clientX, plotY, maxI);
if (yBottom !== plotY) {
addKDPoint(clientX, yBottom, minI);
}
}
minI = maxI = undefined;
lastClientX = clientX;
}
} else {
plotY = Math.round(yAxis.toPixels(y, true));
drawPoint(clientX, plotY, yBottom);
addKDPoint(clientX, plotY, i);
}
}
wasNull = isNull && !connectNulls;
if (i % CHUNK_SIZE === 0) {
series.canvasToSVG();
}
}
return !chartDestroyed;
}, function() {
var loadingDiv = chart.loadingDiv,
loadingShown = chart.loadingShown;
stroke();
series.canvasToSVG();
fireEvent(series, 'renderedCanvas');
// Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree.
// CSS animation looks good, but then it must be deleted in timeout. If we add the module to core,
// change hideLoading so we can skip this block.
if (loadingShown) {
extend(loadingDiv.style, {
transition: 'opacity 250ms',
opacity: 0
});
chart.loadingShown = false;
destroyLoadingDiv = setTimeout(function() {
if (loadingDiv.parentNode) { // In exporting it is falsy
loadingDiv.parentNode.removeChild(loadingDiv);
}
chart.loadingDiv = chart.loadingSpan = null;
}, 250);
}
// Pass tests in Pointer.
// Replace this with a single property, and replace when zooming in
// below boostThreshold.
series.directTouch = false;
series.options.stickyTracking = true;
delete series.buildKDTree; // Go back to prototype, ready to build
series.buildKDTree();
// Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it.
}, chart.renderer.forExport ? Number.MAX_VALUE : undefined);
}
});
seriesTypes.scatter.prototype.cvsMarkerCircle = function(ctx, clientX, plotY, r) {
ctx.moveTo(clientX, plotY);
ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false);
};
// Rect is twice as fast as arc, should be used for small markers
seriesTypes.scatter.prototype.cvsMarkerSquare = function(ctx, clientX, plotY, r) {
ctx.rect(clientX - r, plotY - r, r * 2, r * 2);
};
seriesTypes.scatter.prototype.fill = true;
extend(seriesTypes.area.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom, lastPoint) {
if (lastPoint && clientX !== lastPoint.clientX) {
ctx.moveTo(lastPoint.clientX, lastPoint.yBottom);
ctx.lineTo(lastPoint.clientX, lastPoint.plotY);
ctx.lineTo(clientX, plotY);
ctx.lineTo(clientX, yBottom);
}
},
fill: true,
fillOpacity: true,
sampling: true
});
extend(seriesTypes.column.prototype, {
cvsDrawPoint: function(ctx, clientX, plotY, yBottom) {
ctx.rect(clientX - 1, plotY, 1, yBottom - plotY);
},
fill: true,
sampling: true
});
/**
* Return a full Point object based on the index. The boost module uses stripped point objects
* for performance reasons.
* @param {Number} boostPoint A stripped-down point object
* @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
*/
Series.prototype.getPoint = function(boostPoint) {
var point = boostPoint;
if (boostPoint && !(boostPoint instanceof this.pointClass)) {
point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]); // eslint-disable-line new-cap
point.category = point.x;
point.dist = boostPoint.dist;
point.distX = boostPoint.distX;
point.plotX = boostPoint.plotX;
point.plotY = boostPoint.plotY;
}
return point;
};
/**
* Extend series.destroy to also remove the fake k-d-tree points (#5137). Normally
* this is handled by Series.destroy that calls Point.destroy, but the fake
* search points are not registered like that.
*/
wrap(Series.prototype, 'destroy', function(proceed) {
var series = this,
chart = series.chart;
if (chart.hoverPoints) {
chart.hoverPoints = grep(chart.hoverPoints, function(point) {
return point.series === series;
});
}
if (chart.hoverPoint && chart.hoverPoint.series === series) {
chart.hoverPoint = null;
}
proceed.call(this);
});
/**
* Return a point instance from the k-d-tree
*/
wrap(Series.prototype, 'searchPoint', function(proceed) {
return this.getPoint(
proceed.apply(this, [].slice.call(arguments, 1))
);
});
}(Highcharts));
}));

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(d){function h(){return Array.prototype.slice.call(arguments,1)}function v(e){e.apply(this);this.drawBreaks(this.xAxis,["x"]);this.drawBreaks(this.yAxis,t(this.pointArrayMap,["y"]))}var t=d.pick,q=d.wrap,u=d.each,y=d.extend,w=d.fireEvent,r=d.Axis,z=d.Series;y(r.prototype,{isInBreak:function(e,g){var b=e.repeat||Infinity,c=e.from,a=e.to-e.from,b=g>=c?(g-c)%b:b-(c-g)%b;return e.inclusive?b<=a:
b<a&&0!==b},isInAnyBreak:function(e,g){var b=this.options.breaks,c=b&&b.length,a,f,n;if(c){for(;c--;)this.isInBreak(b[c],e)&&(a=!0,f||(f=t(b[c].showPoints,this.isXAxis?!1:!0)));n=a&&g?a&&!f:a}return n}});q(r.prototype,"setTickPositions",function(e){e.apply(this,Array.prototype.slice.call(arguments,1));if(this.options.breaks){var g=this.tickPositions,b=this.tickPositions.info,c=[],a;for(a=0;a<g.length;a++)this.isInAnyBreak(g[a])||c.push(g[a]);this.tickPositions=c;this.tickPositions.info=b}});q(r.prototype,
"init",function(e,g,b){b.breaks&&b.breaks.length&&(b.ordinal=!1);e.call(this,g,b);if(this.options.breaks){var c=this;c.isBroken=!0;this.val2lin=function(a){var f=a,n,b;for(b=0;b<c.breakArray.length;b++)if(n=c.breakArray[b],n.to<=a)f-=n.len;else if(n.from>=a)break;else if(c.isInBreak(n,a)){f-=a-n.from;break}return f};this.lin2val=function(a){var f,b;for(b=0;b<c.breakArray.length&&!(f=c.breakArray[b],f.from>=a);b++)f.to<a?a+=f.len:c.isInBreak(f,a)&&(a+=f.len);return a};this.setExtremes=function(a,c,
b,e,g){for(;this.isInAnyBreak(a);)a-=this.closestPointRange;for(;this.isInAnyBreak(c);)c-=this.closestPointRange;r.prototype.setExtremes.call(this,a,c,b,e,g)};this.setAxisTranslation=function(a){r.prototype.setAxisTranslation.call(this,a);var b=c.options.breaks;a=[];var e=[],g=0,m,k,p=c.userMin||c.min,d=c.userMax||c.max,l,h;for(h in b)k=b[h],m=k.repeat||Infinity,c.isInBreak(k,p)&&(p+=k.to%m-p%m),c.isInBreak(k,d)&&(d-=d%m-k.from%m);for(h in b){k=b[h];l=k.from;for(m=k.repeat||Infinity;l-m>p;)l-=m;for(;l<
p;)l+=m;for(;l<d;l+=m)a.push({value:l,move:"in"}),a.push({value:l+(k.to-k.from),move:"out",size:k.breakSize})}a.sort(function(b,a){return b.value===a.value?("in"===b.move?0:1)-("in"===a.move?0:1):b.value-a.value});b=0;l=p;for(h in a)k=a[h],b+="in"===k.move?1:-1,1===b&&"in"===k.move&&(l=k.value),0===b&&(e.push({from:l,to:k.value,len:k.value-l-(k.size||0)}),g+=k.value-l-(k.size||0));c.breakArray=e;w(c,"afterBreaks");c.transA*=(d-c.min)/(d-p-g);c.min=p;c.max=d}}});q(z.prototype,"generatePoints",function(e){e.apply(this,
h(arguments));var g=this.xAxis,b=this.yAxis,c=this.points,a,f=c.length,d=this.options.connectNulls,x;if(g&&b&&(g.options.breaks||b.options.breaks))for(;f--;)a=c[f],x=null===a.y&&!1===d,x||!g.isInAnyBreak(a.x,!0)&&!b.isInAnyBreak(a.y,!0)||(c.splice(f,1),this.data[f]&&this.data[f].destroyElements())});d.Series.prototype.drawBreaks=function(e,g){var b=this,c=b.points,a,f,d,h;u(g,function(g){a=e.breakArray||[];f=e.isXAxis?e.min:t(b.options.threshold,e.min);u(c,function(b){h=t(b["stack"+g.toUpperCase()],
b[g]);u(a,function(a){d=!1;if(f<a.from&&h>a.to||f>a.from&&h<a.from)d="pointBreak";else if(f<a.from&&h>a.from&&h<a.to||f>a.from&&h>a.to&&h<a.from)d="pointInBreak";d&&w(e,d,{point:b,brk:a})})})})};q(d.seriesTypes.column.prototype,"drawPoints",v);q(d.Series.prototype,"drawPoints",v)})(h)});

View File

@@ -0,0 +1,334 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pick = H.pick,
wrap = H.wrap,
each = H.each,
extend = H.extend,
fireEvent = H.fireEvent,
Axis = H.Axis,
Series = H.Series;
function stripArguments() {
return Array.prototype.slice.call(arguments, 1);
}
extend(Axis.prototype, {
isInBreak: function(brk, val) {
var ret,
repeat = brk.repeat || Infinity,
from = brk.from,
length = brk.to - brk.from,
test = (val >= from ? (val - from) % repeat : repeat - ((from - val) % repeat));
if (!brk.inclusive) {
ret = test < length && test !== 0;
} else {
ret = test <= length;
}
return ret;
},
isInAnyBreak: function(val, testKeep) {
var breaks = this.options.breaks,
i = breaks && breaks.length,
inbrk,
keep,
ret;
if (i) {
while (i--) {
if (this.isInBreak(breaks[i], val)) {
inbrk = true;
if (!keep) {
keep = pick(breaks[i].showPoints, this.isXAxis ? false : true);
}
}
}
if (inbrk && testKeep) {
ret = inbrk && !keep;
} else {
ret = inbrk;
}
}
return ret;
}
});
wrap(Axis.prototype, 'setTickPositions', function(proceed) {
proceed.apply(this, Array.prototype.slice.call(arguments, 1));
if (this.options.breaks) {
var axis = this,
tickPositions = this.tickPositions,
info = this.tickPositions.info,
newPositions = [],
i;
for (i = 0; i < tickPositions.length; i++) {
if (!axis.isInAnyBreak(tickPositions[i])) {
newPositions.push(tickPositions[i]);
}
}
this.tickPositions = newPositions;
this.tickPositions.info = info;
}
});
wrap(Axis.prototype, 'init', function(proceed, chart, userOptions) {
// Force Axis to be not-ordinal when breaks are defined
if (userOptions.breaks && userOptions.breaks.length) {
userOptions.ordinal = false;
}
proceed.call(this, chart, userOptions);
if (this.options.breaks) {
var axis = this;
axis.isBroken = true;
this.val2lin = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.to <= val) {
nval -= brk.len;
} else if (brk.from >= val) {
break;
} else if (axis.isInBreak(brk, val)) {
nval -= (val - brk.from);
break;
}
}
return nval;
};
this.lin2val = function(val) {
var nval = val,
brk,
i;
for (i = 0; i < axis.breakArray.length; i++) {
brk = axis.breakArray[i];
if (brk.from >= nval) {
break;
} else if (brk.to < nval) {
nval += brk.len;
} else if (axis.isInBreak(brk, nval)) {
nval += brk.len;
}
}
return nval;
};
this.setExtremes = function(newMin, newMax, redraw, animation, eventArguments) {
// If trying to set extremes inside a break, extend it to before and after the break ( #3857 )
while (this.isInAnyBreak(newMin)) {
newMin -= this.closestPointRange;
}
while (this.isInAnyBreak(newMax)) {
newMax -= this.closestPointRange;
}
Axis.prototype.setExtremes.call(this, newMin, newMax, redraw, animation, eventArguments);
};
this.setAxisTranslation = function(saveOld) {
Axis.prototype.setAxisTranslation.call(this, saveOld);
var breaks = axis.options.breaks,
breakArrayT = [], // Temporary one
breakArray = [],
length = 0,
inBrk,
repeat,
brk,
min = axis.userMin || axis.min,
max = axis.userMax || axis.max,
start,
i,
j;
// Min & max check (#4247)
for (i in breaks) {
brk = breaks[i];
repeat = brk.repeat || Infinity;
if (axis.isInBreak(brk, min)) {
min += (brk.to % repeat) - (min % repeat);
}
if (axis.isInBreak(brk, max)) {
max -= (max % repeat) - (brk.from % repeat);
}
}
// Construct an array holding all breaks in the axis
for (i in breaks) {
brk = breaks[i];
start = brk.from;
repeat = brk.repeat || Infinity;
while (start - repeat > min) {
start -= repeat;
}
while (start < min) {
start += repeat;
}
for (j = start; j < max; j += repeat) {
breakArrayT.push({
value: j,
move: 'in'
});
breakArrayT.push({
value: j + (brk.to - brk.from),
move: 'out',
size: brk.breakSize
});
}
}
breakArrayT.sort(function(a, b) {
var ret;
if (a.value === b.value) {
ret = (a.move === 'in' ? 0 : 1) - (b.move === 'in' ? 0 : 1);
} else {
ret = a.value - b.value;
}
return ret;
});
// Simplify the breaks
inBrk = 0;
start = min;
for (i in breakArrayT) {
brk = breakArrayT[i];
inBrk += (brk.move === 'in' ? 1 : -1);
if (inBrk === 1 && brk.move === 'in') {
start = brk.value;
}
if (inBrk === 0) {
breakArray.push({
from: start,
to: brk.value,
len: brk.value - start - (brk.size || 0)
});
length += brk.value - start - (brk.size || 0);
}
}
axis.breakArray = breakArray;
fireEvent(axis, 'afterBreaks');
axis.transA *= ((max - axis.min) / (max - min - length));
axis.min = min;
axis.max = max;
};
}
});
wrap(Series.prototype, 'generatePoints', function(proceed) {
proceed.apply(this, stripArguments(arguments));
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis,
points = series.points,
point,
i = points.length,
connectNulls = series.options.connectNulls,
nullGap;
if (xAxis && yAxis && (xAxis.options.breaks || yAxis.options.breaks)) {
while (i--) {
point = points[i];
nullGap = point.y === null && connectNulls === false; // respect nulls inside the break (#4275)
if (!nullGap && (xAxis.isInAnyBreak(point.x, true) || yAxis.isInAnyBreak(point.y, true))) {
points.splice(i, 1);
if (this.data[i]) {
this.data[i].destroyElements(); // removes the graphics for this point if they exist
}
}
}
}
});
function drawPointsWrapped(proceed) {
proceed.apply(this);
this.drawBreaks(this.xAxis, ['x']);
this.drawBreaks(this.yAxis, pick(this.pointArrayMap, ['y']));
}
H.Series.prototype.drawBreaks = function(axis, keys) {
var series = this,
points = series.points,
breaks,
threshold,
eventName,
y;
each(keys, function(key) {
breaks = axis.breakArray || [];
threshold = axis.isXAxis ? axis.min : pick(series.options.threshold, axis.min);
each(points, function(point) {
y = pick(point['stack' + key.toUpperCase()], point[key]);
each(breaks, function(brk) {
eventName = false;
if ((threshold < brk.from && y > brk.to) || (threshold > brk.from && y < brk.from)) {
eventName = 'pointBreak';
} else if ((threshold < brk.from && y > brk.from && y < brk.to) || (threshold > brk.from && y > brk.to && y < brk.from)) { // point falls inside the break
eventName = 'pointInBreak';
}
if (eventName) {
fireEvent(axis, eventName, {
point: point,
brk: brk
});
}
});
});
});
};
wrap(H.seriesTypes.column.prototype, 'drawPoints', drawPointsWrapped);
wrap(H.Series.prototype, 'drawPoints', drawPointsWrapped);
}(Highcharts));
}));

View File

@@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Data module
(c) 2012-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(q){"object"===typeof module&&module.exports?module.exports=q:q(Highcharts)})(function(q){(function(g){var q=g.win.document,m=g.each,A=g.pick,x=g.inArray,y=g.isNumber,B=g.splat,n,w=function(b,a){this.init(b,a)};g.extend(w.prototype,{init:function(b,a){this.options=b;this.chartOptions=a;this.columns=b.columns||this.rowsToColumns(b.rows)||[];this.firstRowAsNames=A(b.firstRowAsNames,!0);this.decimalRegex=b.decimalPoint&&new RegExp("^(-?[0-9]+)"+b.decimalPoint+"([0-9]+)$");this.rawColumns=[];
this.columns.length?this.dataFound():(this.parseCSV(),this.parseTable(),this.parseGoogleSpreadsheet())},getColumnDistribution:function(){var b=this.chartOptions,a=this.options,e=[],f=function(b){return(g.seriesTypes[b||"line"].prototype.pointArrayMap||[0]).length},d=b&&b.chart&&b.chart.type,c=[],h=[],v=0,k;m(b&&b.series||[],function(b){c.push(f(b.type||d))});m(a&&a.seriesMapping||[],function(b){e.push(b.x||0)});0===e.length&&e.push(0);m(a&&a.seriesMapping||[],function(a){var e=new n,t,r=c[v]||f(d),
p=g.seriesTypes[((b&&b.series||[])[v]||{}).type||d||"line"].prototype.pointArrayMap||["y"];e.addColumnReader(a.x,"x");for(t in a)a.hasOwnProperty(t)&&"x"!==t&&e.addColumnReader(a[t],t);for(k=0;k<r;k++)e.hasReader(p[k])||e.addColumnReader(void 0,p[k]);h.push(e);v++});a=g.seriesTypes[d||"line"].prototype.pointArrayMap;void 0===a&&(a=["y"]);this.valueCount={global:f(d),xColumns:e,individual:c,seriesBuilders:h,globalPointArrayMap:a}},dataFound:function(){this.options.switchRowsAndColumns&&(this.columns=
this.rowsToColumns(this.columns));this.getColumnDistribution();this.parseTypes();!1!==this.parsed()&&this.complete()},parseCSV:function(){var b=this,a=this.options,e=a.csv,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,v=a.endColumn||Number.MAX_VALUE,k,g,z=0;e&&(g=e.replace(/\r\n/g,"\n").replace(/\r/g,"\n").split(a.lineDelimiter||"\n"),k=a.itemDelimiter||(-1!==e.indexOf("\t")?"\t":","),m(g,function(a,e){var g=b.trim(a),u=0===g.indexOf("#");e>=d&&e<=c&&!u&&""!==g&&(g=
a.split(k),m(g,function(b,a){a>=h&&a<=v&&(f[a-h]||(f[a-h]=[]),f[a-h][z]=b)}),z+=1)}),this.dataFound())},parseTable:function(){var b=this.options,a=b.table,e=this.columns,f=b.startRow||0,d=b.endRow||Number.MAX_VALUE,c=b.startColumn||0,h=b.endColumn||Number.MAX_VALUE;a&&("string"===typeof a&&(a=q.getElementById(a)),m(a.getElementsByTagName("tr"),function(b,a){a>=f&&a<=d&&m(b.children,function(b,d){("TD"===b.tagName||"TH"===b.tagName)&&d>=c&&d<=h&&(e[d-c]||(e[d-c]=[]),e[d-c][a-f]=b.innerHTML)})}),this.dataFound())},
parseGoogleSpreadsheet:function(){var b=this,a=this.options,e=a.googleSpreadsheetKey,f=this.columns,d=a.startRow||0,c=a.endRow||Number.MAX_VALUE,h=a.startColumn||0,g=a.endColumn||Number.MAX_VALUE,k,u;e&&jQuery.ajax({dataType:"json",url:"https://spreadsheets.google.com/feeds/cells/"+e+"/"+(a.googleSpreadsheetWorksheet||"od6")+"/public/values?alt=json-in-script&callback=?",error:a.error,success:function(a){a=a.feed.entry;var e,r=a.length,p=0,n=0,l;for(l=0;l<r;l++)e=a[l],p=Math.max(p,e.gs$cell.col),
n=Math.max(n,e.gs$cell.row);for(l=0;l<p;l++)l>=h&&l<=g&&(f[l-h]=[],f[l-h].length=Math.min(n,c-d));for(l=0;l<r;l++)e=a[l],k=e.gs$cell.row-1,u=e.gs$cell.col-1,u>=h&&u<=g&&k>=d&&k<=c&&(f[u-h][k-d]=e.content.$t);m(f,function(a){for(l=0;l<a.length;l++)void 0===a[l]&&(a[l]=null)});b.dataFound()}})},trim:function(b,a){"string"===typeof b&&(b=b.replace(/^\s+|\s+$/g,""),a&&/^[0-9\s]+$/.test(b)&&(b=b.replace(/\s/g,"")),this.decimalRegex&&(b=b.replace(this.decimalRegex,"$1.$2")));return b},parseTypes:function(){for(var b=
this.columns,a=b.length;a--;)this.parseColumn(b[a],a)},parseColumn:function(b,a){var e=this.rawColumns,f=this.columns,d=b.length,c,h,g,k,n=this.firstRowAsNames,m=-1!==x(a,this.valueCount.xColumns),t=[],r=this.chartOptions,p,q=(this.options.columnTypes||[])[a],r=m&&(r&&r.xAxis&&"category"===B(r.xAxis)[0].type||"string"===q);for(e[a]||(e[a]=[]);d--;)c=t[d]||b[d],g=this.trim(c),k=this.trim(c,!0),h=parseFloat(k),void 0===e[a][d]&&(e[a][d]=g),r||0===d&&n?b[d]=g:+k===h?(b[d]=h,31536E6<h&&"float"!==q?b.isDatetime=
!0:b.isNumeric=!0,void 0!==b[d+1]&&(p=h>b[d+1])):(h=this.parseDate(c),m&&y(h)&&"float"!==q?(t[d]=c,b[d]=h,b.isDatetime=!0,void 0!==b[d+1]&&(c=h>b[d+1],c!==p&&void 0!==p&&(this.alternativeFormat?(this.dateFormat=this.alternativeFormat,d=b.length,this.alternativeFormat=this.dateFormats[this.dateFormat].alternative):b.unsorted=!0),p=c)):(b[d]=""===g?null:g,0!==d&&(b.isDatetime||b.isNumeric)&&(b.mixed=!0)));m&&b.mixed&&(f[a]=e[a]);if(m&&p&&this.options.sort)for(a=0;a<f.length;a++)f[a].reverse(),n&&f[a].unshift(f[a].pop())},
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])}},"dd/mm/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[2]-1,+b[1])},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,parser:function(b){return Date.UTC(+b[3],b[1]-1,+b[2])}},"dd/mm/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser:function(b){return Date.UTC(+b[3]+2E3,b[2]-1,+b[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,parser:function(b){return Date.UTC(+b[3]+2E3,b[1]-1,+b[2])}}},parseDate:function(b){var a=this.options.parseDate,e,f,d=this.options.dateFormat||this.dateFormat,c;if(a)e=a(b);else if("string"===typeof b){if(d)a=this.dateFormats[d],(c=b.match(a.regex))&&(e=a.parser(c));else for(f in this.dateFormats)if(a=this.dateFormats[f],c=b.match(a.regex)){this.dateFormat=
f;this.alternativeFormat=a.alternative;e=a.parser(c);break}c||(c=Date.parse(b),"object"===typeof c&&null!==c&&c.getTime?e=c.getTime()-6E4*c.getTimezoneOffset():y(c)&&(e=c-6E4*(new Date(c)).getTimezoneOffset()))}return e},rowsToColumns:function(b){var a,e,f,d,c;if(b)for(c=[],e=b.length,a=0;a<e;a++)for(d=b[a].length,f=0;f<d;f++)c[f]||(c[f]=[]),c[f][a]=b[a][f];return c},parsed:function(){if(this.options.parsed)return this.options.parsed.call(this,this.columns)},getFreeIndexes:function(b,a){var e,f,d=
[],c=[],h;for(f=0;f<b;f+=1)d.push(!0);for(e=0;e<a.length;e+=1)for(h=a[e].getReferencedColumnIndexes(),f=0;f<h.length;f+=1)d[h[f]]=!1;for(f=0;f<d.length;f+=1)d[f]&&c.push(f);return c},complete:function(){var b=this.columns,a,e=this.options,f,d,c,h,g=[],k;if(e.complete||e.afterComplete){for(c=0;c<b.length;c++)this.firstRowAsNames&&(b[c].name=b[c].shift());f=[];d=this.getFreeIndexes(b.length,this.valueCount.seriesBuilders);for(c=0;c<this.valueCount.seriesBuilders.length;c++)k=this.valueCount.seriesBuilders[c],
k.populateColumns(d)&&g.push(k);for(;0<d.length;){k=new n;k.addColumnReader(0,"x");c=x(0,d);-1!==c&&d.splice(c,1);for(c=0;c<this.valueCount.global;c++)k.addColumnReader(void 0,this.valueCount.globalPointArrayMap[c]);k.populateColumns(d)&&g.push(k)}0<g.length&&0<g[0].readers.length&&(k=b[g[0].readers[0].columnIndex],void 0!==k&&(k.isDatetime?a="datetime":k.isNumeric||(a="category")));if("category"===a)for(c=0;c<g.length;c++)for(k=g[c],d=0;d<k.readers.length;d++)"x"===k.readers[d].configName&&(k.readers[d].configName=
"name");for(c=0;c<g.length;c++){k=g[c];d=[];for(h=0;h<b[0].length;h++)d[h]=k.read(b,h);f[c]={data:d};k.name&&(f[c].name=k.name);"category"===a&&(f[c].turboThreshold=0)}b={series:f};a&&(b.xAxis={type:a},"category"===a&&(b.xAxis.nameToX=!1));e.complete&&e.complete(b);e.afterComplete&&e.afterComplete(b)}}});g.Data=w;g.data=function(b,a){return new w(b,a)};g.wrap(g.Chart.prototype,"init",function(b,a,e){var f=this;a&&a.data?g.data(g.extend(a.data,{afterComplete:function(d){var c,h;if(a.hasOwnProperty("series"))if("object"===
typeof a.series)for(c=Math.max(a.series.length,d.series.length);c--;)h=a.series[c]||{},a.series[c]=g.merge(h,d.series[c]);else delete a.series;a=g.merge(d,a);b.call(f,a,e)}}),a):b.call(f,a,e)});n=function(){this.readers=[];this.pointIsArray=!0};n.prototype.populateColumns=function(b){var a=!0;m(this.readers,function(a){void 0===a.columnIndex&&(a.columnIndex=b.shift())});m(this.readers,function(b){void 0===b.columnIndex&&(a=!1)});return a};n.prototype.read=function(b,a){var e=this.pointIsArray,f=e?
[]:{},d;m(this.readers,function(c){var d=b[c.columnIndex][a];e?f.push(d):f[c.configName]=d});void 0===this.name&&2<=this.readers.length&&(d=this.getReferencedColumnIndexes(),2<=d.length&&(d.shift(),d.sort(),this.name=b[d.shift()].name));return f};n.prototype.addColumnReader=function(b,a){this.readers.push({columnIndex:b,configName:a});"x"!==a&&"y"!==a&&void 0!==a&&(this.pointIsArray=!1)};n.prototype.getReferencedColumnIndexes=function(){var b,a=[],e;for(b=0;b<this.readers.length;b+=1)e=this.readers[b],
void 0!==e.columnIndex&&a.push(e.columnIndex);return a};n.prototype.hasReader=function(b){var a,e;for(a=0;a<this.readers.length;a+=1)if(e=this.readers[a],e.configName===b)return!0}})(q)});

View File

@@ -0,0 +1,981 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Data module
*
* (c) 2012-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* global jQuery */
'use strict';
// Utilities
var win = Highcharts.win,
doc = win.document,
each = Highcharts.each,
pick = Highcharts.pick,
inArray = Highcharts.inArray,
isNumber = Highcharts.isNumber,
splat = Highcharts.splat,
SeriesBuilder;
// 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) || [];
this.firstRowAsNames = pick(options.firstRowAsNames, true);
this.decimalRegex = options.decimalPoint && new RegExp('^(-?[0-9]+)' + options.decimalPoint + '([0-9]+)$');
// This is a two-dimensional array holding the raw, trimmed string values
// with the same organisation as the columns array. It makes it possible
// for example to revert from interpreted timestamps to string-based
// categories.
this.rawColumns = [];
// 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,
options = this.options,
xColumns = [],
getValueCount = function(type) {
return (Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap || [0]).length;
},
getPointArrayMap = function(type) {
return Highcharts.seriesTypes[type || 'line'].prototype.pointArrayMap;
},
globalType = chartOptions && chartOptions.chart && chartOptions.chart.type,
individualCounts = [],
seriesBuilders = [],
seriesIndex = 0,
i;
each((chartOptions && chartOptions.series) || [], function(series) {
individualCounts.push(getValueCount(series.type || globalType));
});
// Collect the x-column indexes from seriesMapping
each((options && options.seriesMapping) || [], function(mapping) {
xColumns.push(mapping.x || 0);
});
// If there are no defined series with x-columns, use the first column as x column
if (xColumns.length === 0) {
xColumns.push(0);
}
// Loop all seriesMappings and constructs SeriesBuilders from
// the mapping options.
each((options && options.seriesMapping) || [], function(mapping) {
var builder = new SeriesBuilder(),
name,
numberOfValueColumnsNeeded = individualCounts[seriesIndex] || getValueCount(globalType),
seriesArr = (chartOptions && chartOptions.series) || [],
series = seriesArr[seriesIndex] || {},
pointArrayMap = getPointArrayMap(series.type || globalType) || ['y'];
// Add an x reader from the x property or from an undefined column
// if the property is not set. It will then be auto populated later.
builder.addColumnReader(mapping.x, 'x');
// Add all column mappings
for (name in mapping) {
if (mapping.hasOwnProperty(name) && name !== 'x') {
builder.addColumnReader(mapping[name], name);
}
}
// Add missing columns
for (i = 0; i < numberOfValueColumnsNeeded; i++) {
if (!builder.hasReader(pointArrayMap[i])) {
//builder.addNextColumnReader(pointArrayMap[i]);
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, pointArrayMap[i]);
}
}
seriesBuilders.push(builder);
seriesIndex++;
});
var globalPointArrayMap = getPointArrayMap(globalType);
if (globalPointArrayMap === undefined) {
globalPointArrayMap = ['y'];
}
this.valueCount = {
global: getValueCount(globalType),
xColumns: xColumns,
individual: individualCounts,
seriesBuilders: seriesBuilders,
globalPointArrayMap: globalPointArrayMap
};
},
/**
* 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 info about series and columns
this.getColumnDistribution();
// Interpret the values into right types
this.parseTypes();
// Handle columns if a handleColumns callback is given
if (this.parsed() !== false) {
// 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 = doc.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;
}
}
// Insert null for empty spreadsheet cells (#5298)
each(columns, function(column) {
for (i = 0; i < column.length; i++) {
if (column[i] === undefined) {
column[i] = null;
}
}
});
self.dataFound();
}
});
}
},
/**
* Trim a string from whitespace
*/
trim: function(str, inside) {
if (typeof str === 'string') {
str = str.replace(/^\s+|\s+$/g, '');
// Clear white space insdie the string, like thousands separators
if (inside && /^[0-9\s]+$/.test(str)) {
str = str.replace(/\s/g, '');
}
if (this.decimalRegex) {
str = str.replace(this.decimalRegex, '$1.$2');
}
}
return str;
},
/**
* Parse numeric cells in to number types and date types in to true dates.
*/
parseTypes: function() {
var columns = this.columns,
col = columns.length;
while (col--) {
this.parseColumn(columns[col], col);
}
},
/**
* Parse a single column. Set properties like .isDatetime and .isNumeric.
*/
parseColumn: function(column, col) {
var rawColumns = this.rawColumns,
columns = this.columns,
row = column.length,
val,
floatVal,
trimVal,
trimInsideVal,
firstRowAsNames = this.firstRowAsNames,
isXColumn = inArray(col, this.valueCount.xColumns) !== -1,
dateVal,
backup = [],
diff,
chartOptions = this.chartOptions,
descending,
columnTypes = this.options.columnTypes || [],
columnType = columnTypes[col],
forceCategory = isXColumn && ((chartOptions && chartOptions.xAxis && splat(chartOptions.xAxis)[0].type === 'category') || columnType === 'string');
if (!rawColumns[col]) {
rawColumns[col] = [];
}
while (row--) {
val = backup[row] || column[row];
trimVal = this.trim(val);
trimInsideVal = this.trim(val, true);
floatVal = parseFloat(trimInsideVal);
// Set it the first time
if (rawColumns[col][row] === undefined) {
rawColumns[col][row] = trimVal;
}
// Disable number or date parsing by setting the X axis type to category
if (forceCategory || (row === 0 && firstRowAsNames)) {
column[row] = trimVal;
} else if (+trimInsideVal === floatVal) { // is numeric
column[row] = floatVal;
// If the number is greater than milliseconds in a year, assume datetime
if (floatVal > 365 * 24 * 3600 * 1000 && columnType !== 'float') {
column.isDatetime = true;
} else {
column.isNumeric = true;
}
if (column[row + 1] !== undefined) {
descending = floatVal > column[row + 1];
}
// String, continue to determine if it is a date string or really a string
} else {
dateVal = this.parseDate(val);
// Only allow parsing of dates if this column is an x-column
if (isXColumn && isNumber(dateVal) && columnType !== 'float') { // is date
backup[row] = val;
column[row] = dateVal;
column.isDatetime = true;
// Check if the dates are uniformly descending or ascending. If they
// are not, chances are that they are a different time format, so check
// for alternative.
if (column[row + 1] !== undefined) {
diff = dateVal > column[row + 1];
if (diff !== descending && descending !== undefined) {
if (this.alternativeFormat) {
this.dateFormat = this.alternativeFormat;
row = column.length;
this.alternativeFormat = this.dateFormats[this.dateFormat].alternative;
} else {
column.unsorted = true;
}
}
descending = diff;
}
} else { // string
column[row] = trimVal === '' ? null : trimVal;
if (row !== 0 && (column.isDatetime || column.isNumeric)) {
column.mixed = true;
}
}
}
}
// If strings are intermixed with numbers or dates in a parsed column, it is an indication
// that parsing went wrong or the data was not intended to display as numbers or dates and
// parsing is too aggressive. Fall back to categories. Demonstrated in the
// highcharts/demo/column-drilldown sample.
if (isXColumn && column.mixed) {
columns[col] = rawColumns[col];
}
// If the 0 column is date or number and descending, reverse all columns.
if (isXColumn && descending && this.options.sort) {
for (col = 0; col < columns.length; col++) {
columns[col].reverse();
if (firstRowAsNames) {
columns[col].unshift(columns[col].pop());
}
}
}
},
/**
* 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]);
}
},
'dd/mm/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YYYY' // different format with the same regex
},
'mm/dd/YYYY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{4})$/,
parser: function(match) {
return Date.UTC(+match[3], match[1] - 1, +match[2]);
}
},
'dd/mm/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[2] - 1, +match[1]);
},
alternative: 'mm/dd/YY' // different format with the same regex
},
'mm/dd/YY': {
regex: /^([0-9]{1,2})[\-\/\.]([0-9]{1,2})[\-\/\.]([0-9]{2})$/,
parser: function(match) {
return Date.UTC(+match[3] + 2000, match[1] - 1, +match[2]);
}
}
},
/**
* Parse a date and return it as a number. Overridable through options.parseDate.
*/
parseDate: function(val) {
var parseDate = this.options.parseDate,
ret,
key,
format,
dateFormat = this.options.dateFormat || this.dateFormat,
match;
if (parseDate) {
ret = parseDate(val);
} else if (typeof val === 'string') {
// Auto-detect the date format the first time
if (!dateFormat) {
for (key in this.dateFormats) {
format = this.dateFormats[key];
match = val.match(format.regex);
if (match) {
this.dateFormat = dateFormat = key;
this.alternativeFormat = format.alternative;
ret = format.parser(match);
break;
}
}
// Next time, use the one previously found
} else {
format = this.dateFormats[dateFormat];
match = val.match(format.regex);
if (match) {
ret = format.parser(match);
}
}
// Fall back to Date.parse
if (!match) {
match = Date.parse(val);
// External tools like Date.js and MooTools extend Date object and
// returns a date.
if (typeof match === 'object' && match !== null && match.getTime) {
ret = match.getTime() - match.getTimezoneOffset() * 60000;
// Timestamp
} else if (isNumber(match)) {
ret = match - (new Date(match)).getTimezoneOffset() * 60000;
}
}
}
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) {
return this.options.parsed.call(this, this.columns);
}
},
getFreeIndexes: function(numberOfColumns, seriesBuilders) {
var s,
i,
freeIndexes = [],
freeIndexValues = [],
referencedIndexes;
// Add all columns as free
for (i = 0; i < numberOfColumns; i = i + 1) {
freeIndexes.push(true);
}
// Loop all defined builders and remove their referenced columns
for (s = 0; s < seriesBuilders.length; s = s + 1) {
referencedIndexes = seriesBuilders[s].getReferencedColumnIndexes();
for (i = 0; i < referencedIndexes.length; i = i + 1) {
freeIndexes[referencedIndexes[i]] = false;
}
}
// Collect the values for the free indexes
for (i = 0; i < freeIndexes.length; i = i + 1) {
if (freeIndexes[i]) {
freeIndexValues.push(i);
}
}
return freeIndexValues;
},
/**
* If a complete callback function is provided in the options, interpret the
* columns into a Highcharts options object.
*/
complete: function() {
var columns = this.columns,
xColumns = [],
type,
options = this.options,
series,
data,
i,
j,
r,
seriesIndex,
chartOptions,
allSeriesBuilders = [],
builder,
freeIndexes,
typeCol,
index;
xColumns.length = columns.length;
if (options.complete || options.afterComplete) {
// Get the names and shift the top row
for (i = 0; i < columns.length; i++) {
if (this.firstRowAsNames) {
columns[i].name = columns[i].shift();
}
}
// Use the next columns for series
series = [];
freeIndexes = this.getFreeIndexes(columns.length, this.valueCount.seriesBuilders);
// Populate defined series
for (seriesIndex = 0; seriesIndex < this.valueCount.seriesBuilders.length; seriesIndex++) {
builder = this.valueCount.seriesBuilders[seriesIndex];
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Populate dynamic series
while (freeIndexes.length > 0) {
builder = new SeriesBuilder();
builder.addColumnReader(0, 'x');
// Mark index as used (not free)
index = inArray(0, freeIndexes);
if (index !== -1) {
freeIndexes.splice(index, 1);
}
for (i = 0; i < this.valueCount.global; i++) {
// Create and add a column reader for the next free column index
builder.addColumnReader(undefined, this.valueCount.globalPointArrayMap[i]);
}
// If the builder can be populated with remaining columns, then add it to allBuilders
if (builder.populateColumns(freeIndexes)) {
allSeriesBuilders.push(builder);
}
}
// Get the data-type from the first series x column
if (allSeriesBuilders.length > 0 && allSeriesBuilders[0].readers.length > 0) {
typeCol = columns[allSeriesBuilders[0].readers[0].columnIndex];
if (typeCol !== undefined) {
if (typeCol.isDatetime) {
type = 'datetime';
} else if (!typeCol.isNumeric) {
type = 'category';
}
}
}
// Axis type is category, then the "x" column should be called "name"
if (type === 'category') {
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
for (r = 0; r < builder.readers.length; r++) {
if (builder.readers[r].configName === 'x') {
builder.readers[r].configName = 'name';
}
}
}
}
// Read data for all builders
for (seriesIndex = 0; seriesIndex < allSeriesBuilders.length; seriesIndex++) {
builder = allSeriesBuilders[seriesIndex];
// Iterate down the cells of each column and add data to the series
data = [];
for (j = 0; j < columns[0].length; j++) {
data[j] = builder.read(columns, j);
}
// Add the series
series[seriesIndex] = {
data: data
};
if (builder.name) {
series[seriesIndex].name = builder.name;
}
if (type === 'category') {
series[seriesIndex].turboThreshold = 0;
}
}
// Do the callback
chartOptions = {
series: series
};
if (type) {
chartOptions.xAxis = {
type: type
};
if (type === 'category') {
chartOptions.xAxis.nameToX = false;
}
}
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);
}
});
/**
* Creates a new SeriesBuilder. A SeriesBuilder consists of a number
* of ColumnReaders that reads columns and give them a name.
* Ex: A series builder can be constructed to read column 3 as 'x' and
* column 7 and 8 as 'y1' and 'y2'.
* The output would then be points/rows of the form {x: 11, y1: 22, y2: 33}
*
* The name of the builder is taken from the second column. In the above
* example it would be the column with index 7.
* @constructor
*/
SeriesBuilder = function() {
this.readers = [];
this.pointIsArray = true;
};
/**
* Populates readers with column indexes. A reader can be added without
* a specific index and for those readers the index is taken sequentially
* from the free columns (this is handled by the ColumnCursor instance).
* @returns {boolean}
*/
SeriesBuilder.prototype.populateColumns = function(freeIndexes) {
var builder = this,
enoughColumns = true;
// Loop each reader and give it an index if its missing.
// The freeIndexes.shift() will return undefined if there
// are no more columns.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
reader.columnIndex = freeIndexes.shift();
}
});
// Now, all readers should have columns mapped. If not
// then return false to signal that this series should
// not be added.
each(builder.readers, function(reader) {
if (reader.columnIndex === undefined) {
enoughColumns = false;
}
});
return enoughColumns;
};
/**
* Reads a row from the dataset and returns a point or array depending
* on the names of the readers.
* @param columns
* @param rowIndex
* @returns {Array | Object}
*/
SeriesBuilder.prototype.read = function(columns, rowIndex) {
var builder = this,
pointIsArray = builder.pointIsArray,
point = pointIsArray ? [] : {},
columnIndexes;
// Loop each reader and ask it to read its value.
// Then, build an array or point based on the readers names.
each(builder.readers, function(reader) {
var value = columns[reader.columnIndex][rowIndex];
if (pointIsArray) {
point.push(value);
} else {
point[reader.configName] = value;
}
});
// The name comes from the first column (excluding the x column)
if (this.name === undefined && builder.readers.length >= 2) {
columnIndexes = builder.getReferencedColumnIndexes();
if (columnIndexes.length >= 2) {
// remove the first one (x col)
columnIndexes.shift();
// Sort the remaining
columnIndexes.sort();
// Now use the lowest index as name column
this.name = columns[columnIndexes.shift()].name;
}
}
return point;
};
/**
* Creates and adds ColumnReader from the given columnIndex and configName.
* ColumnIndex can be undefined and in that case the reader will be given
* an index when columns are populated.
* @param columnIndex {Number | undefined}
* @param configName
*/
SeriesBuilder.prototype.addColumnReader = function(columnIndex, configName) {
this.readers.push({
columnIndex: columnIndex,
configName: configName
});
if (!(configName === 'x' || configName === 'y' || configName === undefined)) {
this.pointIsArray = false;
}
};
/**
* Returns an array of column indexes that the builder will use when
* reading data.
* @returns {Array}
*/
SeriesBuilder.prototype.getReferencedColumnIndexes = function() {
var i,
referencedColumnIndexes = [],
columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.columnIndex !== undefined) {
referencedColumnIndexes.push(columnReader.columnIndex);
}
}
return referencedColumnIndexes;
};
/**
* Returns true if the builder has a reader for the given configName.
* @param configName
* @returns {boolean}
*/
SeriesBuilder.prototype.hasReader = function(configName) {
var i, columnReader;
for (i = 0; i < this.readers.length; i = i + 1) {
columnReader = this.readers[i];
if (columnReader.configName === configName) {
return true;
}
}
// Else return undefined
};
}(Highcharts));
}));

View File

@@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Highcharts Drilldown module
Author: Torstein Honsi
License: www.highcharts.com/license
*/
(function(n){"object"===typeof module&&module.exports?module.exports=n:n(Highcharts)})(function(n){(function(e){function n(b,a,d){var c;a.rgba.length&&b.rgba.length?(b=b.rgba,a=a.rgba,c=1!==a[3]||1!==b[3],b=(c?"rgba(":"rgb(")+Math.round(a[0]+(b[0]-a[0])*(1-d))+","+Math.round(a[1]+(b[1]-a[1])*(1-d))+","+Math.round(a[2]+(b[2]-a[2])*(1-d))+(c?","+(a[3]+(b[3]-a[3])*(1-d)):"")+")"):b=a.input||"none";return b}var A=e.noop,B=e.color,u=e.defaultOptions,h=e.each,p=e.extend,H=e.format,C=e.pick,v=e.wrap,q=e.Chart,
t=e.seriesTypes,D=t.pie,r=t.column,E=e.Tick,w=e.fireEvent,F=e.inArray,G=1;h(["fill","stroke"],function(b){e.Fx.prototype[b+"Setter"]=function(){this.elem.attr(b,n(B(this.start),B(this.end),this.pos))}});p(u.lang,{drillUpText:"\u25c1 Back to {series.name}"});u.drilldown={activeAxisLabelStyle:{cursor:"pointer",color:"#003399",fontWeight:"bold",textDecoration:"underline"},activeDataLabelStyle:{cursor:"pointer",color:"#003399",fontWeight:"bold",textDecoration:"underline"},animation:{duration:500},drillUpButton:{position:{align:"right",
x:-10,y:10}}};e.SVGRenderer.prototype.Element.prototype.fadeIn=function(b){this.attr({opacity:.1,visibility:"inherit"}).animate({opacity:C(this.newOpacity,1)},b||{duration:250})};q.prototype.addSeriesAsDrilldown=function(b,a){this.addSingleSeriesAsDrilldown(b,a);this.applyDrilldown()};q.prototype.addSingleSeriesAsDrilldown=function(b,a){var d=b.series,c=d.xAxis,g=d.yAxis,f,k=[],x=[],e,m,y;y={color:b.color||d.color};this.drilldownLevels||(this.drilldownLevels=[]);e=d.options._levelNumber||0;(m=this.drilldownLevels[this.drilldownLevels.length-
1])&&m.levelNumber!==e&&(m=void 0);a=p(p({_ddSeriesId:G++},y),a);f=F(b,d.points);h(d.chart.series,function(a){a.xAxis!==c||a.isDrilling||(a.options._ddSeriesId=a.options._ddSeriesId||G++,a.options._colorIndex=a.userOptions._colorIndex,a.options._levelNumber=a.options._levelNumber||e,m?(k=m.levelSeries,x=m.levelSeriesOptions):(k.push(a),x.push(a.options)))});f=p({levelNumber:e,seriesOptions:d.options,levelSeriesOptions:x,levelSeries:k,shapeArgs:b.shapeArgs,bBox:b.graphic?b.graphic.getBBox():{},lowerSeriesOptions:a,
pointOptions:d.options.data[f],pointIndex:f,oldExtremes:{xMin:c&&c.userMin,xMax:c&&c.userMax,yMin:g&&g.userMin,yMax:g&&g.userMax}},y);this.drilldownLevels.push(f);f=f.lowerSeries=this.addSeries(a,!1);f.options._levelNumber=e+1;c&&(c.oldPos=c.pos,c.userMin=c.userMax=null,g.userMin=g.userMax=null);d.type===f.type&&(f.animate=f.animateDrilldown||A,f.options.animation=!0)};q.prototype.applyDrilldown=function(){var b=this.drilldownLevels,a;b&&0<b.length&&(a=b[b.length-1].levelNumber,h(this.drilldownLevels,
function(b){b.levelNumber===a&&h(b.levelSeries,function(c){c.options&&c.options._levelNumber===a&&c.remove(!1)})}));this.redraw();this.showDrillUpButton()};q.prototype.getDrilldownBackText=function(){var b=this.drilldownLevels;if(b&&0<b.length)return b=b[b.length-1],b.series=b.seriesOptions,H(this.options.lang.drillUpText,b)};q.prototype.showDrillUpButton=function(){var b=this,a=this.getDrilldownBackText(),d=b.options.drilldown.drillUpButton,c,g;this.drillUpButton?this.drillUpButton.attr({text:a}).align():
(g=(c=d.theme)&&c.states,this.drillUpButton=this.renderer.button(a,null,null,function(){b.drillUp()},c,g&&g.hover,g&&g.select).addClass("highcharts-drillup-button").attr({align:d.position.align,zIndex:7}).add().align(d.position,!1,d.relativeTo||"plotBox"))};q.prototype.drillUp=function(){for(var b=this,a=b.drilldownLevels,d=a[a.length-1].levelNumber,c=a.length,g=b.series,f,k,e,l,m=function(a){var c;h(g,function(b){b.options._ddSeriesId===a._ddSeriesId&&(c=b)});c=c||b.addSeries(a,!1);c.type===e.type&&
c.animateDrillupTo&&(c.animate=c.animateDrillupTo);a===k.seriesOptions&&(l=c)};c--;)if(k=a[c],k.levelNumber===d){a.pop();e=k.lowerSeries;if(!e.chart)for(f=g.length;f--;)if(g[f].options.id===k.lowerSeriesOptions.id&&g[f].options._levelNumber===d+1){e=g[f];break}e.xData=[];h(k.levelSeriesOptions,m);w(b,"drillup",{seriesOptions:k.seriesOptions});l.type===e.type&&(l.drilldownLevel=k,l.options.animation=b.options.drilldown.animation,e.animateDrillupFrom&&e.chart&&e.animateDrillupFrom(k));l.options._levelNumber=
d;e.remove(!1);l.xAxis&&(f=k.oldExtremes,l.xAxis.setExtremes(f.xMin,f.xMax,!1),l.yAxis.setExtremes(f.yMin,f.yMax,!1))}w(b,"drillupall");this.redraw();0===this.drilldownLevels.length?this.drillUpButton=this.drillUpButton.destroy():this.drillUpButton.attr({text:this.getDrilldownBackText()}).align();this.ddDupes.length=[]};r.prototype.supportsDrilldown=!0;r.prototype.animateDrillupTo=function(b){if(!b){var a=this,d=a.drilldownLevel;h(this.points,function(a){a.graphic&&a.graphic.hide();a.dataLabel&&a.dataLabel.hide();
a.connector&&a.connector.hide()});setTimeout(function(){a.points&&h(a.points,function(a,b){var f=b===(d&&d.pointIndex)?"show":"fadeIn",k="show"===f?!0:void 0;if(a.graphic)a.graphic[f](k);if(a.dataLabel)a.dataLabel[f](k);if(a.connector)a.connector[f](k)})},Math.max(this.chart.options.drilldown.animation.duration-50,0));this.animate=A}};r.prototype.animateDrilldown=function(b){var a=this,d=this.chart.drilldownLevels,c,g=this.chart.options.drilldown.animation,f=this.xAxis;b||(h(d,function(b){a.options._ddSeriesId===
b.lowerSeriesOptions._ddSeriesId&&(c=b.shapeArgs,c.fill=b.color)}),c.x+=C(f.oldPos,f.pos)-f.pos,h(this.points,function(b){b.shapeArgs.fill=b.color;b.graphic&&b.graphic.attr(c).animate(p(b.shapeArgs,{fill:b.color||a.color}),g);b.dataLabel&&b.dataLabel.fadeIn(g)}),this.animate=null)};r.prototype.animateDrillupFrom=function(b){var a=this.chart.options.drilldown.animation,d=this.group,c=this;h(c.trackerGroups,function(a){if(c[a])c[a].on("mouseover")});delete this.group;h(this.points,function(c){var f=
c.graphic,k=b.shapeArgs,h=function(){f.destroy();d&&(d=d.destroy())};f&&(delete c.graphic,k.fill=b.color,a?f.animate(k,e.merge(a,{complete:h})):(f.attr(k),h()))})};D&&p(D.prototype,{supportsDrilldown:!0,animateDrillupTo:r.prototype.animateDrillupTo,animateDrillupFrom:r.prototype.animateDrillupFrom,animateDrilldown:function(b){var a=this.chart.drilldownLevels[this.chart.drilldownLevels.length-1],d=this.chart.options.drilldown.animation,c=a.shapeArgs,g=c.start,f=(c.end-g)/this.points.length;b||(h(this.points,
function(b,h){var l=b.shapeArgs;c.fill=a.color;l.fill=b.color;if(b.graphic)b.graphic.attr(e.merge(c,{start:g+h*f,end:g+(h+1)*f}))[d?"animate":"attr"](l,d)}),this.animate=null)}});e.Point.prototype.doDrilldown=function(b,a,d){var c=this.series.chart,g=c.options.drilldown,f=(g.series||[]).length,e;c.ddDupes||(c.ddDupes=[]);for(;f--&&!e;)g.series[f].id===this.drilldown&&-1===F(this.drilldown,c.ddDupes)&&(e=g.series[f],c.ddDupes.push(this.drilldown));w(c,"drilldown",{point:this,seriesOptions:e,category:a,
originalEvent:d,points:void 0!==a&&this.series.xAxis.getDDPoints(a).slice(0)},function(a){var c=a.point.series&&a.point.series.chart,d=a.seriesOptions;c&&d&&(b?c.addSingleSeriesAsDrilldown(a.point,d):c.addSeriesAsDrilldown(a.point,d))})};e.Axis.prototype.drilldownCategory=function(b,a){var d,c,e=this.getDDPoints(b);for(d in e)(c=e[d])&&c.series&&c.series.visible&&c.doDrilldown&&c.doDrilldown(!0,b,a);this.chart.applyDrilldown()};e.Axis.prototype.getDDPoints=function(b){var a=[];h(this.series,function(d){var c,
e=d.xData,f=d.points;for(c=0;c<e.length;c++)if(e[c]===b&&d.options.data[c].drilldown){a.push(f?f[c]:!0);break}});return a};E.prototype.drillable=function(){var b=this.pos,a=this.label,d=this.axis,c="xAxis"===d.coll&&d.getDDPoints,g=c&&d.getDDPoints(b);c&&(a&&g.length?(a.drillable=!0,a.basicStyles||(a.basicStyles=e.merge(a.styles)),a.addClass("highcharts-drilldown-axis-label").css(d.chart.options.drilldown.activeAxisLabelStyle).on("click",function(a){d.drilldownCategory(b,a)})):a&&a.drillable&&(a.styles=
{},a.css(a.basicStyles),a.on("click",null),a.removeClass("highcharts-drilldown-axis-label")))};v(E.prototype,"addLabel",function(b){b.call(this);this.drillable()});v(e.Point.prototype,"init",function(b,a,d,c){var g=b.call(this,a,d,c);b=(b=a.xAxis)&&b.ticks[c];g.drilldown&&e.addEvent(g,"click",function(b){a.xAxis&&!1===a.chart.options.drilldown.allowPointDrilldown?a.xAxis.drilldownCategory(c,b):g.doDrilldown(void 0,void 0,b)});b&&b.drillable();return g});v(e.Series.prototype,"drawDataLabels",function(b){var a=
this.chart.options.drilldown.activeDataLabelStyle,d=this.chart.renderer;b.call(this);h(this.points,function(b){var e={};b.drilldown&&b.dataLabel&&("contrast"===a.color&&(e.color=d.getContrast(b.color||this.color)),b.dataLabel.addClass("highcharts-drilldown-data-label"),b.dataLabel.css(a).css(e))},this)});var z,u=function(b){b.call(this);h(this.points,function(a){a.drilldown&&a.graphic&&(a.graphic.addClass("highcharts-drilldown-point"),a.graphic.css({cursor:"pointer"}))})};for(z in t)t[z].prototype.supportsDrilldown&&
v(t[z].prototype,"drawTracker",u)})(n)});

View File

@@ -0,0 +1,791 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Highcharts Drilldown module
*
* Author: Torstein Honsi
* License: www.highcharts.com/license
*
*/
'use strict';
var noop = H.noop,
color = H.color,
defaultOptions = H.defaultOptions,
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,
Tick = H.Tick,
fireEvent = H.fireEvent,
inArray = H.inArray,
ddSeriesId = 1;
// Utilities
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color. This method is copied from ColorAxis.js
* and should always be kept updated, until we get AMD support.
*/
function tweenColors(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, tweenColors(color(this.start), color(this.end), this.pos));
};
});
// Add language
extend(defaultOptions.lang, {
drillUpText: '◁ Back to {series.name}'
});
defaultOptions.drilldown = {
activeAxisLabelStyle: {
cursor: 'pointer',
color: '#003399',
fontWeight: 'bold',
textDecoration: 'underline'
},
activeDataLabelStyle: {
cursor: 'pointer',
color: '#003399',
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,
pointIndex,
levelSeries = [],
levelSeriesOptions = [],
level,
levelNumber,
last,
colorProp;
colorProp = {
color: point.color || oldSeries.color
};
if (!this.drilldownLevels) {
this.drilldownLevels = [];
}
levelNumber = oldSeries.options._levelNumber || 0;
// See if we can reuse the registered series from last run
last = this.drilldownLevels[this.drilldownLevels.length - 1];
if (last && last.levelNumber !== levelNumber) {
last = undefined;
}
ddOptions = extend(extend({
_ddSeriesId: ddSeriesId++
}, colorProp), ddOptions);
pointIndex = inArray(point, oldSeries.points);
// Record options for all current series
each(oldSeries.chart.series, function(series) {
if (series.xAxis === xAxis && !series.isDrilling) {
series.options._ddSeriesId = series.options._ddSeriesId || ddSeriesId++;
series.options._colorIndex = series.userOptions._colorIndex;
series.options._levelNumber = series.options._levelNumber || levelNumber; // #3182
if (last) {
levelSeries = last.levelSeries;
levelSeriesOptions = last.levelSeriesOptions;
} else {
levelSeries.push(series);
levelSeriesOptions.push(series.options);
}
}
});
// Add a record of properties for each drilldown level
level = extend({
levelNumber: levelNumber,
seriesOptions: oldSeries.options,
levelSeriesOptions: levelSeriesOptions,
levelSeries: levelSeries,
shapeArgs: point.shapeArgs,
bBox: point.graphic ? point.graphic.getBBox() : {}, // no graphic in line series with markers disabled
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
}
}, colorProp);
// Push it to the lookup array
this.drilldownLevels.push(level);
newSeries = level.lowerSeries = this.addSeries(ddOptions, false);
newSeries.options._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;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
levelToRemove = drilldownLevels[drilldownLevels.length - 1].levelNumber;
each(this.drilldownLevels, function(level) {
if (level.levelNumber === levelToRemove) {
each(level.levelSeries, function(series) {
if (series.options && series.options._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 drilldownLevels = this.drilldownLevels,
lastLevel;
if (drilldownLevels && drilldownLevels.length > 0) { // #3352, async loading
lastLevel = drilldownLevels[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
)
.addClass('highcharts-drillup-button')
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.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,
level,
oldSeries,
newSeries,
oldExtremes,
addSeries = function(seriesOptions) {
var addedSeries;
each(chartSeries, function(series) {
if (series.options._ddSeriesId === seriesOptions._ddSeriesId) {
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
seriesI = chartSeries.length; // #2919
while (seriesI--) {
if (chartSeries[seriesI].options.id === level.lowerSeriesOptions.id &&
chartSeries[seriesI].options._levelNumber === levelNumber + 1) { // #3867
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.chart) { // #2919
oldSeries.animateDrillupFrom(level);
}
}
newSeries.options._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);
}
}
}
// Fire a once-off event after all series have been drilled up (#5158)
fireEvent(chart, 'drillupall');
this.redraw();
if (this.drilldownLevels.length === 0) {
this.drillUpButton = this.drillUpButton.destroy();
} else {
this.drillUpButton.attr({
text: this.getDrilldownBackText()
})
.align();
}
this.ddDupes.length = []; // #3315
};
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) {
if (point.graphic) { // #3407
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() {
if (newSeries.points) { // May be destroyed in the meantime, #3389
each(newSeries.points, function(point, i) {
// Fade in other points
var verb = i === (level && level.pointIndex) ? 'show' : 'fadeIn',
inherit = verb === 'show' ? true : undefined;
if (point.graphic) { // #3407
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,
animationOptions = this.chart.options.drilldown.animation,
xAxis = this.xAxis;
if (!init) {
each(drilldownLevels, function(level) {
if (series.options._ddSeriesId === level.lowerSeriesOptions._ddSeriesId) {
animateFrom = level.shapeArgs;
// Add the point colors to animate from
animateFrom.fill = level.color;
}
});
animateFrom.x += (pick(xAxis.oldPos, xAxis.pos) - xAxis.pos);
each(this.points, function(point) {
var animateTo = point.shapeArgs;
// Add the point colors to animate to
animateTo.fill = point.color;
if (point.graphic) {
point.graphic
.attr(animateFrom)
.animate(
extend(point.shapeArgs, {
fill: point.color || series.color
}),
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,
animateTo = level.shapeArgs,
complete = function() {
graphic.destroy();
if (group) {
group = group.destroy();
}
};
if (graphic) {
delete point.graphic;
animateTo.fill = level.color;
if (animationOptions) {
graphic.animate(
animateTo,
H.merge(animationOptions, {
complete: complete
})
);
} else {
graphic.attr(animateTo);
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;
if (!init) {
each(this.points, function(point, i) {
var animateTo = point.shapeArgs;
animateFrom.fill = level.color;
animateTo.fill = point.color;
if (point.graphic) {
point.graphic
.attr(H.merge(animateFrom, {
start: start + i * startAngle,
end: start + (i + 1) * startAngle
}))[animationOptions ? 'animate' : 'attr'](
animateTo,
animationOptions
);
}
});
this.animate = null;
}
}
});
}
H.Point.prototype.doDrilldown = function(_holdRedraw, category, originalEvent) {
var series = this.series,
chart = series.chart,
drilldown = chart.options.drilldown,
i = (drilldown.series || []).length,
seriesOptions;
if (!chart.ddDupes) {
chart.ddDupes = [];
}
while (i-- && !seriesOptions) {
if (drilldown.series[i].id === this.drilldown && inArray(this.drilldown, chart.ddDupes) === -1) {
seriesOptions = drilldown.series[i];
chart.ddDupes.push(this.drilldown);
}
}
// 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,
category: category,
originalEvent: originalEvent,
points: category !== undefined && this.series.xAxis.getDDPoints(category).slice(0)
}, function(e) {
var chart = e.point.series && e.point.series.chart,
seriesOptions = e.seriesOptions;
if (chart && seriesOptions) {
if (_holdRedraw) {
chart.addSingleSeriesAsDrilldown(e.point, seriesOptions);
} else {
chart.addSeriesAsDrilldown(e.point, seriesOptions);
}
}
});
};
/**
* Drill down to a given category. This is the same as clicking on an axis label.
*/
H.Axis.prototype.drilldownCategory = function(x, e) {
var key,
point,
ddPointsX = this.getDDPoints(x);
for (key in ddPointsX) {
point = ddPointsX[key];
if (point && point.series && point.series.visible && point.doDrilldown) { // #3197
point.doDrilldown(true, x, e);
}
}
this.chart.applyDrilldown();
};
/**
* Return drillable points for this specific X value
*/
H.Axis.prototype.getDDPoints = function(x) {
var ret = [];
each(this.series, function(series) {
var i,
xData = series.xData,
points = series.points;
for (i = 0; i < xData.length; i++) {
if (xData[i] === x && series.options.data[i].drilldown) {
ret.push(points ? points[i] : true);
break;
}
}
});
return ret;
};
/**
* Make a tick label drillable, or remove drilling on update
*/
Tick.prototype.drillable = function() {
var pos = this.pos,
label = this.label,
axis = this.axis,
isDrillable = axis.coll === 'xAxis' && axis.getDDPoints,
ddPointsX = isDrillable && axis.getDDPoints(pos);
if (isDrillable) {
if (label && ddPointsX.length) {
label.drillable = true;
if (!label.basicStyles) {
label.basicStyles = H.merge(label.styles);
}
label
.addClass('highcharts-drilldown-axis-label')
.css(axis.chart.options.drilldown.activeAxisLabelStyle)
.on('click', function(e) {
axis.drilldownCategory(pos, e);
});
} else if (label && label.drillable) {
label.styles = {}; // reset for full overwrite of styles
label.css(label.basicStyles);
label.on('click', null); // #3806
label.removeClass('highcharts-drilldown-axis-label');
}
}
};
/**
* Always keep the drillability updated (#3951)
*/
wrap(Tick.prototype, 'addLabel', function(proceed) {
proceed.call(this);
this.drillable();
});
/**
* On initialization of each point, identify its label and make it clickable. Also, provide a
* list of points associated to that label.
*/
wrap(H.Point.prototype, 'init', function(proceed, series, options, x) {
var point = proceed.call(this, series, options, x),
xAxis = series.xAxis,
tick = xAxis && xAxis.ticks[x];
if (point.drilldown) {
// Add the click event to the point
H.addEvent(point, 'click', function(e) {
if (series.xAxis && series.chart.options.drilldown.allowPointDrilldown === false) {
series.xAxis.drilldownCategory(x, e);
} else {
point.doDrilldown(undefined, undefined, e);
}
});
/*wrap(point, 'importEvents', function (proceed) { // wrapping importEvents makes point.click event work
if (!this.hasImportedEvents) {
proceed.call(this);
H.addEvent(this, 'click', function () {
this.doDrilldown();
});
}
});*/
}
// Add or remove click handler and style on the tick label
if (tick) {
tick.drillable();
}
return point;
});
wrap(H.Series.prototype, 'drawDataLabels', function(proceed) {
var css = this.chart.options.drilldown.activeDataLabelStyle,
renderer = this.chart.renderer;
proceed.call(this);
each(this.points, function(point) {
var pointCSS = {};
if (point.drilldown && point.dataLabel) {
if (css.color === 'contrast') {
pointCSS.color = renderer.getContrast(point.color || this.color);
}
point.dataLabel
.addClass('highcharts-drilldown-data-label');
point.dataLabel
.css(css)
.css(pointCSS);
}
}, this);
});
// 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.addClass('highcharts-drilldown-point');
point.graphic.css({
cursor: 'pointer'
});
}
});
};
for (type in seriesTypes) {
if (seriesTypes[type].prototype.supportsDrilldown) {
wrap(seriesTypes[type].prototype, 'drawTracker', drawTrackerWrapper);
}
}
}(Highcharts));
}));

View File

@@ -0,0 +1,26 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Exporting module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(h){"object"===typeof module&&module.exports?module.exports=h:h(Highcharts)})(function(h){(function(f){var h=f.defaultOptions,q=f.doc,u=f.Chart,v=f.addEvent,D=f.removeEvent,E=f.fireEvent,r=f.createElement,w=f.discardElement,x=f.css,p=f.merge,B=f.pick,k=f.each,t=f.extend,H=f.splat,I=f.isTouchDevice,F=f.win,J=f.Renderer.prototype.symbols;t(h.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"});h.navigation={buttonOptions:{theme:{},symbolSize:14,symbolX:12.5,symbolY:10.5,align:"right",buttonSpacing:3,height:22,verticalAlign:"top",width:24}};p(!0,h.navigation,{menuStyle:{border:"1px solid #999999",background:"#ffffff",padding:"5px 0"},menuItemStyle:{padding:"0.5em 1em",background:"none",color:"#333333",fontSize:I?"14px":"11px",transition:"background 250ms, color 250ms"},menuItemHoverStyle:{background:"#335cad",color:"#ffffff"},buttonOptions:{symbolFill:"#666666",
symbolStroke:"#666666",symbolStrokeWidth:3,theme:{fill:"#ffffff",stroke:"none",padding:5}}});h.exporting={type:"image/png",url:"https://export.highcharts.com/",printMaxWidth:780,scale:2,buttons:{contextButton:{className:"highcharts-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(a,c,e){var b;a=r("form",p({method:"post",action:a,enctype:"multipart/form-data"},e),{display:"none"},q.body);for(b in c)r("input",{type:"hidden",name:b,value:c[b]},null,a);a.submit();w(a)};t(u.prototype,{sanitizeSVG:function(a){a=a.replace(/zIndex="[^"]+"/g,"").replace(/isShadow="[^"]+"/g,"").replace(/symbolName="[^"]+"/g,
"").replace(/jQuery[0-9]+="[^"]+"/g,"").replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g,"url($2)").replace(/url\([^#]+#/g,"url(#").replace(/<svg /,'<svg xmlns:xlink="http://www.w3.org/1999/xlink" ').replace(/ (NS[0-9]+\:)?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(/&nbsp;/g,"\u00a0").replace(/&shy;/g,"\u00ad");return a=a.replace(/<IMG /g,"<image ").replace(/<(\/?)TITLE>/g,
"<$1title>").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()})},getChartHTML:function(){return this.container.innerHTML},getSVG:function(a){var c=this,e,b,g,C,l,d=p(c.options,a),m=d.exporting.allowHTML;q.createElementNS||
(q.createElementNS=function(a,b){return q.createElement(b)});b=r("div",null,{position:"absolute",top:"-9999em",width:c.chartWidth+"px",height:c.chartHeight+"px"},q.body);g=c.renderTo.style.width;l=c.renderTo.style.height;g=d.exporting.sourceWidth||d.chart.width||/px$/.test(g)&&parseInt(g,10)||600;l=d.exporting.sourceHeight||d.chart.height||/px$/.test(l)&&parseInt(l,10)||400;t(d.chart,{animation:!1,renderTo:b,forExport:!0,renderer:"SVGRenderer",width:g,height:l});d.exporting.enabled=!1;delete d.data;
d.series=[];k(c.series,function(a){C=p(a.userOptions,{animation:!1,enableMouseTracking:!1,showCheckbox:!1,visible:a.visible});C.isInternal||d.series.push(C)});a&&k(["xAxis","yAxis"],function(b){k(H(a[b]),function(a,c){d[b][c]=p(d[b][c],a)})});e=new f.Chart(d,c.callback);k(["xAxis","yAxis"],function(a){k(c[a],function(b,c){var d=e[a][c],g=b.getExtremes(),f=g.userMin,g=g.userMax;!d||void 0===f&&void 0===g||d.setExtremes(f,g,!0,!1)})});g=e.getChartHTML();d=null;e.destroy();w(b);m&&(b=g.match(/<\/svg>(.*?$)/))&&
(b='<foreignObject x="0" y="0" width="200" height="200"><body xmlns="http://www.w3.org/1999/xhtml">'+b[1]+"</body></foreignObject>",g=g.replace("</svg>",b+"</svg>"));g=this.sanitizeSVG(g);return g=g.replace(/(url\(#highcharts-[0-9]+)&quot;/g,"$1").replace(/&quot;/g,"'")},getSVGForExport:function(a,c){var e=this.options.exporting;return this.getSVG(p({chart:{borderRadius:0}},e.chartOptions,c,{exporting:{sourceWidth:a&&a.sourceWidth||e.sourceWidth,sourceHeight:a&&a.sourceHeight||e.sourceHeight}}))},
exportChart:function(a,c){var e=this.getSVGForExport(a,c);a=p(this.options.exporting,a);f.post(a.url,{filename:a.filename||"chart",type:a.type,width:a.width||0,scale:a.scale,svg:e},a.formAttributes)},print:function(){var a=this,c=a.container,e=[],b=c.parentNode,g=q.body,f=g.childNodes,l=a.options.exporting.printMaxWidth,d,m;if(!a.isPrinting){a.isPrinting=!0;a.pointer.reset(null,0);E(a,"beforePrint");if(m=l&&a.chartWidth>l)d=[a.options.chart.width,void 0,!1],a.setSize(l,void 0,!1);k(f,function(a,b){1===
a.nodeType&&(e[b]=a.style.display,a.style.display="none")});g.appendChild(c);F.focus();F.print();setTimeout(function(){b.appendChild(c);k(f,function(a,b){1===a.nodeType&&(a.style.display=e[b])});a.isPrinting=!1;m&&a.setSize.apply(a,d);E(a,"afterPrint")},1E3)}},contextMenu:function(a,c,e,b,g,f,l){var d=this,m=d.options.navigation,h=d.chartWidth,p=d.chartHeight,G="cache-"+a,n=d[G],y=Math.max(g,f),z,A,u,w=function(b){d.pointer.inClass(b.target,a)||A()};n||(d[G]=n=r("div",{className:a},{position:"absolute",
zIndex:1E3,padding:y+"px"},d.container),z=r("div",{className:"highcharts-menu"},null,n),x(z,t({MozBoxShadow:"3px 3px 10px #888",WebkitBoxShadow:"3px 3px 10px #888",boxShadow:"3px 3px 10px #888"},m.menuStyle)),A=function(){x(n,{display:"none"});l&&l.setState(0);d.openMenu=!1},v(n,"mouseleave",function(){u=setTimeout(A,500)}),v(n,"mouseenter",function(){clearTimeout(u)}),v(q,"mouseup",w),v(d,"destroy",function(){D(q,"mouseup",w)}),k(c,function(a){if(a){var b;a.separator?b=r("hr",null,null,z):(b=r("div",
{className:"highcharts-menu-item",onclick:function(b){b&&b.stopPropagation();A();a.onclick&&a.onclick.apply(d,arguments)},innerHTML:a.text||d.options.lang[a.textKey]},null,z),b.onmouseover=function(){x(this,m.menuItemHoverStyle)},b.onmouseout=function(){x(this,m.menuItemStyle)},x(b,t({cursor:"pointer"},m.menuItemStyle)));d.exportDivElements.push(b)}}),d.exportDivElements.push(z,n),d.exportMenuWidth=n.offsetWidth,d.exportMenuHeight=n.offsetHeight);c={display:"block"};e+d.exportMenuWidth>h?c.right=
h-e-g-y+"px":c.left=e-y+"px";b+f+d.exportMenuHeight>p&&"top"!==l.alignOptions.verticalAlign?c.bottom=p-b-y+"px":c.top=b+f-y+"px";x(n,c);d.openMenu=!0},addButton:function(a){var c=this,e=c.renderer,b=p(c.options.navigation.buttonOptions,a),g=b.onclick,f=b.menuItems,l,d,m=b.symbolSize||12;c.btnCount||(c.btnCount=0);c.exportDivElements||(c.exportDivElements=[],c.exportSVGElements=[]);if(!1!==b.enabled){var h=b.theme,k=h.states,q=k&&k.hover,k=k&&k.select,n;delete h.states;g?n=function(a){a.stopPropagation();
g.call(c,a)}:f&&(n=function(){c.contextMenu(d.menuClassName,f,d.translateX,d.translateY,d.width,d.height,d);d.setState(2)});b.text&&b.symbol?h.paddingLeft=B(h.paddingLeft,25):b.text||t(h,{width:b.width,height:b.height,padding:0});d=e.button(b.text,0,0,n,h,q,k).addClass(a.className).attr({"stroke-linecap":"round",title:c.options.lang[b._titleKey],zIndex:3});d.menuClassName=a.menuClassName||"highcharts-menu-"+c.btnCount++;b.symbol&&(l=e.symbol(b.symbol,b.symbolX-m/2,b.symbolY-m/2,m,m).addClass("highcharts-button-symbol").attr({zIndex:1}).add(d),
l.attr({stroke:b.symbolStroke,fill:b.symbolFill,"stroke-width":b.symbolStrokeWidth||1}));d.add().align(t(b,{width:d.width,x:B(b.x,c.buttonOffset)}),!0,"spacingBox");c.buttonOffset+=(d.width+b.buttonSpacing)*("right"===b.align?-1:1);c.exportSVGElements.push(d,l)}},destroyExport:function(a){var c=a?a.target:this;a=c.exportSVGElements;var e=c.exportDivElements;a&&(k(a,function(a,e){a&&(a.onclick=a.ontouchstart=null,c.exportSVGElements[e]=a.destroy())}),a.length=0);e&&(k(e,function(a,e){D(a,"mouseleave");
c.exportDivElements[e]=a.onmouseout=a.onmouseover=a.ontouchstart=a.onclick=null;w(a)}),e.length=0)}});J.menu=function(a,c,e,b){return["M",a,c+2.5,"L",a+e,c+2.5,"M",a,c+b/2+.5,"L",a+e,c+b/2+.5,"M",a,c+b-1.5,"L",a+e,c+b-1.5]};u.prototype.renderExporting=function(){var a,c=this.options.exporting,e=c.buttons,b=this.isDirtyExporting||!this.exportSVGElements;this.buttonOffset=0;this.isDirtyExporting&&this.destroyExport();if(b&&!1!==c.enabled){for(a in e)this.addButton(e[a]);this.isDirtyExporting=!1}v(this,
"destroy",this.destroyExport)};u.prototype.callbacks.push(function(a){a.renderExporting();v(a,"redraw",a.renderExporting);k(["exporting","navigation"],function(c){a[c]={update:function(e,b){a.isDirtyExporting=!0;p(!0,a.options[c],e);B(b,!0)&&a.redraw()}}})})})(h)});

View File

@@ -0,0 +1,877 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Exporting module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var defaultOptions = H.defaultOptions,
doc = H.doc,
Chart = H.Chart,
addEvent = H.addEvent,
removeEvent = H.removeEvent,
fireEvent = H.fireEvent,
createElement = H.createElement,
discardElement = H.discardElement,
css = H.css,
merge = H.merge,
pick = H.pick,
each = H.each,
extend = H.extend,
splat = H.splat,
isTouchDevice = H.isTouchDevice,
win = H.win,
SVGRenderer = H.SVGRenderer;
var symbols = H.Renderer.prototype.symbols;
// 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 = {
buttonOptions: {
theme: {},
symbolSize: 14,
symbolX: 12.5,
symbolY: 10.5,
align: 'right',
buttonSpacing: 3,
height: 22,
// text: null,
verticalAlign: 'top',
width: 24
}
};
// Presentational attributes
merge(true, defaultOptions.navigation, {
menuStyle: {
border: '1px solid #999999',
background: '#ffffff',
padding: '5px 0'
},
menuItemStyle: {
padding: '0.5em 1em',
background: 'none',
color: '#333333',
fontSize: isTouchDevice ? '14px' : '11px',
transition: 'background 250ms, color 250ms'
},
menuItemHoverStyle: {
background: '#335cad',
color: '#ffffff'
},
buttonOptions: {
symbolFill: '#666666',
symbolStroke: '#666666',
symbolStrokeWidth: 3,
theme: {
fill: '#ffffff', // capture hover
stroke: 'none',
padding: 5
}
}
});
// Add the export related options
defaultOptions.exporting = {
//enabled: true,
//filename: 'chart',
type: 'image/png',
url: 'https://export.highcharts.com/',
//width: undefined,
printMaxWidth: 780,
scale: 2,
buttons: {
contextButton: {
className: 'highcharts-contextbutton',
menuClassName: 'highcharts-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&lt;')
.replace(/>/g, '&gt;');
doc.body.innerHTML = '<pre>' + svg + '</pre>';
}
} // */
]
}
}
};
// Add the H.post utility
H.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, {
/**
* A collection of regex fixes on the produces SVG to account for expando properties,
* browser bugs, VML problems and other. Returns a cleaned SVG.
*/
sanitizeSVG: function(svg) {
svg = svg
.replace(/zIndex="[^"]+"/g, '')
.replace(/isShadow="[^"]+"/g, '')
.replace(/symbolName="[^"]+"/g, '')
.replace(/jQuery[0-9]+="[^"]+"/g, '')
.replace(/url\(("|&quot;)(\S+)("|&quot;)\)/g, 'url($2)')
.replace(/url\([^#]+#/g, 'url(#')
.replace(/<svg /, '<svg xmlns:xlink="http://www.w3.org/1999/xlink" ')
.replace(/ (NS[0-9]+\:)?href=/g, ' xlink:href=') // #3567
.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(/&nbsp;/g, '\u00A0') // no-break space
.replace(/&shy;/g, '\u00AD'); // soft hyphen
// IE specific
svg = svg
.replace(/<IMG /g, '<image ')
.replace(/<(\/?)TITLE>/g, '<$1title>')
.replace(/height=([^" ]+)/g, 'height="$1"')
.replace(/width=([^" ]+)/g, 'width="$1"')
.replace(/hc-svg-href="([^"]+)">/g, 'xlink:href="$1"/>')
.replace(/ id=([^" >]+)/g, ' id="$1"') // #4003
.replace(/class=([^" >]+)/g, 'class="$1"')
.replace(/ transform /g, ' ')
.replace(/:(path|rect)/g, '$1')
.replace(/style="([^"]+)"/g, function(s) {
return s.toLowerCase();
});
return svg;
},
/**
* Return innerHTML of chart. Used as hook for plugins.
*/
getChartHTML: function() {
return this.container.innerHTML;
},
/**
* 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,
html,
options = merge(chart.options, additionalOptions), // copy the options and add extra options
allowHTML = options.exporting.allowHTML;
// IE compatibility hack for generating SVG content that it doesn't really understand
if (!doc.createElementNS) {
doc.createElementNS = function(ns, tagName) {
return doc.createElement(tagName);
};
}
// 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,
renderer: 'SVGRenderer',
width: sourceWidth,
height: sourceHeight
});
options.exporting.enabled = false; // hide buttons in print
delete options.data; // #3004
// prepare for replicating the chart
options.series = [];
each(chart.series, function(serie) {
seriesOptions = merge(serie.userOptions, { // #4912
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);
}
});
// Axis options must be merged in one by one, since it may be an array or an object (#2022, #3900)
if (additionalOptions) {
each(['xAxis', 'yAxis'], function(axisType) {
each(splat(additionalOptions[axisType]), function(axisOptions, i) {
options[axisType][i] = merge(options[axisType][i], axisOptions);
});
});
}
// generate the chart copy
chartCopy = new H.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.getChartHTML();
// free up memory
options = null;
chartCopy.destroy();
discardElement(sandbox);
// Move HTML into a foreignObject
if (allowHTML) {
html = svg.match(/<\/svg>(.*?$)/);
if (html) {
html = '<foreignObject x="0" y="0" width="200" height="200">' +
'<body xmlns="http://www.w3.org/1999/xhtml">' +
html[1] +
'</body>' +
'</foreignObject>';
svg = svg.replace('</svg>', html + '</svg>');
}
}
// sanitize
svg = this.sanitizeSVG(svg);
// IE9 beta bugs with innerHTML. Test again with final IE9.
svg = svg.replace(/(url\(#highcharts-[0-9]+)&quot;/g, '$1')
.replace(/&quot;/g, '\'');
return svg;
},
getSVGForExport: function(options, chartOptions) {
var chartExportingOptions = this.options.exporting;
return this.getSVG(merge({
chart: {
borderRadius: 0
}
},
chartExportingOptions.chartOptions,
chartOptions, {
exporting: {
sourceWidth: (options && options.sourceWidth) || chartExportingOptions.sourceWidth,
sourceHeight: (options && options.sourceHeight) || chartExportingOptions.sourceHeight
}
}
));
},
/**
* 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) {
var svg = this.getSVGForExport(options, chartOptions);
// merge the options
options = merge(this.options.exporting, options);
// do the post
H.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,
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,
printMaxWidth = chart.options.exporting.printMaxWidth,
resetParams,
handleMaxWidth;
if (chart.isPrinting) { // block the button while in printing mode
return;
}
chart.isPrinting = true;
chart.pointer.reset(null, 0);
fireEvent(chart, 'beforePrint');
// Handle printMaxWidth
handleMaxWidth = printMaxWidth && chart.chartWidth > printMaxWidth;
if (handleMaxWidth) {
resetParams = [chart.options.chart.width, undefined, false];
chart.setSize(printMaxWidth, undefined, false);
}
// 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;
// Reset printMaxWidth
if (handleMaxWidth) {
chart.setSize.apply(chart, resetParams);
}
fireEvent(chart, 'afterPrint');
}, 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,
chartWidth = chart.chartWidth,
chartHeight = chart.chartHeight,
cacheName = 'cache-' + className,
menu = chart[cacheName],
menuPadding = Math.max(width, height), // for mouse leave detection
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', {
className: 'highcharts-menu'
}, null, menu);
// Presentational CSS
css(innerMenu, extend({
MozBoxShadow: '3px 3px 10px #888',
WebkitBoxShadow: '3px 3px 10px #888',
boxShadow: '3px 3px 10px #888'
}, navOptions.menuStyle));
// 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(doc, 'mouseup', docMouseUpHandler);
addEvent(chart, 'destroy', function() {
removeEvent(doc, 'mouseup', docMouseUpHandler);
});
// create the items
each(items, function(item) {
if (item) {
var element;
if (item.separator) {
element = createElement('hr', null, null, innerMenu);
} else {
element = createElement('div', {
className: 'highcharts-menu-item',
onclick: function(e) {
if (e) { // IE7
e.stopPropagation();
}
hide();
if (item.onclick) {
item.onclick.apply(chart, arguments);
}
},
innerHTML: item.text || chart.options.lang[item.textKey]
}, null, innerMenu);
element.onmouseover = function() {
css(this, navOptions.menuItemHoverStyle);
};
element.onmouseout = function() {
css(this, navOptions.menuItemStyle);
};
css(element, extend({
cursor: 'pointer'
}, navOptions.menuItemStyle));
}
// 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,
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(e) {
e.stopPropagation();
onclick.call(chart, e);
};
} 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 = 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)
.addClass(options.className)
.attr({
'stroke-linecap': 'round',
title: chart.options.lang[btnOptions._titleKey],
zIndex: 3 // #4955
});
button.menuClassName = options.menuClassName || 'highcharts-menu-' + chart.btnCount++;
if (btnOptions.symbol) {
symbol = renderer.symbol(
btnOptions.symbol,
btnOptions.symbolX - (symbolSize / 2),
btnOptions.symbolY - (symbolSize / 2),
symbolSize,
symbolSize
)
.addClass('highcharts-button-symbol')
.attr({
zIndex: 1
}).add(button);
symbol.attr({
stroke: btnOptions.symbolStroke,
fill: btnOptions.symbolFill,
'stroke-width': btnOptions.symbolStrokeWidth || 1
});
}
button.add()
.align(extend(btnOptions, {
width: button.width,
x: pick(btnOptions.x, chart.buttonOffset) // #1654
}), true, 'spacingBox');
chart.buttonOffset += (button.width + btnOptions.buttonSpacing) * (btnOptions.align === 'right' ? -1 : 1);
chart.exportSVGElements.push(button, symbol);
},
/**
* Destroy the buttons.
*/
destroyExport: function(e) {
var chart = e ? e.target : this,
exportSVGElements = chart.exportSVGElements,
exportDivElements = chart.exportDivElements;
// Destroy the extra buttons added
if (exportSVGElements) {
each(exportSVGElements, function(elem, i) {
// Destroy and null the svg/vml elements
if (elem) { // #1822
elem.onclick = elem.ontouchstart = null;
chart.exportSVGElements[i] = elem.destroy();
}
});
exportSVGElements.length = 0;
}
// Destroy the divs for the menu
if (exportDivElements) {
each(exportDivElements, function(elem, 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);
});
exportDivElements.length = 0;
}
}
});
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.renderExporting = function() {
var n,
exportingOptions = this.options.exporting,
buttons = exportingOptions.buttons,
isDirty = this.isDirtyExporting || !this.exportSVGElements;
this.buttonOffset = 0;
if (this.isDirtyExporting) {
this.destroyExport();
}
if (isDirty && exportingOptions.enabled !== false) {
for (n in buttons) {
this.addButton(buttons[n]);
}
this.isDirtyExporting = false;
}
// Destroy the export elements at chart destroy
addEvent(this, 'destroy', this.destroyExport);
};
Chart.prototype.callbacks.push(function(chart) {
function update(prop, options, redraw) {
chart.isDirtyExporting = true;
merge(true, chart.options[prop], options);
if (pick(redraw, true)) {
chart.redraw();
}
}
chart.renderExporting();
addEvent(chart, 'redraw', chart.renderExporting);
// Add update methods to handle chart.update and chart.exporting.update
// and chart.navigation.update.
each(['exporting', 'navigation'], function(prop) {
chart[prop] = {
update: function(options, redraw) {
update(prop, options, redraw);
}
};
});
});
}(Highcharts));
}));

View File

@@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Highcharts funnel module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(c){"object"===typeof module&&module.exports?module.exports=c:c(Highcharts)})(function(c){(function(c){var n=c.seriesType,z=c.seriesTypes,F=c.noop,G=c.each;n("funnel","pie",{animation:!1,center:["50%","50%"],width:"90%",neckWidth:"30%",height:"100%",neckHeight:"25%",reversed:!1,size:!0,dataLabels:{connectorWidth:1},states:{select:{color:"#cccccc",borderColor:"#000000",shadow:!1}}},{animate:F,translate:function(){var b=function(a,b){return/%$/.test(a)?b*parseInt(a,10)/100:parseInt(a,10)},
c=0,e=this.chart,d=this.options,r=d.reversed,H=d.ignoreHiddenPoint,t=e.plotWidth,e=e.plotHeight,p=0,n=d.center,f=b(n[0],t),q=b(n[1],e),z=b(d.width,t),h,v,k=b(d.height,e),w=b(d.neckWidth,t),D=b(d.neckHeight,e),x=q-k/2+k-D,b=this.data,A,B,I="left"===d.dataLabels.position?1:0,C,l,E,u,g,y,m;this.getWidthAt=v=function(a){var b=q-k/2;return a>x||k===D?w:w+(z-w)*(1-(a-b)/(k-D))};this.getX=function(a,b){return f+(b?-1:1)*(v(r?2*q-a:a)/2+d.dataLabels.distance)};this.center=[f,q,k];this.centerX=f;G(b,function(a){H&&
!1===a.visible||(c+=a.y)});G(b,function(a){m=null;B=c?a.y/c:0;l=q-k/2+p*k;g=l+B*k;h=v(l);C=f-h/2;E=C+h;h=v(g);u=f-h/2;y=u+h;l>x?(C=u=f-w/2,E=y=f+w/2):g>x&&(m=g,h=v(x),u=f-h/2,y=u+h,g=x);r&&(l=2*q-l,g=2*q-g,m=m?2*q-m:null);A=["M",C,l,"L",E,l,y,g];m&&A.push(y,m,u,m);A.push(u,g,"Z");a.shapeType="path";a.shapeArgs={d:A};a.percentage=100*B;a.plotX=f;a.plotY=(l+(m||g))/2;a.tooltipPos=[f,a.plotY];a.slice=F;a.half=I;H&&!1===a.visible||(p+=B)})},drawPoints:z.column.prototype.drawPoints,sortByAngle:function(b){b.sort(function(b,
c){return b.plotY-c.plotY})},drawDataLabels:function(){var b=this.data,c=this.options.dataLabels.distance,e,d,r,n=b.length,t,p;for(this.center[2]-=2*c;n--;)r=b[n],d=(e=r.half)?1:-1,p=r.plotY,t=this.getX(p,e),r.labelPos=[0,p,t+(c-5)*d,p,t+c*d,p,e?"right":"left",0];z.pie.prototype.drawDataLabels.call(this)}});n("pyramid","funnel",{neckWidth:"0%",neckHeight:"0%",reversed:!0})})(c)});

View File

@@ -0,0 +1,304 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Highcharts funnel module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/* eslint indent:0 */
'use strict';
// create shortcuts
var seriesType = Highcharts.seriesType,
seriesTypes = Highcharts.seriesTypes,
noop = Highcharts.noop,
each = Highcharts.each;
seriesType('funnel', 'pie', {
animation: false,
center: ['50%', '50%'],
width: '90%',
neckWidth: '30%',
height: '100%',
neckHeight: '25%',
reversed: false,
size: true, // to avoid adapting to data label size in Pie.drawDataLabels
// Presentational
dataLabels: {
//position: 'right',
connectorWidth: 1
//connectorColor: null
},
states: {
select: {
color: '#cccccc',
borderColor: '#000000',
shadow: false
}
}
},
// Properties
{
animate: noop,
/**
* 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,
ignoreHiddenPoint = options.ignoreHiddenPoint,
plotWidth = chart.plotWidth,
plotHeight = chart.plotHeight,
cumulative = 0, // start at top
center = options.center,
centerX = getLength(center[0], plotWidth),
centerY = getLength(center[1], plotHeight),
width = getLength(options.width, plotWidth),
tempWidth,
getWidthAt,
height = getLength(options.height, plotHeight),
neckWidth = getLength(options.neckWidth, plotWidth),
neckHeight = getLength(options.neckHeight, plotHeight),
neckY = (centerY - height / 2) + 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) {
var top = (centerY - height / 2);
return y > neckY || height === neckHeight ?
neckWidth :
neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight));
};
series.getX = function(y, half) {
return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - 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) {
if (!ignoreHiddenPoint || point.visible !== false) {
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 = 2 * centerY - y1;
y3 = 2 * centerY - y3;
y5 = (y5 ? 2 * centerY - 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;
if (!ignoreHiddenPoint || point.visible !== false) {
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: seriesTypes.column.prototype.drawPoints,
/**
* 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.
*/
seriesType('pyramid', 'funnel', {
neckWidth: '0%',
neckHeight: '0%',
reversed: true
});
}(Highcharts));
}));

View File

@@ -0,0 +1,24 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(p){"object"===typeof module&&module.exports?module.exports=p:p(Highcharts)})(function(p){(function(b){var h=b.Axis,t=b.Chart,l=b.color,k,n=b.each,w=b.extend,x=b.isNumber,q=b.Legend,m=b.LegendSymbolMixin,f=b.noop,r=b.merge,v=b.pick,u=b.wrap;k=b.ColorAxis=function(){this.init.apply(this,arguments)};w(k.prototype,h.prototype);w(k.prototype,{defaultColorAxisOptions:{lineWidth:0,minPadding:0,maxPadding:0,gridLineWidth:1,tickPixelInterval:72,startOnTick:!0,endOnTick:!0,offset:0,marker:{animation:{duration:50},
width:.01,color:"#999999"},labels:{overflow:"justify"},minColor:"#e6ebf5",maxColor:"#003399",tickLength:5,showInLegend:!0},init:function(a,c){var d="vertical"!==a.options.legend.layout,e;this.coll="colorAxis";e=r(this.defaultColorAxisOptions,{side:d?2:1,reversed:!d},c,{opposite:!d,showEmpty:!1,title:null});h.prototype.init.call(this,a,e);c.dataClasses&&this.initDataClasses(c);this.initStops(c);this.horiz=d;this.zoomEnabled=!1;this.defaultLegendLength=200},tweenColors:function(a,c,d){var e;c.rgba.length&&
a.rgba.length?(a=a.rgba,c=c.rgba,e=1!==c[3]||1!==a[3],a=(e?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-d))+","+Math.round(c[1]+(a[1]-c[1])*(1-d))+","+Math.round(c[2]+(a[2]-c[2])*(1-d))+(e?","+(c[3]+(a[3]-c[3])*(1-d)):"")+")"):a=c.input||"none";return a},initDataClasses:function(a){var c=this,d=this.chart,e,g=0,b=d.options.chart.colorCount,y=this.options,m=a.dataClasses.length;this.dataClasses=e=[];this.legendItems=[];n(a.dataClasses,function(a,n){var f;a=r(a);e.push(a);a.color||("category"===y.dataClassColor?
(f=d.options.colors,b=f.length,a.color=f[g],a.colorIndex=g,g++,g===b&&(g=0)):a.color=c.tweenColors(l(y.minColor),l(y.maxColor),2>m?.5:n/(m-1)))})},initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];n(this.stops,function(a){a.color=l(a[1])})},setOptions:function(a){h.prototype.setOptions.call(this,a);this.options.crosshair=this.options.marker},setAxisSize:function(){var a=this.legendSymbol,c=this.chart,d=c.options.legend||{},e,g;a?(this.left=d=a.attr("x"),
this.top=e=a.attr("y"),this.width=g=a.attr("width"),this.height=a=a.attr("height"),this.right=c.chartWidth-d-g,this.bottom=c.chartHeight-e-a,this.len=this.horiz?g:a,this.pos=this.horiz?d:e):this.len=(this.horiz?d.symbolWidth:d.symbolHeight)||this.defaultLegendLength},toColor:function(a,c){var d,e=this.stops,g,b=this.dataClasses,m,f;if(b)for(f=b.length;f--;){if(m=b[f],g=m.from,e=m.to,(void 0===g||a>=g)&&(void 0===e||a<=e)){d=m.color;c&&(c.dataClass=f,c.colorIndex=m.colorIndex);break}}else{this.isLog&&
(a=this.val2lin(a));d=1-(this.max-a)/(this.max-this.min||1);for(f=e.length;f--&&!(d>e[f][0]););g=e[f]||e[f+1];e=e[f+1]||g;d=1-(e[0]-d)/(e[0]-g[0]||1);d=this.tweenColors(g.color,e.color,d)}return d},getOffset:function(){var a=this.legendGroup,c=this.chart.axisOffset[this.side];a&&(this.axisParent=a,h.prototype.getOffset.call(this),this.added||(this.added=!0,this.labelLeft=0,this.labelRight=this.width),this.chart.axisOffset[this.side]=c)},setLegendColor:function(){var a,c=this.options,d=this.reversed;
a=d?1:0;d=d?0:1;a=this.horiz?[a,0,d,0]:[0,d,0,a];this.legendColor={linearGradient:{x1:a[0],y1:a[1],x2:a[2],y2:a[3]},stops:c.stops||[[0,c.minColor],[1,c.maxColor]]}},drawLegendSymbol:function(a,c){var d=a.padding,e=a.options,g=this.horiz,b=v(e.symbolWidth,g?this.defaultLegendLength:12),f=v(e.symbolHeight,g?12:this.defaultLegendLength),m=v(e.labelPadding,g?16:30),e=v(e.itemDistance,10);this.setLegendColor();c.legendSymbol=this.chart.renderer.rect(0,a.baseline-11,b,f).attr({zIndex:1}).add(c.legendGroup);
this.legendItemWidth=b+d+(g?e:m);this.legendItemHeight=f+d+(g?m:0)},setState:f,visible:!0,setVisible:f,getSeriesExtremes:function(){var a;this.series.length&&(a=this.series[0],this.dataMin=a.valueMin,this.dataMax=a.valueMax)},drawCrosshair:function(a,c){var d=c&&c.plotX,e=c&&c.plotY,g,b=this.pos,f=this.len;c&&(g=this.toPixels(c[c.series.colorKey]),g<b?g=b-2:g>b+f&&(g=b+f+2),c.plotX=g,c.plotY=this.len-g,h.prototype.drawCrosshair.call(this,a,c),c.plotX=d,c.plotY=e,this.cross&&(this.cross.addClass("highcharts-coloraxis-marker").add(this.legendGroup),
this.cross.attr({fill:this.crosshair.color})))},getPlotLinePath:function(a,c,d,e,b){return x(b)?this.horiz?["M",b-4,this.top-6,"L",b+4,this.top-6,b,this.top,"Z"]:["M",this.left,b,"L",this.left-6,b+6,this.left-6,b-6,"Z"]:h.prototype.getPlotLinePath.call(this,a,c,d,e)},update:function(a,c){var d=this.chart,b=d.legend;n(this.series,function(a){a.isDirtyData=!0});a.dataClasses&&b.allItems&&(n(b.allItems,function(a){a.isDataClass&&a.legendGroup.destroy()}),d.isDirtyLegend=!0);d.options[this.coll]=r(this.userOptions,
a);h.prototype.update.call(this,a,c);this.legendItem&&(this.setLegendColor(),b.colorizeItem(this,!0))},getDataClassLegendSymbols:function(){var a=this,c=this.chart,d=this.legendItems,e=c.options.legend,g=e.valueDecimals,u=e.valueSuffix||"",h;d.length||n(this.dataClasses,function(e,q){var k=!0,r=e.from,l=e.to;h="";void 0===r?h="< ":void 0===l&&(h="> ");void 0!==r&&(h+=b.numberFormat(r,g)+u);void 0!==r&&void 0!==l&&(h+=" - ");void 0!==l&&(h+=b.numberFormat(l,g)+u);d.push(w({chart:c,name:h,options:{},
drawLegendSymbol:m.drawRectangle,visible:!0,setState:f,isDataClass:!0,setVisible:function(){k=this.visible=!k;n(a.series,function(a){n(a.points,function(a){a.dataClass===q&&a.setVisible(k)})});c.legend.colorizeItem(this,k)}},e))});return d},name:""});n(["fill","stroke"],function(a){b.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,k.prototype.tweenColors(l(this.start),l(this.end),this.pos))}});u(t.prototype,"getAxes",function(a){var c=this.options.colorAxis;a.call(this);this.colorAxis=[];c&&
new k(this,c)});u(q.prototype,"getAllItems",function(a){var c=[],d=this.chart.colorAxis[0];d&&d.options&&(d.options.showInLegend&&(d.options.dataClasses?c=c.concat(d.getDataClassLegendSymbols()):c.push(d)),n(d.series,function(a){a.options.showInLegend=!1}));return c.concat(a.call(this))});u(q.prototype,"colorizeItem",function(a,c,d){a.call(this,c,d);d&&c.legendColor&&c.legendSymbol.attr({fill:c.legendColor})})})(p);(function(b){var h=b.defined,t=b.each,l=b.noop,k=b.seriesTypes;b.colorPointMixin={setVisible:function(b){var h=
this,k=b?"show":"hide";t(["graphic","dataLabel"],function(b){if(h[b])h[b][k]()})}};b.colorSeriesMixin={pointArrayMap:["value"],axisTypes:["xAxis","yAxis","colorAxis"],optionalAxis:"colorAxis",trackerGroups:["group","markerGroup","dataLabelsGroup"],getSymbol:l,parallelArrays:["x","y","value"],colorKey:"value",pointAttribs:k.column.prototype.pointAttribs,translateColors:function(){var b=this,h=this.options.nullColor,k=this.colorAxis,l=this.colorKey;t(this.data,function(m){var f=m[l];if(f=m.options.color||
(null===f?h:k&&void 0!==f?k.toColor(f,m):m.color||b.color))m.color=f})},colorAttribs:function(b){var k={};h(b.color)&&(k[this.colorProp||"fill"]=b.color);return k}}})(p);(function(b){var h=b.colorPointMixin,t=b.each,l=b.merge,k=b.noop,n=b.pick,p=b.Series,x=b.seriesType,q=b.seriesTypes;x("heatmap","scatter",{animation:!1,borderWidth:0,nullColor:"#f7f7f7",dataLabels:{formatter:function(){return this.point.value},inside:!0,verticalAlign:"middle",crop:!1,overflow:!1,padding:0},marker:null,pointRange:null,
tooltip:{pointFormat:"{point.x}, {point.y}: {point.value}<br/>"},states:{normal:{animation:!0},hover:{halo:!1,brightness:.2}}},l(b.colorSeriesMixin,{pointArrayMap:["y","value"],hasPointSpecificOptions:!0,supportsDrilldown:!0,getExtremesFromAll:!0,directTouch:!0,init:function(){var b;q.scatter.prototype.init.apply(this,arguments);b=this.options;b.pointRange=n(b.pointRange,b.colsize||1);this.yAxis.axisPointRange=b.rowsize||1},translate:function(){var b=this.options,f=this.xAxis,h=this.yAxis,k=function(b,
a,c){return Math.min(Math.max(a,b),c)};this.generatePoints();t(this.points,function(l){var a=(b.colsize||1)/2,c=(b.rowsize||1)/2,d=k(Math.round(f.len-f.translate(l.x-a,0,1,0,1)),-f.len,2*f.len),a=k(Math.round(f.len-f.translate(l.x+a,0,1,0,1)),-f.len,2*f.len),e=k(Math.round(h.translate(l.y-c,0,1,0,1)),-h.len,2*h.len),c=k(Math.round(h.translate(l.y+c,0,1,0,1)),-h.len,2*h.len);l.plotX=l.clientX=(d+a)/2;l.plotY=(e+c)/2;l.shapeType="rect";l.shapeArgs={x:Math.min(d,a),y:Math.min(e,c),width:Math.abs(a-d),
height:Math.abs(c-e)}});this.translateColors()},drawPoints:function(){q.column.prototype.drawPoints.call(this);t(this.points,function(b){b.graphic.attr(this.colorAttribs(b,b.state))},this)},animate:k,getBox:k,drawLegendSymbol:b.LegendSymbolMixin.drawRectangle,alignDataLabel:q.column.prototype.alignDataLabel,getExtremes:function(){p.prototype.getExtremes.call(this,this.valueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;p.prototype.getExtremes.call(this)}}),h)})(p)});

View File

@@ -0,0 +1,776 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var Axis = H.Axis,
Chart = H.Chart,
color = H.color,
ColorAxis,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Legend = H.Legend,
LegendSymbolMixin = H.LegendSymbolMixin,
noop = H.noop,
merge = H.merge,
pick = H.pick,
wrap = H.wrap;
/**
* The ColorAxis object for inclusion in gradient legends
*/
ColorAxis = H.ColorAxis = function() {
this.init.apply(this, arguments);
};
extend(ColorAxis.prototype, Axis.prototype);
extend(ColorAxis.prototype, {
defaultColorAxisOptions: {
lineWidth: 0,
minPadding: 0,
maxPadding: 0,
gridLineWidth: 1,
tickPixelInterval: 72,
startOnTick: true,
endOnTick: true,
offset: 0,
marker: {
animation: {
duration: 50
},
width: 0.01,
color: '#999999'
},
labels: {
overflow: 'justify'
},
minColor: '#e6ebf5',
maxColor: '#003399',
tickLength: 5,
showInLegend: true
},
init: function(chart, userOptions) {
var horiz = chart.options.legend.layout !== 'vertical',
options;
this.coll = 'colorAxis';
// Build the options
options = merge(this.defaultColorAxisOptions, {
side: horiz ? 2 : 1,
reversed: !horiz
}, userOptions, {
opposite: !horiz,
showEmpty: false,
title: null
});
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.horiz = horiz;
this.zoomEnabled = false;
// Add default values
this.defaultLegendLength = 200;
},
/*
* Return an intermediate color between two colors, according to pos where 0
* is the from color and 1 is the to color.
* NOTE: Changes here should be copied
* to the same function in drilldown.src.js and solid-gauge-src.js.
*/
tweenColors: function(from, to, pos) {
// Check for has alpha, because rgba colors perform worse due to lack of
// support in WebKit.
var hasAlpha,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
},
initDataClasses: function(userOptions) {
var axis = this,
chart = this.chart,
dataClasses,
colorCounter = 0,
colorCount = chart.options.chart.colorCount,
options = this.options,
len = userOptions.dataClasses.length;
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;
colorCount = colors.length;
dataClass.color = colors[colorCounter];
dataClass.colorIndex = colorCounter;
// increase and loop back to zero
colorCounter++;
if (colorCounter === colorCount) {
colorCounter = 0;
}
} else {
dataClass.color = axis.tweenColors(
color(options.minColor),
color(options.maxColor),
len < 2 ? 0.5 : i / (len - 1) // #3219
);
}
}
});
},
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;
},
setAxisSize: function() {
var symbol = this.legendSymbol,
chart = this.chart,
legendOptions = chart.options.legend || {},
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;
} else {
// Fake length for disabled legend to avoid tick issues and such (#5205)
this.len = (this.horiz ? legendOptions.symbolWidth : legendOptions.symbolHeight) || this.defaultLegendLength;
}
},
/**
* 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;
point.colorIndex = dataClass.colorIndex;
}
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;
},
/**
* Override the getOffset method to add the whole axis groups inside the legend.
*/
getOffset: function() {
var group = this.legendGroup,
sideOffset = this.chart.axisOffset[this.side];
if (group) {
// Hook for the getOffset method to add groups to this parent group
this.axisParent = group;
// Call the base
Axis.prototype.getOffset.call(this);
// First time only
if (!this.added) {
this.added = true;
this.labelLeft = 0;
this.labelRight = this.width;
}
// 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,
reversed = this.reversed,
one = reversed ? 1 : 0,
zero = reversed ? 0 : 1;
grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190
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,
width = pick(legendOptions.symbolWidth, horiz ? this.defaultLegendLength : 12),
height = pick(legendOptions.symbolHeight, horiz ? 12 : this.defaultLegendLength),
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);
// 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 plotX = point && point.plotX,
plotY = point && point.plotY,
crossPos,
axisPos = this.pos,
axisLen = this.len;
if (point) {
crossPos = this.toPixels(point[point.series.colorKey]);
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 (this.cross) {
this.cross
.addClass('highcharts-coloraxis-marker')
.add(this.legendGroup);
this.cross.attr({
fill: this.crosshair.color
});
}
}
},
getPlotLinePath: function(a, b, c, d, pos) {
return isNumber(pos) ? // crosshairs only // #3969 pos can be 0 !!
(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']) :
Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
},
update: function(newOptions, redraw) {
var chart = this.chart,
legend = chart.legend;
each(this.series, function(series) {
series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
});
// When updating data classes, destroy old items and make sure new ones are created (#3207)
if (newOptions.dataClasses && legend.allItems) {
each(legend.allItems, function(item) {
if (item.isDataClass) {
item.legendGroup.destroy();
}
});
chart.isDirtyLegend = true;
}
// Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is
// not an array. (#3207)
chart.options[this.coll] = merge(this.userOptions, newOptions);
Axis.prototype.update.call(this, newOptions, redraw);
if (this.legendItem) {
this.setLegendColor();
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 += H.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== undefined && to !== undefined) {
name += ' - ';
}
if (to !== undefined) {
name += H.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,
isDataClass: true,
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
});
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, ColorAxis.prototype.tweenColors(color(this.start), color(this.end), this.pos));
};
});
/**
* 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) {
new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new
}
});
/**
* 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 && colorAxis.options) {
if (colorAxis.options.showInLegend) {
// 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));
});
wrap(Legend.prototype, 'colorizeItem', function(proceed, item, visible) {
proceed.call(this, item, visible);
if (visible && item.legendColor) {
item.legendSymbol.attr({
fill: item.legendColor
});
}
});
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var defined = H.defined,
each = H.each,
noop = H.noop,
seriesTypes = H.seriesTypes;
/**
* Mixin for maps and heatmaps
*/
H.colorPointMixin = {
/**
* Set the visibility of a single point
*/
setVisible: function(vis) {
var point = this,
method = vis ? 'show' : 'hide';
// Show and hide associated elements
each(['graphic', 'dataLabel'], function(key) {
if (point[key]) {
point[key][method]();
}
});
}
};
H.colorSeriesMixin = {
pointArrayMap: ['value'],
axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
optionalAxis: 'colorAxis',
trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
getSymbol: noop,
parallelArrays: ['x', 'y', 'value'],
colorKey: 'value',
pointAttribs: seriesTypes.column.prototype.pointAttribs,
/**
* 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 = point.options.color ||
(value === null ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color);
if (color) {
point.color = color;
}
});
},
/**
* Get the color attibutes to apply on the graphic
*/
colorAttribs: function(point) {
var ret = {};
if (defined(point.color)) {
ret[this.colorProp || 'fill'] = point.color;
}
return ret;
}
};
}(Highcharts));
(function(H) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var colorPointMixin = H.colorPointMixin,
colorSeriesMixin = H.colorSeriesMixin,
each = H.each,
LegendSymbolMixin = H.LegendSymbolMixin,
merge = H.merge,
noop = H.noop,
pick = H.pick,
Series = H.Series,
seriesType = H.seriesType,
seriesTypes = H.seriesTypes;
// The Heatmap series type
seriesType('heatmap', 'scatter', {
animation: false,
borderWidth: 0,
nullColor: '#f7f7f7',
dataLabels: {
formatter: function() { // #2945
return this.point.value;
},
inside: true,
verticalAlign: 'middle',
crop: false,
overflow: false,
padding: 0 // #3837
},
marker: null,
pointRange: null, // dynamically set to colsize by default
tooltip: {
pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
},
states: {
normal: {
animation: true
},
hover: {
halo: false, // #3406, halo is not required on heatmaps
brightness: 0.2
}
}
}, merge(colorSeriesMixin, {
pointArrayMap: ['y', 'value'],
hasPointSpecificOptions: true,
supportsDrilldown: true,
getExtremesFromAll: true,
directTouch: true,
/**
* Override the init method to add point ranges on both axes.
*/
init: function() {
var options;
seriesTypes.scatter.prototype.init.apply(this, arguments);
options = this.options;
options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData
this.yAxis.axisPointRange = options.rowsize || 1; // general point range
},
translate: function() {
var series = this,
options = series.options,
xAxis = series.xAxis,
yAxis = series.yAxis,
between = function(x, a, b) {
return Math.min(Math.max(a, x), b);
};
series.generatePoints();
each(series.points, function(point) {
var xPad = (options.colsize || 1) / 2,
yPad = (options.rowsize || 1) / 2,
x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len),
y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len);
// Set plotX and plotY for use in K-D-Tree and more
point.plotX = point.clientX = (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();
},
drawPoints: function() {
seriesTypes.column.prototype.drawPoints.call(this);
each(this.points, function(point) {
point.graphic.attr(this.colorAttribs(point, point.state));
}, this);
},
animate: noop,
getBox: noop,
drawLegendSymbol: LegendSymbolMixin.drawRectangle,
alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
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);
}
}), colorPointMixin);
}(Highcharts));
}));

View File

@@ -0,0 +1,12 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Plugin for displaying a message when there is no data visible in chart.
(c) 2010-2016 Highsoft AS
Author: Oystein Moseng
License: www.highcharts.com/license
*/
(function(d){"object"===typeof module&&module.exports?module.exports=d:d(Highcharts)})(function(d){(function(c){function d(){return!!this.points.length}function g(){this.hasData()?this.hideNoData():this.showNoData()}var h=c.seriesTypes,e=c.Chart.prototype,f=c.getOptions(),k=c.extend,l=c.each;k(f.lang,{noData:"No data to display"});f.noData={position:{x:0,y:0,align:"center",verticalAlign:"middle"}};f.noData.style={fontWeight:"bold",fontSize:"12px",color:"#666666"};l(["pie","gauge","waterfall","bubble",
"treemap"],function(a){h[a]&&(h[a].prototype.hasData=d)});c.Series.prototype.hasData=function(){return this.visible&&void 0!==this.dataMax&&void 0!==this.dataMin};e.showNoData=function(a){var b=this.options;a=a||b.lang.noData;b=b.noData;this.noDataLabel||(this.noDataLabel=this.renderer.label(a,0,0,null,null,null,b.useHTML,null,"no-data"),this.noDataLabel.attr(b.attr).css(b.style),this.noDataLabel.add(),this.noDataLabel.align(k(this.noDataLabel.getBBox(),b.position),!1,"plotBox"))};e.hideNoData=function(){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)})})(d)});

View File

@@ -0,0 +1,161 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Plugin for displaying a message when there is no data visible in chart.
*
* (c) 2010-2016 Highsoft AS
* Author: Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesTypes = H.seriesTypes,
chartPrototype = H.Chart.prototype,
defaultOptions = H.getOptions(),
extend = H.extend,
each = H.each;
// 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'
}
// useHTML: false
};
// Presentational
defaultOptions.noData.style = {
fontWeight: 'bold',
fontSize: '12px',
color: '#666666'
};
/**
* 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 */
}
each(['pie', 'gauge', 'waterfall', 'bubble', 'treemap'], function(type) {
if (seriesTypes[type]) {
seriesTypes[type].prototype.hasData = hasDataPie;
}
});
H.Series.prototype.hasData = function() {
return this.visible && this.dataMax !== undefined && this.dataMin !== undefined; // #3703
};
/**
* 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,
noDataOptions.useHTML,
null,
'no-data'
);
chart.noDataLabel
.attr(noDataOptions.attr)
.css(noDataOptions.style);
chart.noDataLabel.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));
}));

View File

@@ -0,0 +1,16 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Client side exporting module
(c) 2015 Torstein Honsi / Oystein Moseng
License: www.highcharts.com/license
*/
(function(r){"object"===typeof module&&module.exports?module.exports=r:r(Highcharts)})(function(r){(function(a){function r(e,a){var c=t.getElementsByTagName("head")[0],b=t.createElement("script");b.type="text/javascript";b.src=e;b.onload=a;c.appendChild(b)}var A=a.merge,m=a.win,q=m.navigator,t=m.document,v=m.URL||m.webkitURL||m,w=/Edge\/|Trident\/|MSIE /.test(q.userAgent),B=w?150:0;a.CanVGRenderer={};a.downloadURL=function(e,a){var c=t.createElement("a"),b;if(q.msSaveOrOpenBlob)q.msSaveOrOpenBlob(e,
a);else if(void 0!==c.download)c.href=e,c.download=a,c.target="_blank",t.body.appendChild(c),c.click(),t.body.removeChild(c);else try{if(b=m.open(e,"chart"),void 0===b||null===b)throw"Failed to open window";}catch(h){m.location.href=e}};a.svgToDataUrl=function(e){var a=-1<q.userAgent.indexOf("WebKit")&&0>q.userAgent.indexOf("Chrome");try{if(!a&&0>q.userAgent.toLowerCase().indexOf("firefox"))return v.createObjectURL(new m.Blob([e],{type:"image/svg+xml;charset-utf-16"}))}catch(c){}return"data:image/svg+xml;charset=UTF-8,"+
encodeURIComponent(e)};a.imageToDataUrl=function(a,k,c,b,h,d,l,g,p){var f=new m.Image,n,u=function(){setTimeout(function(){var d=t.createElement("canvas"),u=d.getContext&&d.getContext("2d"),g;try{if(u){d.height=f.height*b;d.width=f.width*b;u.drawImage(f,0,0,d.width,d.height);try{g=d.toDataURL(k),h(g,k,c,b)}catch(m){n(a,k,c,b)}}else l(a,k,c,b)}finally{p&&p(a,k,c,b)}},B)},z=function(){g(a,k,c,b);p&&p(a,k,c,b)};n=function(){f=new m.Image;n=d;f.crossOrigin="Anonymous";f.onload=u;f.onerror=z;f.src=a};
f.onload=u;f.onerror=z;f.src=a};a.downloadSVGLocal=function(e,k,c,b,h,d){var l,g,p=!0,f,n=a.getOptions().exporting.libURL;if("image/svg+xml"===c)try{q.msSaveOrOpenBlob?(g=new MSBlobBuilder,g.append(e),l=g.getBlob("image/svg+xml")):l=a.svgToDataUrl(e),a.downloadURL(l,k),d&&d()}catch(u){h()}else l=a.svgToDataUrl(e),f=function(){try{v.revokeObjectURL(l)}catch(a){}},a.imageToDataUrl(l,c,{},b,function(b){try{a.downloadURL(b,k),d&&d()}catch(c){h()}},function(){var g=t.createElement("canvas"),l=g.getContext("2d"),
x=e.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*b,y=e.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1]*b,v=function(){l.drawSvg(e,0,0,x,y);try{a.downloadURL(q.msSaveOrOpenBlob?g.msToBlob():g.toDataURL(c),k),d&&d()}catch(b){h()}finally{f()}};g.width=x;g.height=y;m.canvg?v():(p=!0,n="/"!==n.substr[-1]?n+"/":n,r(n+"rgbcolor.js",function(){r(n+"canvg.js",function(){v()})}))},h,h,function(){p&&f()})};a.Chart.prototype.getSVGForLocalExport=function(e,k,c,b){var h=this,d,l=0,g,p,f,n,m=function(a,
c,e){++l;e.imageElement.setAttributeNS("http://www.w3.org/1999/xlink","href",a);l===d.length&&b(h.sanitizeSVG(g.innerHTML))};a.wrap(a.Chart.prototype,"getChartHTML",function(a){g=this.container.cloneNode(!0);return a.apply(this,Array.prototype.slice.call(arguments,1))});h.getSVGForExport(e,k);d=g.getElementsByTagName("image");try{if(d.length)for(f=0,n=d.length;f<n;++f)p=d[f],a.imageToDataUrl(p.getAttributeNS("http://www.w3.org/1999/xlink","href"),"image/png",{imageElement:p},e.scale,m,c,c,c);else b(h.sanitizeSVG(g.innerHTML))}catch(q){c()}};
a.Chart.prototype.exportChartLocal=function(e,k){var c=this,b=a.merge(c.options.exporting,e),h=b&&b.type||"image/png",d=function(){if(!1===b.fallbackToExportServer)if(b.error)b.error();else throw"Fallback to export server disabled";else c.exportChart(b)},l=function(c){var e=(b.filename||"chart")+"."+("image/svg+xml"===h?"svg":h.split("/")[1]);a.downloadSVGLocal(c,e,h,b.scale,d)};w&&"image/svg+xml"!==h&&c.container.getElementsByTagName("image").length?d():c.getSVGForLocalExport(b,k,d,l)};A(!0,a.getOptions().exporting,
{libURL:"http://code.highcharts.com@product.cdnpath@/5.0.0/lib/",buttons:{contextButton:{menuItems:[{textKey:"printChart",onclick:function(){this.print()}},{separator:!0},{textKey:"downloadPNG",onclick:function(){this.exportChartLocal()}},{textKey:"downloadJPEG",onclick:function(){this.exportChartLocal({type:"image/jpeg"})}},{textKey:"downloadSVG",onclick:function(){this.exportChartLocal({type:"image/svg+xml"})}}]}}})})(r)});

View File

@@ -0,0 +1,424 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* Client side exporting module
*
* (c) 2015 Torstein Honsi / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
/*global MSBlobBuilder */
var merge = Highcharts.merge,
win = Highcharts.win,
nav = win.navigator,
doc = win.document,
domurl = win.URL || win.webkitURL || win,
isMSBrowser = /Edge\/|Trident\/|MSIE /.test(nav.userAgent),
loadEventDeferDelay = isMSBrowser ? 150 : 0; // Milliseconds to defer image load event handlers to offset IE bug
// Dummy object so we can reuse our canvas-tools.js without errors
Highcharts.CanVGRenderer = {};
/**
* Downloads a script and executes a callback when done.
* @param {String} scriptLocation
* @param {Function} callback
*/
function getScript(scriptLocation, callback) {
var head = doc.getElementsByTagName('head')[0],
script = doc.createElement('script');
script.type = 'text/javascript';
script.src = scriptLocation;
script.onload = callback;
head.appendChild(script);
}
// Download contents by dataURL/blob
Highcharts.downloadURL = function(dataURL, filename) {
var a = doc.createElement('a'),
windowRef;
// IE specific blob implementation
if (nav.msSaveOrOpenBlob) {
nav.msSaveOrOpenBlob(dataURL, filename);
return;
}
// Try HTML5 download attr if supported
if (a.download !== undefined) {
a.href = dataURL;
a.download = filename; // HTML5 download attribute
a.target = '_blank';
doc.body.appendChild(a);
a.click();
doc.body.removeChild(a);
} else {
// No download attr, just opening data URI
try {
windowRef = win.open(dataURL, 'chart');
if (windowRef === undefined || windowRef === null) {
throw 'Failed to open window';
}
} catch (e) {
// window.open failed, trying location.href
win.location.href = dataURL;
}
}
};
// Get blob URL from SVG code. Falls back to normal data URI.
Highcharts.svgToDataUrl = function(svg) {
var webKit = nav.userAgent.indexOf('WebKit') > -1 && nav.userAgent.indexOf('Chrome') < 0; // Webkit and not chrome
try {
// Safari requires data URI since it doesn't allow navigation to blob URLs
// Firefox has an issue with Blobs and internal references, leading to gradients not working using Blobs (#4550)
if (!webKit && nav.userAgent.toLowerCase().indexOf('firefox') < 0) {
return domurl.createObjectURL(new win.Blob([svg], {
type: 'image/svg+xml;charset-utf-16'
}));
}
} catch (e) {
// Ignore
}
return 'data:image/svg+xml;charset=UTF-8,' + encodeURIComponent(svg);
};
// Get data:URL from image URL
// Pass in callbacks to handle results. finallyCallback is always called at the end of the process. Supplying this callback is optional.
// All callbacks receive four arguments: imageURL, imageType, callbackArgs and scale. callbackArgs is used only by callbacks and can contain whatever.
Highcharts.imageToDataUrl = function(imageURL, imageType, callbackArgs, scale, successCallback, taintedCallback, noCanvasSupportCallback, failedLoadCallback, finallyCallback) {
var img = new win.Image(),
taintedHandler,
loadHandler = function() {
setTimeout(function() {
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext && canvas.getContext('2d'),
dataURL;
try {
if (!ctx) {
noCanvasSupportCallback(imageURL, imageType, callbackArgs, scale);
} else {
canvas.height = img.height * scale;
canvas.width = img.width * scale;
ctx.drawImage(img, 0, 0, canvas.width, canvas.height);
// Now we try to get the contents of the canvas.
try {
dataURL = canvas.toDataURL(imageType);
successCallback(dataURL, imageType, callbackArgs, scale);
} catch (e) {
taintedHandler(imageURL, imageType, callbackArgs, scale);
}
}
} finally {
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
}
}, loadEventDeferDelay); // IE bug where image is not always ready despite calling load event.
},
// Image load failed (e.g. invalid URL)
errorHandler = function() {
failedLoadCallback(imageURL, imageType, callbackArgs, scale);
if (finallyCallback) {
finallyCallback(imageURL, imageType, callbackArgs, scale);
}
};
// This is called on load if the image drawing to canvas failed with a security error.
// We retry the drawing with crossOrigin set to Anonymous.
taintedHandler = function() {
img = new win.Image();
taintedHandler = taintedCallback;
img.crossOrigin = 'Anonymous'; // Must be set prior to loading image source
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
img.onload = loadHandler;
img.onerror = errorHandler;
img.src = imageURL;
};
// Get data URL to an image of an SVG and call download on it
Highcharts.downloadSVGLocal = function(svg, filename, imageType, scale, failCallback, successCallback) {
var svgurl,
blob,
objectURLRevoke = true,
finallyHandler,
libURL = Highcharts.getOptions().exporting.libURL;
/*
function svgToPdf(svgElement, margin) {
var width = svgElement.width.baseVal.value + 2 * margin;
var height = svgElement.height.baseVal.value + 2 * margin;
var pdf = new win.jsPDF('l', 'pt', [width, height]); // eslint-disable-line new-cap
win.svgElementToPdf(svgElement, pdf, { removeInvalid: true });
return pdf.output('datauristring');
}
*/
// Initiate download depending on file type
if (imageType === 'image/svg+xml') {
// SVG download. In this case, we want to use Microsoft specific Blob if available
try {
if (nav.msSaveOrOpenBlob) {
blob = new MSBlobBuilder();
blob.append(svg);
svgurl = blob.getBlob('image/svg+xml');
} else {
svgurl = Highcharts.svgToDataUrl(svg);
}
Highcharts.downloadURL(svgurl, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
/*} else if (imageType === 'application/pdf') {
doc.getElementsByTagName('svg')[0].id = 'svgElement';
// you should set the format dynamically, write [width, height] instead of 'a4'
if (win.jsPDF && win.svgElementToPdf) {
var dummyContainer = doc.createElement('div');
dummyContainer.innerHTML = svg;
setTimeout(function () {
var data = svgToPdf(dummyContainer.firstChild, 0);
Highcharts.downloadURL(data, filename);
if (successCallback) {
successCallback();
}
}, 100);
}*/
} else {
// PNG/JPEG download - create bitmap from SVG
svgurl = Highcharts.svgToDataUrl(svg);
finallyHandler = function() {
try {
domurl.revokeObjectURL(svgurl);
} catch (e) {
// Ignore
}
};
// First, try to get PNG by rendering on canvas
Highcharts.imageToDataUrl(svgurl, imageType, { /* args */ }, scale, function(imageURL) {
// Success
try {
Highcharts.downloadURL(imageURL, filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
}
}, function() {
// Failed due to tainted canvas
// Create new and untainted canvas
var canvas = doc.createElement('canvas'),
ctx = canvas.getContext('2d'),
imageWidth = svg.match(/^<svg[^>]*width\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
imageHeight = svg.match(/^<svg[^>]*height\s*=\s*\"?(\d+)\"?[^>]*>/)[1] * scale,
downloadWithCanVG = function() {
ctx.drawSvg(svg, 0, 0, imageWidth, imageHeight);
try {
Highcharts.downloadURL(nav.msSaveOrOpenBlob ? canvas.msToBlob() : canvas.toDataURL(imageType), filename);
if (successCallback) {
successCallback();
}
} catch (e) {
failCallback();
} finally {
finallyHandler();
}
};
canvas.width = imageWidth;
canvas.height = imageHeight;
if (win.canvg) {
// Use preloaded canvg
downloadWithCanVG();
} else {
// Must load canVG first
objectURLRevoke = true; // Don't destroy the object URL yet since we are doing things asynchronously. A cleaner solution would be nice, but this will do for now.
libURL = libURL.substr[-1] !== '/' ? libURL + '/' : libURL; // Allow libURL to end with or without fordward slash
getScript(libURL + 'rgbcolor.js', function() { // Get RGBColor.js first
getScript(libURL + 'canvg.js', function() {
downloadWithCanVG();
});
});
}
},
// No canvas support
failCallback,
// Failed to load image
failCallback,
// Finally
function() {
if (objectURLRevoke) {
finallyHandler();
}
});
}
};
// Get SVG of chart prepared for client side export. This converts embedded images in the SVG to data URIs.
// The options and chartOptions arguments are passed to the getSVGForExport function.
Highcharts.Chart.prototype.getSVGForLocalExport = function(options, chartOptions, failCallback, successCallback) {
var chart = this,
images,
imagesEmbedded = 0,
chartCopyContainer,
el,
i,
l,
// Success handler, we converted image to base64!
embeddedSuccess = function(imageURL, imageType, callbackArgs) {
++imagesEmbedded;
// Change image href in chart copy
callbackArgs.imageElement.setAttributeNS('http://www.w3.org/1999/xlink', 'href', imageURL);
// When done with last image we have our SVG
if (imagesEmbedded === images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML));
}
};
// Hook into getSVG to get a copy of the chart copy's container
Highcharts.wrap(Highcharts.Chart.prototype, 'getChartHTML', function(proceed) {
chartCopyContainer = this.container.cloneNode(true);
return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
});
// Trigger hook to get chart copy
chart.getSVGForExport(options, chartOptions);
images = chartCopyContainer.getElementsByTagName('image');
try {
// If there are no images to embed, the SVG is okay now.
if (!images.length) {
successCallback(chart.sanitizeSVG(chartCopyContainer.innerHTML)); // Use SVG of chart copy
return;
}
// Go through the images we want to embed
for (i = 0, l = images.length; i < l; ++i) {
el = images[i];
Highcharts.imageToDataUrl(el.getAttributeNS('http://www.w3.org/1999/xlink', 'href'), 'image/png', {
imageElement: el
}, options.scale,
embeddedSuccess,
// Tainted canvas
failCallback,
// No canvas support
failCallback,
// Failed to load source
failCallback
);
}
} catch (e) {
failCallback();
}
};
/**
* Add a new method to the Chart object to perform a local download
*/
Highcharts.Chart.prototype.exportChartLocal = function(exportingOptions, chartOptions) {
var chart = this,
options = Highcharts.merge(chart.options.exporting, exportingOptions),
imageType = options && options.type || 'image/png',
fallbackToExportServer = function() {
if (options.fallbackToExportServer === false) {
if (options.error) {
options.error();
} else {
throw 'Fallback to export server disabled';
}
} else {
chart.exportChart(options);
}
},
svgSuccess = function(svg) {
var filename = (options.filename || 'chart') + '.' + (imageType === 'image/svg+xml' ? 'svg' : imageType.split('/')[1]);
Highcharts.downloadSVGLocal(svg, filename, imageType, options.scale, fallbackToExportServer);
};
// If we have embedded images and are exporting to JPEG/PNG, Microsoft browsers won't handle it, so fall back
if (isMSBrowser && imageType !== 'image/svg+xml' && chart.container.getElementsByTagName('image').length) {
fallbackToExportServer();
return;
}
chart.getSVGForLocalExport(options, chartOptions, fallbackToExportServer, svgSuccess);
};
// Extend the default options to use the local exporter logic
merge(true, Highcharts.getOptions().exporting, {
libURL: 'http://code.highcharts.com@product.cdnpath@/5.0.0/lib/',
buttons: {
contextButton: {
menuItems: [{
textKey: 'printChart',
onclick: function() {
this.print();
}
}, {
separator: true
}, {
textKey: 'downloadPNG',
onclick: function() {
this.exportChartLocal();
}
}, {
textKey: 'downloadJPEG',
onclick: function() {
this.exportChartLocal({
type: 'image/jpeg'
});
}
}, {
textKey: 'downloadSVG',
onclick: function() {
this.exportChartLocal({
type: 'image/svg+xml'
});
}
}
/*, {
textKey: 'downloadPDF',
onclick: function () {
this.exportChartLocal({
type: 'application/pdf'
});
}
}*/
]
}
}
});
}(Highcharts));
}));

View File

@@ -0,0 +1,10 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(b){"object"===typeof module&&module.exports?module.exports=b:b(Highcharts)})(function(b){(function(b){var g=b.Chart,h=b.each,r=b.pick,t=b.addEvent;g.prototype.callbacks.push(function(l){function b(){var d=[];h(l.series,function(a){var c=a.options.dataLabels,b=a.dataLabelCollections||["dataLabel"];(c.enabled||a._hasPointLabels)&&!c.allowOverlap&&a.visible&&h(b,function(c){h(a.points,function(a){a[c]&&(a[c].labelrank=r(a.labelrank,a.shapeArgs&&a.shapeArgs.height),d.push(a[c]))})})});l.hideOverlappingLabels(d)}
b();t(l,"redraw",b)});g.prototype.hideOverlappingLabels=function(b){var m=b.length,d,a,c,e,k,n,p,q,f,g=function(a,b,c,d,e,f,g,h){return!(e>a+c||e+g<a||f>b+d||f+h<b)};for(a=0;a<m;a++)if(d=b[a])d.oldOpacity=d.opacity,d.newOpacity=1;b.sort(function(a,b){return(b.labelrank||0)-(a.labelrank||0)});for(a=0;a<m;a++)for(c=b[a],d=a+1;d<m;++d)if(e=b[d],c&&e&&c.placed&&e.placed&&0!==c.newOpacity&&0!==e.newOpacity&&(k=c.alignAttr,n=e.alignAttr,p=c.parentGroup,q=e.parentGroup,f=2*(c.box?0:c.padding),k=g(k.x+p.translateX,
k.y+p.translateY,c.width-f,c.height-f,n.x+q.translateX,n.y+q.translateY,e.width-f,e.height-f)))(c.labelrank<e.labelrank?c:e).newOpacity=0;h(b,function(a){var b,c;a&&(c=a.newOpacity,a.oldOpacity!==c&&a.placed&&(c?a.show(!0):b=function(){a.hide()},a.alignAttr.opacity=c,a[a.isOld?"animate":"attr"](a.alignAttr,null,b)),a.isOld=!0)})}})(b)});

View File

@@ -0,0 +1,164 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
/**
* Highcharts module to hide overlapping data labels. This module is included in Highcharts.
*/
var Chart = H.Chart,
each = H.each,
pick = H.pick,
addEvent = H.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need to be
// considered because they are usually accompanied by data labels that lie inside the columns.
Chart.prototype.callbacks.push(function(chart) {
function collectAndHide() {
var labels = [];
each(chart.series, function(series) {
var dlOptions = series.options.dataLabels,
collections = series.dataLabelCollections || ['dataLabel']; // Range series have two collections
if ((dlOptions.enabled || series._hasPointLabels) && !dlOptions.allowOverlap && series.visible) { // #3866
each(collections, function(coll) {
each(series.points, function(point) {
if (point[coll]) {
point[coll].labelrank = pick(point.labelrank, point.shapeArgs && point.shapeArgs.height); // #4118
labels.push(point[coll]);
}
});
});
}
});
chart.hideOverlappingLabels(labels);
}
// Do it now ...
collectAndHide();
// ... and after each chart redraw
addEvent(chart, 'redraw', collectAndHide);
});
/**
* Hide overlapping labels. Labels are moved and faded in and out on zoom to provide a smooth
* visual imression.
*/
Chart.prototype.hideOverlappingLabels = function(labels) {
var len = labels.length,
label,
i,
j,
label1,
label2,
isIntersecting,
pos1,
pos2,
parent1,
parent2,
padding,
intersectRect = function(x1, y1, w1, h1, x2, y2, w2, h2) {
return !(
x2 > x1 + w1 ||
x2 + w2 < x1 ||
y2 > y1 + h1 ||
y2 + h2 < y1
);
};
// Mark with initial opacity
for (i = 0; i < len; i++) {
label = labels[i];
if (label) {
label.oldOpacity = label.opacity;
label.newOpacity = 1;
}
}
// Prevent a situation in a gradually rising slope, that each label
// will hide the previous one because the previous one always has
// lower rank.
labels.sort(function(a, b) {
return (b.labelrank || 0) - (a.labelrank || 0);
});
// Detect overlapping labels
for (i = 0; i < len; i++) {
label1 = labels[i];
for (j = i + 1; j < len; ++j) {
label2 = labels[j];
if (label1 && label2 && label1.placed && label2.placed && label1.newOpacity !== 0 && label2.newOpacity !== 0) {
pos1 = label1.alignAttr;
pos2 = label2.alignAttr;
parent1 = label1.parentGroup; // Different panes have different positions
parent2 = label2.parentGroup;
padding = 2 * (label1.box ? 0 : label1.padding); // Substract the padding if no background or border (#4333)
isIntersecting = intersectRect(
pos1.x + parent1.translateX,
pos1.y + parent1.translateY,
label1.width - padding,
label1.height - padding,
pos2.x + parent2.translateX,
pos2.y + parent2.translateY,
label2.width - padding,
label2.height - padding
);
if (isIntersecting) {
(label1.labelrank < label2.labelrank ? label1 : label2).newOpacity = 0;
}
}
}
}
// Hide or show
each(labels, function(label) {
var complete,
newOpacity;
if (label) {
newOpacity = label.newOpacity;
if (label.oldOpacity !== newOpacity && label.placed) {
// Make sure the label is completely hidden to avoid catching clicks (#4362)
if (newOpacity) {
label.show(true);
} else {
complete = function() {
label.hide();
};
}
// Animate or set the opacity
label.alignAttr.opacity = newOpacity;
label[label.isOld ? 'animate' : 'attr'](label.alignAttr, null, complete);
}
label.isOld = true;
}
});
};
}(Highcharts));
}));

View File

@@ -0,0 +1,18 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2009-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(t){"object"===typeof module&&module.exports?module.exports=t:t(Highcharts)})(function(t){(function(u){function t(d,b,a,m,c,e){d=(e-b)*(a-d)-(m-b)*(c-d);return 0<d?!0:0>d?!1:!0}function v(d,b,a,m,c,e,f,l){return t(d,b,c,e,f,l)!==t(a,m,c,e,f,l)&&t(d,b,a,m,c,e)!==t(d,b,a,m,f,l)}function y(d,b,a,m,c,e,f,l){return v(d,b,d+a,b,c,e,f,l)||v(d+a,b,d+a,b+m,c,e,f,l)||v(d,b+m,d+a,b+m,c,e,f,l)||v(d,b,d,b+m,c,e,f,l)}function z(d){var b=this;d.call(b);clearTimeout(b.seriesLabelTimer);b.seriesLabelTimer=
setTimeout(function(){b.boxesToAvoid=[];w(b.series,function(a){var d=a.options.label;d.enabled&&a.visible&&(a.graph||a.area)&&(a.interpolatedPoints=a.getPointsOnGraph(),w(d.boxesToAvoid||[],function(a){b.boxesToAvoid.push(a)}))});w(b.series,function(a){function d(a,b,c){return a>p&&a<=p+r-c.width&&b>=g&&b<=g+h-c.height}var c,e,f,l=[],k,n,p=(c=b.inverted)?a.yAxis.pos:a.xAxis.pos,g=c?a.xAxis.pos:a.yAxis.pos,r=b.inverted?a.yAxis.len:a.xAxis.len,h=b.inverted?a.xAxis.len:a.yAxis.len,q=a.interpolatedPoints;
if(a.visible&&q){a.labelBySeries||(a.labelBySeries=b.renderer.label(a.name,0,-9999,"connector").css(D({color:a.color},a.options.label.styles)).attr({padding:0,opacity:0,stroke:a.color,"stroke-width":1}).add(a.group).animate({opacity:1},{duration:200}));c=a.labelBySeries.getBBox();c.width=Math.round(c.width);for(n=q.length-1;0<n;--n)e=q[n].chartX+3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX+3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&
l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY+3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k),e=q[n].chartX-c.width-3,f=q[n].chartY-c.height-3,d(e,f,c)&&(k=a.checkClearPoint(e,f,c)),k&&l.push(k);if(!l.length)for(e=p+r-c.width;e>=p;e-=16)for(f=g;f<g+h-c.height;f+=16)(k=a.checkClearPoint(e,f,c,!0))&&l.push(k);l.length?(l.sort(function(a,b){return b.weight-a.weight}),k=l[0],b.boxesToAvoid.push({left:k.x,right:k.x+c.width,top:k.y,bottom:k.y+c.height}),Math.round(k.x)===Math.round(a.labelBySeries.x)&&
Math.round(k.y)===Math.round(a.labelBySeries.y)||a.labelBySeries.attr({x:k.x-p,y:k.y-g,anchorX:k.connectorPoint&&k.connectorPoint.plotX,anchorY:k.connectorPoint&&k.connectorPoint.plotY,opacity:0}).animate({opacity:1})):a.labelBySeries&&(a.labelBySeries=a.labelBySeries.destroy())}})},350)}var A=u.wrap,w=u.each,D=u.extend,x=u.isNumber,B=u.Series,E=u.SVGRenderer,C=u.Chart;u.setOptions({plotOptions:{series:{label:{enabled:!0,connectorAllowed:!0,connectorNeighbourDistance:24,styles:{fontWeight:"bold"}}}}});
E.prototype.symbols.connector=function(d,b,a,m,c){var e=c&&c.anchorX;c=c&&c.anchorY;var f,l,k=a/2;x(e)&&x(c)&&(f=["M",e,c],l=b-c,0>l&&(l=-m-l),l<a&&(k=e<d+a/2?l:a-l),c>b+m?f.push("L",d+k,b+m):c<b?f.push("L",d+k,b):e<d?f.push("L",d,b+m/2):e>d+a&&f.push("L",d+a,b+m/2));return f||[]};B.prototype.getPointsOnGraph=function(){var d=this.points,b,a,m=[],c,e,f,l;e=this.graph||this.area;f=e.element;var k=(b=this.chart.inverted)?this.yAxis.pos:this.xAxis.pos,n=b?this.xAxis.pos:this.yAxis.pos;if(this.getPointSpline&&
f.getPointAtLength){e.toD&&(a=e.attr("d"),e.attr({d:e.toD}));l=f.getTotalLength();for(c=0;c<l;c+=16)b=f.getPointAtLength(c),m.push({chartX:k+b.x,chartY:n+b.y,plotX:b.x,plotY:b.y});a&&e.attr({d:a});b=d[d.length-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;m.push(b)}else for(l=d.length,c=0;c<l;c+=1){b=d[c];a=d[c-1];b.chartX=k+b.plotX;b.chartY=n+b.plotY;if(0<c&&(e=Math.abs(b.chartX-a.chartX),f=Math.abs(b.chartY-a.chartY),e=Math.max(e,f),16<e))for(e=Math.ceil(e/16),f=1;f<e;f+=1)m.push({chartX:a.chartX+f/
e*(b.chartX-a.chartX),chartY:a.chartY+f/e*(b.chartY-a.chartY),plotX:a.plotX+f/e*(b.plotX-a.plotX),plotY:a.plotY+f/e*(b.plotY-a.plotY)});x(b.plotY)&&m.push(b)}return m};B.prototype.checkClearPoint=function(d,b,a,m){var c=Number.MAX_VALUE,e=Number.MAX_VALUE,f,l,k=this.options.label.connectorAllowed,n=this.chart,p,g,r,h;for(r=0;r<n.boxesToAvoid.length;r+=1){g=n.boxesToAvoid[r];h=d+a.width;p=b;var q=b+a.height;if(!(d>g.right||h<g.left||p>g.bottom||q<g.top))return!1}for(r=0;r<n.series.length;r+=1)if(p=
n.series[r],g=p.interpolatedPoints,p.visible&&g){for(h=1;h<g.length;h+=1){if(y(d,b,a.width,a.height,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY))return!1;this===p&&!f&&m&&(f=y(d-16,b-16,a.width+32,a.height+32,g[h-1].chartX,g[h-1].chartY,g[h].chartX,g[h].chartY));this!==p&&(c=Math.min(c,Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,
2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2)))}if(k&&this===p&&(m&&!f||c<Math.pow(this.options.label.connectorNeighbourDistance,2))){for(h=1;h<g.length;h+=1)f=Math.min(Math.pow(d+a.width/2-g[h].chartX,2)+Math.pow(b+a.height/2-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b-g[h].chartY,2),Math.pow(d+a.width-g[h].chartX,2)+Math.pow(b+a.height-g[h].chartY,2),Math.pow(d-g[h].chartX,2)+
Math.pow(b+a.height-g[h].chartY,2)),f<e&&(e=f,l=g[h]);f=!0}}return!m||f?{x:d,y:b,weight:c-(l?e:0),connectorPoint:l}:!1};A(C.prototype,"render",z);A(C.prototype,"redraw",z)})(t)});

View File

@@ -0,0 +1,544 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/**
* EXPERIMENTAL Highcharts module to place labels next to a series in a natural position.
*
* TODO:
* - add column support (box collision detection, boxesToAvoid logic)
* - other series types, area etc.
* - avoid data labels, when data labels above, show series label below.
* - add more options (connector, format, formatter)
*
* http://jsfiddle.net/highcharts/L2u9rpwr/
* http://jsfiddle.net/highcharts/y5A37/
* http://jsfiddle.net/highcharts/264Nm/
* http://jsfiddle.net/highcharts/y5A37/
*/
'use strict';
var labelDistance = 3,
wrap = H.wrap,
each = H.each,
extend = H.extend,
isNumber = H.isNumber,
Series = H.Series,
SVGRenderer = H.SVGRenderer,
Chart = H.Chart;
H.setOptions({
plotOptions: {
series: {
label: {
enabled: true,
// Allow labels to be placed distant to the graph if necessary, and
// draw a connector line to the graph
connectorAllowed: true,
connectorNeighbourDistance: 24, // If the label is closer than this to a neighbour graph, draw a connector
styles: {
fontWeight: 'bold'
}
// boxesToAvoid: []
}
}
}
});
/**
* Counter-clockwise, part of the fast line intersection logic
*/
function ccw(x1, y1, x2, y2, x3, y3) {
var cw = ((y3 - y1) * (x2 - x1)) - ((y2 - y1) * (x3 - x1));
return cw > 0 ? true : cw < 0 ? false : true;
}
/**
* Detect if two lines intersect
*/
function intersectLine(x1, y1, x2, y2, x3, y3, x4, y4) {
return ccw(x1, y1, x3, y3, x4, y4) !== ccw(x2, y2, x3, y3, x4, y4) &&
ccw(x1, y1, x2, y2, x3, y3) !== ccw(x1, y1, x2, y2, x4, y4);
}
/**
* Detect if a box intersects with a line
*/
function boxIntersectLine(x, y, w, h, x1, y1, x2, y2) {
return (
intersectLine(x, y, x + w, y, x1, y1, x2, y2) || // top of label
intersectLine(x + w, y, x + w, y + h, x1, y1, x2, y2) || // right of label
intersectLine(x, y + h, x + w, y + h, x1, y1, x2, y2) || // bottom of label
intersectLine(x, y, x, y + h, x1, y1, x2, y2) // left of label
);
}
/**
* General symbol definition for labels with connector
*/
SVGRenderer.prototype.symbols.connector = function(x, y, w, h, options) {
var anchorX = options && options.anchorX,
anchorY = options && options.anchorY,
path,
yOffset,
lateral = w / 2;
if (isNumber(anchorX) && isNumber(anchorY)) {
path = ['M', anchorX, anchorY];
// Prefer 45 deg connectors
yOffset = y - anchorY;
if (yOffset < 0) {
yOffset = -h - yOffset;
}
if (yOffset < w) {
lateral = anchorX < x + (w / 2) ? yOffset : w - yOffset;
}
// Anchor below label
if (anchorY > y + h) {
path.push('L', x + lateral, y + h);
// Anchor above label
} else if (anchorY < y) {
path.push('L', x + lateral, y);
// Anchor left of label
} else if (anchorX < x) {
path.push('L', x, y + h / 2);
// Anchor right of label
} else if (anchorX > x + w) {
path.push('L', x + w, y + h / 2);
}
}
return path || [];
};
/**
* Points to avoid. In addition to actual data points, the label should avoid
* interpolated positions.
*/
Series.prototype.getPointsOnGraph = function() {
var distance = 16,
points = this.points,
point,
last,
interpolated = [],
i,
deltaX,
deltaY,
delta,
len,
n,
j,
d,
graph = this.graph || this.area,
node = graph.element,
inverted = this.chart.inverted,
paneLeft = inverted ? this.yAxis.pos : this.xAxis.pos,
paneTop = inverted ? this.xAxis.pos : this.yAxis.pos;
// For splines, get the point at length (possible caveat: peaks are not correctly detected)
if (this.getPointSpline && node.getPointAtLength) {
// If it is animating towards a path definition, use that briefly, and reset
if (graph.toD) {
d = graph.attr('d');
graph.attr({
d: graph.toD
});
}
len = node.getTotalLength();
for (i = 0; i < len; i += distance) {
point = node.getPointAtLength(i);
interpolated.push({
chartX: paneLeft + point.x,
chartY: paneTop + point.y,
plotX: point.x,
plotY: point.y
});
}
if (d) {
graph.attr({
d: d
});
}
// Last point
point = points[points.length - 1];
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
interpolated.push(point);
// Interpolate
} else {
len = points.length;
for (i = 0; i < len; i += 1) {
point = points[i];
last = points[i - 1];
// Absolute coordinates so we can compare different panes
point.chartX = paneLeft + point.plotX;
point.chartY = paneTop + point.plotY;
// Add interpolated points
if (i > 0) {
deltaX = Math.abs(point.chartX - last.chartX);
deltaY = Math.abs(point.chartY - last.chartY);
delta = Math.max(deltaX, deltaY);
if (delta > distance) {
n = Math.ceil(delta / distance);
for (j = 1; j < n; j += 1) {
interpolated.push({
chartX: last.chartX + (point.chartX - last.chartX) * (j / n),
chartY: last.chartY + (point.chartY - last.chartY) * (j / n),
plotX: last.plotX + (point.plotX - last.plotX) * (j / n),
plotY: last.plotY + (point.plotY - last.plotY) * (j / n)
});
}
}
}
// Add the real point in order to find positive and negative peaks
if (isNumber(point.plotY)) {
interpolated.push(point);
}
}
}
return interpolated;
};
/**
* Check whether a proposed label position is clear of other elements
*/
Series.prototype.checkClearPoint = function(x, y, bBox, checkDistance) {
var distToOthersSquared = Number.MAX_VALUE, // distance to other graphs
distToPointSquared = Number.MAX_VALUE,
dist,
connectorPoint,
connectorEnabled = this.options.label.connectorAllowed,
chart = this.chart,
series,
points,
leastDistance = 16,
withinRange,
i,
j;
function intersectRect(r1, r2) {
return !(r2.left > r1.right ||
r2.right < r1.left ||
r2.top > r1.bottom ||
r2.bottom < r1.top);
}
/**
* Get the weight in order to determine the ideal position. Larger distance to
* other series gives more weight. Smaller distance to the actual point (connector points only)
* gives more weight.
*/
function getWeight(distToOthersSquared, distToPointSquared) {
return distToOthersSquared - distToPointSquared;
}
// First check for collision with existing labels
for (i = 0; i < chart.boxesToAvoid.length; i += 1) {
if (intersectRect(chart.boxesToAvoid[i], {
left: x,
right: x + bBox.width,
top: y,
bottom: y + bBox.height
})) {
return false;
}
}
// For each position, check if the lines around the label intersect with any of the
// graphs
for (i = 0; i < chart.series.length; i += 1) {
series = chart.series[i];
points = series.interpolatedPoints;
if (series.visible && points) {
for (j = 1; j < points.length; j += 1) {
// If any of the box sides intersect with the line, return
if (boxIntersectLine(
x,
y,
bBox.width,
bBox.height,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
)) {
return false;
}
// But if it is too far away (a padded box doesn't intersect), also return
if (this === series && !withinRange && checkDistance) {
withinRange = boxIntersectLine(
x - leastDistance,
y - leastDistance,
bBox.width + 2 * leastDistance,
bBox.height + 2 * leastDistance,
points[j - 1].chartX,
points[j - 1].chartY,
points[j].chartX,
points[j].chartY
);
}
// Find the squared distance from the center of the label
if (this !== series) {
distToOthersSquared = Math.min(
distToOthersSquared,
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
}
}
// Do we need a connector?
if (connectorEnabled && this === series && ((checkDistance && !withinRange) ||
distToOthersSquared < Math.pow(this.options.label.connectorNeighbourDistance, 2))) {
for (j = 1; j < points.length; j += 1) {
dist = Math.min(
Math.pow(x + bBox.width / 2 - points[j].chartX, 2) + Math.pow(y + bBox.height / 2 - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y - points[j].chartY, 2),
Math.pow(x + bBox.width - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2),
Math.pow(x - points[j].chartX, 2) + Math.pow(y + bBox.height - points[j].chartY, 2)
);
if (dist < distToPointSquared) {
distToPointSquared = dist;
connectorPoint = points[j];
}
}
withinRange = true;
}
}
}
return !checkDistance || withinRange ? {
x: x,
y: y,
weight: getWeight(distToOthersSquared, connectorPoint ? distToPointSquared : 0),
connectorPoint: connectorPoint
} : false;
};
/**
* The main initiator method that runs on chart level after initiation and redraw. It runs in
* a timeout to prevent locking, and loops over all series, taking all series and labels into
* account when placing the labels.
*/
function drawLabels(proceed) {
var chart = this;
proceed.call(chart);
clearTimeout(chart.seriesLabelTimer);
chart.seriesLabelTimer = setTimeout(function() {
chart.boxesToAvoid = [];
// Build the interpolated points
each(chart.series, function(series) {
var options = series.options.label;
if (options.enabled && series.visible && (series.graph || series.area)) {
series.interpolatedPoints = series.getPointsOnGraph();
each(options.boxesToAvoid || [], function(box) {
chart.boxesToAvoid.push(box);
});
}
});
each(chart.series, function(series) {
var bBox,
x,
y,
results = [],
clearPoint,
i,
best,
inverted = chart.inverted,
paneLeft = inverted ? series.yAxis.pos : series.xAxis.pos,
paneTop = inverted ? series.xAxis.pos : series.yAxis.pos,
paneWidth = chart.inverted ? series.yAxis.len : series.xAxis.len,
paneHeight = chart.inverted ? series.xAxis.len : series.yAxis.len,
points = series.interpolatedPoints;
function insidePane(x, y, bBox) {
return x > paneLeft && x <= paneLeft + paneWidth - bBox.width &&
y >= paneTop && y <= paneTop + paneHeight - bBox.height;
}
if (series.visible && points) {
if (!series.labelBySeries) {
series.labelBySeries = chart.renderer.label(series.name, 0, -9999, 'connector')
.css(extend({
color: series.color
}, series.options.label.styles))
.attr({
padding: 0,
opacity: 0,
stroke: series.color,
'stroke-width': 1
})
.add(series.group)
.animate({
opacity: 1
}, {
duration: 200
});
}
bBox = series.labelBySeries.getBBox();
bBox.width = Math.round(bBox.width);
// Ideal positions are centered above or below a point on right side of chart
for (i = points.length - 1; i > 0; i -= 1) {
// Right - up
x = points[i].chartX + labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Right - down
x = points[i].chartX + labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - down
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY + labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
// Left - up
x = points[i].chartX - bBox.width - labelDistance;
y = points[i].chartY - bBox.height - labelDistance;
if (insidePane(x, y, bBox)) {
best = series.checkClearPoint(
x,
y,
bBox
);
}
if (best) {
results.push(best);
}
}
// Brute force, try all positions on the chart in a 16x16 grid
if (!results.length) {
for (x = paneLeft + paneWidth - bBox.width; x >= paneLeft; x -= 16) {
for (y = paneTop; y < paneTop + paneHeight - bBox.height; y += 16) {
clearPoint = series.checkClearPoint(x, y, bBox, true);
if (clearPoint) {
results.push(clearPoint);
}
}
}
}
if (results.length) {
results.sort(function(a, b) {
return b.weight - a.weight;
});
best = results[0];
chart.boxesToAvoid.push({
left: best.x,
right: best.x + bBox.width,
top: best.y,
bottom: best.y + bBox.height
});
// Move it if needed
if (Math.round(best.x) !== Math.round(series.labelBySeries.x) || Math.round(best.y) !== Math.round(series.labelBySeries.y)) {
series.labelBySeries
.attr({
x: best.x - paneLeft,
y: best.y - paneTop,
anchorX: best.connectorPoint && best.connectorPoint.plotX,
anchorY: best.connectorPoint && best.connectorPoint.plotY,
opacity: 0
})
.animate({
opacity: 1
});
}
} else if (series.labelBySeries) {
series.labelBySeries = series.labelBySeries.destroy();
}
}
});
}, 350);
}
wrap(Chart.prototype, 'render', drawLabels);
wrap(Chart.prototype, 'redraw', drawLabels);
}(Highcharts));
}));

View File

@@ -0,0 +1,14 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
Solid angular gauge module
(c) 2010-2016 Torstein Honsi
License: www.highcharts.com/license
*/
(function(f){"object"===typeof module&&module.exports?module.exports=f:f(Highcharts)})(function(f){(function(b){var f=b.pInt,u=b.pick,m=b.each,v=b.isNumber,n;n={initDataClasses:function(a){var c=this,h=this.chart,e,t=0,l=this.options;this.dataClasses=e=[];m(a.dataClasses,function(g,d){var f;g=b.merge(g);e.push(g);g.color||("category"===l.dataClassColor?(f=h.options.colors,g.color=f[t++],t===f.length&&(t=0)):g.color=c.tweenColors(b.color(l.minColor),b.color(l.maxColor),d/(a.dataClasses.length-1)))})},
initStops:function(a){this.stops=a.stops||[[0,this.options.minColor],[1,this.options.maxColor]];m(this.stops,function(a){a.color=b.color(a[1])})},toColor:function(a,c){var h,e=this.stops,b,f=this.dataClasses,g,d;if(f)for(d=f.length;d--;){if(g=f[d],b=g.from,e=g.to,(void 0===b||a>=b)&&(void 0===e||a<=e)){h=g.color;c&&(c.dataClass=d);break}}else{this.isLog&&(a=this.val2lin(a));h=1-(this.max-a)/(this.max-this.min);for(d=e.length;d--&&!(h>e[d][0]););b=e[d]||e[d+1];e=e[d+1]||b;h=1-(e[0]-h)/(e[0]-b[0]||
1);h=this.tweenColors(b.color,e.color,h)}return h},tweenColors:function(a,c,b){var e;c.rgba.length&&a.rgba.length?(a=a.rgba,c=c.rgba,e=1!==c[3]||1!==a[3],a=(e?"rgba(":"rgb(")+Math.round(c[0]+(a[0]-c[0])*(1-b))+","+Math.round(c[1]+(a[1]-c[1])*(1-b))+","+Math.round(c[2]+(a[2]-c[2])*(1-b))+(e?","+(c[3]+(a[3]-c[3])*(1-b)):"")+")"):a=c.input||"none";return a}};m(["fill","stroke"],function(a){b.Fx.prototype[a+"Setter"]=function(){this.elem.attr(a,n.tweenColors(b.color(this.start),b.color(this.end),this.pos))}});
b.seriesType("solidgauge","gauge",{colorByPoint:!0},{bindAxes:function(){var a;b.seriesTypes.gauge.prototype.bindAxes.call(this);a=this.yAxis;b.extend(a,n);a.options.dataClasses&&a.initDataClasses(a.options);a.initStops(a.options)},drawPoints:function(){var a=this,c=a.yAxis,b=c.center,e=a.options,t=a.chart.renderer,l=e.overshoot,g=v(l)?l/180*Math.PI:0;m(a.points,function(d){var l=d.graphic,k=c.startAngleRad+c.translate(d.y,null,null,null,!0),m=f(u(d.options.radius,e.radius,100))*b[2]/200,p=f(u(d.options.innerRadius,
e.innerRadius,60))*b[2]/200,q=c.toColor(d.y,d),r=Math.min(c.startAngleRad,c.endAngleRad),n=Math.max(c.startAngleRad,c.endAngleRad);"none"===q&&(q=d.color||a.color||"none");"none"!==q&&(d.color=q);k=Math.max(r-g,Math.min(n+g,k));!1===e.wrap&&(k=Math.max(r,Math.min(n,k)));r=Math.min(k,c.startAngleRad);k=Math.max(k,c.startAngleRad);k-r>2*Math.PI&&(k=r+2*Math.PI);d.shapeArgs=p={x:b[0],y:b[1],r:m,innerR:p,start:r,end:k,fill:q};d.startR=m;l?(d=p.d,l.animate(p),d&&(p.d=d)):(d.graphic=t.arc(p).addClass("highcharts-point").attr({fill:q,
"sweep-flag":0}).add(a.group),"square"!==e.linecap&&d.graphic.attr({"stroke-linecap":"round","stroke-linejoin":"round"}),d.graphic.attr({stroke:e.borderColor||"none","stroke-width":e.borderWidth||0}))})},animate:function(a){a||(this.startAngleRad=this.yAxis.startAngleRad,b.seriesTypes.pie.prototype.animate.call(this,a))}})})(f)});

View File

@@ -0,0 +1,287 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* Solid angular gauge module
*
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
var pInt = H.pInt,
pick = H.pick,
each = H.each,
isNumber = H.isNumber,
colorAxisMethods;
// 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;
},
/*
* 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,
ret;
// Unsupported color, return to-color (#3920)
if (!to.rgba.length || !from.rgba.length) {
ret = to.input || 'none';
// Interpolate
} else {
from = from.rgba;
to = to.rgba;
hasAlpha = (to[3] !== 1 || from[3] !== 1);
ret = (hasAlpha ? 'rgba(' : 'rgb(') +
Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
(hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
}
return ret;
}
};
/**
* Handle animation of the color attributes directly
*/
each(['fill', 'stroke'], function(prop) {
H.Fx.prototype[prop + 'Setter'] = function() {
this.elem.attr(prop, colorAxisMethods.tweenColors(H.color(this.start), H.color(this.end), this.pos));
};
});
// The solidgauge series type
H.seriesType('solidgauge', 'gauge', {
colorByPoint: true
}, {
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,
overshoot = options.overshoot,
overshootVal = isNumber(overshoot) ? overshoot / 180 * Math.PI : 0;
each(series.points, function(point) {
var graphic = point.graphic,
rotation = yAxis.startAngleRad + yAxis.translate(point.y, null, null, null, true),
radius = (pInt(pick(point.options.radius, options.radius, 100)) * center[2]) / 200,
innerRadius = (pInt(pick(point.options.innerRadius, options.innerRadius, 60)) * center[2]) / 200,
shapeArgs,
d,
toColor = yAxis.toColor(point.y, point),
axisMinAngle = Math.min(yAxis.startAngleRad, yAxis.endAngleRad),
axisMaxAngle = Math.max(yAxis.startAngleRad, yAxis.endAngleRad),
minAngle,
maxAngle;
if (toColor === 'none') { // #3708
toColor = point.color || series.color || 'none';
}
if (toColor !== 'none') {
point.color = toColor;
}
// Handle overshoot and clipping to axis max/min
rotation = Math.max(axisMinAngle - overshootVal, Math.min(axisMaxAngle + overshootVal, rotation));
// Handle the wrap option
if (options.wrap === false) {
rotation = Math.max(axisMinAngle, Math.min(axisMaxAngle, rotation));
}
minAngle = Math.min(rotation, yAxis.startAngleRad);
maxAngle = Math.max(rotation, yAxis.startAngleRad);
if (maxAngle - minAngle > 2 * Math.PI) {
maxAngle = minAngle + 2 * Math.PI;
}
point.shapeArgs = shapeArgs = {
x: center[0],
y: center[1],
r: radius,
innerR: innerRadius,
start: minAngle,
end: maxAngle,
fill: toColor
};
point.startR = radius; // For PieSeries.animate
if (graphic) {
d = shapeArgs.d;
graphic.animate(shapeArgs);
if (d) {
shapeArgs.d = d; // animate alters it
}
} else {
point.graphic = renderer.arc(shapeArgs)
.addClass('highcharts-point')
.attr({
fill: toColor,
'sweep-flag': 0
})
.add(series.group);
if (options.linecap !== 'square') {
point.graphic.attr({
'stroke-linecap': 'round',
'stroke-linejoin': 'round'
});
}
point.graphic.attr({
stroke: options.borderColor || 'none',
'stroke-width': options.borderWidth || 0
});
}
});
},
/**
* Extend the pie slice animation by animating from start angle and up
*/
animate: function(init) {
if (!init) {
this.startAngleRad = this.yAxis.startAngleRad;
H.seriesTypes.pie.prototype.animate.call(this, init);
}
}
});
}(Highcharts));
}));

View File

@@ -0,0 +1,31 @@
/*
Highcharts JS v5.0.0 (2016-09-29)
(c) 2014 Highsoft AS
Authors: Jon Arild Nygard / Oystein Moseng
License: www.highcharts.com/license
*/
(function(t){"object"===typeof module&&module.exports?module.exports=t:t(Highcharts)})(function(t){(function(g){var t=g.seriesType,n=g.seriesTypes,E=g.map,v=g.merge,y=g.extend,z=g.noop,m=g.each,x=g.grep,k=g.pick,u=g.Series,F=g.stableSort,A=g.Color,G=function(a,b,c){var d;c=c||this;for(d in a)a.hasOwnProperty(d)&&b.call(c,a[d],d,a)},B=function(a,b,c,d){d=d||this;a=a||[];m(a,function(e,f){c=b.call(d,c,e,f,a)});return c},w=function(a,b,c){c=c||this;a=b.call(c,a);!1!==a&&w(a,b,c)};t("treemap","scatter",
{showInLegend:!1,marker:!1,dataLabels:{enabled:!0,defer:!1,verticalAlign:"middle",formatter:function(){return this.point.name||this.point.id},inside:!0},tooltip:{headerFormat:"",pointFormat:"<b>{point.name}</b>: {point.value}</b><br/>"},layoutAlgorithm:"sliceAndDice",layoutStartingDirection:"vertical",alternateStartingDirection:!1,levelIsConstant:!0,drillUpButton:{position:{align:"right",x:-10,y:10}},borderColor:"#e6e6e6",borderWidth:1,opacity:.15,states:{hover:{borderColor:"#999999",brightness:n.heatmap?
0:.1,opacity:.75,shadow:!1}}},{pointArrayMap:["value"],axisTypes:n.heatmap?["xAxis","yAxis","colorAxis"]:["xAxis","yAxis"],optionalAxis:"colorAxis",getSymbol:z,parallelArrays:["x","y","value","colorValue"],colorKey:"colorValue",translateColors:n.heatmap&&n.heatmap.prototype.translateColors,trackerGroups:["group","dataLabelsGroup"],getListOfParents:function(a,b){var c=B(a,function(a,c,b){c=k(c.parent,"");void 0===a[c]&&(a[c]=[]);a[c].push(b);return a},{});G(c,function(a,c,f){""!==c&&-1===g.inArray(c,
b)&&(m(a,function(a){f[""].push(a)}),delete f[c])});return c},getTree:function(){var a,b=this;a=E(this.data,function(a){return a.id});a=b.getListOfParents(this.data,a);b.nodeMap=[];a=b.buildNode("",-1,0,a,null);w(this.nodeMap[this.rootNode],function(a){var d=!1,e=a.parent;a.visible=!0;if(e||""===e)d=b.nodeMap[e];return d});w(this.nodeMap[this.rootNode].children,function(a){var b=!1;m(a,function(a){a.visible=!0;a.children.length&&(b=(b||[]).concat(a.children))});return b});this.setTreeValues(a);return a},
init:function(a,b){u.prototype.init.call(this,a,b);this.options.allowDrillToNode&&this.drillTo()},buildNode:function(a,b,c,d,e){var f=this,h=[],C=f.points[b],D;m(d[a]||[],function(b){D=f.buildNode(f.points[b].id,b,c+1,d,a);h.push(D)});b={id:a,i:b,children:h,level:c,parent:e,visible:!1};f.nodeMap[b.id]=b;C&&(C.node=b);return b},setTreeValues:function(a){var b=this,c=b.options,d=0,e=[],f,h=b.points[a.i];m(a.children,function(a){a=b.setTreeValues(a);e.push(a);a.ignore?w(a.children,function(a){var c=
!1;m(a,function(a){y(a,{ignore:!0,isLeaf:!1,visible:!1});a.children.length&&(c=(c||[]).concat(a.children))});return c}):d+=a.val});F(e,function(a,c){return a.sortIndex-c.sortIndex});f=k(h&&h.options.value,d);h&&(h.value=f);y(a,{children:e,childrenTotal:d,ignore:!(k(h&&h.visible,!0)&&0<f),isLeaf:a.visible&&!d,levelDynamic:c.levelIsConstant?a.level:a.level-b.nodeMap[b.rootNode].level,name:k(h&&h.name,""),sortIndex:k(h&&h.sortIndex,-f),val:f});return a},calculateChildrenAreas:function(a,b){var c=this,
d=c.options,e=this.levelMap[a.levelDynamic+1],f=k(c[e&&e.layoutAlgorithm]&&e.layoutAlgorithm,d.layoutAlgorithm),h=d.alternateStartingDirection,g=[],d=x(a.children,function(a){return!a.ignore});e&&e.layoutStartingDirection&&(b.direction="vertical"===e.layoutStartingDirection?0:1);g=c[f](b,d);m(d,function(a,e){var d=g[e];a.values=v(d,{val:a.childrenTotal,direction:h?1-b.direction:b.direction});a.pointValues=v(d,{x:d.x/c.axisRatio,width:d.width/c.axisRatio});a.children.length&&c.calculateChildrenAreas(a,
a.values)})},setPointValues:function(){var a=this.xAxis,b=this.yAxis;m(this.points,function(c){var d=c.node,e=d.pointValues,f,h;e&&d.visible?(d=Math.round(a.translate(e.x,0,0,0,1))-.5,f=Math.round(a.translate(e.x+e.width,0,0,0,1))-.5,h=Math.round(b.translate(e.y,0,0,0,1))-.5,e=Math.round(b.translate(e.y+e.height,0,0,0,1))-.5,c.shapeType="rect",c.shapeArgs={x:Math.min(d,f),y:Math.min(h,e),width:Math.abs(f-d),height:Math.abs(e-h)},c.plotX=c.shapeArgs.x+c.shapeArgs.width/2,c.plotY=c.shapeArgs.y+c.shapeArgs.height/
2):(delete c.plotX,delete c.plotY)})},setColorRecursive:function(a,b,c){var d=this,e,f;a&&(e=d.points[a.i],f=d.levelMap[a.levelDynamic],b=k(e&&e.options.color,f&&f.color,b),c=k(e&&e.options.colorIndex,f&&f.colorIndex,c),e&&(e.color=b,e.colorIndex=c),a.children.length&&m(a.children,function(a){d.setColorRecursive(a,b,c)}))},algorithmGroup:function(a,b,c,d){this.height=a;this.width=b;this.plot=d;this.startDirection=this.direction=c;this.lH=this.nH=this.lW=this.nW=this.total=0;this.elArr=[];this.lP=
{total:0,lH:0,nH:0,lW:0,nW:0,nR:0,lR:0,aspectRatio:function(a,c){return Math.max(a/c,c/a)}};this.addElement=function(a){this.lP.total=this.elArr[this.elArr.length-1];this.total+=a;0===this.direction?(this.lW=this.nW,this.lP.lH=this.lP.total/this.lW,this.lP.lR=this.lP.aspectRatio(this.lW,this.lP.lH),this.nW=this.total/this.height,this.lP.nH=this.lP.total/this.nW,this.lP.nR=this.lP.aspectRatio(this.nW,this.lP.nH)):(this.lH=this.nH,this.lP.lW=this.lP.total/this.lH,this.lP.lR=this.lP.aspectRatio(this.lP.lW,
this.lH),this.nH=this.total/this.width,this.lP.nW=this.lP.total/this.nH,this.lP.nR=this.lP.aspectRatio(this.lP.nW,this.nH));this.elArr.push(a)};this.reset=function(){this.lW=this.nW=0;this.elArr=[];this.total=0}},algorithmCalcPoints:function(a,b,c,d){var e,f,h,g,k=c.lW,p=c.lH,l=c.plot,n,q=0,r=c.elArr.length-1;b?(k=c.nW,p=c.nH):n=c.elArr[c.elArr.length-1];m(c.elArr,function(a){if(b||q<r)0===c.direction?(e=l.x,f=l.y,h=k,g=a/h):(e=l.x,f=l.y,g=p,h=a/g),d.push({x:e,y:f,width:h,height:g}),0===c.direction?
l.y+=g:l.x+=h;q+=1});c.reset();0===c.direction?c.width-=k:c.height-=p;l.y=l.parent.y+(l.parent.height-c.height);l.x=l.parent.x+(l.parent.width-c.width);a&&(c.direction=1-c.direction);b||c.addElement(n)},algorithmLowAspectRatio:function(a,b,c){var d=[],e=this,f,h={x:b.x,y:b.y,parent:b},g=0,k=c.length-1,p=new this.algorithmGroup(b.height,b.width,b.direction,h);m(c,function(c){f=c.val/b.val*b.height*b.width;p.addElement(f);p.lP.nR>p.lP.lR&&e.algorithmCalcPoints(a,!1,p,d,h);g===k&&e.algorithmCalcPoints(a,
!0,p,d,h);g+=1});return d},algorithmFill:function(a,b,c){var d=[],e,f=b.direction,h=b.x,g=b.y,k=b.width,p=b.height,l,n,q,r;m(c,function(c){e=c.val/b.val*b.height*b.width;l=h;n=g;0===f?(r=p,q=e/r,k-=q,h+=q):(q=k,r=e/q,p-=r,g+=r);d.push({x:l,y:n,width:q,height:r});a&&(f=1-f)});return d},strip:function(a,b){return this.algorithmLowAspectRatio(!1,a,b)},squarified:function(a,b){return this.algorithmLowAspectRatio(!0,a,b)},sliceAndDice:function(a,b){return this.algorithmFill(!0,a,b)},stripes:function(a,
b){return this.algorithmFill(!1,a,b)},translate:function(){var a,b;u.prototype.translate.call(this);this.rootNode=k(this.options.rootId,"");this.levelMap=B(this.options.levels,function(a,b){a[b.level]=b;return a},{});b=this.tree=this.getTree();this.axisRatio=this.xAxis.len/this.yAxis.len;this.nodeMap[""].pointValues=a={x:0,y:0,width:100,height:100};this.nodeMap[""].values=a=v(a,{width:a.width*this.axisRatio,direction:"vertical"===this.options.layoutStartingDirection?0:1,val:b.val});this.calculateChildrenAreas(b,
a);this.colorAxis?this.translateColors():this.options.colorByPoint||this.setColorRecursive(this.tree);this.options.allowDrillToNode&&(b=this.nodeMap[this.rootNode].pointValues,this.xAxis.setExtremes(b.x,b.x+b.width,!1),this.yAxis.setExtremes(b.y,b.y+b.height,!1),this.xAxis.setScale(),this.yAxis.setScale());this.setPointValues()},drawDataLabels:function(){var a=this,b=x(a.points,function(a){return a.node.visible}),c,d;m(b,function(b){d=a.levelMap[b.node.levelDynamic];c={style:{}};b.node.isLeaf||(c.enabled=
!1);d&&d.dataLabels&&(c=v(c,d.dataLabels),a._hasPointLabels=!0);b.shapeArgs&&(c.style.width=b.shapeArgs.width,b.dataLabel&&b.dataLabel.css({width:b.shapeArgs.width+"px"}));b.dlOptions=v(c,b.options.dataLabels)});u.prototype.drawDataLabels.call(this)},alignDataLabel:function(a){n.column.prototype.alignDataLabel.apply(this,arguments);a.dataLabel&&a.dataLabel.attr({zIndex:a.node.zIndex+1})},pointAttribs:function(a,b){var c=this.levelMap[a.node.levelDynamic]||{},d=this.options,e=b&&d.states[b]||{},f=
a.getClassName(),c={stroke:a.borderColor||c.borderColor||e.borderColor||d.borderColor,"stroke-width":k(a.borderWidth,c.borderWidth,e.borderWidth,d.borderWidth),dashstyle:a.borderDashStyle||c.borderDashStyle||e.borderDashStyle||d.borderDashStyle,fill:a.color||this.color};-1!==f.indexOf("highcharts-above-level")?(c.fill="none",c["stroke-width"]=0):-1!==f.indexOf("highcharts-internal-node-interactive")?(d=k(e.opacity,d.opacity),c.fill=A(c.fill).setOpacity(d).get(),c.cursor="pointer"):-1!==f.indexOf("highcharts-internal-node")?
c.fill="none":b&&(c.fill=A(c.fill).brighten(e.brightness).get());return c},drawPoints:function(){var a=this,b=x(a.points,function(a){return a.node.visible});m(b,function(c){var b="levelGroup-"+c.node.levelDynamic;a[b]||(a[b]=a.chart.renderer.g(b).attr({zIndex:1E3-c.node.levelDynamic}).add(a.group));c.group=a[b]});n.column.prototype.drawPoints.call(this);a.options.allowDrillToNode&&m(b,function(b){b.graphic&&(b.drillId=a.options.interactByLeaf?a.drillToByLeaf(b):a.drillToByGroup(b))})},drillTo:function(){var a=
this;g.addEvent(a,"click",function(b){b=b.point;var c=b.drillId,d;c&&(d=a.nodeMap[a.rootNode].name||a.rootNode,b.setState(""),a.drillToNode(c),a.showDrillUpButton(d))})},drillToByGroup:function(a){var b=!1;1!==a.node.level-this.nodeMap[this.rootNode].level||a.node.isLeaf||(b=a.id);return b},drillToByLeaf:function(a){var b=!1;if(a.node.parent!==this.rootNode&&a.node.isLeaf)for(a=a.node;!b;)a=this.nodeMap[a.parent],a.parent===this.rootNode&&(b=a.id);return b},drillUp:function(){var a=null;this.rootNode&&
(a=this.nodeMap[this.rootNode],a=null!==a.parent?this.nodeMap[a.parent]:this.nodeMap[""]);null!==a&&(this.drillToNode(a.id),""===a.id?this.drillUpButton=this.drillUpButton.destroy():(a=this.nodeMap[a.parent],this.showDrillUpButton(a.name||a.id)))},drillToNode:function(a){this.options.rootId=a;this.isDirty=!0;this.chart.redraw()},showDrillUpButton:function(a){var b=this;a=a||"< Back";var c=b.options.drillUpButton,d,e;c.text&&(a=c.text);this.drillUpButton?this.drillUpButton.attr({text:a}).align():(e=
(d=c.theme)&&d.states,this.drillUpButton=this.chart.renderer.button(a,null,null,function(){b.drillUp()},d,e&&e.hover,e&&e.select).attr({align:c.position.align,zIndex:7}).add().align(c.position,!1,c.relativeTo||"plotBox"))},buildKDTree:z,drawLegendSymbol:g.LegendSymbolMixin.drawRectangle,getExtremes:function(){u.prototype.getExtremes.call(this,this.colorValueData);this.valueMin=this.dataMin;this.valueMax=this.dataMax;u.prototype.getExtremes.call(this)},getExtremesFromAll:!0,bindAxes:function(){var a=
{endOnTick:!1,gridLineWidth:0,lineWidth:0,min:0,dataMin:0,minPadding:0,max:100,dataMax:100,maxPadding:0,startOnTick:!1,title:null,tickPositions:[]};u.prototype.bindAxes.call(this);g.extend(this.yAxis.options,a);g.extend(this.xAxis.options,a)}},{getClassName:function(){var a=g.Point.prototype.getClassName.call(this),b=this.series,c=b.options;this.node.level<=b.nodeMap[b.rootNode].level?a+=" highcharts-above-level":this.node.isLeaf||k(c.interactByLeaf,!c.allowDrillToNode)?this.node.isLeaf||(a+=" highcharts-internal-node"):
a+=" highcharts-internal-node-interactive";return a},setState:function(a){g.Point.prototype.setState.call(this,a);this.graphic.attr({zIndex:"hover"===a?1:0})},setVisible:n.pie.prototype.pointClass.prototype.setVisible})})(t)});

View File

@@ -0,0 +1,930 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2014 Highsoft AS
* Authors: Jon Arild Nygard / Oystein Moseng
*
* License: www.highcharts.com/license
*/
'use strict';
var seriesType = H.seriesType,
seriesTypes = H.seriesTypes,
map = H.map,
merge = H.merge,
extend = H.extend,
noop = H.noop,
each = H.each,
grep = H.grep,
pick = H.pick,
Series = H.Series,
stableSort = H.stableSort,
color = H.Color,
eachObject = function(list, func, context) {
var key;
context = context || this;
for (key in list) {
if (list.hasOwnProperty(key)) {
func.call(context, list[key], key, list);
}
}
},
reduce = function(arr, func, previous, context) {
context = context || this;
arr = arr || []; // @note should each be able to handle empty values automatically?
each(arr, function(current, i) {
previous = func.call(context, previous, current, i, arr);
});
return previous;
},
// @todo find correct name for this function.
// @todo Similar to reduce, this function is likely redundant
recursive = function(item, func, context) {
var next;
context = context || this;
next = func.call(context, item);
if (next !== false) {
recursive(next, func, context);
}
};
// The Treemap series type
seriesType('treemap', 'scatter', {
showInLegend: false,
marker: false,
dataLabels: {
enabled: true,
defer: false,
verticalAlign: 'middle',
formatter: function() { // #2945
return this.point.name || this.point.id;
},
inside: true
},
tooltip: {
headerFormat: '',
pointFormat: '<b>{point.name}</b>: {point.value}</b><br/>'
},
layoutAlgorithm: 'sliceAndDice',
layoutStartingDirection: 'vertical',
alternateStartingDirection: false,
levelIsConstant: true,
drillUpButton: {
position: {
align: 'right',
x: -10,
y: 10
}
},
// Presentational options
borderColor: '#e6e6e6',
borderWidth: 1,
opacity: 0.15,
states: {
hover: {
borderColor: '#999999',
brightness: seriesTypes.heatmap ? 0 : 0.1,
opacity: 0.75,
shadow: false
}
}
// Prototype members
}, {
pointArrayMap: ['value'],
axisTypes: seriesTypes.heatmap ? ['xAxis', 'yAxis', 'colorAxis'] : ['xAxis', 'yAxis'],
optionalAxis: 'colorAxis',
getSymbol: noop,
parallelArrays: ['x', 'y', 'value', 'colorValue'],
colorKey: 'colorValue', // Point color option key
translateColors: seriesTypes.heatmap && seriesTypes.heatmap.prototype.translateColors,
trackerGroups: ['group', 'dataLabelsGroup'],
/**
* Creates an object map from parent id to childrens index.
* @param {Array} data List of points set in options.
* @param {string} data[].parent Parent id of point.
* @param {Array} ids List of all point ids.
* @return {Object} Map from parent id to children index in data.
*/
getListOfParents: function(data, ids) {
var listOfParents = reduce(data, function(prev, curr, i) {
var parent = pick(curr.parent, '');
if (prev[parent] === undefined) {
prev[parent] = [];
}
prev[parent].push(i);
return prev;
}, {});
// If parent does not exist, hoist parent to root of tree.
eachObject(listOfParents, function(children, parent, list) {
if ((parent !== '') && (H.inArray(parent, ids) === -1)) {
each(children, function(child) {
list[''].push(child);
});
delete list[parent];
}
});
return listOfParents;
},
/**
* Creates a tree structured object from the series points
*/
getTree: function() {
var tree,
series = this,
allIds = map(this.data, function(d) {
return d.id;
}),
parentList = series.getListOfParents(this.data, allIds);
series.nodeMap = [];
tree = series.buildNode('', -1, 0, parentList, null);
// Parents of the root node is by default visible
recursive(this.nodeMap[this.rootNode], function(node) {
var next = false,
p = node.parent;
node.visible = true;
if (p || p === '') {
next = series.nodeMap[p];
}
return next;
});
// Children of the root node is by default visible
recursive(this.nodeMap[this.rootNode].children, function(children) {
var next = false;
each(children, function(child) {
child.visible = true;
if (child.children.length) {
next = (next || []).concat(child.children);
}
});
return next;
});
this.setTreeValues(tree);
return tree;
},
init: function(chart, options) {
var series = this;
Series.prototype.init.call(series, chart, options);
if (series.options.allowDrillToNode) {
series.drillTo();
}
},
buildNode: function(id, i, level, list, parent) {
var series = this,
children = [],
point = series.points[i],
node,
child;
// Actions
each((list[id] || []), function(i) {
child = series.buildNode(series.points[i].id, i, (level + 1), list, id);
children.push(child);
});
node = {
id: id,
i: i,
children: children,
level: level,
parent: parent,
visible: false // @todo move this to better location
};
series.nodeMap[node.id] = node;
if (point) {
point.node = node;
}
return node;
},
setTreeValues: function(tree) {
var series = this,
options = series.options,
childrenTotal = 0,
children = [],
val,
point = series.points[tree.i];
// First give the children some values
each(tree.children, function(child) {
child = series.setTreeValues(child);
children.push(child);
if (!child.ignore) {
childrenTotal += child.val;
} else {
// @todo Add predicate to avoid looping already ignored children
recursive(child.children, function(children) {
var next = false;
each(children, function(node) {
extend(node, {
ignore: true,
isLeaf: false,
visible: false
});
if (node.children.length) {
next = (next || []).concat(node.children);
}
});
return next;
});
}
});
// Sort the children
stableSort(children, function(a, b) {
return a.sortIndex - b.sortIndex;
});
// Set the values
val = pick(point && point.options.value, childrenTotal);
if (point) {
point.value = val;
}
extend(tree, {
children: children,
childrenTotal: childrenTotal,
// Ignore this node if point is not visible
ignore: !(pick(point && point.visible, true) && (val > 0)),
isLeaf: tree.visible && !childrenTotal,
levelDynamic: (options.levelIsConstant ? tree.level : (tree.level - series.nodeMap[series.rootNode].level)),
name: pick(point && point.name, ''),
sortIndex: pick(point && point.sortIndex, -val),
val: val
});
return tree;
},
/**
* Recursive function which calculates the area for all children of a node.
* @param {Object} node The node which is parent to the children.
* @param {Object} area The rectangular area of the parent.
*/
calculateChildrenAreas: function(parent, area) {
var series = this,
options = series.options,
level = this.levelMap[parent.levelDynamic + 1],
algorithm = pick((series[level && level.layoutAlgorithm] && level.layoutAlgorithm), options.layoutAlgorithm),
alternate = options.alternateStartingDirection,
childrenValues = [],
children;
// Collect all children which should be included
children = grep(parent.children, function(n) {
return !n.ignore;
});
if (level && level.layoutStartingDirection) {
area.direction = level.layoutStartingDirection === 'vertical' ? 0 : 1;
}
childrenValues = series[algorithm](area, children);
each(children, function(child, index) {
var values = childrenValues[index];
child.values = merge(values, {
val: child.childrenTotal,
direction: (alternate ? 1 - area.direction : area.direction)
});
child.pointValues = merge(values, {
x: (values.x / series.axisRatio),
width: (values.width / series.axisRatio)
});
// If node has children, then call method recursively
if (child.children.length) {
series.calculateChildrenAreas(child, child.values);
}
});
},
setPointValues: function() {
var series = this,
xAxis = series.xAxis,
yAxis = series.yAxis;
each(series.points, function(point) {
var node = point.node,
values = node.pointValues,
x1,
x2,
y1,
y2,
crispCorr = 0.5; // Assume 1px borderWidth for simplicity
// Points which is ignored, have no values.
if (values && node.visible) {
x1 = Math.round(xAxis.translate(values.x, 0, 0, 0, 1)) - crispCorr;
x2 = Math.round(xAxis.translate(values.x + values.width, 0, 0, 0, 1)) - crispCorr;
y1 = Math.round(yAxis.translate(values.y, 0, 0, 0, 1)) - crispCorr;
y2 = Math.round(yAxis.translate(values.y + values.height, 0, 0, 0, 1)) - crispCorr;
// Set point values
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)
};
point.plotX = point.shapeArgs.x + (point.shapeArgs.width / 2);
point.plotY = point.shapeArgs.y + (point.shapeArgs.height / 2);
} else {
// Reset visibility
delete point.plotX;
delete point.plotY;
}
});
},
setColorRecursive: function(node, color, colorIndex) {
var series = this,
point,
level;
if (node) {
point = series.points[node.i];
level = series.levelMap[node.levelDynamic];
// Select either point color, level color or inherited color.
color = pick(point && point.options.color, level && level.color, color);
colorIndex = pick(point && point.options.colorIndex, level && level.colorIndex, colorIndex);
if (point) {
point.color = color;
point.colorIndex = colorIndex;
}
// Do it all again with the children
if (node.children.length) {
each(node.children, function(child) {
series.setColorRecursive(child, color, colorIndex);
});
}
}
},
algorithmGroup: function(h, w, d, p) {
this.height = h;
this.width = w;
this.plot = p;
this.direction = d;
this.startDirection = d;
this.total = 0;
this.nW = 0;
this.lW = 0;
this.nH = 0;
this.lH = 0;
this.elArr = [];
this.lP = {
total: 0,
lH: 0,
nH: 0,
lW: 0,
nW: 0,
nR: 0,
lR: 0,
aspectRatio: function(w, h) {
return Math.max((w / h), (h / w));
}
};
this.addElement = function(el) {
this.lP.total = this.elArr[this.elArr.length - 1];
this.total = this.total + el;
if (this.direction === 0) {
// Calculate last point old aspect ratio
this.lW = this.nW;
this.lP.lH = this.lP.total / this.lW;
this.lP.lR = this.lP.aspectRatio(this.lW, this.lP.lH);
// Calculate last point new aspect ratio
this.nW = this.total / this.height;
this.lP.nH = this.lP.total / this.nW;
this.lP.nR = this.lP.aspectRatio(this.nW, this.lP.nH);
} else {
// Calculate last point old aspect ratio
this.lH = this.nH;
this.lP.lW = this.lP.total / this.lH;
this.lP.lR = this.lP.aspectRatio(this.lP.lW, this.lH);
// Calculate last point new aspect ratio
this.nH = this.total / this.width;
this.lP.nW = this.lP.total / this.nH;
this.lP.nR = this.lP.aspectRatio(this.lP.nW, this.nH);
}
this.elArr.push(el);
};
this.reset = function() {
this.nW = 0;
this.lW = 0;
this.elArr = [];
this.total = 0;
};
},
algorithmCalcPoints: function(directionChange, last, group, childrenArea) {
var pX,
pY,
pW,
pH,
gW = group.lW,
gH = group.lH,
plot = group.plot,
keep,
i = 0,
end = group.elArr.length - 1;
if (last) {
gW = group.nW;
gH = group.nH;
} else {
keep = group.elArr[group.elArr.length - 1];
}
each(group.elArr, function(p) {
if (last || (i < end)) {
if (group.direction === 0) {
pX = plot.x;
pY = plot.y;
pW = gW;
pH = p / pW;
} else {
pX = plot.x;
pY = plot.y;
pH = gH;
pW = p / pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (group.direction === 0) {
plot.y = plot.y + pH;
} else {
plot.x = plot.x + pW;
}
}
i = i + 1;
});
// Reset variables
group.reset();
if (group.direction === 0) {
group.width = group.width - gW;
} else {
group.height = group.height - gH;
}
plot.y = plot.parent.y + (plot.parent.height - group.height);
plot.x = plot.parent.x + (plot.parent.width - group.width);
if (directionChange) {
group.direction = 1 - group.direction;
}
// If not last, then add uncalculated element
if (!last) {
group.addElement(keep);
}
},
algorithmLowAspectRatio: function(directionChange, parent, children) {
var childrenArea = [],
series = this,
pTot,
plot = {
x: parent.x,
y: parent.y,
parent: parent
},
direction = parent.direction,
i = 0,
end = children.length - 1,
group = new this.algorithmGroup(parent.height, parent.width, direction, plot); // eslint-disable-line new-cap
// Loop through and calculate all areas
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
group.addElement(pTot);
if (group.lP.nR > group.lP.lR) {
series.algorithmCalcPoints(directionChange, false, group, childrenArea, plot);
}
// If last child, then calculate all remaining areas
if (i === end) {
series.algorithmCalcPoints(directionChange, true, group, childrenArea, plot);
}
i = i + 1;
});
return childrenArea;
},
algorithmFill: function(directionChange, parent, children) {
var childrenArea = [],
pTot,
direction = parent.direction,
x = parent.x,
y = parent.y,
width = parent.width,
height = parent.height,
pX,
pY,
pW,
pH;
each(children, function(child) {
pTot = (parent.width * parent.height) * (child.val / parent.val);
pX = x;
pY = y;
if (direction === 0) {
pH = height;
pW = pTot / pH;
width = width - pW;
x = x + pW;
} else {
pW = width;
pH = pTot / pW;
height = height - pH;
y = y + pH;
}
childrenArea.push({
x: pX,
y: pY,
width: pW,
height: pH
});
if (directionChange) {
direction = 1 - direction;
}
});
return childrenArea;
},
strip: function(parent, children) {
return this.algorithmLowAspectRatio(false, parent, children);
},
squarified: function(parent, children) {
return this.algorithmLowAspectRatio(true, parent, children);
},
sliceAndDice: function(parent, children) {
return this.algorithmFill(true, parent, children);
},
stripes: function(parent, children) {
return this.algorithmFill(false, parent, children);
},
translate: function() {
var pointValues,
seriesArea,
tree,
val;
// Call prototype function
Series.prototype.translate.call(this);
// Assign variables
this.rootNode = pick(this.options.rootId, '');
// Create a object map from level to options
this.levelMap = reduce(this.options.levels, function(arr, item) {
arr[item.level] = item;
return arr;
}, {});
tree = this.tree = this.getTree(); // @todo Only if series.isDirtyData is true
// Calculate plotting values.
this.axisRatio = (this.xAxis.len / this.yAxis.len);
this.nodeMap[''].pointValues = pointValues = {
x: 0,
y: 0,
width: 100,
height: 100
};
this.nodeMap[''].values = seriesArea = merge(pointValues, {
width: (pointValues.width * this.axisRatio),
direction: (this.options.layoutStartingDirection === 'vertical' ? 0 : 1),
val: tree.val
});
this.calculateChildrenAreas(tree, seriesArea);
// Logic for point colors
if (this.colorAxis) {
this.translateColors();
} else if (!this.options.colorByPoint) {
this.setColorRecursive(this.tree);
}
// Update axis extremes according to the root node.
if (this.options.allowDrillToNode) {
val = this.nodeMap[this.rootNode].pointValues;
this.xAxis.setExtremes(val.x, val.x + val.width, false);
this.yAxis.setExtremes(val.y, val.y + val.height, false);
this.xAxis.setScale();
this.yAxis.setScale();
}
// Assign values to points.
this.setPointValues();
},
/**
* Extend drawDataLabels with logic to handle custom options related to the treemap series:
* - Points which is not a leaf node, has dataLabels disabled by default.
* - Options set on series.levels is merged in.
* - Width of the dataLabel is set to match the width of the point shape.
*/
drawDataLabels: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
}),
options,
level;
each(points, function(point) {
level = series.levelMap[point.node.levelDynamic];
// Set options to new object to avoid problems with scope
options = {
style: {}
};
// If not a leaf, then label should be disabled as default
if (!point.node.isLeaf) {
options.enabled = false;
}
// If options for level exists, include them as well
if (level && level.dataLabels) {
options = merge(options, level.dataLabels);
series._hasPointLabels = true;
}
// Set dataLabel width to the width of the point shape.
if (point.shapeArgs) {
options.style.width = point.shapeArgs.width;
if (point.dataLabel) {
point.dataLabel.css({
width: point.shapeArgs.width + 'px'
});
}
}
// Merge custom options with point options
point.dlOptions = merge(options, point.options.dataLabels);
});
Series.prototype.drawDataLabels.call(this);
},
/**
* Over the alignment method by setting z index
*/
alignDataLabel: function(point) {
seriesTypes.column.prototype.alignDataLabel.apply(this, arguments);
if (point.dataLabel) {
point.dataLabel.attr({
zIndex: point.node.zIndex + 1
});
}
},
/**
* Get presentational attributes
*/
pointAttribs: function(point, state) {
var level = this.levelMap[point.node.levelDynamic] || {},
options = this.options,
attr,
stateOptions = (state && options.states[state]) || {},
className = point.getClassName(),
opacity;
// Set attributes by precedence. Point trumps level trumps series. Stroke width uses pick
// because it can be 0.
attr = {
'stroke': point.borderColor || level.borderColor || stateOptions.borderColor || options.borderColor,
'stroke-width': pick(point.borderWidth, level.borderWidth, stateOptions.borderWidth, options.borderWidth),
'dashstyle': point.borderDashStyle || level.borderDashStyle || stateOptions.borderDashStyle || options.borderDashStyle,
'fill': point.color || this.color
};
// Hide levels above the current view
if (className.indexOf('highcharts-above-level') !== -1) {
attr.fill = 'none';
attr['stroke-width'] = 0;
// Nodes with children that accept interaction
} else if (className.indexOf('highcharts-internal-node-interactive') !== -1) {
opacity = pick(stateOptions.opacity, options.opacity);
attr.fill = color(attr.fill).setOpacity(opacity).get();
attr.cursor = 'pointer';
// Hide nodes that have children
} else if (className.indexOf('highcharts-internal-node') !== -1) {
attr.fill = 'none';
} else if (state) {
// Brighten and hoist the hover nodes
attr.fill = color(attr.fill).brighten(stateOptions.brightness).get();
}
return attr;
},
/**
* Extending ColumnSeries drawPoints
*/
drawPoints: function() {
var series = this,
points = grep(series.points, function(n) {
return n.node.visible;
});
each(points, function(point) {
var groupKey = 'levelGroup-' + point.node.levelDynamic;
if (!series[groupKey]) {
series[groupKey] = series.chart.renderer.g(groupKey)
.attr({
zIndex: 1000 - point.node.levelDynamic // @todo Set the zIndex based upon the number of levels, instead of using 1000
})
.add(series.group);
}
point.group = series[groupKey];
});
// Call standard drawPoints
seriesTypes.column.prototype.drawPoints.call(this);
// If drillToNode is allowed, set a point cursor on clickables & add drillId to point
if (series.options.allowDrillToNode) {
each(points, function(point) {
if (point.graphic) {
point.drillId = series.options.interactByLeaf ? series.drillToByLeaf(point) : series.drillToByGroup(point);
}
});
}
},
/**
* Add drilling on the suitable points
*/
drillTo: function() {
var series = this;
H.addEvent(series, 'click', function(event) {
var point = event.point,
drillId = point.drillId,
drillName;
// If a drill id is returned, add click event and cursor.
if (drillId) {
drillName = series.nodeMap[series.rootNode].name || series.rootNode;
point.setState(''); // Remove hover
series.drillToNode(drillId);
series.showDrillUpButton(drillName);
}
});
},
/**
* Finds the drill id for a parent node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByGroup: function(point) {
var series = this,
drillId = false;
if ((point.node.level - series.nodeMap[series.rootNode].level) === 1 && !point.node.isLeaf) {
drillId = point.id;
}
return drillId;
},
/**
* Finds the drill id for a leaf node.
* Returns false if point should not have a click event
* @param {Object} point
* @return {string || boolean} Drill to id or false when point should not have a click event
*/
drillToByLeaf: function(point) {
var series = this,
drillId = false,
nodeParent;
if ((point.node.parent !== series.rootNode) && (point.node.isLeaf)) {
nodeParent = point.node;
while (!drillId) {
nodeParent = series.nodeMap[nodeParent.parent];
if (nodeParent.parent === series.rootNode) {
drillId = nodeParent.id;
}
}
}
return drillId;
},
drillUp: function() {
var drillPoint = null,
node,
parent;
if (this.rootNode) {
node = this.nodeMap[this.rootNode];
if (node.parent !== null) {
drillPoint = this.nodeMap[node.parent];
} else {
drillPoint = this.nodeMap[''];
}
}
if (drillPoint !== null) {
this.drillToNode(drillPoint.id);
if (drillPoint.id === '') {
this.drillUpButton = this.drillUpButton.destroy();
} else {
parent = this.nodeMap[drillPoint.parent];
this.showDrillUpButton((parent.name || parent.id));
}
}
},
drillToNode: function(id) {
this.options.rootId = id;
this.isDirty = true; // Force redraw
this.chart.redraw();
},
showDrillUpButton: function(name) {
var series = this,
backText = (name || '< Back'),
buttonOptions = series.options.drillUpButton,
attr,
states;
if (buttonOptions.text) {
backText = buttonOptions.text;
}
if (!this.drillUpButton) {
attr = buttonOptions.theme;
states = attr && attr.states;
this.drillUpButton = this.chart.renderer.button(
backText,
null,
null,
function() {
series.drillUp();
},
attr,
states && states.hover,
states && states.select
)
.attr({
align: buttonOptions.position.align,
zIndex: 7
})
.add()
.align(buttonOptions.position, false, buttonOptions.relativeTo || 'plotBox');
} else {
this.drillUpButton.attr({
text: backText
})
.align();
}
},
buildKDTree: noop,
drawLegendSymbol: H.LegendSymbolMixin.drawRectangle,
getExtremes: function() {
// Get the extremes from the value data
Series.prototype.getExtremes.call(this, this.colorValueData);
this.valueMin = this.dataMin;
this.valueMax = this.dataMax;
// Get the extremes from the y data
Series.prototype.getExtremes.call(this);
},
getExtremesFromAll: true,
bindAxes: function() {
var treeAxis = {
endOnTick: false,
gridLineWidth: 0,
lineWidth: 0,
min: 0,
dataMin: 0,
minPadding: 0,
max: 100,
dataMax: 100,
maxPadding: 0,
startOnTick: false,
title: null,
tickPositions: []
};
Series.prototype.bindAxes.call(this);
H.extend(this.yAxis.options, treeAxis);
H.extend(this.xAxis.options, treeAxis);
}
// Point class
}, {
getClassName: function() {
var className = H.Point.prototype.getClassName.call(this),
series = this.series,
options = series.options;
// Above the current level
if (this.node.level <= series.nodeMap[series.rootNode].level) {
className += ' highcharts-above-level';
} else if (!this.node.isLeaf && !pick(options.interactByLeaf, !options.allowDrillToNode)) {
className += ' highcharts-internal-node-interactive';
} else if (!this.node.isLeaf) {
className += ' highcharts-internal-node';
}
return className;
},
setState: function(state) {
H.Point.prototype.setState.call(this, state);
this.graphic.attr({
zIndex: state === 'hover' ? 1 : 0
});
},
setVisible: seriesTypes.pie.prototype.pointClass.prototype.setVisible
});
}(Highcharts));
}));

View File

@@ -0,0 +1,317 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,314 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark blue theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,243 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Dark theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,326 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Gray theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,99 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid-light theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,131 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Grid theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));

View File

@@ -0,0 +1,129 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Sand-Signika theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
/* global document */
// Load the fonts
Highcharts.createElement('link', {
href: 'https://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);
}(Highcharts));
}));

View File

@@ -0,0 +1,112 @@
/**
* @license Highcharts JS v5.0.0 (2016-09-29)
*
* (c) 2009-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*/
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(Highcharts) {
/**
* (c) 2010-2016 Torstein Honsi
*
* License: www.highcharts.com/license
*
* Skies theme for Highcharts JS
* @author Torstein Honsi
*/
'use strict';
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
Highcharts.setOptions(Highcharts.theme);
}(Highcharts));
}));