Implemented basic bar chart

This commit is contained in:
Daniel Cojocea committed 2024-08-22 19:36:48 -04:00
1 parent 3973802bd7
commit c3f964a2e2
6 files changed
+47 -5

No files matched your search

@@ -0,0 +1,40 @@
import { useTheme } from "@emotion/react";
import { Box, Stack } from "@mui/material";
const BarChart = ({ checks = [] }) => {
const theme = useTheme();
return (
<Stack direction="row" flexWrap="nowrap" gap={theme.gap.xs} height="50px">
{checks.map((check) => (
<Box
key={`check-${check?._id}`}
position="relative"
width="8px"
height="100%"
backgroundColor="#f4f4f4"
sx={{
borderRadius: theme.gap.xs,
}}
>
<Box
position="absolute"
bottom={0}
width="100%"
height={`${check.responseTime}%`}
backgroundColor={
check.status === true
? "var(--env-var-color-23)"
: "var(--env-var-color-24)"
}
sx={{
borderRadius: theme.gap.xs,
}}
/>
</Box>
))}
</Stack>
);
};
export default BarChart;