mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
feat: Add legend to pie chart
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { HTMLAttributes, useEffect, useState } from 'react';
|
import { HTMLAttributes, useEffect, useState } from 'react';
|
||||||
|
|
||||||
import { Cell, Pie, PieChart, Tooltip } from 'recharts';
|
import { Cell, Legend, Pie, PieChart, Tooltip } from 'recharts';
|
||||||
|
|
||||||
import { cn } from '@documenso/ui/lib/utils';
|
import { cn } from '@documenso/ui/lib/utils';
|
||||||
|
|
||||||
@ -69,6 +69,7 @@ export const CapTable = ({ className, ...props }: CapTableProps) => {
|
|||||||
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
<Cell key={`cell-${index}`} fill={COLORS[index % COLORS.length]} />
|
||||||
))}
|
))}
|
||||||
</Pie>
|
</Pie>
|
||||||
|
<Legend />
|
||||||
<Tooltip
|
<Tooltip
|
||||||
formatter={(percent: number, name, props) => {
|
formatter={(percent: number, name, props) => {
|
||||||
return [`${percent}%`, name || props['name'] || props['payload']['name']];
|
return [`${percent}%`, name || props['name'] || props['payload']['name']];
|
||||||
|
|||||||
Reference in New Issue
Block a user