mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
Add prop for inline plugins
This commit is contained in:
@@ -41,6 +41,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
@@ -65,13 +71,13 @@ export default {
|
||||
}]
|
||||
}
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -80,7 +86,7 @@ export default {
|
||||
type: 'bar',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -67,13 +73,13 @@ export default {
|
||||
}]
|
||||
}
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -83,7 +89,7 @@ export default {
|
||||
type: 'bubble',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,13 +56,13 @@ export default {
|
||||
_chart: null,
|
||||
defaultOptions: {
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -66,7 +72,7 @@ export default {
|
||||
type: 'doughnut',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -67,13 +73,13 @@ export default {
|
||||
}]
|
||||
}
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options, type) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -82,7 +88,7 @@ export default {
|
||||
type: 'horizontalBar',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -65,13 +71,13 @@ export default {
|
||||
}]
|
||||
}
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -81,7 +87,7 @@ export default {
|
||||
type: 'line',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,13 +56,13 @@ export default {
|
||||
_chart: null,
|
||||
defaultOptions: {
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -66,7 +72,7 @@ export default {
|
||||
type: 'pie',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,13 +56,13 @@ export default {
|
||||
_chart: null,
|
||||
defaultOptions: {
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -66,7 +72,7 @@ export default {
|
||||
type: 'polarArea',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -50,13 +56,13 @@ export default {
|
||||
_chart: null,
|
||||
defaultOptions: {
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -66,7 +72,7 @@ export default {
|
||||
type: 'radar',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -42,6 +42,12 @@ export default {
|
||||
},
|
||||
styles: {
|
||||
type: Object
|
||||
},
|
||||
plugins: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -56,13 +62,13 @@ export default {
|
||||
}]
|
||||
}
|
||||
},
|
||||
plugins: []
|
||||
_plugins: this.plugins
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
addPlugin (plugin) {
|
||||
this.plugins.push(plugin)
|
||||
this._plugins.push(plugin)
|
||||
},
|
||||
renderChart (data, options) {
|
||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||
@@ -72,7 +78,7 @@ export default {
|
||||
type: 'scatter',
|
||||
data: data,
|
||||
options: chartOptions,
|
||||
plugins: this.plugins
|
||||
plugins: this._plugins
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user