1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-06-04 01:18:20 +02:00

fix: chart xAxis and null values (#6472)

Changes the xAxis from 'week' to 'date' (timeline fix)

Replace null values with 0

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
This commit is contained in:
andreas-unleash 2024-03-11 10:31:24 +02:00 committed by GitHub
parent ecd2693cfe
commit bf5f38ba1e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 7 deletions

View File

@ -109,17 +109,19 @@ export const MetricsSummaryTooltip: VFC<{ tooltip: TooltipState | null }> = ({
/> />
<InfoLine <InfoLine
iconChar={'▣ '} iconChar={'▣ '}
title={`Total requests: ${point.value.totalRequests}`} title={`Total requests: ${
point.value.totalRequests ?? 0
}`}
color={'info'} color={'info'}
/> />
<InfoLine <InfoLine
iconChar={'▲ '} iconChar={'▲ '}
title={`Exposed: ${point.value.totalYes}`} title={`Exposed: ${point.value.totalYes ?? 0}`}
color={'success'} color={'success'}
/> />
<InfoLine <InfoLine
iconChar={'▼ '} iconChar={'▼ '}
title={`Not exposed: ${point.value.totalNo}`} title={`Not exposed: ${point.value.totalNo ?? 0}`}
color={'error'} color={'error'}
/> />
<Divider <Divider
@ -127,12 +129,18 @@ export const MetricsSummaryTooltip: VFC<{ tooltip: TooltipState | null }> = ({
/> />
<InfoSummary <InfoSummary
data={[ data={[
{ key: 'Flags', value: point.value.totalFlags }, {
key: 'Flags',
value: point.value.totalFlags ?? 0,
},
{ {
key: 'Environments', key: 'Environments',
value: point.value.totalEnvironments, value: point.value.totalEnvironments ?? 0,
},
{
key: 'Apps',
value: point.value.totalApps ?? 0,
}, },
{ key: 'Apps', value: point.value.totalApps },
]} ]}
/> />
</StyledTooltipItemContainer> </StyledTooltipItemContainer>

View File

@ -26,7 +26,7 @@ export const MetricsSummaryChart: VFC<IMetricsSummaryChartProps> = ({
isLocalTooltip isLocalTooltip
TooltipComponent={MetricsSummaryTooltip} TooltipComponent={MetricsSummaryTooltip}
overrideOptions={{ overrideOptions={{
parsing: { yAxisKey: 'totalRequests', xAxisKey: 'week' }, parsing: { yAxisKey: 'totalRequests', xAxisKey: 'date' },
}} }}
cover={notEnoughData ? <NotEnoughData /> : false} cover={notEnoughData ? <NotEnoughData /> : false}
/> />