Registry / data / iobroker.echarts

iobroker.echarts

JSON →
library3.1.0jsnpmunverified

ioBroker.echarts is an ioBroker adapter designed for building and displaying useful charts within the ioBroker smart home ecosystem. It leverages the powerful Apache ECharts library to render various chart types like line, bar, and radar charts. Currently at version 3.1.0, the adapter receives updates with moderate frequency, often including bug fixes, dependency updates, and minor feature enhancements. Key differentiators include its tight integration with ioBroker states, allowing data from various devices and services to be easily visualized. It supports data input from custom JSON states and offers server-side rendering capabilities to generate static chart images (SVG, PNG, JPG, PDF) for use in other applications or storage. The adapter also provides dedicated widgets for ioBroker Vis for easy chart embedding.

npm install iobroker.echarts
INSTALL
IMPORT
SIG · IOBROKER.ECHARTS
I
iobroker.echarts
datajavascriptv3.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sendTo
sendTo('echarts.0', { preset: 'echarts.0.myPreset', renderer: 'png', width: 800, height: 400 }, result => { if (result.error) { console.error(result.error); } else { console.log('Chart generated:', result.data); } });
import { generateChart } from 'iobroker.echarts'; // Incorrect: This package is an adapter, not a traditional JS library with direct exports. const echartsAdapter = require('iobroker.echarts'); // Incorrect: Not a CommonJS module for direct programmatic use.
ioBroker.echarts is an adapter. Programmatic interaction happens via the global `sendTo` function provided by the ioBroker host, not via direct JS module imports. The 'echarts.0' is the instance ID.

Demonstrates how to programmatically request server-side chart rendering and how to update a chart by writing to an ioBroker JSON state.

/* Example of server-side chart rendering using sendTo */ // Assuming 'echarts.0.myPreset' is a pre-configured chart preset in the ioBroker.echarts adapter. // You can create presets via the ioBroker admin interface for the echarts adapter. sendTo( 'echarts.0', { preset: 'echarts.0.myPreset', // The ID of your pre-defined chart preset renderer: 'png', // Output format: 'svg', 'png', 'jpg', 'pdf' width: 1024, // Width of the generated image height: 768, // Height of the generated image background: '#FFFFFF', // Background color (e.g., for PNG/JPG) theme: 'light', // Chart theme: 'light' or 'dark' quality: 0.9, // Quality for JPG renderer (0.0 - 1.0) fileName: 'my_chart.png', // Name to save the file in ioBroker DB (e.g., echarts.0/my_chart.png) cache: 300 // Cache time for this preset in seconds }, result => { if (result.error) { console.error('Failed to render chart:', result.error); } else { console.log('Chart rendering successful. Data or file path:', result.data); // result.data could be a base64 URL if fileName is not specified, // or a confirmation if fileName is used to save to ioBroker DB. } } ); // Example of updating a chart with data from a JSON state // This assumes you have a state '0_userdata.0.myCustomChartData' of type 'json' // and your chart preset is configured to use this state as a data source. const customJsonStateId = '0_userdata.0.myCustomChartData'; const chartData = [ { "ts": Date.now() - 3600000, "val": 25 }, { "ts": Date.now() - 1800000, "val": 30 }, { "ts": Date.now(), "val": 28 } ]; // To update the chart, simply update the JSON state. The adapter will react to changes. setState(customJsonStateId, JSON.stringify(chartData), true); console.log(`Updated state '${customJsonStateId}' with new chart data.`);
Debug
Known issues
breakingStarting with versions 3.0.0 and 3.0.1, ioBroker.echarts removed support for Node.js 18. The adapter now explicitly requires Node.js version 20 or higher.
fix
Ensure your ioBroker host system is running Node.js version 20 or newer. Update Node.js if necessary using recommended ioBroker upgrade procedures.
affects: >=3.0.0
gotchaThe adapter utilizes Sentry libraries for automatic error reporting. This sends exceptions and code errors to the developers. Users concerned about data privacy should be aware of this.
fix
Refer to the Sentry-Plugin Documentation (linked in the adapter's README) for instructions on how to disable this error reporting feature if desired.
affects: >=1.0.0
gotchaWhen using JSON data sources for charts, the adapter automatically calculates start and end times from the provided data. Aggregation of values is not performed by the adapter; all data manipulation must be done before writing the JSON to the ioBroker state.
fix
Pre-process your data to include desired aggregations or specific time ranges before formatting it as JSON and writing it to the ioBroker state. Ensure 'ts', 'time', 't', or 'date' are used for timestamps and 'val', 'value', 'v', 'data', or 'y' for values in the JSON objects.
affects: >=1.0.0
gotchaDue to rendering limitations, it is not possible to enable or disable individual lines in the chart legend on touch devices when chart zoom functionality is enabled.
fix
For touch devices, consider disabling zoom if legend interaction is critical, or provide alternative controls for data visibility outside the chart legend.
affects: >=1.0.0
breakingOlder versions of js-controller and admin adapter might cause compatibility issues. Recent checks indicate that js-controller 6.0.11 and admin 7.6.20 are required minimums for full compatibility, while `io-package.json` might list older dependencies.
fix
Ensure your ioBroker `js-controller` is updated to at least version 6.0.11 and the Admin adapter to at least 7.6.20. Update your `io-package.json` and `package.json` dependencies if you are developing or contributing to the adapter itself.
affects: >=3.0.0
Errors
Common errors & fixes
Cannot install iobroker.echarts@<version>... host.<hostname> Cannot install iobroker...
Often due to an incompatible Node.js version, insufficient permissions, or network issues preventing package download.
fix
Check your Node.js version (`node -v`) and ensure it's `>=20`. Run `iobroker fix` to correct permissions. Verify network connectivity to npm registries. Try `npm cache clean --force` and then retry installation.
Error: No config provided. | Charts dont show the correct JSON value, when they showing them.
The ECharts preset might be misconfigured, or the JSON data provided to a state-based chart is malformed or uses incorrect key names.
fix
Review your chart preset configuration in the ioBroker admin interface. Validate your JSON data structure, ensuring it contains valid `ts`/`time`/`t`/`date` for timestamps and `val`/`value`/`v`/`data`/`y` for values. Use a JSON validator to check syntax.
Cannot find required modules: looks like it is not possible to generate charts on your Hardware/OS
This error can occur during server-side rendering if underlying graphics libraries (like 'canvas' or 'jsdom') are missing or cannot be built on the host system.
fix
This often points to missing system-level dependencies for `node-canvas` or `jsdom`. Install required build tools and libraries for your OS (e.g., `sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev` on Debian/Ubuntu). Then, try reinstalling the adapter or running `npm rebuild` within the adapter's directory.
sendTo('echarts.0', ...): Callback result.error is true or no data is received.
The ioBroker.echarts adapter instance might not be running, the specified preset ID is incorrect, or there's an issue with the rendering parameters. The `sendTo` call itself might not fail, but the callback indicates an internal adapter error.
fix
Verify that the `echarts.0` adapter instance is running in the ioBroker admin interface. Double-check the `preset` ID in your `sendTo` call against your configured presets. Review the ioBroker logs for the `echarts.0` instance for more specific error messages related to the rendering request. Ensure all parameters in the `sendTo` payload are correct and valid.
Upgrade
Version history
3.1.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
iobroker.echarts — npm install iobroker.echarts · libregistry