Replies: 6 comments 7 replies
-
hi, Good luck |
Beta Was this translation helpful? Give feedback.
-
if it were that simple, I probably wouldn't have asked here, right? And I don't think anyone pointed me to the solution... so no, it's not solved. |
Beta Was this translation helpful? Give feedback.
-
This is the current situation. The green/yellow line shows the today's solar production. This is the current code:
|
Beta Was this translation helpful? Give feedback.
-
Ok, let's simplify the goal and just show the 7 days historical average data. Even in this case, graph_span is not helping, at least as far as I understand. Any suggestion? |
Beta Was this translation helpful? Give feedback.
-
Ok, it's clear my request is not clear enough.
I want my graph to show the hourly average (last column). Hope this is more clear. |
Beta Was this translation helpful? Give feedback.
-
thanks a lot for your effort!
Pls allow me some days as I'm really busy these weeks.
I'll try asap and let you know ...
… Il 01/02/2025 08:55 CET perlchamp ***@***.***> ha scritto:
i've found a (dirty and a can-life-with-that) solution :
type: custom:apexcharts-card
header:
show: true
title: blablub
show_states: true
colorize_states: true
stacked: false
New:
stacked: false
graph-settings:
graph_span: 14h
span:
start: day
offset: "+7h"
first graph - today:
series:
- entity: sensor.goldpreis_yaml
name: Durchschnitt
type: column
color: green
float_precision: 2
group_by:
func: avg
duration: 1h
show:
in_header: false
legend_value: true
in_legend: false
second graph - yesterday (<- offset)
- entity: sensor.goldpreis_yaml
name: Durchschnitt
type: column
color: red
float_precision: 2
offset: "-1day"
group_by:
func: avg
duration: 1h
show:
in_header: false
legend_value: true
in_legend: false
You need x Graphs, so the same x entities, with the needed offset (-1day, -2day, -3day...). And give each a different Color. I took green, red, blue, yellow, orange, pink and Magenta.
AND:
Don't change the names of the entities (Durchschnitt). They have to be the same, each ! You can all name 'blablub', but ALL.
Now please copy first my xaxis config. You can change it later, so you can follow..., new: tickAmount, stepSize, format. :
apex_config:
xaxis:
tickAmount: 14 # one tick per displayed xaxis-hour
stepSize: 1h
position: bottom
labels:
format: "HH:mm"
show: true
offsetX: 0
style:
colors: "#777777"
fontSize: 14px
fontFamily: Bahnschrift
axisBorder:
show: true
color: "#555555"
height: 0.5
axisTicks:
show: true
color: "#555555"
title:
text: ""
style:
color: "#777777"
fontFamily: Bahnschrift
crosshairs:
show: false
tooltip:
enabled: false
and please copy my card-style, because then you see, what i see. You can change it later, too. The width garantee that all (14) hours will be displayed on the xaxis.
And no tunty border-radius:
card_mod:
style: |
ha-card {
border-radius: 0px;
margin: -5px 0px 0px -5px;
padding: 0px 0px 20px 0px;
#color: #1C1C1C;
font-size: 1em;
width: 700px;
}
I KNOW, it's not (yet), what you want, but please check the data if they are right.
You should now see 7 avg-columns from today until 7days ago, side by side, per hour.
We are on the right way, aren't we ? If you can life with 'stepped' columns, then give all the same color. The today graph then should be a line, so you can compare the data.
Set now the Attribute 'stacked' to true.
=> now you see only one column per hour
PROBLEM: it is the sum of all 7.
SOLUTION: to each entity add the following line directly UNDER - NOT in - the '-entity:'-attribute:
transform: return x / 7;
EXPLANATION: You have 7 days, so each day-avg-value has to become divided by 7, so that the sum of the averages results nearly the real one.
DEPENDED PROBLEM:
The Tool-Tipps now show the divided value for each part of the column, and not the sum of the column.
If that doesn't matter, you can change the color of each entity to the same, so the column only has now one color.
But now you can't range the y-axis, and the values in the tool-tipps are wrong.
This should nearly be, what you want. With the column Diagramm you have to life, but a 8th graph for today as line or area… so you can compare data per se.
>
> To display a smaller range of y-values you can set min and max.
>
NO THAT'S WRONG ! You can't change a loot of things (design, axis). It's only for watching and visual displaying the data...
I don't like this dirty solution. With the stepped columns i could life...
Good luck !
—
Reply to this email directly, view it on GitHub #716 (reply in thread), or unsubscribe https://github.com/notifications/unsubscribe-auth/BCNMO2P275EZV4FCDXHDMT32NR4V7AVCNFSM6AAAAABV4TA2W6VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTEMBSGQ2DONI.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to show the current day solar production trend (xaxis=hours of the day) and compare it with the average production of the last 7 days.
In other words, if at 11am the solar production in the last 7 days has had an average of 1Kw AT THAT SPECIFIC TIME, I want to show a curve that at 11 shows 1Kw, and so on. Hope it is clear enough.
I managed to compare the current day curve with a previous day curve with offset, but wondering if I can show the average of a longer period.
Beta Was this translation helpful? Give feedback.
All reactions