remove time from daily average tooltip
This commit is contained in:
parent
b708d838d7
commit
5b4b30df0a
|
@ -58,6 +58,7 @@ interface DetailedAreaOrBarChartProps {
|
|||
yDecimals?: number
|
||||
yKey: string
|
||||
showZeroLine?: boolean
|
||||
tooltipDateFormat?: string
|
||||
}
|
||||
|
||||
export const formatDateAxis = (date: string, days: number) => {
|
||||
|
@ -92,6 +93,7 @@ const DetailedAreaOrBarChart: FunctionComponent<
|
|||
yDecimals,
|
||||
yKey,
|
||||
showZeroLine,
|
||||
tooltipDateFormat,
|
||||
}) => {
|
||||
const { t } = useTranslation('common')
|
||||
const [mouseData, setMouseData] = useState<any>(null)
|
||||
|
@ -244,7 +246,11 @@ const DetailedAreaOrBarChart: FunctionComponent<
|
|||
small ? 'text-xs' : 'text-sm'
|
||||
} text-th-fgd-4`}
|
||||
>
|
||||
{dayjs(mouseData[xKey]).format('DD MMM YY, h:mma')}
|
||||
{dayjs(mouseData[xKey]).format(
|
||||
tooltipDateFormat
|
||||
? tooltipDateFormat
|
||||
: 'DD MMM YY, h:mma'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
|
@ -303,7 +309,11 @@ const DetailedAreaOrBarChart: FunctionComponent<
|
|||
>
|
||||
{dayjs(
|
||||
filteredData[filteredData.length - 1][xKey]
|
||||
).format('DD MMM YY, h:mma')}
|
||||
).format(
|
||||
tooltipDateFormat
|
||||
? tooltipDateFormat
|
||||
: 'DD MMM YY, h:mma'
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
|
|
@ -77,6 +77,7 @@ const AverageFundingChart = ({
|
|||
yKey="funding_rate_hourly"
|
||||
yDecimals={5}
|
||||
chartType="bar"
|
||||
tooltipDateFormat={daysToShow === '30' ? 'DD MMM YY' : ''}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue