Apologies, I really did try searching for a solution to this in the thread before posting what will probably have already been answered: I’m trying to make a daily graph that plots from 00:00 this morning till now. However when I use type: line (or area) a ‘phantom’ point is created at tonight’s midnight and draws the line until then
This doesn’t happen when I change it to type:column
Is this intentional? I saw extend_to_end:false being used in some examples, but when I add that to the series I receive a messaging informing me “value.series[0].extend_to_end is extraneous”, so I’m obviously using that wrong.
Edit: To anyone else with the same problem, I realised extend_to_end had been depreciated, and replaced with: extend_to. So I added extend_to:now to the series and it’s all good
Hey!
I would greatly appreciate a pointer on what I’m doing wrong with the group_by settings. I have been searching and almost all comments here relate to using func: avg but I’m using func: sum instead. I have a list of dates and values on how many kwh I use for different parts stored in a custom Mariadb. I load the data from Mariadb into an entity and then draw the graphs from there.
It all works perfectly when displaying the data as-is. But I would like to group my usage per month but the sums that are grouped isn’t correct when I compare them and to the sums myself using excel. Only the first month (that isn’t complete) is correct, the other months groups all have a little to much compared to my own sums.
This is my code:
type: custom:apexcharts-card
header:
title: house usage group by test
show: true
show_states: false
apex_config:
xaxis:
labels:
format: MMM
graph_span: 1 year
span:
start: year
yaxis:
- min: 0
series:
- entity: sensor.daily_energy_data
type: column
unit: kWh
show:
legend_value: false
in_header: false
datalabels: true
data_generator: |
return entity.attributes.data.map((element) => {
return [new Date(element["datestamp"]), element["house_usage"]];
});
group_by:
duration: 1 month
func: sum
fill: zero
No, unfortunately. First you need to use long term statistic to have recorded date for that period of time and when doing so you can only set it up to display the lastest x months and not from a specific date. At least I haven’t been able to.
Has anyone found a way to plot state attributes like state_attr('climate.garageelementet', 'current_temperature') or do I really need to make a template sensor out of it first?
@RomRider I have the same issue as @galaxy_explorer not being able to show sun.sun attributes elevation and azimuth.
In developer tools i can see the attributes and their value, but in Apexcharts i get N/A.
The same config worked for me earlier but not anymore, not sure at what level it stopped working.(half a year ago at least) A fresh install of HA 2022087, and apex2.0.1 gave the same result. (no modifications of default recorder setup)
hey all, I did some searches on this and found some (confusing) information that didn’t help me. How I can query data from my InfluxDB database with Apex charts? As you know, data in HA is purged after a certain time and I’d rather not increase that time because I have a separate server for InfluxDB that my Home Assistant feeds. Right now, only Grafana (add on) can do this easily. thanks!
Has anyone found a way to make one line bolder than the others? As I understand it the stroke width is configured across all series. In the example below I would like the green line to stand out, gets a bit cluttred as it is now:
Another question, has anyone found a way to have vertical lines indicating where each day starts? So that it is easier to see in the graph where a day starts and ends? Tried annotations but only got it to work on the yaxis since I don’t know where to place them on the xaxis since that is a date.
Would it be possible to elaborate a bit on this?
Sorry. It’s probably easy, but I have tried and failed to fill similar gaps (as BolleK had) in my plot. My use is electricity price (hour slot) that I have split into 3 steplines (past of today, rest of today and tomorrow). Maybe its just to extend last value to last hour+1?