RomRider / apexcharts-card

📈 A Lovelace card to display advanced graphs and charts based on ApexChartsJS for Home Assistant
MIT License
1.14k stars 78 forks source link

V2.1.x series kindof broke y axis grid #728

Open Floppe opened 1 month ago

Floppe commented 1 month ago

Checklist

Describe the bug I've tested 2.1.0, 2.1.1 and 2.1.2. All versions do not show Y axis grid lines when using 2 axes. Only min and max line is shown.

Screenshots Before upgrade image After upgrade image

Desktop:

Floppe commented 1 month ago

The card yaml

type: custom:config-template-card
variables:
  mytime: new Date().getTime()
entities:
  - sensor.heatpump
card:
  type: custom:apexcharts-card
  header:
    show: true
    title: Geothermal Energy
    show_states: true
    colorize_states: true
  now:
    show: false
    label: Now
  graph_span: 8h
  apex_config:
    chart:
      height: 450px
      zoom:
        enabled: true
      toolbar:
        show: true
        tools:
          zoom: true
          zoomin: true
          zoomout: true
          pan: true
          reset: true
    tooltip:
      fixed:
        enabled: true
        position: bottomLeft
  yaxis:
    - id: energy
      min: ~0
      apex_config:
        opposite: false
        forceNiceScale: true
        decimalsInFloat: 0
        labels:
          show: true
    - id: gear
      decimals: 0
      min: 0
      apex_config:
        tickAmount: 1
        opposite: true
        forceNiceScale: true
        labels:
          show: true
    - id: dumb
      show: false
  series:
    - entity: sensor.compressor_current_gear
      yaxis_id: gear
      name: Gear
      type: line
      curve: stepline
      extend_to: end
      show:
        in_header: true
        legend_value: false
      color: yellow
      opacity: 0.9
      stroke_width: 2
    - entity: sensor.geothermal_sys_kw
      yaxis_id: energy
      name: Energy
      type: line
      extend_to: false
      float_precision: 0
      stroke_width: 2
      opacity: 0.7
      color: '#FF0000'
      show:
        in_header: true
        legend_value: false
      group_by:
        func: avg
        duration: 1m
RomRider commented 1 month ago

I have seen the same happen from time to time but it's an apexcharts.js issue which I can't fix. Try with forceNiceScale: false maybe? Often a refresh on the page fixes the issue (at least for me)

Floppe commented 1 month ago

Thanks. Did not help with forceNiceScale though.

I also noted a another issue in another graph. So I reverted to 2.0.4 for now.

image

Before if was like this: image

Note the y-axis 0 line. And of course the columns width.

jhemak commented 1 month ago

I am also having several different issues with V2.1.x that are not present in 2.0.4. I have worked around most of those problems, however the one I cannot seem to solve is needing to change forceNiceScale to false since the scale is indeed no longer nice. Any openness to rolling this back in the repo and making 2.1.x a beta until these issues can be addressed?

wejto commented 1 month ago

I also found some issues with the y-axis after upgrading from 2.0.4 (the last version not having this different behaviour).

2.0.4

image

any newer version

image

Note: the stacking works again even in the newer versions but the yaxis section has to go away at all which I would prefer not to.

The config in my scenario looks like following

yaxis:
  - min: 0
    max: ~15
    decimals: 0
    apex_config:
      tickAmount: 5