apexcharts-card write chart value to custom variable

hey guys,
i implemented a apexcharts-card on my frontend.
Everything works great so far, but i would like to implement a feature and unfortunately i can not get it to work.
When i click on the chart, i would like to set a custom variable to the chart value i clicked on.
I tried a couple of ways to get it to work, but without any luck.

Could someone please help me?

This is my configuration right now:

type: custom:apexcharts-card
hours_12: false
header:
  show: true
  show_states: true
graph_span: 48h
span:
  start: day
now:
  show: true
  label: jetzt
series:
  - entity: sensor.epex_spot_data_net_price
    header_actions:
      tap_action:
        action: navigate
        navigation_path: /dashboard-test/1
    show:
      extremas: time
      in_header: before_now
    name: aktueller Preis
    type: line
    curve: stepline
    extend_to: end
    data_generator: |
      return entity.attributes.data.map((entry, index) => { return [new
      Date(entry.start_time).getTime(), entry.price_ct_per_kwh];
      });
    color_threshold:
      - value: 15
        color: green
      - value: 18
        color: "#04822e"
      - value: 20
        color: "#12A141"
      - value: 22
        color: "#79B92C"
      - value: 24
        color: "#C4D81D"
      - value: 26
        color: "#F3DC0C"
      - value: 28
        color: red
experimental:
  color_threshold: true
yaxis:
  - id: preis
    decimals: 0
    apex_config:
      title:
        text: cent/kWh
      tickAmount: 10
apex_config:
  tooltip:
    x:
      show: true
      format: HH:00 - HH:59

resulting in that look:
Screenshot 2024-12-28 215722

is there absolutely nobody who did that before?
please help

For me at least, it is not clear what you mean with “set a custom variable to the chart value i clicked on”

what i mean with that is:

when i click on a price that i like in the chart, i want that price to be written into a variable.
So that i can use that price in an automation.

I am not the utmost apex expert but not that bad either … and from where I sit this can not be achieved or at least not without a considerable amount of custom code. What may be less of an effort (effort none the less) is to click and show a figure based on a calculation within apex. you would need to dive into the docs for the HA apexcharts and the apexcharts.js to find out if it can support what you want…with this little information you provided, I can neither say yes or no