From e675aea84e20c8fed82cde67e75fdbd5bf34c72d Mon Sep 17 00:00:00 2001 From: Robert Swoboda <53216935+Gengar-i@users.noreply.github.com> Date: Wed, 15 Nov 2023 20:07:30 +0100 Subject: [PATCH] chart.js fixes --- src/bundle/Resources/encore/ibexa.js.config.js | 1 + src/bundle/Resources/public/js/scripts/core/base.chart.js | 2 +- .../Resources/public/js/scripts/core/doughnut.chart.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/bundle/Resources/encore/ibexa.js.config.js b/src/bundle/Resources/encore/ibexa.js.config.js index 602f712812..0d868ce1f9 100644 --- a/src/bundle/Resources/encore/ibexa.js.config.js +++ b/src/bundle/Resources/encore/ibexa.js.config.js @@ -32,6 +32,7 @@ const layout = [ path.resolve(__dirname, '../public/js/scripts/core/split.btn.js'), path.resolve(__dirname, '../public/js/scripts/core/pie.chart.js'), path.resolve(__dirname, '../public/js/scripts/core/bar.chart.js'), + path.resolve(__dirname, '../public/js/scripts/core/doughnut.chart.js'), path.resolve(__dirname, '../public/js/scripts/core/adaptive.items.js'), path.resolve(__dirname, '../public/js/scripts/core/popup.menu.js'), path.resolve(__dirname, '../public/js/scripts/core/tag.view.select.js'), 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 9971a01cc8..08858371bc 100644 --- a/src/bundle/Resources/public/js/scripts/core/base.chart.js +++ b/src/bundle/Resources/public/js/scripts/core/base.chart.js @@ -28,7 +28,7 @@ }, }, }; - const defaultPlugins = {}; + const defaultPlugins = []; class BaseChart { constructor(data, options = {}, plugins = []) { diff --git a/src/bundle/Resources/public/js/scripts/core/doughnut.chart.js b/src/bundle/Resources/public/js/scripts/core/doughnut.chart.js index 04fd62dc8f..a8ca3e0f01 100644 --- a/src/bundle/Resources/public/js/scripts/core/doughnut.chart.js +++ b/src/bundle/Resources/public/js/scripts/core/doughnut.chart.js @@ -1,7 +1,7 @@ (function (global, doc, ibexa) { class DoughnutChart extends ibexa.core.BaseChart { - constructor(data) { - super(data); + constructor(data, options = {}, plugins = []) { + super(data, options, plugins); this.type = 'doughnut'; } @@ -11,5 +11,5 @@ } } - ibexa.addConfig('core.chart.Doughnut', DoughnutChart); + ibexa.addConfig('core.chart.DoughnutChart', DoughnutChart); })(window, window.document, window.ibexa);