Add top padding to charts when labels shown

Prevents data labels from being clipped at top of chart container
This commit is contained in:
fahed
2026-02-02 17:42:10 +03:00
parent 22878d5a16
commit b51edaeeb8

View File

@@ -60,6 +60,14 @@ export const createDataLabelConfig = (showDataLabels) => ({
export const createBaseOptions = (showDataLabels) => ({ export const createBaseOptions = (showDataLabels) => ({
responsive: true, responsive: true,
maintainAspectRatio: false, maintainAspectRatio: false,
layout: {
padding: {
top: showDataLabels ? 25 : 5,
right: 5,
bottom: 5,
left: 5
}
},
plugins: { plugins: {
legend: { display: false }, legend: { display: false },
tooltip: { tooltip: {