rails_highcharts 0.0.1.beta1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "http://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in rails_highcharts.gemspec
4
+ gemspec
data/README.md ADDED
@@ -0,0 +1,106 @@
1
+ Highcharts for Rails 3
2
+ =========================================================================
3
+
4
+ __modify from: [highcharts-rails](https://github.com/loudpixel/highcharts-rails "highcharts-rails")__
5
+
6
+ __use: [Highcharts](http://highcharts.com/ "Highcharts")__
7
+
8
+ __[Demo](http://highcharts.com/demo/)__
9
+
10
+ Support Env:
11
+ ------------
12
+ Rails3.0.8+/Ruby1.8.7+
13
+
14
+ ## Usage:
15
+
16
+ gem 'rails_highcharts'
17
+
18
+ rails g rails_highcharts:install
19
+
20
+ in footer layout
21
+
22
+ $(document).ready(function(){
23
+ <%= javascript_include_tag :highcharts %>
24
+ <%= yield :javascript %>
25
+ });
26
+
27
+ in our controller:
28
+
29
+ # Create a pie chart
30
+ browser_data = [
31
+ {:name => 'Safari', :y => 3.57, :identifier => 'applewebkit'},
32
+ {:name => 'Firefox', :y => 22.32, :identifier => 'gecko'},
33
+ {:name => 'Internet Explorer', :y => 56.9, :identifier => 'msie'},
34
+ {:name => 'Other', :y => 17.21}
35
+ ]
36
+
37
+ user_agent = request.env['HTTP_USER_AGENT'].downcase
38
+
39
+ # determine the users browser and pull that piece of the pie chart
40
+ browser_data.each do |browser|
41
+ if user_agent.index(browser[:identifier].to_s)
42
+ browser[:sliced] = true
43
+
44
+ # some browsers will match more than one identifier, stop looking as soon as one is found
45
+ break;
46
+ end
47
+ end
48
+
49
+ # format the labels that show up on the chart
50
+ pie_label_formatter = '
51
+ function() {
52
+ if (this.y > 15) return this.point.name;
53
+ }'
54
+
55
+ # format the tooltips
56
+ pie_tooltip_formatter = '
57
+ function() {
58
+ return "<strong>" + this.point.name + "</strong>: " + this.y + " %";
59
+ }'
60
+
61
+ @pie_chart =
62
+ RailsHighcharts.pie({
63
+ :chart => {
64
+ :renderTo => "pie-chart-container",
65
+ :margin => [50, 30, 0, 30]
66
+ },
67
+ :credits => {
68
+ :enabled => true,
69
+ :href => 'http://marketshare.hitslink.com/browser-market-share.aspx?qprid=3',
70
+ :text => 'Data provided by NETMARKETSHARE'
71
+ },
72
+ :plotOptions => {
73
+ :pie => {
74
+ :dataLabels => {
75
+ :formatter => pie_label_formatter,
76
+ :style => {
77
+ :textShadow => '#000000 1px 1px 2px'
78
+ }
79
+ }
80
+ }
81
+ },
82
+ :series => [
83
+ {
84
+ :type => 'pie',
85
+ :data => browser_data
86
+ }
87
+ ],
88
+ :subtitle => {
89
+ :text => 'January 2010'
90
+ },
91
+ :title => {
92
+ :text => 'Browser Market Share'
93
+ },
94
+ :tooltip => {
95
+ :formatter => pie_tooltip_formatter
96
+ },
97
+ })
98
+
99
+ in your views:
100
+
101
+ <!-- container to hold the pie chart -->
102
+ <div id="pie-chart-container" class="chart-container"></div>
103
+
104
+ <% content_for :javascript do %>
105
+ <%= @pie_chart %>
106
+ <% end %>
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require 'bundler/gem_tasks'
@@ -0,0 +1,21 @@
1
+ require 'rake'
2
+ require 'rails/generators'
3
+
4
+ # ====================================
5
+ # = rails g rails_highcharts:install =
6
+ # ====================================
7
+
8
+ module RailsHighcharts
9
+ module Generators
10
+
11
+ class InstallGenerator < Rails::Generators::Base
12
+
13
+ source_root File.expand_path('../media', __FILE__)
14
+ desc "Copies media files to main project"
15
+ def copy_media_files
16
+ copy_file "../media/javascripts/highcharts.js", "public/javascripts/highcharts/highcharts.js"
17
+ end
18
+ end
19
+
20
+ end
21
+ end
@@ -0,0 +1,169 @@
1
+ /*
2
+ Highcharts JS v2.1.5 (2011-06-22)
3
+
4
+ (c) 2009-2011 Torstein H?nsi
5
+
6
+ License: www.highcharts.com/license
7
+ */
8
+ (function(){function pa(a,b){var c;a||(a={});for(c in b)a[c]=b[c];return a}function la(a,b){return parseInt(a,b||10)}function Qb(a){return typeof a==="string"}function Kb(a){return typeof a==="object"}function ec(a){return typeof a==="number"}function rc(a,b){for(var c=a.length;c--;)if(a[c]===b){a.splice(c,1);break}}function J(a){return a!==Ua&&a!==null}function Ca(a,b,c){var d,e;if(Qb(b))if(J(c))a.setAttribute(b,c);else{if(a&&a.getAttribute)e=a.getAttribute(b)}else if(J(b)&&Kb(b))for(d in b)a.setAttribute(d,
9
+ b[d]);return e}function sc(a){if(!a||a.constructor!==Array)a=[a];return a}function B(){var a=arguments,b,c,d=a.length;for(b=0;b<d;b++){c=a[b];if(typeof c!=="undefined"&&c!==null)return c}}function Zd(a){var b="",c;for(c in a)b+=c+":"+a[c]+";";return b}function La(a,b){if(Cc)if(b&&b.opacity!==Ua)b.filter="alpha(opacity="+b.opacity*100+")";pa(a.style,b)}function ib(a,b,c,d,e){a=wa.createElement(a);b&&pa(a,b);e&&La(a,{padding:0,border:jb,margin:0});c&&La(a,c);d&&d.appendChild(a);return a}function yb(a,
10
+ b){var c=function(){};c.prototype=new a;pa(c.prototype,b);return c}function Bd(a,b,c,d){var e=Va.lang;a=a;var f=isNaN(b=db(b))?2:b;b=c===undefined?e.decimalPoint:c;d=d===undefined?e.thousandsSep:d;e=a<0?"-":"";c=String(la(a=db(+a||0).toFixed(f)));var g=c.length>3?c.length%3:0;return e+(g?c.substr(0,g)+d:"")+c.substr(g).replace(/(\d{3})(?=\d)/g,"$1"+d)+(f?b+db(a-c).toFixed(f).slice(2):"")}function fc(a,b){Dc=B(a,b.animation)}function Cd(){var a=Va.global.useUTC;Ec=a?Date.UTC:function(b,c,d,e,f,g){return(new Date(b,
11
+ c,B(d,1),B(e,0),B(f,0),B(g,0))).getTime()};dd=a?"getUTCMinutes":"getMinutes";ed=a?"getUTCHours":"getHours";fd=a?"getUTCDay":"getDay";tc=a?"getUTCDate":"getDate";Fc=a?"getUTCMonth":"getMonth";Gc=a?"getUTCFullYear":"getFullYear";Dd=a?"setUTCMinutes":"setMinutes";Ed=a?"setUTCHours":"setHours";gd=a?"setUTCDate":"setDate";Fd=a?"setUTCMonth":"setMonth";Gd=a?"setUTCFullYear":"setFullYear"}function Hc(a){Ic||(Ic=ib(Rb));a&&Ic.appendChild(a);Ic.innerHTML=""}function Jc(){}function Hd(a,b){function c(m,i){function y(k,
12
+ o){this.pos=k;this.minor=o;this.isNew=true;o||this.addLabel()}function x(k){if(k){this.options=k;this.id=k.id}return this}function R(k,o,r){this.isNegative=o;this.options=k;this.x=r;this.alignOptions={align:k.align||(qa?o?"left":"right":"center"),verticalAlign:k.verticalAlign||(qa?"middle":o?"bottom":"top"),y:B(k.y,qa?4:o?14:-6),x:B(k.x,qa?o?-6:6:0)};this.textAlign=k.textAlign||(qa?o?"right":"left":"center")}function na(){var k=[],o=[],r;T=ra=null;Da=[];t(Ga,function(q){r=false;t(["xAxis","yAxis"],
13
+ function(ma){if(q.isCartesian&&(ma==="xAxis"&&Ea||ma==="yAxis"&&!Ea)&&(q.options[ma]===i.index||q.options[ma]===Ua&&i.index===0)){q[ma]=w;Da.push(q);r=true}});if(!q.visible&&u.ignoreHiddenSeries)r=false;if(r){var A,U,F,V,Aa;if(!Ea){A=q.options.stacking;Kc=A==="percent";if(A){V=q.type+B(q.options.stack,"");Aa="-"+V;q.stackKey=V;U=k[V]||[];k[V]=U;F=o[Aa]||[];o[Aa]=F}if(Kc){T=0;ra=99}}if(q.isCartesian){t(q.data,function(ma){var s=ma.x,W=ma.y,$=W<0,ga=$?F:U,zb=$?Aa:V;if(T===null)T=ra=ma[ha];if(Ea)if(s>
14
+ ra)ra=s;else{if(s<T)T=s}else if(J(W)){if(A)ga[s]=J(ga[s])?ga[s]+W:W;W=ga?ga[s]:W;ma=B(ma.low,W);if(!Kc)if(W>ra)ra=W;else if(ma<T)T=ma;if(A){v[zb]||(v[zb]={});v[zb][s]||(v[zb][s]=new R(i.stackLabels,$,s));v[zb][s].setTotal(W)}}});if(/(area|column|bar)/.test(q.type)&&!Ea)if(T>=0){T=0;Id=true}else if(ra<0){ra=0;Jd=true}}}})}function N(k,o){var r,q;Cb=o?1:ta.pow(10,kb(ta.log(k)/ta.LN10));r=k/Cb;if(!o){o=[1,2,2.5,5,10];if(i.allowDecimals===false||D)if(Cb===1)o=[1,2,5,10];else if(Cb<=0.1)o=[1/Cb]}for(q=
15
+ 0;q<o.length;q++){k=o[q];if(r<=(o[q]+(o[q+1]||o[q]))/2)break}k*=Cb;return k}function ba(k){var o;o=k;Cb=B(Cb,ta.pow(10,kb(ta.log(Qa)/ta.LN10)));if(Cb<1){o=X(1/Cb)*10;o=X(k*o)/o}return o}function Ka(){var k,o,r,q,A=i.tickInterval,U=i.tickPixelInterval;k=i.maxZoom||(Ea&&!J(i.min)&&!J(i.max)?qb(m.smallestInterval*5,ra-T):null);oa=z?Ba:xa;if(Sb){r=m[Ea?"xAxis":"yAxis"][i.linkedTo];q=r.getExtremes();aa=B(q.min,q.dataMin);ca=B(q.max,q.dataMax)}else{aa=B(Ha,i.min,T);ca=B(Ma,i.max,ra)}if(D){aa=ta.log(aa)/
16
+ ta.LN10;ca=ta.log(ca)/ta.LN10}if(ca-aa<k){q=(k-ca+aa)/2;aa=Fa(aa-q,B(i.min,aa-q),T);ca=qb(aa+k,B(i.max,aa+k),ra)}if(!Wa&&!Kc&&!Sb&&J(aa)&&J(ca)){k=ca-aa||1;if(!J(i.min)&&!J(Ha)&&Kd&&(T<0||!Id))aa-=k*Kd;if(!J(i.max)&&!J(Ma)&&Ld&&(ra>0||!Jd))ca+=k*Ld}Qa=aa===ca?1:Sb&&!A&&U===r.options.tickPixelInterval?r.tickInterval:B(A,Wa?1:(ca-aa)*U/oa);if(!E&&!J(i.tickInterval))Qa=N(Qa);w.tickInterval=Qa;Lc=i.minorTickInterval==="auto"&&Qa?Qa/5:i.minorTickInterval;if(E){ua=[];A=Va.global.useUTC;var F=1E3/rb,V=6E4/
17
+ rb,Aa=36E5/rb;U=864E5/rb;k=6048E5/rb;q=2592E6/rb;var ma=31556952E3/rb,s=[["second",F,[1,2,5,10,15,30]],["minute",V,[1,2,5,10,15,30]],["hour",Aa,[1,2,3,4,6,8,12]],["day",U,[1,2]],["week",k,[1,2]],["month",q,[1,2,3,4,6]],["year",ma,null]],W=s[6],$=W[1],ga=W[2];for(r=0;r<s.length;r++){W=s[r];$=W[1];ga=W[2];if(s[r+1])if(Qa<=($*ga[ga.length-1]+s[r+1][1])/2)break}if($===ma&&Qa<5*$)ga=[1,2,5];s=N(Qa/$,ga);ga=new Date(aa*rb);ga.setMilliseconds(0);if($>=F)ga.setSeconds($>=V?0:s*kb(ga.getSeconds()/s));if($>=
18
+ V)ga[Dd]($>=Aa?0:s*kb(ga[dd]()/s));if($>=Aa)ga[Ed]($>=U?0:s*kb(ga[ed]()/s));if($>=U)ga[gd]($>=q?1:s*kb(ga[tc]()/s));if($>=q){ga[Fd]($>=ma?0:s*kb(ga[Fc]()/s));o=ga[Gc]()}if($>=ma){o-=o%s;ga[Gd](o)}$===k&&ga[gd](ga[tc]()-ga[fd]()+i.startOfWeek);r=1;o=ga[Gc]();F=ga.getTime()/rb;V=ga[Fc]();for(Aa=ga[tc]();F<ca&&r<Ba;){ua.push(F);if($===ma)F=Ec(o+r*s,0)/rb;else if($===q)F=Ec(o,V+r*s)/rb;else if(!A&&($===U||$===k))F=Ec(o,V,Aa+r*s*($===U?1:7));else F+=$*s;r++}ua.push(F);Mc=i.dateTimeLabelFormats[W[0]]}else{r=
19
+ ba(kb(aa/Qa)*Qa);o=ba(hd(ca/Qa)*Qa);ua=[];for(r=ba(r);r<=o;){ua.push(r);r=ba(r+Qa)}}if(!Sb){if(Wa||Ea&&m.hasColumn){o=(Wa?1:Qa)*0.5;if(Wa||!J(B(i.min,Ha)))aa-=o;if(Wa||!J(B(i.max,Ma)))ca+=o}o=ua[0];r=ua[ua.length-1];if(i.startOnTick)aa=o;else aa>o&&ua.shift();if(i.endOnTick)ca=r;else ca<r&&ua.pop();Lb||(Lb={x:0,y:0});if(!E&&ua.length>Lb[ha])Lb[ha]=ua.length}}function za(){var k,o;Db=aa;Md=ca;na();Ka();fb=va;va=oa/(ca-aa||1);if(!Ea)for(k in v)for(o in v[k])v[k][o].cum=v[k][o].total;if(!w.isDirty)w.isDirty=
20
+ aa!==Db||ca!==Md}function Na(k){k=(new x(k)).render();Tb.push(k);return k}function Oa(){var k=i.title,o=i.stackLabels,r=i.alternateGridColor,q=i.lineWidth,A,U,F=m.hasRendered,V=F&&J(Db)&&!isNaN(Db);A=Da.length&&J(aa)&&J(ca);oa=z?Ba:xa;va=oa/(ca-aa||1);eb=z?Z:sb;if(A||Sb){if(Lc&&!Wa)for(A=aa+(ua[0]-aa)%Lc;A<=ca;A+=Lc){ac[A]||(ac[A]=new y(A,true));V&&ac[A].isNew&&ac[A].render(null,true);ac[A].isActive=true;ac[A].render()}t(ua,function(s,W){if(!Sb||s>=aa&&s<=ca){V&&tb[s].isNew&&tb[s].render(W,true);
21
+ tb[s].isActive=true;tb[s].render(W)}});r&&t(ua,function(s,W){if(W%2===0&&s<ca){gc[s]||(gc[s]=new x);gc[s].options={from:s,to:ua[W+1]!==Ua?ua[W+1]:ca,color:r};gc[s].render();gc[s].isActive=true}});F||t((i.plotLines||[]).concat(i.plotBands||[]),function(s){Tb.push((new x(s)).render())})}t([tb,ac,gc],function(s){for(var W in s)if(s[W].isActive)s[W].isActive=false;else{s[W].destroy();delete s[W]}});if(q){A=Z+(Ia?Ba:0)+M;U=Ra-sb-(Ia?xa:0)+M;A=da.crispLine([Za,z?Z:A,z?U:ea,Ja,z?Xa-Eb:A,z?U:Ra-sb],q);if(ja)ja.animate({d:A});
22
+ else ja=da.path(A).attr({stroke:i.lineColor,"stroke-width":q,zIndex:7}).add()}if(w.axisTitle){A=z?Z:ea;q=la(k.style.fontSize||12);A={low:A+(z?0:oa),middle:A+oa/2,high:A+(z?oa:0)}[k.align];q=(z?ea+xa:Z)+(z?1:-1)*(Ia?-1:1)*id+(Y===2?q:0);w.axisTitle[F?"animate":"attr"]({x:z?A:q+(Ia?Ba:0)+M+(k.x||0),y:z?q-(Ia?xa:0)+M:A+(k.y||0)})}if(o&&o.enabled){var Aa,ma;o=w.stackTotalGroup;if(!o)w.stackTotalGroup=o=da.g("stack-labels").attr({visibility:ub,zIndex:6}).translate(Z,ea).add();for(Aa in v){k=v[Aa];for(ma in k)k[ma].render(o)}}w.isDirty=
23
+ false}function Ya(k){for(var o=Tb.length;o--;)Tb[o].id===k&&Tb[o].destroy()}var Ea=i.isX,Ia=i.opposite,z=qa?!Ea:Ea,Y=z?Ia?0:2:Ia?1:3,v={};i=sa(Ea?Nc:jd,[$d,ae,Nd,be][Y],i);var w=this,L=i.type,E=L==="datetime",D=L==="logarithmic",M=i.offset||0,ha=Ea?"x":"y",oa,va,fb,eb=z?Z:sb,Fb,Ub,hc,I,ja,T,ra,Da,Ha,Ma,ca=null,aa=null,Db,Md,Kd=i.minPadding,Ld=i.maxPadding,Sb=J(i.linkedTo),Id,Jd,Kc;L=i.events;var kd,Tb=[],Qa,Lc,Cb,ua,tb={},ac={},gc={},ic,jc,id,Mc,Wa=i.categories,ce=i.labels.formatter||function(){var k=
24
+ this.value;return Mc?Oc(Mc,k):Qa%1E6===0?k/1E6+"M":Qa%1E3===0?k/1E3+"k":!Wa&&k>=1E3?Bd(k,0):k},Pc=z&&i.labels.staggerLines,bc=i.reversed,cc=Wa&&i.tickmarkPlacement==="between"?0.5:0;y.prototype={addLabel:function(){var k=this.pos,o=i.labels,r=!(k===aa&&!B(i.showFirstLabel,1)||k===ca&&!B(i.showLastLabel,0)),q=Wa&&z&&Wa.length&&!o.step&&!o.staggerLines&&!o.rotation&&Ba/Wa.length||!z&&Ba/2,A=this.label;k=ce.call({isFirst:k===ua[0],isLast:k===ua[ua.length-1],dateTimeLabelFormat:Mc,value:Wa&&Wa[k]?Wa[k]:
25
+ k});q=q&&{width:Fa(1,X(q-2*(o.padding||10)))+$a};q=pa(q,o.style);if(A===Ua)this.label=J(k)&&r&&o.enabled?da.text(k,0,0).attr({align:o.align,rotation:o.rotation}).css(q).add(hc):null;else A&&A.attr({text:k}).css(q)},getLabelSize:function(){var k=this.label;return k?(this.labelBBox=k.getBBox())[z?"height":"width"]:0},render:function(k,o){var r=!this.minor,q=this.label,A=this.pos,U=i.labels,F=this.gridLine,V=r?i.gridLineWidth:i.minorGridLineWidth,Aa=r?i.gridLineColor:i.minorGridLineColor,ma=r?i.gridLineDashStyle:
26
+ i.minorGridLineDashStyle,s=this.mark,W=r?i.tickLength:i.minorTickLength,$=r?i.tickWidth:i.minorTickWidth||0,ga=r?i.tickColor:i.minorTickColor,zb=r?i.tickPosition:i.minorTickPosition;r=U.step;var lb=o&&Qc||Ra,Mb;Mb=z?Fb(A+cc,null,null,o)+eb:Z+M+(Ia?(o&&ld||Xa)-Eb-Z:0);lb=z?lb-sb+M-(Ia?xa:0):lb-Fb(A+cc,null,null,o)-eb;if(V){A=Ub(A+cc,V,o);if(F===Ua){F={stroke:Aa,"stroke-width":V};if(ma)F.dashstyle=ma;this.gridLine=F=V?da.path(A).attr(F).add(I):null}F&&A&&F.animate({d:A})}if($){if(zb==="inside")W=-W;
27
+ if(Ia)W=-W;V=da.crispLine([Za,Mb,lb,Ja,Mb+(z?0:-W),lb+(z?W:0)],$);if(s)s.animate({d:V});else this.mark=da.path(V).attr({stroke:ga,"stroke-width":$}).add(hc)}if(q&&!isNaN(Mb)){Mb=Mb+U.x-(cc&&z?cc*va*(bc?-1:1):0);lb=lb+U.y-(cc&&!z?cc*va*(bc?1:-1):0);J(U.y)||(lb+=la(q.styles.lineHeight)*0.9-q.getBBox().height/2);if(Pc)lb+=k/(r||1)%Pc*16;if(r)q[k%r?"hide":"show"]();q[this.isNew?"attr":"animate"]({x:Mb,y:lb})}this.isNew=false},destroy:function(){for(var k in this)this[k]&&this[k].destroy&&this[k].destroy()}};
28
+ x.prototype={render:function(){var k=this,o=k.options,r=o.label,q=k.label,A=o.width,U=o.to,F,V=o.from,Aa=o.dashStyle,ma=k.svgElem,s=[],W,$,ga=o.color;$=o.zIndex;var zb=o.events;if(A){s=Ub(o.value,A);o={stroke:ga,"stroke-width":A};if(Aa)o.dashstyle=Aa}else if(J(V)&&J(U)){V=Fa(V,aa);U=qb(U,ca);F=Ub(U);if((s=Ub(V))&&F)s.push(F[4],F[5],F[1],F[2]);else s=null;o={fill:ga}}else return;if(J($))o.zIndex=$;if(ma)if(s)ma.animate({d:s},null,ma.onGetPath);else{ma.hide();ma.onGetPath=function(){ma.show()}}else if(s&&
29
+ s.length){k.svgElem=ma=da.path(s).attr(o).add();if(zb){Aa=function(lb){ma.on(lb,function(Mb){zb[lb].apply(k,[Mb])})};for(W in zb)Aa(W)}}if(r&&J(r.text)&&s&&s.length&&Ba>0&&xa>0){r=sa({align:z&&F&&"center",x:z?!F&&4:10,verticalAlign:!z&&F&&"middle",y:z?F?16:10:F?6:-4,rotation:z&&!F&&90},r);if(!q)k.label=q=da.text(r.text,0,0).attr({align:r.textAlign||r.align,rotation:r.rotation,zIndex:$}).css(r.style).add();F=[s[1],s[4],B(s[6],s[1])];s=[s[2],s[5],B(s[7],s[2])];W=qb.apply(ta,F);$=qb.apply(ta,s);q.align(r,
30
+ false,{x:W,y:$,width:Fa.apply(ta,F)-W,height:Fa.apply(ta,s)-$});q.show()}else q&&q.hide();return k},destroy:function(){for(var k in this){this[k]&&this[k].destroy&&this[k].destroy();delete this[k]}rc(Tb,this)}};R.prototype={setTotal:function(k){this.cum=this.total=k},render:function(k){var o=this.options.formatter.call(this);if(this.label)this.label.attr({text:o,visibility:gb});else this.label=m.renderer.text(o,0,0).css(this.options.style).attr({align:this.textAlign,rotation:this.options.rotation,
31
+ visibility:gb}).add(k)},setOffset:function(k,o){var r=this.isNegative,q=w.translate(this.total),A=w.translate(0);A=db(q-A);var U=m.xAxis[0].translate(this.x)+k,F=m.plotHeight;r={x:qa?r?q:q-A:U,y:qa?F-U-o:r?F-q-A:F-q,width:qa?A:o,height:qa?o:A};this.label&&this.label.align(this.alignOptions,null,r).attr({visibility:ub})}};Fb=function(k,o,r,q,A){var U=1,F=0,V=q?fb:va;q=q?Db:aa;V||(V=va);if(r){U*=-1;F=oa}if(bc){U*=-1;F-=U*oa}if(o){if(bc)k=oa-k;k=k/V+q;if(D&&A)k=ta.pow(10,k)}else{if(D&&A)k=ta.log(k)/
32
+ ta.LN10;k=U*(k-q)*V+F}return k};Ub=function(k,o,r){var q,A,U;k=Fb(k,null,null,r);var F=r&&Qc||Ra,V=r&&ld||Xa,Aa;r=A=X(k+eb);q=U=X(F-k-eb);if(isNaN(k))Aa=true;else if(z){q=ea;U=F-sb;if(r<Z||r>Z+Ba)Aa=true}else{r=Z;A=V-Eb;if(q<ea||q>ea+xa)Aa=true}return Aa?null:da.crispLine([Za,r,q,Ja,A,U],o||0)};if(qa&&Ea&&bc===Ua)bc=true;pa(w,{addPlotBand:Na,addPlotLine:Na,adjustTickAmount:function(){if(Lb&&!E&&!Wa&&!Sb){var k=ic,o=ua.length;ic=Lb[ha];if(o<ic){for(;ua.length<ic;)ua.push(ba(ua[ua.length-1]+Qa));va*=
33
+ (o-1)/(ic-1);ca=ua[ua.length-1]}if(J(k)&&ic!==k)w.isDirty=true}},categories:Wa,getExtremes:function(){return{min:aa,max:ca,dataMin:T,dataMax:ra,userMin:Ha,userMax:Ma}},getPlotLinePath:Ub,getThreshold:function(k){if(aa>k)k=aa;else if(ca<k)k=ca;return Fb(k,0,1)},isXAxis:Ea,options:i,plotLinesAndBands:Tb,getOffset:function(){var k=Da.length&&J(aa)&&J(ca),o=0,r=0,q=i.title,A=i.labels,U=[-1,1,1,-1][Y],F;if(!hc){hc=da.g("axis").attr({zIndex:7}).add();I=da.g("grid").attr({zIndex:1}).add()}jc=0;if(k||Sb){t(ua,
34
+ function(V){if(tb[V])tb[V].addLabel();else tb[V]=new y(V);if(Y===0||Y===2||{1:"left",3:"right"}[Y]===A.align)jc=Fa(tb[V].getLabelSize(),jc)});if(Pc)jc+=(Pc-1)*16}else for(F in tb){tb[F].destroy();delete tb[F]}if(q&&q.text){if(!w.axisTitle)w.axisTitle=da.text(q.text,0,0).attr({zIndex:7,rotation:q.rotation||0,align:q.textAlign||{low:"left",middle:"center",high:"right"}[q.align]}).css(q.style).add();o=w.axisTitle.getBBox()[z?"height":"width"];r=B(q.margin,z?5:10)}M=U*(i.offset||Vb[Y]);id=jc+(Y!==2&&
35
+ jc&&U*i.labels[z?"y":"x"])+r;Vb[Y]=Fa(Vb[Y],id+o+U*M)},render:Oa,setCategories:function(k,o){w.categories=Wa=k;t(Da,function(r){r.translate();r.setTooltipPoints(true)});w.isDirty=true;B(o,true)&&m.redraw()},setExtremes:function(k,o,r,q){r=B(r,true);Pa(w,"setExtremes",{min:k,max:o},function(){Ha=k;Ma=o;r&&m.redraw(q)})},setScale:za,setTickPositions:Ka,translate:Fb,redraw:function(){kc.resetTracker&&kc.resetTracker();Oa();t(Tb,function(k){k.render()});t(Da,function(k){k.isDirty=true})},removePlotBand:Ya,
36
+ removePlotLine:Ya,reversed:bc,stacks:v});for(kd in L)Sa(w,kd,L[kd]);za()}function d(){var m={};return{add:function(i,y,x,R){if(!m[i]){y=da.text(y,0,0).css(a.toolbar.itemStyle).align({align:"right",x:-Eb-20,y:ea+30}).on("click",R).attr({align:"right",zIndex:20}).add();m[i]=y}},remove:function(i){Hc(m[i].element);m[i]=null}}}function e(m){function i(){var E=this.points||sc(this),D=E[0].series.xAxis,M=this.x;D=D&&D.options.type==="datetime";var ha=Qb(M)||D,oa;oa=ha?['<span style="font-size: 10px">'+
37
+ (D?Oc("%A, %b %e, %Y",M):M)+"</span>"]:[];t(E,function(va){oa.push(va.point.tooltipFormatter(ha))});return oa.join("<br/>")}function y(E,D){z=Ya?E:(2*z+E)/3;Y=Ya?D:(Y+D)/2;v.translate(z,Y);md=db(E-z)>1||db(D-Y)>1?function(){y(E,D)}:null}function x(){if(!Ya){var E=p.hoverPoints;v.hide();t(ba,function(D){D&&D.hide()});E&&t(E,function(D){D.setState()});p.hoverPoints=null;Ya=true}}var R,na=m.borderWidth,N=m.crosshairs,ba=[],Ka=m.style,za=m.shared,Na=la(Ka.padding),Oa=na+Na,Ya=true,Ea,Ia,z=0,Y=0;Ka.padding=
38
+ 0;var v=da.g("tooltip").attr({zIndex:8}).add(),w=da.rect(Oa,Oa,0,0,m.borderRadius,na).attr({fill:m.backgroundColor,"stroke-width":na}).add(v).shadow(m.shadow),L=da.text("",Na+Oa,la(Ka.fontSize)+Na+Oa).attr({zIndex:1}).css(Ka).add(v);v.hide();return{shared:za,refresh:function(E){var D,M,ha,oa=0,va={},fb=[];ha=E.tooltipPos;D=m.formatter||i;va=p.hoverPoints;if(za){va&&t(va,function(eb){eb.setState()});p.hoverPoints=E;t(E,function(eb){eb.setState(Ab);oa+=eb.plotY;fb.push(eb.getLabelConfig())});M=E[0].plotX;
39
+ oa=X(oa)/E.length;va={x:E[0].category};va.points=fb;E=E[0]}else va=E.getLabelConfig();va=D.call(va);R=E.series;M=za?M:E.plotX;oa=za?oa:E.plotY;D=X(ha?ha[0]:qa?Ba-oa:M);M=X(ha?ha[1]:qa?xa-M:oa);ha=za||!E.series.isCartesian||lc(D,M);if(va===false||!ha)x();else{if(Ya){v.show();Ya=false}L.attr({text:va});ha=L.getBBox();Ea=ha.width+2*Na;Ia=ha.height+2*Na;w.attr({width:Ea,height:Ia,stroke:m.borderColor||E.color||R.color||"#606060"});D=D-Ea+Z-25;M=M-Ia+ea+10;if(D<7){D=7;M-=30}if(M<5)M=5;else if(M+Ia>Ra)M=
40
+ Ra-Ia-5;y(X(D-Oa),X(M-Oa))}if(N){N=sc(N);for(D=N.length;D--;){M=E.series[D?"yAxis":"xAxis"];if(N[D]&&M){M=M.getPlotLinePath(E[D?"y":"x"],1);if(ba[D])ba[D].attr({d:M,visibility:ub});else{ha={"stroke-width":N[D].width||1,stroke:N[D].color||"#C0C0C0",zIndex:2};if(N[D].dashStyle)ha.dashstyle=N[D].dashStyle;ba[D]=da.path(M).attr(ha).add()}}}}},hide:x}}function f(m,i){function y(z){var Y,v=Od&&wa.width/wa.documentElement.clientWidth-1,w,L,E;z=z||ab.event;if(!z.target)z.target=z.srcElement;Y=z.touches?z.touches.item(0):
41
+ z;if(z.type!=="mousemove"||ab.opera||v){w=ya;L={left:w.offsetLeft,top:w.offsetTop};for(w=w.offsetParent;w;){L.left+=w.offsetLeft;L.top+=w.offsetTop;if(w!==wa.body&&w!==wa.documentElement){L.left-=w.scrollLeft;L.top-=w.scrollTop}w=w.offsetParent}uc=L;w=uc.left;L=uc.top}if(Cc){E=z.x;Y=z.y}else if(Y.layerX===Ua){E=Y.pageX-w;Y=Y.pageY-L}else{E=z.layerX;Y=z.layerY}if(v){E+=X((v+1)*w-w);Y+=X((v+1)*L-L)}return pa(z,{chartX:E,chartY:Y})}function x(z){var Y={xAxis:[],yAxis:[]};t(bb,function(v){var w=v.translate,
42
+ L=v.isXAxis;Y[L?"xAxis":"yAxis"].push({axis:v,value:w((qa?!L:L)?z.chartX-Z:xa-z.chartY+ea,true)})});return Y}function R(){var z=m.hoverSeries,Y=m.hoverPoint;Y&&Y.onMouseOut();z&&z.onMouseOut();vc&&vc.hide();nd=null}function na(){if(za){var z={xAxis:[],yAxis:[]},Y=za.getBBox(),v=Y.x-Z,w=Y.y-ea;if(Ka){t(bb,function(L){var E=L.translate,D=L.isXAxis,M=qa?!D:D,ha=E(M?v:xa-w-Y.height,true,0,0,1);E=E(M?v+Y.width:xa-w,true,0,0,1);z[D?"xAxis":"yAxis"].push({axis:L,min:qb(ha,E),max:Fa(ha,E)})});Pa(m,"selection",
43
+ z,od)}za=za.destroy()}m.mouseIsDown=pd=Ka=false;Gb(wa,Nb?"touchend":"mouseup",na)}var N,ba,Ka,za,Na=u.zoomType,Oa=/x/.test(Na),Ya=/y/.test(Na),Ea=Oa&&!qa||Ya&&qa,Ia=Ya&&!qa||Oa&&qa;Rc=function(){if(Sc){Sc.translate(Z,ea);qa&&Sc.attr({width:m.plotWidth,height:m.plotHeight}).invert()}else m.trackerGroup=Sc=da.g("tracker").attr({zIndex:9}).add()};Rc();if(i.enabled)m.tooltip=vc=e(i);(function(){var z=true;ya.onmousedown=function(v){v=y(v);m.mouseIsDown=pd=true;N=v.chartX;ba=v.chartY;Sa(wa,Nb?"touchend":
44
+ "mouseup",na)};var Y=function(v){if(!(v&&v.touches&&v.touches.length>1)){v=y(v);if(!Nb)v.returnValue=false;var w=v.chartX,L=v.chartY,E=!lc(w-Z,L-ea);if(Nb&&v.type==="touchstart")if(Ca(v.target,"isTracker"))m.runTrackerClick||v.preventDefault();else!de&&!E&&v.preventDefault();if(E){z||R();if(w<Z)w=Z;else if(w>Z+Ba)w=Z+Ba;if(L<ea)L=ea;else if(L>ea+xa)L=ea+xa}if(pd&&v.type!=="touchstart"){Ka=Math.sqrt(Math.pow(N-w,2)+Math.pow(ba-L,2));if(Ka>10){if(mc&&(Oa||Ya)&&lc(N-Z,ba-ea))za||(za=da.rect(Z,ea,Ea?
45
+ 1:Ba,Ia?1:xa,0).attr({fill:"rgba(69,114,167,0.25)",zIndex:7}).add());if(za&&Ea){w=w-N;za.attr({width:db(w),x:(w>0?0:w)+N})}if(za&&Ia){L=L-ba;za.attr({height:db(L),y:(L>0?0:L)+ba})}}}else if(!E){var D;L=m.hoverPoint;w=m.hoverSeries;var M,ha,oa=Xa,va=qa?v.chartY:v.chartX-Z;if(vc&&i.shared){D=[];M=Ga.length;for(ha=0;ha<M;ha++)if(Ga[ha].visible&&Ga[ha].tooltipPoints.length){v=Ga[ha].tooltipPoints[va];v._dist=db(va-v.plotX);oa=qb(oa,v._dist);D.push(v)}for(M=D.length;M--;)D[M]._dist>oa&&D.splice(M,1);if(D.length&&
46
+ D[0].plotX!==nd){vc.refresh(D);nd=D[0].plotX}}if(w&&w.tracker)(v=w.tooltipPoints[va])&&v!==L&&v.onMouseOver()}return(z=E)||!mc}};ya.onmousemove=Y;Sa(ya,"mouseleave",R);ya.ontouchstart=function(v){if(Oa||Ya)ya.onmousedown(v);Y(v)};ya.ontouchmove=Y;ya.ontouchend=function(){Ka&&R()};ya.onclick=function(v){var w=m.hoverPoint;v=y(v);v.cancelBubble=true;if(!Ka)if(w&&Ca(v.target,"isTracker")){var L=w.plotX,E=w.plotY;pa(w,{pageX:uc.left+Z+(qa?Ba-E:L),pageY:uc.top+ea+(qa?xa-L:E)});Pa(w.series,"click",pa(v,
47
+ {point:w}));w.firePointEvent("click",v)}else{pa(v,x(v));lc(v.chartX-Z,v.chartY-ea)&&Pa(m,"click",v)}Ka=false}})();Pd=setInterval(function(){md&&md()},32);pa(this,{zoomX:Oa,zoomY:Ya,resetTracker:R})}function g(m){var i=m.type||u.type||u.defaultSeriesType,y=vb[i],x=p.hasRendered;if(x)if(qa&&i==="column")y=vb.bar;else if(!qa&&i==="bar")y=vb.column;i=new y;i.init(p,m);if(!x&&i.inverted)qa=true;if(i.isCartesian)mc=i.isCartesian;Ga.push(i);return i}function h(){u.alignTicks!==false&&t(bb,function(m){m.adjustTickAmount()});
48
+ Lb=null}function j(m){var i=p.isDirtyLegend,y,x=p.isDirtyBox,R=Ga.length,na=R,N=p.clipRect;for(fc(m,p);na--;){m=Ga[na];if(m.isDirty&&m.options.stacking){y=true;break}}if(y)for(na=R;na--;){m=Ga[na];if(m.options.stacking)m.isDirty=true}t(Ga,function(ba){if(ba.isDirty){ba.cleanData();ba.getSegments();if(ba.options.legendType==="point")i=true}});if(i&&qd.renderLegend){qd.renderLegend();p.isDirtyLegend=false}if(mc){if(!Tc){Lb=null;t(bb,function(ba){ba.setScale()})}h();wc();t(bb,function(ba){if(ba.isDirty||
49
+ x){ba.redraw();x=true}})}if(x){rd();Rc();if(N){Uc(N);N.animate({width:p.plotSizeX,height:p.plotSizeY})}}t(Ga,function(ba){if(ba.isDirty&&ba.visible&&(!ba.isCartesian||ba.xAxis))ba.redraw()});kc&&kc.resetTracker&&kc.resetTracker();Pa(p,"redraw")}function l(){var m=a.xAxis||{},i=a.yAxis||{},y;m=sc(m);t(m,function(x,R){x.index=R;x.isX=true});i=sc(i);t(i,function(x,R){x.index=R});bb=m.concat(i);p.xAxis=[];p.yAxis=[];bb=nc(bb,function(x){y=new c(p,x);p[y.isXAxis?"xAxis":"yAxis"].push(y);return y});h()}
50
+ function n(m,i){Hb=sa(a.title,m);xc=sa(a.subtitle,i);t([["title",m,Hb],["subtitle",i,xc]],function(y){var x=y[0],R=p[x],na=y[1];y=y[2];if(R&&na){R.destroy();R=null}if(y&&y.text&&!R)p[x]=da.text(y.text,0,0).attr({align:y.align,"class":"highcharts-"+x,zIndex:1}).css(y.style).add().align(y,false,Ob)})}function C(){mb=u.renderTo;Qd=oc+sd++;if(Qb(mb))mb=wa.getElementById(mb);mb.innerHTML="";if(!mb.offsetWidth){Wb=mb.cloneNode(0);La(Wb,{position:pc,top:"-9999px",display:""});wa.body.appendChild(Wb)}Vc=
51
+ (Wb||mb).offsetWidth;yc=(Wb||mb).offsetHeight;p.chartWidth=Xa=u.width||Vc||600;p.chartHeight=Ra=u.height||(yc>19?yc:400);p.container=ya=ib(Rb,{className:"highcharts-container"+(u.className?" "+u.className:""),id:Qd},pa({position:Rd,overflow:gb,width:Xa+$a,height:Ra+$a,textAlign:"left"},u.style),Wb||mb);p.renderer=da=u.forExport?new Wc(ya,Xa,Ra,true):new Xc(ya,Xa,Ra);var m,i;if(Sd&&ya.getBoundingClientRect){m=function(){La(ya,{left:0,top:0});i=ya.getBoundingClientRect();La(ya,{left:-(i.left-la(i.left))+
52
+ $a,top:-(i.top-la(i.top))+$a})};m();Sa(ab,"resize",m);Sa(p,"destroy",function(){Gb(ab,"resize",m)})}}function G(){function m(){var y=u.width||mb.offsetWidth,x=u.height||mb.offsetHeight;if(y&&x){if(y!==Vc||x!==yc){clearTimeout(i);i=setTimeout(function(){td(y,x,false)},100)}Vc=y;yc=x}}var i;Sa(ab,"resize",m);Sa(p,"destroy",function(){Gb(ab,"resize",m)})}function fa(){var m=a.labels,i=a.credits,y;n();qd=p.legend=new ee(p);wc();t(bb,function(x){x.setTickPositions(true)});h();wc();rd();mc&&t(bb,function(x){x.render()});
53
+ if(!p.seriesGroup)p.seriesGroup=da.g("series-group").attr({zIndex:3}).add();t(Ga,function(x){x.translate();x.setTooltipPoints();x.render()});m.items&&t(m.items,function(){var x=pa(m.style,this.style),R=la(x.left)+Z,na=la(x.top)+ea+12;delete x.left;delete x.top;da.text(this.html,R,na).attr({zIndex:2}).css(x).add()});if(!p.toolbar)p.toolbar=d(p);if(i.enabled&&!p.credits){y=i.href;da.text(i.text,0,0).on("click",function(){if(y)location.href=y}).attr({align:i.position.align,zIndex:8}).css(i.style).add().align(i.position)}Rc();
54
+ p.hasRendered=true;if(Wb){mb.appendChild(ya);Hc(Wb)}}function K(){var m=Ga.length,i=ya&&ya.parentNode;Pa(p,"destroy");Gb(ab,"unload",K);Gb(p);for(t(bb,function(y){Gb(y)});m--;)Ga[m].destroy();if(ya){ya.innerHTML="";Gb(ya);i&&i.removeChild(ya);ya=null}if(da)da.alignedObjects=null;clearInterval(Pd);for(m in p)delete p[m]}function ia(){if(!zc&&ab==ab.top&&wa.readyState!=="complete")wa.attachEvent("onreadystatechange",function(){wa.detachEvent("onreadystatechange",ia);wa.readyState==="complete"&&ia()});
55
+ else{Yc=Pb=0;C();ud();vd();t(a.series||[],function(m){g(m)});p.inverted=qa=B(qa,a.chart.inverted);l();p.render=fa;p.tracker=kc=new f(p,a.tooltip);fa();Pa(p,"load");b&&b.apply(p,[p]);t(p.callbacks,function(m){m.apply(p,[p])})}}Nc=sa(Nc,Va.xAxis);jd=sa(jd,Va.yAxis);Va.xAxis=Va.yAxis=null;a=sa(Va,a);var u=a.chart,P=u.margin;P=Kb(P)?P:[P,P,P,P];var O=B(u.marginTop,P[0]),Q=B(u.marginRight,P[1]),H=B(u.marginBottom,P[2]),S=B(u.marginLeft,P[3]),Ta=u.spacingTop,cb=u.spacingRight,Ib=u.spacingBottom,Jb=u.spacingLeft,
56
+ Ob,Hb,xc,ea,Eb,sb,Z,Vb,mb,Wb,ya,Qd,Vc,yc,Xa,Ra,ld,Qc,Zc,wd,xd,$c,p=this,de=(P=u.events)&&!!P.click,yd,lc,vc,pd,dc,Td,zd,xa,Ba,kc,Sc,Rc,qd,Xb,Yb,uc,mc=u.showAxes,Tc=0,bb=[],Lb,Ga=[],qa,da,md,Pd,nd,rd,wc,ud,vd,td,od,Ud,ee=function(m){function i(I,ja){var T=I.legendItem,ra=I.legendLine,Da=I.legendSymbol,Ha=Ia.color,Ma=ja?N.itemStyle.color:Ha,ca=ja?I.color:Ha;Ha=ja?I.pointAttr[hb]:{stroke:Ha,fill:Ha};T&&T.css({fill:Ma});ra&&ra.attr({stroke:ca});Da&&Da.attr(Ha)}function y(I,ja,T){var ra=I.legendItem,Da=
57
+ I.legendLine,Ha=I.legendSymbol;I=I.checkbox;ra&&ra.attr({x:ja,y:T});Da&&Da.translate(ja,T-4);Ha&&Ha.attr({x:ja+Ha.xOff,y:T+Ha.yOff});if(I){I.x=ja;I.y=T}}function x(){t(Na,function(I){var ja=I.checkbox,T=fb.alignAttr;ja&&La(ja,{left:T.translateX+I.legendItemWidth+ja.x-40+$a,top:T.translateY+ja.y-11+$a})})}function R(I){var ja,T,ra,Da,Ha=I.legendItem;Da=I.series||I;var Ma=Da.options,ca=Ma&&Ma.borderWidth||0;if(!Ha){Da=/^(bar|pie|area|column)$/.test(Da.type);I.legendItem=Ha=da.text(N.labelFormatter.call(I),
58
+ 0,0).css(I.visible?Ya:Ia).on("mouseover",function(){I.setState(Ab);Ha.css(Ea)}).on("mouseout",function(){Ha.css(I.visible?Ya:Ia);I.setState()}).on("click",function(){var Db=function(){I.setVisible()};I.firePointEvent?I.firePointEvent("legendItemClick",null,Db):Pa(I,"legendItemClick",null,Db)}).attr({zIndex:2}).add(fb);if(!Da&&Ma&&Ma.lineWidth){var aa={"stroke-width":Ma.lineWidth,zIndex:2};if(Ma.dashStyle)aa.dashstyle=Ma.dashStyle;I.legendLine=da.path([Za,-Ka-za,0,Ja,-za,0]).attr(aa).add(fb)}if(Da)ja=
59
+ da.rect(T=-Ka-za,ra=-11,Ka,12,2).attr({zIndex:3}).add(fb);else if(Ma&&Ma.marker&&Ma.marker.enabled)ja=da.symbol(I.symbol,T=-Ka/2-za,ra=-4,Ma.marker.radius).attr({zIndex:3}).add(fb);if(ja){ja.xOff=T+ca%2/2;ja.yOff=ra+ca%2/2}I.legendSymbol=ja;i(I,I.visible);if(Ma&&Ma.showCheckbox){I.checkbox=ib("input",{type:"checkbox",checked:I.selected,defaultChecked:I.selected},N.itemCheckboxStyle,ya);Sa(I.checkbox,"click",function(Db){Pa(I,"checkboxClick",{checked:Db.target.checked},function(){I.select()})})}}ja=
60
+ Ha.getBBox();T=I.legendItemWidth=N.itemWidth||Ka+za+ja.width+Y;M=ja.height;if(ba&&L-w+T>(Fb||Xa-2*z-w)){L=w;E+=M}D=E;y(I,L,E);if(ba)L+=T;else E+=M;eb=Fb||Fa(ba?L-w:T,eb)}function na(){L=w;E=v;D=eb=0;fb||(fb=da.g("legend").attr({zIndex:7}).add());Na=[];t(Ub,function(ra){var Da=ra.options;if(Da.showInLegend)Na=Na.concat(Da.legendType==="point"?ra.data:ra)});Na.sort(function(ra,Da){return(ra.options.legendIndex||0)-(Da.options.legendIndex||0)});hc&&Na.reverse();t(Na,R);Xb=Fb||eb;Yb=D-v+M;if(oa||va){Xb+=
61
+ 2*z;Yb+=2*z;if(ha)Xb>0&&Yb>0&&ha.animate(ha.crisp(null,null,null,Xb,Yb));else ha=da.rect(0,0,Xb,Yb,N.borderRadius,oa||0).attr({stroke:N.borderColor,"stroke-width":oa||0,fill:va||jb}).add(fb).shadow(N.shadow);ha[Na.length?"show":"hide"]()}for(var I=["left","right","top","bottom"],ja,T=4;T--;){ja=I[T];if(Oa[ja]&&Oa[ja]!=="auto"){N[T<2?"align":"verticalAlign"]=ja;N[T<2?"x":"y"]=la(Oa[ja])*(T%2?-1:1)}}fb.align(pa(N,{width:Xb,height:Yb}),true,Ob);Tc||x()}var N=m.options.legend;if(N.enabled){var ba=N.layout===
62
+ "horizontal",Ka=N.symbolWidth,za=N.symbolPadding,Na,Oa=N.style,Ya=N.itemStyle,Ea=N.itemHoverStyle,Ia=N.itemHiddenStyle,z=la(Oa.padding),Y=20,v=18,w=4+z+Ka+za,L,E,D,M=0,ha,oa=N.borderWidth,va=N.backgroundColor,fb,eb,Fb=N.width,Ub=m.series,hc=N.reversed;na();Sa(m,"endResize",x);return{colorizeItem:i,destroyItem:function(I){var ja=I.checkbox;t(["legendItem","legendLine","legendSymbol"],function(T){I[T]&&I[T].destroy()});ja&&Hc(I.checkbox)},renderLegend:na}}};lc=function(m,i){return m>=0&&m<=Ba&&i>=0&&
63
+ i<=xa};Ud=function(){Pa(p,"selection",{resetSelection:true},od);p.toolbar.remove("zoom")};od=function(m){var i=Va.lang,y=p.pointCount<100;p.toolbar.add("zoom",i.resetZoom,i.resetZoomTitle,Ud);!m||m.resetSelection?t(bb,function(x){x.setExtremes(null,null,false,y)}):t(m.xAxis.concat(m.yAxis),function(x){var R=x.axis;if(p.tracker[R.isXAxis?"zoomX":"zoomY"])R.setExtremes(x.min,x.max,false,y)});j()};wc=function(){var m=a.legend,i=B(m.margin,10),y=m.x,x=m.y,R=m.align,na=m.verticalAlign,N;ud();if((p.title||
64
+ p.subtitle)&&!J(O))if(N=Fa(p.title&&!Hb.floating&&!Hb.verticalAlign&&Hb.y||0,p.subtitle&&!xc.floating&&!xc.verticalAlign&&xc.y||0))ea=Fa(ea,N+B(Hb.margin,15)+Ta);if(m.enabled&&!m.floating)if(R==="right")J(Q)||(Eb=Fa(Eb,Xb-y+i+cb));else if(R==="left")J(S)||(Z=Fa(Z,Xb+y+i+Jb));else if(na==="top")J(O)||(ea=Fa(ea,Yb+x+i+Ta));else if(na==="bottom")J(H)||(sb=Fa(sb,Yb-x+i+Ib));mc&&t(bb,function(ba){ba.getOffset()});J(S)||(Z+=Vb[3]);J(O)||(ea+=Vb[0]);J(H)||(sb+=Vb[2]);J(Q)||(Eb+=Vb[1]);vd()};td=function(m,
65
+ i,y){var x=p.title,R=p.subtitle;Tc+=1;fc(y,p);Qc=Ra;ld=Xa;p.chartWidth=Xa=X(m);p.chartHeight=Ra=X(i);La(ya,{width:Xa+$a,height:Ra+$a});da.setSize(Xa,Ra,y);Ba=Xa-Z-Eb;xa=Ra-ea-sb;Lb=null;t(bb,function(na){na.isDirty=true;na.setScale()});t(Ga,function(na){na.isDirty=true});p.isDirtyLegend=true;p.isDirtyBox=true;wc();x&&x.align(null,null,Ob);R&&R.align(null,null,Ob);j(y);Qc=null;Pa(p,"resize");setTimeout(function(){Pa(p,"endResize",null,function(){Tc-=1})},Dc&&Dc.duration||500)};vd=function(){p.plotLeft=
66
+ Z=X(Z);p.plotTop=ea=X(ea);p.plotWidth=Ba=X(Xa-Z-Eb);p.plotHeight=xa=X(Ra-ea-sb);p.plotSizeX=qa?xa:Ba;p.plotSizeY=qa?Ba:xa;Ob={x:Jb,y:Ta,width:Xa-Jb-cb,height:Ra-Ta-Ib}};ud=function(){ea=B(O,Ta);Eb=B(Q,cb);sb=B(H,Ib);Z=B(S,Jb);Vb=[0,0,0,0]};rd=function(){var m=u.borderWidth||0,i=u.backgroundColor,y=u.plotBackgroundColor,x=u.plotBackgroundImage,R,na={x:Z,y:ea,width:Ba,height:xa};R=m+(u.shadow?8:0);if(m||i)if(Zc)Zc.animate(Zc.crisp(null,null,null,Xa-R,Ra-R));else Zc=da.rect(R/2,R/2,Xa-R,Ra-R,u.borderRadius,
67
+ m).attr({stroke:u.borderColor,"stroke-width":m,fill:i||jb}).add().shadow(u.shadow);if(y)if(wd)wd.animate(na);else wd=da.rect(Z,ea,Ba,xa,0).attr({fill:y}).add().shadow(u.plotShadow);if(x)if(xd)xd.animate(na);else xd=da.image(x,Z,ea,Ba,xa).add();if(u.plotBorderWidth)if($c)$c.animate($c.crisp(null,Z,ea,Ba,xa));else $c=da.rect(Z,ea,Ba,xa,0,u.plotBorderWidth).attr({stroke:u.plotBorderColor,"stroke-width":u.plotBorderWidth,zIndex:4}).add();p.isDirtyBox=false};Sa(ab,"unload",K);u.reflow!==false&&Sa(p,"load",
68
+ G);if(P)for(yd in P)Sa(p,yd,P[yd]);p.options=a;p.series=Ga;p.addSeries=function(m,i,y){var x;if(m){fc(y,p);i=B(i,true);Pa(p,"addSeries",{options:m},function(){x=g(m);x.isDirty=true;p.isDirtyLegend=true;i&&p.redraw()})}return x};p.animation=B(u.animation,true);p.destroy=K;p.get=function(m){var i,y,x;for(i=0;i<bb.length;i++)if(bb[i].options.id===m)return bb[i];for(i=0;i<Ga.length;i++)if(Ga[i].options.id===m)return Ga[i];for(i=0;i<Ga.length;i++){x=Ga[i].data;for(y=0;y<x.length;y++)if(x[y].id===m)return x[y]}return null};
69
+ p.getSelectedPoints=function(){var m=[];t(Ga,function(i){m=m.concat(Ad(i.data,function(y){return y.selected}))});return m};p.getSelectedSeries=function(){return Ad(Ga,function(m){return m.selected})};p.hideLoading=function(){ad(dc,{opacity:0},{duration:a.loading.hideDuration,complete:function(){La(dc,{display:jb})}});zd=false};p.isInsidePlot=lc;p.redraw=j;p.setSize=td;p.setTitle=n;p.showLoading=function(m){var i=a.loading;if(!dc){dc=ib(Rb,{className:"highcharts-loading"},pa(i.style,{left:Z+$a,top:ea+
70
+ $a,width:Ba+$a,height:xa+$a,zIndex:10,display:jb}),ya);Td=ib("span",null,i.labelStyle,dc)}Td.innerHTML=m||a.lang.loading;if(!zd){La(dc,{opacity:0,display:""});ad(dc,{opacity:i.style.opacity},{duration:i.showDuration});zd=true}};p.pointCount=0;ia()}var wa=document,ab=window,ta=Math,X=ta.round,kb=ta.floor,hd=ta.ceil,Fa=ta.max,qb=ta.min,db=ta.abs,nb=ta.cos,Bb=ta.sin,Zb=ta.PI,Vd=Zb*2/360,qc=navigator.userAgent,Cc=/msie/i.test(qc)&&!ab.opera,Ac=wa.documentMode===8,Od=/AppleWebKit/.test(qc),Sd=/Firefox/.test(qc),
71
+ zc=!!wa.createElementNS&&!!wa.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect,Xc,Nb=wa.documentElement.ontouchstart!==undefined,Pb,Yc,Wd={},sd=0,rb=1,Ic,Va,Oc,Dc,bd,Ua,Rb="div",pc="absolute",Rd="relative",gb="hidden",oc="highcharts-",ub="visible",$a="px",jb="none",Za="M",Ja="L",Xd="rgba(192,192,192,"+(zc?1.0E-6:0.0020)+")",hb="",Ab="hover",Ec,dd,ed,fd,tc,Fc,Gc,Dd,Ed,gd,Fd,Gd,ka=ab.HighchartsAdapter,wb=ka||{},t=wb.each,Ad=wb.grep,nc=wb.map,sa=wb.merge,Yd=wb.hyphenate,Sa=wb.addEvent,
72
+ Gb=wb.removeEvent,Pa=wb.fireEvent,ad=wb.animate,Uc=wb.stop,vb={};Oc=function(a,b,c){function d(G){return G.toString().replace(/^([0-9])$/,"0$1")}if(!J(b)||isNaN(b))return"Invalid date";a=B(a,"%Y-%m-%d %H:%M:%S");b=new Date(b*rb);var e,f=b[ed](),g=b[fd](),h=b[tc](),j=b[Fc](),l=b[Gc](),n=Va.lang,C=n.weekdays;n=n.months;b={a:C[g].substr(0,3),A:C[g],d:d(h),e:h,b:n[j].substr(0,3),B:n[j],m:d(j+1),y:l.toString().substr(2,2),Y:l,H:d(f),I:d(f%12||12),l:f%12||12,M:d(b[dd]()),p:f<12?"AM":"PM",P:f<12?"am":"pm",
73
+ S:d(b.getSeconds())};for(e in b)a=a.replace("%"+e,b[e]);return c?a.substr(0,1).toUpperCase()+a.substr(1):a};ka&&ka.init&&ka.init();if(!ka&&ab.jQuery){var ob=jQuery;t=function(a,b){for(var c=0,d=a.length;c<d;c++)if(b.call(a[c],a[c],c,a)===false)return c};Ad=ob.grep;nc=function(a,b){for(var c=[],d=0,e=a.length;d<e;d++)c[d]=b.call(a[d],a[d],d,a);return c};sa=function(){var a=arguments;return ob.extend(true,null,a[0],a[1],a[2],a[3])};Yd=function(a){return a.replace(/([A-Z])/g,function(b,c){return"-"+
74
+ c.toLowerCase()})};Sa=function(a,b,c){ob(a).bind(b,c)};Gb=function(a,b,c){var d=wa.removeEventListener?"removeEventListener":"detachEvent";if(wa[d]&&!a[d])a[d]=function(){};ob(a).unbind(b,c)};Pa=function(a,b,c,d){var e=ob.Event(b),f="detached"+b;pa(e,c);if(a[b]){a[f]=a[b];a[b]=null}ob(a).trigger(e);if(a[f]){a[b]=a[f];a[f]=null}d&&!e.isDefaultPrevented()&&d(e)};ad=function(a,b,c){var d=ob(a);if(b.d){a.toD=b.d;b.d=1}d.stop();d.animate(b,c)};Uc=function(a){ob(a).stop()};ob.extend(ob.easing,{easeOutQuad:function(a,
75
+ b,c,d,e){return-d*(b/=e)*(b-2)+c}});var fe=jQuery.fx.step._default,ge=jQuery.fx.prototype.cur;ob.fx.step._default=function(a){var b=a.elem;b.attr?b.attr(a.prop,a.now):fe.apply(this,arguments)};ob.fx.step.d=function(a){var b=a.elem;if(!a.started){var c=bd.init(b,b.d,b.toD);a.start=c[0];a.end=c[1];a.started=true}b.attr("d",bd.step(a.start,a.end,a.pos,b.toD))};ob.fx.prototype.cur=function(){var a=this.elem;return a.attr?a.attr(this.prop):ge.apply(this,arguments)}}bd={init:function(a,b,c){b=b||"";var d=
76
+ a.shift,e=b.indexOf("C")>-1,f=e?7:3,g;b=b.split(" ");c=[].concat(c);var h,j,l=function(n){for(g=n.length;g--;)n[g]===Za&&n.splice(g+1,0,n[g+1],n[g+2],n[g+1],n[g+2])};if(e){l(b);l(c)}if(a.isArea){h=b.splice(b.length-6,6);j=c.splice(c.length-6,6)}if(d){c=[].concat(c).splice(0,f).concat(c);a.shift=false}if(b.length)for(a=c.length;b.length<a;){d=[].concat(b).splice(b.length-f,f);if(e){d[f-6]=d[f-2];d[f-5]=d[f-1]}b=b.concat(d)}if(h){b=b.concat(h);c=c.concat(j)}return[b,c]},step:function(a,b,c,d){var e=
77
+ [],f=a.length;if(c===1)e=d;else if(f===b.length&&c<1)for(;f--;){d=parseFloat(a[f]);e[f]=isNaN(d)?a[f]:c*parseFloat(b[f]-d)+d}else e=b;return e}};ka={enabled:true,align:"center",x:0,y:15,style:{color:"#666",fontSize:"11px",lineHeight:"14px"}};Va={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",
78
+ "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',
79
+ 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:sa(ka,
80
+ {enabled:false,y:-6,formatter:function(){return this.y}}),showInLegend:true,states:{hover:{marker:{}},select:{marker:{}}},stickyTracking:true}},labels:{style:{position:pc,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"},
81
+ itemCheckboxStyle:{position:pc,width:"13px",height:"13px"},symbolWidth:16,symbolPadding:5,verticalAlign:"bottom",x:0,y:0},loading:{hideDuration:100,labelStyle:{fontWeight:"bold",position:Rd,top:"1em"},showDuration:100,style:{position:pc,backgroundColor:"white",opacity:0.5,textAlign:"center"}},tooltip:{enabled:true,backgroundColor:"rgba(255, 255, 255, .85)",borderWidth:2,borderRadius:5,shadow:true,snap:Nb?25:10,style:{color:"#333333",fontSize:"12px",padding:"5px",whiteSpace:"nowrap"}},toolbar:{itemStyle:{color:"#4572A7",
82
+ 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 Nc={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:ka,lineColor:"#C0D0E0",lineWidth:1,max:null,min:null,minPadding:0.01,maxPadding:0.01,minorGridLineColor:"#E0E0E0",
83
+ 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"},jd=sa(Nc,{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,
84
+ title:{rotation:270,text:"Y-values"},stackLabels:{enabled:false,formatter:function(){return this.total},style:ka.style}}),be={labels:{align:"right",x:-8,y:null},title:{rotation:270}},ae={labels:{align:"left",x:8,y:null},title:{rotation:90}},Nd={labels:{align:"center",x:0,y:14},title:{rotation:0}},$d=sa(Nd,{labels:{y:-5}}),xb=Va.plotOptions;ka=xb.line;xb.spline=sa(ka);xb.scatter=sa(ka,{lineWidth:0,states:{hover:{lineWidth:0}}});xb.area=sa(ka,{});xb.areaspline=sa(xb.area);xb.column=sa(ka,{borderColor:"#FFFFFF",
85
+ 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}},dataLabels:{y:null,verticalAlign:null}});xb.bar=sa(xb.column,{dataLabels:{align:"left",x:5,y:0}});xb.pie=sa(ka,{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,
86
+ size:"75%",showInLegend:false,slicedOffset:10,states:{hover:{brightness:0.1,shadow:false}}});Cd();var $b=function(a){var b=[],c;(function(d){if(c=/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))b=[la(c[1]),la(c[2]),la(c[3]),parseFloat(c[4],10)];else if(c=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(d))b=[la(c[1],16),la(c[2],16),la(c[3],16),1]})(a);return{get:function(d){return b&&!isNaN(b[0])?d==="rgb"?"rgb("+b[0]+","+b[1]+","+b[2]+
87
+ ")":d==="a"?b[3]:"rgba("+b.join(",")+")":a},brighten:function(d){if(ec(d)&&d!==0){var e;for(e=0;e<3;e++){b[e]+=la(d*255);if(b[e]<0)b[e]=0;if(b[e]>255)b[e]=255}}return this},setOpacity:function(d){b[3]=d;return this}}};Jc.prototype={init:function(a,b){this.element=wa.createElementNS("http://www.w3.org/2000/svg",b);this.renderer=a},animate:function(a,b,c){if(b=B(b,Dc,true)){b=sa(b);if(c)b.complete=c;ad(this,a,b)}else{this.attr(a);c&&c()}},attr:function(a,b){var c,d,e,f,g=this.element,h=g.nodeName,j=
88
+ this.renderer,l,n=this.shadows,C,G=this;if(Qb(a)&&J(b)){c=a;a={};a[c]=b}if(Qb(a)){c=a;if(h==="circle")c={x:"cx",y:"cy"}[c]||c;else if(c==="strokeWidth")c="stroke-width";G=Ca(g,c)||this[c]||0;if(c!=="d"&&c!=="visibility")G=parseFloat(G)}else for(c in a){l=false;d=a[c];if(c==="d"){if(d&&d.join)d=d.join(" ");if(/(NaN| {2}|^$)/.test(d))d="M 0 0";this.d=d}else if(c==="x"&&h==="text"){for(e=0;e<g.childNodes.length;e++){f=g.childNodes[e];Ca(f,"x")===Ca(g,"x")&&Ca(f,"x",d)}if(this.rotation)Ca(g,"transform",
89
+ "rotate("+this.rotation+" "+d+" "+la(a.y||Ca(g,"y"))+")")}else if(c==="fill")d=j.color(d,g,c);else if(h==="circle"&&(c==="x"||c==="y"))c={x:"cx",y:"cy"}[c]||c;else if(c==="translateX"||c==="translateY"||c==="rotation"||c==="verticalAlign"){this[c]=d;this.updateTransform();l=true}else if(c==="stroke")d=j.color(d,g,c);else if(c==="dashstyle"){c="stroke-dasharray";d=d&&d.toLowerCase();if(d==="solid")d=jb;else if(d){d=d.replace("shortdashdotdot","3,1,1,1,1,1,").replace("shortdashdot","3,1,1,1").replace("shortdot",
90
+ "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]=la(d[e])*a["stroke-width"];d=d.join(",")}}else if(c==="isTracker")this[c]=d;else if(c==="width")d=la(d);else if(c==="align"){c="text-anchor";d={left:"start",center:"middle",right:"end"}[d]}if(c==="strokeWidth")c="stroke-width";if(Od&&c==="stroke-width"&&d===0)d=1.0E-6;if(this.symbolName&&/^(x|y|r|start|end|innerR)/.test(c)){if(!C){this.symbolAttr(a);
91
+ C=true}l=true}if(n&&/^(width|height|visibility|x|y|d)$/.test(c))for(e=n.length;e--;)Ca(n[e],c,d);if((c==="width"||c==="height")&&h==="rect"&&d<0)d=0;if(c==="text"){this.textStr=d;this.added&&j.buildText(this)}else l||Ca(g,c,d)}return G},symbolAttr:function(a){var b=this;t(["x","y","r","start","end","width","height","innerR"],function(c){b[c]=B(a[c],b[c])});b.attr({d:b.renderer.symbols[b.symbolName](X(b.x*2)/2,X(b.y*2)/2,b.r,{start:b.start,end:b.end,width:b.width,height:b.height,innerR:b.innerR})})},
92
+ clip:function(a){return this.attr("clip-path","url("+this.renderer.url+"#"+a.id+")")},crisp:function(a,b,c,d,e){var f,g={},h={},j;a=a||this.strokeWidth||0;j=a%2/2;h.x=kb(b||this.x||0)+j;h.y=kb(c||this.y||0)+j;h.width=kb((d||this.width||0)-2*j);h.height=kb((e||this.height||0)-2*j);h.strokeWidth=a;for(f in h)if(this[f]!==h[f])this[f]=g[f]=h[f];return g},css:function(a){var b=this.element;b=a&&a.width&&b.nodeName==="text";var c=a,d;if(a&&a.color)a.fill=a.color;this.styles=a=pa(this.styles,a);if(J(a)){a=
93
+ {};for(d in c)a[Yd(d)]=c[d]}if(Cc&&!zc){b&&delete a.width;La(this.element,a)}else this.attr({style:Zd(a)});b&&this.added&&this.renderer.buildText(this);return this},on:function(a,b){var c=b;if(Nb&&a==="click"){a="touchstart";c=function(d){d.preventDefault();b()}}this.element["on"+a]=c;return this},translate:function(a,b){return this.attr({translateX:a,translateY:b})},invert:function(){this.inverted=true;this.updateTransform();return this},updateTransform:function(){var a=this.translateX||0,b=this.translateY||
94
+ 0,c=this.inverted,d=this.rotation,e=[];if(c){a+=this.attr("width");b+=this.attr("height")}if(a||b)e.push("translate("+a+","+b+")");if(c)e.push("rotate(90) scale(-1,1)");else d&&e.push("rotate("+d+" "+this.x+" "+this.y+")");e.length&&Ca(this.element,"transform",e.join(" "))},toFront:function(){var a=this.element;a.parentNode.appendChild(a);return this},align:function(a,b,c){if(a){this.alignOptions=a;this.alignByTranslate=b;c||this.renderer.alignedObjects.push(this)}else{a=this.alignOptions;b=this.alignByTranslate}c=
95
+ B(c,this.renderer);var d=a.align,e=a.verticalAlign,f=(c.x||0)+(a.x||0),g=(c.y||0)+(a.y||0),h={};if(/^(right|center)$/.test(d))f+=(c.width-(a.width||0))/{right:1,center:2}[d];h[b?"translateX":"x"]=X(f);if(/^(bottom|middle)$/.test(e))g+=(c.height-(a.height||0))/({bottom:1,middle:2}[e]||1);h[b?"translateY":"y"]=X(g);this[this.placed?"animate":"attr"](h);this.placed=true;this.alignAttr=h;return this},getBBox:function(){var a,b,c,d=this.rotation,e=d*Vd;try{a=pa({},this.element.getBBox())}catch(f){a={width:0,
96
+ height:0}}b=a.width;c=a.height;if(d){a.width=db(c*Bb(e))+db(b*nb(e));a.height=db(c*nb(e))+db(b*Bb(e))}return a},show:function(){return this.attr({visibility:ub})},hide:function(){return this.attr({visibility:gb})},add:function(a){var b=this.renderer,c=a||b,d=c.element||b.box,e=d.childNodes,f=this.element,g=Ca(f,"zIndex");this.parentInverted=a&&a.inverted;this.textStr!==undefined&&b.buildText(this);if(g){c.handleZ=true;g=la(g)}if(c.handleZ)for(c=0;c<e.length;c++){a=e[c];b=Ca(a,"zIndex");if(a!==f&&
97
+ (la(b)>g||!J(g)&&J(b))){d.insertBefore(f,a);return this}}d.appendChild(f);this.added=true;return this},destroy:function(){var a=this.element||{},b=this.shadows,c=a.parentNode,d;a.onclick=a.onmouseout=a.onmouseover=a.onmousemove=null;Uc(this);c&&c.removeChild(a);b&&t(b,function(e){(c=e.parentNode)&&c.removeChild(e)});rc(this.renderer.alignedObjects,this);for(d in this)delete this[d];return null},empty:function(){for(var a=this.element,b=a.childNodes,c=b.length;c--;)a.removeChild(b[c])},shadow:function(a,
98
+ b){var c=[],d,e,f=this.element,g=this.parentInverted?"(-1,-1)":"(1,1)";if(a){for(d=1;d<=3;d++){e=f.cloneNode(0);Ca(e,{isShadow:"true",stroke:"rgb(0, 0, 0)","stroke-opacity":0.05*d,"stroke-width":7-2*d,transform:"translate"+g,fill:jb});b?b.element.appendChild(e):f.parentNode.insertBefore(e,f);c.push(e)}this.shadows=c}return this}};var Wc=function(){this.init.apply(this,arguments)};Wc.prototype={Element:Jc,init:function(a,b,c,d){var e=location,f;f=this.createElement("svg").attr({xmlns:"http://www.w3.org/2000/svg",
99
+ version:"1.1"});a.appendChild(f.element);this.box=f.element;this.boxWrapper=f;this.alignedObjects=[];this.url=Cc?"":e.href.replace(/#.*?$/,"");this.defs=this.createElement("defs").add();this.forExport=d;this.setSize(b,c,false)},createElement:function(a){var b=new this.Element;b.init(this,a);return b},buildText:function(a){for(var b=a.element,c=B(a.textStr,"").toString().replace(/<(b|strong)>/g,'<span style="font-weight:bold">').replace(/<(i|em)>/g,'<span style="font-style:italic">').replace(/<a/g,
100
+ "<span").replace(/<\/(b|strong|i|em|a)>/g,"</span>").split(/<br.*?>/g),d=b.childNodes,e=/style="([^"]+)"/,f=/href="([^"]+)"/,g=Ca(b,"x"),h=a.styles,j=Sd&&h&&h["-hc-direction"]==="rtl"&&!this.forExport&&la(qc.split("Firefox/")[1])<4,l,n=h&&la(h.width),C=h&&h["line-height"],G,fa=d.length;fa--;)b.removeChild(d[fa]);n&&!a.added&&this.box.appendChild(b);t(c,function(K,ia){var u,P=0,O;K=K.replace(/<span/g,"|||<span").replace(/<\/span>/g,"</span>|||");u=K.split("|||");t(u,function(Q){if(Q!==""||u.length===
101
+ 1){var H={},S=wa.createElementNS("http://www.w3.org/2000/svg","tspan");e.test(Q)&&Ca(S,"style",Q.match(e)[1].replace(/(;| |^)color([ :])/,"$1fill$2"));if(f.test(Q)){Ca(S,"onclick",'location.href="'+Q.match(f)[1]+'"');La(S,{cursor:"pointer"})}Q=(Q.replace(/<(.|\n)*?>/g,"")||" ").replace(/&lt;/g,"<").replace(/&gt;/g,">");if(j){l=[];for(fa=Q.length;fa--;)l.push(Q.charAt(fa));Q=l.join("")}S.appendChild(wa.createTextNode(Q));if(P)H.dx=3;else H.x=g;if(!P){if(ia){!zc&&a.renderer.forExport&&La(S,{display:"block"});
102
+ O=ab.getComputedStyle&&ab.getComputedStyle(G,null).getPropertyValue("line-height");if(!O||isNaN(O))O=C||G.offsetHeight||18;Ca(S,"dy",O)}G=S}Ca(S,H);b.appendChild(S);P++;if(n){Q=Q.replace(/-/g,"- ").split(" ");for(var Ta,cb=[];Q.length||cb.length;){Ta=b.getBBox().width;H=Ta>n;if(!H||Q.length===1){Q=cb;cb=[];if(Q.length){S=wa.createElementNS("http://www.w3.org/2000/svg","tspan");Ca(S,{dy:C||16,x:g});b.appendChild(S);if(Ta>n)n=Ta}}else{S.removeChild(S.firstChild);cb.unshift(Q.pop())}Q.length&&S.appendChild(wa.createTextNode(Q.join(" ").replace(/- /g,
103
+ "-")))}}}})})},crispLine:function(a,b){if(a[1]===a[4])a[1]=a[4]=X(a[1])+b%2/2;if(a[2]===a[5])a[2]=a[5]=X(a[2])+b%2/2;return a},path:function(a){return this.createElement("path").attr({d:a,fill:jb})},circle:function(a,b,c){a=Kb(a)?a:{x:a,y:b,r:c};return this.createElement("circle").attr(a)},arc:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.r;d=a.innerR;e=a.start;f=a.end;a=a.x}return this.symbol("arc",a||0,b||0,c||0,{innerR:d||0,start:e||0,end:f||0})},rect:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.width;
104
+ d=a.height;e=a.r;f=a.strokeWidth;a=a.x}e=this.createElement("rect").attr({rx:e,ry:e,fill:jb});return e.attr(e.crisp(f,a,b,Fa(c,0),Fa(d,0)))},setSize:function(a,b,c){var d=this.alignedObjects,e=d.length;this.width=a;this.height=b;for(this.boxWrapper[B(c,true)?"animate":"attr"]({width:a,height:b});e--;)d[e].align()},g:function(a){return this.createElement("g").attr(J(a)&&{"class":oc+a})},image:function(a,b,c,d,e){var f={preserveAspectRatio:jb};arguments.length>1&&pa(f,{x:b,y:c,width:d,height:e});f=
105
+ this.createElement("image").attr(f);f.element.setAttributeNS?f.element.setAttributeNS("http://www.w3.org/1999/xlink","href",a):f.element.setAttribute("hc-svg-href",a);return f},symbol:function(a,b,c,d,e){var f,g=this.symbols[a];g=g&&g(X(b),X(c),d,e);var h=/^url\((.*?)\)$/,j;if(g){f=this.path(g);pa(f,{symbolName:a,x:b,y:c,r:d});e&&pa(f,e)}else if(h.test(a)){var l=function(n,C){n.attr({width:C[0],height:C[1]}).translate(-X(C[0]/2),-X(C[1]/2))};j=a.match(h)[1];a=Wd[j];f=this.image(j).attr({x:b,y:c});
106
+ if(a)l(f,a);else{f.attr({width:0,height:0});ib("img",{onload:function(){l(f,Wd[j]=[this.width,this.height])},src:j})}}else f=this.circle(b,c,d);return f},symbols:{square:function(a,b,c){c=0.707*c;return[Za,a-c,b-c,Ja,a+c,b-c,a+c,b+c,a-c,b+c,"Z"]},triangle:function(a,b,c){return[Za,a,b-1.33*c,Ja,a+c,b+0.67*c,a-c,b+0.67*c,"Z"]},"triangle-down":function(a,b,c){return[Za,a,b+1.33*c,Ja,a-c,b-0.67*c,a+c,b-0.67*c,"Z"]},diamond:function(a,b,c){return[Za,a,b-c,Ja,a+c,b,a,b+c,a-c,b,"Z"]},arc:function(a,b,c,
107
+ d){var e=d.start,f=d.end-1.0E-6,g=d.innerR,h=nb(e),j=Bb(e),l=nb(f);f=Bb(f);d=d.end-e<Zb?0:1;return[Za,a+c*h,b+c*j,"A",c,c,0,d,1,a+c*l,b+c*f,Ja,a+g*l,b+g*f,"A",g,g,0,d,0,a+g*h,b+g*j,"Z"]}},clipRect:function(a,b,c,d){var e=oc+sd++,f=this.createElement("clipPath").attr({id:e}).add(this.defs);a=this.rect(a,b,c,d,0).add(f);a.id=e;return a},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f=this;b=a.linearGradient;c=oc+sd++;var g,h,j;g=f.createElement("linearGradient").attr({id:c,gradientUnits:"userSpaceOnUse",
108
+ x1:b[0],y1:b[1],x2:b[2],y2:b[3]}).add(f.defs);t(a.stops,function(l){if(e.test(l[1])){d=$b(l[1]);h=d.get("rgb");j=d.get("a")}else{h=l[1];j=1}f.createElement("stop").attr({offset:l[0],"stop-color":h,"stop-opacity":j}).add(g)});return"url("+this.url+"#"+c+")"}else if(e.test(a)){d=$b(a);Ca(b,c+"-opacity",d.get("a"));return d.get("rgb")}else return a},text:function(a,b,c){var d=Va.chart.style;b=X(B(b,0));c=X(B(c,0));a=this.createElement("text").attr({x:b,y:c,text:a}).css({"font-family":d.fontFamily,"font-size":d.fontSize});
109
+ a.x=b;a.y=c;return a}};Xc=Wc;if(!zc){wb=yb(Jc,{init:function(a,b){var c=["<",b,' filled="f" stroked="f"'],d=["position: ",pc,";"];if(b==="shape"||b===Rb)d.push("left:0;top:0;width:10px;height:10px;");if(Ac)d.push("visibility: ",b===Rb?gb:ub);c.push(' style="',d.join(""),'"/>');if(b){c=b===Rb||b==="span"||b==="img"?c.join(""):a.prepVML(c);this.element=ib(c)}this.renderer=a},add:function(a){var b=this.renderer,c=this.element,d=b.box;d=a?a.element||a:d;a&&a.inverted&&b.invertChild(c,d);Ac&&d.gVis===
110
+ gb&&La(c,{visibility:gb});d.appendChild(c);this.added=true;this.alignOnAdd&&this.updateTransform();return this},attr:function(a,b){var c,d,e,f=this.element||{},g=f.style,h=f.nodeName,j=this.renderer,l=this.symbolName,n,C,G=this.shadows,fa=this;if(Qb(a)&&J(b)){c=a;a={};a[c]=b}if(Qb(a)){c=a;fa=c==="strokeWidth"||c==="stroke-width"?this.strokeweight:this[c]}else for(c in a){d=a[c];n=false;if(l&&/^(x|y|r|start|end|width|height|innerR)/.test(c)){if(!C){this.symbolAttr(a);C=true}n=true}else if(c==="d"){d=
111
+ d||[];this.d=d.join(" ");e=d.length;for(n=[];e--;)n[e]=ec(d[e])?X(d[e]*10)-5:d[e]==="Z"?"x":d[e];d=n.join(" ")||"x";f.path=d;if(G)for(e=G.length;e--;)G[e].path=d;n=true}else if(c==="zIndex"||c==="visibility"){if(Ac&&c==="visibility"&&h==="DIV"){f.gVis=d;n=f.childNodes;for(e=n.length;e--;)La(n[e],{visibility:d});if(d===ub)d=null}if(d)g[c]=d;n=true}else if(/^(width|height)$/.test(c)){if(this.updateClipping){this[c]=d;this.updateClipping()}else g[c]=d;n=true}else if(/^(x|y)$/.test(c)){this[c]=d;if(f.tagName===
112
+ "SPAN")this.updateTransform();else g[{x:"left",y:"top"}[c]]=d}else if(c==="class")f.className=d;else if(c==="stroke"){d=j.color(d,f,c);c="strokecolor"}else if(c==="stroke-width"||c==="strokeWidth"){f.stroked=d?true:false;c="strokeweight";this[c]=d;if(ec(d))d+=$a}else if(c==="dashstyle"){(f.getElementsByTagName("stroke")[0]||ib(j.prepVML(["<stroke/>"]),null,null,f))[c]=d||"solid";this.dashstyle=d;n=true}else if(c==="fill")if(h==="SPAN")g.color=d;else{f.filled=d!==jb?true:false;d=j.color(d,f,c);c="fillcolor"}else if(c===
113
+ "translateX"||c==="translateY"||c==="rotation"||c==="align"){if(c==="align")c="textAlign";this[c]=d;this.updateTransform();n=true}else if(c==="text"){this.bBox=null;f.innerHTML=d;n=true}if(G&&c==="visibility")for(e=G.length;e--;)G[e].style[c]=d;if(!n)if(Ac)f[c]=d;else Ca(f,c,d)}return fa},clip:function(a){var b=this,c=a.members;c.push(b);b.destroyClip=function(){rc(c,b)};return b.css(a.getCSS(b.inverted))},css:function(a){var b=this.element;if(b=a&&b.tagName==="SPAN"&&a.width){delete a.width;this.textWidth=
114
+ b;this.updateTransform()}this.styles=pa(this.styles,a);La(this.element,a);return this},destroy:function(){this.destroyClip&&this.destroyClip();Jc.prototype.destroy.apply(this)},empty:function(){for(var a=this.element.childNodes,b=a.length,c;b--;){c=a[b];c.parentNode.removeChild(c)}},getBBox:function(){var a=this.element,b=this.bBox;if(!b){if(a.nodeName==="text")a.style.position=pc;b=this.bBox={x:a.offsetLeft,y:a.offsetTop,width:a.offsetWidth,height:a.offsetHeight}}return b},on:function(a,b){this.element["on"+
115
+ a]=function(){var c=ab.event;c.target=c.srcElement;b(c)};return this},updateTransform:function(){if(this.added){var a=this,b=a.element,c=a.translateX||0,d=a.translateY||0,e=a.x||0,f=a.y||0,g=a.textAlign||"left",h={left:0,center:0.5,right:1}[g],j=g&&g!=="left";if(c||d)a.css({marginLeft:c,marginTop:d});a.inverted&&t(b.childNodes,function(P){a.renderer.invertChild(P,b)});if(b.tagName==="SPAN"){var l,n;c=a.rotation;var C;l=0;d=1;var G=0,fa;C=la(a.textWidth);var K=a.xCorr||0,ia=a.yCorr||0,u=[c,g,b.innerHTML,
116
+ a.textWidth].join(",");if(u!==a.cTT){if(J(c)){l=c*Vd;d=nb(l);G=Bb(l);La(b,{filter:c?["progid:DXImageTransform.Microsoft.Matrix(M11=",d,", M12=",-G,", M21=",G,", M22=",d,", sizingMethod='auto expand')"].join(""):jb})}l=b.offsetWidth;n=b.offsetHeight;if(l>C){La(b,{width:C+$a,display:"block",whiteSpace:"normal"});l=C}C=X((la(b.style.fontSize)||12)*1.2);K=d<0&&-l;ia=G<0&&-n;fa=d*G<0;K+=G*C*(fa?1-h:h);ia-=d*C*(c?fa?h:1-h:1);if(j){K-=l*h*(d<0?-1:1);if(c)ia-=n*h*(G<0?-1:1);La(b,{textAlign:g})}a.xCorr=K;
117
+ a.yCorr=ia}La(b,{left:e+K,top:f+ia});a.cTT=u}}else this.alignOnAdd=true},shadow:function(a,b){var c=[],d,e=this.element,f=this.renderer,g,h=e.style,j,l=e.path;if(l&&typeof l.value!=="string")l="x";if(a){for(d=1;d<=3;d++){j=['<shape isShadow="true" strokeweight="',7-2*d,'" filled="false" path="',l,'" coordsize="100,100" style="',e.style.cssText,'" />'];g=ib(f.prepVML(j),null,{left:la(h.left)+1,top:la(h.top)+1});j=['<stroke color="black" opacity="',0.05*d,'"/>'];ib(f.prepVML(j),null,null,g);b?b.element.appendChild(g):
118
+ e.parentNode.insertBefore(g,e);c.push(g)}this.shadows=c}return this}});ka=function(){this.init.apply(this,arguments)};ka.prototype=sa(Wc.prototype,{Element:wb,isIE8:qc.indexOf("MSIE 8.0")>-1,init:function(a,b,c){var d;this.alignedObjects=[];d=this.createElement(Rb);a.appendChild(d.element);this.box=d.element;this.boxWrapper=d;this.setSize(b,c,false);if(!wa.namespaces.hcv){wa.namespaces.add("hcv","urn:schemas-microsoft-com:vml");wa.createStyleSheet().cssText="hcv\\:fill, hcv\\:path, hcv\\:shape, hcv\\:stroke{ behavior:url(#default#VML); display: inline-block; } "}},
119
+ clipRect:function(a,b,c,d){var e=this.createElement();return pa(e,{members:[],left:a,top:b,width:c,height:d,getCSS:function(f){var g=this.top,h=this.left,j=h+this.width,l=g+this.height;g={clip:"rect("+X(f?h:g)+"px,"+X(f?l:j)+"px,"+X(f?j:l)+"px,"+X(f?g:h)+"px)"};!f&&Ac&&pa(g,{width:j+$a,height:l+$a});return g},updateClipping:function(){t(e.members,function(f){f.css(e.getCSS(f.inverted))})}})},color:function(a,b,c){var d,e=/^rgba/;if(a&&a.linearGradient){var f,g,h=a.linearGradient,j,l,n,C;t(a.stops,
120
+ function(G,fa){if(e.test(G[1])){d=$b(G[1]);f=d.get("rgb");g=d.get("a")}else{f=G[1];g=1}if(fa){n=f;C=g}else{j=f;l=g}});a=90-ta.atan((h[3]-h[1])/(h[2]-h[0]))*180/Zb;c=["<",c,' colors="0% ',j,",100% ",n,'" angle="',a,'" opacity="',C,'" o:opacity2="',l,'" type="gradient" focus="100%" />'];ib(this.prepVML(c),null,null,b)}else if(e.test(a)&&b.tagName!=="IMG"){d=$b(a);c=["<",c,' opacity="',d.get("a"),'"/>'];ib(this.prepVML(c),null,null,b);return d.get("rgb")}else return a},prepVML:function(a){var b=this.isIE8;
121
+ a=a.join("");if(b){a=a.replace("/>",' xmlns="urn:schemas-microsoft-com:vml" />');a=a.indexOf('style="')===-1?a.replace("/>",' style="display:inline-block;behavior:url(#default#VML);" />'):a.replace('style="','style="display:inline-block;behavior:url(#default#VML);')}else a=a.replace("<","<hcv:");return a},text:function(a,b,c){var d=Va.chart.style;return this.createElement("span").attr({text:a,x:X(b),y:X(c)}).css({whiteSpace:"nowrap",fontFamily:d.fontFamily,fontSize:d.fontSize})},path:function(a){return this.createElement("shape").attr({coordsize:"100 100",
122
+ d:a})},circle:function(a,b,c){return this.symbol("circle").attr({x:a,y:b,r:c})},g:function(a){var b;if(a)b={className:oc+a,"class":oc+a};return this.createElement(Rb).attr(b)},image:function(a,b,c,d,e){var f=this.createElement("img").attr({src:a});arguments.length>1&&f.css({left:b,top:c,width:d,height:e});return f},rect:function(a,b,c,d,e,f){if(Kb(a)){b=a.y;c=a.width;d=a.height;e=a.r;f=a.strokeWidth;a=a.x}var g=this.symbol("rect");g.r=e;return g.attr(g.crisp(f,a,b,Fa(c,0),Fa(d,0)))},invertChild:function(a,
123
+ b){var c=b.style;La(a,{flip:"x",left:la(c.width)-10,top:la(c.height)-10,rotation:-90})},symbols:{arc:function(a,b,c,d){var e=d.start,f=d.end,g=nb(e),h=Bb(e),j=nb(f),l=Bb(f);d=d.innerR;var n=0.07/c,C=d&&0.1/d||0;if(f-e===0)return["x"];else if(2*Zb-f+e<n)j=-n;else if(f-e<C)j=nb(e+C);return["wa",a-c,b-c,a+c,b+c,a+c*g,b+c*h,a+c*j,b+c*l,"at",a-d,b-d,a+d,b+d,a+d*j,b+d*l,a+d*g,b+d*h,"x","e"]},circle:function(a,b,c){return["wa",a-c,b-c,a+c,b+c,a+c,b,a+c,b,"e"]},rect:function(a,b,c,d){if(!J(d))return[];var e=
124
+ d.width;d=d.height;var f=a+e,g=b+d;c=qb(c,e,d);return[Za,a+c,b,Ja,f-c,b,"wa",f-2*c,b,f,b+2*c,f-c,b,f,b+c,Ja,f,g-c,"wa",f-2*c,g-2*c,f,g,f,g-c,f-c,g,Ja,a+c,g,"wa",a,g-2*c,a+2*c,g,a+c,g,a,g-c,Ja,a,b+c,"wa",a,b,a+2*c,b+2*c,a,b+c,a+c,b,"x","e"]}}});Xc=ka}Hd.prototype.callbacks=[];var Bc=function(){};Bc.prototype={init:function(a,b){var c;this.series=a;this.applyOptions(b);this.pointAttr={};if(a.options.colorByPoint){c=a.chart.options.colors;if(!this.options)this.options={};this.color=this.options.color=
125
+ this.color||c[Pb++];if(Pb>=c.length)Pb=0}a.chart.pointCount++;return this},applyOptions:function(a){var b=this.series;this.config=a;if(ec(a)||a===null)this.y=a;else if(Kb(a)&&!ec(a.length)){pa(this,a);this.options=a}else if(Qb(a[0])){this.name=a[0];this.y=a[1]}else if(ec(a[0])){this.x=a[0];this.y=a[1]}if(this.x===Ua)this.x=b.autoIncrement()},destroy:function(){var a=this,b=a.series,c;b.chart.pointCount--;a===b.chart.hoverPoint&&a.onMouseOut();b.chart.hoverPoints=null;Gb(a);t(["graphic","tracker",
126
+ "group","dataLabel","connector"],function(d){a[d]&&a[d].destroy()});a.legendItem&&a.series.chart.legend.destroyItem(a);for(c in a)a[c]=null},getLabelConfig:function(){return{x:this.category,y:this.y,series:this.series,point:this,percentage:this.percentage,total:this.total||this.stackTotal}},select:function(a,b){var c=this,d=c.series.chart;c.selected=a=B(a,!c.selected);c.firePointEvent(a?"select":"unselect");c.setState(a&&"select");b||t(d.getSelectedPoints(),function(e){if(e.selected&&e!==c){e.selected=
127
+ false;e.setState(hb);e.firePointEvent("unselect")}})},onMouseOver:function(){var a=this.series.chart,b=a.tooltip,c=a.hoverPoint;c&&c!==this&&c.onMouseOut();this.firePointEvent("mouseOver");b&&!b.shared&&b.refresh(this);this.setState(Ab);a.hoverPoint=this},onMouseOut:function(){this.firePointEvent("mouseOut");this.setState();this.series.chart.hoverPoint=null},tooltipFormatter:function(a){var b=this.series;return['<span style="color:'+b.color+'">',this.name||b.name,"</span>: ",!a?"<b>x = "+(this.name||
128
+ this.x)+",</b> ":"","<b>",!a?"y = ":"",this.y,"</b>"].join("")},update:function(a,b,c){var d=this,e=d.series,f=d.graphic,g=e.chart;b=B(b,true);d.firePointEvent("update",{options:a},function(){d.applyOptions(a);if(Kb(a)){e.getAttribs();f&&f.attr(d.pointAttr[e.state])}e.isDirty=true;b&&g.redraw(c)})},remove:function(a,b){var c=this,d=c.series,e=d.chart,f=d.data;fc(b,e);a=B(a,true);c.firePointEvent("remove",null,function(){rc(f,c);c.destroy();d.isDirty=true;a&&e.redraw()})},firePointEvent:function(a,
129
+ b,c){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)c=function(f){d.select(null,f.ctrlKey||f.metaKey||f.shiftKey)};Pa(this,a,b,c)},importEvents:function(){if(!this.hasImportedEvents){var a=sa(this.series.options.point,this.options).events,b;this.events=a;for(b in a)Sa(this,b,a[b]);this.hasImportedEvents=true}},setState:function(a){var b=this.series,c=b.options.states,d=xb[b.type].marker&&
130
+ b.options.marker,e=d&&!d.enabled,f=(d=d&&d.states[a])&&d.enabled===false,g=b.stateMarkerGraphic,h=b.chart,j=this.pointAttr;a=a||hb;if(!(a===this.state||this.selected&&a!=="select"||c[a]&&c[a].enabled===false||a&&(f||e&&!d.enabled))){if(this.graphic)this.graphic.attr(j[a]);else{if(a){if(!g)b.stateMarkerGraphic=g=h.renderer.circle(0,0,j[a].r).attr(j[a]).add(b.group);g.translate(this.plotX,this.plotY)}if(g)g[a?"show":"hide"]()}this.state=a}}};var pb=function(){};pb.prototype={isCartesian:true,type:"line",
131
+ pointClass:Bc,pointAttrToOptions:{stroke:"lineColor","stroke-width":"lineWidth",fill:"fillColor",r:"radius"},init:function(a,b){var c,d;d=a.series.length;this.chart=a;b=this.setOptions(b);pa(this,{index:d,options:b,name:b.name||"Series "+(d+1),state:hb,pointAttr:{},visible:b.visible!==false,selected:b.selected===true});d=b.events;for(c in d)Sa(this,c,d[c]);if(d&&d.click||b.point&&b.point.events&&b.point.events.click||b.allowPointSelect)a.runTrackerClick=true;this.getColor();this.getSymbol();this.setData(b.data,
132
+ false)},autoIncrement:function(){var a=this.options,b=this.xIncrement;b=B(b,a.pointStart,0);this.pointInterval=B(this.pointInterval,a.pointInterval,1);this.xIncrement=b+this.pointInterval;return b},cleanData:function(){var a=this.chart,b=this.data,c,d,e=a.smallestInterval,f,g;b.sort(function(h,j){return h.x-j.x});if(this.options.connectNulls)for(g=b.length-1;g>=0;g--)b[g].y===null&&b[g-1]&&b[g+1]&&b.splice(g,1);for(g=b.length-1;g>=0;g--)if(b[g-1]){f=b[g].x-b[g-1].x;if(f>0&&(d===Ua||f<d)){d=f;c=g}}if(e===
133
+ Ua||d<e)a.smallestInterval=d;this.closestPoints=c},getSegments:function(){var a=-1,b=[],c=this.data;t(c,function(d,e){if(d.y===null){e>a+1&&b.push(c.slice(a+1,e));a=e}else e===c.length-1&&b.push(c.slice(a+1,e+1))});this.segments=b},setOptions:function(a){var b=this.chart.options.plotOptions;return sa(b[this.type],b.series,a)},getColor:function(){var a=this.chart.options.colors;this.color=this.options.color||a[Pb++]||"#0000ff";if(Pb>=a.length)Pb=0},getSymbol:function(){var a=this.chart.options.symbols;
134
+ this.symbol=this.options.marker.symbol||a[Yc++];if(Yc>=a.length)Yc=0},addPoint:function(a,b,c,d){var e=this.data,f=this.graph,g=this.area,h=this.chart;a=(new this.pointClass).init(this,a);fc(d,h);if(f&&c)f.shift=c;if(g){g.shift=c;g.isArea=true}b=B(b,true);e.push(a);c&&e[0].remove(false);this.getAttribs();this.isDirty=true;b&&h.redraw()},setData:function(a,b){var c=this,d=c.data,e=c.initialColor,f=c.chart,g=d&&d.length||0;c.xIncrement=null;if(J(e))Pb=e;for(a=nc(sc(a||[]),function(h){return(new c.pointClass).init(c,
135
+ h)});g--;)d[g].destroy();c.data=a;c.cleanData();c.getSegments();c.getAttribs();c.isDirty=true;f.isDirtyBox=true;B(b,true)&&f.redraw(false)},remove:function(a,b){var c=this,d=c.chart;a=B(a,true);if(!c.isRemoving){c.isRemoving=true;Pa(c,"remove",null,function(){c.destroy();d.isDirtyLegend=d.isDirtyBox=true;a&&d.redraw(b)})}c.isRemoving=false},translate:function(){for(var a=this.chart,b=this.options.stacking,c=this.xAxis.categories,d=this.yAxis,e=this.data,f=e.length;f--;){var g=e[f],h=g.x,j=g.y,l=g.low,
136
+ n=d.stacks[(j<0?"-":"")+this.stackKey];g.plotX=this.xAxis.translate(h);if(b&&this.visible&&n&&n[h]){l=n[h];h=l.total;l.cum=l=l.cum-j;j=l+j;if(b==="percent"){l=h?l*100/h:0;j=h?j*100/h:0}g.percentage=h?g.y*100/h:0;g.stackTotal=h}if(J(l))g.yBottom=d.translate(l,0,1,0,1);if(j!==null)g.plotY=d.translate(j,0,1,0,1);g.clientX=a.inverted?a.plotHeight-g.plotX:g.plotX;g.category=c&&c[g.x]!==Ua?c[g.x]:g.x}},setTooltipPoints:function(a){var b=this.chart,c=b.inverted,d=[],e=X((c?b.plotTop:b.plotLeft)+b.plotSizeX),
137
+ f,g,h=[];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,l){f=d[l-1]?d[l-1]._high+1:0;for(g=j._high=d[l+1]?kb((j.plotX+(d[l+1]?d[l+1].plotX:e))/2):e;f<=g;)h[c?e-f++:f++]=j});this.tooltipPoints=h},onMouseOver:function(){var a=this.chart,b=a.hoverSeries;if(!(!Nb&&a.mouseIsDown)){b&&b!==this&&b.onMouseOut();this.options.events.mouseOver&&Pa(this,"mouseOver");this.tracker&&this.tracker.toFront();this.setState(Ab);
138
+ a.hoverSeries=this}},onMouseOut:function(){var a=this.options,b=this.chart,c=b.tooltip,d=b.hoverPoint;d&&d.onMouseOut();this&&a.events.mouseOut&&Pa(this,"mouseOut");c&&!a.stickyTracking&&c.hide();this.setState();b.hoverSeries=null},animate:function(a){var b=this.chart,c=this.clipRect,d=this.options.animation;if(d&&!Kb(d))d={};if(a){if(!c.isAnimating){c.attr("width",0);c.isAnimating=true}}else{c.animate({width:b.plotSizeX},d);this.animate=null}},drawPoints:function(){var a,b=this.data,c=this.chart,
139
+ d,e,f,g,h,j;if(this.options.marker.enabled)for(f=b.length;f--;){g=b[f];d=g.plotX;e=g.plotY;j=g.graphic;if(e!==Ua&&!isNaN(e)){a=g.pointAttr[g.selected?"select":hb];h=a.r;if(j)j.animate({x:d,y:e,r:h});else g.graphic=c.renderer.symbol(B(g.marker&&g.marker.symbol,this.symbol),d,e,h).attr(a).add(this.group)}}},convertAttribs:function(a,b,c,d){var e=this.pointAttrToOptions,f,g,h={};a=a||{};b=b||{};c=c||{};d=d||{};for(f in e){g=e[f];h[f]=B(a[g],b[f],c[f],d[f])}return h},getAttribs:function(){var a=this,
140
+ b=xb[a.type].marker?a.options.marker:a.options,c=b.states,d=c[Ab],e,f=a.color,g={stroke:f,fill:f},h=a.data,j=[],l,n=a.pointAttrToOptions,C;if(a.options.marker){d.radius=d.radius||b.radius+2;d.lineWidth=d.lineWidth||b.lineWidth+1}else d.color=d.color||$b(d.color||f).brighten(d.brightness).get();j[hb]=a.convertAttribs(b,g);t([Ab,"select"],function(G){j[G]=a.convertAttribs(c[G],j[hb])});a.pointAttr=j;for(f=h.length;f--;){g=h[f];if((b=g.options&&g.options.marker||g.options)&&b.enabled===false)b.radius=
141
+ 0;e=false;if(g.options)for(C in n)if(J(b[n[C]]))e=true;if(e){l=[];c=b.states||{};e=c[Ab]=c[Ab]||{};if(!a.options.marker)e.color=$b(e.color||g.options.color).brighten(e.brightness||d.brightness).get();l[hb]=a.convertAttribs(b,j[hb]);l[Ab]=a.convertAttribs(c[Ab],j[Ab],l[hb]);l.select=a.convertAttribs(c.select,j.select,l[hb])}else l=j;g.pointAttr=l}},destroy:function(){var a=this,b=a.chart,c=/\/5[0-9\.]+ (Safari|Mobile)\//.test(qc),d,e;Gb(a);a.legendItem&&a.chart.legend.destroyItem(a);t(a.data,function(f){f.destroy()});
142
+ t(["area","graph","dataLabelsGroup","group","tracker"],function(f){if(a[f]){d=c&&f==="group"?"hide":"destroy";a[f][d]()}});if(b.hoverSeries===a)b.hoverSeries=null;rc(b.series,a);for(e in a)delete a[e]},drawDataLabels:function(){if(this.options.dataLabels.enabled){var a=this,b,c,d=a.data,e=a.options.dataLabels,f,g=a.dataLabelsGroup,h=a.chart,j=h.inverted,l=a.type,n;n=a.options.stacking;var C=l==="column"||l==="bar",G=e.verticalAlign===null,fa=e.y===null;if(C)if(n){if(G)e=sa(e,{verticalAlign:"middle"});
143
+ if(fa)e=sa(e,{y:{top:14,middle:4,bottom:-6}[e.verticalAlign]})}else{if(G)e=sa(e,{verticalAlign:"top"});if(fa)e=sa(e,{y:-6})}if(!g)g=a.dataLabelsGroup=h.renderer.g("data-labels").attr({visibility:a.visible?ub:gb,zIndex:6}).translate(h.plotLeft,h.plotTop).add();n=e.color;if(n==="auto")n=null;e.style.color=B(n,a.color);t(d,function(K){var ia=K.barX,u=ia&&ia+K.barW/2||K.plotX||-999,P=B(K.plotY,-999),O=K.dataLabel,Q=e.align;f=e.formatter.call(K.getLabelConfig());b=(j?h.plotWidth-P:u)+e.x;c=(j?h.plotHeight-
144
+ u:P)+e.y;if(l==="column")b+={left:-1,right:1}[Q]*K.barW/2||0;if(O){if(j&&!e.y)c=c+la(O.styles.lineHeight)*0.9-O.getBBox().height/2;O.attr({text:f}).animate({x:b,y:c})}else if(J(f)){O=K.dataLabel=h.renderer.text(f,b,c).attr({align:Q,rotation:e.rotation,zIndex:1}).css(e.style).add(g);j&&!e.y&&O.attr({y:c+la(O.styles.lineHeight)*0.9-O.getBBox().height/2})}if(C&&a.options.stacking){u=K.barY;P=K.barW;K=K.barH;O.align(e,null,{x:j?h.plotWidth-u-K:ia,y:j?h.plotHeight-ia-P:u,width:j?K:P,height:j?P:K})}})}},
145
+ drawGraph:function(){var a=this,b=a.options,c=a.graph,d=[],e,f=a.area,g=a.group,h=b.lineColor||a.color,j=b.lineWidth,l=b.dashStyle,n,C=a.chart.renderer,G=a.yAxis.getThreshold(b.threshold||0),fa=/^area/.test(a.type),K=[],ia=[];t(a.segments,function(u){n=[];t(u,function(H,S){if(a.getPointSpline)n.push.apply(n,a.getPointSpline(u,H,S));else{n.push(S?Ja:Za);S&&b.step&&n.push(H.plotX,u[S-1].plotY);n.push(H.plotX,H.plotY)}});if(u.length>1)d=d.concat(n);else K.push(u[0]);if(fa){var P=[],O,Q=n.length;for(O=
146
+ 0;O<Q;O++)P.push(n[O]);Q===3&&P.push(Ja,n[1],n[2]);if(b.stacking&&a.type!=="areaspline")for(O=u.length-1;O>=0;O--)P.push(u[O].plotX,u[O].yBottom);else P.push(Ja,u[u.length-1].plotX,G,Ja,u[0].plotX,G);ia=ia.concat(P)}});a.graphPath=d;a.singlePoints=K;if(fa){e=B(b.fillColor,$b(a.color).setOpacity(b.fillOpacity||0.75).get());if(f)f.animate({d:ia});else a.area=a.chart.renderer.path(ia).attr({fill:e}).add(g)}if(c)c.animate({d:d});else if(j){c={stroke:h,"stroke-width":j};if(l)c.dashstyle=l;a.graph=C.path(d).attr(c).add(g).shadow(b.shadow)}},
147
+ render:function(){var a=this,b=a.chart,c,d,e=a.options,f=e.animation,g=f&&a.animate;f=g?f&&f.duration||500:0;var h=a.clipRect;d=b.renderer;if(!h){h=a.clipRect=!b.hasRendered&&b.clipRect?b.clipRect:d.clipRect(0,0,b.plotSizeX,b.plotSizeY);if(!b.clipRect)b.clipRect=h}if(!a.group){c=a.group=d.g("series");if(b.inverted){d=function(){c.attr({width:b.plotWidth,height:b.plotHeight}).invert()};d();Sa(b,"resize",d)}c.clip(a.clipRect).attr({visibility:a.visible?ub:gb,zIndex:e.zIndex}).translate(b.plotLeft,b.plotTop).add(b.seriesGroup)}a.drawDataLabels();
148
+ g&&a.animate(true);a.drawGraph&&a.drawGraph();a.drawPoints();a.options.enableMouseTracking!==false&&a.drawTracker();g&&a.animate();setTimeout(function(){h.isAnimating=false;if((c=a.group)&&h!==b.clipRect&&h.renderer){c.clip(a.clipRect=b.clipRect);h.destroy()}},f);a.isDirty=false},redraw:function(){var a=this.chart,b=this.group;if(b){a.inverted&&b.attr({width:a.plotWidth,height:a.plotHeight});b.animate({translateX:a.plotLeft,translateY:a.plotTop})}this.translate();this.setTooltipPoints(true);this.render()},
149
+ setState:function(a){var b=this.options,c=this.graph,d=b.states;b=b.lineWidth;a=a||hb;if(this.state!==a){this.state=a;if(!(d[a]&&d[a].enabled===false)){if(a)b=d[a].lineWidth||b+1;if(c&&!c.dashstyle)c.attr({"stroke-width":b},a?0:500)}}},setVisible:function(a,b){var c=this.chart,d=this.legendItem,e=this.group,f=this.tracker,g=this.dataLabelsGroup,h,j=this.data,l=c.options.chart.ignoreHiddenSeries;h=this.visible;h=(this.visible=a=a===Ua?!h:a)?"show":"hide";e&&e[h]();if(f)f[h]();else for(e=j.length;e--;){f=
150
+ j[e];f.tracker&&f.tracker[h]()}g&&g[h]();d&&c.legend.colorizeItem(this,a);this.isDirty=true;this.options.stacking&&t(c.series,function(n){if(n.options.stacking&&n.visible)n.isDirty=true});if(l)c.isDirtyBox=true;b!==false&&c.redraw();Pa(this,h)},show:function(){this.setVisible(true)},hide:function(){this.setVisible(false)},select:function(a){this.selected=a=a===Ua?!this.selected:a;if(this.checkbox)this.checkbox.checked=a;Pa(this,a?"select":"unselect")},drawTracker:function(){var a=this,b=a.options,
151
+ c=[].concat(a.graphPath),d=c.length,e=a.chart,f=e.options.tooltip.snap,g=a.tracker,h=b.cursor;h=h&&{cursor:h};var j=a.singlePoints,l;if(d)for(l=d+1;l--;){c[l]===Za&&c.splice(l+1,0,c[l+1]-f,c[l+2],Ja);if(l&&c[l]===Za||l===d)c.splice(l,0,Ja,c[l-2]+f,c[l-1])}for(l=0;l<j.length;l++){d=j[l];c.push(Za,d.plotX-f,d.plotY,Ja,d.plotX+f,d.plotY)}if(g)g.attr({d:c});else a.tracker=e.renderer.path(c).attr({isTracker:true,stroke:Xd,fill:jb,"stroke-width":b.lineWidth+2*f,visibility:a.visible?ub:gb,zIndex:1}).on(Nb?
152
+ "touchstart":"mouseover",function(){e.hoverSeries!==a&&a.onMouseOver()}).on("mouseout",function(){b.stickyTracking||a.onMouseOut()}).css(h).add(e.trackerGroup)}};ka=yb(pb);vb.line=ka;ka=yb(pb,{type:"area"});vb.area=ka;ka=yb(pb,{type:"spline",getPointSpline:function(a,b,c){var d=b.plotX,e=b.plotY,f=a[c-1],g=a[c+1],h,j,l,n;if(c&&c<a.length-1){a=f.plotY;l=g.plotX;g=g.plotY;var C;h=(1.5*d+f.plotX)/2.5;j=(1.5*e+a)/2.5;l=(1.5*d+l)/2.5;n=(1.5*e+g)/2.5;C=(n-j)*(l-d)/(l-h)+e-n;j+=C;n+=C;if(j>a&&j>e){j=Fa(a,
153
+ e);n=2*e-j}else if(j<a&&j<e){j=qb(a,e);n=2*e-j}if(n>g&&n>e){n=Fa(g,e);j=2*e-n}else if(n<g&&n<e){n=qb(g,e);j=2*e-n}b.rightContX=l;b.rightContY=n}if(c){b=["C",f.rightContX||f.plotX,f.rightContY||f.plotY,h||d,j||e,d,e];f.rightContX=f.rightContY=null}else b=[Za,d,e];return b}});vb.spline=ka;ka=yb(ka,{type:"areaspline"});vb.areaspline=ka;var cd=yb(pb,{type:"column",pointAttrToOptions:{stroke:"borderColor","stroke-width":"borderWidth",fill:"color",r:"borderRadius"},init:function(){pb.prototype.init.apply(this,
154
+ arguments);var a=this,b=a.chart;b.hasColumn=true;b.hasRendered&&t(b.series,function(c){if(c.type===a.type)c.isDirty=true})},translate:function(){var a=this,b=a.chart,c=a.options,d=c.stacking,e=c.borderWidth,f=0,g=a.xAxis.reversed,h=a.xAxis.categories,j={},l,n;pb.prototype.translate.apply(a);t(b.series,function(H){if(H.type===a.type&&H.visible){if(H.options.stacking){l=H.stackKey;if(j[l]===Ua)j[l]=f++;n=j[l]}else n=f++;H.columnIndex=n}});var C=a.data,G=a.closestPoints;h=db(C[1]?C[G].plotX-C[G-1].plotX:
155
+ b.plotSizeX/(h&&h.length||1));G=h*c.groupPadding;var fa=(h-2*G)/f,K=c.pointWidth,ia=J(K)?(fa-K)/2:fa*c.pointPadding,u=Fa(B(K,fa-2*ia),1),P=ia+(G+((g?f-a.columnIndex:a.columnIndex)||0)*fa-h/2)*(g?-1:1),O=a.yAxis.getThreshold(c.threshold||0),Q=B(c.minPointLength,5);t(C,function(H){var S=H.plotY,Ta=H.yBottom||O,cb=H.plotX+P,Ib=hd(qb(S,Ta)),Jb=hd(Fa(S,Ta)-Ib),Ob=a.yAxis.stacks[(H.y<0?"-":"")+a.stackKey],Hb;d&&a.visible&&Ob&&Ob[H.x]&&Ob[H.x].setOffset(P,u);if(db(Jb)<Q){if(Q){Jb=Q;Ib=db(Ib-O)>Q?Ta-Q:O-
156
+ (S<=O?Q:0)}Hb=Ib-3}pa(H,{barX:cb,barY:Ib,barW:u,barH:Jb});H.shapeType="rect";S=pa(b.renderer.Element.prototype.crisp.apply({},[e,cb,Ib,u,Jb]),{r:c.borderRadius});if(e%2){S.y-=1;S.height+=1}H.shapeArgs=S;H.trackerArgs=J(Hb)&&sa(H.shapeArgs,{height:Fa(6,Jb+3),y:Hb})})},getSymbol:function(){},drawGraph:function(){},drawPoints:function(){var a=this,b=a.options,c=a.chart.renderer,d,e;t(a.data,function(f){var g=f.plotY;if(g!==Ua&&!isNaN(g)&&f.y!==null){d=f.graphic;e=f.shapeArgs;if(d){Uc(d);d.animate(e)}else f.graphic=
157
+ c[f.shapeType](e).attr(f.pointAttr[f.selected?"select":hb]).add(a.group).shadow(b.shadow)}})},drawTracker:function(){var a=this,b=a.chart,c=b.renderer,d,e,f=+new Date,g=a.options.cursor,h=g&&{cursor:g},j;t(a.data,function(l){e=l.tracker;d=l.trackerArgs||l.shapeArgs;delete d.strokeWidth;if(l.y!==null)if(e)e.attr(d);else l.tracker=c[l.shapeType](d).attr({isTracker:f,fill:Xd,visibility:a.visible?ub:gb,zIndex:1}).on(Nb?"touchstart":"mouseover",function(n){j=n.relatedTarget||n.fromElement;b.hoverSeries!==
158
+ a&&Ca(j,"isTracker")!==f&&a.onMouseOver();l.onMouseOver()}).on("mouseout",function(n){if(!a.options.stickyTracking){j=n.relatedTarget||n.toElement;Ca(j,"isTracker")!==f&&a.onMouseOut()}}).css(h).add(l.group||b.trackerGroup)})},animate:function(a){var b=this,c=b.data;if(!a){t(c,function(d){var e=d.graphic;d=d.shapeArgs;if(e){e.attr({height:0,y:b.yAxis.translate(0,0,1)});e.animate({height:d.height,y:d.y},b.options.animation)}});b.animate=null}},remove:function(){var a=this,b=a.chart;b.hasRendered&&
159
+ t(b.series,function(c){if(c.type===a.type)c.isDirty=true});pb.prototype.remove.apply(a,arguments)}});vb.column=cd;ka=yb(cd,{type:"bar",init:function(a){a.inverted=this.inverted=true;cd.prototype.init.apply(this,arguments)}});vb.bar=ka;ka=yb(pb,{type:"scatter",translate:function(){var a=this;pb.prototype.translate.apply(a);t(a.data,function(b){b.shapeType="circle";b.shapeArgs={x:b.plotX,y:b.plotY,r:a.chart.options.tooltip.snap}})},drawTracker:function(){var a=this,b=a.options.cursor,c=b&&{cursor:b},
160
+ 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(c)})},cleanData:function(){}});vb.scatter=ka;ka=yb(Bc,{init:function(){Bc.prototype.init.apply(this,arguments);var a=this,b;pa(a,{visible:a.visible!==false,name:B(a.name,"Slice")});b=function(){a.slice()};Sa(a,"select",b);Sa(a,"unselect",b);return a},setVisible:function(a){var b=this.series.chart,c=this.tracker,
161
+ d=this.dataLabel,e=this.connector,f;f=(this.visible=a=a===Ua?!this.visible:a)?"show":"hide";this.group[f]();c&&c[f]();d&&d[f]();e&&e[f]();this.legendItem&&b.legend.colorizeItem(this,a)},slice:function(a,b,c){var d=this.series.chart,e=this.slicedTranslation;fc(c,d);B(b,true);a=this.sliced=J(a)?a:!this.sliced;a={translateX:a?e[0]:d.plotLeft,translateY:a?e[1]:d.plotTop};this.group.animate(a);this.shadowGroup&&this.shadowGroup.animate(a)}});ka=yb(pb,{type:"pie",isCartesian:false,pointClass:ka,pointAttrToOptions:{stroke:"borderColor",
162
+ "stroke-width":"borderWidth",fill:"color"},getColor:function(){this.initialColor=Pb},animate:function(){var a=this;t(a.data,function(b){var c=b.graphic;b=b.shapeArgs;var d=-Zb/2;if(c){c.attr({r:0,start:d,end:d});c.animate({r:b.r,start:b.start,end:b.end},a.options.animation)}});a.animate=null},translate:function(){var a=0,b=-0.25,c=this.options,d=c.slicedOffset,e=d+c.borderWidth,f=c.center.concat([c.size,c.innerSize||0]),g=this.chart,h=g.plotWidth,j=g.plotHeight,l,n,C,G=this.data,fa=2*Zb,K,ia=qb(h,
163
+ j),u,P,O,Q=c.dataLabels.distance;f=nc(f,function(H,S){return(u=/%$/.test(H))?[h,j,ia,ia][S]*la(H)/100:H});this.getX=function(H,S){C=ta.asin((H-f[1])/(f[2]/2+Q));return f[0]+(S?-1:1)*nb(C)*(f[2]/2+Q)};this.center=f;t(G,function(H){a+=H.y});t(G,function(H){K=a?H.y/a:0;l=X(b*fa*1E3)/1E3;b+=K;n=X(b*fa*1E3)/1E3;H.shapeType="arc";H.shapeArgs={x:f[0],y:f[1],r:f[2]/2,innerR:f[3]/2,start:l,end:n};C=(n+l)/2;H.slicedTranslation=nc([nb(C)*d+g.plotLeft,Bb(C)*d+g.plotTop],X);P=nb(C)*f[2]/2;O=Bb(C)*f[2]/2;H.tooltipPos=
164
+ [f[0]+P*0.7,f[1]+O*0.7];H.labelPos=[f[0]+P+nb(C)*Q,f[1]+O+Bb(C)*Q,f[0]+P+nb(C)*e,f[1]+O+Bb(C)*e,f[0]+P,f[1]+O,Q<0?"center":C<fa/4?"left":"right",C];H.percentage=K*100;H.total=a});this.setTooltipPoints()},render:function(){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,b=a.renderer,c,d,e,f=this.options.shadow,g,h;t(this.data,function(j){d=
165
+ j.graphic;h=j.shapeArgs;e=j.group;g=j.shadowGroup;if(f&&!g)g=j.shadowGroup=b.g("shadow").attr({zIndex:4}).add();if(!e)e=j.group=b.g("point").attr({zIndex:5}).add();c=j.sliced?j.slicedTranslation:[a.plotLeft,a.plotTop];e.translate(c[0],c[1]);g&&g.translate(c[0],c[1]);if(d)d.animate(h);else j.graphic=b.arc(h).attr(pa(j.pointAttr[hb],{"stroke-linejoin":"round"})).add(j.group).shadow(f,g);j.visible===false&&j.setVisible(false)})},drawDataLabels:function(){var a=this.data,b,c=this.chart,d=this.options.dataLabels,
166
+ e=B(d.connectorPadding,10),f=B(d.connectorWidth,1),g,h,j=d.distance>0,l,n,C=this.center[1],G=[[],[],[],[]],fa,K,ia,u,P,O,Q,H=4,S;pb.prototype.drawDataLabels.apply(this);t(a,function(Ta){var cb=Ta.labelPos[7];G[cb<0?0:cb<Zb/2?1:cb<Zb?2:3].push(Ta)});G[1].reverse();G[3].reverse();for(Q=function(Ta,cb){return Ta.y>cb.y};H--;){a=0;b=[].concat(G[H]);b.sort(Q);for(S=b.length;S--;)b[S].rank=S;for(u=0;u<2;u++){n=(O=H%3)?9999:-9999;P=O?-1:1;for(S=0;S<G[H].length;S++){b=G[H][S];if(g=b.dataLabel){h=b.labelPos;
167
+ ia=ub;fa=h[0];K=h[1];l||(l=g&&g.getBBox().height);if(j)if(u&&b.rank<a)ia=gb;else if(!O&&K<n+l||O&&K>n-l){K=n+P*l;fa=this.getX(K,H>1);if(!O&&K+l>C||O&&K-l<C)if(u)ia=gb;else a++}if(b.visible===false)ia=gb;if(ia===ub)n=K;if(u){g.attr({visibility:ia,align:h[6]})[g.moved?"animate":"attr"]({x:fa+d.x+({left:e,right:-e}[h[6]]||0),y:K+d.y});g.moved=true;if(j&&f){g=b.connector;h=[Za,fa+(h[6]==="left"?5:-5),K,Ja,fa,K,Ja,h[2],h[3],Ja,h[4],h[5]];if(g){g.animate({d:h});g.attr("visibility",ia)}else b.connector=
168
+ g=this.chart.renderer.path(h).attr({"stroke-width":f,stroke:d.connectorColor||"#606060",visibility:ia,zIndex:3}).translate(c.plotLeft,c.plotTop).add()}}}}}}},drawTracker:cd.prototype.drawTracker,getSymbol:function(){}});vb.pie=ka;ab.Highcharts={Chart:Hd,dateFormat:Oc,pathAnim:bd,getOptions:function(){return Va},numberFormat:Bd,Point:Bc,Color:$b,Renderer:Xc,seriesTypes:vb,setOptions:function(a){Va=sa(Va,a);Cd();return Va},Series:pb,addEvent:Sa,createElement:ib,discardElement:Hc,css:La,each:t,extend:pa,
169
+ map:nc,merge:sa,pick:B,extendClass:yb,version:"2.1.5"}})();
@@ -0,0 +1,14 @@
1
+ require 'rails'
2
+
3
+ module RailsHighcharts
4
+ class Engine < Rails::Engine
5
+
6
+ # ========================================
7
+ # = javascript_include_tag :highcharts =
8
+ # ========================================
9
+ config.before_initialize do
10
+ config.action_view.javascript_expansions[:highcharts] = %w(highcharts/highcharts.js)
11
+ end
12
+
13
+ end
14
+ end
@@ -0,0 +1,31 @@
1
+ # =======================================================
2
+ # h = {:a=>1, :b=>{:c=>3, :d=>{:e=>4}}} =
3
+ # h1 = {:a=>1, :b=>{:g=>6, :d=>{:f=>5}}} =
4
+ # a = h.merge_recursive(h1) =
5
+ # a = {:a=>1, :b=>{:c=>3, :d=>{:e=>4, :f=>5}, :g=>6}} =
6
+ # =======================================================
7
+
8
+ module HashExtend
9
+
10
+ # extend the Hash class to allow for recursive merging
11
+ def merge_recursive(hash)
12
+ result = Marshal.load(Marshal.dump(self))
13
+
14
+ hash.keys.each do |key|s
15
+ if hash[key].is_a?(Hash) and self[key].is_a?(Hash)
16
+ result[key] = result[key].deep_merge(hash[key])
17
+ next
18
+ end
19
+ result[key] = hash[key]
20
+ end
21
+
22
+ # return the merged result hash
23
+ result
24
+ end
25
+
26
+ end #Hash
27
+
28
+ class Hash
29
+ include HashExtend
30
+ end
31
+
@@ -0,0 +1,3 @@
1
+ module RailsHighcharts
2
+ VERSION = "0.0.1.beta1"
3
+ end
@@ -0,0 +1,335 @@
1
+ require "rails"
2
+ require "rails_highcharts/engine"
3
+ require "rails_highcharts/version"
4
+ require "rails_highcharts/hash_extend"
5
+
6
+ class RailsHighcharts
7
+
8
+ @@types = ['area', 'areaspline', 'bar', 'column', 'line', 'pie', 'scatter', 'spline']
9
+ @@date_format = "<strong>%A</strong><br /> %m/%d/%Y"
10
+
11
+ attr_accessor :chart, :colors, :credits, :labels, :lang, :legend, :plotOptions, :point,
12
+ :series, :subtitle, :symbols, :title, :toolbar, :tooltip, :x_axis, :y_axis
13
+
14
+ def self.method_missing(m, options={})
15
+ format = options[:format] || 'jquery'
16
+ options.delete(:format)
17
+
18
+ # create the chart and return it in the format requested
19
+ if @@types.include?(m.to_s)
20
+ chart = new(options.merge!({:type => m}))
21
+ chart.send(format)
22
+ else
23
+ "#{m} is not a supported chart format, please use one of the following: #{supported_types}."
24
+ end
25
+ end
26
+
27
+ def initialize(options={})
28
+ # override highcharts defaults
29
+ @credits = {
30
+ :enabled => false
31
+ }
32
+ @legend = {
33
+ :layout => 'vertical',
34
+ :style => {
35
+ :left => 'auto',
36
+ :bottom => 'auto',
37
+ :right => '50px',
38
+ :top => '75px'
39
+ }
40
+ }
41
+
42
+ # IE7 displays 'null' without this
43
+ @title = {
44
+ :text => ""
45
+ }
46
+ @x_axis = {
47
+ :title => {
48
+ :text => ""
49
+ }
50
+ }
51
+ @y_axis = {
52
+ :title => {
53
+ :text => ""
54
+ }
55
+ }
56
+
57
+ # define defaults based on chart type
58
+ case options[:type].to_s
59
+ when 'area'
60
+ @chart = {
61
+ :defaultSeriesType => 'area',
62
+ :margin => [50, 200, 60, 80]
63
+ }
64
+ when 'areaspline'
65
+ @chart = {
66
+ :defaultSeriesType => 'areaspline',
67
+ :margin => [50, 200, 60, 80]
68
+ }
69
+ when 'bar'
70
+ @chart = {
71
+ :inverted => true,
72
+ :defaultSeriesType => 'bar',
73
+ :margin => [50, 50, 50, 100]
74
+ }
75
+ @plotOptions = {
76
+ :bar => {
77
+ :showInLegend => false,
78
+ :dataLabels => {
79
+ :y => -5,
80
+ :enabled => true,
81
+ :color => '#666666'
82
+ }
83
+ }
84
+ }
85
+ when 'column'
86
+ @chart = {
87
+ :defaultSeriesType => 'column',
88
+ :margin => [50, 50, 50, 100]
89
+ }
90
+ @plotOptions = {
91
+ :column => {
92
+ :showInLegend => false
93
+ }
94
+ }
95
+ when 'line'
96
+ @chart = {
97
+ :defaultSeriesType => 'line',
98
+ :margin => [50, 200, 60, 80]
99
+ }
100
+ when 'pie'
101
+ @chart = {
102
+ :margin => [10, 10, 10, 10]
103
+ }
104
+ @plotOptions = {
105
+ :pie => {
106
+ :dataLabels => {
107
+ :enabled => true,
108
+ :color => 'white',
109
+ :style => {:font => '10pt Helvetica'}
110
+ }
111
+ }
112
+ }
113
+ when 'scatter'
114
+ @chart = {
115
+ :defaultSeriesType => 'scatter',
116
+ :margin => [50, 200, 60, 80]
117
+ }
118
+ @plotOptions = {
119
+ :scatter => {
120
+ :marker => {
121
+ :radius => 5,
122
+ :states => {
123
+ :hover => {
124
+ :enabled => true,
125
+ :lineColor => '#666666'
126
+ }
127
+ }
128
+ }
129
+ }
130
+ }
131
+ when 'spline'
132
+ @chart = {
133
+ :defaultSeriesType => 'spline',
134
+ :margin => [50, 200, 60, 80]
135
+ }
136
+ end
137
+
138
+ # set the options from provided hash
139
+ options.each do |attribute, value|
140
+ if value.is_a?(Hash)
141
+ # if provided a hash attempt to merge with defaults, otherwise just override defaults
142
+ send("#{attribute}=", (send(attribute) || {}).merge_recursive(value)) if self.respond_to?("#{attribute}=")
143
+ else
144
+ send("#{attribute.to_s}=", value) if self.respond_to?("#{attribute}=")
145
+ end
146
+ end
147
+ end
148
+
149
+ def self.supported_types
150
+ @@types.join(' ')
151
+ end
152
+
153
+ def jquery
154
+ query_params = instance_variables.sort.map do |var|
155
+ case var.to_s
156
+
157
+ when '@chart'
158
+ set_chart
159
+ when '@colors'
160
+ set_colors if @colors.is_a?(Array)
161
+ when '@credits'
162
+ set_credits
163
+ when '@labels'
164
+ set_labels
165
+ when '@lang'
166
+ set_lang
167
+ when '@legend'
168
+ set_legend
169
+ when '@plotOptions'
170
+ set_plotOptions
171
+ when '@point'
172
+ set_point
173
+ when '@series'
174
+ set_series
175
+ when '@subtitle'
176
+ set_subtitle
177
+ when '@symbols'
178
+ set_symbols
179
+ when '@title'
180
+ set_title
181
+ when '@toolbar'
182
+ set_toolbar
183
+ when '@tooltip'
184
+ set_tooltip
185
+ when '@x_axis'
186
+ set_x_axis
187
+ when '@y_axis'
188
+ set_y_axis
189
+ end
190
+ end.compact
191
+
192
+ "var chart = new Highcharts.Chart({
193
+ #{query_params.join(",\n")}
194
+ });"
195
+ end
196
+
197
+ private
198
+ def set_chart
199
+ "chart: {
200
+ #{concatenate_attributes(@chart)}
201
+ }"
202
+ end
203
+
204
+ def set_colors
205
+ "colors: [#{@colors.join(", ")}]"
206
+ end
207
+
208
+ def set_credits
209
+ "credits: {
210
+ #{concatenate_attributes(@credits)}
211
+ }"
212
+ end
213
+
214
+ def set_labels
215
+ "labels: {
216
+ #{concatenate_attributes(@labels)}
217
+ }"
218
+ end
219
+
220
+ def set_lang
221
+ "lang: {
222
+ #{concatenate_attributes(@lang)}
223
+ }"
224
+ end
225
+
226
+ def set_legend
227
+ "legend: {
228
+ #{concatenate_attributes(@legend)}
229
+ }"
230
+ end
231
+
232
+ def set_plotOptions
233
+ "plotOptions: {
234
+ #{concatenate_attributes(@plotOptions)}
235
+ }"
236
+ end
237
+
238
+ def set_point
239
+ "point: {
240
+ #{concatenate_attributes(@point)}
241
+ }"
242
+ end
243
+
244
+ def set_series
245
+ attrs = Array.new
246
+ @series.each do |series_hash|
247
+ ser = Array.new
248
+ series_hash.each do |key, value|
249
+ if key == 'data'
250
+ ser << "[#{concatenate_attributes(value)}]"
251
+ else
252
+ ser << "#{key}: #{typed_print(value)}"
253
+ end
254
+ end
255
+
256
+ attrs << "{#{ser.join(",\n")}}";
257
+ end
258
+
259
+ "series: [
260
+ #{attrs.join(",\n") + "\n"}
261
+ ]"
262
+ end
263
+
264
+ def set_subtitle
265
+ "subtitle: {
266
+ #{concatenate_attributes(@subtitle)}
267
+ }"
268
+ end
269
+
270
+ def set_symbols
271
+ "symbols: [#{@symbols.join(", ")}]"
272
+ end
273
+
274
+ def set_title
275
+ "title: {
276
+ #{concatenate_attributes(@title)}
277
+ }"
278
+ end
279
+
280
+ def set_toolbar
281
+ "toolbar: {
282
+ #{concatenate_attributes(@toolbar)}
283
+ }"
284
+ end
285
+
286
+ def set_tooltip
287
+ "tooltip: {
288
+ #{concatenate_attributes(@tooltip)}
289
+ }"
290
+ end
291
+
292
+ def set_x_axis
293
+ "xAxis: {
294
+ #{concatenate_attributes(@x_axis)}
295
+ }"
296
+ end
297
+
298
+ def set_y_axis
299
+ "yAxis: {
300
+ #{concatenate_attributes(@y_axis)}
301
+ }"
302
+ end
303
+
304
+ # generic method that accepts a hash and concatenates its key/value pairs
305
+ def concatenate_attributes(attr)
306
+ attrs = Array.new
307
+ attr.each do |key, value|
308
+ if value.is_a?(Hash)
309
+ attrs << "#{key}: {#{concatenate_attributes(value)}}"
310
+ else
311
+ attrs << "#{key}: #{typed_print(value)}"
312
+ end
313
+ end
314
+
315
+ attrs.join(",\n") + "\n"
316
+ end
317
+
318
+ # method determines if value needs to be surrounded in single quotes
319
+ def typed_print(string)
320
+ if string.is_a?(Hash)
321
+ values = Array.new
322
+ string.each { |key, value| values << "#{key}: #{typed_print(value)}"}
323
+ "{" + values.join(", ") + "}"
324
+ elsif string.is_a?(Array)
325
+ "[" + string.map { |e| typed_print(e) } .join(", ") + "]"
326
+ elsif string.is_a?(Date)
327
+ "'#{string.strftime(@@date_format)}'"
328
+ elsif string.is_a?(String) && string != 'null' && string.strip[0..7] != 'function'
329
+ "'" + string.gsub(/['"\\\x0]/,'\\\\\0') + "'"
330
+ else
331
+ string
332
+ end
333
+ end
334
+
335
+ end #RailsHighcharts
metadata ADDED
@@ -0,0 +1,95 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails_highcharts
3
+ version: !ruby/object:Gem::Version
4
+ hash: 62196393
5
+ prerelease: 6
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 1
10
+ - beta
11
+ - 1
12
+ version: 0.0.1.beta1
13
+ platform: ruby
14
+ authors:
15
+ - AlexZhang
16
+ autorequire:
17
+ bindir: bin
18
+ cert_chain: []
19
+
20
+ date: 2011-07-07 00:00:00 +08:00
21
+ default_executable:
22
+ dependencies:
23
+ - !ruby/object:Gem::Dependency
24
+ name: rails
25
+ prerelease: false
26
+ requirement: &id001 !ruby/object:Gem::Requirement
27
+ none: false
28
+ requirements:
29
+ - - ">="
30
+ - !ruby/object:Gem::Version
31
+ hash: 23
32
+ segments:
33
+ - 3
34
+ - 0
35
+ - 8
36
+ version: 3.0.8
37
+ type: :runtime
38
+ version_requirements: *id001
39
+ description: Highcharts for Rails 3
40
+ email:
41
+ - blackanger.z@gmail.com
42
+ executables: []
43
+
44
+ extensions: []
45
+
46
+ extra_rdoc_files:
47
+ - README.md
48
+ files:
49
+ - Gemfile
50
+ - Rakefile
51
+ - README.md
52
+ - lib/generators/rails_highcharts/install_generator.rb
53
+ - lib/generators/rails_highcharts/media/javascripts/highcharts.js
54
+ - lib/rails_highcharts/engine.rb
55
+ - lib/rails_highcharts/hash_extend.rb
56
+ - lib/rails_highcharts/version.rb
57
+ - lib/rails_highcharts.rb
58
+ has_rdoc: true
59
+ homepage: ""
60
+ licenses: []
61
+
62
+ post_install_message:
63
+ rdoc_options: []
64
+
65
+ require_paths:
66
+ - lib
67
+ required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
69
+ requirements:
70
+ - - ">="
71
+ - !ruby/object:Gem::Version
72
+ hash: 3
73
+ segments:
74
+ - 0
75
+ version: "0"
76
+ required_rubygems_version: !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ">"
80
+ - !ruby/object:Gem::Version
81
+ hash: 25
82
+ segments:
83
+ - 1
84
+ - 3
85
+ - 1
86
+ version: 1.3.1
87
+ requirements: []
88
+
89
+ rubyforge_project: rails_highcharts
90
+ rubygems_version: 1.6.2
91
+ signing_key:
92
+ specification_version: 3
93
+ summary: Highcharts for Rails 3
94
+ test_files: []
95
+