-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ✨ added test execution trend chart (#57)
* feat: ✨ added test execution trend chart * fix: 🐛 fixed time issue and changed time graph to linear * docs: 📝 updated readme and minor refactoring done
- Loading branch information
Showing
15 changed files
with
395 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
'use client'; | ||
|
||
import { Area, AreaChart, CartesianGrid, XAxis } from 'recharts'; | ||
|
||
import { | ||
Card, | ||
CardContent, | ||
CardDescription, | ||
CardFooter, | ||
CardHeader, | ||
CardTitle, | ||
} from '@/components/ui/card'; | ||
import { | ||
ChartConfig, | ||
ChartContainer, | ||
ChartTooltip, | ||
ChartTooltipContent, | ||
} from '@/components/ui/chart'; | ||
import { AreaChartData } from '@/types/types'; | ||
|
||
interface AreaChartProps { | ||
title: string; | ||
description: string; | ||
config: ChartConfig; | ||
data: AreaChartData[]; | ||
footer?: string; | ||
subFooter?: string; | ||
} | ||
|
||
export function AreaChartComponent({ | ||
title, | ||
description, | ||
config, | ||
data, | ||
footer, | ||
subFooter, | ||
}: AreaChartProps): JSX.Element { | ||
return ( | ||
<Card> | ||
<CardHeader className='items-center pb-0'> | ||
<CardTitle className='text-xl'>{title}</CardTitle> | ||
{description && <CardDescription>{description}</CardDescription>} | ||
</CardHeader> | ||
<CardContent className='flex-1 pb-5'> | ||
<ChartContainer config={config}> | ||
<AreaChart | ||
accessibilityLayer | ||
data={data} | ||
margin={{ | ||
left: 10, | ||
right: 10, | ||
}} | ||
> | ||
<CartesianGrid vertical={true} /> | ||
<XAxis | ||
dataKey='property' | ||
tickLine={false} | ||
axisLine={false} | ||
tickMargin={5} | ||
tickFormatter={(value) => value.slice(0, 5)} | ||
hide | ||
/> | ||
<ChartTooltip | ||
cursor={false} | ||
content={<ChartTooltipContent indicator='dot' />} | ||
/> | ||
<Area | ||
dataKey='value' | ||
type='linear' | ||
fill='var(--color-property)' | ||
fillOpacity={0.4} | ||
stroke='var(--color-property)' | ||
/> | ||
</AreaChart> | ||
</ChartContainer> | ||
</CardContent> | ||
{footer && ( | ||
<CardFooter> | ||
<div className='flex w-full items-start gap-2 text-sm'> | ||
<div className='grid gap-2'> | ||
<div className='flex items-center gap-2 font-medium leading-none'> | ||
{footer} | ||
</div> | ||
{subFooter && ( | ||
<div className='flex items-center gap-2 leading-none text-muted-foreground'> | ||
{subFooter} | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</CardFooter> | ||
)} | ||
</Card> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.