@@ -2,11 +2,11 @@ import { ResponsiveContainer } from 'recharts';
22import styled , { useTheme } from 'styled-components' ;
33import { spacing , Stack , Wrap } from '../../../spacing' ;
44import { Box } from '../../box/Box' ;
5- import { ConstrainedText } from '../../constrainedtext/Constrainedtext.component' ;
6- import { FormattedDateTime } from '../../date/FormattedDateTime' ;
75import { IconHelp } from '../../iconhelper/IconHelper' ;
86import { Loader } from '../../loader/Loader.component' ;
97import { Text } from '../../text/Text.component' ;
8+ import { ConstrainedText } from '../../constrainedtext/Constrainedtext.component' ;
9+ import { FormattedDateTime } from '../../date/FormattedDateTime' ;
1010import { formatXAxisDate , maxWidthTooltip } from './chartUtils' ;
1111import { TimeType } from '../types' ;
1212
@@ -149,32 +149,45 @@ export const CustomTick = ({
149149 x = { centerX }
150150 y = { y - 10 }
151151 width = { tickWidth }
152- color = { theme . textSecondary }
153- overflow = "visible"
152+ height = { 30 }
153+ style = { {
154+ overflow : 'visible' ,
155+ pointerEvents : 'none' ,
156+ } }
154157 >
155- < ConstrainedText
156- color = "textSecondary"
157- text = {
158- < Text variant = "Smaller" >
159- { type . type === 'time' ? (
160- < FormattedDateTime
161- format = { formatXAxisDate ( duration ) }
162- value = { new Date ( payload . value ) }
163- />
164- ) : (
165- String ( payload . value )
166- ) }
167- </ Text >
168- }
169- centered
170- tooltipStyle = { {
171- backgroundColor : theme . backgroundLevel1 ,
172- padding : spacing . r10 ,
173- borderRadius : spacing . r8 ,
174- border : `1px solid ${ theme . border } ` ,
175- position : 'absolute' ,
158+ < div
159+ style = { {
160+ width : '100%' ,
161+ height : '100%' ,
162+ display : 'flex' ,
163+ alignItems : 'center' ,
164+ justifyContent : 'center' ,
176165 } }
177- />
166+ >
167+ < ConstrainedText
168+ color = "textSecondary"
169+ text = {
170+ < Text variant = "Smaller" >
171+ { type . type === 'time' ? (
172+ < FormattedDateTime
173+ format = { formatXAxisDate ( duration ) }
174+ value = { new Date ( payload . value ) }
175+ />
176+ ) : (
177+ String ( payload . value )
178+ ) }
179+ </ Text >
180+ }
181+ centered
182+ tooltipStyle = { {
183+ backgroundColor : theme . backgroundLevel1 ,
184+ padding : spacing . r10 ,
185+ borderRadius : spacing . r8 ,
186+ border : `1px solid ${ theme . border } ` ,
187+ position : 'absolute' ,
188+ } }
189+ />
190+ </ div >
178191 </ foreignObject >
179192 ) ;
180193} ;
0 commit comments