diff --git a/components/charts/pops.tsx b/components/charts/pops.tsx index 5ce7d8a..6eba935 100644 --- a/components/charts/pops.tsx +++ b/components/charts/pops.tsx @@ -3,7 +3,7 @@ import useSWR from "swr"; import { Chart as ChartJS, registerables } from 'chart.js'; import { Pie } from "react-chartjs-2"; -import ChartDataLabels from 'chartjs-plugin-datalabels'; +import ChartDataLabels, { Context } from 'chartjs-plugin-datalabels'; import { Species } from '../../types/stellaris'; const fetcher = async (url:any) => await fetch(url).then((res) => res.json()); @@ -74,7 +74,7 @@ export const PopChart = () => { display: true }, datalabels: { - formatter: (value: any, context: any) => { + formatter: (value: any, context: Context) => { if (value > 0) { return Species[context.dataIndex]; } @@ -82,8 +82,7 @@ export const PopChart = () => { return ""; } }, - anchor: 'center', - align: 'end', + color: 'black' }, },