add padding between the legend and the chart
All checks were successful
Deploy / deploy (push) Successful in 5m22s
All checks were successful
Deploy / deploy (push) Successful in 5m22s
This commit is contained in:
parent
7a8ece1587
commit
3e91c5d98a
@ -315,7 +315,24 @@ export default function PlayerRankChart({ player }: Props) {
|
||||
|
||||
return (
|
||||
<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>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user