forked from ddrilling/asb_cloud_front
Добавлено выравнивание по левому краю для левого столбика подсказки курсора для графиков мониторинга и архива
This commit is contained in:
parent
1e27317ea1
commit
ccd2158f36
@ -1,4 +1,4 @@
|
||||
import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { CSSProperties, ReactNode, SVGProps, useEffect, useMemo, useRef, useState, isValidElement, cloneElement } from 'react'
|
||||
import * as d3 from 'd3'
|
||||
|
||||
import { wrapPlugin } from '@components/d3/plugins/base'
|
||||
@ -166,6 +166,7 @@ const _D3HorizontalCursor = <DataType,>({
|
||||
})
|
||||
|
||||
const bodies = groups.map((group) => render(group, chartData))
|
||||
.map(body => isValidElement(body) ? cloneElement(body, {className: 'tooltip-body' }) : body)
|
||||
|
||||
setTooltipBodies(bodies)
|
||||
}, [groups, data, yAxis, lineY, fixed, mouseState.visible])
|
||||
|
@ -99,6 +99,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& .tooltip-body {
|
||||
|
||||
& > div:nth-child(n+3):nth-child(3n+1) {
|
||||
text-align: end;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user