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

@@ -26,10 +26,15 @@ import {
} from '@superset-ui/chart-controls';
import { DEFAULT_FORM_DATA } from './constants';
import { legendSection, truncateXAxis, xAxisBounds } from '../controls';
import {
legendSection,
truncateXAxis,
xAxisBounds,
xAxisLabelRotation,
} from '../controls';
import { defaultYAxis } from '../defaults';
const { logAxis, truncateYAxis, yAxisBounds, xAxisLabelRotation, opacity } =
DEFAULT_FORM_DATA;
const { logAxis, truncateYAxis, yAxisBounds, opacity } = DEFAULT_FORM_DATA;
const config: ControlPanelConfig = {
controlPanelSections: [
@@ -127,27 +132,7 @@ const config: ControlPanelConfig = {
},
},
],
[
{
name: 'xAxisLabelRotation',
config: {
type: 'SelectControl',
freeForm: true,
clearable: false,
label: t('Rotate x 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],
[
{
name: 'x_axis_title_margin',
@@ -212,7 +197,7 @@ const config: ControlPanelConfig = {
[0, '0°'],
[45, '45°'],
],
default: xAxisLabelRotation,
default: defaultYAxis.yAxisLabelRotation,
renderTrigger: true,
description: t(
'Input field supports custom rotation. e.g. 30 for 30°',