diff --git a/addons/survey/static/src/js/survey_result.js b/addons/survey/static/src/js/survey_result.js index c70280c727e..98d5ad60800 100644 --- a/addons/survey/static/src/js/survey_result.js +++ b/addons/survey/static/src/js/survey_result.js @@ -136,6 +136,11 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ await loadBundle("web.chartjs_lib"); }, + destroy: function () { + window.removeEventListener("afterprint", this._onAfterPrint); + window.removeEventListener("beforeprint", this._onBeforePrint); + }, + // ------------------------------------------------------------------------- // Handlers // ------------------------------------------------------------------------- @@ -145,8 +150,7 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ * @private */ _onBeforePrint: function () { - const printWidth = 630; // Value to fit any graphic into the width of an A4 portrait page - this.chart.resize(printWidth, Math.floor(printWidth / this.chart.aspectRatio)); + // Kept in case someone hooked something here }, /** @@ -154,7 +158,7 @@ publicWidget.registry.SurveyResultChart = publicWidget.Widget.extend({ * @private */ _onAfterPrint: function () { - this.chart.resize(); + // Kept in case someone hooked something here }, // ------------------------------------------------------------------------- diff --git a/addons/survey/views/survey_templates_statistics.xml b/addons/survey/views/survey_templates_statistics.xml index c5b32868a2f..b394d14664a 100644 --- a/addons/survey/views/survey_templates_statistics.xml +++ b/addons/survey/views/survey_templates_statistics.xml @@ -420,7 +420,7 @@ t-att-data-graph-data="graph_data" t-att-data-right-answers="list(question_data['right_answers'].mapped('value'))"> - +
@@ -494,7 +494,7 @@ data-graph-type= "multi_bar" t-att-data-graph-data="graph_data"> - +