Code

Switch from Highcharts to Rickshaw, which is MIT / BSD licensed.
authorFlorian Forster <octo@verplant.org>
Wed, 20 Feb 2013 15:14:18 +0000 (16:14 +0100)
committerFlorian Forster <octo@verplant.org>
Wed, 20 Feb 2013 15:14:18 +0000 (16:14 +0100)
README
share/Makefile.am
share/collection.js
share/d3.min.js [new file with mode: 0644]
share/highcharts.js [deleted file]
share/rickshaw.min.css [new file with mode: 0644]
share/rickshaw.min.js [new file with mode: 0644]
src/utils_cgi.c

diff --git a/README b/README
index a88ebdc67fba0e532cbf0dad57a1498cf6186266..640960cba3c8183b6c19cbc9673b0b4565f9e2a9 100644 (file)
--- a/README
+++ b/README
@@ -109,12 +109,13 @@ License
   MIT license and the GPL. The file "share/jquery-1.4.4.min.js" includes a
   license header which points you to more detailed information.
 
-  c4 includes the JavaScript library "Highcharts" which is licensed under the
-  Creative Commons Attribution-NonCommercial 3.0 License (CC-by-nc 3.0). This
-  means that the library is free of charge for non-commercial use. The file
-  "share/highcharts.js" includes a license header which points you to more
-  detailed information. More information on Highcharts and licensing options is
-  available from <http://www.highcharts.com/>.
+  c4 includes the JavaScript library "D3.js" which is licensed under the
+  3-clause BSD license. More information on D3.js is available from
+  <http://d3js.org/>.
+
+  c4 includes the JavaScript library "Rickshaw" which is licensed under the
+  MIT license. More information on Rickshaw is available from
+  <http://code.shutterstock.com/rickshaw/>.
 
 
 Author
index ce08502ab970aa24370c67b43376d6841e6eb72b..16867430df693f3d19d9489f4431edbbc3bfa085 100644 (file)
@@ -3,4 +3,6 @@ dist_sysconf_DATA = collection.conf
 dist_pkgdata_DATA = style.css \
                 collection.js \
                 jquery-1.4.4.min.js \
-                highcharts.js
+                d3.min.js \
+                rickshaw.min.css \
+                rickshaw.min.js
index e1764acb12b828c74d36f8f121f3fd218542164e..e1a6a2255be5b5114a775118627f094f1151e864 100644 (file)
@@ -274,116 +274,102 @@ function def_draw (def, data_list, series_array) /* {{{ */
   }
 } /* }}} function def_draw */
 
-function inst_get_chart_opts (inst, def) /* {{{ */
+/*
+ * Given one metric definition, returns the appropriate data from the data
+ * list. */
+function def_get_data (def, data_list)
 {
-  var chart_opts = new Object ();
+  var i;
 
-  chart_opts.chart =
-  {
-    renderTo: inst.container,
-    zoomType: 'x'
-  };
-  chart_opts.xAxis =
-  {
-    type: 'datetime',
-    maxZoom: 300, // five minutes
-    title: { text: null },
-    events:
-    {
-      setExtremes: function (event)
-      {
-        var begin = null;
-        var end   = null;
-
-        if ((event.min) && (event.max))
-        {
-          begin = event.min / 1000.0;
-          end   = event.max / 1000.0;
-        }
-        inst_fetch_data (inst, begin, end);
-      }
-    }
-  };
-  chart_opts.yAxis =
+  for (i = 0; i < data_list.length; i++)
   {
-    labels:
-    {
-      formatter: function () { return (value_to_string (this.value)); }
-    },
-    startOnTick: false,
-    endOnTick: false
+    if ((def.ds_name) && (def.ds_name != data_list[i].data_source))
+      continue;
+    if (!ident_matches (def.select, data_list[i].file))
+      continue;
+
+    return (data_list[i]);
+  }
+  return;
+}
+
+function def_to_rickshaw_one (def, data)
+{
+  var series = {
+    data: []
   };
-  chart_opts.legend =
-  {
-    labelFormatter: function ()
-    {
-      var series = this;
-      var min = Number.MAX_VALUE;
-      var max = Number.NEGATIVE_INFINITY;
-      var num = 0;
-      var sum = 0;
-      var avg;
-      var i;
+  var i;
 
-      for (i = 0; i < this.data.length; i++)
-      {
-        var v;
+  if (def.legend)
+    series.name = def.legend;
 
-        v = this.data[i].y;
-        if (v == null)
-          continue;
+  if (def.color)
+    series.color = def.color;
 
-        if (min > v)
-          min = v;
-        if (max < v)
-          max = v;
+  for (i = 0; i < data.data.length; i++)
+  {
+    var x = data.first_value_time + (i * data.interval);
+    var y = data.data[i];
 
-        sum += v;
-        num++;
-      }
+    series.data.push ({'x': x, 'y': y});
+  }
 
-      if (num == 0)
-      {
-        min = null;
-        max = null;
-        avg = null;
-      }
-      else
-      {
-        avg = sum / num;
-      }
+  return (series);
+}
 
-      return (this.name + " (" + value_to_string (min) + " min, "
-          + value_to_string (avg) + " avg, "
-          + value_to_string (max) + " max)");
-    }
+function def_to_rickshaw (graph_def, data_list)
+{
+  var graph_config = {
+      renderer: 'line',
+      series: []
   };
-  chart_opts.series = new Array ();
+  var graph;
+  var i;
 
-  if (def.title)
-    chart_opts.title = { text: def.title };
+  for (i = 0; i < graph_def.defs.length; i++)
+  {
+    var def = graph_def.defs[i];
+    var data = def_get_data (def, data_list);
+    var series;
 
-  if (def.vertical_label)
-    chart_opts.yAxis.title = { text: def.vertical_label };
+    if (!data)
+      continue;
 
-  return (chart_opts);
-} /* }}} function chart_opts_get */
+    series = def_to_rickshaw_one (def, data);
+    if (series)
+      graph_config.series.push (series);
 
-function inst_draw (inst, def, data_list) /* {{{ */
+    //if (def.area)
+    //  graph_config.renderer = 'area';
+  }
+
+  return (graph_config);
+}
+
+function inst_draw_rickshaw (inst, def, data_list)
 {
-  var chart_opts;
-  var i;
+  var graph_config = def_to_rickshaw (def, data_list);
 
-  if (!inst || !def || !data_list)
-    return;
+  graph_config.element = document.getElementById (inst.container);
 
-  chart_opts = inst_get_chart_opts (inst, def);
+  inst.chart = new Rickshaw.Graph (graph_config);
+  inst.chart.render ();
 
-  for (i = def.defs.length - 1; i >= 0; i--)
-    def_draw (def.defs[i], data_list, chart_opts.series);
+  var x_axis = new Rickshaw.Graph.Axis.Time({
+    graph: inst.chart
+  });
+  x_axis.render ();
+
+  var y_axis = new Rickshaw.Graph.Axis.Y({
+    graph: inst.chart
+  });
+  y_axis.render ();
+}
 
