This commit is contained in:
Emily
2024-09-12 16:16:19 +02:00
parent 6a9a698b7a
commit 525a371a6e
20 changed files with 746 additions and 365 deletions

View File

@@ -1,11 +1,12 @@
import { Chart, registerables } from 'chart.js';
import annotaionPlugin from 'chartjs-plugin-annotation';
let registered = false;
export async function registerChartComponents() {
if (registered) return;
if (process.client) {
Chart.register(...registerables);
Chart.register(...registerables, annotaionPlugin);
registered = true;
}
}