diff --git a/frontend/src/components/projectStats/contributorsStats.js b/frontend/src/components/projectStats/contributorsStats.js index 4398b4468b..c3bde64350 100644 --- a/frontend/src/components/projectStats/contributorsStats.js +++ b/frontend/src/components/projectStats/contributorsStats.js @@ -1,5 +1,15 @@ import React from 'react'; import { Doughnut, Bar } from 'react-chartjs-2'; +import { + Chart as ChartJS, + ArcElement, + BarElement, + CategoryScale, + Legend, + LinearScale, + Title, + Tooltip, +} from 'chart.js'; import { FormattedMessage, useIntl } from 'react-intl'; import messages from './messages'; @@ -10,6 +20,7 @@ import { useContributorStats } from '../../hooks/UseContributorStats'; import { StatsCardContent } from '../statsCard'; export default function ContributorsStats({ contributors }) { + ChartJS.register(BarElement, CategoryScale, Legend, LinearScale, Title, Tooltip, ArcElement); const intl = useIntl(); const stats = useContributorStats(contributors.userContributions); const getUserLevelLabel = (level) => intl.formatMessage(userMessages[`mapperLevel${level}`]);