Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function installChartjs() {
// These have the side effect of installing themselves.
require("chartjs-plugin-annotation");
require("chartjs-plugin-datalabels");
require("chartjs-plugin-zoom");
require("webviz-core/src/util/multicolorLineChart");
// Otherwise we'd get labels everywhere.
Chart.defaults.global.plugins.datalabels.display = false;
setUpChartJSZoom();
if (Chart.plugins.count() !== 6) {
throw new Error(
"Incorrect number of Chart.js plugins; one probably has not loaded correctly (make sure we don't have duplicate chart.js instances when running `yarn list`."
);
}
}