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

@@ -32,7 +32,11 @@ import {
import { DEFAULT_FORM_DATA } from './types';
import { EchartsTimeseriesSeriesType } from '../Timeseries/types';
import { legendSection, richTooltipSection } from '../controls';
import {
legendSection,
richTooltipSection,
xAxisLabelRotation,
} from '../controls';
const {
area,
@@ -49,7 +53,6 @@ const {
truncateYAxis,
yAxisBounds,
zoomable,
xAxisLabelRotation,
yAxisIndex,
} = DEFAULT_FORM_DATA;
@@ -314,27 +317,7 @@ const config: ControlPanelConfig = {
...legendSection,
[<ControlSubSectionHeader>{t('X Axis')}</ControlSubSectionHeader>],
['x_axis_time_format'],
[
{
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],
...richTooltipSection,
// eslint-disable-next-line react/jsx-key
[<ControlSubSectionHeader>{t('Y Axis')}</ControlSubSectionHeader>],