Skip to content

Commit

Permalink
Chart area boxes receive 0 margin during the final layout process (#9915
Browse files Browse the repository at this point in the history
)
  • Loading branch information
etimberg committed Nov 28, 2021
1 parent bccb127 commit 7cbc47b
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/core.layouts.js
Expand Up @@ -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});
});
}
};
35 changes: 35 additions & 0 deletions 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
}
}
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7cbc47b

Please sign in to comment.