1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-22 19:07:54 +01: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
iconChar={'▣ '}
title={`Total requests: ${point.value.totalRequests}`}
title={`Total requests: ${
point.value.totalRequests ?? 0
}`}
color={'info'}
/>
<InfoLine
iconChar={'▲ '}
title={`Exposed: ${point.value.totalYes}`}
title={`Exposed: ${point.value.totalYes ?? 0}`}
color={'success'}
/>
<InfoLine
iconChar={'▼ '}
title={`Not exposed: ${point.value.totalNo}`}
title={`Not exposed: ${point.value.totalNo ?? 0}`}
color={'error'}
/>
<Divider
@ -127,12 +129,18 @@ export const MetricsSummaryTooltip: VFC<{ tooltip: TooltipState | null }> = ({
/>
<InfoSummary
data={[
{ key: 'Flags', value: point.value.totalFlags },
{
key: 'Flags',
value: point.value.totalFlags ?? 0,
},
{
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>

View File

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