diff --git a/src/bundle/Resources/public/js/scripts/core/base.chart.js b/src/bundle/Resources/public/js/scripts/core/base.chart.js index b6591caeaf..9971a01cc8 100644 --- a/src/bundle/Resources/public/js/scripts/core/base.chart.js +++ b/src/bundle/Resources/public/js/scripts/core/base.chart.js @@ -28,11 +28,13 @@ }, }, }; + const defaultPlugins = {}; class BaseChart { - constructor(data, options = {}) { + constructor(data, options = {}, plugins = []) { this.setData(data); this.setOptions(options); + this.setPlugins(plugins); this.lang = document.documentElement.lang.replace('_', '-'); // TODO: Get this config from settings } @@ -48,6 +50,10 @@ }; } + setPlugins(plugins) { + this.plugins = [...defaultPlugins, ...plugins]; + } + getType() {} getLayoutOptions() {} @@ -76,8 +82,6 @@ } render() { - // console.log(window); - // console.log(this.labels, this.datasets); this.chart = new Chart(this.canvas, { type: this.getType(), data: { @@ -85,6 +89,7 @@ datasets: this.datasets, }, options: this.options, + plugins: this.plugins, }); this.updateChartMessageDisplay(); diff --git a/src/bundle/Resources/public/js/scripts/core/line.chart.js b/src/bundle/Resources/public/js/scripts/core/line.chart.js index 4f54bc66b3..ca6b8eb70a 100644 --- a/src/bundle/Resources/public/js/scripts/core/line.chart.js +++ b/src/bundle/Resources/public/js/scripts/core/line.chart.js @@ -5,9 +5,6 @@ point: { radius: 2, }, - line: { - tension: 0, - }, }, scales: { x: {