uxigene / mmm-chart Goto Github PK
View Code? Open in Web Editor NEWChart module for MagicMirror²
Chart module for MagicMirror²
hi,
whenever i activate your module all the other modules keep loding and won't boot
{ module: 'MMM-Chart', position: 'top_right', config: { width: 800, height: 800, chartConfig: { type: 'bar', data: { labels: ['Red', 'Blue', 'Yellow', 'Green', 'Purple', 'Orange'], datasets: [{ label: '# of Votes', data: [12, 19, 3, 5, 2, 3], backgroundColor: [ 'rgba(255, 99, 132, 0.2)', 'rgba(54, 162, 235, 0.2)', 'rgba(255, 206, 86, 0.2)', 'rgba(75, 192, 192, 0.2)', 'rgba(153, 102, 255, 0.2)', 'rgba(255, 159, 64, 0.2)' ], borderColor: [ 'rgba(255, 99, 132, 1)', 'rgba(54, 162, 235, 1)', 'rgba(255, 206, 86, 1)', 'rgba(75, 192, 192, 1)', 'rgba(153, 102, 255, 1)', 'rgba(255, 159, 64, 1)' ], borderWidth: 1 }] } } } },
`/* global Module */
/* Magic Mirror
Module.register("MMM-Chart", {
defaults: {
width : 200,
height : 200,
chartConfig : {
}
},
getScripts: function() {
return ["modules/" + this.name + "/node_modules/chart.js/dist/Chart.bundle.min.js"];
},
start: function() {
this.config = Object.assign({}, this.defaults, this.config);
Log.info("Starting module: " + this.name);
},
getDom: function() {
// Create wrapper element
const wrapperEl = document.createElement("div");
wrapperEl.setAttribute("style", "position: relative; display: inline-block;");
// Create chart canvas
const chartEl = document.createElement("canvas");
// Init chart.js
this.chart = new Chart(chartEl.getContext("2d"), this.config.chartConfig);
// Set the size
chartEl.width = this.config.width;
chartEl.height = this.config.height;
chartEl.setAttribute("style", "display: block;");
// Append chart
wrapperEl.appendChild(chartEl);
return wrapperEl;
}
});
pi@raspberrypi:~/MagicMirror $ npm start
[email protected] start
DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js
[31.07.2022 14:19.56.781] [LOG] Starting MagicMirror: v2.18.0
[31.07.2022 14:19.56.792] [LOG] Loading config ...
[31.07.2022 14:19.56.813] [LOG] Loading module helpers ...
[31.07.2022 14:19.58.311] [LOG] Initializing new module helper ...
[31.07.2022 14:19.58.313] [LOG] Module helper loaded: MMM-BackgroundSlideshow
[31.07.2022 14:19.59.837] [LOG] Initializing new module helper ...
[31.07.2022 14:19.59.841] [LOG] Module helper loaded: MMM-CalendarExt2
[31.07.2022 14:19.59.849] [LOG] No helper found for module: clock.
[31.07.2022 14:19.59.866] [LOG] Initializing new module helper ...
[31.07.2022 14:19.59.868] [LOG] Module helper loaded: MMM-MyDutchWeather
[31.07.2022 14:20.00.186] [LOG] Initializing new module helper ...
[31.07.2022 14:20.00.189] [LOG] Module helper loaded: MMM-rainfc
[31.07.2022 14:20.00.269] [LOG] Initializing new module helper ...
[31.07.2022 14:20.00.272] [LOG] Module helper loaded: MMM-MyGarbage
[31.07.2022 14:20.00.279] [LOG] No helper found for module: MMM-AutoDimmer.
[31.07.2022 14:20.00.616] [LOG] Initializing new module helper ...
[31.07.2022 14:20.00.619] [LOG] Module helper loaded: MMM-Remote-Control
[31.07.2022 14:20.00.626] [LOG] No helper found for module: MMM-Chart.
[31.07.2022 14:20.00.628] [LOG] All module helpers loaded.
[31.07.2022 14:20.01.029] [LOG] Starting server on port 8080 ...
[31.07.2022 14:20.01.041] [WARN] You're using a full whitelist configuration to allow for all IPs
[31.07.2022 14:20.01.059] [LOG] Server started ...
[31.07.2022 14:20.01.062] [LOG] Connecting socket for: MMM-BackgroundSlideshow
[31.07.2022 14:20.01.065] [LOG] Connecting socket for: MMM-CalendarExt2
[31.07.2022 14:20.01.067] [LOG] Connecting socket for: MMM-MyDutchWeather
[31.07.2022 14:20.01.069] [LOG] Starting node_helper for: MMM-MyDutchWeather
[31.07.2022 14:20.01.072] [LOG] Connecting socket for: MMM-rainfc
[31.07.2022 14:20.01.074] [LOG] Connecting socket for: MMM-MyGarbage
[31.07.2022 14:20.01.077] [LOG] Starting node_helper for module: MMM-MyGarbage
[31.07.2022 14:20.01.079] [LOG] Connecting socket for: MMM-Remote-Control
[31.07.2022 14:20.01.081] [LOG] Starting node helper for: MMM-Remote-Control
[31.07.2022 14:20.01.248] [LOG] Sockets connected & modules started ...
[31.07.2022 14:20.01.593] [LOG] Launching application.
[31.07.2022 14:20.04.852] [INFO] BACKGROUNDSLIDESHOW_NEXT_IMAGE
[31.07.2022 14:20.04.888] [ERROR] Whoops! There was an uncaught exception...
[31.07.2022 14:20.04.905] [ERROR] TypeError: Cannot read property 'imagePaths' of undefined
at Class.gatherImageList (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:112:32)
at Class.getNextImage (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:145:12)
at Class.socketNotificationReceived (/home/pi/MagicMirror/modules/MMM-BackgroundSlideshow/node_helper.js:298:12)
at Socket. (/home/pi/MagicMirror/js/node_helper.js:109:11)
at Socket.emit (events.js:200:13)
at Socket.emitUntyped (/home/pi/MagicMirror/node_modules/socket.io/dist/typed-events.js:69:22)
at /home/pi/MagicMirror/node_modules/socket.io/dist/socket.js:465:39
at processTicksAndRejections (internal/process/task_queues.js:82:9)
[31.07.2022 14:20.04.914] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
[31.07.2022 14:20.04.916] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
[31.07.2022 14:20.08.582] [LOG] 200[object Object]`
and i already tryed disabeling MMM-BackgroundSlideshow but that doesnt help either (its also functioning fine)
Can you provide a chartConfig example for the configuration option in your documentation? I use the Chartjs.org format for data display but the chart still does not display. Not sure if this is a module issue or a formatting issue on my part.
Attempting a pie chart: http://www.chartjs.org/samples/latest/charts/pie.html
If I want to do the git clone, I always get the report:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.