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});
});
}
};
--- /dev/null
+{
+ "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