vue-chartjs
Advanced tools
Comparing version 3.0.2 to 3.1.0
# Change Log | ||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
<a name="3.1.0"></a> | ||
# [3.1.0](https://github.com/apertureless/vue-chartjs/compare/v3.0.2...v3.1.0) (2018-01-12) | ||
### Bug Fixes | ||
* **mixins:** Check for chartjs instance before rendering chart ([39ff839](https://github.com/apertureless/vue-chartjs/commit/39ff839)), closes [#288](https://github.com/apertureless/vue-chartjs/issues/288) | ||
### Features | ||
* **charts:** Remove default styling ([ac5d4d8](https://github.com/apertureless/vue-chartjs/commit/ac5d4d8)) | ||
# Change Log | ||
## [v3.0.1](https://github.com/apertureless/vue-chartjs/tree/v3.0.1) (2017-11-06) | ||
@@ -4,0 +23,0 @@ [Full Changelog](https://github.com/apertureless/vue-chartjs/compare/v3.0.0...v3.0.1) |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("chart.js")):"function"==typeof define&&define.amd?define("VueChartJs",["chart.js"],e):"object"==typeof exports?exports.VueChartJs=e(require("chart.js")):t.VueChartJs=e(t.Chart)}(this,function(t){return function(t){function e(n){if(r[n])return r[n].exports;var a=r[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,e),a.l=!0,a.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,n){e.o(t,r)||Object.defineProperty(t,r,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(e,r){e.exports=t},function(t,e,r){"use strict";function n(t,e){return o()(t,e)}Object.defineProperty(e,"__esModule",{value:!0});var a=r(0),s=r.n(a),i=r(2),o=r.n(i),u={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{scales:{yAxes:[{ticks:{beginAtZero:!0},gridLines:{display:!1}}],xAxes:[{gridLines:{display:!1},categoryPercentage:.5,barPercentage:.2}]}},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"bar",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},c={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"horizontalbar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{scales:{yAxes:[{ticks:{beginAtZero:!0},gridLines:{display:!1}}],xAxes:[{gridLines:{display:!1},categoryPercentage:.5,barPercentage:.2}]}},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e,r){var a=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"horizontalBar",data:t,options:a,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},l={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"doughnut-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"doughnut",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},h={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"line-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{scales:{yAxes:[{ticks:{beginAtZero:!0},gridLines:{display:!1}}],xAxes:[{gridLines:{display:!1}}]}},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"line",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},d={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"pie-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"pie",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},f={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"polar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"polarArea",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},p={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"radar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"radar",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},y={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bubble-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{scales:{yAxes:[{ticks:{beginAtZero:!0},gridLines:{display:!1}}],xAxes:[{gridLines:{display:!1},categoryPercentage:.5,barPercentage:.2}]}},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"bubble",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},b={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"scatter-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object}},data:function(){return{_chart:null,defaultOptions:{scales:{xAxes:[{type:"linear",position:"bottom"}]}},plugins:[]}},methods:{addPlugin:function(t){this.plugins.push(t)},renderChart:function(t,e){var r=n(this.defaultOptions,e);this.$data._chart=new s.a(this.$refs.canvas.getContext("2d"),{type:"scatter",data:t,options:r,plugins:this.plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},g=r(5),v=r.n(g),_=r(6),m=r.n(_),j={reactiveData:v.a,reactiveProp:m.a},w=r(7),O=r.n(w);r.d(e,"VueCharts",function(){return x}),r.d(e,"Bar",function(){return u}),r.d(e,"HorizontalBar",function(){return c}),r.d(e,"Doughnut",function(){return l}),r.d(e,"Line",function(){return h}),r.d(e,"Pie",function(){return d}),r.d(e,"PolarArea",function(){return f}),r.d(e,"Radar",function(){return p}),r.d(e,"Bubble",function(){return y}),r.d(e,"Scatter",function(){return b}),r.d(e,"mixins",function(){return j});var x={version:O.a.version,Bar:u,HorizontalBar:c,Doughnut:l,Line:h,Pie:d,PolarArea:f,Radar:p,Bubble:y,Scatter:b,mixins:j};e.default=x},function(t,e,r){(function(t,r){function n(t,e){return t.set(e[0],e[1]),t}function a(t,e){return t.add(e),t}function s(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}function i(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););return t}function o(t,e){for(var r=-1,n=e.length,a=t.length;++r<n;)t[a+r]=e[r];return t}function u(t,e,r,n){var a=-1,s=t?t.length:0;for(n&&s&&(r=t[++a]);++a<s;)r=e(r,t[a],a,t);return r}function c(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}function l(t,e){return null==t?void 0:t[e]}function h(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function d(t){var e=-1,r=Array(t.size);return t.forEach(function(t,n){r[++e]=[n,t]}),r}function f(t,e){return function(r){return t(e(r))}}function p(t){var e=-1,r=Array(t.size);return t.forEach(function(t){r[++e]=t}),r}function y(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function b(){this.__data__=Ye?Ye(null):{}}function g(t){return this.has(t)&&delete this.__data__[t]}function v(t){var e=this.__data__;if(Ye){var r=e[t];return r===Mt?void 0:r}return Ie.call(e,t)?e[t]:void 0}function _(t){var e=this.__data__;return Ye?void 0!==e[t]:Ie.call(e,t)}function m(t,e){return this.__data__[t]=Ye&&void 0===e?Mt:e,this}function j(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function w(){this.__data__=[]}function O(t){var e=this.__data__,r=T(e,t);return!(r<0)&&(r==e.length-1?e.pop():Re.call(e,r,1),!0)}function x(t){var e=this.__data__,r=T(e,t);return r<0?void 0:e[r][1]}function k(t){return T(this.__data__,t)>-1}function C(t,e){var r=this.__data__,n=T(r,t);return n<0?r.push([t,e]):r[n][1]=e,this}function $(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function A(){this.__data__={hash:new y,map:new(Ge||j),string:new y}}function P(t){return ft(this,t).delete(t)}function S(t){return ft(this,t).get(t)}function L(t){return ft(this,t).has(t)}function D(t,e){return ft(this,t).set(t,e),this}function I(t){this.__data__=new j(t)}function N(){this.__data__=new j}function E(t){return this.__data__.delete(t)}function B(t){return this.__data__.get(t)}function J(t){return this.__data__.has(t)}function z(t,e){var r=this.__data__;if(r instanceof j){var n=r.__data__;if(!Ge||n.length<Vt-1)return n.push([t,e]),this;r=this.__data__=new $(n)}return r.set(t,e),this}function V(t,e){var r=cr(t)||Ct(t)?c(t.length,String):[],n=r.length,a=!!n;for(var s in t)!e&&!Ie.call(t,s)||a&&("length"==s||vt(s,n))||r.push(s);return r}function M(t,e,r){(void 0===r||kt(t[e],r))&&("number"!=typeof e||void 0!==r||e in t)||(t[e]=r)}function F(t,e,r){var n=t[e];Ie.call(t,e)&&kt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function T(t,e){for(var r=t.length;r--;)if(kt(t[r][0],e))return r;return-1}function R(t,e){return t&<(e,Et(e),t)}function U(t,e,r,n,a,s,o){var u;if(n&&(u=s?n(t,a,s,o):n(t)),void 0!==u)return u;if(!Lt(t))return t;var c=cr(t);if(c){if(u=yt(t),!e)return ct(t,u)}else{var l=ur(t),d=l==Zt||l==qt;if(lr(t))return et(t,e);if(l==Gt||l==Tt||d&&!s){if(h(t))return s?t:{};if(u=bt(d?{}:t),!e)return ht(t,R(u,t))}else{if(!ge[l])return s?t:{};u=gt(t,l,U,e)}}o||(o=new I);var f=o.get(t);if(f)return f;if(o.set(t,u),!c)var p=r?dt(t):Et(t);return i(p||t,function(a,s){p&&(s=a,a=t[s]),F(u,s,U(a,e,r,n,s,t,o))}),u}function Z(t){return Lt(t)?Fe(t):{}}function q(t,e,r){var n=e(t);return cr(t)?n:o(n,r(t))}function W(t){return Ee.call(t)}function H(t){return!(!Lt(t)||jt(t))&&(Pt(t)||h(t)?Be:pe).test(xt(t))}function G(t){return Dt(t)&&St(t.length)&&!!be[Ee.call(t)]}function K(t){if(!wt(t))return qe(t);var e=[];for(var r in Object(t))Ie.call(t,r)&&"constructor"!=r&&e.push(r);return e}function Q(t){if(!Lt(t))return Ot(t);var e=wt(t),r=[];for(var n in t)("constructor"!=n||!e&&Ie.call(t,n))&&r.push(n);return r}function X(t,e,r,n,a){if(t!==e){if(!cr(e)&&!hr(e))var s=Q(e);i(s||e,function(i,o){if(s&&(o=i,i=e[o]),Lt(i))a||(a=new I),Y(t,e,o,r,X,n,a);else{var u=n?n(t[o],i,o+"",t,e,a):void 0;void 0===u&&(u=i),M(t,o,u)}})}}function Y(t,e,r,n,a,s,i){var o=t[r],u=e[r],c=i.get(u);if(c)return void M(t,r,c);var l=s?s(o,u,r+"",t,e,i):void 0,h=void 0===l;h&&(l=u,cr(u)||hr(u)?cr(o)?l=o:At(o)?l=ct(o):(h=!1,l=U(u,!0)):It(u)||Ct(u)?Ct(o)?l=Nt(o):!Lt(o)||n&&Pt(o)?(h=!1,l=U(u,!0)):l=o:h=!1),h&&(i.set(u,l),a(l,u,n,s,i),i.delete(u)),M(t,r,l)}function tt(t,e){return e=We(void 0===e?t.length-1:e,0),function(){for(var r=arguments,n=-1,a=We(r.length-e,0),i=Array(a);++n<a;)i[n]=r[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=r[n];return o[e]=i,s(t,this,o)}}function et(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function rt(t){var e=new t.constructor(t.byteLength);return new Ve(e).set(new Ve(t)),e}function nt(t,e){var r=e?rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}function at(t,e,r){return u(e?r(d(t),!0):d(t),n,new t.constructor)}function st(t){var e=new t.constructor(t.source,fe.exec(t));return e.lastIndex=t.lastIndex,e}function it(t,e,r){return u(e?r(p(t),!0):p(t),a,new t.constructor)}function ot(t){return ir?Object(ir.call(t)):{}}function ut(t,e){var r=e?rt(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}function ct(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}function lt(t,e,r,n){r||(r={});for(var a=-1,s=e.length;++a<s;){var i=e[a],o=n?n(r[i],t[i],i,r,t):void 0;F(r,i,void 0===o?t[i]:o)}return r}function ht(t,e){return lt(t,or(t),e)}function dt(t){return q(t,Et,or)}function ft(t,e){var r=t.__data__;return mt(e)?r["string"==typeof e?"string":"hash"]:r.map}function pt(t,e){var r=l(t,e);return H(r)?r:void 0}function yt(t){var e=t.length,r=t.constructor(e);return e&&"string"==typeof t[0]&&Ie.call(t,"index")&&(r.index=t.index,r.input=t.input),r}function bt(t){return"function"!=typeof t.constructor||wt(t)?{}:Z(Me(t))}function gt(t,e,r,n){var a=t.constructor;switch(e){case ee:return rt(t);case Rt:case Ut:return new a(+t);case re:return nt(t,n);case ne:case ae:case se:case ie:case oe:case ue:case ce:case le:case he:return ut(t,n);case Wt:return at(t,n,r);case Ht:case Xt:return new a(t);case Kt:return st(t);case Qt:return it(t,n,r);case Yt:return ot(t)}}function vt(t,e){return!!(e=null==e?Ft:e)&&("number"==typeof t||ye.test(t))&&t>-1&&t%1==0&&t<e}function _t(t,e,r){if(!Lt(r))return!1;var n=typeof e;return!!("number"==n?$t(r)&&vt(e,r.length):"string"==n&&e in r)&&kt(r[e],t)}function mt(t){var e=typeof t;return"string"==e||"number"==e||"symbol"==e||"boolean"==e?"__proto__"!==t:null===t}function jt(t){return!!Le&&Le in t}function wt(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Pe)}function Ot(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}function xt(t){if(null!=t){try{return De.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function kt(t,e){return t===e||t!==t&&e!==e}function Ct(t){return At(t)&&Ie.call(t,"callee")&&(!Te.call(t,"callee")||Ee.call(t)==Tt)}function $t(t){return null!=t&&St(t.length)&&!Pt(t)}function At(t){return Dt(t)&&$t(t)}function Pt(t){var e=Lt(t)?Ee.call(t):"";return e==Zt||e==qt}function St(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=Ft}function Lt(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Dt(t){return!!t&&"object"==typeof t}function It(t){if(!Dt(t)||Ee.call(t)!=Gt||h(t))return!1;var e=Me(t);if(null===e)return!0;var r=Ie.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==Ne}function Nt(t){return lt(t,Bt(t))}function Et(t){return $t(t)?V(t):K(t)}function Bt(t){return $t(t)?V(t,!0):Q(t)}function Jt(){return[]}function zt(){return!1}var Vt=200,Mt="__lodash_hash_undefined__",Ft=9007199254740991,Tt="[object Arguments]",Rt="[object Boolean]",Ut="[object Date]",Zt="[object Function]",qt="[object GeneratorFunction]",Wt="[object Map]",Ht="[object Number]",Gt="[object Object]",Kt="[object RegExp]",Qt="[object Set]",Xt="[object String]",Yt="[object Symbol]",te="[object WeakMap]",ee="[object ArrayBuffer]",re="[object DataView]",ne="[object Float32Array]",ae="[object Float64Array]",se="[object Int8Array]",ie="[object Int16Array]",oe="[object Int32Array]",ue="[object Uint8Array]",ce="[object Uint8ClampedArray]",le="[object Uint16Array]",he="[object Uint32Array]",de=/[\\^$.*+?()[\]{}|]/g,fe=/\w*$/,pe=/^\[object .+?Constructor\]$/,ye=/^(?:0|[1-9]\d*)$/,be={};be[ne]=be[ae]=be[se]=be[ie]=be[oe]=be[ue]=be[ce]=be[le]=be[he]=!0,be[Tt]=be["[object Array]"]=be[ee]=be[Rt]=be[re]=be[Ut]=be["[object Error]"]=be[Zt]=be[Wt]=be[Ht]=be[Gt]=be[Kt]=be[Qt]=be[Xt]=be[te]=!1;var ge={};ge[Tt]=ge["[object Array]"]=ge[ee]=ge[re]=ge[Rt]=ge[Ut]=ge[ne]=ge[ae]=ge[se]=ge[ie]=ge[oe]=ge[Wt]=ge[Ht]=ge[Gt]=ge[Kt]=ge[Qt]=ge[Xt]=ge[Yt]=ge[ue]=ge[ce]=ge[le]=ge[he]=!0,ge["[object Error]"]=ge[Zt]=ge[te]=!1;var ve="object"==typeof t&&t&&t.Object===Object&&t,_e="object"==typeof self&&self&&self.Object===Object&&self,me=ve||_e||Function("return this")(),je="object"==typeof e&&e&&!e.nodeType&&e,we=je&&"object"==typeof r&&r&&!r.nodeType&&r,Oe=we&&we.exports===je,xe=Oe&&ve.process,ke=function(){try{return xe&&xe.binding("util")}catch(t){}}(),Ce=ke&&ke.isTypedArray,$e=Array.prototype,Ae=Function.prototype,Pe=Object.prototype,Se=me["__core-js_shared__"],Le=function(){var t=/[^.]+$/.exec(Se&&Se.keys&&Se.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}(),De=Ae.toString,Ie=Pe.hasOwnProperty,Ne=De.call(Object),Ee=Pe.toString,Be=RegExp("^"+De.call(Ie).replace(de,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Je=Oe?me.Buffer:void 0,ze=me.Symbol,Ve=me.Uint8Array,Me=f(Object.getPrototypeOf,Object),Fe=Object.create,Te=Pe.propertyIsEnumerable,Re=$e.splice,Ue=Object.getOwnPropertySymbols,Ze=Je?Je.isBuffer:void 0,qe=f(Object.keys,Object),We=Math.max,He=pt(me,"DataView"),Ge=pt(me,"Map"),Ke=pt(me,"Promise"),Qe=pt(me,"Set"),Xe=pt(me,"WeakMap"),Ye=pt(Object,"create"),tr=xt(He),er=xt(Ge),rr=xt(Ke),nr=xt(Qe),ar=xt(Xe),sr=ze?ze.prototype:void 0,ir=sr?sr.valueOf:void 0;y.prototype.clear=b,y.prototype.delete=g,y.prototype.get=v,y.prototype.has=_,y.prototype.set=m,j.prototype.clear=w,j.prototype.delete=O,j.prototype.get=x,j.prototype.has=k,j.prototype.set=C,$.prototype.clear=A,$.prototype.delete=P,$.prototype.get=S,$.prototype.has=L,$.prototype.set=D,I.prototype.clear=N,I.prototype.delete=E,I.prototype.get=B,I.prototype.has=J,I.prototype.set=z;var or=Ue?f(Ue,Object):Jt,ur=W;(He&&ur(new He(new ArrayBuffer(1)))!=re||Ge&&ur(new Ge)!=Wt||Ke&&"[object Promise]"!=ur(Ke.resolve())||Qe&&ur(new Qe)!=Qt||Xe&&ur(new Xe)!=te)&&(ur=function(t){var e=Ee.call(t),r=e==Gt?t.constructor:void 0,n=r?xt(r):void 0;if(n)switch(n){case tr:return re;case er:return Wt;case rr:return"[object Promise]";case nr:return Qt;case ar:return te}return e});var cr=Array.isArray,lr=Ze||zt,hr=Ce?function(t){return function(e){return t(e)}}(Ce):G,dr=function(t){return tt(function(e,r){var n=-1,a=r.length,s=a>1?r[a-1]:void 0,i=a>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(a--,s):void 0,i&&_t(r[0],r[1],i)&&(s=a<3?void 0:s,a=1),e=Object(e);++n<a;){var o=r[n];o&&t(e,o,n,s)}return e})}(function(t,e,r){X(t,e,r)});r.exports=dr}).call(e,r(3),r(4)(t))},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports={data:function(){return{chartData:null}},watch:{chartData:{handler:function(t,e){if(e){var r=this.$data._chart,n=t.datasets.map(function(t){return t.label}),a=e.datasets.map(function(t){return t.label}),s=JSON.stringify(a);JSON.stringify(n)===s&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,n){var a=Object.keys(e.datasets[n]),s=Object.keys(t);a.filter(function(t){return"_meta"!==t&&-1===s.indexOf(t)}).forEach(function(t){delete r.data.datasets[n][t]});for(var i in t)t.hasOwnProperty(i)&&(r.data.datasets[n][i]=t[i])}),t.hasOwnProperty("labels")&&(r.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(r.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(r.data.yLabels=t.yLabels),r.update()):(r.destroy(),this.renderChart(this.chartData,this.options))}else this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={props:{chartData:{required:!0}},watch:{chartData:{handler:function(t,e){if(e){var r=this.$data._chart,n=t.datasets.map(function(t){return t.label}),a=e.datasets.map(function(t){return t.label}),s=JSON.stringify(a);JSON.stringify(n)===s&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,n){var a=Object.keys(e.datasets[n]),s=Object.keys(t);a.filter(function(t){return"_meta"!==t&&-1===s.indexOf(t)}).forEach(function(t){delete r.data.datasets[n][t]});for(var i in t)t.hasOwnProperty(i)&&(r.data.datasets[n][i]=t[i])}),t.hasOwnProperty("labels")&&(r.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(r.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(r.data.yLabels=t.yLabels),r.update()):(r.destroy(),this.renderChart(this.chartData,this.options))}else this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={name:"vue-chartjs",version:"3.0.2",description:"Vue.js wrapper for chart.js for creating beautiful charts.",author:"Jakub Juszczak <jakub@posteo.de>",homepage:"http://vue-chartjs.org",license:"MIT",contributors:[{name:"Thorsten Lünborg",web:"https://github.com/LinusBorg"},{name:"Juan Carlos Alonso",web:"https://github.com/jcalonso"}],maintainers:[{name:"Jakub Juszczak",email:"jakub@posteo.de",web:"http://www.jakubjuszczak.de"}],repository:{type:"git",url:"git+ssh://git@github.com:apertureless/vue-chartjs.git"},bugs:{url:"https://github.com/apertureless/vue-chartjs/issues"},keywords:["ChartJs","Vue","Visualisation","Wrapper","Charts"],main:"dist/vue-chartjs.js",unpkg:"dist/vue-chartjs.min.js",module:"es/index.js","jsnext:main":"es/index.js",files:["src","dist","es"],scripts:{dev:"node build/dev-server.js",build:"yarn run release && yarn run build:es","build:es":"cross-env BABEL_ENV=es babel src --out-dir es",unit:"karma start test/unit/karma.conf.js --single-run",e2e:"node test/e2e/runner.js",test:"npm run unit",lint:"eslint --ext .js,.vue src test/unit/specs test/e2e/specs",release:"webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js",prepublishOnly:"yarn run lint && yarn run test && yarn run build"},dependencies:{"lodash.merge":"^4.6.0"},peerDependencies:{"chart.js":"2.7.x"},devDependencies:{"@babel/cli":"^7.0.0-beta.31","@babel/core":"^7.0.0-beta.31","@babel/preset-env":"^7.0.0-beta.31","@babel/preset-stage-2":"^7.0.0-beta.31","babel-loader":"8.0.0-beta.0",chai:"^3.5.0","chart.js":"2.7.0",chromedriver:"^2.28.0","connect-history-api-fallback":"^1.1.0","cross-env":"^3.2.4","cross-spawn":"^5.1.0","css-loader":"^0.28.0",eslint:"^3.19.0","eslint-config-standard":"^10.2.1","eslint-friendly-formatter":"^2.0.7","eslint-loader":"^1.7.1","eslint-plugin-html":"^2.0.1","eslint-plugin-import":"^2.2.0","eslint-plugin-node":"^4.2.2","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","eventsource-polyfill":"^0.9.6",express:"^4.15.2","extract-text-webpack-plugin":"^3.0.1","file-loader":"^0.10.1","friendly-errors-webpack-plugin":"^1.6.1","function-bind":"^1.0.2","html-webpack-plugin":"^2.28.0","http-proxy-middleware":"^0.17.4","inject-loader":"^3.0.0",isparta:"^4.0.0","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.5.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.0.2","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.4","karma-phantomjs-shim":"^1.4.0","karma-sinon-chai":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.30","karma-webpack":"2",lolex:"^1.6.0",mocha:"^3.1.0",nightwatch:"^0.9.14",opn:"^5.1.0",ora:"^1.2.0","phantomjs-prebuilt":"^2.1.13",portfinder:"^1.0.13","selenium-server":"^3.3.1",shelljs:"^0.7.7",sinon:"^2.1.0","sinon-chai":"^2.9.0","url-loader":"^0.5.8",vue:"2.5.2","vue-hot-reload-api":"2.1.0","vue-html-loader":"^1.2.4","vue-loader":"^13.3.0","vue-style-loader":"3.0.1","vue-template-compiler":"2.5.2",webpack:"^3.7.1","webpack-dev-middleware":"^1.10.1","webpack-hot-middleware":"^2.17.1","webpack-merge":"^4.1.0"},engines:{node:">=6.9.0",npm:">= 3.0.0"},browserify:{transform:["babelify"]},greenkeeper:{ignore:["extract-text-webpack-plugin","karma-webpack","webpack","webpack-merge"]}}}])}); | ||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("chart.js")):"function"==typeof define&&define.amd?define("VueChartJs",["chart.js"],e):"object"==typeof exports?exports.VueChartJs=e(require("chart.js")):t.VueChartJs=e(t.Chart)}("undefined"!=typeof self?self:this,function(t){return function(t){function e(s){if(a[s])return a[s].exports;var r=a[s]={i:s,l:!1,exports:{}};return t[s].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var a={};return e.m=t,e.c=a,e.d=function(t,a,s){e.o(t,a)||Object.defineProperty(t,a,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var a=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(a,"a",a),a},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=1)}([function(e,a){e.exports=t},function(t,e,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=a(0),r=a.n(s),n={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"bar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},i={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"horizontalbar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"horizontalBar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},u={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"doughnut-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"doughnut",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},h={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"line-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"line",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},d={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"pie-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"pie",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},l={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"polar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"polarArea",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},c={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"radar-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"radar",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},o={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"bubble-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"bubble",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},p={render:function(t){return t("div",{style:this.styles,class:this.cssClasses},[t("canvas",{attrs:{id:this.chartId,width:this.width,height:this.height},ref:"canvas"})])},props:{chartId:{default:"scatter-chart",type:String},width:{default:400,type:Number},height:{default:400,type:Number},cssClasses:{type:String,default:""},styles:{type:Object},plugins:{type:Array,default:function(){return[]}}},data:function(){return{_chart:null,_plugins:this.plugins}},methods:{addPlugin:function(t){this.$data._plugins.push(t)},renderChart:function(t,e){this.$data._chart=new r.a(this.$refs.canvas.getContext("2d"),{type:"scatter",data:t,options:e,plugins:this.$data._plugins})}},beforeDestroy:function(){this.$data._chart&&this.$data._chart.destroy()}},f=a(2),y=a.n(f),g=a(3),b=a.n(g),m={reactiveData:y.a,reactiveProp:b.a},v=a(4),_=a.n(v);a.d(e,"VueCharts",function(){return w}),a.d(e,"Bar",function(){return n}),a.d(e,"HorizontalBar",function(){return i}),a.d(e,"Doughnut",function(){return u}),a.d(e,"Line",function(){return h}),a.d(e,"Pie",function(){return d}),a.d(e,"PolarArea",function(){return l}),a.d(e,"Radar",function(){return c}),a.d(e,"Bubble",function(){return o}),a.d(e,"Scatter",function(){return p}),a.d(e,"mixins",function(){return m});var w={version:_.a.version,Bar:n,HorizontalBar:i,Doughnut:u,Line:h,Pie:d,PolarArea:l,Radar:c,Bubble:o,Scatter:p,mixins:m};e.default=w},function(t,e){t.exports={data:function(){return{chartData:null}},watch:{chartData:{handler:function(t,e){if(e){var a=this.$data._chart,s=t.datasets.map(function(t){return t.label}),r=e.datasets.map(function(t){return t.label}),n=JSON.stringify(r);JSON.stringify(s)===n&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,s){var r=Object.keys(e.datasets[s]),n=Object.keys(t);r.filter(function(t){return"_meta"!==t&&-1===n.indexOf(t)}).forEach(function(t){delete a.data.datasets[s][t]});for(var i in t)t.hasOwnProperty(i)&&(a.data.datasets[s][i]=t[i])}),t.hasOwnProperty("labels")&&(a.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(a.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(a.data.yLabels=t.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={props:{chartData:{required:!0}},watch:{chartData:{handler:function(t,e){if(e){var a=this.$data._chart,s=t.datasets.map(function(t){return t.label}),r=e.datasets.map(function(t){return t.label}),n=JSON.stringify(r);JSON.stringify(s)===n&&e.datasets.length===t.datasets.length?(t.datasets.forEach(function(t,s){var r=Object.keys(e.datasets[s]),n=Object.keys(t);r.filter(function(t){return"_meta"!==t&&-1===n.indexOf(t)}).forEach(function(t){delete a.data.datasets[s][t]});for(var i in t)t.hasOwnProperty(i)&&(a.data.datasets[s][i]=t[i])}),t.hasOwnProperty("labels")&&(a.data.labels=t.labels),t.hasOwnProperty("xLabels")&&(a.data.xLabels=t.xLabels),t.hasOwnProperty("yLabels")&&(a.data.yLabels=t.yLabels),a.update()):(a.destroy(),this.renderChart(this.chartData,this.options))}else this.$data._chart&&this.$data._chart.destroy(),this.renderChart(this.chartData,this.options)}}}}},function(t,e){t.exports={name:"vue-chartjs",version:"3.1.0",description:"Vue.js wrapper for chart.js for creating beautiful charts.",author:"Jakub Juszczak <jakub@posteo.de>",homepage:"http://vue-chartjs.org",license:"MIT",contributors:[{name:"Thorsten Lünborg",web:"https://github.com/LinusBorg"},{name:"Juan Carlos Alonso",web:"https://github.com/jcalonso"}],maintainers:[{name:"Jakub Juszczak",email:"jakub@posteo.de",web:"http://www.jakubjuszczak.de"}],repository:{type:"git",url:"git+ssh://git@github.com:apertureless/vue-chartjs.git"},bugs:{url:"https://github.com/apertureless/vue-chartjs/issues"},keywords:["ChartJs","Vue","Visualisation","Wrapper","Charts"],main:"dist/vue-chartjs.js",unpkg:"dist/vue-chartjs.min.js",module:"es/index.js","jsnext:main":"es/index.js",files:["src","dist","es"],scripts:{dev:"node build/dev-server.js",build:"yarn run release && yarn run build:es","build:es":"cross-env BABEL_ENV=es babel src --out-dir es",unit:"karma start test/unit/karma.conf.js --single-run",e2e:"node test/e2e/runner.js",test:"npm run unit",lint:"eslint --ext .js,.vue src test/unit/specs test/e2e/specs",release:"webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js",prepublishOnly:"yarn run lint && yarn run test && yarn run build"},dependencies:{},peerDependencies:{"chart.js":"2.7.x"},devDependencies:{"@babel/cli":"^7.0.0-beta.31","@babel/core":"^7.0.0-beta.31","@babel/preset-env":"^7.0.0-beta.31","@babel/preset-stage-2":"^7.0.0-beta.31","babel-loader":"8.0.0-beta.0",chai:"^3.5.0","chart.js":"2.7.0",chromedriver:"^2.28.0","connect-history-api-fallback":"^1.1.0","cross-env":"^5.1.1","cross-spawn":"^5.1.0","css-loader":"^0.28.0",eslint:"^3.19.0","eslint-config-standard":"^10.2.1","eslint-friendly-formatter":"^2.0.7","eslint-loader":"^1.7.1","eslint-plugin-html":"^2.0.1","eslint-plugin-import":"^2.2.0","eslint-plugin-node":"^4.2.2","eslint-plugin-promise":"^3.5.0","eslint-plugin-standard":"^3.0.1","eventsource-polyfill":"^0.9.6",express:"^4.15.2","extract-text-webpack-plugin":"^3.0.1","file-loader":"^0.10.1","friendly-errors-webpack-plugin":"^1.6.1","function-bind":"^1.0.2","html-webpack-plugin":"^2.28.0","http-proxy-middleware":"^0.17.4","inject-loader":"^3.0.0",isparta:"^4.0.0","jasmine-core":"^2.5.2","json-loader":"^0.5.4",karma:"^1.5.0","karma-coverage":"^1.1.1","karma-jasmine":"^1.0.2","karma-mocha":"^1.2.0","karma-phantomjs-launcher":"^1.0.4","karma-phantomjs-shim":"^1.4.0","karma-sinon-chai":"^1.2.0","karma-sourcemap-loader":"^0.3.7","karma-spec-reporter":"0.0.30","karma-webpack":"2",lolex:"^1.6.0",mocha:"^3.1.0",opn:"^5.1.0",ora:"^1.2.0","phantomjs-prebuilt":"^2.1.13",portfinder:"^1.0.13","selenium-server":"^3.3.1",shelljs:"^0.7.7",sinon:"^2.1.0","sinon-chai":"^2.9.0","url-loader":"^0.5.8",vue:"2.5.2","vue-hot-reload-api":"2.1.0","vue-html-loader":"^1.2.4","vue-loader":"^13.3.0","vue-style-loader":"3.0.1","vue-template-compiler":"2.5.2",webpack:"^3.7.1","webpack-dev-middleware":"^1.10.1","webpack-hot-middleware":"^2.17.1","webpack-merge":"^4.1.0"},engines:{node:">=6.9.0",npm:">= 3.0.0"},browserify:{transform:["babelify"]},greenkeeper:{ignore:["extract-text-webpack-plugin","karma-webpack","webpack","webpack-merge"]}}}])}); |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,22 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [{ | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -67,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'bar', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -78,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,22 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [{ | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -67,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'bubble', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -78,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,4 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: {}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -49,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'doughnut', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -60,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,22 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [{ | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -67,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options, type) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
renderChart: function renderChart(data, options) { | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'horizontalBar', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -78,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,20 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [{ | ||
gridLines: { | ||
display: false | ||
} | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -65,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'line', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -76,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,4 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: {}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -49,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'pie', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -60,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,4 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: {}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -49,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'polarArea', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -60,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,4 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: {}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -49,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'radar', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -60,0 +63,0 @@ } |
import Chart from 'chart.js'; | ||
import { mergeOptions } from '../helpers/options'; | ||
export default { | ||
@@ -36,2 +35,8 @@ render: function render(createElement) { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default: function _default() { | ||
return []; | ||
} | ||
} | ||
@@ -42,11 +47,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
xAxes: [{ | ||
type: 'linear', | ||
position: 'bottom' | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
}; | ||
@@ -56,11 +53,10 @@ }, | ||
addPlugin: function addPlugin(plugin) { | ||
this.plugins.push(plugin); | ||
this.$data._plugins.push(plugin); | ||
}, | ||
renderChart: function renderChart(data, options) { | ||
var chartOptions = mergeOptions(this.defaultOptions, options); | ||
this.$data._chart = new Chart(this.$refs.canvas.getContext('2d'), { | ||
type: 'scatter', | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
}); | ||
@@ -67,0 +63,0 @@ } |
@@ -8,3 +8,7 @@ import Bar from '../BaseCharts/Bar'; | ||
return { | ||
chartData: '' | ||
chartData: '', | ||
options: { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}; | ||
@@ -18,6 +22,3 @@ }, | ||
this.renderChart(this.chartData, { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
}); | ||
this.renderChart(this.chartData, this.options); | ||
setInterval(function () { | ||
@@ -24,0 +25,0 @@ _this.fillData(); |
@@ -6,8 +6,13 @@ import Bar from '../BaseCharts/Bar'; | ||
mixins: [reactiveProp], | ||
data: function data() { | ||
return { | ||
options: { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}; | ||
}, | ||
mounted: function mounted() { | ||
this.renderChart(this.chartData, { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
}); | ||
this.renderChart(this.chartData, this.options); | ||
} | ||
}; |
@@ -57,2 +57,6 @@ module.exports = { | ||
} else { | ||
if (this.$data._chart) { | ||
this.$data._chart.destroy(); | ||
} | ||
this.renderChart(this.chartData, this.options); | ||
@@ -59,0 +63,0 @@ } |
@@ -57,2 +57,6 @@ module.exports = { | ||
} else { | ||
if (this.$data._chart) { | ||
this.$data._chart.destroy(); | ||
} | ||
this.renderChart(this.chartData, this.options); | ||
@@ -59,0 +63,0 @@ } |
{ | ||
"name": "vue-chartjs", | ||
"version": "3.0.2", | ||
"version": "3.1.0", | ||
"description": "Vue.js wrapper for chart.js for creating beautiful charts.", | ||
@@ -56,8 +56,6 @@ "author": "Jakub Juszczak <jakub@posteo.de>", | ||
"lint": "eslint --ext .js,.vue src test/unit/specs test/e2e/specs", | ||
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js", | ||
"release": "webpack --progress --hide-modules --config ./build/webpack.release.js && cross-env NODE_ENV=production webpack --progress --hide-modules --config ./build/webpack.release.min.js", | ||
"prepublishOnly": "yarn run lint && yarn run test && yarn run build" | ||
}, | ||
"dependencies": { | ||
"lodash.merge": "^4.6.0" | ||
}, | ||
"dependencies": {}, | ||
"peerDependencies": { | ||
@@ -76,3 +74,3 @@ "chart.js": "2.7.x" | ||
"connect-history-api-fallback": "^1.1.0", | ||
"cross-env": "^3.2.4", | ||
"cross-env": "^5.1.1", | ||
"cross-spawn": "^5.1.0", | ||
@@ -113,3 +111,2 @@ "css-loader": "^0.28.0", | ||
"mocha": "^3.1.0", | ||
"nightwatch": "^0.9.14", | ||
"opn": "^5.1.0", | ||
@@ -116,0 +113,0 @@ "ora": "^1.2.0", |
@@ -79,3 +79,3 @@ <div align="center"> | ||
If you're using Webpack 2 it will automatically use the `jsnext:main` / `module` entry point. Which is `es/index.js` | ||
It is a __transpiled__ es version of the source. And is not __bundled__ to a module. This way you three shaking will work. Like in the bundled version, `Chart.js` is a `peerDependencies` and need to be installed. | ||
It is a __transpiled__ es version of the source. And is not __bundled__ to a module. This way you tree shaking will work. Like in the bundled version, `Chart.js` is a `peerDependencies` and need to be installed. | ||
@@ -169,4 +169,8 @@ | ||
The mixins automatically create `chartData` as a prop or data. And add a watcher. If data has changed, the chart will update. | ||
However keep in mind the limitations of vue and javascript for mutations on arrays and objects. More info [here](http://vue-chartjs.org/#/home?id=reactive-data) | ||
However keep in mind the limitations of vue and javascript for mutations on arrays and objects. | ||
**It is important that you pass your options in a local variable named `options`!** | ||
The reason is that if the mixin re-renders the chart it calls `this.renderChart(this.chartData, this.options`)` so don't pass in the options object directly or it will be ignored. | ||
More info [here](http://vue-chartjs.org/#/home?id=reactive-data) | ||
```javascript | ||
@@ -234,2 +238,6 @@ // MonthlyIncome.js | ||
## Single File Components | ||
You can create your components in Vues single file components. However it is important that you **do not** have the `<template></template>` included. Because Vue can't merge tempaltes. And the template is included in the mixin. If you leave the template tag in your component, it will overwrite the one which comes from the base chart and you will have a blank screen. | ||
## Available Charts | ||
@@ -236,0 +244,0 @@ |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -44,2 +43,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -50,22 +55,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [ { | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -76,6 +62,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -85,4 +70,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -89,0 +74,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,22 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [ { | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -78,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -88,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -92,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,5 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -61,7 +64,6 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -71,4 +73,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -75,0 +77,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,22 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [ { | ||
gridLines: { | ||
display: false | ||
}, | ||
categoryPercentage: 0.5, | ||
barPercentage: 0.2 | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -78,6 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options, type) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
renderChart (data, options) { | ||
this.$data._chart = new Chart( | ||
@@ -87,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -91,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,20 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
}, | ||
gridLines: { | ||
display: false | ||
} | ||
}], | ||
xAxes: [ { | ||
gridLines: { | ||
display: false | ||
} | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -76,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -86,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -90,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,5 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -61,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -71,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -75,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,5 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -61,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -71,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -75,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,5 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -61,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -71,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -75,0 +76,0 @@ ) |
import Chart from 'chart.js' | ||
import { mergeOptions } from '../helpers/options' | ||
@@ -45,2 +44,8 @@ export default { | ||
type: Object | ||
}, | ||
plugins: { | ||
type: Array, | ||
default () { | ||
return [] | ||
} | ||
} | ||
@@ -52,11 +57,3 @@ }, | ||
_chart: null, | ||
defaultOptions: { | ||
scales: { | ||
xAxes: [{ | ||
type: 'linear', | ||
position: 'bottom' | ||
}] | ||
} | ||
}, | ||
plugins: [] | ||
_plugins: this.plugins | ||
} | ||
@@ -67,7 +64,5 @@ }, | ||
addPlugin (plugin) { | ||
this.plugins.push(plugin) | ||
this.$data._plugins.push(plugin) | ||
}, | ||
renderChart (data, options) { | ||
let chartOptions = mergeOptions(this.defaultOptions, options) | ||
this.$data._chart = new Chart( | ||
@@ -77,4 +72,4 @@ this.$refs.canvas.getContext('2d'), { | ||
data: data, | ||
options: chartOptions, | ||
plugins: this.plugins | ||
options: options, | ||
plugins: this.$data._plugins | ||
} | ||
@@ -81,0 +76,0 @@ ) |
@@ -7,7 +7,9 @@ import Bar from '../BaseCharts/Bar' | ||
mixins: [reactiveData], | ||
data () { | ||
return { | ||
chartData: '' | ||
data: () => ({ | ||
chartData: '', | ||
options: { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}, | ||
}), | ||
created () { | ||
@@ -18,3 +20,3 @@ this.fillData() | ||
mounted () { | ||
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false}) | ||
this.renderChart(this.chartData, this.options) | ||
@@ -21,0 +23,0 @@ setInterval(() => { |
@@ -7,6 +7,12 @@ import Bar from '../BaseCharts/Bar' | ||
mixins: [reactiveProp], | ||
data: () => ({ | ||
options: { | ||
responsive: true, | ||
maintainAspectRatio: false | ||
} | ||
}), | ||
mounted () { | ||
this.renderChart(this.chartData, {responsive: true, maintainAspectRatio: false}) | ||
this.renderChart(this.chartData, this.options) | ||
} | ||
} |
@@ -66,2 +66,5 @@ module.exports = { | ||
} else { | ||
if (this.$data._chart) { | ||
this.$data._chart.destroy() | ||
} | ||
this.renderChart(this.chartData, this.options) | ||
@@ -68,0 +71,0 @@ } |
@@ -66,2 +66,5 @@ module.exports = { | ||
} else { | ||
if (this.$data._chart) { | ||
this.$data._chart.destroy() | ||
} | ||
this.renderChart(this.chartData, this.options) | ||
@@ -68,0 +71,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 2 instances in 1 package
1
64
309
0
3399547
60
3088
- Removedlodash.merge@^4.6.0
- Removedlodash.merge@4.6.2(transitive)