add padding between the legend and the chart
All checks were successful
Deploy / deploy (push) Successful in 5m22s

This commit is contained in:
Lee 2024-09-30 14:53:47 +01:00
parent 7a8ece1587
commit 3e91c5d98a

@ -315,7 +315,24 @@ export default function PlayerRankChart({ player }: Props) {
return ( return (
<div className="h-96"> <div className="h-96">
<Line className="w-fit" options={options} data={data} /> <Line
className="w-fit"
options={options}
data={data}
plugins={[
{
id: "legend-padding",
beforeInit: (chart: any) => {
const originalFit = chart.legend.fit;
chart.legend.fit = function fit() {
originalFit.bind(chart.legend)();
this.height += 2;
};
},
},
]}
/>
</div> </div>
); );
} }