-  inst.chart = new Highcharts.Chart (chart_opts);
-} /* }}} function inst_draw */
+function inst_draw (inst, def, data_list)
+{
+  inst_draw_rickshaw (inst, def, data_list);
+}
 
 function inst_redraw (inst, def, data_list) /* {{{ */
 {
diff --git a/share/d3.min.js b/share/d3.min.js
new file mode 100644 (file)
index 0000000..9a9af75
--- /dev/null
@@ -0,0 +1,2 @@
+(function(){function e(a){var b=-1,c=a.length,d=[];while(++b<c)d.push(a[b]);return d}function f(a){return Array.prototype.slice.call(a)}function i(){return this}function j(a){return a!=null&&!isNaN(a)}function k(a){return a.length}function l(a){return a==null}function m(a){return a.replace(/(^\s+)|(\s+$)/g,"").replace(/\s+/g," ")}function o(){}function p(){function c(){var b=a,c=-1,d=b.length,e;while(++c<d)(e=b[c])._on&&e.apply(this,arguments)}var a=[],b={};return c.on=function(d,e){var f,g;if(f=b[d])f._on=!1,a=a.slice(0,g=a.indexOf(f)).concat(a.slice(g+1)),delete b[d];return e&&(e._on=!0,a.push(e),b[d]=e),c},c}function s(a,b){return b-(a?1+Math.floor(Math.log(a+Math.pow(10,1+Math.floor(Math.log(a)/Math.LN10)-b))/Math.LN10):1)}function t(a){return a+""}function u(a){var b=a.lastIndexOf("."),c=b>=0?a.substring(b):(b=a.length,""),d=[];while(b>0)d.push(a.substring(b-=3,b+3));return d.reverse().join(",")+c}function w(a,b){return{scale:Math.pow(10,(8-b)*3),symbol:a}}function B(a){return function(b){return b<=0?0:b>=1?1:a(b)}}function C(a){return function(b){return 1-a(1-b)}}function D(a){return function(b){return.5*(b<.5?a(2*b):2-a(2-2*b))}}function E(a){return a}function F(a){return function(b){return Math.pow(b,a)}}function G(a){return 1-Math.cos(a*Math.PI/2)}function H(a){return Math.pow(2,10*(a-1))}function I(a){return 1-Math.sqrt(1-a*a)}function J(a,b){var c;return arguments.length<2&&(b=.45),arguments.length<1?(a=1,c=b/4):c=b/(2*Math.PI)*Math.asin(1/a),function(d){return 1+a*Math.pow(2,10*-d)*Math.sin((d-c)*2*Math.PI/b)}}function K(a){return a||(a=1.70158),function(b){return b*b*((a+1)*b-a)}}function L(a){return a<1/2.75?7.5625*a*a:a<2/2.75?7.5625*(a-=1.5/2.75)*a+.75:a<2.5/2.75?7.5625*(a-=2.25/2.75)*a+.9375:7.5625*(a-=2.625/2.75)*a+.984375}function M(){d3.event.stopPropagation(),d3.event.preventDefault()}function O(a){return a=="transform"?d3.interpolateTransform:d3.interpolate}function P(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return(c-a)*b}}function Q(a,b){return b=b-(a=+a)?1/(b-a):0,function(c){return Math.max(0,Math.min(1,(c-a)*b))}}function R(a,b,c){return new S(a,b,c)}function S(a,b,c){this.r=a,this.g=b,this.b=c}function T(a){return a<16?"0"+Math.max(0,a).toString(16):Math.min(255,a).toString(16)}function U(a,b,c){var d=0,e=0,f=0,g,h,i;g=/([a-z]+)\((.*)\)/i.exec(a);if(g){h=g[2].split(",");switch(g[1]){case"hsl":return c(parseFloat(h[0]),parseFloat(h[1])/100,parseFloat(h[2])/100);case"rgb":return b(W(h[0]),W(h[1]),W(h[2]))}}return(i=X[a])?b(i.r,i.g,i.b):(a!=null&&a.charAt(0)==="#"&&(a.length===4?(d=a.charAt(1),d+=d,e=a.charAt(2),e+=e,f=a.charAt(3),f+=f):a.length===7&&(d=a.substring(1,3),e=a.substring(3,5),f=a.substring(5,7)),d=parseInt(d,16),e=parseInt(e,16),f=parseInt(f,16)),b(d,e,f))}function V(a,b,c){var d=Math.min(a/=255,b/=255,c/=255),e=Math.max(a,b,c),f=e-d,g,h,i=(e+d)/2;return f?(h=i<.5?f/(e+d):f/(2-e-d),a==e?g=(b-c)/f+(b<c?6:0):b==e?g=(c-a)/f+2:g=(a-b)/f+4,g*=60):h=g=0,Z(g,h,i)}function W(a){var b=parseFloat(a);return a.charAt(a.length-1)==="%"?Math.round(b*2.55):b}function Z(a,b,c){return new $(a,b,c)}function $(a,b,c){this.h=a,this.s=b,this.l=c}function _(a,b,c){function f(a){return a>360?a-=360:a<0&&(a+=360),a<60?d+(e-d)*a/60:a<180?e:a<240?d+(e-d)*(240-a)/60:d}function g(a){return Math.round(f(a)*255)}var d,e;return a%=360,a<0&&(a+=360),b=b<0?0:b>1?1:b,c=c<0?0:c>1?1:c,e=c<=.5?c*(1+b):c+b-c*b,d=2*c-e,R(g(a+120),g(a),g(a-120))}function ba(a){return h(a,bd),a}function be(a){return function(){return bb(a,this)}}function bf(a){return function(){return bc(a,this)}}function bh(a,b){function f(){if(b=this.classList)return b.add(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;c.lastIndex=0,c.test(e)||(e=m(e+" "+a),d?b.baseVal=e:this.className=e)}function g(){if(b=this.classList)return b.remove(a);var b=this.className,d=b.baseVal!=null,e=d?b.baseVal:b;e=m(e.replace(c," ")),d?b.baseVal=e:this.className=e}function h(){(b.apply(this,arguments)?f:g).call(this)}var c=new RegExp("(^|\\s+)"+d3.requote(a)+"(\\s+|$)","g");if(arguments.length<2){var d=this.node();if(e=d.classList)return e.contains(a);var e=d.className;return c.lastIndex=0,c.test(e.baseVal!=null?e.baseVal:e)}return this.each(typeof b=="function"?h:b?f:g)}function bi(a){return{__data__:a}}function bj(a){return arguments.length||(a=d3.ascending),function(b,c){return a(b&&b.__data__,c&&c.__data__)}}function bl(a){return h(a,bm),a}function bn(a,b,c){h(a,br);var d={},e=d3.dispatch("start","end"),f=bu;return a.id=b,a.time=c,a.tween=function(b,c){return arguments.length<2?d[b]:(c==null?delete d[b]:d[b]=c,a)},a.ease=function(b){return arguments.length?(f=typeof b=="function"?b:d3.ease.apply(d3,arguments),a):f},a.each=function(b,c){return arguments.length<2?bv.call(a,b):(e.on(b,c),a)},d3.timer(function(g){return a.each(function(h,i,j){function p(a){if(o.active>b)return r();o.active=b;for(var f in d)(f=d[f].call(l,h,i))&&k.push(f);return e.start.call(l,h,i),q(a)||d3.timer(q,0,c),1}function q(a){if(o.active!==b)return r();var c=(a-m)/n,d=f(c),g=k.length;while(g>0)k[--g].call(l,d);if(c>=1)return r(),bt=b,e.end.call(l,h,i),bt=0,1}function r(){return--o.count||delete l.__transition__,1}var k=[],l=this,m=a[j][i].delay,n=a[j][i].duration,o=l.__transition__||(l.__transition__={active:0,count:0});++o.count,m<=g?p(g):d3.timer(p,m,c)}),1},0,c),a}function bp(a,b,c){return c!=""&&bo}function bq(a,b){function d(a,d,e){var f=b.call(this,a,d);return f==null?e!=""&&bo:e!=f&&c(e,f)}function e(a,d,e){return e!=b&&c(e,b)}var c=O(a);return typeof b=="function"?d:b==null?bp:(b+="",e)}function bv(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];g&&a.call(g=g.node,g.__data__,e,b)}return this}function bz(){var a,b=Date.now(),c=bw;while(c)a=b-c.then,a>=c.delay&&(c.flush=c.callback(a)),c=c.next;var d=bA()-b;d>24?(isFinite(d)&&(clearTimeout(by),by=setTimeout(bz,d)),bx=0):(bx=1,bB(bz))}function bA(){var a=null,b=bw,c=Infinity;while(b)b.flush?b=a?a.next=b.next:bw=b.next:(c=Math.min(c,b.then+b.delay),b=(a=b).next);return c}function bC(a){var b=[a.a,a.b],c=[a.c,a.d],d=bE(b),e=bD(b,c),f=bE(bF(c,b,-e));this.translate=[a.e,a.f],this.rotate=Math.atan2(a.b,a.a)*bH,this.scale=[d,f||0],this.skew=f?e/f*bH:0}function bD(a,b){return a[0]*b[0]+a[1]*b[1]}function bE(a){var b=Math.sqrt(bD(a,a));return a[0]/=b,a[1]/=b,b}function bF(a,b,c){return a[0]+=c*b[0],a[1]+=c*b[1],a}function bI(){}function bJ(a){var b=a[0],c=a[a.length-1];return b<c?[b,c]:[c,b]}function bK(a,b){var c=0,d=a.length-1,e=a[c],f=a[d],g;f<e&&(g=c,c=d,d=g,g=e,e=f,f=g);if(g=f-e)b=b(g),a[c]=b.floor(e),a[d]=b.ceil(f);return a}function bL(){return Math}function bM(a,b,c,d){function g(){var g=a.length==2?bS:bT,i=d?Q:P;return e=g(a,b,i,c),f=g(b,a,i,d3.interpolate),h}function h(a){return e(a)}var e,f;return h.invert=function(a){return f(a)},h.domain=function(b){return arguments.length?(a=b.map(Number),g()):a},h.range=function(a){return arguments.length?(b=a,g()):b},h.rangeRound=function(a){return h.range(a).interpolate(d3.interpolateRound)},h.clamp=function(a){return arguments.length?(d=a,g()):d},h.interpolate=function(a){return arguments.length?(c=a,g()):c},h.ticks=function(b){return bQ(a,b)},h.tickFormat=function(b){return bR(a,b)},h.nice=function(){return bK(a,bO),g()},h.copy=function(){return bM(a,b,c,d)},g()}function bN(a,b){return a.range=d3.rebind(a,b.range),a.rangeRound=d3.rebind(a,b.rangeRound),a.interpolate=d3.rebind(a,b.interpolate),a.clamp=d3.rebind(a,b.clamp),a}function bO(a){return a=Math.pow(10,Math.round(Math.log(a)/Math.LN10)-1),{floor:function(b){return Math.floor(b/a)*a},ceil:function(b){return Math.ceil(b/a)*a}}}function bP(a,b){var c=bJ(a),d=c[1]-c[0],e=Math.pow(10,Math.floor(Math.log(d/b)/Math.LN10)),f=b/d*e;return f<=.15?e*=10:f<=.35?e*=5:f<=.75&&(e*=2),c[0]=Math.ceil(c[0]/e)*e,c[1]=Math.floor(c[1]/e)*e+e*.5,c[2]=e,c}function bQ(a,b){return d3.range.apply(d3,bP(a,b))}function bR(a,b){return d3.format(",."+Math.max(0,-Math.floor(Math.log(bP(a,b)[2])/Math.LN10+.01))+"f")}function bS(a,b,c,d){var e=c(a[0],a[1]),f=d(b[0],b[1]);return function(a){return f(e(a))}}function bT(a,b,c,d){var e=[],f=[],g=0,h=a.length;while(++g<h)e.push(c(a[g-1],a[g])),f.push(d(b[g-1],b[g]));return function(b){var c=d3.bisect(a,b,1,a.length-1)-1;return f[c](e[c](b))}}function bU(a,b){function d(c){return a(b(c))}var c=b.pow;return d.invert=function(b){return c(a.invert(b))},d.domain=function(e){return arguments.length?(b=e[0]<0?bX:bW,c=b.pow,a.domain(e.map(b)),d):a.domain().map(c)},d.nice=function(){return a.domain(bK(a.domain(),bL)),d},d.ticks=function(){var d=bJ(a.domain()),e=[];if(d.every(isFinite)){var f=Math.floor(d[0]),g=Math.ceil(d[1]),h=Math.round(c(d[0])),i=Math.round(c(d[1]));if(b===bX){e.push(c(f));for(;f++<g;)for(var j=9;j>0;j--)e.push(c(f)*j)}else{for(;f<g;f++)for(var j=1;j<10;j++)e.push(c(f)*j);e.push(c(f))}for(f=0;e[f]<h;f++);for(g=e.length;e[g-1]>i;g--);e=e.slice(f,g)}return e},d.tickFormat=function(a,e){arguments.length<2&&(e=bV);if(arguments.length<1)return e;var f=a/d.ticks().length,g=b===bX?(h=-1e-15,Math.floor):(h=1e-15,Math.ceil),h;return function(a){return a/c(g(b(a)+h))<f?e(a):""}},d.copy=function(){return bU(a.copy(),b)},bN(d,a)}function bW(a){return Math.log(a)/Math.LN10}function bX(a){return-Math.log(-a)/Math.LN10}function bY(a,b){function e(b){return a(c(b))}var c=bZ(b),d=bZ(1/b);return e.invert=function(b){return d(a.invert(b))},e.domain=function(b){return arguments.length?(a.domain(b.map(c)),e):a.domain().map(d)},e.ticks=function(a){return bQ(e.domain(),a)},e.tickFormat=function(a){return bR(e.domain(),a)},e.nice=function(){return e.domain(bK(e.domain(),bO))},e.exponent=function(a){if(!arguments.length)return b;var f=e.domain();return c=bZ(b=a),d=bZ(1/b),e.domain(f)},e.copy=function(){return bY(a.copy(),b)},bN(e,a)}function bZ(a){return function(b){return b<0?-Math.pow(-b,a):Math.pow(b,a)}}function b$(a,b){function f(b){return d[((c[b]||(c[b]=a.push(b)))-1)%d.length]}function g(b,c){return d3.range(a.length).map(function(a){return b+c*a})}var c,d,e;return f.domain=function(d){if(!arguments.length)return a;a=[],c={};var e=-1,g=d.length,h;while(++e<g)c[h=d[e]]||(c[h]=a.push(h));return f[b.t](b.x,b.p)},f.range=function(a){return arguments.length?(d=a,e=0,b={t:"range",x:a},f):d},f.rangePoints=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length-1+h);return d=g(a.length<2?(i+j)/2:i+k*h/2,k),e=0,b={t:"rangePoints",x:c,p:h},f},f.rangeBands=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=(j-i)/(a.length+h);return d=g(i+k*h,k),e=k*(1-h),b={t:"rangeBands",x:c,p:h},f},f.rangeRoundBands=function(c,h){arguments.length<2&&(h=0);var i=c[0],j=c[1],k=Math.floor((j-i)/(a.length+h));return d=g(i+Math.round((j-i-(a.length-h)*k)/2),k),e=Math.round(k*(1-h)),b={t:"rangeRoundBands",x:c,p:h},f},f.rangeBand=function(){return e},f.copy=function(){return b$(a,b)},f.domain(a)}function cd(a,b){function d(){var d=0,f=a.length,g=b.length;c=[];while(++d<g)c[d-1]=d3.quantile(a,d/g);return e}function e(a){return isNaN(a=+a)?NaN:b[d3.bisect(c,a)]}var c;return e.domain=function(b){return arguments.length?(a=b.filter(function(a){return!isNaN(a)}).sort(d3.ascending),d()):a},e.range=function(a){return arguments.length?(b=a,d()):b},e.quantiles=function(){return c},e.copy=function(){return cd(a,b)},d()}function ce(a,b,c){function f(b){return c[Math.max(0,Math.min(e,Math.floor(d*(b-a))))]}function g(){return d=c.length/(b-a),e=c.length-1,f}var d,e;return f.domain=function(c){return arguments.length?(a=+c[0],b=+c[c.length-1],g()):[a,b]},f.range=function(a){return arguments.length?(c=a,g()):c},f.copy=function(){return ce(a,b,c)},g()}function ch(a){return a.innerRadius}function ci(a){return a.outerRadius}function cj(a){return a.startAngle}function ck(a){return a.endAngle}function cl(a){function g(d){return d.length<1?null:"M"+e(a(cm(this,d,b,c)),f)}var b=cn,c=co,d="linear",e=cp[d],f=.7;return g.x=function(a){return arguments.length?(b=a,g):b},g.y=function(a){return arguments.length?(c=a,g):c},g.interpolate=function(a){return arguments.length?(e=cp[d=a],g):d},g.tension=function(a){return arguments.length?(f=a,g):f},g}function cm(a,b,c,d){var e=[],f=-1,g=b.length,h=typeof c=="function",i=typeof d=="function",j;if(h&&i)while(++f<g)e.push([c.call(a,j=b[f],f),d.call(a,j,f)]);else if(h)while(++f<g)e.push([c.call(a,b[f],f),d]);else if(i)while(++f<g)e.push([c,d.call(a,b[f],f)]);else while(++f<g)e.push([c,d]);return e}function cn(a){return a[0]}function co(a){return a[1]}function cq(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("L",(d=a[b])[0],",",d[1]);return e.join("")}function cr(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("V",(d=a[b])[1],"H",d[0]);return e.join("")}function cs(a){var b=0,c=a.length,d=a[0],e=[d[0],",",d[1]];while(++b<c)e.push("H",(d=a[b])[0],"V",d[1]);return e.join("")}function ct(a,b){return a.length<4?cq(a):a[1]+cw(a.slice(1,a.length-1),cx(a,b))}function cu(a,b){return a.length<3?cq(a):a[0]+cw((a.push(a[0]),a),cx([a[a.length-2]].concat(a,[a[1]]),b))}function cv(a,b,c){return a.length<3?cq(a):a[0]+cw(a,cx(a,b))}function cw(a,b){if(b.length<1||a.length!=b.length&&a.length!=b.length+2)return cq(a);var c=a.length!=b.length,d="",e=a[0],f=a[1],g=b[0],h=g,i=1;c&&(d+="Q"+(f[0]-g[0]*2/3)+","+(f[1]-g[1]*2/3)+","+f[0]+","+f[1],e=a[1],i=2);if(b.length>1){h=b[1],f=a[i],i++,d+="C"+(e[0]+g[0])+","+(e[1]+g[1])+","+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1];for(var j=2;j<b.length;j++,i++)f=a[i],h=b[j],d+="S"+(f[0]-h[0])+","+(f[1]-h[1])+","+f[0]+","+f[1]}if(c){var k=a[i];d+="Q"+(f[0]+h[0]*2/3)+","+(f[1]+h[1]*2/3)+","+k[0]+","+k[1]}return d}function cx(a,b){var c=[],d=(1-b)/2,e,f=a[0],g=a[1],h=1,i=a.length;while(++h<i)e=f,f=g,g=a[h],c.push([d*(g[0]-e[0]),d*(g[1]-e[1])]);return c}function cy(a){if(a.length<3)return cq(a);var b=1,c=a.length,d=a[0],e=d[0],f=d[1],g=[e,e,e,(d=a[1])[0]],h=[f,f,f,d[1]],i=[e,",",f];cG(i,g,h);while(++b<c)d=a[b],g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cG(i,g,h);b=-1;while(++b<2)g.shift(),g.push(d[0]),h.shift(),h.push(d[1]),cG(i,g,h);return i.join("")}function cz(a){if(a.length<4)return cq(a);var b=[],c=-1,d=a.length,e,f=[0],g=[0];while(++c<3)e=a[c],f.push(e[0]),g.push(e[1]);b.push(cC(cF,f)+","+cC(cF,g)),--c;while(++c<d)e=a[c],f.shift(),f.push(e[0]),g.shift(),g.push(e[1]),cG(b,f,g);return b.join("")}function cA(a){var b,c=-1,d=a.length,e=d+4,f,g=[],h=[];while(++c<4)f=a[c%d],g.push(f[0]),h.push(f[1]);b=[cC(cF,g),",",cC(cF,h)],--c;while(++c<e)f=a[c%d],g.shift(),g.push(f[0]),h.shift(),h.push(f[1]),cG(b,g,h);return b.join("")}function cB(a,b){var c=a.length-1,d=a[0][0],e=a[0][1],f=a[c][0]-d,g=a[c][1]-e,h=-1,i,j;while(++h<=c)i=a[h],j=h/c,i[0]=b*i[0]+(1-b)*(d+j*f),i[1]=b*i[1]+(1-b)*(e+j*g);return cy(a)}function cC(a,b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3]}function cG(a,b,c){a.push("C",cC(cD,b),",",cC(cD,c),",",cC(cE,b),",",cC(cE,c),",",cC(cF,b),",",cC(cF,c))}function cH(a,b){return(b[1]-a[1])/(b[0]-a[0])}function cI(a){var b=0,c=a.length-1,d=[],e=a[0],f=a[1],g=d[0]=cH(e,f);while(++b<c)d[b]=g+(g=cH(e=f,f=a[b+1]));return d[b]=g,d}function cJ(a){var b=[],c,d,e,f,g=cI(a),h=-1,i=a.length-1;while(++h<i)c=cH(a[h],a[h+1]),Math.abs(c)<1e-6?g[h]=g[h+1]=0:(d=g[h]/c,e=g[h+1]/c,f=d*d+e*e,f>9&&(f=c*3/Math.sqrt(f),g[h]=f*d,g[h+1]=f*e));h=-1;while(++h<=i)f=(a[Math.min(i,h+1)][0]-a[Math.max(0,h-1)][0])/(6*(1+g[h]*g[h])),b.push([f||0,g[h]*f||0]);return b}function cK(a){return a.length<3?cq(a):a[0]+cw(a,cJ(a))}function cL(a){var b,c=-1,d=a.length,e,f;while(++c<d)b=a[c],e=b[0],f=b[1]+cf,b[0]=e*Math.cos(f),b[1]=e*Math.sin(f);return a}function cM(a){function j(f){if(f.length<1)return null;var j=cm(this,f,b,d),k=cm(this,f,b===c?cN(j):c,d===e?cO(j):e);return"M"+g(a(k),i)+"L"+h(a(j.reverse()),i)+"Z"}var b=cn,c=cn,d=0,e=co,f,g,h,i=.7;return j.x=function(a){return arguments.length?(b=c=a,j):c},j.x0=function(a){return arguments.length?(b=a,j):b},j.x1=function(a){return arguments.length?(c=a,j):c},j.y=function(a){return arguments.length?(d=e=a,j):e},j.y0=function(a){return arguments.length?(d=a,j):d},j.y1=function(a){return arguments.length?(e=a,j):e},j.interpolate=function(a){return arguments.length?(g=cp[f=a],h=g.reverse||g,j):f},j.tension=function(a){return arguments.length?(i=a,j):i},j.interpolate("linear")}function cN(a){return function(b,c){return a[c][0]}}function cO(a){return function(b,c){return a[c][1]}}function cP(a){return a.source}function cQ(a){return a.target}function cR(a){return a.radius}function cS(a){return a.startAngle}function cT(a){return a.endAngle}function cU(a){return[a.x,a.y]}function cV(a){return function(){var b=a.apply(this,arguments),c=b[0],d=b[1]+cf;return[c*Math.cos(d),c*Math.sin(d)]}}function cX(a,b){var c=(a.ownerSVGElement||a).createSVGPoint();if(cW<0&&(window.scrollX||window.scrollY)){var d=d3.select(document.body).append("svg:svg").style("position","absolute").style("top",0).style("left",0),e=d[0][0].getScreenCTM();cW=!e.f&&!e.e,d.remove()}return cW?(c.x=b.pageX,c.y=b.pageY):(c.x=b.clientX,c.y=b.clientY),c=c.matrixTransform(a.getScreenCTM().inverse()),[c.x,c.y]}function cY(){return 64}function cZ(){return"circle"}function db(a,b){a.attr("transform",function(a){return"translate("+b(a)+",0)"})}function dc(a,b){a.attr("transform",function(a){return"translate(0,"+b(a)+")"})}function dd(a,b,c){e=[];if(c&&b.length>1){var d=bJ(a.domain()),e,f=-1,g=b.length,h=(b[1]-b[0])/++c,i,j;while(++f<g)for(i=c;--i>0;)(j=+b[f]-i*h)>=d[0]&&e.push(j);for(--f,i=0;++i<c&&(j=+b[f]+i*h)<d[1];)e.push(j)}return e}function dp(a,b){a.select(".extent").attr("x",b[0][0]),a.selectAll(".n,.s,.w,.nw,.sw").attr("x",b[0][0]-2),a.selectAll(".e,.ne,.se").attr("x",b[1][0]-3),a.selectAll(".extent,.n,.s").attr("width",b[1][0]-b[0][0])}function dq(a,b){a.select(".extent").attr("y",b[0][1]),a.selectAll(".n,.e,.w,.nw,.ne").attr("y",b[0][1]-3),a.selectAll(".s,.se,.sw").attr("y",b[1][1]-4),a.selectAll(".extent,.e,.w").attr("height",b[1][1]-b[0][1])}function dr(){d3.event.keyCode==32&&dg&&!dk&&(dm=null,dn[0]-=dj[1][0],dn[1]-=dj[1][1],dk=2,M())}function ds(){d3.event.keyCode==32&&dk==2&&(dn[0]+=dj[1][0],dn[1]+=dj[1][1],dk=0,M())}function dt(){if(dn){var a=d3.svg.mouse(dg),b=d3.select(dg);dk||(d3.event.altKey?(dm||(dm=[(dj[0][0]+dj[1][0])/2,(dj[0][1]+dj[1][1])/2]),dn[0]=dj[+(a[0]<dm[0])][0],dn[1]=dj[+(a[1]<dm[1])][1]):dm=null),dh&&(du(a,dh,0),dp(b,dj)),di&&(du(a,di,1),dq(b,dj)),df("brush")}}function du(a,b,c){var d=bJ(b.range()),e=dn[c],f=dj[1][c]-dj[0][c],g,h;dk&&(d[0]-=e,d[1]-=f+e),g=Math.max(d[0],Math.min(d[1],a[c])),dk?h=(g+=e)+f:(dm&&(e=Math.max(d[0],Math.min(d[1],2*dm[c]-g))),e<g?(h=g,g=e):h=e),dj[0][c]=g,dj[1][c]=h}function dv(){dn&&(dt(),d3.select(dg).selectAll(".resize").style("pointer-events",de.empty()?"none":"all"),df("brushend"),de=df=dg=dh=di=dj=dk=dl=dm=dn=null,M())}function dE(a){var b=d3.event,c=dz.parentNode,d=0,e=0;c&&(c=dF(c),d=c[0]-dB[0],e=c[1]-dB[1],dB=c,dC|=d|e);try{d3.event={dx:d,dy:e},dx[a].apply(dz,dA)}finally{d3.event=b}b.preventDefault()}function dF(a,b){var c=d3.event.changedTouches;return c?d3.svg.touches(a,c)[0]:d3.svg.mouse(a)}function dG(){if(!dz)return;var a=dz.parentNode;if(!a)return dH();dE("drag"),M()}function dH(){if(!dz)return;dE("dragend"),dz=null,dC&&dy===d3.event.target&&(dD=!0,M())}function dI(){dD&&dy===d3.event.target&&(M(),dD=!1,dy=null)}function dW(a){return[a[0]-dO[0],a[1]-dO[1],dO[2]]}function dX(){dJ||(dJ=d3.select("body").append("div").style("visibility","hidden").style("top",0).style("height",0).style("width",0).style("overflow-y","scroll").append("div").style("height","2000px").node().parentNode);var a=d3.event,b;try{dJ.scrollTop=1e3,dJ.dispatchEvent(a),b=1e3-dJ.scrollTop}catch(c){b=a.wheelDelta||-a.detail*5}return b*.005}function dY(){var a=d3.svg.touches(dS),b=-1,c=a.length,d;while(++b<c)dM[(d=a[b]).identifier]=dW(d);return a}function dZ(){var a=d3.svg.touches(dS);switch(a.length){case 1:var b=a[0];eb(dO[2],b,dM[b.identifier]);break;case 2:var c=a[0],d=a[1],e=[(c[0]+d[0])/2,(c[1]+d[1])/2],f=dM[c.identifier],g=dM[d.identifier],h=[(f[0]+g[0])/2,(f[1]+g[1])/2,f[2]];eb(Math.log(d3.event.scale)/Math.LN2+f[2],e,h)}}function d$(){dL=null,dK&&(dU=!0,eb(dO[2],d3.svg.mouse(dS),dK))}function d_(){dK&&(dU&&dR===d3.event.target&&(dV=!0),d$(),dK=null)}function ea(){dV&&dR===d3.event.target&&(d3.event.stopPropagation(),d3.event.preventDefault(),dV=!1,dR=null)}function eb(a,b,c){function l(a,b,c){a.domain(a.range().map(function(f){return a.invert((f-c)*d/e+b)}))}a=ed(a,2);var d=Math.pow(2,dO[2]),e=Math.pow(2,a),f=Math.pow(2,(dO[2]=a)-c[2]),g=dO[0],h=dO[1],i=dO[0]=ed(b[0]-c[0]*f,0,e),j=dO[1]=ed(b[1]-c[1]*f,1,e),k=d3.event;d3.event={scale:e,translate:[i,j],transform:function(a,b){a&&l(a,g,i),b&&l(b,h,j)}};try{dQ.apply(dS,dT)}finally{d3.event=k}k.preventDefault()}function ed(a,b,c){var d=dP[b],e=d[0],f=d[1];return arguments.length===3?Math.max(f*(f===Infinity?-Infinity:1/c-1),Math.min(e===-Infinity?Infinity:e,a/c))*c:Math.max(e,Math.min(f,a))}Date.now||(Date.now=function(){return+(new Date)});try{document.createElement("div").style.setProperty("opacity",0,"")}catch(a){var b=CSSStyleDeclaration.prototype,c=b.setProperty;b.setProperty=function(a,b,d){c.call(this,a,b+"",d)}}d3={version:"2.5.0"};var d=f;try{d(document.documentElement.childNodes)[0].nodeType}catch(g){d=e}var h=[].__proto__?function(a,b){a.__proto__=b}:function(a,b){for(var c in b)a[c]=b[c]};d3.functor=function(a){return typeof a=="function"?a:function(){return a}},d3.rebind=function(a,b){return function(){var c=b.apply(a,arguments);return arguments.length?a:c}},d3.ascending=function(a,b){return a<b?-1:a>b?1:a>=b?0:NaN},d3.descending=function(a,b){return b<a?-1:b>a?1:b>=a?0:NaN},d3.mean=function(a,b){var c=a.length,d,e=0,f=-1,g=0;if(arguments.length===1)while(++f<c)j(d=a[f])&&(e+=(d-e)/++g);else while(++f<c)j(d=b.call(a,a[f],f))&&(e+=(d-e)/++g);return g?e:undefined},d3.median=function(a,b){return arguments.length>1&&(a=a.map(b)),a=a.filter(j),a.length?d3.quantile(a.sort(d3.ascending),.5):undefined},d3.min=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&e>f&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&e>f&&(e=f)}return e},d3.max=function(a,b){var c=-1,d=a.length,e,f;if(arguments.length===1){while(++c<d&&((e=a[c])==null||e!=e))e=undefined;while(++c<d)(f=a[c])!=null&&f>e&&(e=f)}else{while(++c<d&&((e=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&f>e&&(e=f)}return e},d3.extent=function(a,b){var c=-1,d=a.length,e,f,g;if(arguments.length===1){while(++c<d&&((e=g=a[c])==null||e!=e))e=g=undefined;while(++c<d)(f=a[c])!=null&&(e>f&&(e=f),g<f&&(g=f))}else{while(++c<d&&((e=g=b.call(a,a[c],c))==null||e!=e))e=undefined;while(++c<d)(f=b.call(a,a[c],c))!=null&&(e>f&&(e=f),g<f&&(g=f))}return[e,g]},d3.random={normal:function(a,b){return arguments.length<2&&(b=1),arguments.length<1&&(a=0),function(){var c,d,e;do c=Math.random()*2-1,d=Math.random()*2-1,e=c*c+d*d;while(!e||e>1);return a+b*c*Math.sqrt(-2*Math.log(e)/e)}}},d3.sum=function(a,b){var c=0,d=a.length,e,f=-1;if(arguments.length===1)while(++f<d)isNaN(e=+a[f])||(c+=e);else while(++f<d)isNaN(e=+b.call(a,a[f],f))||(c+=e);return c},d3.quantile=function(a,b){var c=(a.length-1)*b+1,d=Math.floor(c),e=a[d-1],f=c-d;return f?e+f*(a[d]-e):e},d3.zip=function(){if(!(e=arguments.length))return[];for(var a=-1,b=d3.min(arguments,k),c=new Array(b);++a<b;)for(var d=-1,e,f=c[a]=new Array(e);++d<e;)f[d]=arguments[d][a];return c},d3.bisectLeft=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;a[e]<b?c=e+1:d=e}return c},d3.bisect=d3.bisectRight=function(a,b,c,d){arguments.length<3&&(c=0),arguments.length<4&&(d=a.length);while(c<d){var e=c+d>>1;b<a[e]?d=e:c=e+1}return c},d3.first=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])>0&&(e=f);return e},d3.last=function(a,b){var c=0,d=a.length,e=a[0],f;arguments.length===1&&(b=d3.ascending);while(++c<d)b.call(a,e,f=a[c])<=0&&(e=f);return e},d3.nest=function(){function f(c,g){if(g>=b.length)return e?e.call(a,c):d?c.sort(d):c;var h=-1,i=c.length,j=b[g++],k,l,m={};while(++h<i)(k=j(l=c[h]))in m?m[k].push(l):m[k]=[l];for(k in m)m[k]=f(m[k],g);return m}function g(a,d){if(d>=b.length)return a;var e=[],f=c[d++],h;for(h in a)e.push({key:h,values:g(a[h],d)});return f&&e.sort(function(a,b){return f(a.key,b.key)}),e}var a={},b=[],c=[],d,e;return a.map=function(a){return f(a,0)},a.entries=function(a){return g(f(a,0),0)},a.key=function(c){return b.push(c),a},a.sortKeys=function(d){return c[b.length-1]=d,a},a.sortValues=function(b){return d=b,a},a.rollup=function(b){return e=b,a},a},d3.keys=function(a){var b=[];for(var c in a)b.push(c);return b},d3.values=function(a){var b=[];for(var c in a)b.push(a[c]);return b},d3.entries=function(a){var b=[];for(var c in a)b.push({key:c,value:a[c]});return b},d3.permute=function(a,b){var c=[],d=-1,e=b.length;while(++d<e)c[d]=a[b[d]];return c},d3.merge=function(a){return Array.prototype.concat.apply([],a)},d3.split=function(a,b){var c=[],d=[],e,f=-1,g=a.length;arguments.length<2&&(b=l);while(++f<g)b.call(d,e=a[f],f)?d=[]:(d.length||c.push(d),d.push(e));return c},d3.range=function(a,b,c){arguments.length<3&&(c=1,arguments.length<2&&(b=a,a=0));if((b-a)/c==Infinity)throw new Error("infinite range");var d=[],e=-1,f;if(c<0)while((f=a+c*++e)>b)d.push(f);else while((f=a+c*++e)<b)d.push(f);return d},d3.requote=function(a){return a.replace(n,"\\$&")};var n=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;d3.round=function(a,b){return b?Math.round(a*Math.pow(10,b))*Math.pow(10,-b):Math.round(a)},d3.xhr=function(a,b,c){var d=new XMLHttpRequest;arguments.length<3?c=b:b&&d.overrideMimeType&&d.overrideMimeType(b),d.open("GET",a,!0),d.onreadystatechange=function(){d.readyState===4&&c(d.status<300?d:null)},d.send(null)},d3.text=function(a,b,c){function d(a){c(a&&a.responseText)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.json=function(a,b){d3.text(a,"application/json",function(a){b(a?JSON.parse(a):null)})},d3.html=function(a,b){d3.text(a,"text/html",function(a){if(a!=null){var c=document.createRange();c.selectNode(document.body),a=c.createContextualFragment(a)}b(a)})},d3.xml=function(a,b,c){function d(a){c(a&&a.responseXML)}arguments.length<3&&(c=b,b=null),d3.xhr(a,b,d)},d3.ns={prefix:{svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"},qualify:function(a){var b=a.indexOf(":");return b<0?a:{space:d3.ns.prefix[a.substring(0,b)],local:a.substring(b+1)}}},d3.dispatch=function(){var a=new o,b=-1,c=arguments.length;while(++b<c)a[arguments[b]]=p();return a},o.prototype.on=function(a,b){var c=a.indexOf("."),d="";c>0&&(d=a.substring(c+1),a=a.substring(0,c)),this[a].on(d,b)},d3.format=function(a){var b=q.exec(a),c=b[1]||" ",d=b[3]||"",e=b[5],f=+b[6],g=b[7],h=b[8],i=b[9],j=1,k="",l=!1;h&&(h=+h.substring(1)),e&&(c="0",g&&(f-=Math.floor((f-1)/4)));switch(i){case"n":g=!0,i="g";break;case"%":j=100,k="%",i="f";break;case"p":j=100,k="%",i="r";break;case"d":l=!0,h=0;break;case"s":j=-1,i="r"}return i=="r"&&!h&&(i="g"),i=r[i]||t,function(a){if(l&&a%1)return"";var b=a<0&&(a=-a)?"−":d;if(j<0){var m=d3.formatPrefix(a,h);a*=m.scale,k=m.symbol}else a*=j;a=i(a,h);if(e){var n=a.length+b.length;n<f&&(a=(new Array(f-n+1)).join(c)+a),g&&(a=u(a)),a=b+a}else{g&&(a=u(a)),a=b+a;var n=a.length;n<f&&(a=(new Array(f-n+1)).join(c)+a)}return a+k}};var q=/(?:([^{])?([<>=^]))?([+\- ])?(#)?(0)?([0-9]+)?(,)?(\.[0-9]+)?([a-zA-Z%])?/,r={g:function(a,b){return a.toPrecision(b)},e:function(a,b){return a.toExponential(b)},f:function(a,b){return a.toFixed(b)},r:function(a,b){return d3.round(a,b=s(a,b)).toFixed(Math.max(0,Math.min(20,b)))}},v=["y","z","a","f","p","n","μ","m","","k","M","G","T","P","E","Z","Y"].map(w);d3.formatPrefix=function(a,b){var c=0;return a&&(a<0&&(a*=-1),b&&(a=d3.round(a,s(a,b))),c=1+Math.floor(1e-12+Math.log(a)/Math.LN10),c=Math.max(-24,Math.min(24,Math.floor((c<=0?c+1:c-1)/3)*3))),v[8+c/3]};var x=F(2),y=F(3),z={linear:function(){return E},poly:F,quad:function(){return x},cubic:function(){return y},sin:function(){return G},exp:function(){return H},circle:function(){return I},elastic:J,back:K,bounce:function(){return L}},A={"in":function(a){return a},out:C,"in-out":D,"out-in":function(a){return D(C(a))}};d3.ease=function(a){var b=a.indexOf("-"),c=b>=0?a.substring(0,b):a,d=b>=0?a.substring(b+1):"in";return B(A[d](z[c].apply(null,Array.prototype.slice.call(arguments,1))))},d3.event=null,d3.interpolate=function(a,b){var c=d3.interpolators.length,d;while(--c>=0&&!(d=d3.interpolators[c](a,b)));return d},d3.interpolateNumber=function(a,b){return b-=a,function(c){return a+b*c}},d3.interpolateRound=function(a,b){return b-=a,function(c){return Math.round(a+b*c)}},d3.interpolateString=function(a,b){var c,d,e,f=0,g=0,h=[],i=[],j,k;N.lastIndex=0;for(d=0;c=N.exec(b);++d)c.index&&h.push(b.substring(f,g=c.index)),i.push({i:h.length,x:c[0]}),h.push(null),f=N.lastIndex;f<b.length&&h.push(b.substring(f));for(d=0,j=i.length;(c=N.exec(a))&&d<j;++d){k=i[d];if(k.x==c[0]){if(k.i)if(h[k.i+1]==null){h[k.i-1]+=k.x,h.splice(k.i,1);for(e=d+1;e<j;++e)i[e].i--}else{h[k.i-1]+=k.x+h[k.i+1],h.splice(k.i,2);for(e=d+1;e<j;++e)i[e].i-=2}else if(h[k.i+1]==null)h[k.i]=k.x;else{h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1);for(e=d+1;e<j;++e)i[e].i--}i.splice(d,1),j--,d--}else k.x=d3.interpolateNumber(parseFloat(c[0]),parseFloat(k.x))}while(d<j)k=i.pop(),h[k.i+1]==null?h[k.i]=k.x:(h[k.i]=k.x+h[k.i+1],h.splice(k.i+1,1)),j--;return h.length===1?h[0]==null?i[0].x:function(){return b}:function(a){for(d=0;d<j;++d)h[(k=i[d]).i]=k.x(a);return h.join("")}},d3.interpolateTransform=function(a,b){return d3.interpolateString(d3.transform(a)+"",d3.transform(b)+"")},d3.interpolateRgb=function(a,b){a=d3.rgb(a),b=d3.rgb(b);var c=a.r,d=a.g,e=a.b,f=b.r-c,g=b.g-d,h=b.b-e;return function(a){return"#"+T(Math.round(c+f*a))+T(Math.round(d+g*a))+T(Math.round(e+h*a))}},d3.interpolateHsl=function(a,b){a=d3.hsl(a),b=d3.hsl(b);var c=a.h,d=a.s,e=a.l,f=b.h-c,g=b.s-d,h=b.l-e;return function(a){return _(c+f*a,d+g*a,e+h*a).toString()}},d3.interpolateArray=function(a,b){var c=[],d=[],e=a.length,f=b.length,g=Math.min(a.length,b.length),h;for(h=0;h<g;++h)c.push(d3.interpolate(a[h],b[h]));for(;h<e;++h)d[h]=a[h];for(;h<f;++h)d[h]=b[h];return function(a){for(h=0;h<g;++h)d[h]=c[h](a);return d}},d3.interpolateObject=function(a,b){var c={},d={},e;for(e in a)e in b?c[e]=O(e)(a[e],b[e]):d[e]=a[e];for(e in b)e in a||(d[e]=b[e]);return function(a){for(e in c)d[e]=c[e](a);return d}};var N=/[-+]?(?:\d*\.?\d+)(?:[eE][-+]?\d+)?/g;d3.interpolators=[d3.interpolateObject,function(a,b){return b instanceof Array&&d3.interpolateArray(a,b)},function(a,b){return typeof b=="string"&&d3.interpolateString(a+"",b)},function(a,b){return(typeof b=="string"?b in X||/^(#|rgb\(|hsl\()/.test(b):b instanceof S||b instanceof $)&&d3.interpolateRgb(a+"",b)},function(a,b){return typeof b=="number"&&d3.interpolateNumber(+a,b)}],d3.rgb=function(a,b,c){return arguments.length===1?a instanceof S?R(a.r,a.g,a.b):U(""+a,R,_):R(~~a,~~b,~~c)},S.prototype.brighter=function(a){a=Math.pow(.7,arguments.length?a:1);var b=this.r,c=this.g,d=this.b,e=30;return!b&&!c&&!d?R(e,e,e):(b&&b<e&&(b=e),c&&c<e&&(c=e),d&&d<e&&(d=e),R(Math.min(255,Math.floor(b/a)),Math.min(255,Math.floor(c/a)),Math.min(255,Math.floor(d/a))))},S.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),R(Math.floor(a*this.r),Math.floor(a*this.g),Math.floor(a*this.b))},S.prototype.hsl=function(){return V(this.r,this.g,this.b)},S.prototype.toString=function(){return"#"+T(this.r)+T(this.g)+T(this.b)};var X={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",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080"
+,green:"#008000",greenyellow:"#adff2f",grey:"#808080",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",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",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:"#db7093",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",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};for(var Y in X)X[Y]=U(X[Y],R,_);d3.hsl=function(a,b,c){return arguments.length===1?a instanceof $?Z(a.h,a.s,a.l):U(""+a,V,Z):Z(+a,+b,+c)},$.prototype.brighter=function(a){return a=Math.pow(.7,arguments.length?a:1),Z(this.h,this.s,this.l/a)},$.prototype.darker=function(a){return a=Math.pow(.7,arguments.length?a:1),Z(this.h,this.s,a*this.l)},$.prototype.rgb=function(){return _(this.h,this.s,this.l)},$.prototype.toString=function(){return this.rgb().toString()};var bb=function(a,b){return b.querySelector(a)},bc=function(a,b){return b.querySelectorAll(a)};typeof Sizzle=="function"&&(bb=function(a,b){return Sizzle(a,b)[0]},bc=function(a,b){return Sizzle.uniqueSort(Sizzle(a,b))});var bd=[];d3.selection=function(){return bk},d3.selection.prototype=bd,bd.select=function(a){var b=[],c,d,e,f;typeof a!="function"&&(a=be(a));for(var g=-1,h=this.length;++g<h;){b.push(c=[]),c.parentNode=(e=this[g]).parentNode;for(var i=-1,j=e.length;++i<j;)(f=e[i])?(c.push(d=a.call(f,f.__data__,i)),d&&"__data__"in f&&(d.__data__=f.__data__)):c.push(null)}return ba(b)},bd.selectAll=function(a){var b=[],c,e;typeof a!="function"&&(a=bf(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i])b.push(c=d(a.call(e,e.__data__,i))),c.parentNode=e;return ba(b)},bd.attr=function(a,b){function d(){this.removeAttribute(a)}function e(){this.removeAttributeNS(a.space,a.local)}function f(){this.setAttribute(a,b)}function g(){this.setAttributeNS(a.space,a.local,b)}function h(){var c=b.apply(this,arguments);c==null?this.removeAttribute(a):this.setAttribute(a,c)}function i(){var c=b.apply(this,arguments);c==null?this.removeAttributeNS(a.space,a.local):this.setAttributeNS(a.space,a.local,c)}a=d3.ns.qualify(a);if(arguments.length<2){var c=this.node();return a.local?c.getAttributeNS(a.space,a.local):c.getAttribute(a)}return this.each(b==null?a.local?e:d:typeof b=="function"?a.local?i:h:a.local?g:f)},bd.classed=function(a,b){var c=a.split(bg),d=c.length,e=-1;if(arguments.length>1){while(++e<d)bh.call(this,c[e],b);return this}while(++e<d)if(!bh.call(this,c[e]))return!1;return!0};var bg=/\s+/g;bd.style=function(a,b,c){function d(){this.style.removeProperty(a)}function e(){this.style.setProperty(a,b,c)}function f(){var d=b.apply(this,arguments);d==null?this.style.removeProperty(a):this.style.setProperty(a,d,c)}return arguments.length<3&&(c=""),arguments.length<2?window.getComputedStyle(this.node(),null).getPropertyValue(a):this.each(b==null?d:typeof b=="function"?f:e)},bd.property=function(a,b){function c(){delete this[a]}function d(){this[a]=b}function e(){var c=b.apply(this,arguments);c==null?delete this[a]:this[a]=c}return arguments.length<2?this.node()[a]:this.each(b==null?c:typeof b=="function"?e:d)},bd.text=function(a){return arguments.length<1?this.node().textContent:this.each(typeof a=="function"?function(){this.textContent=a.apply(this,arguments)}:function(){this.textContent=a})},bd.html=function(a){return arguments.length<1?this.node().innerHTML:this.each(typeof a=="function"?function(){this.innerHTML=a.apply(this,arguments)}:function(){this.innerHTML=a})},bd.append=function(a){function b(){return this.appendChild(document.createElement(a))}function c(){return this.appendChild(document.createElementNS(a.space,a.local))}return a=d3.ns.qualify(a),this.select(a.local?c:b)},bd.insert=function(a,b){function c(){return this.insertBefore(document.createElement(a),bb(b,this))}function d(){return this.insertBefore(document.createElementNS(a.space,a.local),bb(b,this))}return a=d3.ns.qualify(a),this.select(a.local?d:c)},bd.remove=function(){return this.each(function(){var a=this.parentNode;a&&a.removeChild(this)})},bd.data=function(a,b){function f(a,f){var g,h=a.length,i=f.length,j=Math.min(h,i),k=Math.max(h,i),l=[],m=[],n=[],o,p;if(b){var q={},r=[],s,t=f.length;for(g=-1;++g<h;)s=b.call(o=a[g],o.__data__,g),s in q?n[t++]=o:q[s]=o,r.push(s);for(g=-1;++g<i;)o=q[s=b.call(f,p=f[g],g)],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bi(p),l[g]=n[g]=null),delete q[s];for(g=-1;++g<h;)r[g]in q&&(n[g]=a[g])}else{for(g=-1;++g<j;)o=a[g],p=f[g],o?(o.__data__=p,l[g]=o,m[g]=n[g]=null):(m[g]=bi(p),l[g]=n[g]=null);for(;g<i;++g)m[g]=bi(f[g]),l[g]=n[g]=null;for(;g<k;++g)n[g]=a[g],m[g]=l[g]=null}m.update=l,m.parentNode=l.parentNode=n.parentNode=a.parentNode,c.push(m),d.push(l),e.push(n)}var c=[],d=[],e=[],g=-1,h=this.length,i;if(typeof a=="function")while(++g<h)f(i=this[g],a.call(i,i.parentNode.__data__,g));else while(++g<h)f(i=this[g],a);var j=ba(d);return j.enter=function(){return bl(c)},j.exit=function(){return ba(e)},j},bd.filter=function(a){var b=[],c,d,e;for(var f=0,g=this.length;f<g;f++){b.push(c=[]),c.parentNode=(d=this[f]).parentNode;for(var h=0,i=d.length;h<i;h++)(e=d[h])&&a.call(e,e.__data__,h)&&c.push(e)}return ba(b)},bd.map=function(a){return this.each(function(){this.__data__=a.apply(this,arguments)})},bd.sort=function(a){a=bj.apply(this,arguments);for(var b=0,c=this.length;b<c;b++)for(var d=this[b].sort(a),e=1,f=d.length,g=d[0];e<f;e++){var h=d[e];h&&(g&&g.parentNode.insertBefore(h,g.nextSibling),g=h)}return this},bd.on=function(a,b,c){arguments.length<3&&(c=!1);var d="__on"+a,e=a.indexOf(".");return e>0&&(a=a.substring(0,e)),arguments.length<2?(e=this.node()[d])&&e._:this.each(function(e,f){function h(a){var c=d3.event;d3.event=a;try{b.call(g,g.__data__,f)}finally{d3.event=c}}var g=this;g[d]&&g.removeEventListener(a,g[d],c),b&&g.addEventListener(a,g[d]=h,c),h._=b})},bd.each=function(a){for(var b=-1,c=this.length;++b<c;)for(var d=this[b],e=-1,f=d.length;++e<f;){var g=d[e];g&&a.call(g,g.__data__,e,b)}return this},bd.call=function(a){return a.apply(this,(arguments[0]=this,arguments)),this},bd.empty=function(){return!this.node()},bd.node=function(a){for(var b=0,c=this.length;b<c;b++)for(var d=this[b],e=0,f=d.length;e<f;e++){var g=d[e];if(g)return g}return null},bd.transition=function(){var a=[],b,c;for(var d=-1,e=this.length;++d<e;){a.push(b=[]);for(var f=this[d],g=-1,h=f.length;++g<h;)b.push((c=f[g])?{node:c,delay:0,duration:250}:null)}return bn(a,bt||++bs,Date.now())};var bk=ba([[document]]);bk[0].parentNode=document.documentElement,d3.select=function(a){return typeof a=="string"?bk.select(a):ba([[a]])},d3.selectAll=function(a){return typeof a=="string"?bk.selectAll(a):ba([d(a)])};var bm=[];bm.append=bd.append,bm.insert=bd.insert,bm.empty=bd.empty,bm.node=bd.node,bm.select=function(a){var b=[],c,d,e,f,g;for(var h=-1,i=this.length;++h<i;){e=(f=this[h]).update,b.push(c=[]),c.parentNode=f.parentNode;for(var j=-1,k=f.length;++j<k;)(g=f[j])?(c.push(e[j]=d=a.call(f.parentNode,g.__data__,j)),d.__data__=g.__data__):c.push(null)}return ba(b)};var bo={},br=[],bs=0,bt=0,bu=d3.ease("cubic-in-out");br.call=bd.call,d3.transition=function(){return bk.transition()},d3.transition.prototype=br,br.select=function(a){var b=[],c,d,e;typeof a!="function"&&(a=be(a));for(var f=-1,g=this.length;++f<g;){b.push(c=[]);for(var h=this[f],i=-1,j=h.length;++i<j;)(e=h[i])&&(d=a.call(e.node,e.node.__data__,i))?("__data__"in e.node&&(d.__data__=e.node.__data__),c.push({node:d,delay:e.delay,duration:e.duration})):c.push(null)}return bn(b,this.id,this.time).ease(this.ease())},br.selectAll=function(a){var b=[],c,d,e;typeof a!="function"&&(a=bf(a));for(var f=-1,g=this.length;++f<g;)for(var h=this[f],i=-1,j=h.length;++i<j;)if(e=h[i]){d=a.call(e.node,e.node.__data__,i),b.push(c=[]);for(var k=-1,l=d.length;++k<l;)c.push({node:d[k],delay:e.delay,duration:e.duration})}return bn(b,this.id,this.time).ease(this.ease())},br.attr=function(a,b){return this.attrTween(a,bq(a,b))},br.attrTween=function(a,b){function d(a,d){var e=b.call(this,a,d,this.getAttribute(c));return e===bo?(this.removeAttribute(c),null):e&&function(a){this.setAttribute(c,e(a))}}function e(a,d){var e=b.call(this,a,d,this.getAttributeNS(c.space,c.local));return e===bo?(this.removeAttributeNS(c.space,c.local),null):e&&function(a){this.setAttributeNS(c.space,c.local,e(a))}}var c=d3.ns.qualify(a);return this.tween("attr."+a,c.local?e:d)},br.style=function(a,b,c){return arguments.length<3&&(c=""),this.styleTween(a,bq(a,b),c)},br.styleTween=function(a,b,c){return arguments.length<3&&(c=""),this.tween("style."+a,function(d,e){var f=b.call(this,d,e,window.getComputedStyle(this,null).getPropertyValue(a));return f===bo?(this.style.removeProperty(a),null):f&&function(b){this.style.setProperty(a,f(b),c)}})},br.text=function(a){return this.tween("text",function(b,c){this.textContent=typeof a=="function"?a.call(this,b,c):a})},br.remove=function(){return this.each("end",function(){var a;!this.__transition__&&(a=this.parentNode)&&a.removeChild(this)})},br.delay=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].delay=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].delay=a}))},br.duration=function(a){var b=this;return b.each(typeof a=="function"?function(c,d,e){b[e][d].duration=+a.apply(this,arguments)}:(a=+a,function(c,d,e){b[e][d].duration=a}))},br.transition=function(){return this.select(i)};var bw=null,bx,by;d3.timer=function(a,b,c){var d=!1,e,f=bw;if(arguments.length<3){if(arguments.length<2)b=0;else if(!isFinite(b))return;c=Date.now()}while(f){if(f.callback===a){f.then=c,f.delay=b,d=!0;break}e=f,f=f.next}d||(bw={callback:a,then:c,delay:b,next:bw}),bx||(by=clearTimeout(by),bx=1,bB(bz))},d3.timer.flush=function(){var a,b=Date.now(),c=bw;while(c)a=b-c.then,c.delay||(c.flush=c.callback(a)),c=c.next;bA()};var bB=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a){setTimeout(a,17)};d3.transform=function(a){return bG.setAttribute("transform",a),new bC(bG.transform.baseVal.consolidate().matrix)},bC.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var bG=document.createElementNS(d3.ns.prefix.svg,"g"),bH=180/Math.PI;d3.scale={},d3.scale.linear=function(){return bM([0,1],[0,1],d3.interpolate,!1)},d3.scale.log=function(){return bU(d3.scale.linear(),bW)};var bV=d3.format("e");bW.pow=function(a){return Math.pow(10,a)},bX.pow=function(a){return-Math.pow(10,-a)},d3.scale.pow=function(){return bY(d3.scale.linear(),1)},d3.scale.sqrt=function(){return d3.scale.pow().exponent(.5)},d3.scale.ordinal=function(){return b$([],{t:"range",x:[]})},d3.scale.category10=function(){return d3.scale.ordinal().range(b_)},d3.scale.category20=function(){return d3.scale.ordinal().range(ca)},d3.scale.category20b=function(){return d3.scale.ordinal().range(cb)},d3.scale.category20c=function(){return d3.scale.ordinal().range(cc)};var b_=["#1f77b4","#ff7f0e","#2ca02c","#d62728","#9467bd","#8c564b","#e377c2","#7f7f7f","#bcbd22","#17becf"],ca=["#1f77b4","#aec7e8","#ff7f0e","#ffbb78","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5","#8c564b","#c49c94","#e377c2","#f7b6d2","#7f7f7f","#c7c7c7","#bcbd22","#dbdb8d","#17becf","#9edae5"],cb=["#393b79","#5254a3","#6b6ecf","#9c9ede","#637939","#8ca252","#b5cf6b","#cedb9c","#8c6d31","#bd9e39","#e7ba52","#e7cb94","#843c39","#ad494a","#d6616b","#e7969c","#7b4173","#a55194","#ce6dbd","#de9ed6"],cc=["#3182bd","#6baed6","#9ecae1","#c6dbef","#e6550d","#fd8d3c","#fdae6b","#fdd0a2","#31a354","#74c476","#a1d99b","#c7e9c0","#756bb1","#9e9ac8","#bcbddc","#dadaeb","#636363","#969696","#bdbdbd","#d9d9d9"];d3.scale.quantile=function(){return cd([],[])},d3.scale.quantize=function(){return ce(0,1,[0,1])},d3.svg={},d3.svg.arc=function(){function e(){var e=a.apply(this,arguments),f=b.apply(this,arguments),g=c.apply(this,arguments)+cf,h=d.apply(this,arguments)+cf,i=(h<g&&(i=g,g=h,h=i),h-g),j=i<Math.PI?"0":"1",k=Math.cos(g),l=Math.sin(g),m=Math.cos(h),n=Math.sin(h);return i>=cg?e?"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"M0,"+e+"A"+e+","+e+" 0 1,0 0,"+ -e+"A"+e+","+e+" 0 1,0 0,"+e+"Z":"M0,"+f+"A"+f+","+f+" 0 1,1 0,"+ -f+"A"+f+","+f+" 0 1,1 0,"+f+"Z":e?"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L"+e*m+","+e*n+"A"+e+","+e+" 0 "+j+",0 "+e*k+","+e*l+"Z":"M"+f*k+","+f*l+"A"+f+","+f+" 0 "+j+",1 "+f*m+","+f*n+"L0,0"+"Z"}var a=ch,b=ci,c=cj,d=ck;return e.innerRadius=function(b){return arguments.length?(a=d3.functor(b),e):a},e.outerRadius=function(a){return arguments.length?(b=d3.functor(a),e):b},e.startAngle=function(a){return arguments.length?(c=d3.functor(a),e):c},e.endAngle=function(a){return arguments.length?(d=d3.functor(a),e):d},e.centroid=function(){var e=(a.apply(this,arguments)+b.apply(this,arguments))/2,f=(c.apply(this,arguments)+d.apply(this,arguments))/2+cf;return[Math.cos(f)*e,Math.sin(f)*e]},e};var cf=-Math.PI/2,cg=2*Math.PI-1e-6;d3.svg.line=function(){return cl(Object)};var cp={linear:cq,"step-before":cr,"step-after":cs,basis:cy,"basis-open":cz,"basis-closed":cA,bundle:cB,cardinal:cv,"cardinal-open":ct,"cardinal-closed":cu,monotone:cK},cD=[0,2/3,1/3,0],cE=[0,1/3,2/3,0],cF=[0,1/6,2/3,1/6];d3.svg.line.radial=function(){var a=cl(cL);return a.radius=a.x,delete a.x,a.angle=a.y,delete a.y,a},cr.reverse=cs,cs.reverse=cr,d3.svg.area=function(){return cM(Object)},d3.svg.area.radial=function(){var a=cM(cL);return a.radius=a.x,delete a.x,a.innerRadius=a.x0,delete a.x0,a.outerRadius=a.x1,delete a.x1,a.angle=a.y,delete a.y,a.startAngle=a.y0,delete a.y0,a.endAngle=a.y1,delete a.y1,a},d3.svg.chord=function(){function f(c,d){var e=g(this,a,c,d),f=g(this,b,c,d);return"M"+e.p0+i(e.r,e.p1)+(h(e,f)?j(e.r,e.p1,e.r,e.p0):j(e.r,e.p1,f.r,f.p0)+i(f.r,f.p1)+j(f.r,f.p1,e.r,e.p0))+"Z"}function g(a,b,f,g){var h=b.call(a,f,g),i=c.call(a,h,g),j=d.call(a,h,g)+cf,k=e.call(a,h,g)+cf;return{r:i,a0:j,a1:k,p0:[i*Math.cos(j),i*Math.sin(j)],p1:[i*Math.cos(k),i*Math.sin(k)]}}function h(a,b){return a.a0==b.a0&&a.a1==b.a1}function i(a,b){return"A"+a+","+a+" 0 0,1 "+b}function j(a,b,c,d){return"Q 0,0 "+d}var a=cP,b=cQ,c=cR,d=cj,e=ck;return f.radius=function(a){return arguments.length?(c=d3.functor(a),f):c},f.source=function(b){return arguments.length?(a=d3.functor(b),f):a},f.target=function(a){return arguments.length?(b=d3.functor(a),f):b},f.startAngle=function(a){return arguments.length?(d=d3.functor(a),f):d},f.endAngle=function(a){return arguments.length?(e=d3.functor(a),f):e},f},d3.svg.diagonal=function(){function d(d,e){var f=a.call(this,d,e),g=b.call(this,d,e),h=(f.y+g.y)/2,i=[f,{x:f.x,y:h},{x:g.x,y:h},g];return i=i.map(c),"M"+i[0]+"C"+i[1]+" "+i[2]+" "+i[3]}var a=cP,b=cQ,c=cU;return d.source=function(b){return arguments.length?(a=d3.functor(b),d):a},d.target=function(a){return arguments.length?(b=d3.functor(a),d):b},d.projection=function(a){return arguments.length?(c=a,d):c},d},d3.svg.diagonal.radial=function(){var a=d3.svg.diagonal(),b=cU,c=a.projection;return a.projection=function(a){return arguments.length?c(cV(b=a)):b},a},d3.svg.mouse=function(a){return cX(a,d3.event)};var cW=/WebKit/.test(navigator.userAgent)?-1:0;d3.svg.touches=function(a,b){return arguments.length<2&&(b=d3.event.touches),b?d(b).map(function(b){var c=cX(a,b);return c.identifier=b.identifier,c}):[]},d3.svg.symbol=function(){function c(c,d){return(c$[a.call(this,c,d)]||c$.circle)(b.call(this,c,d))}var a=cZ,b=cY;return c.type=function(b){return arguments.length?(a=d3.functor(b),c):a},c.size=function(a){return arguments.length?(b=d3.functor(a),c):b},c};var c$={circle:function(a){var b=Math.sqrt(a/Math.PI);return"M0,"+b+"A"+b+","+b+" 0 1,1 0,"+ -b+"A"+b+","+b+" 0 1,1 0,"+b+"Z"},cross:function(a){var b=Math.sqrt(a/5)/2;return"M"+ -3*b+","+ -b+"H"+ -b+"V"+ -3*b+"H"+b+"V"+ -b+"H"+3*b+"V"+b+"H"+b+"V"+3*b+"H"+ -b+"V"+b+"H"+ -3*b+"Z"},diamond:function(a){var b=Math.sqrt(a/(2*da)),c=b*da;return"M0,"+ -b+"L"+c+",0"+" 0,"+b+" "+ -c+",0"+"Z"},square:function(a){var b=Math.sqrt(a)/2;return"M"+ -b+","+ -b+"L"+b+","+ -b+" "+b+","+b+" "+ -b+","+b+"Z"},"triangle-down":function(a){var b=Math.sqrt(a/c_),c=b*c_/2;return"M0,"+c+"L"+b+","+ -c+" "+ -b+","+ -c+"Z"},"triangle-up":function(a){var b=Math.sqrt(a/c_),c=b*c_/2;return"M0,"+ -c+"L"+b+","+c+" "+ -b+","+c+"Z"}};d3.svg.symbolTypes=d3.keys(c$);var c_=Math.sqrt(3),da=Math.tan(30*Math.PI/180);d3.svg.axis=function(){function j(j){j.each(function(k,l,m){var n=d3.select(this),o=j.delay?function(a){var b=bt;try{return bt=j.id,a.transition().delay(j[m][l].delay).duration(j[m][l].duration).ease(j.ease())}finally{bt=b}}:Object,p=a.ticks.apply(a,g),q=h==null?a.tickFormat.apply(a,g):h,r=dd(a,p,i),s=n.selectAll(".minor").data(r,String),t=s.enter().insert("svg:line","g").attr("class","tick minor").style("opacity",1e-6),u=o(s.exit()).style("opacity",1e-6).remove(),v=o(s).style("opacity",1),w=n.selectAll("g").data(p,String),x=w.enter().insert("svg:g","path").style("opacity",1e-6),y=o(w.exit()).style("opacity",1e-6).remove(),z=o(w).style("opacity",1),A,B=bJ(a.range()),C=n.selectAll(".domain").data([0]),D=C.enter().append("svg:path").attr("class","domain"),E=o(C),F=this.__chart__||a;this.__chart__=a.copy(),x.append("svg:line").attr("class","tick"),x.append("svg:text"),z.select("text").text(q);switch(b){case"bottom":A=db,v.attr("x2",0).attr("y2",d),z.select("line").attr("x2",0).attr("y2",c),z.select("text").attr("x",0).attr("y",Math.max(c,0)+f).attr("dy",".71em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+e+"V0H"+B[1]+"V"+e);break;case"top":A=db,v.attr("x2",0).attr("y2",-d),z.select("line").attr("x2",0).attr("y2",-c),z.select("text").attr("x",0).attr("y",-(Math.max(c,0)+f)).attr("dy","0em").attr("text-anchor","middle"),E.attr("d","M"+B[0]+","+ -e+"V0H"+B[1]+"V"+ -e);break;case"left":A=dc,v.attr("x2",-d).attr("y2",0),z.select("line").attr("x2",-c).attr("y2",0),z.select("text").attr("x",-(Math.max(c,0)+f)).attr("y",0).attr("dy",".32em").attr("text-anchor","end"),E.attr("d","M"+ -e+","+B[0]+"H0V"+B[1]+"H"+ -e);break;case"right":A=dc,v.attr("x2",d).attr("y2",0),z.select("line").attr("x2",c).attr("y2",0),z.select("text").attr("x",Math.max(c,0)+f).attr("y",0).attr("dy",".32em").attr("text-anchor","start"),E.attr("d","M"+e+","+B[0]+"H0V"+B[1]+"H"+e)}x.call(A,F),z.call(A,a),y.call(A,a),t.call(A,F),v.call(A,a),u.call(A,a)})}var a=d3.scale.linear(),b="bottom",c=6,d=6,e=6,f=3,g=[10],h,i=0;return j.scale=function(b){return arguments.length?(a=b,j):a},j.orient=function(a){return arguments.length?(b=a,j):b},j.ticks=function(){return arguments.length?(g=arguments,j):g},j.tickFormat=function(a){return arguments.length?(h=a,j):h},j.tickSize=function(a,b,f){if(!arguments.length)return c;var g=arguments.length-1;return c=+a,d=g>1?+b:c,e=g>0?+arguments[g]:c,j},j.tickPadding=function(a){return arguments.length?(f=+a,j):f},j.tickSubdivide=function(a){return arguments.length?(i=+a,j):i},j},d3.svg.brush=function(){function e(a){var g=b&&c?["n","e","s","w","nw","ne","se","sw"]:b?["e","w"]:c?["n","s"]:[];a.each(function(){var a=d3.select(this).on("mousedown.brush",f),h=a.selectAll(".background").data([,]),i=a.selectAll(".extent").data([,]),j=a.selectAll(".resize").data(g,String),k;h.enter().append("svg:rect").attr("class","background").style("visibility","hidden").style("pointer-events","all").style("cursor","crosshair"),i.enter().append("svg:rect").attr("class","extent").style("cursor","move"),j.enter().append("svg:rect").attr("class",function(a){return"resize "+a}).attr("width",6).attr("height",6).style("visibility","hidden").style("pointer-events",e.empty()?"none":"all").style("cursor",function(a){return dw[a]}),j.exit().remove(),b&&(k=bJ(b.range()),h.attr("x",k[0]).attr("width",k[1]-k[0]),dp(a,d)),c&&(k=bJ(c.range()),h.attr("y",k[0]).attr("height",k[1]-k[0]),dq(a,d))})}function f(){var a=d3.select(d3.event.target);de=e,dg=this,dj=d,dn=d3.svg.mouse(dg),(dk=a.classed("extent"))?(dn[0]=d[0][0]-dn[0],dn[1]=d[0][1]-dn[1]):a.classed("resize")?(dl=d3.event.target.__data__,dn[0]=d[+/w$/.test(dl)][0],dn[1]=d[+/^n/.test(dl)][1]):d3.event.altKey&&(dm=dn.slice()),dh=!/^(n|s)$/.test(dl)&&b,di=!/^(e|w)$/.test(dl)&&c,df=g(this,arguments),df("brushstart"),dt(),M()}function g(b,c){return function(d){var f=d3.event;try{d3.event={type:d,target:e},a[d].apply(b,c)}finally{d3.event=f}}}var a=d3.dispatch("brushstart","brush","brushend"),b,c,d=[[0,0],[0,0]];return e.x=function(a){return arguments.length?(b=a,e):b},e.y=function(a){return arguments.length?(c=a,e):c},e.extent=function(a){var f,g,h,i,j;return arguments.length?(b&&(f=a[0],g=a[1],c&&(f=f[0],g=g[0]),f=b(f),g=b(g),g<f&&(j=f,f=g,g=j),d[0][0]=f,d[1][0]=g),c&&(h=a[0],i=a[1],b&&(h=h[1],i=i[1]),h=c(h),i=c(i),i<h&&(j=h,h=i,i=j),d[0][1]=h,d[1][1]=i),e):(b&&(f=b.invert(d[0][0]),g=b.invert(d[1][0]),g<f&&(j=f,f=g,g=j)),c&&(h=c.invert(d[0][1]),i=c.invert(d[1][1]),i<h&&(j=h,h=i,i=j)),b&&c?[[f,h],[g,i]]:b?[f,g]:c&&[h,i])},e.clear=function(){return d[0][0]=d[0][1]=d[1][0]=d[1][1]=0,e},e.empty=function(){return b&&d[0][0]===d[1][0]||c&&d[0][1]===d[1][1]},e.on=function(b,c){return a.on(b,c),e},d3.select(window).on("mousemove.brush",dt).on("mouseup.brush",dv).on("keydown.brush",dr).on("keyup.brush",ds),e};var de,df,dg,dh,di,dj,dk,dl,dm,dn,dw={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"};d3.behavior={},d3.behavior.drag=function(){function b(){this.on("mousedown.drag",d).on("touchstart.drag",d),d3.select(window).on("mousemove.drag",dG).on("touchmove.drag",dG).on("mouseup.drag",dH,!0).on("touchend.drag",dH,!0).on("click.drag",dI,!0)}function c(){dx=a,dy=d3.event.target,dB=dF((dz=this).parentNode),dC=0,dA=arguments}function d(){c.apply(this,arguments),dE("dragstart")}var a=d3.dispatch("drag","dragstart","dragend");return b.on=function(c,d){return a.on(c,d),b},b};var dx,dy,dz,dA,dB,dC,dD;d3.behavior.zoom=function(){function d(){this.on("mousedown.zoom",f).on("mousewheel.zoom",g).on("DOMMouseScroll.zoom",g).on("dblclick.zoom",h).on("touchstart.zoom",i),d3.select(window).on("mousemove.zoom",d$).on("mouseup.zoom",d_).on("touchmove.zoom",dZ).on("touchend.zoom",dY).on("click.zoom",ea,!0)}function e(){dO=a,dP=c,dQ=b.zoom,dR=d3.event.target,dS=this,dT=arguments}function f(){e.apply(this,arguments),dK=dW(d3.svg.mouse(dS)),dU=!1,d3.event.preventDefault(),window.focus()}function g(){e.apply(this,arguments),dL||(dL=dW(d3.svg.mouse(dS))),eb(dX()+a[2],d3.svg.mouse(dS),dL)}function h(){e.apply(this,arguments);var b=d3.svg.mouse(dS);eb(d3.event.shiftKey?Math.ceil(a[2]-1):Math.floor(a[2]+1),b,dW(b))}function i(){e.apply(this,arguments);var b=dY(),c,d=Date.now();b.length===1&&d-dN<300&&eb(1+Math.floor(a[2]),c=b[0],dM[c.identifier]),dN=d}var a=[0,0,0],b=d3.dispatch("zoom"),c=ec;return d.extent=function(a){return arguments.length?(c=a==null?ec:a,d):c},d.on=function(a,c){return b.on(a,c),d},d};var dJ,dK,dL,dM={},dN=0,dO,dP,dQ,dR,dS,dT,dU,dV,ec=[[-Infinity,Infinity],[-Infinity,Infinity],[-Infinity,Infinity]]})();
\ No newline at end of file
diff --git a/share/highcharts.js b/share/highcharts.js
deleted file mode 100644 (file)
index f6aefd0..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- Highcharts JS v2.1.1 (2010-12-03)
-
- (c) 2009-2010 Torstein H?nsi
-
- License: www.highcharts.com/license
-*/
-(function(){function oa(a,c){a||(a={});for(var b in c)a[b]=c[b];return a}function pa(a,c){return parseInt(a,c||10)}function Ib(a){return typeof a=="string"}function Jb(a){return typeof a=="object"}function bc(a){return typeof a=="number"}function yc(a,c){for(var b=a.length;b--;)if(a[b]==c){a.splice(b,1);break}}function M(a){return a!==Oa&&a!==null}function ya(a,c,b){var d,e;if(Ib(c))if(M(b))a.setAttribute(c,b);else{if(a&&a.getAttribute)e=a.getAttribute(c)}else if(M(c)&&Jb(c))for(d in c)a.setAttribute(d,
-c[d]);return e}function mc(a){if(!a||a.constructor!=Array)a=[a];return a}function y(){var a=arguments,c,b;for(c=0;c<a.length;c++){b=a[c];if(M(b))return b}}function Vd(a){var c="",b;for(b in a)c+=Ad(b)+":"+a[b]+";";return c}function Ua(a,c){if(Zc)if(c&&c.opacity!==Oa)c.filter="alpha(opacity="+c.opacity*100+")";oa(a.style,c)}function fb(a,c,b,d,e){a=Da.createElement(a);c&&oa(a,c);e&&Ua(a,{padding:0,border:mb,margin:0});b&&Ua(a,b);d&&d.appendChild(a);return a}function Kb(a,c){zc=y(a,c.animation)}function Bd(){var a=
-Pa.global.useUTC;Ac=a?Date.UTC:function(c,b,d,e,f,g){return(new Date(c,b,y(d,1),y(e,0),y(f,0),y(g,0))).getTime()};$c=a?"getUTCMinutes":"getMinutes";ad=a?"getUTCHours":"getHours";bd=a?"getUTCDay":"getDay";nc=a?"getUTCDate":"getDate";Bc=a?"getUTCMonth":"getMonth";Cc=a?"getUTCFullYear":"getFullYear";Cd=a?"setUTCMinutes":"setMinutes";Dd=a?"setUTCHours":"setHours";cd=a?"setUTCDate":"setDate";Ed=a?"setUTCMonth":"setMonth";Fd=a?"setUTCFullYear":"setFullYear"}function Dc(a){Ec||(Ec=fb(Lb));a&&Ec.appendChild(a);
-Ec.innerHTML=""}function wb(a,c){var b=function(){};b.prototype=new a;oa(b.prototype,c);return b}function Gd(a,c,b,d){var e=Pa.lang;a=a;var f=isNaN(c=$a(c))?2:c;c=b===undefined?e.decimalPoint:b;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";b=pa(a=$a(+a||0).toFixed(f))+"";var g=(g=b.length)>3?g%3:0;return e+(g?b.substr(0,g)+d:"")+b.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?c+$a(a-b).toFixed(f).slice(2):"")}function Fc(){}function Hd(a,c){function b(m,h){function x(l,p){this.pos=l;this.minor=p;
-this.isNew=true;p||this.addLabel()}function w(l){if(l){this.options=l;this.id=l.id}return this}function O(){var l=[],p=[],r;Qa=v=null;S=[];t(za,function(o){r=false;t(["xAxis","yAxis"],function(da){if(o.isCartesian&&(da=="xAxis"&&ha||da=="yAxis"&&!ha)&&(o.options[da]==h.index||o.options[da]===Oa&&h.index===0)){o[da]=s;S.push(o);r=true}});if(!o.visible&&u.ignoreHiddenSeries)r=false;if(r){var V,W,F,A,ea;if(!ha){V=o.options.stacking;Gc=V=="percent";if(V){A=o.type+y(o.options.stack,"");ea="-"+A;o.stackKey=
-A;W=l[A]||[];l[A]=W;F=p[ea]||[];p[ea]=F}if(Gc){Qa=0;v=99}}if(o.isCartesian){t(o.data,function(da){var B=da.x,sa=da.y,R=sa<0,X=R?F:W;R=R?ea:A;if(Qa===null)Qa=v=da[G];if(ha)if(B>v)v=B;else{if(B<Qa)Qa=B}else if(M(sa)){if(V)X[B]=M(X[B])?X[B]+sa:sa;da=X?X[B]:sa;if(!Gc)if(da>v)v=da;else if(da<Qa)Qa=da;if(V){aa[R]||(aa[R]={});aa[R][B]={total:da,cum:da}}}});if(/(area|column|bar)/.test(o.type)&&!ha)if(Qa>=0){Qa=0;Id=true}else if(v<0){v=0;Jd=true}}}})}function fa(l,p){var r;Eb=p?1:Ra.pow(10,Mb(Ra.log(l)/Ra.LN10));
-r=l/Eb;if(!p){p=[1,2,2.5,5,10];if(h.allowDecimals===false)if(Eb==1)p=[1,2,5,10];else if(Eb<=0.1)p=[1/Eb]}for(var o=0;o<p.length;o++){l=p[o];if(r<=(p[o]+(p[o+1]||p[o]))/2)break}l*=Eb;return l}function I(l){var p;p=l;if(M(Eb)){p=(Eb<1?T(1/Eb):1)*10;p=T(l*p)/p}return p}function ia(){var l,p,r,o,V=h.tickInterval,W=h.tickPixelInterval;l=h.maxZoom||(ha?ab(m.smallestInterval*5,v-Qa):null);C=L?Ba:qa;if(Nb){r=m[ha?"xAxis":"yAxis"][h.linkedTo];o=r.getExtremes();H=y(o.min,o.dataMin);P=y(o.max,o.dataMax)}else{H=
-y(wa,h.min,Qa);P=y(Sa,h.max,v)}if(P-H<l){o=(l-P+H)/2;H=Ca(H-o,y(h.min,H-o),Qa);P=ab(H+l,y(h.max,H+l),v)}if(!gb&&!Gc&&!Nb&&M(H)&&M(P)){l=P-H||1;if(!M(h.min)&&!M(wa)&&Vb&&(Qa<0||!Id))H-=l*Vb;if(!M(h.max)&&!M(Sa)&&Kd&&(v>0||!Jd))P+=l*Kd}Va=H==P?1:Nb&&!V&&W==r.options.tickPixelInterval?r.tickInterval:y(V,gb?1:(P-H)*W/C);if(!J&&!M(h.tickInterval))s.tickInterval=Va=fa(Va);Hc=h.minorTickInterval==="auto"&&Va?Va/5:h.minorTickInterval;if(J){la=[];V=Pa.global.useUTC;var F=1E3/nb,A=6E4/nb,ea=36E5/nb;W=864E5/
-nb;l=6048E5/nb;o=2592E6/nb;var da=31556952E3/nb,B=[["second",F,[1,2,5,10,15,30]],["minute",A,[1,2,5,10,15,30]],["hour",ea,[1,2,3,4,6,8,12]],["day",W,[1,2]],["week",l,[1,2]],["month",o,[1,2,3,4,6]],["year",da,null]],sa=B[6],R=sa[1],X=sa[2];for(r=0;r<B.length;r++){sa=B[r];R=sa[1];X=sa[2];if(B[r+1])if(Va<=(R*X[X.length-1]+B[r+1][1])/2)break}if(R==da&&Va<5*R)X=[1,2,5];B=fa(Va/R,X);X=new Date(H*nb);X.setMilliseconds(0);if(R>=F)X.setSeconds(R>=A?0:B*Mb(X.getSeconds()/B));if(R>=A)X[Cd](R>=ea?0:B*Mb(X[$c]()/
-B));if(R>=ea)X[Dd](R>=W?0:B*Mb(X[ad]()/B));if(R>=W)X[cd](R>=o?1:B*Mb(X[nc]()/B));if(R>=o){X[Ed](R>=da?0:B*Mb(X[Bc]()/B));p=X[Cc]()}if(R>=da){p-=p%B;X[Fd](p)}R==l&&X[cd](X[nc]()-X[bd]()+h.startOfWeek);r=1;p=X[Cc]();F=X.getTime()/nb;A=X[Bc]();for(ea=X[nc]();F<P&&r<Ba;){la.push(F);if(R==da)F=Ac(p+r*B,0)/nb;else if(R==o)F=Ac(p,A+r*B)/nb;else if(!V&&(R==W||R==l))F=Ac(p,A,ea+r*B*(R==W?1:7));else F+=R*B;r++}la.push(F);Ic=h.dateTimeLabelFormats[sa[0]]}else{r=Mb(H/Va)*Va;p=dd(P/Va)*Va;la=[];for(r=I(r);r<=
-p;){la.push(r);r=I(r+Va)}}if(!Nb){if(gb||ha&&m.hasColumn){p=(gb?1:Va)*0.5;H-=p;P+=p}p=la[0];r=la[la.length-1];if(h.startOnTick)H=p;else H>p&&la.shift();if(h.endOnTick)P=r;else P<r&&la.pop();Fb||(Fb={x:0,y:0});if(!J&&la.length>Fb[G])Fb[G]=la.length}}function Ea(){var l,p;hb=H;cc=P;O();ia();ba=D;D=C/(P-H||1);if(!ha)for(l in aa)for(p in aa[l])aa[l][p].cum=aa[l][p].total;if(!s.isDirty)s.isDirty=H!=hb||P!=cc}function ta(l){l=(new w(l)).render();Ob.push(l);return l}function Ya(){var l=h.title,p=h.alternateGridColor,
-r=h.lineWidth,o,V,W=m.hasRendered,F=W&&M(hb)&&!isNaN(hb);o=S.length&&M(H)&&M(P);C=L?Ba:qa;D=C/(P-H||1);ua=L?U:ob;if(o||Nb){if(Hc&&!gb)for(o=H+(la[0]-H)%Hc;o<=P;o+=Hc){Wb[o]||(Wb[o]=new x(o,true));F&&Wb[o].isNew&&Wb[o].render(null,true);Wb[o].isActive=true;Wb[o].render()}t(la,function(A,ea){if(!Nb||A>=H&&A<=P){F&&pb[A].isNew&&pb[A].render(ea,true);pb[A].isActive=true;pb[A].render(ea)}});p&&t(la,function(A,ea){if(ea%2===0&&A<P){dc[A]||(dc[A]=new w);dc[A].options={from:A,to:la[ea+1]!==Oa?la[ea+1]:P,
-color:p};dc[A].render();dc[A].isActive=true}});W||t((h.plotLines||[]).concat(h.plotBands||[]),function(A){Ob.push((new w(A)).render())})}t([pb,Wb,dc],function(A){for(var ea in A)if(A[ea].isActive)A[ea].isActive=false;else{A[ea].destroy();delete A[ea]}});if(r){o=U+(Ka?Ba:0)+Q;V=La-ob-(Ka?qa:0)+Q;o=Y.crispLine([Wa,L?U:o,L?V:Z,Aa,L?Ta-zb:o,L?V:La-ob],r);if(Fa)Fa.animate({d:o});else Fa=Y.path(o).attr({stroke:h.lineColor,"stroke-width":r,zIndex:7}).add()}if(s.axisTitle){o=L?U:Z;r=pa(l.style.fontSize||
-12);o={low:o+(L?0:C),middle:o+C/2,high:o+(L?C:0)}[l.align];r=(L?Z+qa:U)+(L?1:-1)*(Ka?-1:1)*ed+(E==2?r:0);s.axisTitle[W?"animate":"attr"]({x:L?o:r+(Ka?Ba:0)+Q+(l.x||0),y:L?r-(Ka?qa:0)+Q:o+(l.y||0)})}s.isDirty=false}function Ha(l){for(var p=0;p<Ob.length;p++)Ob[p].id==l&&Ob[p].destroy()}var ha=h.isX,Ka=h.opposite,L=Ga?!ha:ha,E=L?Ka?0:2:Ka?1:3,aa={};h=va(ha?Jc:fd,[Wd,Xd,Ld,Yd][E],h);var s=this,J=h.type=="datetime",Q=h.offset||0,G=ha?"x":"y",C,D,ba,ua=L?U:ob,ma,ra,cb,Ab,Fa,Qa,v,S,wa,Sa,P=null,H=null,
-hb,cc,Vb=h.minPadding,Kd=h.maxPadding,Nb=M(h.linkedTo),Id,Jd,Gc,Md=h.events,gd,Ob=[],Va,Hc,Eb,la,pb={},Wb={},dc={},ec,fc,ed,Ic,gb=h.categories,Zd=h.labels.formatter||function(){var l=this.value;return Ic?Kc(Ic,l):Va%1E6===0?l/1E6+"M":Va%1E3===0?l/1E3+"k":!gb&&l>=1E3?Gd(l,0):l},Lc=L&&h.labels.staggerLines,Xb=h.reversed,Yb=gb&&h.tickmarkPlacement=="between"?0.5:0;x.prototype={addLabel:function(){var l=this.pos,p=h.labels,r=!(l==H&&!y(h.showFirstLabel,1)||l==P&&!y(h.showLastLabel,0)),o=this.label;l=
-Zd.call({isFirst:l==la[0],isLast:l==la[la.length-1],dateTimeLabelFormat:Ic,value:gb&&gb[l]?gb[l]:l});if(o===Oa)this.label=M(l)&&r&&p.enabled?Y.text(l,0,0).attr({align:p.align,rotation:p.rotation}).css(p.style).add(cb):null;else o&&o.attr({text:l})},getLabelSize:function(){var l=this.label;return l?(this.labelBBox=l.getBBox())[L?"height":"width"]:0},render:function(l,p){var r=!this.minor,o=this.label,V=this.pos,W=h.labels,F=this.gridLine,A=r?h.gridLineWidth:h.minorGridLineWidth,ea=r?h.gridLineColor:
-h.minorGridLineColor,da=r?h.gridLineDashStyle:h.minorGridLineDashStyle,B=this.mark,sa=r?h.tickLength:h.minorTickLength,R=r?h.tickWidth:h.minorTickWidth||0,X=r?h.tickColor:h.minorTickColor,oc=r?h.tickPosition:h.minorTickPosition;r=W.step;var qb=p&&Mc||La,Pb;Pb=L?ma(V+Yb,null,null,p)+ua:U+Q+(Ka?(p&&hd||Ta)-zb-U:0);qb=L?qb-ob+Q-(Ka?qa:0):qb-ma(V+Yb,null,null,p)-ua;if(A){V=ra(V+Yb,A,p);if(F===Oa){F={stroke:ea,"stroke-width":A};if(da)F.dashstyle=da;this.gridLine=F=A?Y.path(V).attr(F).add(Ab):null}F&&V&&
-F.animate({d:V})}if(R){if(oc=="inside")sa=-sa;if(Ka)sa=-sa;A=Y.crispLine([Wa,Pb,qb,Aa,Pb+(L?0:-sa),qb+(L?sa:0)],R);if(B)B.animate({d:A});else this.mark=Y.path(A).attr({stroke:X,"stroke-width":R}).add(cb)}if(o){Pb=Pb+W.x-(Yb&&L?Yb*D*(Xb?-1:1):0);qb=qb+W.y-(Yb&&!L?Yb*D*(Xb?1:-1):0);if(Lc)qb+=l%Lc*16;if(r)o[l%r?"hide":"show"]();o[this.isNew?"attr":"animate"]({x:Pb,y:qb})}this.isNew=false},destroy:function(){for(var l in this)this[l]&&this[l].destroy&&this[l].destroy()}};w.prototype={render:function(){var l=
-this,p=l.options,r=p.label,o=l.label,V=p.width,W=p.to,F,A=p.from,ea=p.dashStyle,da=l.svgElem,B=[],sa,R,X=p.color;R=p.zIndex;var oc=p.events;if(V){B=ra(p.value,V);p={stroke:X,"stroke-width":V};if(ea)p.dashstyle=ea}else if(M(A)&&M(W)){A=Ca(A,H);W=ab(W,P);F=ra(W);if((B=ra(A))&&F)B.push(F[4],F[5],F[1],F[2]);else B=null;p={fill:X}}else return;if(M(R))p.zIndex=R;if(da)if(B)da.animate({d:B},null,da.onGetPath);else{da.hide();da.onGetPath=function(){da.show()}}else if(B&&B.length){l.svgElem=da=Y.path(B).attr(p).add();
-if(oc){ea=function(qb){da.on(qb,function(Pb){oc[qb].apply(l,[Pb])})};for(sa in oc)ea(sa)}}if(r&&M(r.text)&&B&&B.length&&Ba>0&&qa>0){r=va({align:L&&F&&"center",x:L?!F&&4:10,verticalAlign:!L&&F&&"middle",y:L?F?16:10:F?6:-4,rotation:L&&!F&&90},r);if(!o)l.label=o=Y.text(r.text,0,0).attr({align:r.textAlign||r.align,rotation:r.rotation,zIndex:R}).css(r.style).add();F=[B[1],B[4],B[6]||B[1]];B=[B[2],B[5],B[7]||B[2]];sa=ab.apply(Ra,F);R=ab.apply(Ra,B);o.align(r,false,{x:sa,y:R,width:Ca.apply(Ra,F)-sa,height:Ca.apply(Ra,
-B)-R});o.show()}else o&&o.hide();return l},destroy:function(){for(var l in this){this[l]&&this[l].destroy&&this[l].destroy();delete this[l]}yc(Ob,this)}};ma=function(l,p,r,o){var V=1,W=0,F=o?ba:D;o=o?hb:H;F||(F=D);if(r){V*=-1;W=C}if(Xb){V*=-1;W-=V*C}if(p){if(Xb)l=C-l;l=l/F+o}else l=V*(l-o)*F+W;return l};ra=function(l,p,r){var o,V,W;l=ma(l,null,null,r);var F=r&&Mc||La,A=r&&hd||Ta,ea;r=V=T(l+ua);o=W=T(F-l-ua);if(isNaN(l))ea=true;else if(L){o=Z;W=F-ob;if(r<U||r>U+Ba)ea=true}else{r=U;V=A-zb;if(o<Z||o>
-Z+qa)ea=true}return ea?null:Y.crispLine([Wa,r,o,Aa,V,W],p||0)};if(Ga&&ha&&Xb===Oa)Xb=true;oa(s,{addPlotBand:ta,addPlotLine:ta,adjustTickAmount:function(){if(Fb&&!J&&!gb&&!Nb){var l=ec,p=la.length;ec=Fb[G];if(p<ec){for(;la.length<ec;)la.push(I(la[la.length-1]+Va));D*=(p-1)/(ec-1);P=la[la.length-1]}if(M(l)&&ec!=l)s.isDirty=true}},categories:gb,getExtremes:function(){return{min:H,max:P,dataMin:Qa,dataMax:v}},getPlotLinePath:ra,getThreshold:function(l){if(H>l)l=H;else if(P<l)l=P;return ma(l,0,1)},isXAxis:ha,
-options:h,plotLinesAndBands:Ob,getOffset:function(){var l=S.length&&M(H)&&M(P),p=0,r=0,o=h.title,V=h.labels,W=[-1,1,1,-1][E];if(!cb){cb=Y.g("axis").attr({zIndex:7}).add();Ab=Y.g("grid").attr({zIndex:1}).add()}fc=0;if(l||Nb){t(la,function(A){if(pb[A])pb[A].addLabel();else pb[A]=new x(A);if(E===0||E==2||{1:"left",3:"right"}[E]==V.align)fc=Ca(pb[A].getLabelSize(),fc)});if(Lc)fc+=(Lc-1)*16}else for(var F in pb){pb[F].destroy();delete pb[F]}if(o&&o.text){if(!s.axisTitle)s.axisTitle=Y.text(o.text,0,0).attr({zIndex:7,
-rotation:o.rotation||0,align:o.textAlign||{low:"left",middle:"center",high:"right"}[o.align]}).css(o.style).add();p=s.axisTitle.getBBox()[L?"height":"width"];r=y(o.margin,L?5:10)}Q=W*(h.offset||Qb[E]);ed=fc+(E!=2&&fc&&W*h.labels[L?"y":"x"])+r;Qb[E]=Ca(Qb[E],ed+p+W*Q)},render:Ya,setCategories:function(l,p){s.categories=gb=l;t(S,function(r){r.translate();r.setTooltipPoints(true)});s.isDirty=true;y(p,true)&&m.redraw()},setExtremes:function(l,p,r,o){Kb(o,m);r=y(r,true);Ia(s,"setExtremes",{min:l,max:p},
-function(){wa=l;Sa=p;r&&m.redraw()})},setScale:Ea,setTickPositions:ia,translate:ma,redraw:function(){gc.resetTracker&&gc.resetTracker();Ya();t(Ob,function(l){l.render()});t(S,function(l){l.isDirty=true})},removePlotBand:Ha,removePlotLine:Ha,reversed:Xb,stacks:aa});for(gd in Md)Ma(s,gd,Md[gd]);Ea()}function d(){var m={};return{add:function(h,x,w,O){if(!m[h]){x=Y.text(x,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-zb-20,y:Z+30}).on("click",O).attr({align:"right",zIndex:20}).add();m[h]=x}},
-remove:function(h){Dc(m[h].element);m[h]=null}}}function e(m){function h(){var G=this.points||mc(this.point),C=G[0].series.xAxis,D=this.x;C=C&&C.options.type=="datetime";var ba=Ib(D)||C,ua,ma;ma=ba?['<span style="font-size: 10px">',C?Kc("%A, %b %e, %Y",D):D,"</span><br/>"]:[];t(G,function(ra){ua=ra.series;ma.push('<span style="color:'+ua.color+'">',ra.name||ua.name,"</span>: ",!ba?"<b>x = "+(ra.name||ra.x)+",</b> ":"","<b>",!ba?"y = ":"",ra.y,"</b><br/>")});return ma.join("")}function x(G,C){E=ha?
-G:(2*E+G)/3;aa=ha?C:(aa+C)/2;s.translate(E,aa);id=$a(G-E)>1||$a(C-aa)>1?function(){x(G,C)}:null}function w(){if(!ha){var G=q.hoverPoints;s.hide();t(ia,function(C){C.hide()});G&&t(G,function(C){C.setState()});q.hoverPoints=null;ha=true}}var O,fa=m.borderWidth,I=m.crosshairs,ia=[],Ea=m.style,ta=m.shared,Ya=pa(Ea.padding),Ha=fa+Ya,ha=true,Ka,L,E=0,aa=0;Ea.padding=0;var s=Y.g("tooltip").attr({zIndex:8}).add(),J=Y.rect(Ha,Ha,0,0,m.borderRadius,fa).attr({fill:m.backgroundColor,"stroke-width":fa}).add(s).shadow(m.shadow),
-Q=Y.text("",Ya+Ha,pa(Ea.fontSize)+Ya+Ha).attr({zIndex:1}).css(Ea).add(s);s.hide();return{shared:ta,refresh:function(G){var C,D,ba,ua=0,ma={},ra=[];ba=G.tooltipPos;C=m.formatter||h;ma=q.hoverPoints;var cb=function(Fa){return{series:Fa.series,point:Fa,x:Fa.category,y:Fa.y,percentage:Fa.percentage,total:Fa.total||Fa.stackTotal}};if(ta){ma&&t(ma,function(Fa){Fa.setState()});q.hoverPoints=G;t(G,function(Fa){Fa.setState(xb);ua+=Fa.plotY;ra.push(cb(Fa))});D=G[0].plotX;ua=T(ua)/G.length;ma={x:G[0].category};
-ma.points=ra;G=G[0]}else ma=cb(G);ma=C.call(ma);O=G.series;D=ta?D:G.plotX;ua=ta?ua:G.plotY;C=T(ba?ba[0]:Ga?Ba-ua:D);D=T(ba?ba[1]:Ga?qa-D:ua);ba=!G.series.isCartesian||hc(C,D);if(ma===false||!ba)w();else{if(ha){s.show();ha=false}Q.attr({text:ma});ba=Q.getBBox();Ka=ba.width;L=ba.height;J.attr({width:Ka+2*Ya,height:L+2*Ya,stroke:m.borderColor||G.color||O.color||"#606060"});C=C-Ka+U-25;D=D-L+Z+10;if(C<7){C=7;D-=30}if(D<5)D=5;else if(D+L>La)D=La-L-5;x(T(C-Ha),T(D-Ha))}if(I){I=mc(I);D=I.length;for(var Ab;D--;)if(I[D]&&
-(Ab=G.series[D?"yAxis":"xAxis"])){C=Ab.getPlotLinePath(G[D?"y":"x"],1);if(ia[D])ia[D].attr({d:C,visibility:Bb});else{ba={"stroke-width":I[D].width||1,stroke:I[D].color||"#C0C0C0",zIndex:2};if(I[D].dashStyle)ba.dashstyle=I[D].dashStyle;ia[D]=Y.path(C).attr(ba).add()}}}},hide:w}}function f(m,h){function x(E){var aa;E=E||rb.event;if(!E.target)E.target=E.srcElement;aa=E.touches?E.touches.item(0):E;if(E.type!="mousemove"||rb.opera){for(var s=xa,J={left:s.offsetLeft,top:s.offsetTop};s=s.offsetParent;){J.left+=
-s.offsetLeft;J.top+=s.offsetTop;if(s!=Da.body&&s!=Da.documentElement){J.left-=s.scrollLeft;J.top-=s.scrollTop}}pc=J}if(Zc){E.chartX=E.x;E.chartY=E.y}else if(aa.layerX===Oa){E.chartX=aa.pageX-pc.left;E.chartY=aa.pageY-pc.top}else{E.chartX=E.layerX;E.chartY=E.layerY}return E}function w(E){var aa={xAxis:[],yAxis:[]};t(Xa,function(s){var J=s.translate,Q=s.isXAxis;aa[Q?"xAxis":"yAxis"].push({axis:s,value:J((Ga?!Q:Q)?E.chartX-U:qa-E.chartY+Z,true)})});return aa}function O(){var E=m.hoverSeries,aa=m.hoverPoint;
-aa&&aa.onMouseOut();E&&E.onMouseOut();qc&&qc.hide();jd=null}function fa(){if(ta){var E={xAxis:[],yAxis:[]},aa=ta.getBBox(),s=aa.x-U,J=aa.y-Z;if(Ea){t(Xa,function(Q){var G=Q.translate,C=Q.isXAxis,D=Ga?!C:C,ba=G(D?s:qa-J-aa.height,true);G=G(D?s+aa.width:qa-J,true);E[C?"xAxis":"yAxis"].push({axis:Q,min:ab(ba,G),max:Ca(ba,G)})});Ia(m,"selection",E,kd)}ta=ta.destroy()}m.mouseIsDown=ld=Ea=false;Cb(Da,Gb?"touchend":"mouseup",fa)}var I,ia,Ea,ta,Ya=u.zoomType,Ha=/x/.test(Ya),ha=/y/.test(Ya),Ka=Ha&&!Ga||ha&&
-Ga,L=ha&&!Ga||Ha&&Ga;Nc=function(){if(Oc){Oc.translate(U,Z);Ga&&Oc.attr({width:m.plotWidth,height:m.plotHeight}).invert()}else m.trackerGroup=Oc=Y.g("tracker").attr({zIndex:9}).add()};Nc();if(h.enabled)m.tooltip=qc=e(h);(function(){var E=true;xa.onmousedown=function(s){s=x(s);m.mouseIsDown=ld=true;I=s.chartX;ia=s.chartY;Ma(Da,Gb?"touchend":"mouseup",fa)};var aa=function(s){if(!(s&&s.touches&&s.touches.length>1)){s=x(s);if(!Gb)s.returnValue=false;var J=s.chartX,Q=s.chartY,G=!hc(J-U,Q-Z);if(Gb&&s.type==
-"touchstart")if(ya(s.target,"isTracker"))m.runTrackerClick||s.preventDefault();else!$d&&!G&&s.preventDefault();if(G){E||O();if(J<U)J=U;else if(J>U+Ba)J=U+Ba;if(Q<Z)Q=Z;else if(Q>Z+qa)Q=Z+qa}if(ld&&s.type!="touchstart"){if(Ea=Math.sqrt(Math.pow(I-J,2)+Math.pow(ia-Q,2))>10){if(ic&&(Ha||ha)&&hc(I-U,ia-Z))ta||(ta=Y.rect(U,Z,Ka?1:Ba,L?1:qa,0).attr({fill:"rgba(69,114,167,0.25)",zIndex:7}).add());if(ta&&Ka){J=J-I;ta.attr({width:$a(J),x:(J>0?0:J)+I})}if(ta&&L){Q=Q-ia;ta.attr({height:$a(Q),y:(Q>0?0:Q)+ia})}}}else if(!G){var C;
-Q=m.hoverPoint;J=m.hoverSeries;var D,ba,ua=Ta,ma=Ga?s.chartY:s.chartX-U;if(qc&&h.shared){C=[];D=za.length;for(ba=0;ba<D;ba++)if(za[ba].visible&&za[ba].tooltipPoints.length){s=za[ba].tooltipPoints[ma];s._dist=$a(ma-s.plotX);ua=ab(ua,s._dist);C.push(s)}for(D=C.length;D--;)C[D]._dist>ua&&C.splice(D,1);if(C.length&&C[0].plotX!=jd){qc.refresh(C);jd=C[0].plotX}}if(J&&J.tracker)(s=J.tooltipPoints[ma])&&s!=Q&&s.onMouseOver()}return(E=G)||!ic}};xa.onmousemove=aa;Ma(xa,"mouseleave",O);xa.ontouchstart=function(s){if(Ha||
-ha)xa.onmousedown(s);aa(s)};xa.ontouchmove=aa;xa.ontouchend=function(){Ea&&O()};xa.onclick=function(s){var J=m.hoverPoint;s=x(s);s.cancelBubble=true;if(!Ea)if(J&&ya(s.target,"isTracker")){var Q=J.plotX,G=J.plotY;oa(J,{pageX:pc.left+U+(Ga?Ba-G:Q),pageY:pc.top+Z+(Ga?qa-Q:G)});Ia(J.series,"click",oa(s,{point:J}));J.firePointEvent("click",s)}else{oa(s,w(s));hc(s.chartX-U,s.chartY-Z)&&Ia(m,"click",s)}Ea=false}})();Nd=setInterval(function(){id&&id()},32);oa(this,{zoomX:Ha,zoomY:ha,resetTracker:O})}function g(m){var h=
-m.type||u.type||u.defaultSeriesType,x=sb[h],w=q.hasRendered;if(w)if(Ga&&h=="column")x=sb.bar;else if(!Ga&&h=="bar")x=sb.column;h=new x;h.init(q,m);if(!w&&h.inverted)Ga=true;if(h.isCartesian)ic=h.isCartesian;za.push(h);return h}function i(){u.alignTicks!==false&&t(Xa,function(m){m.adjustTickAmount()});Fb=null}function j(m){var h=q.isDirtyLegend,x,w=q.isDirtyBox,O=za.length,fa=O,I=q.clipRect;for(Kb(m,q);fa--;){m=za[fa];if(m.isDirty&&m.options.stacking){x=true;break}}if(x)for(fa=O;fa--;){m=za[fa];if(m.options.stacking)m.isDirty=
-true}t(za,function(ia){if(ia.isDirty){ia.cleanData();ia.getSegments();if(ia.options.legendType=="point")h=true}});if(h&&md.renderLegend){md.renderLegend();q.isDirtyLegend=false}if(ic){if(!Pc){Fb=null;t(Xa,function(ia){ia.setScale()})}i();rc();t(Xa,function(ia){if(ia.isDirty||w){ia.redraw();w=true}})}if(w){nd();Nc();if(I){Qc(I);I.animate({width:q.plotSizeX,height:q.plotSizeY})}}t(za,function(ia){ia.isDirty&&ia.visible&&ia.redraw()});gc&&gc.resetTracker&&gc.resetTracker();Ia(q,"redraw")}function k(){var m=
-a.xAxis||{},h=a.yAxis||{},x;m=mc(m);t(m,function(w,O){w.index=O;w.isX=true});h=mc(h);t(h,function(w,O){w.index=O});Xa=m.concat(h);q.xAxis=[];q.yAxis=[];Xa=jc(Xa,function(w){x=new b(q,w);q[x.isXAxis?"xAxis":"yAxis"].push(x);return x});i()}function n(m,h){kc=va(a.title,m);sc=va(a.subtitle,h);t([["title",m,kc],["subtitle",h,sc]],function(x){var w=x[0],O=q[w],fa=x[1];x=x[2];if(O&&fa){O.destroy();O=null}if(x&&x.text&&!O)q[w]=Y.text(x.text,0,0).attr({align:x.align,"class":"highcharts-"+w,zIndex:1}).css(x.style).add().align(x,
-false,tc)})}function z(){ib=u.renderTo;Od=Zb+od++;if(Ib(ib))ib=Da.getElementById(ib);ib.innerHTML="";if(!ib.offsetWidth){Rb=ib.cloneNode(0);Ua(Rb,{position:lc,top:"-9999px",display:""});Da.body.appendChild(Rb)}Rc=(Rb||ib).offsetWidth;uc=(Rb||ib).offsetHeight;q.chartWidth=Ta=u.width||Rc||600;q.chartHeight=La=u.height||(uc>19?uc:400);q.container=xa=fb(Lb,{className:"highcharts-container"+(u.className?" "+u.className:""),id:Od},oa({position:Pd,overflow:tb,width:Ta+bb,height:La+bb,textAlign:"left"},u.style),
-Rb||ib);q.renderer=Y=u.renderer=="SVG"?new Sc(xa,Ta,La):new Qd(xa,Ta,La);var m;if(/Gecko/.test(vc)){m=function(){Ua(xa,{left:0,top:0});var h=xa.getBoundingClientRect();Ua(xa,{left:-h.left%1+bb,top:-h.top%1+bb})};m();Ma(rb,"resize",m);Ma(q,"destroy",function(){Cb(rb,"resize",m)})}}function K(){function m(){var x=u.width||ib.offsetWidth,w=u.height||ib.offsetHeight;if(x&&w){if(x!=Rc||w!=uc){clearTimeout(h);h=setTimeout(function(){pd(x,w,false)},100)}Rc=x;uc=w}}var h;Ma(window,"resize",m);Ma(q,"destroy",
-function(){Cb(window,"resize",m)})}function ja(){var m=a.labels,h=a.credits,x;n();md=q.legend=new ae(q);rc();t(Xa,function(w){w.setTickPositions(true)});i();rc();nd();ic&&t(Xa,function(w){w.render()});if(!q.seriesGroup)q.seriesGroup=Y.g("series-group").attr({zIndex:3}).add();t(za,function(w){w.translate();w.setTooltipPoints();w.render()});m.items&&t(m.items,function(){var w=oa(m.style,this.style),O=pa(w.left)+U,fa=pa(w.top)+Z+12;delete w.left;delete w.top;Y.text(this.html,O,fa).attr({zIndex:2}).css(w).add()});
-if(!q.toolbar)q.toolbar=d(q);if(h.enabled&&!q.credits){x=h.href;Y.text(h.text,0,0).on("click",function(){if(x)location.href=x}).attr({align:h.position.align,zIndex:8}).css(h.style).add().align(h.position)}Nc();q.hasRendered=true;if(Rb){ib.appendChild(xa);Dc(Rb)}}function $(){var m=za.length,h=xa.parentNode;Ia(q,"destroy");Cb(rb,"unload",$);Cb(q);for(t(Xa,function(x){Cb(x)});m--;)za[m].destroy();xa.innerHTML="";Cb(xa);h&&h.removeChild(xa);xa=null;Y.alignedObjects=null;clearInterval(Nd);for(m in q)delete q[m]}
-function ga(){if(!Tc&&Da.readyState!="complete")Da.attachEvent("onreadystatechange",function(){Da.detachEvent("onreadystatechange",ga);ga()});else{z();qd();rd();t(a.series||[],function(m){g(m)});q.inverted=Ga=y(Ga,a.chart.inverted);k();q.render=ja;q.tracker=gc=new f(q,a.tooltip);ja();Ia(q,"load");c&&c.apply(q,[q]);t(q.callbacks,function(m){m.apply(q,[q])})}}Jc=va(Jc,Pa.xAxis);fd=va(fd,Pa.yAxis);Pa.xAxis=Pa.yAxis=null;a=va(Pa,a);var u=a.chart,N=u.margin;N=Jb(N)?N:[N,N,N,N];var ka=y(u.marginTop,N[0]),
-Na=y(u.marginRight,N[1]),ca=y(u.marginBottom,N[2]),na=y(u.marginLeft,N[3]),Za=u.spacingTop,jb=u.spacingRight,sd=u.spacingBottom,Uc=u.spacingLeft,tc,kc,sc,Z,zb,ob,U,Qb,ib,Rb,xa,Od,Rc,uc,Ta,La,hd,Mc,td,ud,vd,wd,q=this,$d=(N=u.events)&&!!N.click,xd,hc,qc,ld,$b,Rd,yd,qa,Ba,gc,Oc,Nc,md,Sb,Tb,pc,ic=u.showAxes,Pc=0,Xa=[],Fb,za=[],Ga,Y,id,Nd,jd,nd,rc,qd,rd,pd,kd,Sd,ae=function(m){function h(v,S){var wa=v.legendItem,Sa=v.legendLine,P=v.legendSymbol,H=L.color,hb=S?I.itemStyle.color:H;H=S?v.color:H;wa&&wa.css({fill:hb});
-Sa&&Sa.attr({stroke:H});P&&P.attr({stroke:H,fill:H})}function x(v,S,wa){var Sa=v.legendItem,P=v.legendLine,H=v.legendSymbol;v=v.checkbox;Sa&&Sa.attr({x:S,y:wa});P&&P.translate(S,wa-4);H&&H.attr({x:S+H.xOff,y:wa+H.yOff});if(v){v.x=S;v.y=wa}}function w(){t(Ya,function(v){var S=v.checkbox;S&&Ua(S,{left:ra.attr("translateX")+v.legendItemWidth+S.x-40+bb,top:ra.attr("translateY")+S.y-11+bb})})}function O(v){var S,wa,Sa,P,H,hb=v.legendItem;P=v.series||v;if(!hb){H=/^(bar|pie|area|column)$/.test(P.type);v.legendItem=
-hb=Y.text(I.labelFormatter.call(v),0,0).css(v.visible?ha:L).on("mouseover",function(){v.setState(xb);hb.css(Ka)}).on("mouseout",function(){hb.css(v.visible?ha:L);v.setState()}).on("click",function(){var Vb=function(){v.setVisible()};v.firePointEvent?v.firePointEvent("legendItemClick",null,Vb):Ia(v,"legendItemClick",null,Vb)}).attr({zIndex:2}).add(ra);if(!H&&v.options&&v.options.lineWidth){var cc=v.options;P={"stroke-width":cc.lineWidth,zIndex:2};if(cc.dashStyle)P.dashstyle=cc.dashStyle;v.legendLine=
-Y.path([Wa,-Ea-ta,0,Aa,-ta,0]).attr(P).add(ra)}if(H)S=Y.rect(wa=-Ea-ta,Sa=-11,Ea,12,2).attr({"stroke-width":0,zIndex:3}).add(ra);else if(v.options&&v.options.marker&&v.options.marker.enabled)S=Y.symbol(v.symbol,wa=-Ea/2-ta,Sa=-4,v.options.marker.radius).attr(v.pointAttr[db]).attr({zIndex:3}).add(ra);if(S){S.xOff=wa;S.yOff=Sa}v.legendSymbol=S;h(v,v.visible);if(v.options&&v.options.showCheckbox){v.checkbox=fb("input",{type:"checkbox",checked:v.selected,defaultChecked:v.selected},I.itemCheckboxStyle,
-xa);Ma(v.checkbox,"click",function(Vb){Ia(v,"checkboxClick",{checked:Vb.target.checked},function(){v.select()})})}}x(v,Q,G);S=hb.getBBox();C=G;D=S.height;v.legendItemWidth=S=I.itemWidth||Ea+ta+S.width+aa;if(ia){Q+=S;cb=Ab||Ca(Q-J,cb);if(Q-J+S>(Ab||Ta-2*E-J)){Q=J;G+=D}}else{G+=D;cb=Ab||Ca(S,cb)}Ya.push(v)}function fa(){Q=J;G=s;C=cb=0;Ya=[];ra||(ra=Y.g("legend").attr({zIndex:7}).add());Qa&&Fa.reverse();t(Fa,function(Sa){if(Sa.options.showInLegend)t(Sa.options.legendType=="point"?Sa.data:[Sa],O)});Qa&&
-Fa.reverse();Sb=Ab||cb;Tb=C-s+D;if(ua||ma){Sb+=2*E;Tb+=2*E;if(ba)Sb>0&&Tb>0&&ba.animate({width:Sb,height:Tb});else ba=Y.rect(0,0,Sb,Tb,I.borderRadius,ua||0).attr({stroke:I.borderColor,"stroke-width":ua||0,fill:ma||mb}).add(ra).shadow(I.shadow);ba[Ya.length?"show":"hide"]()}for(var v=["left","right","top","bottom"],S,wa=4;wa--;){S=v[wa];if(Ha[S]&&Ha[S]!="auto"){I[wa<2?"align":"verticalAlign"]=S;I[wa<2?"x":"y"]=pa(Ha[S])*(wa%2?-1:1)}}ra.align(oa(I,{width:Sb,height:Tb}),true,tc);Pc||w()}var I=m.options.legend;
-if(I.enabled){var ia=I.layout=="horizontal",Ea=I.symbolWidth,ta=I.symbolPadding,Ya,Ha=I.style,ha=I.itemStyle,Ka=I.itemHoverStyle,L=I.itemHiddenStyle,E=pa(Ha.padding),aa=20,s=18,J=4+E+Ea+ta,Q,G,C,D=0,ba,ua=I.borderWidth,ma=I.backgroundColor,ra,cb,Ab=I.width,Fa=m.series,Qa=I.reversed;fa();Ma(m,"endResize",w);return{colorizeItem:h,destroyItem:function(v){var S=v.checkbox;t(["legendItem","legendLine","legendSymbol"],function(wa){v[wa]&&v[wa].destroy()});S&&Dc(v.checkbox)},renderLegend:fa}}};hc=function(m,
-h){return m>=0&&m<=Ba&&h>=0&&h<=qa};Sd=function(){Ia(q,"selection",{resetSelection:true},kd);q.toolbar.remove("zoom")};kd=function(m){var h=Pa.lang,x=q.pointCount<100;q.toolbar.add("zoom",h.resetZoom,h.resetZoomTitle,Sd);!m||m.resetSelection?t(Xa,function(w){w.setExtremes(null,null,false,x)}):t(m.xAxis.concat(m.yAxis),function(w){var O=w.axis;if(q.tracker[O.isXAxis?"zoomX":"zoomY"])O.setExtremes(w.min,w.max,false,x)});j()};rc=function(){var m=a.legend,h=y(m.margin,10),x=m.x,w=m.y,O=m.align,fa=m.verticalAlign,
-I;qd();if((q.title||q.subtitle)&&!M(ka))if(I=Ca(q.title&&!kc.floating&&!kc.verticalAlign&&kc.y||0,q.subtitle&&!sc.floating&&!sc.verticalAlign&&sc.y||0))Z=Ca(Z,I+y(kc.margin,15)+Za);if(m.enabled&&!m.floating)if(O=="right")M(Na)||(zb=Ca(zb,Sb-x+h+jb));else if(O=="left")M(na)||(U=Ca(U,Sb+x+h+Uc));else if(fa=="top")M(ka)||(Z=Ca(Z,Tb+w+h+Za));else if(fa=="bottom")M(ca)||(ob=Ca(ob,Tb-w+h+sd));ic&&t(Xa,function(ia){ia.getOffset()});M(na)||(U+=Qb[3]);M(ka)||(Z+=Qb[0]);M(ca)||(ob+=Qb[2]);M(Na)||(zb+=Qb[1]);
-rd()};pd=function(m,h,x){var w=q.title,O=q.subtitle;Pc+=1;Kb(x,q);Mc=La;hd=Ta;Ta=T(m);La=T(h);Ua(xa,{width:Ta+bb,height:La+bb});Y.setSize(Ta,La);Ba=Ta-U-zb;qa=La-Z-ob;Fb=null;t(Xa,function(fa){fa.isDirty=true;fa.setScale()});t(za,function(fa){fa.isDirty=true});q.isDirtyLegend=true;q.isDirtyBox=true;rc();w&&w.align(null,null,tc);O&&O.align(null,null,tc);j();Mc=null;Ia(q,"resize");setTimeout(function(){Ia(q,"endResize",null,function(){Pc-=1})},zc&&zc.duration||500)};rd=function(){q.plotLeft=U=T(U);
-q.plotTop=Z=T(Z);q.plotWidth=Ba=T(Ta-U-zb);q.plotHeight=qa=T(La-Z-ob);q.plotSizeX=Ga?qa:Ba;q.plotSizeY=Ga?Ba:qa;tc={x:Uc,y:Za,width:Ta-Uc-jb,height:La-Za-sd}};qd=function(){Z=y(ka,Za);zb=y(Na,jb);ob=y(ca,sd);U=y(na,Uc);Qb=[0,0,0,0]};nd=function(){var m=u.borderWidth||0,h=u.backgroundColor,x=u.plotBackgroundColor,w=u.plotBackgroundImage,O,fa={x:U,y:Z,width:Ba,height:qa};O=2*m+(u.shadow?8:0);if(m||h)if(td)td.animate({width:Ta-O,height:La-O});else td=Y.rect(O/2,O/2,Ta-O,La-O,u.borderRadius,m).attr({stroke:u.borderColor,
-"stroke-width":m,fill:h||mb}).add().shadow(u.shadow);if(x)if(ud)ud.animate(fa);else ud=Y.rect(U,Z,Ba,qa,0).attr({fill:x}).add().shadow(u.plotShadow);if(w)if(vd)vd.animate(fa);else vd=Y.image(w,U,Z,Ba,qa).add();if(u.plotBorderWidth)if(wd)wd.animate(fa);else wd=Y.rect(U,Z,Ba,qa,0,u.plotBorderWidth).attr({stroke:u.plotBorderColor,"stroke-width":u.plotBorderWidth,zIndex:4}).add();q.isDirtyBox=false};Vc=Hb=0;Ma(rb,"unload",$);u.reflow!==false&&Ma(q,"load",K);if(N)for(xd in N)Ma(q,xd,N[xd]);q.options=a;
-q.series=za;q.addSeries=function(m,h,x){var w;if(m){Kb(x,q);h=y(h,true);Ia(q,"addSeries",{options:m},function(){w=g(m);w.isDirty=true;q.isDirtyLegend=true;h&&q.redraw()})}return w};q.animation=y(u.animation,true);q.destroy=$;q.get=function(m){var h,x,w;for(h=0;h<Xa.length;h++)if(Xa[h].options.id==m)return Xa[h];for(h=0;h<za.length;h++)if(za[h].options.id==m)return za[h];for(h=0;h<za.length;h++){w=za[h].data;for(x=0;x<w.length;x++)if(w[x].id==m)return w[x]}return null};q.getSelectedPoints=function(){var m=
-[];t(za,function(h){m=m.concat(zd(h.data,function(x){return x.selected}))});return m};q.getSelectedSeries=function(){return zd(za,function(m){return m.selected})};q.hideLoading=function(){Wc($b,{opacity:0},{duration:a.loading.hideDuration,complete:function(){Ua($b,{display:mb})}});yd=false};q.isInsidePlot=hc;q.redraw=j;q.setSize=pd;q.setTitle=n;q.showLoading=function(m){var h=a.loading;if(!$b){$b=fb(Lb,{className:"highcharts-loading"},oa(h.style,{left:U+bb,top:Z+bb,width:Ba+bb,height:qa+bb,zIndex:10,
-display:mb}),xa);Rd=fb("span",null,h.labelStyle,$b)}Rd.innerHTML=m||a.lang.loading;if(!yd){Ua($b,{opacity:0,display:""});Wc($b,{opacity:h.style.opacity},{duration:h.showDuration});yd=true}};q.pointCount=0;ga()}var Da=document,rb=window,Ra=Math,T=Ra.round,Mb=Ra.floor,dd=Ra.ceil,Ca=Ra.max,ab=Ra.min,$a=Ra.abs,ub=Ra.cos,yb=Ra.sin,Ub=Ra.PI,Td=Ub*2/360,vc=navigator.userAgent,Zc=/msie/i.test(vc)&&!rb.opera,wc=Da.documentMode==8,be=/AppleWebKit/.test(vc),Tc=rb.SVGAngle||Da.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure",
-"1.1"),Gb="ontouchstart"in Da.documentElement,Hb,Vc,ce={},od=0,nb=1,Ec,Pa,Kc,zc,Xc,Oa,Lb="div",lc="absolute",Pd="relative",tb="hidden",Zb="highcharts-",Bb="visible",bb="px",mb="none",Wa="M",Aa="L",Ud="rgba(192,192,192,"+(Tc?1.0E-6:0.0020)+")",db="",xb="hover",Ac,$c,ad,bd,nc,Bc,Cc,Cd,Dd,cd,Ed,Fd,eb=rb.HighchartsAdapter,Db=eb||{},t=Db.each,zd=Db.grep,jc=Db.map,va=Db.merge,Ad=Db.hyphenate,Ma=Db.addEvent,Cb=Db.removeEvent,Ia=Db.fireEvent,Wc=Db.animate,Qc=Db.stop,sb={};eb&&eb.init&&eb.init();if(!eb&&rb.jQuery){var kb=
-jQuery;t=function(a,c){for(var b=0,d=a.length;b<d;b++)if(c.call(a[b],a[b],b,a)===false)return b};zd=kb.grep;jc=function(a,c){for(var b=[],d=0,e=a.length;d<e;d++)b[d]=c.call(a[d],a[d],d,a);return b};va=function(){var a=arguments;return kb.extend(true,null,a[0],a[1],a[2],a[3])};Ad=function(a){return a.replace(/([A-Z])/g,function(c,b){return"-"+b.toLowerCase()})};Ma=function(a,c,b){kb(a).bind(c,b)};Cb=function(a,c,b){var d=Da.removeEventListener?"removeEventListener":"detachEvent";if(Da[d]&&!a[d])a[d]=
-function(){};kb(a).unbind(c,b)};Ia=function(a,c,b,d){var e=kb.Event(c),f="detached"+c;oa(e,b);if(a[c]){a[f]=a[c];a[c]=null}kb(a).trigger(e);if(a[f]){a[c]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};Wc=function(a,c,b){var d=kb(a);if(c.d){a.toD=c.d;c.d=1}d.stop();d.animate(c,b)};Qc=function(a){kb(a).stop()};kb.extend(kb.easing,{easeOutQuad:function(a,c,b,d,e){return-d*(c/=e)*(c-2)+b}});var de=jQuery.fx.step._default,ee=jQuery.fx.prototype.cur;kb.fx.step._default=function(a){var c=a.elem;c.attr?
-c.attr(a.prop,a.now):de.apply(this,arguments)};kb.fx.step.d=function(a){var c=a.elem;if(!a.started){var b=Xc.init(c,c.d,c.toD);a.start=b[0];a.end=b[1];a.started=true}c.attr("d",Xc.step(a.start,a.end,a.pos,c.toD))};kb.fx.prototype.cur=function(){var a=this.elem;return a.attr?a.attr(this.prop):ee.apply(this,arguments)}}Xc={init:function(a,c,b){c=c||"";var d=a.shift,e=c.indexOf("C")>-1,f=e?7:3,g;c=c.split(" ");b=[].concat(b);var i,j,k=function(n){for(g=n.length;g--;)n[g]==Wa&&n.splice(g+1,0,n[g+1],n[g+
-2],n[g+1],n[g+2])};if(e){k(c);k(b)}if(a.isArea){i=c.splice(c.length-6,6);j=b.splice(b.length-6,6)}if(d){b=[].concat(b).splice(0,f).concat(b);a.shift=false}for(a=b.length;c.length<a;){d=[].concat(c).splice(c.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}c=c.concat(d)}if(i){c=c.concat(i);b=b.concat(j)}return[c,b]},step:function(a,c,b,d){var e=[],f=a.length;if(b==1)e=d;else if(f==c.length&&b<1)for(;f--;){d=parseFloat(a[f]);e[f]=isNaN(d)?a[f]:b*parseFloat(c[f]-d)+d}else e=c;return e}};eb={enabled:true,
-align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px"}};Pa={colors:["#4572A7","#AA4643","#89A54E","#80699B","#3D96AE","#DB843D","#92A8CD","#A47D7C","#B5CA92"],symbols:["circle","diamond","square","triangle","triangle-down"],lang:{loading:"Loading...",months:["January","February","March","April","May","June","July","August","September","October","November","December"],weekdays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],decimalPoint:".",resetZoom:"Reset zoom",resetZoomTitle:"Reset zoom level 1:1",
-thousandsSep:","},global:{useUTC:true},chart:{borderColor:"#4572A7",borderRadius:5,defaultSeriesType:"line",ignoreHiddenSeries:true,spacingTop:10,spacingRight:10,spacingBottom:15,spacingLeft:10,style:{fontFamily:'"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif',fontSize:"12px"},backgroundColor:"#FFFFFF",plotBorderColor:"#C0C0C0"},title:{text:"Chart title",align:"center",y:15,style:{color:"#3E576F",fontSize:"16px"}},subtitle:{text:"",align:"center",y:30,style:{color:"#6D869F"}},
-plotOptions:{line:{allowPointSelect:false,showCheckbox:false,animation:{duration:1E3},events:{},lineWidth:2,shadow:true,marker:{enabled:true,lineWidth:0,radius:4,lineColor:"#FFFFFF",states:{hover:{},select:{fillColor:"#FFFFFF",lineColor:"#000000",lineWidth:2}}},point:{events:{}},dataLabels:va(eb,{enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:lc,color:"#3E576F"}},legend:{enabled:true,
-align:"center",layout:"horizontal",labelFormatter:function(){return this.name},borderWidth:1,borderColor:"#909090",borderRadius:5,shadow:false,style:{padding:"5px"},itemStyle:{cursor:"pointer",color:"#3E576F"},itemHoverStyle:{cursor:"pointer",color:"#000000"},itemHiddenStyle:{color:"#C0C0C0"},itemCheckboxStyle:{position:lc,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Pd,top:"1em"},showDuration:100,
-style:{position:lc,backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Gb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",cursor:"pointer"}},credits:{enabled:true,text:"Highcharts.com",href:"http://www.highcharts.com",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#909090",
-fontSize:"10px"}}};var Jc={dateTimeLabelFormats:{second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e. %b",week:"%e. %b",month:"%b '%y",year:"%Y"},endOnTick:false,gridLineColor:"#C0C0C0",labels:eb,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",minorGridLineWidth:1,minorTickColor:"#A0A0A0",minorTickLength:2,minorTickPosition:"outside",startOfWeek:1,startOnTick:false,tickColor:"#C0D0E0",tickLength:5,tickmarkPlacement:"between",tickPixelInterval:100,
-tickPosition:"outside",tickWidth:1,title:{align:"middle",style:{color:"#6D869F",fontWeight:"bold"}},type:"linear"},fd=va(Jc,{endOnTick:true,gridLineWidth:1,tickPixelInterval:72,showLastLabel:true,labels:{align:"right",x:-8,y:3},lineWidth:0,maxPadding:0.05,minPadding:0.05,startOnTick:true,tickWidth:0,title:{rotation:270,text:"Y-values"}}),Yd={labels:{align:"right",x:-8,y:3},title:{rotation:270}},Xd={labels:{align:"left",x:8,y:3},title:{rotation:90}},Ld={labels:{align:"center",x:0,y:14},title:{rotation:0}},
-Wd=va(Ld,{labels:{y:-5}}),vb=Pa.plotOptions;eb=vb.line;vb.spline=va(eb);vb.scatter=va(eb,{lineWidth:0,states:{hover:{lineWidth:0}}});vb.area=va(eb,{});vb.areaspline=va(vb.area);vb.column=va(eb,{borderColor:"#FFFFFF",borderWidth:1,borderRadius:0,groupPadding:0.2,marker:null,pointPadding:0.1,minPointLength:0,states:{hover:{brightness:0.1,shadow:false},select:{color:"#C0C0C0",borderColor:"#000000",shadow:false}}});vb.bar=va(vb.column,{dataLabels:{align:"left",x:5,y:0}});vb.pie=va(eb,{borderColor:"#FFFFFF",
-borderWidth:1,center:["50%","50%"],colorByPoint:true,dataLabels:{distance:30,enabled:true,formatter:function(){return this.point.name},y:5},legendType:"point",marker:null,size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Bd();var ac=function(a){var c=[],b;(function(d){if(b=/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*\)/.exec(d))c=[pa(b[1]),pa(b[2]),pa(b[3]),parseFloat(b[4],10)];else if(b=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))c=
-[pa(b[1],16),pa(b[2],16),pa(b[3],16),1]})(a);return{get:function(d){return c&&!isNaN(c[0])?d=="rgb"?"rgb("+c[0]+","+c[1]+","+c[2]+")":d=="a"?c[3]:"rgba("+c.join(",")+")":a},brighten:function(d){if(bc(d)&&d!==0){var e;for(e=0;e<3;e++){c[e]+=pa(d*255);if(c[e]<0)c[e]=0;if(c[e]>255)c[e]=255}}return this},setOpacity:function(d){c[3]=d;return this}}};Kc=function(a,c,b){function d(K){return K.toString().replace(/^([0-9])$/,"0$1")}if(!M(c)||isNaN(c))return"Invalid date";a=y(a,"%Y-%m-%d %H:%M:%S");c=new Date(c*
-nb);var e=c[ad](),f=c[bd](),g=c[nc](),i=c[Bc](),j=c[Cc](),k=Pa.lang,n=k.weekdays;k=k.months;c={a:n[f].substr(0,3),A:n[f],d:d(g),e:g,b:k[i].substr(0,3),B:k[i],m:d(i+1),y:j.toString().substr(2,2),Y:j,H:d(e),I:d(e%12||12),l:e%12||12,M:d(c[$c]()),p:e<12?"AM":"PM",P:e<12?"am":"pm",S:d(c.getSeconds())};for(var z in c)a=a.replace("%"+z,c[z]);return b?a.substr(0,1).toUpperCase()+a.substr(1):a};Fc.prototype={init:function(a,c){this.element=Da.createElementNS("http://www.w3.org/2000/svg",c);this.renderer=a},
-animate:function(a,c,b){if(c=y(c,zc,true)){c=va(c);if(b)c.complete=b;Wc(this,a,c)}else{this.attr(a);b&&b()}},attr:function(a,c){var b,d,e,f,g=this.element,i=g.nodeName,j=this.renderer,k,n=this.shadows,z,K=this;if(Ib(a)&&M(c)){b=a;a={};a[b]=c}if(Ib(a)){b=a;if(i=="circle")b={x:"cx",y:"cy"}[b]||b;else if(b=="strokeWidth")b="stroke-width";K=ya(g,b)||this[b]||0;if(b!="d"&&b!="visibility")K=parseFloat(K)}else for(b in a){k=false;d=a[b];if(b=="d"){if(d&&d.join)d=d.join(" ");if(/(NaN| {2}|^$)/.test(d))d=
-"M 0 0";this.d=d}else if(b=="x"&&i=="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];ya(f,"x")==ya(g,"x")&&ya(f,"x",d)}if(this.rotation)ya(g,"transform","rotate("+this.rotation+" "+d+" "+pa(a.y||ya(g,"y"))+")")}else if(b=="fill")d=j.color(d,g,b);else if(i=="circle"&&(b=="x"||b=="y"))b={x:"cx",y:"cy"}[b]||b;else if(b=="translateX"||b=="translateY"||b=="rotation"){this[b]=d;this.updateTransform();k=true}else if(b=="stroke")d=j.color(d,g,b);else if(b=="dashstyle"){b="stroke-dasharray";if(d){d=
-d.toLowerCase().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(e=d.length;e--;)d[e]=pa(d[e])*a["stroke-width"];d=d.join(",")}}else if(b=="isTracker")this[b]=d;else if(b=="width")d=pa(d);else if(b=="align"){b="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}if(b=="strokeWidth")b="stroke-width";if(be&&
-b=="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(b)){if(!z){this.symbolAttr(a);z=true}k=true}if(n&&/^(width|height|visibility|x|y|d)$/.test(b))for(e=n.length;e--;)ya(n[e],b,d);if(b=="text")j.buildText(g,d);else k||ya(g,b,d)}return K},symbolAttr:function(a){this.x=y(a.x,this.x);this.y=parseFloat(y(a.y,this.y));this.r=y(a.r,this.r);this.start=y(a.start,this.start);this.end=y(a.end,this.end);this.width=y(a.width,this.width);this.height=parseFloat(y(a.height,this.height));
-this.innerR=y(a.innerR,this.innerR);this.attr({d:this.renderer.symbols[this.symbolName](this.x,this.y,this.r,{start:this.start,end:this.end,width:this.width,height:this.height,innerR:this.innerR})})},clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},css:function(a){if(a&&a.color)a.fill=a.color;a=oa(this.styles,a);this.attr({style:Vd(a)});this.styles=a;return this},on:function(a,c){var b=c;if(Gb&&a=="click"){a="touchstart";b=function(d){d.preventDefault();c()}}this.element["on"+
-a]=b;return this},translate:function(a,c){return this.attr({translateX:a,translateY:c})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,c=this.translateY||0,b=this.inverted,d=this.rotation,e=[];if(b){a+=this.attr("width");c+=this.attr("height")}if(a||c)e.push("translate("+a+","+c+")");if(b)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&ya(this.element,"transform",e.join(" "))},
-toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,c,b){if(a){this.alignOptions=a;this.alignByTranslate=c;b||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;c=this.alignByTranslate}b=y(b,this.renderer);var d=a.align,e=a.verticalAlign,f=(b.x||0)+(a.x||0),g=(b.y||0)+(a.y||0),i={};if(/^(right|center)$/.test(d))f+=(b.width-(a.width||0))/{right:1,center:2}[d];i[c?"translateX":"x"]=f;if(/^(bottom|middle)$/.test(e))g+=(b.height-(a.height||0))/
-({bottom:1,middle:2}[e]||1);i[c?"translateY":"y"]=g;this[this.placed?"animate":"attr"](i);this.placed=true;return this},getBBox:function(){var a,c,b,d=this.rotation,e=d*Td;try{a=oa({},this.element.getBBox())}catch(f){a={width:0,height:0}}c=a.width;b=a.height;if(d){a.width=$a(b*yb(e))+$a(c*ub(e));a.height=$a(b*ub(e))+$a(c*yb(e))}return a},show:function(){return this.attr({visibility:Bb})},hide:function(){return this.attr({visibility:tb})},add:function(a){var c=this.renderer,b=a||c;c=b.element||c.box;
-var d=c.childNodes,e=this.element,f=ya(e,"zIndex"),g;this.parentInverted=a&&a.inverted;if(f){b.handleZ=true;f=pa(f)}if(b.handleZ)for(g=0;g<d.length;g++){a=d[g];b=ya(a,"zIndex");if(a!=e&&(pa(b)>f||!M(f)&&M(b))){c.insertBefore(e,a);return this}}c.appendChild(e);return this},destroy:function(){var a=this.element||{},c=this.shadows,b=a.parentNode,d;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=null;Qc(this);b&&b.removeChild(a);c&&t(c,function(e){(b=e.parentNode)&&b.removeChild(e)});yc(this.renderer.alignedObjects,
-this);for(d in this)delete this[d];return null},empty:function(){for(var a=this.element,c=a.childNodes,b=c.length;b--;)a.removeChild(c[b])},shadow:function(a){var c=[],b,d=this.element,e=this.parentInverted?"(-1,-1)":"(1,1)";if(a){for(a=1;a<=3;a++){b=d.cloneNode(0);ya(b,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*a,"stroke-width":7-2*a,transform:"translate"+e,fill:mb});d.parentNode.insertBefore(b,d);c.push(b)}this.shadows=c}return this}};var Sc=function(){this.init.apply(this,arguments)};
-Sc.prototype={init:function(a,c,b){var d=location,e;this.Element=Fc;e=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",version:"1.1"});a.appendChild(e.element);this.box=e.element;this.boxWrapper=e;this.alignedObjects=[];this.url=Zc?"":d.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.setSize(c,b,false)},createElement:function(a){var c=new this.Element;c.init(this,a);return c},buildText:function(a,c){for(var b=c.toString().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),d=a.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=ya(a,"x"),i,j=d.length;j--;)a.removeChild(d[j]);t(b,function(k,n){var z,K=0,ja;k=k.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");z=k.split("|||");t(z,function($){if($!==""||z.length==1){var ga={},u=Da.createElementNS("http://www.w3.org/2000/svg","tspan");e.test($)&&ya(u,"style",$.match(e)[1].replace(/(;| |^)color([ :])/,
-"$1fill$2"));if(f.test($)){ya(u,"onclick",'location.href="'+$.match(f)[1]+'"');Ua(u,{cursor:"pointer"})}$=$.replace(/<(.|\n)*?>/g,"");u.appendChild(Da.createTextNode($||" "));if(K)ga.dx=3;else ga.x=g;if(!K){if(n){ja=pa(window.getComputedStyle(i,null).getPropertyValue("line-height"));if(isNaN(ja))ja=i.offsetHeight||18;ya(u,"dy",ja)}i=u}ya(u,ga);a.appendChild(u);K++}})})},crispLine:function(a,c){if(a[1]==a[4])a[1]=a[4]=T(a[1])+c%2/2;if(a[2]==a[5])a[2]=a[5]=T(a[2])+c%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,
-fill:mb})},circle:function(a,c,b){a=Jb(a)?a:{x:a,y:c,r:b};return this.createElement("circle").attr(a)},arc:function(a,c,b,d,e,f){if(Jb(a)){c=a.y;b=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,c||0,b||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,c,b,d,e,f){if(arguments.length>1){var g=(f||0)%2/2;a=T(a||0)+g;c=T(c||0)+g;b=T((b||0)-2*g);d=T((d||0)-2*g)}g=Jb(a)?a:{x:a,y:c,width:Ca(b,0),height:Ca(d,0)};return this.createElement("rect").attr(oa(g,{rx:e||g.r,ry:e||g.r,fill:mb}))},
-setSize:function(a,c,b){var d=this.alignedObjects,e=d.length;this.width=a;this.height=c;for(this.boxWrapper[y(b,true)?"animate":"attr"]({width:a,height:c});e--;)d[e].align()},g:function(a){return this.createElement("g").attr(M(a)&&{"class":Zb+a})},image:function(a,c,b,d,e){var f={preserveAspectRatio:mb};arguments.length>1&&oa(f,{x:c,y:b,width:d,height:e});f=this.createElement("image").attr(f);f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a);return f},symbol:function(a,c,b,d,e){var f,
-g=this.symbols[a];g=g&&g(c,b,d,e);var i=/^url\((.*?)\)$/;if(g){f=this.path(g);oa(f,{symbolName:a,x:c,y:b,r:d});e&&oa(f,e)}else if(i.test(a)){a=a.match(i)[1];f=this.image(a).attr({x:c,y:b});fb("img",{onload:function(){var j=ce[this.src]||[this.width,this.height];f.attr({width:j[0],height:j[1]}).translate(-T(j[0]/2),-T(j[1]/2))},src:a})}else f=this.circle(c,b,d);return f},symbols:{square:function(a,c,b){b=0.707*b;return[Wa,a-b,c-b,Aa,a+b,c-b,a+b,c+b,a-b,c+b,"Z"]},triangle:function(a,c,b){return[Wa,
-a,c-1.33*b,Aa,a+b,c+0.67*b,a-b,c+0.67*b,"Z"]},"triangle-down":function(a,c,b){return[Wa,a,c+1.33*b,Aa,a-b,c-0.67*b,a+b,c-0.67*b,"Z"]},diamond:function(a,c,b){return[Wa,a,c-b,Aa,a+b,c,a,c+b,a-b,c,"Z"]},arc:function(a,c,b,d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,i=ub(e),j=yb(e),k=ub(f);f=yb(f);d=d.end-e<Ub?0:1;return[Wa,a+b*i,c+b*j,"A",b,b,0,d,1,a+b*k,c+b*f,Aa,a+g*k,c+g*f,"A",g,g,0,d,0,a+g*i,c+g*j,"Z"]}},clipRect:function(a,c,b,d){var e=Zb+od++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);
-a=this.rect(a,c,b,d,0).add(f);a.id=e;return a},color:function(a,c,b){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;c=a.linearGradient;b=Zb+od++;var g,i,j;g=f.createElement("linearGradient").attr({id:b,gradientUnits:"userSpaceOnUse",x1:c[0],y1:c[1],x2:c[2],y2:c[3]}).add(f.defs);t(a.stops,function(k){if(e.test(k[1])){d=ac(k[1]);i=d.get("rgb");j=d.get("a")}else{i=k[1];j=1}f.createElement("stop").attr({offset:k[0],"stop-color":i,"stop-opacity":j}).add(g)});return"url("+this.url+"#"+b+")"}else if(e.test(a)){d=
-ac(a);ya(c,b+"-opacity",d.get("a"));return d.get("rgb")}else return a},text:function(a,c,b){var d=Pa.chart.style;c=T(y(c,0));b=T(y(b,0));a=this.createElement("text").attr({x:c,y:b,text:a}).css({"font-family":d.fontFamily,"font-size":d.fontSize});a.x=c;a.y=b;return a}};var Ja;if(!Tc){var fe=wb(Fc,{init:function(a,c){var b=["<",c,' filled="f" stroked="f"'],d=["position: ",lc,";"];if(c=="shape"||c==Lb)d.push("left:0;top:0;width:10px;height:10px;");if(wc)d.push("visibility: ",c==Lb?tb:Bb);b.push(' style="',
-d.join(""),'"/>');if(c){b=c==Lb||c=="span"||c=="img"?b.join(""):a.prepVML(b);this.element=fb(b)}this.renderer=a},add:function(a){var c=this.renderer,b=this.element,d=c.box;d=a?a.element||a:d;a&&a.inverted&&c.invertChild(b,d);wc&&d.gVis==tb&&Ua(b,{visibility:tb});d.appendChild(b);this.added=true;this.alignOnAdd&&this.updateTransform();return this},attr:function(a,c){var b,d,e,f=this.element||{},g=f.style,i=f.nodeName,j=this.renderer,k=this.symbolName,n,z,K=this.shadows,ja=this;if(Ib(a)&&M(c)){b=a;
-a={};a[b]=c}if(Ib(a)){b=a;ja=b=="strokeWidth"||b=="stroke-width"?this.strokeweight:this[b]}else for(b in a){d=a[b];n=false;if(k&&/^(x|y|r|start|end|width|height|innerR)/.test(b)){if(!z){this.symbolAttr(a);z=true}n=true}else if(b=="d"){d=d||[];this.d=d.join(" ");e=d.length;for(n=[];e--;)n[e]=bc(d[e])?T(d[e]*10)-5:d[e]=="Z"?"x":d[e];d=n.join(" ")||"x";f.path=d;if(K)for(e=K.length;e--;)K[e].path=d;n=true}else if(b=="zIndex"||b=="visibility"){if(wc&&b=="visibility"&&i=="DIV"){f.gVis=d;n=f.childNodes;
-for(e=n.length;e--;)Ua(n[e],{visibility:d});if(d==Bb)d=null}if(d)g[b]=d;n=true}else if(/^(width|height)$/.test(b)){if(this.updateClipping){this[b]=d;this.updateClipping()}else g[b]=d;n=true}else if(/^(x|y)$/.test(b)){this[b]=d;if(f.tagName=="SPAN")this.updateTransform();else g[{x:"left",y:"top"}[b]]=d}else if(b=="class")f.className=d;else if(b=="stroke"){d=j.color(d,f,b);b="strokecolor"}else if(b=="stroke-width"||b=="strokeWidth"){f.stroked=d?true:false;b="strokeweight";this[b]=d;if(bc(d))d+=bb}else if(b==
-"dashstyle"){(f.getElementsByTagName("stroke")[0]||fb(j.prepVML(["<stroke/>"]),null,null,f))[b]=d||"solid";this.dashstyle=d;n=true}else if(b=="fill")if(i=="SPAN")g.color=d;else{f.filled=d!=mb?true:false;d=j.color(d,f,b);b="fillcolor"}else if(b=="translateX"||b=="translateY"||b=="rotation"||b=="align"){if(b=="align")b="textAlign";this[b]=d;this.updateTransform();n=true}else if(b=="text"){f.innerHTML=d;n=true}if(K&&b=="visibility")for(e=K.length;e--;)K[e].style[b]=d;if(!n)if(wc)f[b]=d;else ya(f,b,d)}return ja},
-clip:function(a){var c=a.members,b=c.length;c.push(this);this.destroyClip=function(){c.splice(b,1)};return this.css(a.getCSS(this.inverted))},css:function(a){Ua(this.element,a);return this},destroy:function(){this.destroyClip&&this.destroyClip();Fc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,c=a.length,b;c--;){b=a[c];b.parentNode.removeChild(b)}},getBBox:function(){var a=this.element;if(a.nodeName=="text")a.style.position=lc;return{x:a.offsetLeft,y:a.offsetTop,
-width:a.offsetWidth,height:a.offsetHeight}},on:function(a,c){this.element["on"+a]=function(){var b=rb.event;b.target=b.srcElement;c(b)};return this},updateTransform:function(){if(this.added){var a=this,c=a.element,b=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.rotation||0,i=g*Td,j=ub(i);i=yb(i);var k=a.textAlign||"left",n={right:1,center:2}[k],z=k&&k!="left";if(b||d)a.css({marginLeft:b,marginTop:d});a.inverted&&t(c.childNodes,function(K){a.renderer.invertChild(K,c)});if(c.tagName=="SPAN"){Ua(c,
-{filter:g?["progid:DXImageTransform.Microsoft.Matrix(M11=",j,", M12=",-i,", M21=",i,", M22=",j,", sizingMethod='auto expand')"].join(""):mb});b=c.offsetWidth;d=c.offsetHeight;g=T(pa(c.style.fontSize||12)*1.2);e+=b*ab(j,0)+ab(i,0)*g;f+=d*ab(i,0)-Ca(j,0)*g;if(z){e-=b/n*j;f-=d/n*i}Ua(c,{textAlign:k,left:e,top:f})}}else this.alignOnAdd=true},shadow:function(a){var c=[],b=this.element,d=this.renderer,e,f=b.style,g,i=b.path;if(""+b.path==="")i="x";if(a){for(a=1;a<=3;a++){g=['<shape isShadow="true" strokeweight="',
-7-2*a,'" filled="false" path="',i,'" coordsize="100,100" style="',b.style.cssText,'" />'];e=fb(d.prepVML(g),null,{left:pa(f.left)+1,top:pa(f.top)+1});g=['<stroke color="black" opacity="',0.05*a,'"/>'];fb(d.prepVML(g),null,null,e);b.parentNode.insertBefore(e,b);c.push(e)}this.shadows=c}return this}});Ja=function(){this.init.apply(this,arguments)};Ja.prototype=va(Sc.prototype,{isIE8:vc.indexOf("MSIE 8.0")>-1,init:function(a,c,b){var d;this.Element=fe;this.alignedObjects=[];d=this.createElement(Lb);
-a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(c,b,false);if(!Da.namespaces.hcv){Da.namespaces.add("hcv","urn:schemas-microsoft-com:vml");Da.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}},clipRect:function(a,c,b,d){var e=this.createElement();return oa(e,{members:[],left:a,top:c,width:b,height:d,getCSS:function(f){var g=this.top,i=this.left,j=i+this.width,k=g+this.height;g={clip:"rect("+
-T(f?i:g)+"px,"+T(f?k:j)+"px,"+T(f?j:k)+"px,"+T(f?g:i)+"px)"};!f&&wc&&oa(g,{width:j+bb,height:k+bb});return g},updateClipping:function(){t(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,c,b){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,i=a.linearGradient,j,k,n,z;t(a.stops,function(K,ja){if(e.test(K[1])){d=ac(K[1]);f=d.get("rgb");g=d.get("a")}else{f=K[1];g=1}if(ja){n=f;z=g}else{j=f;k=g}});a=90-Ra.atan((i[3]-i[1])/(i[2]-i[0]))*180/Ub;b=["<",b,' colors="0% ',j,",100% ",n,
-'" angle="',a,'" opacity="',z,'" o:opacity2="',k,'" type="gradient" focus="100%" />'];fb(this.prepVML(b),null,null,c)}else if(e.test(a)&&c.tagName!="IMG"){d=ac(a);b=["<",b,' opacity="',d.get("a"),'"/>'];fb(this.prepVML(b),null,null,c);return d.get("rgb")}else return a},prepVML:function(a){var c=this.isIE8;a=a.join("");if(c){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')==-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="',
-'style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,c,b){var d=Pa.chart.style;return this.createElement("span").attr({text:a,x:T(c),y:T(b)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily,fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",d:a})},circle:function(a,c,b){return this.path(this.symbols.circle(a,c,b))},g:function(a){var c;if(a)c={className:Zb+a,"class":Zb+a};return this.createElement(Lb).attr(c)},
-image:function(a,c,b,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:c,top:b,width:d,height:e});return f},rect:function(a,c,b,d,e,f){if(arguments.length>1){var g=(f||0)%2/2;a=T(a||0)+g;c=T(c||0)+g;b=T((b||0)-2*g);d=T((d||0)-2*g)}if(Jb(a)){c=a.y;b=a.width;d=a.height;e=a.r;a=a.x}return this.symbol("rect",a||0,c||0,e||0,{width:b||0,height:d||0})},invertChild:function(a,c){var b=c.style;Ua(a,{flip:"x",left:pa(b.width)-10,top:pa(b.height)-10,rotation:-90})},symbols:{arc:function(a,
-c,b,d){var e=d.start,f=d.end,g=ub(e),i=yb(e),j=ub(f),k=yb(f);d=d.innerR;if(f-e===0)return["x"];else if(f-e==2*Ub)j=-0.07/b;return["wa",a-b,c-b,a+b,c+b,a+b*g,c+b*i,a+b*j,c+b*k,"at",a-d,c-d,a+d,c+d,a+d*j,c+d*k,a+d*g,c+d*i,"x","e"]},circle:function(a,c,b){return["wa",a-b,c-b,a+b,c+b,a+b,c,a+b,c,"e"]},rect:function(a,c,b,d){var e=d.width;d=d.height;var f=a+e,g=c+d;b=ab(b,e,d);return[Wa,a+b,c,Aa,f-b,c,"wa",f-2*b,c,f,c+2*b,f-b,c,f,c+b,Aa,f,g-b,"wa",f-2*b,g-2*b,f,g,f,g-b,f-b,g,Aa,a+b,g,"wa",a,g-2*b,a+2*
-b,g,a+b,g,a,g-b,Aa,a,c+b,"wa",a,c,a+2*b,c+2*b,a,c+b,a+b,c,"x","e"]}}})}var Qd=Tc?Sc:Ja;Hd.prototype.callbacks=[];var xc=function(){};xc.prototype={init:function(a,c){var b;this.series=a;this.applyOptions(c);this.pointAttr={};if(a.options.colorByPoint){b=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=this.color||b[Hb++];if(Hb>=b.length)Hb=0}a.chart.pointCount++;return this},applyOptions:function(a){var c=this.series;this.config=a;if(bc(a)||a===null)this.y=a;else if(Jb(a)&&
-!bc(a.length)){oa(this,a);this.options=a}else if(Ib(a[0])){this.name=a[0];this.y=a[1]}else if(bc(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Oa)this.x=c.autoIncrement()},destroy:function(){var a=this,c=a.series,b;c.chart.pointCount--;a==c.chart.hoverPoint&&a.onMouseOut();c.chart.hoverPoints=null;Cb(a);t(["graphic","tracker","group","dataLabel","connector"],function(d){a[d]&&a[d].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(b in a)a[b]=null},select:function(a,c){var b=this,d=b.series.chart;
-b.selected=a=y(a,!b.selected);b.firePointEvent(a?"select":"unselect");b.setState(a&&"select");c||t(d.getSelectedPoints(),function(e){if(e.selected&&e!=b){e.selected=false;e.setState(db);e.firePointEvent("unselect")}})},onMouseOver:function(){var a=this.series.chart,c=a.tooltip,b=a.hoverPoint;b&&b!=this&&b.onMouseOut();this.firePointEvent("mouseOver");c&&!c.shared&&c.refresh(this);this.setState(xb);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState();this.series.chart.hoverPoint=
-null},update:function(a,c,b){var d=this,e=d.series,f=e.chart;Kb(b,f);c=y(c,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);e.isDirty=true;c&&f.redraw()})},remove:function(a,c){var b=this,d=b.series,e=d.chart,f=d.data;Kb(c,e);a=y(a,true);b.firePointEvent("remove",null,function(){yc(f,b);b.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,c,b){var d=this,e=this.series.options;if(e.point.events[a]||d.options&&d.options.events&&d.options.events[a])this.importEvents();
-if(a=="click"&&e.allowPointSelect)b=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Ia(this,a,c,b)},importEvents:function(){if(!this.hasImportedEvents){var a=va(this.series.options.point,this.options).events,c;this.events=a;for(c in a)Ma(this,c,a[c]);this.hasImportedEvents=true}},setState:function(a){var c=this.series,b=c.options.states,d=vb[c.type].marker&&c.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=c.stateMarkerGraphic,i=c.chart,j=this.pointAttr;a||(a=
-db);if(!(a==this.state||this.selected&&a!="select"||b[a]&&b[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(j[a]);else{if(a){if(!g)c.stateMarkerGraphic=g=i.renderer.circle(0,0,j[a].r).attr(j[a]).add(c.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var lb=function(){};lb.prototype={isCartesian:true,type:"line",pointClass:xc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,
-c){var b,d;d=a.series.length;this.chart=a;c=this.setOptions(c);oa(this,{index:d,options:c,name:c.name||"Series "+(d+1),state:db,pointAttr:{},visible:c.visible!==false,selected:c.selected===true});d=c.events;for(b in d)Ma(this,b,d[b]);if(d&&d.click||c.point&&c.point.events&&c.point.events.click||c.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(c.data,false)},autoIncrement:function(){var a=this.options,c=this.xIncrement;c=y(c,a.pointStart,0);this.pointInterval=
-y(this.pointInterval,a.pointInterval,1);this.xIncrement=c+this.pointInterval;return c},cleanData:function(){var a=this.chart,c=this.data,b,d,e=a.smallestInterval,f,g;c.sort(function(i,j){return i.x-j.x});for(g=c.length-1;g>=0;g--)c[g-1]&&c[g-1].x==c[g].x&&c.splice(g-1,1);for(g=c.length-1;g>=0;g--)if(c[g-1]){f=c[g].x-c[g-1].x;if(d===Oa||f<d){d=f;b=g}}if(e===Oa||d<e)a.smallestInterval=d;this.closestPoints=b},getSegments:function(){var a=-1,c=[],b=this.data;t(b,function(d,e){if(d.y===null){e>a+1&&c.push(b.slice(a+
-1,e));a=e}else e==b.length-1&&c.push(b.slice(a+1,e+1))});this.segments=c},setOptions:function(a){var c=this.chart.options.plotOptions;return va(c[this.type],c.series,a)},getColor:function(){var a=this.chart.options.colors;this.color=this.options.color||a[Hb++]||"#0000ff";if(Hb>=a.length)Hb=0},getSymbol:function(){var a=this.chart.options.symbols;this.symbol=this.options.marker.symbol||a[Vc++];if(Vc>=a.length)Vc=0},addPoint:function(a,c,b,d){var e=this.data,f=this.graph,g=this.area,i=this.chart;a=
-(new this.pointClass).init(this,a);Kb(d,i);if(f&&b)f.shift=b;if(g){g.shift=b;g.isArea=true}c=y(c,true);e.push(a);b&&e[0].remove(false);this.isDirty=true;c&&i.redraw()},setData:function(a,c){var b=this,d=b.data,e=b.initialColor,f=b.chart,g=d&&d.length||0;b.xIncrement=null;if(M(e))Hb=e;for(a=jc(mc(a||[]),function(i){return(new b.pointClass).init(b,i)});g--;)d[g].destroy();b.data=a;b.cleanData();b.getSegments();b.isDirty=true;f.isDirtyBox=true;y(c,true)&&f.redraw(false)},remove:function(a,c){var b=this,
-d=b.chart;a=y(a,true);if(!b.isRemoving){b.isRemoving=true;Ia(b,"remove",null,function(){b.destroy();d.isDirtyLegend=d.isDirtyBox=true;a&&d.redraw(c)})}b.isRemoving=false},translate:function(){for(var a=this.chart,c=this.options.stacking,b=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],i=g.x,j=g.y,k;k=d.stacks[(j<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(i);if(c&&this.visible&&k[i]){k=k[i];i=k.total;k.cum=k=k.cum-j;j=k+j;if(c=="percent"){k=i?k*100/i:0;j=i?j*
-100/i:0}g.percentage=i?g.y*100/i:0;g.stackTotal=i;g.yBottom=d.translate(k,0,1)}if(j!==null)g.plotY=d.translate(j,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=b&&b[g.x]!==Oa?b[g.x]:g.x}},setTooltipPoints:function(a){var c=this.chart,b=c.inverted,d=[],e=T((b?c.plotTop:c.plotLeft)+c.plotSizeX),f,g,i=[];if(a)this.tooltipPoints=null;t(this.segments,function(j){d=d.concat(j)});if(this.xAxis&&this.xAxis.reversed)d=d.reverse();t(d,function(j,k){f=d[k-1]?d[k-1].high+1:0;for(g=j.high=d[k+
-1]?Mb((j.plotX+(d[k+1]?d[k+1].plotX:e))/2):e;f<=g;)i[b?e-f++:f++]=j});this.tooltipPoints=i},onMouseOver:function(){var a=this.chart,c=a.hoverSeries;if(!(!Gb&&a.mouseIsDown)){c&&c!=this&&c.onMouseOut();this.options.events.mouseOver&&Ia(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(xb);a.hoverSeries=this}},onMouseOut:function(){var a=this.options,c=this.chart,b=c.tooltip,d=c.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Ia(this,"mouseOut");b&&!a.stickyTracking&&b.hide();
-this.setState();c.hoverSeries=null},animate:function(a){var c=this,b=c.chart,d=c.clipRect,e=c.options.animation;if(e&&!Jb(e))e={};if(a){if(!d.isAnimating){d.attr("width",0);d.isAnimating=true}}else{d.animate({width:b.plotSizeX},e&&oa(e,{complete:function(){d.isAnimating=false;if(d!=b.clipRect){c.group.clip(c.clipRect=b.clipRect);d.destroy()}}}));this.animate=null}},drawPoints:function(){var a,c=this.data,b=this.chart,d,e,f,g,i,j;if(this.options.marker.enabled)for(f=c.length;f--;){g=c[f];d=g.plotX;
-e=g.plotY;j=g.graphic;if(e!==Oa&&!isNaN(e)){a=g.pointAttr[g.selected?"select":db];i=a.r;if(j)j.animate({x:d,y:e,r:i});else g.graphic=b.renderer.symbol(y(g.marker&&g.marker.symbol,this.symbol),d,e,i).attr(a).add(this.group)}}},convertAttribs:function(a,c,b,d){var e=this.pointAttrToOptions,f,g,i={};a=a||{};c=c||{};b=b||{};d=d||{};for(f in e){g=e[f];i[f]=y(a[g],c[f],b[f],d[f])}return i},getAttribs:function(){var a=this,c=vb[a.type].marker?a.options.marker:a.options,b=c.states,d=b[xb],e,f={},g=a.color,
-i=a.data,j=[],k,n=a.pointAttrToOptions;if(a.options.marker){f={stroke:g,fill:g};d.radius=d.radius||c.radius+2;d.lineWidth=d.lineWidth||c.lineWidth+1}else{f={fill:g};d.color=d.color||ac(d.color||g).brighten(d.brightness).get()}j[db]=a.convertAttribs(c,f);t([xb,"select"],function(K){j[K]=a.convertAttribs(b[K],j[db])});a.pointAttr=j;for(f=i.length;f--;){g=i[f];if((c=g.options&&g.options.marker||g.options)&&c.enabled===false)c.radius=0;e=false;if(g.options)for(var z in n)if(M(c[n[z]]))e=true;if(e){k=
-[];b=c.states||{};e=b[xb]=b[xb]||{};if(!a.options.marker)e.color=ac(e.color||g.options.color).brighten(e.brightness||d.brightness).get();k[db]=a.convertAttribs(c,j[db]);k[xb]=a.convertAttribs(b[xb],j[xb],k[db]);k.select=a.convertAttribs(b.select,j.select,k[db])}else k=j;g.pointAttr=k}},destroy:function(){var a=this,c=a.chart,b=/\/5[0-9\.]+ Safari\//.test(vc),d,e;Cb(a);a.legendItem&&a.chart.legend.destroyItem(a);t(a.data,function(f){f.destroy()});t(["area","graph","dataLabelsGroup","group","tracker"],
-function(f){if(a[f]){d=b&&f=="group"?"hide":"destroy";a[f][d]()}});if(c.hoverSeries==a)c.hoverSeries=null;yc(c.series,a);for(e in a)delete a[e]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a=this,c,b,d=a.data,e=a.options.dataLabels,f,g=a.dataLabelsGroup,i=a.chart,j=i.inverted,k=a.type,n;if(!g)g=a.dataLabelsGroup=i.renderer.g(Zb+"data-labels").attr({visibility:a.visible?Bb:tb,zIndex:5}).translate(i.plotLeft,i.plotTop).add();n=e.color;if(n=="auto")n=null;e.style.color=y(n,a.color);
-t(d,function(z){var K=y(z.barX,z.plotX,-999),ja=y(z.plotY,-999),$=z.dataLabel,ga=e.align;f=e.formatter.call({x:z.x,y:z.y,series:a,point:z,percentage:z.percentage,total:z.total||z.stackTotal});c=(j?i.plotWidth-ja:K)+e.x;b=(j?i.plotHeight-K:ja)+e.y;if(k=="column")c+={center:z.barW/2,right:z.barW}[ga]||0;if($)$.animate({x:c,y:b});else if(f)z.dataLabel=i.renderer.text(f,c,b).attr({align:ga,rotation:e.rotation,zIndex:1}).css(e.style).add(g)})}},drawGraph:function(){var a=this,c=a.options,b=a.graph,d=[],
-e,f=a.area,g=a.group,i=c.lineColor||a.color,j=c.lineWidth,k=c.dashStyle,n,z=a.chart.renderer,K=a.yAxis.getThreshold(c.threshold||0),ja=/^area/.test(a.type),$=[],ga=[];t(a.segments,function(u){n=[];t(u,function(ca,na){if(a.getPointSpline)n.push.apply(n,a.getPointSpline(u,ca,na));else{n.push(na?Aa:Wa);na&&c.step&&n.push(ca.plotX,u[na-1].plotY);n.push(ca.plotX,ca.plotY)}});if(u.length>1)d=d.concat(n);else $.push(u[0]);if(ja){var N=[],ka,Na=n.length;for(ka=0;ka<Na;ka++)N.push(n[ka]);Na==3&&N.push(Aa,
-n[1],n[2]);if(c.stacking&&a.type!="areaspline")for(ka=u.length-1;ka>=0;ka--)N.push(u[ka].plotX,u[ka].yBottom);else N.push(Aa,u[u.length-1].plotX,K,Aa,u[0].plotX,K);ga=ga.concat(N)}});a.graphPath=d;a.singlePoints=$;if(ja){e=y(c.fillColor,ac(a.color).setOpacity(c.fillOpacity||0.75).get());if(f)f.animate({d:ga});else a.area=a.chart.renderer.path(ga).attr({fill:e}).add(g)}if(b)b.animate({d:d});else if(j){b={stroke:i,"stroke-width":j};if(k)b.dashstyle=k;a.graph=z.path(d).attr(b).add(g).shadow(c.shadow)}},
-render:function(){var a=this.chart,c,b,d=this.options,e=d.animation&&this.animate;b=a.renderer;if(!this.clipRect){this.clipRect=!a.hasRendered&&a.clipRect?a.clipRect:b.clipRect(0,0,a.plotSizeX,a.plotSizeY);if(!a.clipRect)a.clipRect=this.clipRect}if(!this.group){c=this.group=b.g("series");if(a.inverted){b=function(){c.attr({width:a.plotWidth,height:a.plotHeight}).invert()};b();Ma(a,"resize",b)}c.clip(this.clipRect).attr({visibility:this.visible?Bb:tb,zIndex:d.zIndex}).translate(a.plotLeft,a.plotTop).add(a.seriesGroup)}this.drawDataLabels();
-e&&this.animate(true);this.getAttribs();this.drawGraph&&this.drawGraph();this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();e&&this.animate();this.isDirty=false},redraw:function(){var a=this.chart,c=this.group;if(c){a.inverted&&c.attr({width:a.plotWidth,height:a.plotHeight});c.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},setState:function(a){var c=this.options,b=this.graph,d=c.states;c=c.lineWidth;a=a||
-db;if(this.state!=a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)c=d[a].lineWidth||c+1;if(b&&!b.dashstyle)b.attr({"stroke-width":c},a?0:500)}}},setVisible:function(a,c){var b=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,i,j=this.data,k=b.options.chart.ignoreHiddenSeries;i=this.visible;i=(this.visible=a=a===Oa?!i:a)?"show":"hide";e&&e[i]();if(f)f[i]();else for(e=j.length;e--;){f=j[e];f.tracker&&f.tracker[i]()}g&&g[i]();d&&b.legend.colorizeItem(this,a);this.isDirty=
-true;this.options.stacking&&t(b.series,function(n){if(n.options.stacking&&n.visible)n.isDirty=true});if(k)b.isDirtyBox=true;c!==false&&b.redraw();Ia(this,i)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Oa?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Ia(this,a?"select":"unselect")},drawTracker:function(){var a=this,c=a.options,b=[].concat(a.graphPath),d=b.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,i=c.cursor;
-i=i&&{cursor:i};var j=a.singlePoints,k;if(d)for(k=d+1;k--;){b[k]==Wa&&b.splice(k+1,0,b[k+1]-f,b[k+2],Aa);if(k&&b[k]==Wa||k==d)b.splice(k,0,Aa,b[k-2]+f,b[k-1])}for(k=0;k<j.length;k++){d=j[k];b.push(Wa,d.plotX-f,d.plotY,Aa,d.plotX+f,d.plotY)}if(g)g.attr({d:b});else a.tracker=e.renderer.path(b).attr({isTracker:true,stroke:Ud,fill:mb,"stroke-width":c.lineWidth+2*f,visibility:a.visible?Bb:tb,zIndex:1}).on(Gb?"touchstart":"mouseover",function(){e.hoverSeries!=a&&a.onMouseOver()}).on("mouseout",function(){c.stickyTracking||
-a.onMouseOut()}).css(i).add(e.trackerGroup)}};Ja=wb(lb);sb.line=Ja;Ja=wb(lb,{type:"area"});sb.area=Ja;Ja=wb(lb,{type:"spline",getPointSpline:function(a,c,b){var d=c.plotX,e=c.plotY,f=a[b-1],g=a[b+1],i,j,k,n;if(b&&b<a.length-1){a=f.plotY;k=g.plotX;g=g.plotY;var z;i=(1.5*d+f.plotX)/2.5;j=(1.5*e+a)/2.5;k=(1.5*d+k)/2.5;n=(1.5*e+g)/2.5;z=(n-j)*(k-d)/(k-i)+e-n;j+=z;n+=z;if(j>a&&j>e){j=Ca(a,e);n=2*e-j}else if(j<a&&j<e){j=ab(a,e);n=2*e-j}if(n>g&&n>e){n=Ca(g,e);j=2*e-n}else if(n<g&&n<e){n=ab(g,e);j=2*e-n}c.rightContX=
-k;c.rightContY=n}if(b){c=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,i||d,j||e,d,e];f.rightContX=f.rightContY=null}else c=[Wa,d,e];return c}});sb.spline=Ja;Ja=wb(Ja,{type:"areaspline"});sb.areaspline=Ja;var Yc=wb(lb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){lb.prototype.init.apply(this,arguments);var a=this,c=a.chart;c.hasColumn=true;c.hasRendered&&t(c.series,function(b){if(b.type==a.type)b.isDirty=true})},
-translate:function(){var a=this,c=a.chart,b=0,d=a.xAxis.reversed,e=a.xAxis.categories,f={},g,i;lb.prototype.translate.apply(a);t(c.series,function(N){if(N.type==a.type){if(N.options.stacking){g=N.stackKey;if(f[g]===Oa)f[g]=b++;i=f[g]}else i=b++;N.columnIndex=i}});var j=a.options,k=a.data,n=a.closestPoints;c=$a(k[1]?k[n].plotX-k[n-1].plotX:c.plotSizeX/(e?e.length:1));e=c*j.groupPadding;n=(c-2*e)/b;var z=j.pointWidth,K=M(z)?(n-z)/2:n*j.pointPadding,ja=y(z,n-2*K),$=K+(e+((d?b-a.columnIndex:a.columnIndex)||
-0)*n-c/2)*(d?-1:1),ga=a.yAxis.getThreshold(j.threshold||0),u=y(j.minPointLength,5);t(k,function(N){var ka=N.plotY,Na=N.yBottom||ga,ca=N.plotX+$,na=dd(ab(ka,Na)),Za=dd(Ca(ka,Na)-na),jb;if($a(Za)<u){if(u){Za=u;na=$a(na-ga)>u?Na-u:ga-(ka<=ga?u:0)}jb=na-3}oa(N,{barX:ca,barY:na,barW:ja,barH:Za});N.shapeType="rect";N.shapeArgs={x:ca,y:na,width:ja,height:Za,r:j.borderRadius};N.trackerArgs=M(jb)&&va(N.shapeArgs,{height:Ca(6,Za+3),y:jb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=
-this,c=a.options,b=a.chart.renderer,d,e;t(a.data,function(f){var g=f.plotY;if(g!==Oa&&!isNaN(g)){d=f.graphic;e=f.shapeArgs;if(d){Qc(d);d.animate(e)}else f.graphic=b[f.shapeType](e).attr(f.pointAttr[f.selected?"select":db]).add(a.group).shadow(c.shadow)}})},drawTracker:function(){var a=this,c=a.chart,b=c.renderer,d,e,f=+new Date,g=a.options.cursor,i=g&&{cursor:g},j;t(a.data,function(k){e=k.tracker;d=k.trackerArgs||k.shapeArgs;if(k.y!==null)if(e)e.attr(d);else k.tracker=b[k.shapeType](d).attr({isTracker:f,
-fill:Ud,visibility:a.visible?Bb:tb,zIndex:1}).on(Gb?"touchstart":"mouseover",function(n){j=n.relatedTarget||n.fromElement;c.hoverSeries!=a&&ya(j,"isTracker")!=f&&a.onMouseOver();k.onMouseOver()}).on("mouseout",function(n){if(!a.options.stickyTracking){j=n.relatedTarget||n.toElement;ya(j,"isTracker")!=f&&a.onMouseOut()}}).css(i).add(c.trackerGroup)})},animate:function(a){var c=this,b=c.data;if(!a){t(b,function(d){var e=d.graphic;if(e){e.attr({height:0,y:c.yAxis.translate(0,0,1)});e.animate({height:d.barH,
-y:d.barY},c.options.animation)}});c.animate=null}},remove:function(){var a=this,c=a.chart;c.hasRendered&&t(c.series,function(b){if(b.type==a.type)b.isDirty=true});lb.prototype.remove.apply(a,arguments)}});sb.column=Yc;Ja=wb(Yc,{type:"bar",init:function(a){a.inverted=this.inverted=true;Yc.prototype.init.apply(this,arguments)}});sb.bar=Ja;Ja=wb(lb,{type:"scatter",translate:function(){var a=this;lb.prototype.translate.apply(a);t(a.data,function(c){c.shapeType="circle";c.shapeArgs={x:c.plotX,y:c.plotY,
-r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,c=a.options.cursor,b=c&&{cursor:c},d;t(a.data,function(e){(d=e.graphic)&&d.attr({isTracker:true}).on("mouseover",function(){a.onMouseOver();e.onMouseOver()}).on("mouseout",function(){a.options.stickyTracking||a.onMouseOut()}).css(b)})},cleanData:function(){}});sb.scatter=Ja;Ja=wb(xc,{init:function(){xc.prototype.init.apply(this,arguments);var a=this,c;oa(a,{visible:a.visible!==false,name:y(a.name,"Slice")});c=function(){a.slice()};
-Ma(a,"select",c);Ma(a,"unselect",c);return a},setVisible:function(a){var c=this.series.chart,b=this.tracker,d=this.dataLabel,e=this.connector,f;f=(this.visible=a=a===Oa?!this.visible:a)?"show":"hide";this.group[f]();b&&b[f]();d&&d[f]();e&&e[f]();this.legendItem&&c.legend.colorizeItem(this,a)},slice:function(a,c,b){var d=this.series.chart,e=this.slicedTranslation;Kb(b,d);y(c,true);a=this.sliced=M(a)?a:!this.sliced;this.group.animate({translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop})}});Ja=
-wb(lb,{type:"pie",isCartesian:false,pointClass:Ja,pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=Hb},animate:function(){var a=this;t(a.data,function(c){var b=c.graphic;c=c.shapeArgs;var d=-Ub/2;if(b){b.attr({r:0,start:d,end:d});b.animate({r:c.r,start:c.start,end:c.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,c=-0.25,b=this.options,d=b.slicedOffset,e=d+b.borderWidth,f=b.center,g=this.chart,i=g.plotWidth,
-j=g.plotHeight,k,n,z,K=this.data,ja=2*Ub,$,ga=ab(i,j),u,N,ka,Na=b.dataLabels.distance;f.push(b.size,b.innerSize||0);f=jc(f,function(ca,na){return(u=/%$/.test(ca))?[i,j,ga,ga][na]*pa(ca)/100:ca});this.getX=function(ca,na){z=Ra.asin((ca-f[1])/(f[2]/2+Na));return f[0]+(na?-1:1)*ub(z)*(f[2]/2+Na)};this.center=f;t(K,function(ca){a+=ca.y});t(K,function(ca){$=a?ca.y/a:0;k=c*ja;c+=$;n=c*ja;ca.shapeType="arc";ca.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:k,end:n};z=(n+k)/2;ca.slicedTranslation=
-jc([ub(z)*d+g.plotLeft,yb(z)*d+g.plotTop],T);N=ub(z)*f[2]/2;ka=yb(z)*f[2]/2;ca.tooltipPos=[f[0]+N*0.7,f[1]+ka*0.7];ca.labelPos=[f[0]+N+ub(z)*Na,f[1]+ka+yb(z)*Na,f[0]+N+ub(z)*e,f[1]+ka+yb(z)*e,f[0]+N,f[1]+ka,Na<0?"center":z<ja/4?"left":"right",z];ca.percentage=$*100;ca.total=a});this.setTooltipPoints()},render:function(){this.getAttribs();this.drawPoints();this.options.enableMouseTracking!==false&&this.drawTracker();this.drawDataLabels();this.options.animation&&this.animate&&this.animate();this.isDirty=
-false},drawPoints:function(){var a=this.chart,c=a.renderer,b,d,e;t(this.data,function(f){d=f.graphic;e=f.shapeArgs;if(!f.group){b=f.sliced?f.slicedTranslation:[a.plotLeft,a.plotTop];f.group=c.g("point").attr({zIndex:5}).add().translate(b[0],b[1])}if(d)d.animate(e);else f.graphic=c.arc(e).attr(f.pointAttr[db]).add(f.group);f.visible===false&&f.setVisible(false)})},drawDataLabels:function(){var a=this.data,c,b=this.chart,d=this.options.dataLabels,e=y(d.connectorPadding,10),f=y(d.connectorWidth,1),g,
-i,j=d.distance>0,k,n,z=this.center[1],K=[[],[],[],[]],ja,$,ga,u,N,ka,Na,ca=4,na;lb.prototype.drawDataLabels.apply(this);t(a,function(Za){var jb=Za.labelPos[7];K[jb<0?0:jb<Ub/2?1:jb<Ub?2:3].push(Za)});K[1].reverse();K[3].reverse();for(Na=function(Za,jb){return Za.y>jb.y};ca--;){a=0;c=[].concat(K[ca]);c.sort(Na);for(na=c.length;na--;)c[na].rank=na;for(u=0;u<2;u++){n=(ka=ca%3)?9999:-9999;N=ka?-1:1;for(na=0;na<K[ca].length;na++){c=K[ca][na];if(g=c.dataLabel){i=c.labelPos;ga=Bb;ja=i[0];$=i[1];k||(k=g&&
-g.getBBox().height);if(j)if(u&&c.rank<a)ga=tb;else if(!ka&&$<n+k||ka&&$>n-k){$=n+N*k;ja=this.getX($,ca>1);if(!ka&&$+k>z||ka&&$-k<z)if(u)ga=tb;else a++}if(c.visible===false)ga=tb;if(ga==Bb)n=$;if(u){g.attr({visibility:ga,align:i[6]})[g.moved?"animate":"attr"]({x:ja+d.x+({left:e,right:-e}[i[6]]||0),y:$+d.y});g.moved=true;if(j&&f){g=c.connector;i=[Wa,ja+(i[6]=="left"?5:-5),$,Aa,ja,$,Aa,i[2],i[3],Aa,i[4],i[5]];if(g){g.animate({d:i});g.attr("visibility",ga)}else c.connector=g=this.chart.renderer.path(i).attr({"stroke-width":f,
-stroke:d.connectorColor||"#606060",visibility:ga,zIndex:3}).translate(b.plotLeft,b.plotTop).add()}}}}}}},drawTracker:Yc.prototype.drawTracker,getSymbol:function(){}});sb.pie=Ja;rb.Highcharts={Chart:Hd,dateFormat:Kc,pathAnim:Xc,getOptions:function(){return Pa},numberFormat:Gd,Point:xc,Renderer:Qd,seriesTypes:sb,setOptions:function(a){Pa=va(Pa,a);Bd();return Pa},Series:lb,addEvent:Ma,createElement:fb,discardElement:Dc,css:Ua,each:t,extend:oa,map:jc,merge:va,pick:y,extendClass:wb,version:"2.1.1"}})();
diff --git a/share/rickshaw.min.css b/share/rickshaw.min.css
new file mode 100644 (file)
index 0000000..96dcd75
--- /dev/null
@@ -0,0 +1 @@
+.rickshaw_graph .detail{pointer-events:none;position:absolute;top:0;z-index:2;background:rgba(0,0,0,.1);bottom:0;width:1px;transition:opacity .25s linear;-moz-transition:opacity .25s linear;-o-transition:opacity .25s linear;-webkit-transition:opacity .25s linear}.rickshaw_graph .detail.inactive{opacity:0}.rickshaw_graph .detail .item.active{opacity:1}.rickshaw_graph .detail .x_label{font-family:Arial,sans-serif;border-radius:3px;padding:6px;opacity:.5;border:1px solid #e0e0e0;font-size:12px;position:absolute;background:#fff;white-space:nowrap}.rickshaw_graph .detail .item{position:absolute;z-index:2;border-radius:3px;padding:.25em;font-size:12px;font-family:Arial,sans-serif;opacity:0;background:rgba(0,0,0,.4);color:#fff;border:1px solid rgba(0,0,0,.4);margin-left:1em;margin-top:-1em;white-space:nowrap}.rickshaw_graph .detail .item.active{opacity:1;background:rgba(0,0,0,.8)}.rickshaw_graph .detail .item:before{content:"\25c2";position:absolute;left:-.5em;color:rgba(0,0,0,.7);width:0}.rickshaw_graph .detail .dot{width:4px;height:4px;margin-left:-4px;margin-top:-3px;border-radius:5px;position:absolute;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;border-width:2px;border-style:solid;display:none;background-clip:padding-box}.rickshaw_graph .detail .dot.active{display:block}.rickshaw_graph{position:relative}.rickshaw_graph svg{display:block;overflow:hidden}.rickshaw_graph .x_tick{position:absolute;top:0;bottom:0;width:0;border-left:1px dotted rgba(0,0,0,.2);pointer-events:none}.rickshaw_graph .x_tick .title{position:absolute;font-size:12px;font-family:Arial,sans-serif;opacity:.5;white-space:nowrap;margin-left:3px;bottom:1px}.rickshaw_annotation_timeline{height:1px;border-top:1px solid #e0e0e0;margin-top:10px;position:relative}.rickshaw_annotation_timeline .annotation{position:absolute;height:6px;width:6px;margin-left:-2px;top:-3px;border-radius:5px;background-color:rgba(0,0,0,.25)}.rickshaw_graph .annotation_line{position:absolute;top:0;bottom:-6px;width:0;border-left:2px solid rgba(0,0,0,.3);display:none}.rickshaw_graph .annotation_line.active{display:block}.rickshaw_graph .annotation_range{background:rgba(0,0,0,.1);display:none;position:absolute;top:0;bottom:-6px;z-index:-10}.rickshaw_graph .annotation_range.active{display:block}.rickshaw_graph .annotation_range.active.offscreen{display:none}.rickshaw_annotation_timeline .annotation .content{background:#fff;color:#000;opacity:.9;padding:5px 5px;box-shadow:0 0 2px rgba(0,0,0,.8);border-radius:3px;position:relative;z-index:20;font-size:12px;padding:6px 8px 8px;top:18px;left:-11px;width:160px;display:none;cursor:pointer}.rickshaw_annotation_timeline .annotation .content:before{content:"\25b2";position:absolute;top:-11px;color:#fff;text-shadow:0 -1px 1px rgba(0,0,0,.8)}.rickshaw_annotation_timeline .annotation.active,.rickshaw_annotation_timeline .annotation:hover{background-color:rgba(0,0,0,.8);cursor:none}.rickshaw_annotation_timeline .annotation .content:hover{z-index:50}.rickshaw_annotation_timeline .annotation.active .content{display:block}.rickshaw_annotation_timeline .annotation:hover .content{display:block;z-index:50}.rickshaw_graph .y_axis,.rickshaw_graph .x_axis_d3{fill:none}.rickshaw_graph .y_ticks .tick,.rickshaw_graph .x_ticks_d3 .tick{stroke:rgba(0,0,0,.16);stroke-width:2px;shape-rendering:crisp-edges;pointer-events:none}.rickshaw_graph .y_grid .tick,.rickshaw_graph .x_grid_d3 .tick{z-index:-1;stroke:rgba(0,0,0,.20);stroke-width:1px;stroke-dasharray:1 1}.rickshaw_graph .y_grid path,.rickshaw_graph .x_grid_d3 path{fill:none;stroke:none}.rickshaw_graph .y_ticks path,.rickshaw_graph .x_ticks_d3 path{fill:none;stroke:#808080}.rickshaw_graph .y_ticks text,.rickshaw_graph .x_ticks_d3 text{opacity:.5;font-size:12px;pointer-events:none}.rickshaw_graph .x_tick.glow .title,.rickshaw_graph .y_ticks.glow text{fill:black;color:#000;text-shadow:-1px 1px 0 rgba(255,255,255,.1),1px -1px 0 rgba(255,255,255,.1),1px 1px 0 rgba(255,255,255,.1),0px 1px 0 rgba(255,255,255,.1),0px -1px 0 rgba(255,255,255,.1),1px 0 0 rgba(255,255,255,.1),-1px 0 0 rgba(255,255,255,.1),-1px -1px 0 rgba(255,255,255,.1)}.rickshaw_graph .x_tick.inverse .title,.rickshaw_graph .y_ticks.inverse text{fill:white;color:#fff;text-shadow:-1px 1px 0 rgba(0,0,0,.8),1px -1px 0 rgba(0,0,0,.8),1px 1px 0 rgba(0,0,0,.8),0px 1px 0 rgba(0,0,0,.8),0px -1px 0 rgba(0,0,0,.8),1px 0 0 rgba(0,0,0,.8),-1px 0 0 rgba(0,0,0,.8),-1px -1px 0 rgba(0,0,0,.8)}.rickshaw_legend{font-family:Arial;font-size:12px;color:#fff;background:#404040;display:inline-block;padding:12px 5px;border-radius:2px;position:relative}.rickshaw_legend:hover{z-index:10}.rickshaw_legend .swatch{width:10px;height:10px;border:1px solid rgba(0,0,0,.2)}.rickshaw_legend .line{clear:both;line-height:140%;padding-right:15px}.rickshaw_legend .line .swatch{display:inline-block;margin-right:3px;border-radius:2px}.rickshaw_legend .label{margin:0;white-space:nowrap;display:inline;font-size:inherit;background-color:transparent;color:inherit;font-weight:400;line-height:normal;padding:0;text-shadow:none}.rickshaw_legend .action:hover{opacity:.6}.rickshaw_legend .action{margin-right:.2em;font-size:10px;opacity:.2;cursor:pointer;font-size:14px}.rickshaw_legend .line.disabled{opacity:.4}.rickshaw_legend ul{list-style-type:none;margin:0;padding:0;margin:2px;cursor:pointer}.rickshaw_legend li{padding:0 0 0 2px;min-width:80px;white-space:nowrap}.rickshaw_legend li:hover{background:rgba(255,255,255,.08);border-radius:3px}.rickshaw_legend li:active{background:rgba(255,255,255,.2);border-radius:3px}
\ No newline at end of file
diff --git a/share/rickshaw.min.js b/share/rickshaw.min.js
new file mode 100644 (file)
index 0000000..6f262ba
--- /dev/null
@@ -0,0 +1,2 @@
+var Rickshaw={namespace:function(namespace,obj){var parts=namespace.split(".");var parent=Rickshaw;for(var i=1,length=parts.length;i<length;i++){var currentPart=parts[i];parent[currentPart]=parent[currentPart]||{};parent=parent[currentPart]}return parent},keys:function(obj){var keys=[];for(var key in obj)keys.push(key);return keys},extend:function(destination,source){for(var property in source){destination[property]=source[property]}return destination}};if(typeof module!=="undefined"&&module.exports){var d3=require("d3");module.exports=Rickshaw}(function(globalContext){var _toString=Object.prototype.toString,NULL_TYPE="Null",UNDEFINED_TYPE="Undefined",BOOLEAN_TYPE="Boolean",NUMBER_TYPE="Number",STRING_TYPE="String",OBJECT_TYPE="Object",FUNCTION_CLASS="[object Function]";function isFunction(object){return _toString.call(object)===FUNCTION_CLASS}function extend(destination,source){for(var property in source)if(source.hasOwnProperty(property))destination[property]=source[property];return destination}function keys(object){if(Type(object)!==OBJECT_TYPE){throw new TypeError}var results=[];for(var property in object){if(object.hasOwnProperty(property)){results.push(property)}}return results}function Type(o){switch(o){case null:return NULL_TYPE;case void 0:return UNDEFINED_TYPE}var type=typeof o;switch(type){case"boolean":return BOOLEAN_TYPE;case"number":return NUMBER_TYPE;case"string":return STRING_TYPE}return OBJECT_TYPE}function isUndefined(object){return typeof object==="undefined"}var slice=Array.prototype.slice;function argumentNames(fn){var names=fn.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");return names.length==1&&!names[0]?[]:names}function wrap(fn,wrapper){var __method=fn;return function(){var a=update([bind(__method,this)],arguments);return wrapper.apply(this,a)}}function update(array,args){var arrayLength=array.length,length=args.length;while(length--)array[arrayLength+length]=args[length];return array}function merge(array,args){array=slice.call(array,0);return update(array,args)}function bind(fn,context){if(arguments.length<2&&isUndefined(arguments[0]))return this;var __method=fn,args=slice.call(arguments,2);return function(){var a=merge(args,arguments);return __method.apply(context,a)}}var emptyFunction=function(){};var Class=function(){var IS_DONTENUM_BUGGY=function(){for(var p in{toString:1}){if(p==="toString")return false}return true}();function subclass(){}function create(){var parent=null,properties=[].slice.apply(arguments);if(isFunction(properties[0]))parent=properties.shift();function klass(){this.initialize.apply(this,arguments)}extend(klass,Class.Methods);klass.superclass=parent;klass.subclasses=[];if(parent){subclass.prototype=parent.prototype;klass.prototype=new subclass;try{parent.subclasses.push(klass)}catch(e){}}for(var i=0,length=properties.length;i<length;i++)klass.addMethods(properties[i]);if(!klass.prototype.initialize)klass.prototype.initialize=emptyFunction;klass.prototype.constructor=klass;return klass}function addMethods(source){var ancestor=this.superclass&&this.superclass.prototype,properties=keys(source);if(IS_DONTENUM_BUGGY){if(source.toString!=Object.prototype.toString)properties.push("toString");if(source.valueOf!=Object.prototype.valueOf)properties.push("valueOf")}for(var i=0,length=properties.length;i<length;i++){var property=properties[i],value=source[property];if(ancestor&&isFunction(value)&&argumentNames(value)[0]=="$super"){var method=value;value=wrap(function(m){return function(){return ancestor[m].apply(this,arguments)}}(property),method);value.valueOf=bind(method.valueOf,method);value.toString=bind(method.toString,method)}this.prototype[property]=value}return this}return{create:create,Methods:{addMethods:addMethods}}}();if(globalContext.exports){globalContext.exports.Class=Class}else{globalContext.Class=Class}})(Rickshaw);Rickshaw.namespace("Rickshaw.Compat.ClassList");Rickshaw.Compat.ClassList=function(){if(typeof document!=="undefined"&&!("classList"in document.createElement("a"))){(function(view){"use strict";var classListProp="classList",protoProp="prototype",elemCtrProto=(view.HTMLElement||view.Element)[protoProp],objCtr=Object,strTrim=String[protoProp].trim||function(){return this.replace(/^\s+|\s+$/g,"")},arrIndexOf=Array[protoProp].indexOf||function(item){var i=0,len=this.length;for(;i<len;i++){if(i in this&&this[i]===item){return i}}return-1},DOMEx=function(type,message){this.name=type;this.code=DOMException[type];this.message=message},checkTokenAndGetIndex=function(classList,token){if(token===""){throw new DOMEx("SYNTAX_ERR","An invalid or illegal string was specified")}if(/\s/.test(token)){throw new DOMEx("INVALID_CHARACTER_ERR","String contains an invalid character")}return arrIndexOf.call(classList,token)},ClassList=function(elem){var trimmedClasses=strTrim.call(elem.className),classes=trimmedClasses?trimmedClasses.split(/\s+/):[],i=0,len=classes.length;for(;i<len;i++){this.push(classes[i])}this._updateClassName=function(){elem.className=this.toString()}},classListProto=ClassList[protoProp]=[],classListGetter=function(){return new ClassList(this)};DOMEx[protoProp]=Error[protoProp];classListProto.item=function(i){return this[i]||null};classListProto.contains=function(token){token+="";return checkTokenAndGetIndex(this,token)!==-1};classListProto.add=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.push(token);this._updateClassName()}};classListProto.remove=function(token){token+="";var index=checkTokenAndGetIndex(this,token);if(index!==-1){this.splice(index,1);this._updateClassName()}};classListProto.toggle=function(token){token+="";if(checkTokenAndGetIndex(this,token)===-1){this.add(token)}else{this.remove(token)}};classListProto.toString=function(){return this.join(" ")};if(objCtr.defineProperty){var classListPropDesc={get:classListGetter,enumerable:true,configurable:true};try{objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}catch(ex){if(ex.number===-2146823252){classListPropDesc.enumerable=false;objCtr.defineProperty(elemCtrProto,classListProp,classListPropDesc)}}}else if(objCtr[protoProp].__defineGetter__){elemCtrProto.__defineGetter__(classListProp,classListGetter)}})(window)}};if(typeof RICKSHAW_NO_COMPAT!=="undefined"&&!RICKSHAW_NO_COMPAT||typeof RICKSHAW_NO_COMPAT==="undefined"){new Rickshaw.Compat.ClassList}Rickshaw.namespace("Rickshaw.Graph");Rickshaw.Graph=function(args){if(!args.element)throw"Rickshaw.Graph needs a reference to an element";this.element=args.element;this.series=args.series;this.defaults={interpolation:"cardinal",offset:"zero",min:undefined,max:undefined};Rickshaw.keys(this.defaults).forEach(function(k){this[k]=args[k]||this.defaults[k]},this);this.window={};this.updateCallbacks=[];var self=this;this.initialize=function(args){this.validateSeries(args.series);this.series.active=function(){return self.series.filter(function(s){return!s.disabled})};this.setSize({width:args.width,height:args.height});this.element.classList.add("rickshaw_graph");this.vis=d3.select(this.element).append("svg:svg").attr("width",this.width).attr("height",this.height);var renderers=[Rickshaw.Graph.Renderer.Stack,Rickshaw.Graph.Renderer.Line,Rickshaw.Graph.Renderer.Bar,Rickshaw.Graph.Renderer.Area,Rickshaw.Graph.Renderer.ScatterPlot];renderers.forEach(function(r){if(!r)return;self.registerRenderer(new r({graph:self}))});this.setRenderer(args.renderer||"stack",args);this.discoverRange()};this.validateSeries=function(series){if(!(series instanceof Array)&&!(series instanceof Rickshaw.Series)){var seriesSignature=Object.prototype.toString.apply(series);throw"series is not an array: "+seriesSignature}var pointsCount;series.forEach(function(s){if(!(s instanceof Object)){throw"series element is not an object: "+s}if(!s.data){throw"series has no data: "+JSON.stringify(s)}if(!(s.data instanceof Array)){throw"series data is not an array: "+JSON.stringify(s.data)}var x=s.data[0].x;var y=s.data[0].y;if(typeof x!="number"||typeof y!="number"&&y!==null){throw"x and y properties of points should be numbers instead of "+typeof x+" and "+typeof y}},this)};this.dataDomain=function(){var data=this.series[0].data;return[data[0].x,data.slice(-1).shift().x]};this.discoverRange=function(){var domain=this.renderer.domain();this.x=d3.scale.linear().domain(domain.x).range([0,this.width]);this.y=d3.scale.linear().domain(domain.y).range([this.height,0]);this.y.magnitude=d3.scale.linear().domain([domain.y[0]-domain.y[0],domain.y[1]-domain.y[0]]).range([0,this.height])};this.render=function(){var stackedData=this.stackData();this.discoverRange();this.renderer.render();this.updateCallbacks.forEach(function(callback){callback()})};this.update=this.render;this.stackData=function(){var data=this.series.active().map(function(d){return d.data}).map(function(d){return d.filter(function(d){return this._slice(d)},this)},this);this.stackData.hooks.data.forEach(function(entry){data=entry.f.apply(self,[data])});var stackedData;if(!this.renderer.unstack){this._validateStackable();var layout=d3.layout.stack();layout.offset(self.offset);stackedData=layout(data)}stackedData=stackedData||data;this.stackData.hooks.after.forEach(function(entry){stackedData=entry.f.apply(self,[data])});var i=0;this.series.forEach(function(series){if(series.disabled)return;series.stack=stackedData[i++]});this.stackedData=stackedData;return stackedData};this._validateStackable=function(){var series=this.series;var pointsCount;series.forEach(function(s){pointsCount=pointsCount||s.data.length;if(pointsCount&&s.data.length!=pointsCount){throw"stacked series cannot have differing numbers of points: "+pointsCount+" vs "+s.data.length+"; see Rickshaw.Series.fill()"}},this)};this.stackData.hooks={data:[],after:[]};this._slice=function(d){if(this.window.xMin||this.window.xMax){var isInRange=true;if(this.window.xMin&&d.x<this.window.xMin)isInRange=false;if(this.window.xMax&&d.x>this.window.xMax)isInRange=false;return isInRange}return true};this.onUpdate=function(callback){this.updateCallbacks.push(callback)};this.registerRenderer=function(renderer){this._renderers=this._renderers||{};this._renderers[renderer.name]=renderer};this.configure=function(args){if(args.width||args.height){this.setSize(args)}Rickshaw.keys(this.defaults).forEach(function(k){this[k]=k in args?args[k]:k in this?this[k]:this.defaults[k]},this);this.setRenderer(args.renderer||this.renderer.name,args)};this.setRenderer=function(name,args){if(!this._renderers[name]){throw"couldn't find renderer "+name}this.renderer=this._renderers[name];if(typeof args=="object"){this.renderer.configure(args)}};this.setSize=function(args){args=args||{};if(typeof window!==undefined){var style=window.getComputedStyle(this.element,null);var elementWidth=parseInt(style.getPropertyValue("width"));var elementHeight=parseInt(style.getPropertyValue("height"))}this.width=args.width||elementWidth||400;this.height=args.height||elementHeight||250;this.vis&&this.vis.attr("width",this.width).attr("height",this.height)};this.initialize(args)};Rickshaw.namespace("Rickshaw.Fixtures.Color");Rickshaw.Fixtures.Color=function(){this.schemes={};this.schemes.spectrum14=["#ecb796","#dc8f70","#b2a470","#92875a","#716c49","#d2ed82","#bbe468","#a1d05d","#e7cbe6","#d8aad6","#a888c2","#9dc2d3","#649eb9","#387aa3"].reverse();this.schemes.spectrum2000=["#57306f","#514c76","#646583","#738394","#6b9c7d","#84b665","#a7ca50","#bfe746","#e2f528","#fff726","#ecdd00","#d4b11d","#de8800","#de4800","#c91515","#9a0000","#7b0429","#580839","#31082b"];this.schemes.spectrum2001=["#2f243f","#3c2c55","#4a3768","#565270","#6b6b7c","#72957f","#86ad6e","#a1bc5e","#b8d954","#d3e04e","#ccad2a","#cc8412","#c1521d","#ad3821","#8a1010","#681717","#531e1e","#3d1818","#320a1b"];this.schemes.classic9=["#423d4f","#4a6860","#848f39","#a2b73c","#ddcb53","#c5a32f","#7d5836","#963b20","#7c2626","#491d37","#2f254a"].reverse();this.schemes.httpStatus={503:"#ea5029",502:"#d23f14",500:"#bf3613",410:"#efacea",409:"#e291dc",403:"#f457e8",408:"#e121d2",401:"#b92dae",405:"#f47ceb",404:"#a82a9f",400:"#b263c6",301:"#6fa024",302:"#87c32b",307:"#a0d84c",304:"#28b55c",200:"#1a4f74",206:"#27839f",201:"#52adc9",202:"#7c979f",203:"#a5b8bd",204:"#c1cdd1"};this.schemes.colorwheel=["#b5b6a9","#858772","#785f43","#96557e","#4682b4","#65b9ac","#73c03a","#cb513a"].reverse();this.schemes.cool=["#5e9d2f","#73c03a","#4682b4","#7bc3b8","#a9884e","#c1b266","#a47493","#c09fb5"];this.schemes.munin=["#00cc00","#0066b3","#ff8000","#ffcc00","#330099","#990099","#ccff00","#ff0000","#808080","#008f00","#00487d","#b35a00","#b38f00","#6b006b","#8fb300","#b30000","#bebebe","#80ff80","#80c9ff","#ffc080","#ffe680","#aa80ff","#ee00cc","#ff8080","#666600","#ffbfff","#00ffcc","#cc6699","#999900"]};Rickshaw.namespace("Rickshaw.Fixtures.RandomData");Rickshaw.Fixtures.RandomData=function(timeInterval){var addData;timeInterval=timeInterval||1;var lastRandomValue=200;var timeBase=Math.floor((new Date).getTime()/1e3);this.addData=function(data){var randomValue=Math.random()*100+15+lastRandomValue;var index=data[0].length;var counter=1;data.forEach(function(series){var randomVariance=Math.random()*20;var v=randomValue/25+counter++ +(Math.cos(index*counter*11/960)+2)*15+(Math.cos(index/7)+2)*7+(Math.cos(index/17)+2)*1;series.push({x:index*timeInterval+timeBase,y:v+randomVariance})});lastRandomValue=randomValue*.85}};Rickshaw.namespace("Rickshaw.Fixtures.Time");Rickshaw.Fixtures.Time=function(){var tzOffset=(new Date).getTimezoneOffset()*60;var self=this;this.months=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];this.units=[{name:"decade",seconds:86400*365.25*10,formatter:function(d){return parseInt(d.getUTCFullYear()/10)*10}},{name:"year",seconds:86400*365.25,formatter:function(d){return d.getUTCFullYear()}},{name:"month",seconds:86400*30.5,formatter:function(d){return self.months[d.getUTCMonth()]}},{name:"week",seconds:86400*7,formatter:function(d){return self.formatDate(d)}},{name:"day",seconds:86400,formatter:function(d){return d.getUTCDate()}},{name:"6 hour",seconds:3600*6,formatter:function(d){return self.formatTime(d)}},{name:"hour",seconds:3600,formatter:function(d){return self.formatTime(d)}},{name:"15 minute",seconds:60*15,formatter:function(d){return self.formatTime(d)}},{name:"minute",seconds:60,formatter:function(d){return d.getUTCMinutes()}},{name:"15 second",seconds:15,formatter:function(d){return d.getUTCSeconds()+"s"}},{name:"second",seconds:1,formatter:function(d){return d.getUTCSeconds()+"s"}}];this.unit=function(unitName){return this.units.filter(function(unit){return unitName==unit.name}).shift()};this.formatDate=function(d){return d.toUTCString().match(/, (\w+ \w+ \w+)/)[1]};this.formatTime=function(d){return d.toUTCString().match(/(\d+:\d+):/)[1]};this.ceil=function(time,unit){if(unit.name=="month"){var nearFuture=new Date((time+unit.seconds-1)*1e3);var rounded=new Date(0);rounded.setUTCFullYear(nearFuture.getUTCFullYear());rounded.setUTCMonth(nearFuture.getUTCMonth());rounded.setUTCDate(1);rounded.setUTCHours(0);rounded.setUTCMinutes(0);rounded.setUTCSeconds(0);rounded.setUTCMilliseconds(0);return rounded.getTime()/1e3}if(unit.name=="year"){var nearFuture=new Date((time+unit.seconds-1)*1e3);var rounded=new Date(0);rounded.setUTCFullYear(nearFuture.getUTCFullYear());rounded.setUTCMonth(0);rounded.setUTCDate(1);rounded.setUTCHours(0);rounded.setUTCMinutes(0);rounded.setUTCSeconds(0);rounded.setUTCMilliseconds(0);return rounded.getTime()/1e3}return Math.ceil(time/unit.seconds)*unit.seconds}};Rickshaw.namespace("Rickshaw.Fixtures.Number");Rickshaw.Fixtures.Number.formatKMBT=function(y){abs_y=Math.abs(y);if(abs_y>=1e12){return y/1e12+"T"}else if(abs_y>=1e9){return y/1e9+"B"}else if(abs_y>=1e6){return y/1e6+"M"}else if(abs_y>=1e3){return y/1e3+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y==0){return""}else{return y}};Rickshaw.Fixtures.Number.formatBase1024KMGTP=function(y){abs_y=Math.abs(y);if(abs_y>=0x4000000000000){return y/0x4000000000000+"P"}else if(abs_y>=1099511627776){return y/1099511627776+"T"}else if(abs_y>=1073741824){return y/1073741824+"G"}else if(abs_y>=1048576){return y/1048576+"M"}else if(abs_y>=1024){return y/1024+"K"}else if(abs_y<1&&y>0){return y.toFixed(2)}else if(abs_y==0){return""}else{return y}};Rickshaw.namespace("Rickshaw.Color.Palette");Rickshaw.Color.Palette=function(args){var color=new Rickshaw.Fixtures.Color;args=args||{};this.schemes={};this.scheme=color.schemes[args.scheme]||args.scheme||color.schemes.colorwheel;this.runningIndex=0;this.generatorIndex=0;if(args.interpolatedStopCount){var schemeCount=this.scheme.length-1;var i,j,scheme=[];for(i=0;i<schemeCount;i++){scheme.push(this.scheme[i]);var generator=d3.interpolateHsl(this.scheme[i],this.scheme[i+1]);for(j=1;j<args.interpolatedStopCount;j++){scheme.push(generator(1/args.interpolatedStopCount*j))}}scheme.push(this.scheme[this.scheme.length-1]);this.scheme=scheme}this.rotateCount=this.scheme.length;this.color=function(key){return this.scheme[key]||this.scheme[this.runningIndex++]||this.interpolateColor()||"#808080"};this.interpolateColor=function(){if(!Array.isArray(this.scheme))return;var color;if(this.generatorIndex==this.rotateCount*2-1){color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[0])(.5);this.generatorIndex=0;this.rotateCount*=2}else{color=d3.interpolateHsl(this.scheme[this.generatorIndex],this.scheme[this.generatorIndex+1])(.5);this.generatorIndex++}this.scheme.push(color);return color}};Rickshaw.namespace("Rickshaw.Graph.Ajax");Rickshaw.Graph.Ajax=Rickshaw.Class.create({initialize:function(args){this.dataURL=args.dataURL;this.onData=args.onData||function(d){return d};this.onComplete=args.onComplete||function(){};this.onError=args.onError||function(){};this.args=args;this.request()},request:function(){$.ajax({url:this.dataURL,dataType:"json",success:this.success.bind(this),error:this.error.bind(this)})},error:function(){console.log("error loading dataURL: "+this.dataURL);this.onError(this)},success:function(data,status){data=this.onData(data);this.args.series=this._splice({data:data,series:this.args.series});this.graph=this.graph||new Rickshaw.Graph(this.args);this.graph.render();this.onComplete(this)},_splice:function(args){var data=args.data;var series=args.series;if(!args.series)return data;series.forEach(function(s){var seriesKey=s.key||s.name;if(!seriesKey)throw"series needs a key or a name";data.forEach(function(d){var dataKey=d.key||d.name;if(!dataKey)throw"data needs a key or a name";if(seriesKey==dataKey){var properties=["color","name","data"];properties.forEach(function(p){if(d[p])s[p]=d[p]})}})});return series}});Rickshaw.namespace("Rickshaw.Graph.Annotate");Rickshaw.Graph.Annotate=function(args){var graph=this.graph=args.graph;this.elements={timeline:args.element};var self=this;this.data={};this.elements.timeline.classList.add("rickshaw_annotation_timeline");this.add=function(time,content,end_time){self.data[time]=self.data[time]||{boxes:[]};self.data[time].boxes.push({content:content,end:end_time})};this.update=function(){Rickshaw.keys(self.data).forEach(function(time){var annotation=self.data[time];var left=self.graph.x(time);if(left<0||left>self.graph.x.range()[1]){if(annotation.element){annotation.line.classList.add("offscreen");annotation.element.style.display="none"}annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.add("offscreen")});return}if(!annotation.element){var element=annotation.element=document.createElement("div");element.classList.add("annotation");this.elements.timeline.appendChild(element);element.addEventListener("click",function(e){element.classList.toggle("active");annotation.line.classList.toggle("active");annotation.boxes.forEach(function(box){if(box.rangeElement)box.rangeElement.classList.toggle("active")})},false)}annotation.element.style.left=left+"px";annotation.element.style.display="block";annotation.boxes.forEach(function(box){var element=box.element;if(!element){element=box.element=document.createElement("div");element.classList.add("content");element.innerHTML=box.content;annotation.element.appendChild(element);annotation.line=document.createElement("div");annotation.line.classList.add("annotation_line");self.graph.element.appendChild(annotation.line);if(box.end){box.rangeElement=document.createElement("div");box.rangeElement.classList.add("annotation_range");self.graph.element.appendChild(box.rangeElement)}}if(box.end){var annotationRangeStart=left;var annotationRangeEnd=Math.min(self.graph.x(box.end),self.graph.x.range()[1]);if(annotationRangeStart>annotationRangeEnd){annotationRangeEnd=left;annotationRangeStart=Math.max(self.graph.x(box.end),self.graph.x.range()[0])}var annotationRangeWidth=annotationRangeEnd-annotationRangeStart;box.rangeElement.style.left=annotationRangeStart+"px";box.rangeElement.style.width=annotationRangeWidth+"px";box.rangeElement.classList.remove("offscreen")}annotation.line.classList.remove("offscreen");annotation.line.style.left=left+"px"})},this)};this.graph.onUpdate(function(){self.update()})};Rickshaw.namespace("Rickshaw.Graph.Axis.Time");Rickshaw.Graph.Axis.Time=function(args){var self=this;this.graph=args.graph;this.elements=[];this.ticksTreatment=args.ticksTreatment||"plain";this.fixedTimeUnit=args.timeUnit;var time=new Rickshaw.Fixtures.Time;this.appropriateTimeUnit=function(){var unit;var units=time.units;var domain=this.graph.x.domain();var rangeSeconds=domain[1]-domain[0];units.forEach(function(u){if(Math.floor(rangeSeconds/u.seconds)>=2){unit=unit||u}});return unit||time.units[time.units.length-1]};this.tickOffsets=function(){var domain=this.graph.x.domain();var unit=this.fixedTimeUnit||this.appropriateTimeUnit();var count=Math.ceil((domain[1]-domain[0])/unit.seconds);var runningTick=domain[0];var offsets=[];for(var i=0;i<count;i++){var tickValue=time.ceil(runningTick,unit);runningTick=tickValue+unit.seconds/2;offsets.push({value:tickValue,unit:unit})}return offsets};this.render=function(){this.elements.forEach(function(e){e.parentNode.removeChild(e)});this.elements=[];var offsets=this.tickOffsets();offsets.forEach(function(o){if(self.graph.x(o.value)>self.graph.x.range()[1])return;var element=document.createElement("div");element.style.left=self.graph.x(o.value)+"px";element.classList.add("x_tick");element.classList.add(self.ticksTreatment);var title=document.createElement("div");title.classList.add("title");title.innerHTML=o.unit.formatter(new Date(o.value*1e3));element.appendChild(title);self.graph.element.appendChild(element);self.elements.push(element)})};this.graph.onUpdate(function(){self.render()})};Rickshaw.namespace("Rickshaw.Graph.Axis.X");Rickshaw.Graph.Axis.X=function(args){var self=this;var berthRate=.1;this.initialize=function(args){this.graph=args.graph;this.orientation=args.orientation||"top";var pixelsPerTick=args.pixelsPerTick||75;this.ticks=args.ticks||Math.floor(this.graph.width/pixelsPerTick);this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";if(args.element){this.element=args.element;this._discoverSize(args.element,args);this.vis=d3.select(args.element).append("svg:svg").attr("height",this.height).attr("width",this.width).attr("class","rickshaw_graph x_axis_d3");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}this.graph.onUpdate(function(){self.render()})};this.setSize=function(args){args=args||{};if(!this.element)return;this._discoverSize(this.element.parentNode,args);this.vis.attr("height",this.height).attr("width",this.width*(1+berthRate));var berth=Math.floor(this.width*berthRate/2);this.element.style.left=-1*berth+"px"};this.render=function(){if(this.graph.width!==this._renderWidth)this.setSize({auto:true});var axis=d3.svg.axis().scale(this.graph.x).orient(this.orientation);axis.tickFormat(args.tickFormat||function(x){return x});var berth=Math.floor(this.width*berthRate/2)||0;if(this.orientation=="top"){var yOffset=this.height||this.graph.height;var transform="translate("+berth+","+yOffset+")"}else{var transform="translate("+berth+", 0)"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["x_ticks_d3",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var gridSize=(this.orientation=="bottom"?1:-1)*this.graph.height;this.graph.vis.append("svg:g").attr("class","x_grid_d3").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize));this._renderHeight=this.graph.height};this._discoverSize=function(element,args){if(typeof window!=="undefined"){var style=window.getComputedStyle(element,null);var elementHeight=parseInt(style.getPropertyValue("height"));if(!args.auto){var elementWidth=parseInt(style.getPropertyValue("width"))}}this.width=(args.width||elementWidth||this.graph.width)*(1+berthRate);this.height=args.height||elementHeight||40};this.initialize(args)};Rickshaw.namespace("Rickshaw.Graph.Axis.Y");Rickshaw.Graph.Axis.Y=function(args){var self=this;var berthRate=.1;this.initialize=function(args){this.graph=args.graph;this.orientation=args.orientation||"right";var pixelsPerTick=args.pixelsPerTick||75;this.ticks=args.ticks||Math.floor(this.graph.height/pixelsPerTick);this.tickSize=args.tickSize||4;this.ticksTreatment=args.ticksTreatment||"plain";if(args.element){this.element=args.element;this.vis=d3.select(args.element).append("svg:svg").attr("class","rickshaw_graph y_axis");this.element=this.vis[0][0];this.element.style.position="relative";this.setSize({width:args.width,height:args.height})}else{this.vis=this.graph.vis}this.graph.onUpdate(function(){self.render()})};this.setSize=function(args){args=args||{};if(!this.element)return;if(typeof window!=="undefined"){var style=window.getComputedStyle(this.element.parentNode,null);var elementWidth=parseInt(style.getPropertyValue("width"));if(!args.auto){var elementHeight=parseInt(style.getPropertyValue("height"))}}this.width=args.width||elementWidth||this.graph.width*berthRate;this.height=args.height||elementHeight||this.graph.height;this.vis.attr("width",this.width).attr("height",this.height*(1+berthRate));var berth=this.height*berthRate;this.element.style.top=-1*berth+"px"};this.render=function(){if(this.graph.height!==this._renderHeight)this.setSize({auto:true});var axis=d3.svg.axis().scale(this.graph.y).orient(this.orientation);axis.tickFormat(args.tickFormat||function(y){return y});if(this.orientation=="left"){var berth=this.height*berthRate;var transform="translate("+this.width+", "+berth+")"}if(this.element){this.vis.selectAll("*").remove()}this.vis.append("svg:g").attr("class",["y_ticks",this.ticksTreatment].join(" ")).attr("transform",transform).call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(this.tickSize));var gridSize=(this.orientation=="right"?1:-1)*this.graph.width;this.graph.vis.append("svg:g").attr("class","y_grid").call(axis.ticks(this.ticks).tickSubdivide(0).tickSize(gridSize));this._renderHeight=this.graph.height};this.initialize(args)};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Highlight");Rickshaw.Graph.Behavior.Series.Highlight=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;var colorSafe={};var activeLine=null;this.addHighlightEvents=function(l){l.element.addEventListener("mouseover",function(e){if(activeLine)return;else activeLine=l;self.legend.lines.forEach(function(line,index){if(l===line){if(index>0&&self.graph.renderer.unstack){var seriesIndex=self.graph.series.length-index-1;line.originalIndex=seriesIndex;var series=self.graph.series.splice(seriesIndex,1)[0];self.graph.series.push(series)}return}colorSafe[line.series.name]=colorSafe[line.series.name]||line.series.color;line.series.color=d3.interpolateRgb(line.series.color,d3.rgb("#d8d8d8"))(.8).toString()});self.graph.update()},false);l.element.addEventListener("mouseout",function(e){if(!activeLine)return;else activeLine=null;self.legend.lines.forEach(function(line){if(l===line&&line.hasOwnProperty("originalIndex")){var series=self.graph.series.pop();self.graph.series.splice(line.originalIndex,0,series);delete line["originalIndex"]}if(colorSafe[line.series.name]){line.series.color=colorSafe[line.series.name]}});self.graph.update()},false)};if(this.legend){this.legend.lines.forEach(function(l){self.addHighlightEvents(l)})}};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Order");Rickshaw.Graph.Behavior.Series.Order=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;$(function(){$(self.legend.list).sortable({containment:"parent",tolerance:"pointer",update:function(event,ui){var series=[];$(self.legend.list).find("li").each(function(index,item){if(!item.series)return;series.push(item.series)});for(var i=self.graph.series.length-1;i>=0;i--){self.graph.series[i]=series.shift()}self.graph.update()}});$(self.legend.list).disableSelection()});this.graph.onUpdate(function(){var h=window.getComputedStyle(self.legend.element).height;self.legend.element.style.height=h})};Rickshaw.namespace("Rickshaw.Graph.Behavior.Series.Toggle");Rickshaw.Graph.Behavior.Series.Toggle=function(args){this.graph=args.graph;this.legend=args.legend;var self=this;this.addAnchor=function(line){var anchor=document.createElement("a");anchor.innerHTML="&#10004;";anchor.classList.add("action");line.element.insertBefore(anchor,line.element.firstChild);anchor.onclick=function(e){if(line.series.disabled){line.series.enable();line.element.classList.remove("disabled")}else{line.series.disable();line.element.classList.add("disabled")}};var label=line.element.getElementsByTagName("span")[0];label.onclick=function(e){var disableAllOtherLines=line.series.disabled;if(!disableAllOtherLines){for(var i=0;i<self.legend.lines.length;i++){var l=self.legend.lines[i];if(line.series===l.series){}else if(l.series.disabled){}else{disableAllOtherLines=true;break}}}if(disableAllOtherLines){line.series.enable();line.element.classList.remove("disabled");self.legend.lines.forEach(function(l){if(line.series===l.series){}else{l.series.disable();l.element.classList.add("disabled")}})}else{self.legend.lines.forEach(function(l){l.series.enable();l.element.classList.remove("disabled")})}}};if(this.legend){$(this.legend.list).sortable({start:function(event,ui){ui.item.bind("no.onclick",function(event){event.preventDefault()})},stop:function(event,ui){setTimeout(function(){ui.item.unbind("no.onclick")},250)}});this.legend.lines.forEach(function(l){self.addAnchor(l)})}this._addBehavior=function(){this.graph.series.forEach(function(s){s.disable=function(){if(self.graph.series.length<=1){throw"only one series left"}s.disabled=true;self.graph.update()};s.enable=function(){s.disabled=false;self.graph.update()}})};this._addBehavior();this.updateBehaviour=function(){this._addBehavior()}};Rickshaw.namespace("Rickshaw.Graph.HoverDetail");Rickshaw.Graph.HoverDetail=Rickshaw.Class.create({initialize:function(args){var graph=this.graph=args.graph;this.xFormatter=args.xFormatter||function(x){return new Date(x*1e3).toUTCString()};this.yFormatter=args.yFormatter||function(y){return y===null?y:y.toFixed(2)};var element=this.element=document.createElement("div");element.className="detail";this.visible=true;graph.element.appendChild(element);this.lastEvent=null;this._addListeners();this.onShow=args.onShow;this.onHide=args.onHide;this.onRender=args.onRender;this.formatter=args.formatter||this.formatter},formatter:function(series,x,y,formattedX,formattedY,d){return series.name+":&nbsp;"+formattedY},update:function(e){e=e||this.lastEvent;if(!e)return;this.lastEvent=e;if(!e.target.nodeName.match(/^(path|svg|rect)$/))return;var graph=this.graph;var eventX=e.offsetX||e.layerX;var eventY=e.offsetY||e.layerY;var j=0;var points=[];var nearestPoint;this.graph.series.active().forEach(function(series){var data=this.graph.stackedData[j++];var domainX=graph.x.invert(eventX);var domainIndexScale=d3.scale.linear().domain([data[0].x,data.slice(-1)[0].x]).range([0,data.length]);
+var approximateIndex=Math.floor(domainIndexScale(domainX));var dataIndex=Math.min(approximateIndex||0,data.length-1);for(var i=approximateIndex;i<data.length-1;){if(!data[i]||!data[i+1])break;if(data[i].x<=domainX&&data[i+1].x>domainX){dataIndex=i;break}if(data[i+1].x<=domainX){i++}else{i--}}var value=data[dataIndex];var distance=Math.sqrt(Math.pow(Math.abs(graph.x(value.x)-eventX),2)+Math.pow(Math.abs(graph.y(value.y+value.y0)-eventY),2));var xFormatter=series.xFormatter||this.xFormatter;var yFormatter=series.yFormatter||this.yFormatter;var point={formattedXValue:xFormatter(value.x),formattedYValue:yFormatter(value.y),series:series,value:value,distance:distance,order:j,name:series.name};if(!nearestPoint||distance<nearestPoint.distance){nearestPoint=point}points.push(point)},this);nearestPoint.active=true;var domainX=nearestPoint.value.x;var formattedXValue=nearestPoint.formattedXValue;this.element.innerHTML="";this.element.style.left=graph.x(domainX)+"px";this.visible&&this.render({points:points,detail:points,mouseX:eventX,mouseY:eventY,formattedXValue:formattedXValue,domainX:domainX})},hide:function(){this.visible=false;this.element.classList.add("inactive");if(typeof this.onHide=="function"){this.onHide()}},show:function(){this.visible=true;this.element.classList.remove("inactive");if(typeof this.onShow=="function"){this.onShow()}},render:function(args){var graph=this.graph;var points=args.points;var point=points.filter(function(p){return p.active}).shift();if(point.value.y===null)return;var formattedXValue=this.xFormatter(point.value.x);var formattedYValue=this.yFormatter(point.value.y);this.element.innerHTML="";this.element.style.left=graph.x(point.value.x)+"px";var xLabel=document.createElement("div");xLabel.className="x_label";xLabel.innerHTML=formattedXValue;this.element.appendChild(xLabel);var item=document.createElement("div");item.className="item";item.innerHTML=this.formatter(point.series,point.value.x,point.value.y,formattedXValue,formattedYValue,point);item.style.top=this.graph.y(point.value.y0+point.value.y)+"px";this.element.appendChild(item);var dot=document.createElement("div");dot.className="dot";dot.style.top=item.style.top;dot.style.borderColor=point.series.color;this.element.appendChild(dot);if(point.active){item.className="item active";dot.className="dot active"}this.show();if(typeof this.onRender=="function"){this.onRender(args)}},_addListeners:function(){this.graph.element.addEventListener("mousemove",function(e){this.visible=true;this.update(e)}.bind(this),false);this.graph.onUpdate(function(){this.update()}.bind(this));this.graph.element.addEventListener("mouseout",function(e){if(e.relatedTarget&&!(e.relatedTarget.compareDocumentPosition(this.graph.element)&Node.DOCUMENT_POSITION_CONTAINS)){this.hide()}}.bind(this),false)}});Rickshaw.namespace("Rickshaw.Graph.JSONP");Rickshaw.Graph.JSONP=Rickshaw.Class.create(Rickshaw.Graph.Ajax,{request:function(){$.ajax({url:this.dataURL,dataType:"jsonp",success:this.success.bind(this),error:this.error.bind(this)})}});Rickshaw.namespace("Rickshaw.Graph.Legend");Rickshaw.Graph.Legend=function(args){var element=this.element=args.element;var graph=this.graph=args.graph;var self=this;element.classList.add("rickshaw_legend");var list=this.list=document.createElement("ul");element.appendChild(list);var series=graph.series.map(function(s){return s});if(!args.naturalOrder){series=series.reverse()}this.lines=[];this.addLine=function(series){var line=document.createElement("li");line.className="line";var swatch=document.createElement("div");swatch.className="swatch";swatch.style.backgroundColor=series.color;line.appendChild(swatch);var label=document.createElement("span");label.className="label";label.innerHTML=series.name;line.appendChild(label);list.appendChild(line);line.series=series;if(series.noLegend){line.style.display="none"}var _line={element:line,series:series};if(self.shelving){self.shelving.addAnchor(_line);self.shelving.updateBehaviour()}if(self.highlighter){self.highlighter.addHighlightEvents(_line)}self.lines.push(_line)};series.forEach(function(s){self.addLine(s)});graph.onUpdate(function(){})};Rickshaw.namespace("Rickshaw.Graph.RangeSlider");Rickshaw.Graph.RangeSlider=function(args){var element=this.element=args.element;var graph=this.graph=args.graph;$(function(){$(element).slider({range:true,min:graph.dataDomain()[0],max:graph.dataDomain()[1],values:[graph.dataDomain()[0],graph.dataDomain()[1]],slide:function(event,ui){graph.window.xMin=ui.values[0];graph.window.xMax=ui.values[1];graph.update();if(graph.dataDomain()[0]==ui.values[0]){graph.window.xMin=undefined}if(graph.dataDomain()[1]==ui.values[1]){graph.window.xMax=undefined}}})});element[0].style.width=graph.width+"px";graph.onUpdate(function(){var values=$(element).slider("option","values");$(element).slider("option","min",graph.dataDomain()[0]);$(element).slider("option","max",graph.dataDomain()[1]);if(graph.window.xMin==undefined){values[0]=graph.dataDomain()[0]}if(graph.window.xMax==undefined){values[1]=graph.dataDomain()[1]}$(element).slider("option","values",values)})};Rickshaw.namespace("Rickshaw.Graph.Renderer");Rickshaw.Graph.Renderer=Rickshaw.Class.create({initialize:function(args){this.graph=args.graph;this.tension=args.tension||this.tension;this.graph.unstacker=this.graph.unstacker||new Rickshaw.Graph.Unstacker({graph:this.graph});this.configure(args)},seriesPathFactory:function(){},seriesStrokeFactory:function(){},defaults:function(){return{tension:.8,strokeWidth:2,unstack:true,padding:{top:.01,right:0,bottom:.01,left:0},stroke:false,fill:false}},domain:function(){var values={xMin:[],xMax:[],y:[]};var stackedData=this.graph.stackedData||this.graph.stackData();var firstPoint=stackedData[0][0];var xMin=firstPoint.x;var xMax=firstPoint.x;var yMin=firstPoint.y+firstPoint.y0;var yMax=firstPoint.y+firstPoint.y0;stackedData.forEach(function(series){series.forEach(function(d){var y=d.y+d.y0;if(y<yMin)yMin=y;if(y>yMax)yMax=y});if(series[0].x<xMin)xMin=series[0].x;if(series[series.length-1].x>xMax)xMax=series[series.length-1].x});xMin-=(xMax-xMin)*this.padding.left;xMax+=(xMax-xMin)*this.padding.right;yMin=this.graph.min==="auto"?yMin:this.graph.min||0;yMax=this.graph.max||yMax;if(this.graph.min==="auto"||yMin<0){yMin-=(yMax-yMin)*this.padding.bottom}if(this.graph.max===undefined){yMax+=(yMax-yMin)*this.padding.top}return{x:[xMin,xMax],y:[yMin,yMax]}},render:function(){var graph=this.graph;graph.vis.selectAll("*").remove();var nodes=graph.vis.selectAll("path").data(this.graph.stackedData).enter().append("svg:path").attr("d",this.seriesPathFactory());var i=0;graph.series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){var fill=this.fill?series.color:"none";var stroke=this.stroke?series.color:"none";series.path.setAttribute("fill",fill);series.path.setAttribute("stroke",stroke);series.path.setAttribute("stroke-width",this.strokeWidth);series.path.setAttribute("class",series.className)},configure:function(args){args=args||{};Rickshaw.keys(this.defaults()).forEach(function(key){if(!args.hasOwnProperty(key)){this[key]=this[key]||this.graph[key]||this.defaults()[key];return}if(typeof this.defaults()[key]=="object"){Rickshaw.keys(this.defaults()[key]).forEach(function(k){this[key][k]=args[key][k]!==undefined?args[key][k]:this[key][k]!==undefined?this[key][k]:this.defaults()[key][k]},this)}else{this[key]=args[key]!==undefined?args[key]:this[key]!==undefined?this[key]:this.graph[key]!==undefined?this.graph[key]:this.defaults()[key]}},this)},setStrokeWidth:function(strokeWidth){if(strokeWidth!==undefined){this.strokeWidth=strokeWidth}},setTension:function(tension){if(tension!==undefined){this.tension=tension}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Line");Rickshaw.Graph.Renderer.Line=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"line",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:false,stroke:true})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Stack");Rickshaw.Graph.Renderer.Stack=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"stack",defaults:function($super){return Rickshaw.extend($super(),{fill:true,stroke:false,unstack:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(this.graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Bar");Rickshaw.Graph.Renderer.Bar=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"bar",defaults:function($super){var defaults=Rickshaw.extend($super(),{gapSize:.05,unstack:false});delete defaults.tension;return defaults},initialize:function($super,args){args=args||{};this.gapSize=args.gapSize||this.gapSize;$super(args)},domain:function($super){var domain=$super();var frequentInterval=this._frequentInterval();domain.x[1]+=parseInt(frequentInterval.magnitude);return domain},barWidth:function(){var stackedData=this.graph.stackedData||this.graph.stackData();var data=stackedData.slice(-1).shift();var frequentInterval=this._frequentInterval();var barWidth=this.graph.x(data[0].x+frequentInterval.magnitude*(1-this.gapSize));return barWidth},render:function(){var graph=this.graph;graph.vis.selectAll("*").remove();var barWidth=this.barWidth();var barXOffset=0;var activeSeriesCount=graph.series.filter(function(s){return!s.disabled}).length;var seriesBarWidth=this.unstack?barWidth/activeSeriesCount:barWidth;var transform=function(d){var matrix=[1,0,0,d.y<0?-1:1,0,d.y<0?graph.y.magnitude(Math.abs(d.y))*2:0];return"matrix("+matrix.join(",")+")"};graph.series.forEach(function(series){if(series.disabled)return;var nodes=graph.vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:rect").attr("x",function(d){return graph.x(d.x)+barXOffset}).attr("y",function(d){return graph.y(d.y0+Math.abs(d.y))*(d.y<0?-1:1)}).attr("width",seriesBarWidth).attr("height",function(d){return graph.y.magnitude(Math.abs(d.y))}).attr("transform",transform);Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)});if(this.unstack)barXOffset+=seriesBarWidth},this)},_frequentInterval:function(){var stackedData=this.graph.stackedData||this.graph.stackData();var data=stackedData.slice(-1).shift();var intervalCounts={};for(var i=0;i<data.length-1;i++){var interval=data[i+1].x-data[i].x;intervalCounts[interval]=intervalCounts[interval]||0;intervalCounts[interval]++}var frequentInterval={count:0};Rickshaw.keys(intervalCounts).forEach(function(i){if(frequentInterval.count<intervalCounts[i]){frequentInterval={count:intervalCounts[i],magnitude:i}}});this._frequentInterval=function(){return frequentInterval};return frequentInterval}});Rickshaw.namespace("Rickshaw.Graph.Renderer.Area");Rickshaw.Graph.Renderer.Area=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"area",defaults:function($super){return Rickshaw.extend($super(),{unstack:false,fill:false,stroke:false})},seriesPathFactory:function(){var graph=this.graph;var factory=d3.svg.area().x(function(d){return graph.x(d.x)}).y0(function(d){return graph.y(d.y0)}).y1(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},seriesStrokeFactory:function(){var graph=this.graph;var factory=d3.svg.line().x(function(d){return graph.x(d.x)}).y(function(d){return graph.y(d.y+d.y0)}).interpolate(graph.interpolation).tension(this.tension);factory.defined&&factory.defined(function(d){return d.y!==null});return factory},render:function(){var graph=this.graph;graph.vis.selectAll("*").remove();var method=this.unstack?"append":"insert";var nodes=graph.vis.selectAll("path").data(this.graph.stackedData).enter()[method]("svg:g","g");nodes.append("svg:path").attr("d",this.seriesPathFactory()).attr("class","area");if(this.stroke){nodes.append("svg:path").attr("d",this.seriesStrokeFactory()).attr("class","line")}var i=0;graph.series.forEach(function(series){if(series.disabled)return;series.path=nodes[0][i++];this._styleSeries(series)},this)},_styleSeries:function(series){if(!series.path)return;d3.select(series.path).select(".area").attr("fill",series.color);if(this.stroke){d3.select(series.path).select(".line").attr("fill","none").attr("stroke",series.stroke||d3.interpolateRgb(series.color,"black")(.125)).attr("stroke-width",this.strokeWidth)}if(series.className){series.path.setAttribute("class",series.className)}}});Rickshaw.namespace("Rickshaw.Graph.Renderer.ScatterPlot");Rickshaw.Graph.Renderer.ScatterPlot=Rickshaw.Class.create(Rickshaw.Graph.Renderer,{name:"scatterplot",defaults:function($super){return Rickshaw.extend($super(),{unstack:true,fill:true,stroke:false,padding:{top:.01,right:.01,bottom:.01,left:.01},dotSize:4})},initialize:function($super,args){$super(args)},render:function(){var graph=this.graph;graph.vis.selectAll("*").remove();graph.series.forEach(function(series){if(series.disabled)return;var nodes=graph.vis.selectAll("path").data(series.stack.filter(function(d){return d.y!==null})).enter().append("svg:circle").attr("cx",function(d){return graph.x(d.x)}).attr("cy",function(d){return graph.y(d.y)}).attr("r",function(d){return"r"in d?d.r:graph.renderer.dotSize});Array.prototype.forEach.call(nodes[0],function(n){n.setAttribute("fill",series.color)})},this)}});Rickshaw.namespace("Rickshaw.Graph.Smoother");Rickshaw.Graph.Smoother=function(args){this.graph=args.graph;this.element=args.element;var self=this;this.aggregationScale=1;if(this.element){$(function(){$(self.element).slider({min:1,max:100,slide:function(event,ui){self.setScale(ui.value);self.graph.update()}})})}self.graph.stackData.hooks.data.push({name:"smoother",orderPosition:50,f:function(data){if(self.aggregationScale==1)return data;var aggregatedData=[];data.forEach(function(seriesData){var aggregatedSeriesData=[];while(seriesData.length){var avgX=0,avgY=0;var slice=seriesData.splice(0,self.aggregationScale);slice.forEach(function(d){avgX+=d.x/slice.length;avgY+=d.y/slice.length});aggregatedSeriesData.push({x:avgX,y:avgY})}aggregatedData.push(aggregatedSeriesData)});return aggregatedData}});this.setScale=function(scale){if(scale<1){throw"scale out of range: "+scale}this.aggregationScale=scale;this.graph.update()}};Rickshaw.namespace("Rickshaw.Graph.Unstacker");Rickshaw.Graph.Unstacker=function(args){this.graph=args.graph;var self=this;this.graph.stackData.hooks.after.push({name:"unstacker",f:function(data){if(!self.graph.renderer.unstack)return data;data.forEach(function(seriesData){seriesData.forEach(function(d){d.y0=0})});return data}})};Rickshaw.namespace("Rickshaw.Series");Rickshaw.Series=Rickshaw.Class.create(Array,{initialize:function(data,palette,options){options=options||{};this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;var timeInterval=typeof options.timeInterval=="undefined"?1e3:options.timeInterval;this.setTimeInterval(timeInterval);if(data&&typeof data=="object"&&data instanceof Array){data.forEach(function(item){this.addItem(item)},this)}},addItem:function(item){if(typeof item.name==="undefined"){throw"addItem() needs a name"}item.color=item.color||this.palette.color(item.name);item.data=item.data||[];if(item.data.length==0&&this.length&&this.getIndex()>0){this[0].data.forEach(function(plot){item.data.push({x:plot.x,y:0})})}else if(item.data.length==0){item.data.push({x:this.timeBase-(this.timeInterval||0),y:0})}this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},addData:function(data){var index=this.getIndex();Rickshaw.keys(data).forEach(function(name){if(!this.itemByName(name)){this.addItem({name:name})}},this);this.forEach(function(item){item.data.push({x:(index*this.timeInterval||1)+this.timeBase,y:data[item.name]||0})},this)},getIndex:function(){return this[0]&&this[0].data&&this[0].data.length?this[0].data.length:0},itemByName:function(name){for(var i=0;i<this.length;i++){if(this[i].name==name)return this[i]}},setTimeInterval:function(iv){this.timeInterval=iv/1e3},setTimeBase:function(t){this.timeBase=t},dump:function(){var data={timeBase:this.timeBase,timeInterval:this.timeInterval,items:[]};this.forEach(function(item){var newItem={color:item.color,name:item.name,data:[]};item.data.forEach(function(plot){newItem.data.push({x:plot.x,y:plot.y})});data.items.push(newItem)});return data},load:function(data){if(data.timeInterval){this.timeInterval=data.timeInterval}if(data.timeBase){this.timeBase=data.timeBase}if(data.items){data.items.forEach(function(item){this.push(item);if(this.legend){this.legend.addLine(this.itemByName(item.name))}},this)}}});Rickshaw.Series.zeroFill=function(series){Rickshaw.Series.fill(series,0)};Rickshaw.Series.fill=function(series,fill){var x;var i=0;var data=series.map(function(s){return s.data});while(i<Math.max.apply(null,data.map(function(d){return d.length}))){x=Math.min.apply(null,data.filter(function(d){return d[i]}).map(function(d){return d[i].x}));data.forEach(function(d){if(!d[i]||d[i].x!=x){d.splice(i,0,{x:x,y:fill})}});i++}};Rickshaw.namespace("Rickshaw.Series.FixedDuration");Rickshaw.Series.FixedDuration=Rickshaw.Class.create(Rickshaw.Series,{initialize:function(data,palette,options){var options=options||{};if(typeof options.timeInterval==="undefined"){throw new Error("FixedDuration series requires timeInterval")}if(typeof options.maxDataPoints==="undefined"){throw new Error("FixedDuration series requires maxDataPoints")}this.palette=new Rickshaw.Color.Palette(palette);this.timeBase=typeof options.timeBase==="undefined"?Math.floor((new Date).getTime()/1e3):options.timeBase;this.setTimeInterval(options.timeInterval);if(this[0]&&this[0].data&&this[0].data.length){this.currentSize=this[0].data.length;this.currentIndex=this[0].data.length}else{this.currentSize=0;this.currentIndex=0}this.maxDataPoints=options.maxDataPoints;if(data&&typeof data=="object"&&data instanceof Array){data.forEach(function(item){this.addItem(item)},this);this.currentSize+=1;this.currentIndex+=1}this.timeBase-=(this.maxDataPoints-this.currentSize)*this.timeInterval;if(typeof this.maxDataPoints!=="undefined"&&this.currentSize<this.maxDataPoints){for(var i=this.maxDataPoints-this.currentSize-1;i>0;i--){this.currentSize+=1;this.currentIndex+=1;this.forEach(function(item){item.data.unshift({x:((i-1)*this.timeInterval||1)+this.timeBase,y:0,i:i})},this)}}},addData:function($super,data){$super(data);this.currentSize+=1;this.currentIndex+=1;if(this.maxDataPoints!==undefined){while(this.currentSize>this.maxDataPoints){this.dropData()}}},dropData:function(){this.forEach(function(item){item.data.splice(0,1)});this.currentSize-=1},getIndex:function(){return this.currentIndex}});
\ No newline at end of file
index f4d3e52df1c6cb40b4848183b2d9315c26bbfee9..f7ff84d87fd2754c250efa48bcc0610601a1f953 100644 (file)
@@ -688,9 +688,12 @@ int html_print_page (const char *title, /* {{{ */
       "  <head>\n"
       "    <title>%s</title>\n"
       "    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../share/"PACKAGE"/style.css\" />\n"
+      "    <link rel=\"stylesheet\" type=\"text/css\" href=\"../../share/"PACKAGE"/rickshaw.min.css\" />\n"
       "    <script type=\"text/javascript\" src=\"../../share/"PACKAGE"/jquery-1.4.4.min.js\">\n"
       "    </script>\n"
-      "    <script type=\"text/javascript\" src=\"../../share/"PACKAGE"/highcharts.js\">\n"
+      "    <script type=\"text/javascript\" src=\"../../share/"PACKAGE"/d3.min.js\">\n"
+      "    </script>\n"
+      "    <script type=\"text/javascript\" src=\"../../share/"PACKAGE"/rickshaw.min.js\">\n"
       "    </script>\n"
       "    <script type=\"text/javascript\" src=\"../../share/"PACKAGE"/collection.js\">\n"
       "    </script>\n"