Skip to content

Commit 4c8e50c

Browse files
Create default for tickLabelMinGap. Reduce default to 4px.
1 parent 9c3d958 commit 4c8e50c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/x-charts/src/ChartsXAxis/ChartsXAxis.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ function addLabelDimension(
3939
{
4040
tickLabelStyle: style,
4141
tickLabelInterval,
42-
// FIXME: Define the default value in the correct place
43-
tickLabelMinGap = 8,
42+
tickLabelMinGap,
4443
reverse,
4544
isMounted,
4645
}: Pick<ChartsXAxisProps, 'tickLabelInterval' | 'tickLabelStyle'> &
@@ -101,6 +100,7 @@ const defaultProps = {
101100
disableLine: false,
102101
disableTicks: false,
103102
tickSize: 6,
103+
tickLabelMinGap: 4,
104104
} as const;
105105

106106
/**
@@ -140,6 +140,7 @@ function ChartsXAxis(inProps: ChartsXAxisProps) {
140140
tickLabelInterval,
141141
tickPlacement,
142142
tickLabelPlacement,
143+
tickLabelMinGap,
143144
sx,
144145
} = defaultizedProps;
145146

@@ -185,6 +186,7 @@ function ChartsXAxis(inProps: ChartsXAxisProps) {
185186
const xTicksWithDimension = addLabelDimension(xTicks, {
186187
tickLabelStyle: axisTickLabelProps.style,
187188
tickLabelInterval,
189+
tickLabelMinGap,
188190
reverse,
189191
isMounted,
190192
});

0 commit comments

Comments
 (0)