Skip to content

Commit

Permalink
fix: chart xAxis and null values (#6472)
Browse files Browse the repository at this point in the history
Changes the xAxis from 'week' to 'date' (timeline fix)

Replace null values with 0

---------

Signed-off-by: andreas-unleash <andreas@getunleash.ai>
  • Loading branch information
andreas-unleash committed Mar 11, 2024
1 parent ecd2693 commit bf5f38b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
Expand Up @@ -109,30 +109,38 @@ 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
sx={(theme) => ({ margin: theme.spacing(1.5, 0) })}
/>
<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>
Expand Down
Expand Up @@ -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}
/>
Expand Down

0 comments on commit bf5f38b

Please sign in to comment.