@@ -207,8 +207,7 @@ function ChartsXAxis(inProps: ChartsXAxisProps) {
207
207
tickLabelMinGap,
208
208
reverse,
209
209
isMounted,
210
- isPointInside : ( offset : number ) =>
211
- instance . isPointInside ( { x : offset , y : - 1 } , { direction : 'x' } ) ,
210
+ isPointInside : ( x : number ) => instance . isPointInside ( { x, y : - 1 } , { direction : 'x' } ) ,
212
211
} ) ;
213
212
214
213
const labelRefPoint = {
@@ -248,45 +247,39 @@ function ChartsXAxis(inProps: ChartsXAxisProps) {
248
247
< Line x1 = { left } x2 = { left + width } className = { classes . line } { ...slotProps ?. axisLine } />
249
248
) }
250
249
251
- { xTicks . map (
252
- ( item , index ) => {
253
- const { formattedValue, offset : tickOffset , labelOffset } = item ;
254
- const xTickLabel = labelOffset ?? 0 ;
255
- const yTickLabel = positionSign * ( tickSize + 3 ) ;
256
-
257
- const showTick = instance . isPointInside ( { x : tickOffset , y : - 1 } , { direction : 'x' } ) ;
258
- const showTickLabel = instance . isPointInside (
259
- { x : tickOffset + xTickLabel , y : - 1 } ,
260
- { direction : 'x' } ,
261
- ) ;
262
- const skipLabel = ! visibleLabels . has ( item ) ;
263
-
264
- return (
265
- < g
266
- key = { index }
267
- transform = { `translate(${ tickOffset } , 0)` }
268
- className = { classes . tickContainer }
269
- >
270
- { ! disableTicks && showTick && (
271
- < Tick
272
- y2 = { positionSign * tickSize }
273
- className = { classes . tick }
274
- { ...slotProps ?. axisTick }
275
- />
276
- ) }
277
-
278
- { formattedValue !== undefined && ! skipLabel && showTickLabel && (
279
- < TickLabel
280
- x = { xTickLabel }
281
- y = { yTickLabel }
282
- { ...axisTickLabelProps }
283
- text = { formattedValue . toString ( ) }
284
- />
285
- ) }
286
- </ g >
287
- ) ;
288
- } ,
289
- ) }
250
+ { xTicks . map ( ( item , index ) => {
251
+ const { formattedValue, offset : tickOffset , labelOffset } = item ;
252
+ const xTickLabel = labelOffset ?? 0 ;
253
+ const yTickLabel = positionSign * ( tickSize + 3 ) ;
254
+
255
+ const showTick = instance . isPointInside ( { x : tickOffset , y : - 1 } , { direction : 'x' } ) ;
256
+ const showTickLabel = visibleLabels . has ( item ) ;
257
+
258
+ return (
259
+ < g
260
+ key = { index }
261
+ transform = { `translate(${ tickOffset } , 0)` }
262
+ className = { classes . tickContainer }
263
+ >
264
+ { ! disableTicks && showTick && (
265
+ < Tick
266
+ y2 = { positionSign * tickSize }
267
+ className = { classes . tick }
268
+ { ...slotProps ?. axisTick }
269
+ />
270
+ ) }
271
+
272
+ { formattedValue !== undefined && showTickLabel && (
273
+ < TickLabel
274
+ x = { xTickLabel }
275
+ y = { yTickLabel }
276
+ { ...axisTickLabelProps }
277
+ text = { formattedValue . toString ( ) }
278
+ />
279
+ ) }
280
+ </ g >
281
+ ) ;
282
+ } ) }
290
283
291
284
{ label && (
292
285
< g className = { classes . label } >
0 commit comments