Skip to content

Commit 7f62914

Browse files
committed
✨ Add addPlugin method to scatter chart
1 parent 362639c commit 7f62914

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/BaseCharts/Scatter.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,19 +45,24 @@ export default Vue.extend({
4545
position: 'bottom'
4646
}]
4747
}
48-
}
48+
},
49+
plugins: []
4950
}
5051
},
5152

5253
methods: {
54+
addPlugin (plugin) {
55+
this.plugins.push(plugin)
56+
},
5357
renderChart (data, options) {
5458
let chartOptions = mergeOptions(this.defaultOptions, options)
5559

5660
this._chart = new Chart(
5761
this.$refs.canvas.getContext('2d'), {
5862
type: 'scatter',
5963
data: data,
60-
options: chartOptions
64+
options: chartOptions,
65+
plugins: this.plugins
6166
}
6267
)
6368
this._chart.generateLegend()

0 commit comments

Comments
 (0)