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) => ({
|
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: {
|
||||||
|
|||||||
Reference in New Issue
Block a user