Apex Chart Tooltip mit 2 Werten

Hallo zusammen,

ich brauche mal wieder Hilfe, ich habe mir schon recht erfolgreich ein Diagramm gebaut. Komme aber in einem Punkt nicht weiter.

Wenn ich mit der Maus über die Grafik fahre, wird mir nur der PV Wert angezeigt nicht der Hausverbrauch. Ich möchte beide Werte in einem Tooltip haben.

Könnt ihr mir helfen? Chat GPT war mal wieder nicht hilfreich.

Danke vorab

type: custom:apexcharts-card
header:
  show: true
  title: PV & Hausverbrauch – 14 Tage
  show_states: true
  colorize_states: true
graph_span: 14d
update_interval: 30min
apex_config:
  chart:
    background: "#f5f5f5"
  legend:
    show: true
    position: top
  stroke:
    width: 3
  grid:
    borderColor: "#c8c8c8"
    strokeDashArray: 3
  dataLabels:
    enabled: true
  tooltip:
    shared: true
    intersect: false
    followCursor: true
  yaxis:
    - id: left
      decimalsInFloat: 0
      labels:
        formatter: |
          EVAL: (val) => `${val}kWh`
  colors:
    - "#f5ce89"
    - "#28baf3"
  xaxis:
    tooltip:
      enabled: false
series:
  - entity: sensor.s10x_solar_production_today
    name: PV-Ertrag
    type: line
    curve: smooth
    yaxis_id: left
    statistics:
      type: state
      period: day
  - entity: sensor.s10x_house_consumption_today
    name: Hausverbrauch
    type: column
    yaxis_id: left
    statistics:
      type: state
      period: day

Moin, bin vor paar Wochen zu Gemini gewechselt und es hat gefruchtet! :slight_smile:

Hier ist die Lösung, was bei mir funktioniert:

type: custom:apexcharts-card
update_interval: 30s
cache: false
graph_span: 12h
all_series_config:
  stroke_width: 1
  group_by:
    func: avg
    duration: 10min
apex_config:
  tooltip:
    enabled: true
    shared: true
    intersect: false
  chart:
    toolbar:
      show: false
header:
  show: true
  title: "BMS Status: 16kWh Speicher"
  show_states: true
  colorize_states: true
yaxis:
  - id: current_axis
    show: true
    min: -50
    max: 50
    apex_config:
      tickAmount: 10
  - id: soc_axis
    opposite: true
    show: true
    min: 0
    max: 100
    apex_config:
      tickAmount: 10
  - id: voltage_axis
    opposite: true
    show: true
    min: 50
    max: 55
    apex_config:
      tickAmount: 10
series:
  - entity: sensor.jk_bms_jk_bms_001_current
    name: Strom
    yaxis_id: current_axis
    color: "#ff9800"
  - entity: sensor.jk_bms_jk_bms_001_state_of_charge_soc
    name: Ladestand
    yaxis_id: soc_axis
    color: "#4caf50"
  - entity: sensor.jk_bms_jk_bms_001_voltage
    name: Spannung
    yaxis_id: voltage_axis
    color: "#2196f3"
```

Gruß

Viktor

1 „Gefällt mir“