And what does the documentation say about extend_to_end ?
Hello @Kertz1954,
extend_to_end: isnt a viable option since apexchart 2.0.
I removed that variable and now is working perfectly!!
Thanks so much!
It’s still loading, has nobody an idea ?
replace extend_to_end: false
by extend_to: now
under section all_series_config
and delete the second extend_to_end
This is my new config:
card config:
type: custom:apexcharts-card
header:
show: true
title: Precio vs Consumo
show_states: true
colorize_states: true
apex_config:
legend:
show: false
chart:
height: 250px
all_series_config:
type: area
curve: stepline
float_precision: 3
stroke_width: 2
opacity: 0.2
extend_to: now
show:
extremas: true
now:
show: true
yaxis:
- id: first
min: '|-0.01|'
max: '|+0.01|'
show: false
- id: second
opposite: true
min: 0
max: 2.4
show: false
graph_span: 1d
span:
start: day
series:
- entity: sensor.pvpc
name: PVPC
yaxis_id: first
color: orange
- entity: sensor.energy_hourly
name: Consumo
yaxis_id: second
color: DodgerBlue
- entity: sensor.pvpc
name: PVPC
color: red
stroke_width: 1
opacity: 0.05
yaxis_id: first
show:
extremas: false
in_header: false
data_generator: |
let res = [];
let current_hour = new Date().getHours();
for (const [key, value] of Object.entries(entity.attributes)) {
if (key.endsWith("h"))
{
let hour = key.slice(6,-1);
let date = new Date(moment({ "hour":hour, "minute":0 }));
if (date.getHours() >= current_hour)
{
res.push([date.getTime(), value]);
}
}
}
return res;
There seems to be a bug when using a stacked chart - the extrema labels seem to be mis-aligned vertically, behaving as if was not a stacked chart.
In the following example, the entity sensor.solar_panels_west_facing
is third and therefore at the top of the stack, but the label for the max extrema is at the bottom.
Am I missing something or should I raise an issue?
Hi,
I’mm trying to get the same span control on my graph but it isn’t working.
Can’t figure out where I need to put the extra bit for the span control.
Could you share the whole config where the config-template-card is in place?
I think I can figure it out than.
Thx
its all in that post?
just replace the fixed option parameters with the variable in the config-template-card as I showed there
what did you try?
As your “extremas” for the West-P, is 149W, it makes sense , that it’s showed “as low as is”, how / where is your extremas for south resp. east ? …
PS: You might be able to use offsetY , thou that would be in “fixed” position ( unless you script-it )
PS2: Stacked doesn’t mean “multiple” Yaxis, as you also see in your config ( you only have 1 Yaxis )
You need a fill config for each series:
fill:
type:
- gradient
- gradient
- gradient
- gradient
- gradient
- gradient
- solid
gradient:
type: vertical
shadeIntensity: 0.8
inverseColors: false
opacityFrom: 0.6
opacityTo: 0.3
stops:
- 0
I configured only the west panels max extrema to illustrate the bug. The east panels max extrema is correct as its the first series in the stack but the south panels is incorrect.
Of course. Not sure what this has to do with me asking if others are experiencing this bug.
I have raised issue Incorrect Y position for max extrema label for a stacked graph · Issue #514 · RomRider/apexcharts-card · GitHub
Serious ?, you have 1 Y-Axis, the first “extrema-label” is correct ( because it’s the first ofcause ), the “west” is naturally placed at the “VALUE” of the sensor ON the Y-Axis, @ 149W as the first (east-sensor) , south-starts to sense, the the value , is showed “Stacked” upon the first valur(east), They still use the SAME-Y-Axis, and so goes for West, value stacked , AND you have the 3 individual val49ues in your Header ( by choice) … THEN, you choose to pick-out the max-value of i.e West-sensor, it’s 149 W, … where on a scale ( 1 Scale) from 0 > eternity do you want this label, at it’s reigh tful place on the SCALE 149W, or +something( i.e on top of the other sensors values), spite the fact it’s 149W, you want this to label @ 3000 something ? … it’s 149W, it’s placed at 149 at the scale ( it’s not a “Stacked” Value ) which it obviously shouldn’t be
PS: When you “first” sensor, east, no longer produce any “W”, then south-sensor become “first” and max- label placed correct (in your mind) … and i somehow understand why you want the label placed in such way ( the the stacked-sensors visually value ) , You could also choose to show “Max” another place than in the Graph area. I.e in the header, or beneath the graph, the “Marker” of the Value, will forever be where it belong , 149@149 on the scale
For sure it’s in no way a Bug, it’s nothing else than a FR
perfect, thank you - now it’s working!
Hi!!
Something is wrong after 2023.03 with my chart…
But there is data in the entities:
Did i miss something?
The code:
# SYSMON
- type: vertical-stack
cards:
- type: custom:apexcharts-card
<<: *apexcharts-card
header:
<<: *apexcharts-card-header
title: System monitor
series:
- entity: sensor.rpi_hassio_cpu_usage
type: area
curve: smooth
group_by:
duration: 15min
func: avg
- entity: sensor.rpi_hassio_temperature
type: area
curve: smooth
group_by:
duration: 15min
func: avg
- type: entities
title: Pi statistics
show_header_toggle: false
entities:
- sensor.rpi_hassio_memory_use
- sensor.rpi_hassio_last_boot_customized
Yes, Maybe you missed checking your logs, or you just don’t thing this is relevant to share
Serious? Thanks for your help
My thought was/is, when something (unexpected) “suddenly” happens in a system, it’s usually reflected in the log-files, and in some case useful for troubleshooting purpose, could maybe even reveal the problem/cause in clear text
Ohh well you actually did help
But still weird…
Checked console log and i still was on APEXCHARTS-CARD v2.0.1 (after restore older backup)
Updated to latest 2.0.2 and it works…
But when i reverted to v.2.0.1 again (to check that it wouldnt work again) it also is still working haha
Wtf?
And i wanted to share more… but apexconfig is very long and logs also… so i wanted to not have a very long post to read
I found out I did everything correct in the graph yaml.
But didn’t realise I had to create the input_select for the input_select.apex_span
For some reason I thought the selector was created in the graph automatically
I figured it out now
Hi,
I may have found a bug, or maybe it’s my config. I am trying to plot a column chart for the forecast rainfall uisng data_generate. If I have a chart only with the column chart of interest, it all looks fine.
The moment I add another series (no matter the config for it), the columns for the data_generated series become thin:
The chart is generated using the code:
type: custom:apexcharts-card
series:
- entity: sensor.inpo_praha_forecast
type: column
data_generator: |
return entity.attributes.forecast_time.map((time, index) => {
return [new Date(time).getTime(), entity.attributes.forecast_precipitation[index]];
});
- entity: sensor.electricity_total_energy #<---- remove this to see a good chart
graph_span: 24h
span:
start: day
yaxis:
- min: 0
max: 1
and the source sensor has the following structure, which is used for the data generation (cut for brevity):
forecast_time:
- '2023-02-17T12:23:00.121309+01:00'
- '2023-02-17T13:00:00+01:00'
- '2023-02-17T14:00:00+01:00'
- '2023-02-17T15:00:00+01:00'
- '2023-02-17T16:00:00+01:00'
- '2023-02-17T17:00:00+01:00'
- ....
forecast_temperature:
- 9.3
- 10
- 10
- 10
- ...
forecast_precipitation:
- 0
- 0
- 0
- ...
icon: mdi:weather-sunny-alert
friendly_name: InPo Praha Forecast
Your config ?.. and where is that ? you have 2 time-line sensors … 1 is “precipitation-forecast” and the other “apparently” looks like a “total-current-power” CURRENT ( means “now” ) , thou it’s hard to tell from a picture … your graph however , starts “day” meaning 00:01> AND picture shows precip-forecast for the day … HOW does this other sensor come into the picture (in the middle of the forecast-graph ? )
You are “blowing” a half wind, and doesn’t seems to understand what you are doing, sorry to say straight .
Figure out what you what to show/see, if you got problems with that, open a topic, f… up a graph is the easiest thing to do, and that does not mean there is a bug