Files
litlyx/dashboard/composables/registerChartComponents.ts
Emily 525a371a6e .
2024-09-12 16:16:19 +02:00

12 lines
329 B
TypeScript

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, annotaionPlugin);
registered = true;
}
}