Add addPlugin method to scatter chart

This commit is contained in:
Jakub Juszczak
2017-07-04 10:30:46 +02:00
parent 362639c4e2
commit 7f62914edb

View File

@@ -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()