I have put in the bit of code you said - here is where I put it - is that correct:
console.log("error: " + json)
}
console.log("return: " + json)
return result;
}
return request();
Here is the output in the console window.
apexcharts-card.js:1 apexcharts-card: TypeError: Cannot read property '1' of undefined
at apexcharts-card.js:852
at Array.forEach (<anonymous>)
at HTMLElement._updateData (apexcharts-card.js:852)
le @ apexcharts-card.js:1
_updateData @ apexcharts-card.js:852
async function (async)
_updateData @ apexcharts-card.js:852
_firstDataLoad @ apexcharts-card.js:808
_initialLoad @ apexcharts-card.js:852
async function (async)
_initialLoad @ apexcharts-card.js:852
_reset @ apexcharts-card.js:808
setConfig @ apexcharts-card.js:808
s.setConfig @ card-mod.js:5
value @ chunk.41966229a8d95ddfa733.js:1
performUpdate @ app.52350e7c.js:12773
_enqueueUpdate @ app.52350e7c.js:12773
async function (async)
_enqueueUpdate @ app.52350e7c.js:12773
requestUpdateInternal @ app.52350e7c.js:12773
set @ app.52350e7c.js:12773
commit @ app.52350e7c.js:12773
commit @ app.52350e7c.js:12773
update @ app.52350e7c.js:12773
__commitTemplateResult @ app.52350e7c.js:12773
commit @ app.52350e7c.js:12773
a @ app.52350e7c.js:12773
T.render @ app.52350e7c.js:12773
update @ app.52350e7c.js:12773
performUpdate @ app.52350e7c.js:12773
_enqueueUpdate @ app.52350e7c.js:12773
async function (async)
_enqueueUpdate @ app.52350e7c.js:12773
requestUpdateInternal @ app.52350e7c.js:12773
set @ app.52350e7c.js:12773
value @ chunk.57e5b7cb5684d6b2bde8.js:1264
handleEvent @ app.52350e7c.js:12773
__boundHandleEvent @ app.52350e7c.js:12773
i @ app.52350e7c.js:12773
value @ chunk.ffc30d40bdb982984a0e.js:509
value @ chunk.ffc30d40bdb982984a0e.js:509
value @ chunk.ffc30d40bdb982984a0e.js:888
handleEvent @ app.52350e7c.js:12773
__boundHandleEvent @ app.52350e7c.js:12773
i @ app.52350e7c.js:12773
value @ chunk.e569390753b4b84e6b04.js:1106
(anonymous) @ chunk.e569390753b4b84e6b04.js:1106
update @ chunk.1431d25117b120ae04cd.js:1
_dispatch @ chunk.1431d25117b120ae04cd.js:1
dispatch @ chunk.1431d25117b120ae04cd.js:1
wi @ chunk.1431d25117b120ae04cd.js:1
(anonymous) @ chunk.1431d25117b120ae04cd.js:1
flush @ chunk.1431d25117b120ae04cd.js:1
(anonymous) @ chunk.1431d25117b120ae04cd.js:1
VM459:27 error: [object Object]
VM459:29 return: [object Object]
What does the VM459:27 error: [object Object] and VM459:29 return: [object Object] mean ?
And is this an error in apex charts ?
apexcharts-card: TypeError: Cannot read property '1' of undefined
at apexcharts-card.js:852
at Array.forEach (<anonymous>)
at HTMLElement._updateData (apexcharts-card.js:852)
return: [object Object]
If I put this URL into the browser (chrome):
http://10.0.0.10:8086/query?db=sensors&q=SELECT+"value"+FROM+"solar"+WHERE+"entity_id"+=+'month'
I get this return - which has the correct values:
{"results":[{"statement_id":0,"series":[{"name":"solar","columns":["time","value"],"values":[["2021-01-31T09:30:00Z",588.8],["2021-02-28T09:30:00Z",596.5],["2021-03-31T09:30:00Z",736.7],["2021-04-30T09:30:00Z",572.9]]}]}]}
The date/time is correct - last day of month @ 19:30 = 09:30UTC+10:00. and the solar production for the month.
So all I need to do is get this into apex-charts.
How can I adapt the URL and returned json to work with your javascript code?
thanks