Add top padding to charts when labels shown
Prevents data labels from being clipped at top of chart container
This commit is contained in:
@@ -60,6 +60,14 @@ export const createDataLabelConfig = (showDataLabels) => ({
|
||||
export const createBaseOptions = (showDataLabels) => ({
|
||||
responsive: true,
|
||||
maintainAspectRatio: false,
|
||||
layout: {
|
||||
padding: {
|
||||
top: showDataLabels ? 25 : 5,
|
||||
right: 5,
|
||||
bottom: 5,
|
||||
left: 5
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
legend: { display: false },
|
||||
tooltip: {
|
||||
|
||||
Reference in New Issue
Block a user