diff --git a/src/core/core.layouts.js b/src/core/core.layouts.js index c5c7e46749f..5154e1285f4 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 00000000000..e3e2520a1ac --- /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 00000000000..f3b020f7bf6 Binary files /dev/null and b/test/fixtures/plugin.legend/legend-line-chart-area.png differ