mirror of
https://github.com/apache/superset.git
synced 2026-05-12 19:35:17 +00:00
fix(echarts): increase default axis title margins to prevent label overlap (#39447)
This commit is contained in:
@@ -25,8 +25,8 @@ export const DEFAULT_FORM_DATA: Partial<EchartsBubbleFormData> = {
|
||||
emitFilter: false,
|
||||
logXAis: false,
|
||||
logYAxis: false,
|
||||
xAxisTitleMargin: 30,
|
||||
yAxisTitleMargin: 30,
|
||||
xAxisTitleMargin: 40,
|
||||
yAxisTitleMargin: 50,
|
||||
truncateXAxis: false,
|
||||
truncateYAxis: false,
|
||||
xAxisBounds: [null, null],
|
||||
|
||||
@@ -144,7 +144,7 @@ const config: ControlPanelConfig = {
|
||||
clearable: true,
|
||||
label: t('X axis title margin'),
|
||||
renderTrigger: true,
|
||||
default: sections.TITLE_MARGIN_OPTIONS[1],
|
||||
default: sections.TITLE_MARGIN_OPTIONS[3],
|
||||
choices: formatSelectOptions(sections.TITLE_MARGIN_OPTIONS),
|
||||
},
|
||||
},
|
||||
@@ -216,7 +216,7 @@ const config: ControlPanelConfig = {
|
||||
clearable: true,
|
||||
label: t('Y axis title margin'),
|
||||
renderTrigger: true,
|
||||
default: sections.TITLE_MARGIN_OPTIONS[1],
|
||||
default: sections.TITLE_MARGIN_OPTIONS[4],
|
||||
choices: formatSelectOptions(sections.TITLE_MARGIN_OPTIONS),
|
||||
},
|
||||
},
|
||||
|
||||
@@ -156,9 +156,9 @@ const defaultFormData: EchartsTimeseriesFormData & {
|
||||
showLegend: false,
|
||||
legendSort: null,
|
||||
xAxisTitle: '',
|
||||
xAxisTitleMargin: 0,
|
||||
xAxisTitleMargin: 40,
|
||||
yAxisTitle: '',
|
||||
yAxisTitleMargin: 15,
|
||||
yAxisTitleMargin: 50,
|
||||
yAxisTitlePosition: '',
|
||||
time_range: 'No filter',
|
||||
granularity: undefined,
|
||||
|
||||
@@ -92,7 +92,7 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
|
||||
clearable: true,
|
||||
label: t('Axis title margin'),
|
||||
renderTrigger: true,
|
||||
default: sections.TITLE_MARGIN_OPTIONS[0],
|
||||
default: sections.TITLE_MARGIN_OPTIONS[3],
|
||||
choices: formatSelectOptions(sections.TITLE_MARGIN_OPTIONS),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
isXAxis ? isVertical(controls) : isHorizontal(controls),
|
||||
@@ -125,7 +125,7 @@ function createAxisTitleControl(axis: 'x' | 'y'): ControlSetRow[] {
|
||||
clearable: true,
|
||||
label: t('Axis title margin'),
|
||||
renderTrigger: true,
|
||||
default: sections.TITLE_MARGIN_OPTIONS[1],
|
||||
default: sections.TITLE_MARGIN_OPTIONS[4],
|
||||
choices: formatSelectOptions(sections.TITLE_MARGIN_OPTIONS),
|
||||
visibility: ({ controls }: ControlPanelsContainerProps) =>
|
||||
isXAxis ? isHorizontal(controls) : isVertical(controls),
|
||||
|
||||
@@ -44,9 +44,9 @@ export const DEFAULT_FORM_DATA: EchartsTimeseriesFormData = {
|
||||
// ...DEFAULT_TITLE_FORM_DATA, // TODO: figure out why these break things for stories (e.g. Bubble Chart)
|
||||
// here are the contents of DEFAULT_TITLE_FORM_DATA:
|
||||
xAxisTitle: '',
|
||||
xAxisTitleMargin: 0,
|
||||
xAxisTitleMargin: 40,
|
||||
yAxisTitle: '',
|
||||
yAxisTitleMargin: 15,
|
||||
yAxisTitleMargin: 50,
|
||||
yAxisTitlePosition: 'Top',
|
||||
// Now that the weird bug workaround is over, here's the rest...
|
||||
...DEFAULT_SORT_SERIES_DATA,
|
||||
|
||||
@@ -107,9 +107,9 @@ export const DEFAULT_LEGEND_FORM_DATA: LegendFormData = {
|
||||
|
||||
export const DEFAULT_TITLE_FORM_DATA: TitleFormData = {
|
||||
xAxisTitle: '',
|
||||
xAxisTitleMargin: 0,
|
||||
xAxisTitleMargin: 40,
|
||||
yAxisTitle: '',
|
||||
yAxisTitleMargin: 15,
|
||||
yAxisTitleMargin: 50,
|
||||
yAxisTitlePosition: 'Top',
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user