Registry / visualization / node-red-contrib-chartjs

node-red-contrib-chartjs

JSON →
library0.5.2jsnpmunverified

A Node-RED node that provides Chart.js-based charts for Node-RED dashboards. Version 0.5.2 supports line, multi-line, vertical/horizontal bar, pie, doughnut, polar area, bubble, and radar charts. Charts are served on configurable HTTP paths and can be updated at runtime via msg.payload. Uses socket.io and serve-static on the server side. This package is a Node-RED community contribution, not actively maintained with regular releases. Key differentiator: it enables dynamic chart creation and updates within Node-RED flows without custom code.

npm install node-red-contrib-chartjs
INSTALL
IMPORT
SIG · NODE-RED-CONTRIB-C
N
node-red-contrib-chartjs
visualizationjavascriptv0.5.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Shows how to send chart data to the Chart.js node via msg.payload in Node-RED.

// This is a Node-RED node, imported automatically when installed // Flow: inject -> chartjs node -> http response // In inject node, set msg.payload to chart data: // Line chart example: msg.payload = { channel: "Temperature", color: "Red", dataset: [ { x: "Jan", y: 22 }, { x: "Feb", y: 25 } ] }; return msg;
Debug
Known issues
gotchaDataset structure differs between linear and other chart types. Multi-line charts require array of objects with channel/color/dataset; others expect a single object.
fix
Use array for linear (line, multi-line) charts, object for pie, bar, etc. See documentation for exact format.
affects: >=0.1.0
gotchaNode-RED must be restarted after installing the package to register the nodes.
fix
Restart Node-RED server after npm install.
affects: >=0.1.0
gotchaChart path must be unique across all chartjs nodes; duplicate paths cause conflicts.
fix
Configure a distinct path in node properties for each chart instance.
affects: >=0.1.0
Errors
Common errors & fixes
Chart not displaying, only shows 'Loading...'
Missing or incorrect socket.io connection; chart path not accessible.
fix
Check that Node-RED is running and chart path (e.g., /myChart) is not blocked by firewall. Restart both Node-RED and browser.
TypeError: Cannot read property 'dataset' of undefined
msg.payload missing or malformed dataset.
fix
Ensure msg.payload contains a valid dataset array with x and y fields. Example: { dataset: [{ x: 'A', y: 1 }] }
Chart.js not found (404 for chart.js script)
Static files not served correctly; node-red-contrib-chartjs dependency missing.
fix
Reinstall package: npm install node-red-contrib-chartjs --save
Upgrade
Version history
0.5.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
41 hits · last 30 days
node
36
Resources
node-red-contrib-chartjs — npm install node-red-contrib-chartjs · libregistry