47 lines
1019 B
TypeScript
47 lines
1019 B
TypeScript
// app/components/publication-chart-client.tsx
|
|
|
|
"use client";
|
|
|
|
import {
|
|
Bar,
|
|
BarChart,
|
|
ResponsiveContainer,
|
|
XAxis,
|
|
LabelList,
|
|
} from "recharts";
|
|
|
|
interface ChartData {
|
|
year: number;
|
|
count: number;
|
|
}
|
|
|
|
export function PublicationChartClient({ data }: { data: ChartData[] }) {
|
|
return (
|
|
<ResponsiveContainer width="100%" height="100%">
|
|
<BarChart data={data} margin={{ top: 10 }}>
|
|
<XAxis
|
|
dataKey="year"
|
|
stroke="hsl(var(--muted-foreground))"
|
|
fontSize={12}
|
|
tickLine={false}
|
|
axisLine={false}
|
|
/>
|
|
{/* Y-axis is hidden as per the design */}
|
|
<Bar
|
|
dataKey="count"
|
|
fill="hsl(var(--foreground))"
|
|
radius={[4, 4, 0, 0]}
|
|
height={20}
|
|
>
|
|
<LabelList
|
|
dataKey="count"
|
|
position="top"
|
|
offset={6}
|
|
fontSize={12}
|
|
fill="hsl(var(--foreground))"
|
|
/>
|
|
</Bar>
|
|
</BarChart>
|
|
</ResponsiveContainer>
|
|
);
|
|
} |