mirror of
https://github.com/KevinMidboe/vue-chartjs.git
synced 2025-10-29 18:00:20 +00:00
✨ Add addPlugin method to scatter chart
This commit is contained in:
@@ -45,11 +45,15 @@ export default Vue.extend({
|
|||||||
position: 'bottom'
|
position: 'bottom'
|
||||||
}]
|
}]
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
plugins: []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
addPlugin (plugin) {
|
||||||
|
this.plugins.push(plugin)
|
||||||
|
},
|
||||||
renderChart (data, options) {
|
renderChart (data, options) {
|
||||||
let chartOptions = mergeOptions(this.defaultOptions, options)
|
let chartOptions = mergeOptions(this.defaultOptions, options)
|
||||||
|
|
||||||
@@ -57,7 +61,8 @@ export default Vue.extend({
|
|||||||
this.$refs.canvas.getContext('2d'), {
|
this.$refs.canvas.getContext('2d'), {
|
||||||
type: 'scatter',
|
type: 'scatter',
|
||||||
data: data,
|
data: data,
|
||||||
options: chartOptions
|
options: chartOptions,
|
||||||
|
plugins: this.plugins
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
this._chart.generateLegend()
|
this._chart.generateLegend()
|
||||||
|
|||||||
Reference in New Issue
Block a user