Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

max auto or |+x| not working correctly with stacked columns #822

Open
4 tasks done
chrismaddahl opened this issue Dec 4, 2024 · 1 comment
Open
4 tasks done

max auto or |+x| not working correctly with stacked columns #822

chrismaddahl opened this issue Dec 4, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@chrismaddahl
Copy link

Checklist

  • I updated the card to the latest version available
  • I cleared the cache of my browser
  • I verified that I'm really running the lastest version in my browser console
  • I checked if there is another issue opened with the same problem

Describe the bug
I have multiple sensors displayed as stacked columns.
For example the sum of one columns is 30kWh and the bottom column is 15kWh.
the max value of the y-axis is then only at around 15kWh and the rest above is cut off.

Version of the card
Version: 2.1.2

To Reproduce
This is the configuration I used:

type: custom:apexcharts-card
apex_config:
  chart:
    height: 300px
graph_span: 2d
span:
  end: day
stacked: true
header:
  show: true
  title: Hausverbrauch letzte 24h
  show_states: true
  colorize_states: true
now:
  show: true
  color: green
yaxis:
  - id: one
    min: 0
    max: 30
    decimals: 1
    apex_config:
      tickAmount: 10
series:
  - entity: sensor.hostname_wechselrichter_home_consumption_from_grid_day
    yaxis_id: one
    name: Netzbezug
    stack_group: a
    color: 3A506B
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h
  - entity: sensor.hostname_wechselrichter_home_consumption_from_pv_day
    yaxis_id: one
    name: Eigenverbrauch PV direkt
    stack_group: a
    color: FFC300
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h
  - entity: sensor.hostname_wechselrichter_home_consumption_from_battery_day
    yaxis_id: one
    name: Eigenverbrauch Batterie
    stack_group: a
    color: 39D353
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h
  - entity: sensor.hostname_wechselrichter_energy_to_grid_day
    yaxis_id: one
    name: Einspeisung
    stack_group: a
    color: D72638
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h
  - entity: sensor.hostname_wechselrichter_battery_charge_from_pv_day
    name: Batterieladung
    stack_group: a
    color: 56CCF2
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h
  - entity: sensor.enector_geladene_energie
    name: Wallbox
    stack_group: a
    color: 5555FF
    type: column
    stroke_width: 1
    extend_to: now
    group_by:
      func: diff
      duration: 1h

Screenshots
If applicable, add screenshots to help explain your problem.
grafik
grafik

Expected behavior
I expected the max value of the y-axis to be calculated from the sum of all columns

Desktop (please complete the following information):

  • Browser [Firefox]
  • Version [133.0]

Additional context
Add any other context about the problem here.

@chrismaddahl chrismaddahl added the bug Something isn't working label Dec 4, 2024
@odelma
Copy link

odelma commented Dec 14, 2024

I was looking for solutions for the same problem, with stacked columns if I do not set max value for the y-axis the axis is cut off at the biggest value of the series, not showing the stacked (combined) value.

I also noticed that a chart with column and line series renders in an unexpected way. Max value here is 15 but without max value set for y-axis, the chart shows until 40 which leaves a lot of empty space:
image

Then if I set max: auto (or max: ~0) I get:
image

...i.e. seemingly it is taking max from the first series and thus cutting the line series for values above 6. These might be two sides of the same issue with (min/)max?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants