forked from ddrilling/asb_cloud_front
Исправлена высота подсказки курсора для графиков мониторинга и архива
This commit is contained in:
parent
1fb4846dbe
commit
1240c15401
@ -139,7 +139,7 @@ const _D3HorizontalCursor = <DataType,>({
|
|||||||
if (!mouseState.visible || fixed) return
|
if (!mouseState.visible || fixed) return
|
||||||
|
|
||||||
let top = mouseState.y + offsetY
|
let top = mouseState.y + offsetY
|
||||||
if (top + height >= sizes.chartsHeight) {
|
if (top + height / 2 >= sizes.chartsHeight) {
|
||||||
setPosition('bottom')
|
setPosition('bottom')
|
||||||
top = mouseState.y - offsetY - height
|
top = mouseState.y - offsetY - height
|
||||||
} else {
|
} else {
|
||||||
@ -179,14 +179,16 @@ const _D3HorizontalCursor = <DataType,>({
|
|||||||
<foreignObject
|
<foreignObject
|
||||||
key={`${i}`}
|
key={`${i}`}
|
||||||
width={width}
|
width={width}
|
||||||
height={height}
|
height={'100%'}
|
||||||
x={sizes.groupLeft(i) + (sizes.groupWidth - width) / 2}
|
x={sizes.groupLeft(i) + (sizes.groupWidth - width) / 2}
|
||||||
y={tooltipY}
|
y={tooltipY}
|
||||||
opacity={fixed || mouseState.visible ? 1 : 0}
|
opacity={fixed || mouseState.visible ? 1 : 0}
|
||||||
pointerEvents={fixed ? 'all' : 'none'}
|
pointerEvents={fixed ? 'all' : 'none'}
|
||||||
style={{ transition: 'opacity .1s ease-out', userSelect: fixed ? 'auto' : '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'}>
|
<div className={'tooltip-content'}>
|
||||||
{tooltipBodies[i]}
|
{tooltipBodies[i]}
|
||||||
</div>
|
</div>
|
||||||
|
@ -559,6 +559,7 @@ const _D3MonitoringCharts = <DataType extends Record<string, unknown>>({
|
|||||||
groups={groups}
|
groups={groups}
|
||||||
sizes={sizes}
|
sizes={sizes}
|
||||||
data={data}
|
data={data}
|
||||||
|
height={height}
|
||||||
/>
|
/>
|
||||||
</D3MouseZone>
|
</D3MouseZone>
|
||||||
</svg>
|
</svg>
|
||||||
|
Loading…
Reference in New Issue
Block a user