Files

29 lines
594 B
TypeScript
Raw Permalink Normal View History

/**
* Single Chart.js registration point.
* Import this module (side-effect import) in any file that uses react-chartjs-2.
* Chart.js is idempotent about duplicate registrations, but importing the
* registration from one place ensures every primitive is only bundled once
* and the register() call is not duplicated at runtime.
*/
import {
Chart as ChartJS,
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend,
} from 'chart.js';
ChartJS.register(
CategoryScale,
LinearScale,
PointElement,
LineElement,
Title,
Tooltip,
Legend,
);