chore: Moves xAxisLabelRotation to shared controls (#26212)

This commit is contained in:
Michael S. Molina
2023-12-08 13:37:06 -03:00
committed by GitHub
parent dbed64a2c6
commit 005cf5947b
12 changed files with 57 additions and 176 deletions

View File

@@ -37,6 +37,7 @@ import {
showValueSection,
truncateXAxis,
xAxisBounds,
xAxisLabelRotation,
} from '../../../controls';
import { OrientationType } from '../../types';
@@ -51,7 +52,6 @@ const {
truncateYAxis,
yAxisBounds,
zoomable,
xAxisLabelRotation,
orientation,
} = DEFAULT_FORM_DATA;
@@ -165,22 +165,9 @@ function createAxisControl(axis: 'x' | 'y'): ControlSetRow[] {
],
[
{
name: 'xAxisLabelRotation',
name: xAxisLabelRotation.name,
config: {
type: 'SelectControl',
freeForm: true,
clearable: false,
label: t('Rotate axis label'),
choices: [
[0, '0°'],
[45, '45°'],
[90, '90°'],
],
default: xAxisLabelRotation,
renderTrigger: true,
description: t(
'Input field supports custom rotation. e.g. 30 for 30°',
),
...xAxisLabelRotation.config,
visibility: ({ controls }: ControlPanelsContainerProps) =>
isXAxis ? isVertical(controls) : isHorizontal(controls),
},