You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP →
Socket
Book a DemoInstallSign in
Socket

vue-chartkick

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue-chartkick - npm Package Compare versions

Comparing version

to
0.5.2

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 0.5.2
- Updated Chartkick.js to 3.1.1
## 0.5.1

@@ -2,0 +6,0 @@

4

dist/vue-chartkick.esm.js

@@ -5,3 +5,3 @@ /*

* https://github.com/ankane/vue-chartkick
* v0.5.1
* v0.5.2
* MIT License

@@ -115,3 +115,3 @@ */

Chartkick.version = "0.5.0";
Chartkick.version = "0.5.2"; // TODO remove in future versions
Chartkick.install = function(Vue, options) {

@@ -118,0 +118,0 @@ if (options && options.adapter) {

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).VueChartkick=e()}(this,function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t,e){return t(e={exports:{}},e.exports),e.exports}var r=t(function(t,e){t.exports=function(){function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t,e){var r;for(r in e)n(e[r])||i(e[r])?(n(e[r])&&!n(t[r])&&(t[r]={}),i(e[r])&&!i(t[r])&&(t[r]=[]),a(t[r],e[r])):void 0!==e[r]&&(t[r]=e[r])}function q(t,e){var r={};return a(r,t),a(r,e),r}var c=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i,d=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([.,]\d+)?($|Z|([+-])(\d\d)(:)?(\d\d)?)/i,h=String(1.5).charAt(1);function f(t){return""+t}function tt(t){return parseFloat(t)}function et(t){var e,r,n,a;if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{if(t=f(t),e=t.match(c))return r=parseInt(e[1],10),n=parseInt(e[3],10)-1,a=parseInt(e[5],10),new Date(r,n,a);var o=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=function(t){var e,r,n,a,o,i,s,c,l,u,p;if("[object Date]"===(u=Object.prototype.toString.call(t)))return t;if("[object String]"!==u)return;if(n=t.match(d))return p=parseInt(n[1],10),i=parseInt(n[3],10)-1,e=parseInt(n[5],10),r=parseInt(n[7],10),o=n[9]?parseInt(n[9],10):0,l=n[11]?parseInt(n[11],10):0,a=n[12]?1e3*parseFloat(h+n[12].slice(1)):0,c=Date.UTC(p,i,e,r,o,l,a),n[13]&&n[14]&&(s=60*n[15],n[17]&&(s+=parseInt(n[17],10)),s*="-"===n[14]?-1:1,c-=60*s*1e3),new Date(c)}(o)||new Date(t)}return t}function l(t){if(!i(t)){var e,r=[];for(e in t)t.hasOwnProperty(e)&&r.push([e,t[e]]);t=r}return t}function o(o,i,s,c,l,u,p,d){return function(t,e,r){var n=t.data,a=q({},o);return a=q(a,r||{}),(t.hideLegend||"legend"in e)&&i(a,e.legend,t.hideLegend),e.title&&s(a,e.title),"min"in e?c(a,e.min):function(t){var e,r,n;for(e=0;e<t.length;e++)for(n=t[e].data,r=0;r<n.length;r++)if(n[r][1]<0)return!0;return!1}(n)||c(a,0),e.max&&l(a,e.max),"stacked"in e&&u(a,e.stacked),e.colors&&(a.colors=e.colors),e.xtitle&&p(a,e.xtitle),e.ytitle&&d(a,e.ytitle),a=q(a,e.library||{})}}function y(t,e){return t[0].getTime()-e[0].getTime()}function m(t,e){return t[0]-e[0]}function rt(t,e){return t-e}function nt(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function at(t){return nt(t)&&0===t.getMinutes()}function ot(t){return at(t)&&0===t.getHours()}function it(t){return ot(t)&&1===t.getDate()}function u(t){return!isNaN(et(t))&&6<=f(t).length}function p(t){return"number"==typeof t}function g(t,e,r){if(t=t||"",r.prefix&&(e<0&&(e*=-1,t+="-"),t+=r.prefix),r.thousands||r.decimal){var n=(e=f(e)).split(".");e=n[0],r.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,r.thousands)),1<n.length&&(e+=(r.decimal||".")+n[1])}return t+e+(r.suffix||"")}function st(t,e,r){return r in e?e[r]:r in t.options?t.options[r]:null}var b={maintainAspectRatio:!1,animation:!1,tooltips:{displayColors:!1,callbacks:{}},legend:{},title:{fontSize:20,fontColor:"#333"}},v={scales:{yAxes:[{ticks:{maxTicksLimit:4},scaleLabel:{fontSize:16,fontColor:"#333"}}],xAxes:[{gridLines:{drawOnChartArea:!1},scaleLabel:{fontSize:16,fontColor:"#333"},time:{},ticks:{}}]}},ct=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],x=function(t,e,r){void 0!==e?(t.legend.display=!!e,e&&!0!==e&&(t.legend.position=e)):r&&(t.legend.display=!1)},z=function(t,e){t.title.display=!0,t.title.text=e},M=function(t,e){null!==e&&(t.scales.xAxes[0].ticks.min=tt(e))},w=function(t,e){t.scales.xAxes[0].ticks.max=tt(e)},A=function(t,e){t.scales.xAxes[0].stacked=!!e,t.scales.yAxes[0].stacked=!!e},C=function(t,e){t.scales.xAxes[0].scaleLabel.display=!0,t.scales.xAxes[0].scaleLabel.labelString=e},_=function(t,e){t.scales.yAxes[0].scaleLabel.display=!0,t.scales.yAxes[0].scaleLabel.labelString=e},lt=function(t){return null!=t},S=function(t,e,r){var n={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal};if("pie"!==r){var a=e.scales.yAxes;"bar"===r&&(a=e.scales.xAxes),a[0].ticks.callback||(a[0].ticks.callback=function(t){return g("",t,n)})}if(!e.tooltips.callbacks.label)if("scatter"===r)e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";return r&&(r+=": "),r+"("+t.xLabel+", "+t.yLabel+")"};else if("bubble"===r)e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";r&&(r+=": ");var n=e.datasets[t.datasetIndex].data[t.index];return r+"("+t.xLabel+", "+t.yLabel+", "+n.v+")"};else if("pie"===r)e.tooltips.callbacks.label=function(t,e){var r=e.labels[t.index];return i(r)?(r=r.slice())[0]+=": ":r+=": ",g(r,e.datasets[t.datasetIndex].data[t.index],n)};else{var o="bar"===r?"xLabel":"yLabel";e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";return r&&(r+=": "),g(r,t[o],n)}}},k=o(q(b,v),x,z,function(t,e){if(e!==null){t.scales.yAxes[0].ticks.min=tt(e)}},function(t,e){t.scales.yAxes[0].ticks.max=tt(e)},A,C,_),O=function(t,e,r){var n,a=[],o=[],i=t.options.colors||ct,s=!0,c=!0,l=!0,u=!0,p=!0,d=!0,h=t.data,f=0;if("bubble"===r)for(var y=0;y<h.length;y++)for(var m=h[y],g=0;g<m.data.length;g++)m.data[g][2]>f&&(f=m.data[g][2]);var b,v,x,z,M,w,A,C,_,S,k,O=[],T=[];if("bar"===r||"column"===r||"number"!==t.xtype&&"bubble"!==t.xtype){var D,L,j=[];for(b=0;b<h.length;b++)for(x=h[b],v=0;v<x.data.length;v++)z=x.data[v],M="datetime"==t.xtype?z[0].getTime():z[0],O[M]||(O[M]=new Array(h.length)),O[M][b]=tt(z[1]),-1===j.indexOf(M)&&j.push(M);for("datetime"!==t.xtype&&"number"!==t.xtype||j.sort(rt),v=0;v<h.length;v++)T.push([]);for(L=0;L<j.length;L++)for(b=j[L],"datetime"===t.xtype?(D=new Date(tt(b)),s=s&&ot(D),n||(n=D.getDay()),c=c&&(C=n,ot(A=D)&&A.getDay()===C),l=l&&it(D),u=u&&(it(w=D)&&0===w.getMonth()),p=p&&at(D),d=d&&nt(D)):D=b,o.push(D),v=0;v<h.length;v++)T[v].push(void 0===O[b][v]?null:O[b][v])}else for(var E=0;E<h.length;E++){for(var I=h[E],B=[],N=0;N<I.data.length;N++){var F={x:tt(I.data[N][0]),y:tt(I.data[N][1])};"bubble"===r&&(F.r=20*tt(I.data[N][2])/f,F.v=I.data[N][2]),B.push(F)}T.push(B)}for(b=0;b<h.length;b++){var H=(x=h[b]).color||i[b],R="line"!==r?(S=.5,void 0,(k=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_=H))?"rgba("+parseInt(k[1],16)+", "+parseInt(k[2],16)+", "+parseInt(k[3],16)+", "+S+")":_):H,P={label:x.name||"",data:T[b],fill:"area"===r,borderColor:H,backgroundColor:R,pointBackgroundColor:H,borderWidth:2,pointHoverBackgroundColor:H};x.stack&&(P.stack=x.stack);var U=st(t,x,"curve");!1===U&&(P.lineTension=0);var V=st(t,x,"points");!1===V&&(P.pointRadius=0,P.pointHitRadius=5),P=q(P=q(P=q(P,t.options.dataset||{}),x.library||{}),x.dataset||{}),a.push(P)}var W=t.options.xmin,Q=t.options.xmax;if("datetime"===t.xtype?(lt(W)&&(e.scales.xAxes[0].time.min=et(W).getTime()),lt(Q)&&(e.scales.xAxes[0].time.max=et(Q).getTime())):"number"===t.xtype&&(lt(W)&&(e.scales.xAxes[0].ticks.min=W),lt(Q)&&(e.scales.xAxes[0].ticks.max=Q)),"datetime"===t.xtype&&0<o.length){var J=(lt(W)?et(W):o[0]).getTime(),G=(lt(Q)?et(Q):o[0]).getTime();for(b=1;b<o.length;b++){var K=o[b].getTime();K<J&&(J=K),G<K&&(G=K)}var X,Y=(G-J)/864e5;if(!e.scales.xAxes[0].time.unit)if(u||3650<Y?(e.scales.xAxes[0].time.unit="year",X=365):l||300<Y?(e.scales.xAxes[0].time.unit="month",X=30):s||10<Y?(e.scales.xAxes[0].time.unit="day",X=1):p||.5<Y?(e.scales.xAxes[0].time.displayFormats={hour:"MMM D, h a"},e.scales.xAxes[0].time.unit="hour",X=1/24):d&&(e.scales.xAxes[0].time.displayFormats={minute:"h:mm a"},e.scales.xAxes[0].time.unit="minute",X=1/24/60),X&&0<Y){var Z=Math.ceil(Y/X/(t.element.offsetWidth/100));c&&1===X&&(Z=7*Math.ceil(Z/7)),e.scales.xAxes[0].time.unitStepSize=Z}e.scales.xAxes[0].time.tooltipFormat||(s?e.scales.xAxes[0].time.tooltipFormat="ll":p?e.scales.xAxes[0].time.tooltipFormat="MMM D, h a":d&&(e.scales.xAxes[0].time.tooltipFormat="h:mm a"))}var $={labels:o,datasets:a};return $},T=function(t){this.name="chartjs",this.library=t};T.prototype.renderLineChart=function(t,e){var r={};!t.options.max&&function(t){var e,r,n;for(e=0;e<t.length;e++)for(n=t[e].data,r=0;r<n.length;r++)if(0!=n[r][1])return!1;return!0}(t.data)&&(r.max=1);var n=k(t,q(r,t.options));S(t,n,e);var a=O(t,n,e||"line");"number"===t.xtype?(n.scales.xAxes[0].type="linear",n.scales.xAxes[0].position="bottom"):n.scales.xAxes[0].type="string"===t.xtype?"category":"time",this.drawChart(t,"line",a,n)},T.prototype.renderPieChart=function(t){var e=q({},b);t.options.donut&&(e.cutoutPercentage=50),"legend"in t.options&&x(e,t.options.legend),t.options.title&&z(e,t.options.title),e=q(e,t.options.library||{}),S(t,e,"pie");for(var r=[],n=[],a=0;a<t.data.length;a++){var o=t.data[a];r.push(o[0]),n.push(o[1])}var i={data:n,backgroundColor:t.options.colors||ct};i=q(i,t.options.dataset||{});var s={labels:r,datasets:[i]};this.drawChart(t,"pie",s,e)},T.prototype.renderColumnChart=function(t,e){var r;r="bar"===e?o(q(b,v),x,z,M,w,A,C,_)(t,t.options):k(t,t.options),S(t,r,e);var n=O(t,r,"column");"bar"!==e&&function(t,e,r){var n=Math.ceil(t.element.offsetWidth/4/e.labels.length);if(n>25){n=25}else if(n<10){n=10}if(!r.scales.xAxes[0].ticks.callback){r.scales.xAxes[0].ticks.callback=function(t){t=f(t);if(t.length>n){return t.substring(0,n-2)+"..."}else{return t}}}}(t,n,r),this.drawChart(t,"bar"===e?"horizontalBar":"bar",n,r)},T.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},T.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},T.prototype.renderScatterChart=function(t,e){e=e||"scatter";var r=k(t,t.options);S(t,r,e),"showLines"in r||(r.showLines=!1);var n=O(t,r,e);r.scales.xAxes[0].type="linear",r.scales.xAxes[0].position="bottom",this.drawChart(t,e,n,r)},T.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},T.prototype.destroy=function(t){t.chart&&t.chart.destroy()};var D={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!(T.prototype.drawChart=function(t,e,r,n){this.destroy(t);var a={type:e,data:r,options:n};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(a)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,a)})},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},series:{marker:{}}}},L=function(t,e,r){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):r&&(t.legend.enabled=!1)},j=function(t,e){t.title.text=e},E=o(D,L,j,function(t,e){t.yAxis.min=e},function(t,e){t.yAxis.max=e},function(t,e){t.plotOptions.series.stacking=e?!0===e?"normal":e:null},function(t,e){t.xAxis.title.text=e},function(t,e){t.yAxis.title.text=e}),I=function(t,e,r){var n={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal};"pie"===r||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return g("",this.value,n)}),e.tooltip.pointFormatter||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">ā—</span> '+g(this.series.name+": <b>",this.y,n)+"</b><br/>"})},B=function(t){this.name="highcharts",this.library=t};B.prototype.renderLineChart=function(t,e){var r={};"areaspline"===(e=e||"spline")&&(r={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var n,a,o,i=E(t,t.options,r);i.xAxis.type="string"===t.xtype?"category":"number"===t.xtype?"linear":"datetime",i.chart.type||(i.chart.type=e),I(t,i,e);var s=t.data;for(a=0;a<s.length;a++){if(s[a].name=s[a].name||"Value",n=s[a].data,"datetime"===t.xtype)for(o=0;o<n.length;o++)n[o][0]=n[o][0].getTime();!(s[a].marker={symbol:"circle"})===t.options.points&&(s[a].marker.enabled=!1)}this.drawChart(t,s,i)},B.prototype.renderScatterChart=function(t){var e=E(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},B.prototype.renderPieChart=function(t){var e=q(D,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&L(e,t.options.legend),t.options.title&&j(e,t.options.title);var r=q(e,t.options.library||{});I(t,r,"pie");var n=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,n,r)},B.prototype.renderColumnChart=function(t,e){e=e||"column";var r,n,a,o,i=t.data,s=E(t,t.options),c=[],l=[];for(s.chart.type=e,I(t,s,e),r=0;r<i.length;r++)for(a=i[r],n=0;n<a.data.length;n++)o=a.data[n],c[o[0]]||(c[o[0]]=new Array(i.length),l.push(o[0])),c[o[0]][r]=o[1];"number"===t.xtype&&l.sort(rt),s.xAxis.categories=l;var u,p=[];for(r=0;r<i.length;r++){for(o=[],n=0;n<l.length;n++)o.push(c[l[n]][r]||0);u={name:i[r].name||"Value",data:o},i[r].stack&&(u.stack=i[r].stack),p.push(u)}this.drawChart(t,p,s)},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,r){this.destroy(t),r.chart.renderTo=t.element.id,r.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(r)+");"),t.chart=new this.library.Chart(r)};var N={},F=[],H={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},R=function(t,e,r){var n;void 0!==e?(n=e?!0===e?"right":e:"none",t.legend.position=n):r&&(t.legend.position="none")},P=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},U=function(t,e){t.hAxis.viewWindow.min=e},V=function(t,e){t.hAxis.viewWindow.max=e},W=function(t,e){t.isStacked=e||!1},Q=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},J=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},G=o(H,R,P,function(t,e){t.vAxis.viewWindow.min=e},function(t,e){t.vAxis.viewWindow.max=e},W,Q,J),K=function(t){this.name="google",this.library=t};K.prototype.renderLineChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={};!1===n.options.curve&&(t.curveType="none"),!1===n.options.points&&(t.pointSize=0);var e=G(n,n.options,t),r=a.createDataTable(n.data,n.xtype);a.drawChart(n,"LineChart",r,e)})},K.prototype.renderPieChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={chartArea:{top:"10%",height:"80%"},legend:{}};n.options.colors&&(t.colors=n.options.colors),n.options.donut&&(t.pieHole=.5),"legend"in n.options&&R(t,n.options.legend),n.options.title&&P(t,n.options.title);var e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number","Value"),r.addRows(n.data),a.drawChart(n,"PieChart",r,e)})},K.prototype.renderColumnChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=G(r,r.options),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"ColumnChart",e,t)})},K.prototype.renderBarChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=o(H,R,P,U,V,W,Q,J)(r,r.options,{hAxis:{gridlines:{color:"#ccc"}}}),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"BarChart",e,t)})},K.prototype.renderAreaChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=G(r,r.options,{isStacked:true,pointSize:0,areaOpacity:.5}),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"AreaChart",e,t)})},K.prototype.renderGeoChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={legend:"none",colorAxis:{colors:n.options.colors||["#f6c7b6","#ce502d"]}},e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number",n.options.label||"Value"),r.addRows(n.data),a.drawChart(n,"GeoChart",r,e)})},K.prototype.renderScatterChart=function(c){var l=this;this.waitForLoaded(c,function(){var t,e,r,n,a=G(c,c.options,{}),o=c.data,i=[];for(t=0;t<o.length;t++)for(o[t].name=o[t].name||"Value",n=o[t].data,e=0;e<n.length;e++){var s=new Array(o.length+1);s[0]=n[e][0],s[t+1]=n[e][1],i.push(s)}for((r=new l.library.visualization.DataTable).addColumn("number",""),t=0;t<o.length;t++)r.addColumn("number",o[t].name);r.addRows(i),l.drawChart(c,"ScatterChart",r,a)})},K.prototype.renderTimeline=function(n){var a=this;this.waitForLoaded(n,"timeline",function(){var t={legend:"none"};n.options.colors&&(t.colors=n.options.colors);var e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn({type:"string",id:"Name"}),r.addColumn({type:"date",id:"Start"}),r.addColumn({type:"date",id:"End"}),r.addRows(n.data),n.element.style.lineHeight="normal",a.drawChart(n,"Timeline",r,e)})},K.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},K.prototype.drawChart=function(t,e,r,n){this.destroy(t),t.options.code&&window.console.log("var data = new google.visualization.DataTable("+r.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(n)+");"),t.chart=new this.library.visualization[e](t.element),function(t){if(window.attachEvent){window.attachEvent("onresize",t)}else if(window.addEventListener){window.addEventListener("resize",t,true)}t()}(function(){t.chart.draw(r,n)})},K.prototype.waitForLoaded=function(t,e,r){var n=this;if(r||(r=e,e="corechart"),F.push({pack:e,callback:r}),N[e])this.runCallbacks();else{N[e]=!0;var a={packages:[e],callback:function(){n.runCallbacks()}},o=t.__config();o.language&&(a.language=o.language),"corechart"===e&&o.mapsApiKey&&(a.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",a)}},K.prototype.runCallbacks=function(){for(var t,e=0;e<F.length;e++)t=F[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline)&&(t.callback(),F.splice(e,1),e--)},K.prototype.createDataTable=function(t,e){var r,n,a,o,i,s=[],c=[];for(r=0;r<t.length;r++)for(a=t[r],t[r].name=t[r].name||"Value",n=0;n<a.data.length;n++)o=a.data[n],i="datetime"===e?o[0].getTime():o[0],s[i]||(s[i]=new Array(t.length),c.push(i)),s[i][r]=tt(o[1]);var l,u=[],p=!0;for(n=0;n<c.length;n++)r=c[n],"datetime"===e?(l=new Date(tt(r)),p=p&&ot(l)):l="number"===e?tt(r):r,u.push([l].concat(s[r]));if("datetime"===e)u.sort(y);else if("number"===e){for(u.sort(m),r=0;r<u.length;r++)u[r][0]=f(u[r][0]);e="string"}var d=new this.library.visualization.DataTable;for(e="datetime"===e&&p?"date":e,d.addColumn(e,""),r=0;r<t.length;r++)d.addColumn("number",t[r].name);return d.addRows(u),d};var X=[],e=0,r=4;function Y(){if(e<r){var t=X.shift();t&&(e++,function(t,e,a){!function(t,e,r){var n=window.jQuery||window.Zepto||window.$;if(n)n.ajax({dataType:"json",url:t,success:e,error:r,complete:Z});else{var a=new XMLHttpRequest;a.open("GET",t,!0),a.setRequestHeader("Content-Type","application/json"),a.onload=function(){Z(),200===a.status?e(JSON.parse(a.responseText),a.statusText,a):r(a,"error",a.statusText)},a.send()}}(t,e,function(t,e,r){var n="string"==typeof r?r:r.message;a(n)})}(t[0],t[1],t[2]),Y())}}function Z(){e--,Y()}var $={},ut=[];function pt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function dt(t,e){pt(t,"Error Loading Chart: "+e),t.style.color="#ff0000"}function ht(e){try{e.__render()}catch(t){throw dt(e.element,t.message),t}}function ft(e,t){"string"==typeof t?function(t,e,r){X.push([t,e,r]),Y()}(t,function(t){e.rawData=t,ht(e)},function(t){dt(e.element,t)}):(e.rawData=t,ht(e))}function yt(t,e,r){if(t.addEventListener)return t.addEventListener(e,r,!1),r;var n=function(){return r.call(t,window.event)};return t.attachEvent("on"+e,n),n}function t(t,e,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent("on"+e,r)}function mt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}function gt(t){var e=function(t){if(t){if("Highcharts"===t.product)return B;if(t.charts)return K;if(s(t))return T}throw new Error("Unknown adapter")}(t),r=new e(t);-1===ut.indexOf(r)&&ut.push(r)}function bt(t,e){e.options.messages&&e.options.messages.empty&&function(t,e){{if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var r=0;r<t.length;r++)if(0<t[r].data.length)return!1;return!0}}(e.data,t)?pt(e.element,e.options.messages.empty):(function(t,e){var r,n,a,o;for(a="render"+t,o=e.options.adapter,function(){"Chart"in window&&gt(window.Chart);"Highcharts"in window&&gt(window.Highcharts);window.google&&window.google.charts&&gt(window.google)}(),r=0;r<ut.length;r++)if(n=ut[r],(!o||o===n.name)&&s(n[a]))return e.adapter=n.name,(e.__adapterObject=n)[a](e);throw 0<ut.length?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}(t,e),e.options.download&&!e.__downloadAttached&&"chartjs"===e.adapter&&function(r){var n=r.element,a=document.createElement("a"),o=r.options.download;!0===o?o={}:"string"==typeof o&&(o={filename:o});a.download=o.filename||"chart.png",a.style.position="absolute",a.style.top="20px",a.style.right="20px",a.style.zIndex=1e3,a.style.lineHeight="20px",a.target="_blank";var t=document.createElement("img");t.alt="Download",t.style.border="none",t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",a.appendChild(t),n.style.position="relative",r.__downloadAttached=!0,r.__enterEvent=yt(n,"mouseover",function(t){var e=t.relatedTarget;e&&(e===this||mt(this,e))||!r.options.download||(a.href=r.toImage(o),n.appendChild(a))}),r.__leaveEvent=yt(n,"mouseout",function(t){var e=t.relatedTarget;e&&(e===this||mt(this,e))||a.parentNode&&a.parentNode.removeChild(a)})}(e))}var vt=function(t,e){return t="number"===e?tt(t):"datetime"===e?et(t):f(t)},xt=function(t,e){var r,n,a=[];for(n=0;n<t.length;n++)"bubble"===e?a.push([tt(t[n][0]),tt(t[n][1]),tt(t[n][2])]):(r=vt(t[n][0],e),a.push([r,tt(t[n][1])]));return"datetime"===e?a.sort(y):"number"===e&&a.sort(m),a};function zt(t,e){var r,n,a;for(r=0;r<t.length;r++)for(a=l(t[r].data),n=0;n<a.length;n++)if(!e(a[n][0]))return!1;return!0}function Mt(t,e,r){var n,a=t.options,o=t.rawData;for(!i(o)||"object"!=typeof o[0]||i(o[0])?(o=[{name:a.label,data:o}],t.hideLegend=!0):t.hideLegend=!1,t.xtype=e||(a.discrete?"string":function(t,e){return zt(t,p)?"number":!e&&zt(t,u)?"datetime":"string"}(o,r)),o=function(t){var e,r,n=[];for(e=0;e<t.length;e++){var a={};for(r in t[e])t[e].hasOwnProperty(r)&&(a[r]=t[e][r]);n.push(a)}return n}(o),n=0;n<o.length;n++)o[n].data=xt(l(o[n].data),t.xtype);return o}function wt(t){var e,r=l(t.rawData);for(e=0;e<r.length;e++)r[e]=[f(r[e][0]),tt(r[e][1])];return r}var At=function(t,e,r){var n;if("string"==typeof t&&(n=t,!(t=document.getElementById(t))))throw new Error("No element with id "+n);this.element=t,this.options=q(Ct.options,r||{}),this.dataSource=e,ft(Ct.charts[t.id]=this,e),this.options.refresh&&this.startRefresh()};At.prototype.getElement=function(){return this.element},At.prototype.getDataSource=function(){return this.dataSource},At.prototype.getData=function(){return this.data},At.prototype.getOptions=function(){return this.options},At.prototype.getChartObject=function(){return this.chart},At.prototype.getAdapter=function(){return this.adapter},At.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),ft(this,t)},At.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},At.prototype.redraw=function(){ft(this,this.rawData)},At.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&",e=this.dataSource+t+"_="+(new Date).getTime();ft(this,e)}},At.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource)throw new Error("Data source must be a URL for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval(function(){t.refreshData()},1e3*e)}},At.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},At.prototype.toImage=function(t){if("chartjs"!==this.adapter)return null;if(t&&t.background&&"transparent"!==t.background){var e=this.chart.chart.canvas,r=this.chart.chart.ctx,n=document.createElement("canvas"),a=n.getContext("2d");return n.width=r.canvas.width,n.height=r.canvas.height,a.fillStyle=t.background,a.fillRect(0,0,n.width,n.height),a.drawImage(e,0,0),n.toDataURL("image/png")}return this.chart.toBase64Image()},At.prototype.destroy=function(){this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&t(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&t(this.element,"mouseout",this.__leaveEvent)},At.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=q(Ct.options,t),e&&(this.stopRefresh(),this.startRefresh())},At.prototype.__render=function(){this.data=this.__processData(),bt(this.__chartName(),this)},At.prototype.__config=function(){return $};var Ct={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this)},e.prototype.__chartName=function(){return"LineChart"},e}(At),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return wt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(At),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(At),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(At),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(At),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return wt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(At),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(At),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(At),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=et(e[t][1]),e[t][2]=et(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(At),charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&($[e]=t[e])},setDefaultOptions:function(t){Ct.options=t},eachChart:function(t){for(var e in Ct.charts)Ct.charts.hasOwnProperty(e)&&t(Ct.charts[e])},config:$,options:{},adapters:ut,addAdapter:gt,use:function(t){return gt(t),Ct}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=Ct),Ct.default=Ct}()}),p=t(function(t,e){function r(t){var e=[];for(var r in t)e.push(r);return e}(t.exports="function"==typeof Object.keys?Object.keys:r).shim=r}),d=(p.shim,t(function(t,e){var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function a(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=r?n:a).supported=n,e.unsupported=a})),n=(d.supported,d.unsupported,t(function(t){var s=Array.prototype.slice,c=t.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?t===e:t==e:function(t,e,r){var n,a;if(l(t)||l(e))return!1;if(t.prototype!==e.prototype)return!1;if(d(t))return!!d(e)&&(t=s.call(t),e=s.call(e),c(t,e,r));if(u(t)){if(!u(e))return!1;if(t.length!==e.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}try{var o=p(t),i=p(e)}catch(t){return!1}if(o.length!=i.length)return!1;for(o.sort(),i.sort(),n=o.length-1;0<=n;n--)if(o[n]!=i[n])return!1;for(n=o.length-1;0<=n;n--)if(a=o[n],!c(t[a],e[a],r))return!1;return typeof t==typeof e}(t,e,r))};function l(t){return null==t}function u(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(0<t.length&&"number"!=typeof t[0]))}})),a=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===o}(t)}(t)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c(function(t){return Array.isArray(t)?[]:{}}(t),t,e):t}function s(t,e,r){return t.concat(e).map(function(t){return i(t,r)})}function c(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||a;var n=Array.isArray(e);return n===Array.isArray(t)?n?r.arrayMerge(t,e,r):function(e,r,n){var a={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){a[t]=i(e[t],n)}),Object.keys(r).forEach(function(t){n.isMergeableObject(r[t])&&e[t]?a[t]=c(e[t],r[t],n):a[t]=i(r[t],n)}),a}(t,e,r):i(e,r)}c.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,e){return c(t,e,r)},{})};function l(t,e,r){var a=["adapter","colors","curve","dataset","decimal","discrete","donut","download","label","legend","library","max","messages","min","points","prefix","refresh","stacked","suffix","thousands","title","xmax","xmin","xtitle","ytitle"];t.component(e,{props:["data","id","width","height"].concat(a),render:function(t){return t("div",{attrs:{id:this.chartId},style:this.chartStyle},["Loading..."])},data:function(){return{chartId:null}},computed:{chartStyle:function(){return this.data,this.chartOptions,{height:this.height||"300px",lineHeight:this.height||"300px",width:this.width||"100%",textAlign:"center",color:"#999",fontSize:"14px",fontFamily:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif"}},chartOptions:function(){for(var t={},e=a,r=0;r<e.length;r++){var n=e[r];void 0!==this[n]&&(t[n]=this[n])}return t}},created:function(){this.chartId=this.chartId||this.id||"chart-"+h++},mounted:function(){this.updateChart(),this.savedState=this.currentState()},updated:function(){var t=this.currentState();n(t,this.savedState)||(this.updateChart(),this.savedState=t)},beforeDestroy:function(){this.chart&&this.chart.destroy()},methods:{updateChart:function(){null!==this.data?this.chart?this.chart.updateData(this.data,this.chartOptions):this.chart=new r(this.chartId,this.data,this.chartOptions):this.chart&&(this.chart.destroy(),this.chart=null,this.$el.innerText="Loading...")},currentState:function(){return u({},{data:this.data,chartOptions:this.chartOptions})}}})}var u=c,h=1;r.version="0.5.0",r.install=function(t,e){e&&e.adapter&&r.addAdapter(e.adapter),l(t,"line-chart",r.LineChart),l(t,"pie-chart",r.PieChart),l(t,"column-chart",r.ColumnChart),l(t,"bar-chart",r.BarChart),l(t,"area-chart",r.AreaChart),l(t,"scatter-chart",r.ScatterChart),l(t,"geo-chart",r.GeoChart),l(t,"timeline",r.Timeline)};var e=r;return"undefined"!=typeof window&&window.Vue&&window.Vue.use(e),e});
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).VueChartkick=e()}(this,function(){"use strict";"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function t(t,e){return t(e={exports:{}},e.exports),e.exports}var r=t(function(t,e){t.exports=function(){function i(t){return"[object Array]"===Object.prototype.toString.call(t)}function s(t){return t instanceof Function}function n(t){return"[object Object]"===Object.prototype.toString.call(t)}function a(t,e){var r;for(r in e)n(e[r])||i(e[r])?(n(e[r])&&!n(t[r])&&(t[r]={}),i(e[r])&&!i(t[r])&&(t[r]=[]),a(t[r],e[r])):void 0!==e[r]&&(t[r]=e[r])}function q(t,e){var r={};return a(r,t),a(r,e),r}var c=/^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i,d=/(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)(T)?(\d\d)(:)?(\d\d)?(:)?(\d\d)?([.,]\d+)?($|Z|([+-])(\d\d)(:)?(\d\d)?)/i,h=String(1.5).charAt(1);function f(t){return""+t}function tt(t){return parseFloat(t)}function et(t){var e,r,n,a;if("object"!=typeof t)if("number"==typeof t)t=new Date(1e3*t);else{if(t=f(t),e=t.match(c))return r=parseInt(e[1],10),n=parseInt(e[3],10)-1,a=parseInt(e[5],10),new Date(r,n,a);var o=t.replace(/ /,"T").replace(" ","").replace("UTC","Z");t=function(t){var e,r,n,a,o,i,s,c,l,u,p;if("[object Date]"===(u=Object.prototype.toString.call(t)))return t;if("[object String]"!==u)return;if(n=t.match(d))return p=parseInt(n[1],10),i=parseInt(n[3],10)-1,e=parseInt(n[5],10),r=parseInt(n[7],10),o=n[9]?parseInt(n[9],10):0,l=n[11]?parseInt(n[11],10):0,a=n[12]?1e3*parseFloat(h+n[12].slice(1)):0,c=Date.UTC(p,i,e,r,o,l,a),n[13]&&n[14]&&(s=60*n[15],n[17]&&(s+=parseInt(n[17],10)),s*="-"===n[14]?-1:1,c-=60*s*1e3),new Date(c)}(o)||new Date(t)}return t}function l(t){if(!i(t)){var e,r=[];for(e in t)t.hasOwnProperty(e)&&r.push([e,t[e]]);t=r}return t}function o(o,i,s,c,l,u,p,d){return function(t,e,r){var n=t.data,a=q({},o);return a=q(a,r||{}),(t.hideLegend||"legend"in e)&&i(a,e.legend,t.hideLegend),e.title&&s(a,e.title),"min"in e?c(a,e.min):function(t){var e,r,n;for(e=0;e<t.length;e++)for(n=t[e].data,r=0;r<n.length;r++)if(n[r][1]<0)return!0;return!1}(n)||c(a,0),e.max&&l(a,e.max),"stacked"in e&&u(a,e.stacked),e.colors&&(a.colors=e.colors),e.xtitle&&p(a,e.xtitle),e.ytitle&&d(a,e.ytitle),a=q(a,e.library||{})}}function y(t,e){return t[0].getTime()-e[0].getTime()}function m(t,e){return t[0]-e[0]}function rt(t,e){return t-e}function nt(t){return 0===t.getMilliseconds()&&0===t.getSeconds()}function at(t){return nt(t)&&0===t.getMinutes()}function ot(t){return at(t)&&0===t.getHours()}function it(t){return ot(t)&&1===t.getDate()}function u(t){return!isNaN(et(t))&&6<=f(t).length}function p(t){return"number"==typeof t}function g(t,e,r){if(t=t||"",r.prefix&&(e<0&&(e*=-1,t+="-"),t+=r.prefix),r.thousands||r.decimal){var n=(e=f(e)).split(".");e=n[0],r.thousands&&(e=e.replace(/\B(?=(\d{3})+(?!\d))/g,r.thousands)),1<n.length&&(e+=(r.decimal||".")+n[1])}return t+e+(r.suffix||"")}function st(t,e,r){return r in e?e[r]:r in t.options?t.options[r]:null}var b={maintainAspectRatio:!1,animation:!1,tooltips:{displayColors:!1,callbacks:{}},legend:{},title:{fontSize:20,fontColor:"#333"}},v={scales:{yAxes:[{ticks:{maxTicksLimit:4},scaleLabel:{fontSize:16,fontColor:"#333"}}],xAxes:[{gridLines:{drawOnChartArea:!1},scaleLabel:{fontSize:16,fontColor:"#333"},time:{},ticks:{}}]}},ct=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#651067"],x=function(t,e,r){void 0!==e?(t.legend.display=!!e,e&&!0!==e&&(t.legend.position=e)):r&&(t.legend.display=!1)},z=function(t,e){t.title.display=!0,t.title.text=e},M=function(t,e){null!==e&&(t.scales.xAxes[0].ticks.min=tt(e))},w=function(t,e){t.scales.xAxes[0].ticks.max=tt(e)},A=function(t,e){t.scales.xAxes[0].stacked=!!e,t.scales.yAxes[0].stacked=!!e},C=function(t,e){t.scales.xAxes[0].scaleLabel.display=!0,t.scales.xAxes[0].scaleLabel.labelString=e},_=function(t,e){t.scales.yAxes[0].scaleLabel.display=!0,t.scales.yAxes[0].scaleLabel.labelString=e},lt=function(t){return null!=t},S=function(t,e,r){var n={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal};if("pie"!==r){var a=e.scales.yAxes;"bar"===r&&(a=e.scales.xAxes),a[0].ticks.callback||(a[0].ticks.callback=function(t){return g("",t,n)})}if(!e.tooltips.callbacks.label)if("scatter"===r)e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";return r&&(r+=": "),r+"("+t.xLabel+", "+t.yLabel+")"};else if("bubble"===r)e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";r&&(r+=": ");var n=e.datasets[t.datasetIndex].data[t.index];return r+"("+t.xLabel+", "+t.yLabel+", "+n.v+")"};else if("pie"===r)e.tooltips.callbacks.label=function(t,e){var r=e.labels[t.index];return i(r)?(r=r.slice())[0]+=": ":r+=": ",g(r,e.datasets[t.datasetIndex].data[t.index],n)};else{var o="bar"===r?"xLabel":"yLabel";e.tooltips.callbacks.label=function(t,e){var r=e.datasets[t.datasetIndex].label||"";return r&&(r+=": "),g(r,t[o],n)}}},k=o(q(b,v),x,z,function(t,e){if(e!==null){t.scales.yAxes[0].ticks.min=tt(e)}},function(t,e){t.scales.yAxes[0].ticks.max=tt(e)},A,C,_),O=function(t,e,r){var n,a=[],o=[],i=t.options.colors||ct,s=!0,c=!0,l=!0,u=!0,p=!0,d=!0,h=t.data,f=0;if("bubble"===r)for(var y=0;y<h.length;y++)for(var m=h[y],g=0;g<m.data.length;g++)m.data[g][2]>f&&(f=m.data[g][2]);var b,v,x,z,M,w,A,C,_,S,k,O=[],T=[];if("bar"===r||"column"===r||"number"!==t.xtype&&"bubble"!==t.xtype){var D,L,j=[];for(b=0;b<h.length;b++)for(x=h[b],v=0;v<x.data.length;v++)z=x.data[v],M="datetime"==t.xtype?z[0].getTime():z[0],O[M]||(O[M]=new Array(h.length)),O[M][b]=tt(z[1]),-1===j.indexOf(M)&&j.push(M);for("datetime"!==t.xtype&&"number"!==t.xtype||j.sort(rt),v=0;v<h.length;v++)T.push([]);for(L=0;L<j.length;L++)for(b=j[L],"datetime"===t.xtype?(D=new Date(tt(b)),s=s&&ot(D),n||(n=D.getDay()),c=c&&(C=n,ot(A=D)&&A.getDay()===C),l=l&&it(D),u=u&&(it(w=D)&&0===w.getMonth()),p=p&&at(D),d=d&&nt(D)):D=b,o.push(D),v=0;v<h.length;v++)T[v].push(void 0===O[b][v]?null:O[b][v])}else for(var E=0;E<h.length;E++){for(var I=h[E],B=[],N=0;N<I.data.length;N++){var F={x:tt(I.data[N][0]),y:tt(I.data[N][1])};"bubble"===r&&(F.r=20*tt(I.data[N][2])/f,F.v=I.data[N][2]),B.push(F)}T.push(B)}for(b=0;b<h.length;b++){var H=(x=h[b]).color||i[b],R="line"!==r?(S=.5,void 0,(k=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(_=H))?"rgba("+parseInt(k[1],16)+", "+parseInt(k[2],16)+", "+parseInt(k[3],16)+", "+S+")":_):H,P={label:x.name||"",data:T[b],fill:"area"===r,borderColor:H,backgroundColor:R,pointBackgroundColor:H,borderWidth:2,pointHoverBackgroundColor:H};x.stack&&(P.stack=x.stack);var U=st(t,x,"curve");!1===U&&(P.lineTension=0);var V=st(t,x,"points");!1===V&&(P.pointRadius=0,P.pointHitRadius=5),P=q(P=q(P=q(P,t.options.dataset||{}),x.library||{}),x.dataset||{}),a.push(P)}var W=t.options.xmin,Q=t.options.xmax;if("datetime"===t.xtype?(lt(W)&&(e.scales.xAxes[0].time.min=et(W).getTime()),lt(Q)&&(e.scales.xAxes[0].time.max=et(Q).getTime())):"number"===t.xtype&&(lt(W)&&(e.scales.xAxes[0].ticks.min=W),lt(Q)&&(e.scales.xAxes[0].ticks.max=Q)),"datetime"===t.xtype&&0<o.length){var J=(lt(W)?et(W):o[0]).getTime(),G=(lt(Q)?et(Q):o[0]).getTime();for(b=1;b<o.length;b++){var K=o[b].getTime();K<J&&(J=K),G<K&&(G=K)}var X,Y=(G-J)/864e5;if(!e.scales.xAxes[0].time.unit)if(u||3650<Y?(e.scales.xAxes[0].time.unit="year",X=365):l||300<Y?(e.scales.xAxes[0].time.unit="month",X=30):s||10<Y?(e.scales.xAxes[0].time.unit="day",X=1):p||.5<Y?(e.scales.xAxes[0].time.displayFormats={hour:"MMM D, h a"},e.scales.xAxes[0].time.unit="hour",X=1/24):d&&(e.scales.xAxes[0].time.displayFormats={minute:"h:mm a"},e.scales.xAxes[0].time.unit="minute",X=1/24/60),X&&0<Y){var Z=Math.ceil(Y/X/(t.element.offsetWidth/100));c&&1===X&&(Z=7*Math.ceil(Z/7)),e.scales.xAxes[0].time.unitStepSize=Z}e.scales.xAxes[0].time.tooltipFormat||(s?e.scales.xAxes[0].time.tooltipFormat="ll":p?e.scales.xAxes[0].time.tooltipFormat="MMM D, h a":d&&(e.scales.xAxes[0].time.tooltipFormat="h:mm a"))}var $={labels:o,datasets:a};return $},T=function(t){this.name="chartjs",this.library=t};T.prototype.renderLineChart=function(t,e){var r={};!t.options.max&&function(t){var e,r,n;for(e=0;e<t.length;e++)for(n=t[e].data,r=0;r<n.length;r++)if(0!=n[r][1])return!1;return!0}(t.data)&&(r.max=1);var n=k(t,q(r,t.options));S(t,n,e);var a=O(t,n,e||"line");"number"===t.xtype?(n.scales.xAxes[0].type="linear",n.scales.xAxes[0].position="bottom"):n.scales.xAxes[0].type="string"===t.xtype?"category":"time",this.drawChart(t,"line",a,n)},T.prototype.renderPieChart=function(t){var e=q({},b);t.options.donut&&(e.cutoutPercentage=50),"legend"in t.options&&x(e,t.options.legend),t.options.title&&z(e,t.options.title),e=q(e,t.options.library||{}),S(t,e,"pie");for(var r=[],n=[],a=0;a<t.data.length;a++){var o=t.data[a];r.push(o[0]),n.push(o[1])}var i={data:n,backgroundColor:t.options.colors||ct};i=q(i,t.options.dataset||{});var s={labels:r,datasets:[i]};this.drawChart(t,"pie",s,e)},T.prototype.renderColumnChart=function(t,e){var r;if("bar"===e){var n=q(b,v);delete n.scales.yAxes[0].ticks.maxTicksLimit,r=o(n,x,z,M,w,A,C,_)(t,t.options)}else r=k(t,t.options);S(t,r,e);var a=O(t,r,"column");"bar"!==e&&function(t,e,r){var n=Math.ceil(t.element.offsetWidth/4/e.labels.length);if(n>25){n=25}else if(n<10){n=10}if(!r.scales.xAxes[0].ticks.callback){r.scales.xAxes[0].ticks.callback=function(t){t=f(t);if(t.length>n){return t.substring(0,n-2)+"..."}else{return t}}}}(t,a,r),this.drawChart(t,"bar"===e?"horizontalBar":"bar",a,r)},T.prototype.renderAreaChart=function(t){this.renderLineChart(t,"area")},T.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},T.prototype.renderScatterChart=function(t,e){e=e||"scatter";var r=k(t,t.options);S(t,r,e),"showLines"in r||(r.showLines=!1);var n=O(t,r,e);r.scales.xAxes[0].type="linear",r.scales.xAxes[0].position="bottom",this.drawChart(t,e,n,r)},T.prototype.renderBubbleChart=function(t){this.renderScatterChart(t,"bubble")},T.prototype.destroy=function(t){t.chart&&t.chart.destroy()};var D={chart:{},xAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},yAxis:{title:{text:null},labels:{style:{fontSize:"12px"}}},title:{text:null},credits:{enabled:!(T.prototype.drawChart=function(t,e,r,n){this.destroy(t);var a={type:e,data:r,options:n};t.options.code&&window.console.log("new Chart(ctx, "+JSON.stringify(a)+");"),t.element.innerHTML="<canvas></canvas>";var o=t.element.getElementsByTagName("CANVAS")[0];t.chart=new this.library(o,a)})},legend:{borderWidth:0},tooltip:{style:{fontSize:"12px"}},plotOptions:{areaspline:{},series:{marker:{}}}},L=function(t,e,r){void 0!==e?(t.legend.enabled=!!e,e&&!0!==e&&("top"===e||"bottom"===e?t.legend.verticalAlign=e:(t.legend.layout="vertical",t.legend.verticalAlign="middle",t.legend.align=e))):r&&(t.legend.enabled=!1)},j=function(t,e){t.title.text=e},E=o(D,L,j,function(t,e){t.yAxis.min=e},function(t,e){t.yAxis.max=e},function(t,e){t.plotOptions.series.stacking=e?!0===e?"normal":e:null},function(t,e){t.xAxis.title.text=e},function(t,e){t.yAxis.title.text=e}),I=function(t,e,r){var n={prefix:t.options.prefix,suffix:t.options.suffix,thousands:t.options.thousands,decimal:t.options.decimal};"pie"===r||e.yAxis.labels.formatter||(e.yAxis.labels.formatter=function(){return g("",this.value,n)}),e.tooltip.pointFormatter||(e.tooltip.pointFormatter=function(){return'<span style="color:'+this.color+'">ā—</span> '+g(this.series.name+": <b>",this.y,n)+"</b><br/>"})},B=function(t){this.name="highcharts",this.library=t};B.prototype.renderLineChart=function(t,e){var r={};"areaspline"===(e=e||"spline")&&(r={plotOptions:{areaspline:{stacking:"normal"},area:{stacking:"normal"},series:{marker:{enabled:!1}}}}),!1===t.options.curve&&("areaspline"===e?e="area":"spline"===e&&(e="line"));var n,a,o,i=E(t,t.options,r);i.xAxis.type="string"===t.xtype?"category":"number"===t.xtype?"linear":"datetime",i.chart.type||(i.chart.type=e),I(t,i,e);var s=t.data;for(a=0;a<s.length;a++){if(s[a].name=s[a].name||"Value",n=s[a].data,"datetime"===t.xtype)for(o=0;o<n.length;o++)n[o][0]=n[o][0].getTime();!(s[a].marker={symbol:"circle"})===t.options.points&&(s[a].marker.enabled=!1)}this.drawChart(t,s,i)},B.prototype.renderScatterChart=function(t){var e=E(t,t.options,{});e.chart.type="scatter",this.drawChart(t,t.data,e)},B.prototype.renderPieChart=function(t){var e=q(D,{});t.options.colors&&(e.colors=t.options.colors),t.options.donut&&(e.plotOptions={pie:{innerSize:"50%"}}),"legend"in t.options&&L(e,t.options.legend),t.options.title&&j(e,t.options.title);var r=q(e,t.options.library||{});I(t,r,"pie");var n=[{type:"pie",name:t.options.label||"Value",data:t.data}];this.drawChart(t,n,r)},B.prototype.renderColumnChart=function(t,e){e=e||"column";var r,n,a,o,i=t.data,s=E(t,t.options),c=[],l=[];for(s.chart.type=e,I(t,s,e),r=0;r<i.length;r++)for(a=i[r],n=0;n<a.data.length;n++)o=a.data[n],c[o[0]]||(c[o[0]]=new Array(i.length),l.push(o[0])),c[o[0]][r]=o[1];"number"===t.xtype&&l.sort(rt),s.xAxis.categories=l;var u,p=[];for(r=0;r<i.length;r++){for(o=[],n=0;n<l.length;n++)o.push(c[l[n]][r]||0);u={name:i[r].name||"Value",data:o},i[r].stack&&(u.stack=i[r].stack),p.push(u)}this.drawChart(t,p,s)},B.prototype.renderBarChart=function(t){this.renderColumnChart(t,"bar")},B.prototype.renderAreaChart=function(t){this.renderLineChart(t,"areaspline")},B.prototype.destroy=function(t){t.chart&&t.chart.destroy()},B.prototype.drawChart=function(t,e,r){this.destroy(t),r.chart.renderTo=t.element.id,r.series=e,t.options.code&&window.console.log("new Highcharts.Chart("+JSON.stringify(r)+");"),t.chart=new this.library.Chart(r)};var N={},F=[],H={chartArea:{},fontName:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",pointSize:6,legend:{textStyle:{fontSize:12,color:"#444"},alignment:"center",position:"right"},curveType:"function",hAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},gridlines:{color:"transparent"},baselineColor:"#ccc",viewWindow:{}},vAxis:{textStyle:{color:"#666",fontSize:12},titleTextStyle:{},baselineColor:"#ccc",viewWindow:{}},tooltip:{textStyle:{color:"#666",fontSize:12}}},R=function(t,e,r){var n;void 0!==e?(n=e?!0===e?"right":e:"none",t.legend.position=n):r&&(t.legend.position="none")},P=function(t,e){t.title=e,t.titleTextStyle={color:"#333",fontSize:"20px"}},U=function(t,e){t.hAxis.viewWindow.min=e},V=function(t,e){t.hAxis.viewWindow.max=e},W=function(t,e){t.isStacked=e||!1},Q=function(t,e){t.hAxis.title=e,t.hAxis.titleTextStyle.italic=!1},J=function(t,e){t.vAxis.title=e,t.vAxis.titleTextStyle.italic=!1},G=o(H,R,P,function(t,e){t.vAxis.viewWindow.min=e},function(t,e){t.vAxis.viewWindow.max=e},W,Q,J),K=function(t){this.name="google",this.library=t};K.prototype.renderLineChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={};!1===n.options.curve&&(t.curveType="none"),!1===n.options.points&&(t.pointSize=0);var e=G(n,n.options,t),r=a.createDataTable(n.data,n.xtype);a.drawChart(n,"LineChart",r,e)})},K.prototype.renderPieChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={chartArea:{top:"10%",height:"80%"},legend:{}};n.options.colors&&(t.colors=n.options.colors),n.options.donut&&(t.pieHole=.5),"legend"in n.options&&R(t,n.options.legend),n.options.title&&P(t,n.options.title);var e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number","Value"),r.addRows(n.data),a.drawChart(n,"PieChart",r,e)})},K.prototype.renderColumnChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=G(r,r.options),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"ColumnChart",e,t)})},K.prototype.renderBarChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=o(H,R,P,U,V,W,Q,J)(r,r.options,{hAxis:{gridlines:{color:"#ccc"}}}),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"BarChart",e,t)})},K.prototype.renderAreaChart=function(r){var n=this;this.waitForLoaded(r,function(){var t=G(r,r.options,{isStacked:true,pointSize:0,areaOpacity:.5}),e=n.createDataTable(r.data,r.xtype);n.drawChart(r,"AreaChart",e,t)})},K.prototype.renderGeoChart=function(n){var a=this;this.waitForLoaded(n,function(){var t={legend:"none",colorAxis:{colors:n.options.colors||["#f6c7b6","#ce502d"]}},e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn("string",""),r.addColumn("number",n.options.label||"Value"),r.addRows(n.data),a.drawChart(n,"GeoChart",r,e)})},K.prototype.renderScatterChart=function(c){var l=this;this.waitForLoaded(c,function(){var t,e,r,n,a=G(c,c.options,{}),o=c.data,i=[];for(t=0;t<o.length;t++)for(o[t].name=o[t].name||"Value",n=o[t].data,e=0;e<n.length;e++){var s=new Array(o.length+1);s[0]=n[e][0],s[t+1]=n[e][1],i.push(s)}for((r=new l.library.visualization.DataTable).addColumn("number",""),t=0;t<o.length;t++)r.addColumn("number",o[t].name);r.addRows(i),l.drawChart(c,"ScatterChart",r,a)})},K.prototype.renderTimeline=function(n){var a=this;this.waitForLoaded(n,"timeline",function(){var t={legend:"none"};n.options.colors&&(t.colors=n.options.colors);var e=q(q(H,t),n.options.library||{}),r=new a.library.visualization.DataTable;r.addColumn({type:"string",id:"Name"}),r.addColumn({type:"date",id:"Start"}),r.addColumn({type:"date",id:"End"}),r.addRows(n.data),n.element.style.lineHeight="normal",a.drawChart(n,"Timeline",r,e)})},K.prototype.destroy=function(t){t.chart&&t.chart.clearChart()},K.prototype.drawChart=function(t,e,r,n){this.destroy(t),t.options.code&&window.console.log("var data = new google.visualization.DataTable("+r.toJSON()+");\nvar chart = new google.visualization."+e+"(element);\nchart.draw(data, "+JSON.stringify(n)+");"),t.chart=new this.library.visualization[e](t.element),function(t){if(window.attachEvent){window.attachEvent("onresize",t)}else if(window.addEventListener){window.addEventListener("resize",t,true)}t()}(function(){t.chart.draw(r,n)})},K.prototype.waitForLoaded=function(t,e,r){var n=this;if(r||(r=e,e="corechart"),F.push({pack:e,callback:r}),N[e])this.runCallbacks();else{N[e]=!0;var a={packages:[e],callback:function(){n.runCallbacks()}},o=t.__config();o.language&&(a.language=o.language),"corechart"===e&&o.mapsApiKey&&(a.mapsApiKey=o.mapsApiKey),this.library.charts.load("current",a)}},K.prototype.runCallbacks=function(){for(var t,e=0;e<F.length;e++)t=F[e],this.library.visualization&&("corechart"===t.pack&&this.library.visualization.LineChart||"timeline"===t.pack&&this.library.visualization.Timeline)&&(t.callback(),F.splice(e,1),e--)},K.prototype.createDataTable=function(t,e){var r,n,a,o,i,s=[],c=[];for(r=0;r<t.length;r++)for(a=t[r],t[r].name=t[r].name||"Value",n=0;n<a.data.length;n++)o=a.data[n],i="datetime"===e?o[0].getTime():o[0],s[i]||(s[i]=new Array(t.length),c.push(i)),s[i][r]=tt(o[1]);var l,u=[],p=!0;for(n=0;n<c.length;n++)r=c[n],"datetime"===e?(l=new Date(tt(r)),p=p&&ot(l)):l="number"===e?tt(r):r,u.push([l].concat(s[r]));if("datetime"===e)u.sort(y);else if("number"===e){for(u.sort(m),r=0;r<u.length;r++)u[r][0]=f(u[r][0]);e="string"}var d=new this.library.visualization.DataTable;for(e="datetime"===e&&p?"date":e,d.addColumn(e,""),r=0;r<t.length;r++)d.addColumn("number",t[r].name);return d.addRows(u),d};var X=[],e=0,r=4;function Y(){if(e<r){var t=X.shift();t&&(e++,function(t,e,a){!function(t,e,r){var n=window.jQuery||window.Zepto||window.$;if(n)n.ajax({dataType:"json",url:t,success:e,error:r,complete:Z});else{var a=new XMLHttpRequest;a.open("GET",t,!0),a.setRequestHeader("Content-Type","application/json"),a.onload=function(){Z(),200===a.status?e(JSON.parse(a.responseText),a.statusText,a):r(a,"error",a.statusText)},a.send()}}(t,e,function(t,e,r){var n="string"==typeof r?r:r.message;a(n)})}(t[0],t[1],t[2]),Y())}}function Z(){e--,Y()}var $={},ut=[];function pt(t,e){document.body.innerText?t.innerText=e:t.textContent=e}function dt(t,e){pt(t,"Error Loading Chart: "+e),t.style.color="#ff0000"}function ht(e){try{e.__render()}catch(t){throw dt(e.element,t.message),t}}function ft(e,t){"string"==typeof t?function(t,e,r){X.push([t,e,r]),Y()}(t,function(t){e.rawData=t,ht(e)},function(t){dt(e.element,t)}):(e.rawData=t,ht(e))}function yt(t,e,r){if(t.addEventListener)return t.addEventListener(e,r,!1),r;var n=function(){return r.call(t,window.event)};return t.attachEvent("on"+e,n),n}function t(t,e,r){t.removeEventListener?t.removeEventListener(e,r,!1):t.detachEvent("on"+e,r)}function mt(t,e){if(t===e)return!1;for(;e&&e!==t;)e=e.parentNode;return e===t}function gt(t){var e=function(t){if(t){if("Highcharts"===t.product)return B;if(t.charts)return K;if(s(t))return T}throw new Error("Unknown adapter")}(t),r=new e(t);-1===ut.indexOf(r)&&ut.push(r)}function bt(t,e){e.options.messages&&e.options.messages.empty&&function(t,e){{if("PieChart"===e||"GeoChart"===e||"Timeline"===e)return 0===t.length;for(var r=0;r<t.length;r++)if(0<t[r].data.length)return!1;return!0}}(e.data,t)?pt(e.element,e.options.messages.empty):(function(t,e){var r,n,a,o;for(a="render"+t,o=e.options.adapter,function(){"Chart"in window&&gt(window.Chart);"Highcharts"in window&&gt(window.Highcharts);window.google&&window.google.charts&&gt(window.google)}(),r=0;r<ut.length;r++)if(n=ut[r],(!o||o===n.name)&&s(n[a]))return e.adapter=n.name,(e.__adapterObject=n)[a](e);throw 0<ut.length?new Error("No charting library found for "+t):new Error("No charting libraries found - be sure to include one before your charts")}(t,e),e.options.download&&!e.__downloadAttached&&"chartjs"===e.adapter&&function(r){var n=r.element,a=document.createElement("a"),o=r.options.download;!0===o?o={}:"string"==typeof o&&(o={filename:o});a.download=o.filename||"chart.png",a.style.position="absolute",a.style.top="20px",a.style.right="20px",a.style.zIndex=1e3,a.style.lineHeight="20px",a.target="_blank";var t=document.createElement("img");t.alt="Download",t.style.border="none",t.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==",a.appendChild(t),n.style.position="relative",r.__downloadAttached=!0,r.__enterEvent=yt(n,"mouseover",function(t){var e=t.relatedTarget;e&&(e===this||mt(this,e))||!r.options.download||(a.href=r.toImage(o),n.appendChild(a))}),r.__leaveEvent=yt(n,"mouseout",function(t){var e=t.relatedTarget;e&&(e===this||mt(this,e))||a.parentNode&&a.parentNode.removeChild(a)})}(e))}var vt=function(t,e){return t="number"===e?tt(t):"datetime"===e?et(t):f(t)},xt=function(t,e){var r,n,a=[];for(n=0;n<t.length;n++)"bubble"===e?a.push([tt(t[n][0]),tt(t[n][1]),tt(t[n][2])]):(r=vt(t[n][0],e),a.push([r,tt(t[n][1])]));return"datetime"===e?a.sort(y):"number"===e&&a.sort(m),a};function zt(t,e){var r,n,a;for(r=0;r<t.length;r++)for(a=l(t[r].data),n=0;n<a.length;n++)if(!e(a[n][0]))return!1;return!0}function Mt(t,e,r){var n,a=t.options,o=t.rawData;for(!i(o)||"object"!=typeof o[0]||i(o[0])?(o=[{name:a.label,data:o}],t.hideLegend=!0):t.hideLegend=!1,t.xtype=e||(a.discrete?"string":function(t,e){return zt(t,p)?"number":!e&&zt(t,u)?"datetime":"string"}(o,r)),o=function(t){var e,r,n=[];for(e=0;e<t.length;e++){var a={};for(r in t[e])t[e].hasOwnProperty(r)&&(a[r]=t[e][r]);n.push(a)}return n}(o),n=0;n<o.length;n++)o[n].data=xt(l(o[n].data),t.xtype);return o}function wt(t){var e,r=l(t.rawData);for(e=0;e<r.length;e++)r[e]=[f(r[e][0]),tt(r[e][1])];return r}var At=function(t,e,r){var n;if("string"==typeof t&&(n=t,!(t=document.getElementById(t))))throw new Error("No element with id "+n);this.element=t,this.options=q(Ct.options,r||{}),this.dataSource=e,ft(Ct.charts[t.id]=this,e),this.options.refresh&&this.startRefresh()};At.prototype.getElement=function(){return this.element},At.prototype.getDataSource=function(){return this.dataSource},At.prototype.getData=function(){return this.data},At.prototype.getOptions=function(){return this.options},At.prototype.getChartObject=function(){return this.chart},At.prototype.getAdapter=function(){return this.adapter},At.prototype.updateData=function(t,e){this.dataSource=t,e&&this.__updateOptions(e),ft(this,t)},At.prototype.setOptions=function(t){this.__updateOptions(t),this.redraw()},At.prototype.redraw=function(){ft(this,this.rawData)},At.prototype.refreshData=function(){if("string"==typeof this.dataSource){var t=-1===this.dataSource.indexOf("?")?"?":"&",e=this.dataSource+t+"_="+(new Date).getTime();ft(this,e)}},At.prototype.startRefresh=function(){var t=this,e=this.options.refresh;if(e&&"string"!=typeof this.dataSource)throw new Error("Data source must be a URL for refresh");if(!this.intervalId){if(!e)throw new Error("No refresh interval");this.intervalId=setInterval(function(){t.refreshData()},1e3*e)}},At.prototype.stopRefresh=function(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)},At.prototype.toImage=function(t){if("chartjs"!==this.adapter)return null;if(t&&t.background&&"transparent"!==t.background){var e=this.chart.chart.canvas,r=this.chart.chart.ctx,n=document.createElement("canvas"),a=n.getContext("2d");return n.width=r.canvas.width,n.height=r.canvas.height,a.fillStyle=t.background,a.fillRect(0,0,n.width,n.height),a.drawImage(e,0,0),n.toDataURL("image/png")}return this.chart.toBase64Image()},At.prototype.destroy=function(){this.__adapterObject&&this.__adapterObject.destroy(this),this.__enterEvent&&t(this.element,"mouseover",this.__enterEvent),this.__leaveEvent&&t(this.element,"mouseout",this.__leaveEvent)},At.prototype.__updateOptions=function(t){var e=t.refresh&&t.refresh!==this.options.refresh;this.options=q(Ct.options,t),e&&(this.stopRefresh(),this.startRefresh())},At.prototype.__render=function(){this.data=this.__processData(),bt(this.__chartName(),this)},At.prototype.__config=function(){return $};var Ct={LineChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this)},e.prototype.__chartName=function(){return"LineChart"},e}(At),PieChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return wt(this)},e.prototype.__chartName=function(){return"PieChart"},e}(At),ColumnChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,null,!0)},e.prototype.__chartName=function(){return"ColumnChart"},e}(At),BarChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,null,!0)},e.prototype.__chartName=function(){return"BarChart"},e}(At),AreaChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this)},e.prototype.__chartName=function(){return"AreaChart"},e}(At),GeoChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return wt(this)},e.prototype.__chartName=function(){return"GeoChart"},e}(At),ScatterChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,"number")},e.prototype.__chartName=function(){return"ScatterChart"},e}(At),BubbleChart:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){return Mt(this,"bubble")},e.prototype.__chartName=function(){return"BubbleChart"},e}(At),Timeline:function(t){function e(){t.apply(this,arguments)}return t&&(e.__proto__=t),((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.__processData=function(){var t,e=this.rawData;for(t=0;t<e.length;t++)e[t][1]=et(e[t][1]),e[t][2]=et(e[t][2]);return e},e.prototype.__chartName=function(){return"Timeline"},e}(At),charts:{},configure:function(t){for(var e in t)t.hasOwnProperty(e)&&($[e]=t[e])},setDefaultOptions:function(t){Ct.options=t},eachChart:function(t){for(var e in Ct.charts)Ct.charts.hasOwnProperty(e)&&t(Ct.charts[e])},config:$,options:{},adapters:ut,addAdapter:gt,use:function(t){return gt(t),Ct}};return"undefined"==typeof window||window.Chartkick||(window.Chartkick=Ct),Ct.default=Ct}()}),p=t(function(t,e){function r(t){var e=[];for(var r in t)e.push(r);return e}(t.exports="function"==typeof Object.keys?Object.keys:r).shim=r}),d=(p.shim,t(function(t,e){var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();function n(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function a(t){return t&&"object"==typeof t&&"number"==typeof t.length&&Object.prototype.hasOwnProperty.call(t,"callee")&&!Object.prototype.propertyIsEnumerable.call(t,"callee")||!1}(e=t.exports=r?n:a).supported=n,e.unsupported=a})),n=(d.supported,d.unsupported,t(function(t){var s=Array.prototype.slice,c=t.exports=function(t,e,r){return r||(r={}),t===e||(t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():!t||!e||"object"!=typeof t&&"object"!=typeof e?r.strict?t===e:t==e:function(t,e,r){var n,a;if(l(t)||l(e))return!1;if(t.prototype!==e.prototype)return!1;if(d(t))return!!d(e)&&(t=s.call(t),e=s.call(e),c(t,e,r));if(u(t)){if(!u(e))return!1;if(t.length!==e.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}try{var o=p(t),i=p(e)}catch(t){return!1}if(o.length!=i.length)return!1;for(o.sort(),i.sort(),n=o.length-1;0<=n;n--)if(o[n]!=i[n])return!1;for(n=o.length-1;0<=n;n--)if(a=o[n],!c(t[a],e[a],r))return!1;return typeof t==typeof e}(t,e,r))};function l(t){return null==t}function u(t){return!(!t||"object"!=typeof t||"number"!=typeof t.length)&&("function"==typeof t.copy&&"function"==typeof t.slice&&!(0<t.length&&"number"!=typeof t[0]))}})),a=function(t){return function(t){return!!t&&"object"==typeof t}(t)&&!function(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||function(t){return t.$$typeof===o}(t)}(t)};var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function i(t,e){return!1!==e.clone&&e.isMergeableObject(t)?c(function(t){return Array.isArray(t)?[]:{}}(t),t,e):t}function s(t,e,r){return t.concat(e).map(function(t){return i(t,r)})}function c(t,e,r){(r=r||{}).arrayMerge=r.arrayMerge||s,r.isMergeableObject=r.isMergeableObject||a;var n=Array.isArray(e);return n===Array.isArray(t)?n?r.arrayMerge(t,e,r):function(e,r,n){var a={};return n.isMergeableObject(e)&&Object.keys(e).forEach(function(t){a[t]=i(e[t],n)}),Object.keys(r).forEach(function(t){n.isMergeableObject(r[t])&&e[t]?a[t]=c(e[t],r[t],n):a[t]=i(r[t],n)}),a}(t,e,r):i(e,r)}c.all=function(t,r){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,e){return c(t,e,r)},{})};function l(t,e,r){var a=["adapter","colors","curve","dataset","decimal","discrete","donut","download","label","legend","library","max","messages","min","points","prefix","refresh","stacked","suffix","thousands","title","xmax","xmin","xtitle","ytitle"];t.component(e,{props:["data","id","width","height"].concat(a),render:function(t){return t("div",{attrs:{id:this.chartId},style:this.chartStyle},["Loading..."])},data:function(){return{chartId:null}},computed:{chartStyle:function(){return this.data,this.chartOptions,{height:this.height||"300px",lineHeight:this.height||"300px",width:this.width||"100%",textAlign:"center",color:"#999",fontSize:"14px",fontFamily:"'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif"}},chartOptions:function(){for(var t={},e=a,r=0;r<e.length;r++){var n=e[r];void 0!==this[n]&&(t[n]=this[n])}return t}},created:function(){this.chartId=this.chartId||this.id||"chart-"+h++},mounted:function(){this.updateChart(),this.savedState=this.currentState()},updated:function(){var t=this.currentState();n(t,this.savedState)||(this.updateChart(),this.savedState=t)},beforeDestroy:function(){this.chart&&this.chart.destroy()},methods:{updateChart:function(){null!==this.data?this.chart?this.chart.updateData(this.data,this.chartOptions):this.chart=new r(this.chartId,this.data,this.chartOptions):this.chart&&(this.chart.destroy(),this.chart=null,this.$el.innerText="Loading...")},currentState:function(){return u({},{data:this.data,chartOptions:this.chartOptions})}}})}var u=c,h=1;r.version="0.5.2",r.install=function(t,e){e&&e.adapter&&r.addAdapter(e.adapter),l(t,"line-chart",r.LineChart),l(t,"pie-chart",r.PieChart),l(t,"column-chart",r.ColumnChart),l(t,"bar-chart",r.BarChart),l(t,"area-chart",r.AreaChart),l(t,"scatter-chart",r.ScatterChart),l(t,"geo-chart",r.GeoChart),l(t,"timeline",r.Timeline)};var e=r;return"undefined"!=typeof window&&window.Vue&&window.Vue.use(e),e});
{
"name": "vue-chartkick",
"version": "0.5.1",
"version": "0.5.2",
"description": "Create beautiful JavaScript charts with one line of Vue",

@@ -34,3 +34,3 @@ "main": "dist/vue-chartkick.js",

"dependencies": {
"chartkick": "^3.1.0",
"chartkick": "^3.1.1",
"deep-equal": "^1.0.1",

@@ -37,0 +37,0 @@ "deepmerge": "^2.1.1"

@@ -22,5 +22,5 @@ # Vue Chartkick

import Chartkick from 'vue-chartkick'
import 'chart.js'
import Chart from 'chart.js'
Vue.use(Chartkick)
Vue.use(Chartkick.use(Chart))
```

@@ -309,5 +309,5 @@

import Chartkick from 'vue-chartkick'
import 'chart.js'
import Chart from 'chart.js'
Vue.use(Chartkick)
Vue.use(Chartkick.use(Chart))
```

@@ -359,4 +359,3 @@

Chartkick.use(Highcharts)
Vue.use(Chartkick)
Vue.use(Chartkick.use(Highcharts))
```

@@ -370,3 +369,3 @@

<script src="https://unpkg.com/chart.js@2.8.0/dist/Chart.bundle.js"></script>
<script src="https://unpkg.com/vue-chartkick@0.5.0"></script>
<script src="https://unpkg.com/vue-chartkick@0.5.2"></script>
```

@@ -378,3 +377,3 @@

```javascript
```vue
<line-chart adapter="google"></line-chart>

@@ -381,0 +380,0 @@ ```

Sorry, the diff of this file is too big to display