Skip to content

Commit 879c61c

Browse files
feat(site): display tooltip in bars for app usage chart (coder#13854)
1 parent 6bf7e5a commit 879c61c

File tree

2 files changed

+22
-13
lines changed

2 files changed

+22
-13
lines changed

site/src/pages/TemplatePage/TemplateInsightsPage/TemplateInsightsPage.tsx

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -480,19 +480,25 @@ const TemplateUsagePanel: FC<TemplateUsagePanelProps> = ({
480480
{usage.display_name}
481481
</div>
482482
</div>
483-
<LinearProgress
484-
value={percentage}
485-
variant="determinate"
486-
css={{
487-
width: "100%",
488-
height: 8,
489-
backgroundColor: theme.palette.divider,
490-
"& .MuiLinearProgress-bar": {
491-
backgroundColor: usageColors[i],
492-
borderRadius: 999,
493-
},
494-
}}
495-
/>
483+
<Tooltip
484+
title={`${Math.floor(percentage)}%`}
485+
placement="top"
486+
arrow
487+
>
488+
<LinearProgress
489+
value={percentage}
490+
variant="determinate"
491+
css={{
492+
width: "100%",
493+
height: 8,
494+
backgroundColor: theme.palette.divider,
495+
"& .MuiLinearProgress-bar": {
496+
backgroundColor: usageColors[i],
497+
borderRadius: 999,
498+
},
499+
}}
500+
/>
501+
</Tooltip>
496502
<Stack
497503
spacing={0}
498504
css={{

site/src/theme/mui.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -455,6 +455,9 @@ export const components = {
455455
background: theme.palette.divider,
456456
padding: "8px 16px",
457457
}),
458+
arrow: ({ theme }) => ({
459+
color: theme.palette.divider,
460+
}),
458461
},
459462
},
460463
MuiAlert: {

0 commit comments

Comments
 (0)