fix: x axis title disappears when editing bar chart (#30821)

This commit is contained in:
Damian Pendrak
2024-11-29 16:09:03 +01:00
committed by GitHub
parent 14682b9054
commit 97dde8c485
3 changed files with 27 additions and 2 deletions

View File

@@ -73,6 +73,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isVertical(controls) : isHorizontal(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -90,6 +92,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isVertical(controls) : isHorizontal(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -104,6 +108,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -121,6 +127,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -138,6 +146,8 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Changing this control takes effect instantly'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -160,6 +170,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
description: `${D3_TIME_FORMAT_DOCS}. ${TIME_SERIES_DESCRIPTION_TEXT}`,
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isVertical(controls) : isHorizontal(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -170,6 +182,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
...xAxisLabelRotation.config,
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isVertical(controls) : isHorizontal(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -181,6 +195,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
label: t('Axis Format'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -196,6 +212,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Logarithmic axis'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -210,6 +228,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Draw split lines for minor axis ticks'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -224,6 +244,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
description: t('Its not recommended to truncate axis in Bar chart.'),
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isHorizontal(controls) : isVertical(controls),
disableStash: true,
resetOnHide: false,
},
},
],
@@ -244,6 +266,8 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
visibility: ({ controls }: ControlPanelsContainerProps) =>
Boolean(controls?.truncateYAxis?.value) &&
(isXAxis ? isHorizontal(controls) : isVertical(controls)),
disableStash: true,
resetOnHide: false,
},
},
],