Исправлена высота подсказки курсора для графиков мониторинга и архива

This commit is contained in:
ts_salikhov 2022-08-17 15:28:07 +04:00
parent 1fb4846dbe
commit 1240c15401
2 changed files with 6 additions and 3 deletions

View File

@ -139,7 +139,7 @@ const _D3HorizontalCursor = <DataType,>({
if (!mouseState.visible || fixed) return
let top = mouseState.y + offsetY
if (top + height >= sizes.chartsHeight) {
if (top + height / 2 >= sizes.chartsHeight) {
setPosition('bottom')
top = mouseState.y - offsetY - height
} else {
@ -179,14 +179,16 @@ const _D3HorizontalCursor = <DataType,>({
<foreignObject
key={`${i}`}
width={width}
height={height}
height={'100%'}
x={sizes.groupLeft(i) + (sizes.groupWidth - width) / 2}
y={tooltipY}
opacity={fixed || mouseState.visible ? 1 : 0}
pointerEvents={fixed ? 'all' : 'none'}
style={{ transition: 'opacity .1s ease-out', userSelect: fixed ? 'auto' : 'none' }}
>
<div className={`tooltip ${position} ${className}`}>
<div className={`tooltip ${position} ${className}`}
style={{height: 'auto', bottom: `${position === 'bottom' ? '0' : ''}`}}
>
<div className={'tooltip-content'}>
{tooltipBodies[i]}
</div>

View File

@ -559,6 +559,7 @@ const _D3MonitoringCharts = <DataType extends Record<string, unknown>>({
groups={groups}
sizes={sizes}
data={data}
height={height}
/>
</D3MouseZone>
</svg>