
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
chartjs-react
Advanced tools
Tiny, written in TS, based on React hooks wrapper for Chart.js v4
The main problem that the most popular package react-chartjs-2 was written
many years ago has a bunch of legacy code and issues
(in 90% of cases it does not work without the redraw = true flag).
The main idea was to completely rewrite code into modern React with hooks.
The second goal, add custom React tooltips for Chart.js
The version format is X.Y.Z, where
If you like to use this module please click the star button - it is very motivating.
Install chartjs-react using npm:
$ npm install chartjs-react
TODO tooltips
Bar chart on Chart.js v3 (date-fns)
import {
BarController,
LinearScale,
BarElement,
TimeScale,
Tooltip,
} from 'chart.js';
import 'chartjs-adapter-date-fns';
import { enUS } from 'date-fns/locale';
import { ReactChart } from 'chartjs-react';
// Register modules,
// this example for time scale and linear scale
ReactChart.register(BarController, LinearScale, BarElement, TimeScale, Tooltip);
// options of chart similar to v2 with a few changes
// https://www.chartjs.org/docs/next/getting-started/v3-migration/
const chartOption = {
scales: {
x: {
type: 'time',
adapters: {
date: enUS,
},
},
y: {
type: 'linear',
},
},
};
// data of chart similar to v2, check the migration guide
const chartData = {};
const BarChart = () => {
return (
<ReactChart
type="bar"
data={chartData}
options={chartOption}
height={400}
/>
);
};
Get the chart instance
import { Chart } from 'chart.js';
onEvent = () => {
const myChartInstance = Chart.getChart('unique-chart-id');
// Do your stuff with the chart instance
// Note: the chart should be mounted
};
const BarChart = () => {
return (
<ReactChart
id="unique-chart-id"
type="bar"
data={chartData}
options={chartOption}
height={400}
/>
);
};
FAQs
TypeScript React wrapper for Chart.js with hooks and tooltip
The npm package chartjs-react receives a total of 238 weekly downloads. As such, chartjs-react popularity was classified as not popular.
We found that chartjs-react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.