sharmstr / MMM-ApexCharts

4 stars 1 forks source link

Unable to display example chart on MagicMirror #2

Closed RaymondJSpigot closed 2 months ago

RaymondJSpigot commented 2 months ago

I've installed the module on my MagicMirror and pointed it to the URL with sample data you've provided in the notes at https://forum.magicmirror.builders/topic/17567/mmm-apexcharts-apexcharts-js-for-your-mirror

I was trying to replicate some of your example charts to start with but haven't been able to get charts to display. On starting the mirror my other modules are shown ok, but there's no chart displayed. The console shows several errors like

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading ‘forEach’)

My config.js entry for the module looks like

{
            module: 'MMM-ApexCharts',
            position: "middle_center",
            config: {
                    chartBackground: "transparent",
                    chartDataLabels: false,
                    chartJsonFormat: "paired",
                    chartJsonInterval: "",
                    chartJsonUrl: "http://my-json-server.typicode.com/sharmstr/MMM-ApexCharts/paired",
                    chartMonochrome: true,
                    chartMonochromeColor: "#534F4F",
                    chartThemeMode: "dark",
                    chartThemePalette: "palette1",
                    chartWidth: 400,
                    chartConfig: {
                            chart: {
                            type: "bar"
                            },
                        }
                }
        },

(I'm not sure I've got the format of the chartConfig section correct - a working config example for one of your sample charts would be really helpful! I've tried a couple of variations but still no chart showing up) Hopefully you can point me in the right direction anyway - thanks

sharmstr commented 2 months ago

Several working examples in the wiki

https://github.com/sharmstr/MMM-ApexCharts/wiki/JSON