Apex Chart Cards Y-Axis ID ignored?

Hi!

Apexcharts-card is so nice. Been using it for basic good looking stuff for a while now.

I have difficulty on creating a two axis graph for fridge temperatures on one side and freezer temperatures on the other. I have 4 series, and need to match 2 ea side.

It seems series 1 gets matched do the left and 2,3,4 to the right, no matter the id I specify in series. Been bumping on that for a while. Maybe an experienced eye will find my error in a sec. :slight_smile:

Thanks

type: custom:apexcharts-card
header:
  title: Refrigeradores e Congeladores
  show: true
apex_config:
  yaxis:
    - id: esquerda
      title:
        text: Geladeiras
      min: |
        EVAL:function(min) {
          return min;
        }
    - id: direita
      title:
        text: Congeladores
      opposite: true
      min: |
        EVAL:function(min) {
          return min;
        }
series:
  - entity: sensor.termometro_geladeira_geral_temperature
    name: Geladeira Geral
    yaxis_id: esquerda
  - entity: sensor.termometro_geladeira_vidro_refrigerador_temperature
    name: Geladeira Vidro
    yaxis_id: esquerda
  - entity: sensor.termometro_geladeira_geral_congelador_temperature
    name: Freezer Geral
    yaxis_id: direita
  - entity: sensor.termometro_geladeira_vidro_congelador_temperature
    name: Freezer Vidro
    yaxis_id: direita

image

Because you’re using yaxis under apex_config it is passed through to Apex Charts with no validation, and Apex Charts doesn’t have an id attribute on it. For multiple y-axes, Apex Charts uses an array. However I’ve found that this doesn’t work with apexcharts_card (this line seems to preclude it).

To use id you would need to use the apexcharts_card yaxis attribute (confusing yes). However, this does not support EVAL for min an max. And it won’t let you put these under apex_config under yaxis (even more confusing).

You also cannot use a mix of yaxis definitions from apexcharts_card and Apex Charts because the former overrides the latter.

To hopefully make it clearer, you can have:

apex_config:
  yaxis:
    # Apex Charts properties but arrays don't seem to work

or:

yaxis:
  # apexcharts_card properties
  apex_config:
    # Apex Charts properties but not min, max, show or opposite

Indeed. One can notice different samples with apex_config before or after the y axis (an other stuff), but it gets a little complicated. In my case, a simpler config did the trick, following your advice. Fortunately, the automatic definition of y axis is working fine in this version (had issues in the past, thus the eval).

Thanks!