-
|
Hello, I'm having trouble writing to the system logs when a user clicks on an ApexCharts graph. My initial idea was to control an input field by clicking on a bar in the chart, but that didn't work. So, I tried to simplify it by just writing something to the log, but I've noticed that clicking on the chart doesn't do anything at all. Here's the code for my chart. Is there a problem with my EVAL function? Am I missing something? type: custom:apexcharts-card
header:
show: true
title: "TEST — clic global (events.click via this.hass)"
apex_config:
chart:
events:
click: |
EVAL: (event, chartContext, opts) => {
try {
this.hass.callService('system_log','write',{
message: 'Apex CLICK (events.click): coucou',
level: 'warning',
logger: 'custom.apexclick'
});
} catch(e) {
console.warn('apex click error', e);
}
}
graph_span: 2d
all_series_config:
type: column
group_by:
duration: 1d
func: max
fill: 'zero'
series:
- entity: sensor.energie_piscine_jour_hp
name: HP
- entity: sensor.energie_piscine_jour_hc
name: HCThank you very much for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
If it is just logging then you could also achieve this via tap_action but I guess you are looking for more. |
Beta Was this translation helpful? Give feedback.
-
|
and btw, I suggest to not post in two locations... |
Beta Was this translation helpful? Give feedback.
If it is just logging then you could also achieve this via tap_action but I guess you are looking for more.
hass is only there in
transformanddata_generator.... here you could get it via the DOM ...at least, this is what I found a while agodocument.querySelector('home-assistant').hass