From: Evert Timberg Date: Sun, 28 Nov 2021 15:25:27 +0000 (-0500) Subject: Chart area boxes receive 0 margin during the final layout process (#9915) X-Git-Tag: v3.6.1~7 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=7cbc47beccc260e65e7d8de20ba86e37f597b446;p=thirdparty%2FChart.js.git Chart area boxes receive 0 margin during the final layout process (#9915) --- diff --git a/src/core/core.layouts.js b/src/core/core.layouts.js index c5c7e4674..5154e1285 100644 --- a/src/core/core.layouts.js +++ b/src/core/core.layouts.js @@ -460,7 +460,7 @@ export default { each(boxes.chartArea, (layout) => { const box = layout.box; Object.assign(box, chart.chartArea); - box.update(chartArea.w, chartArea.h); + box.update(chartArea.w, chartArea.h, {left: 0, top: 0, right: 0, bottom: 0}); }); } }; diff --git a/test/fixtures/plugin.legend/legend-line-chart-area.json b/test/fixtures/plugin.legend/legend-line-chart-area.json new file mode 100644 index 000000000..e3e2520a1 --- /dev/null +++ b/test/fixtures/plugin.legend/legend-line-chart-area.json @@ -0,0 +1,35 @@ +{ + "config": { + "type": "line", + "data": { + "labels": ["A", "B", "C", "D", "E"], + "datasets": [{ + "data": [10, 20, 30, 40, 50], + "backgroundColor": "#00ff00", + "borderWidth": 0, + "label": "" + }] + }, + "options": { + "plugins": { + "legend": { + "position": "chartArea" + } + }, + "scales": { + "x": { + "display": false + }, + "y": { + "display": false + } + } + } + }, + "options": { + "canvas": { + "height": 256, + "width": 512 + } + } +} \ No newline at end of file diff --git a/test/fixtures/plugin.legend/legend-line-chart-area.png b/test/fixtures/plugin.legend/legend-line-chart-area.png new file mode 100644 index 000000000..f3b020f7b Binary files /dev/null and b/test/fixtures/plugin.legend/legend-line-chart-area.png differ