Plotly scatter graph fail

New to plotly/JS.
Following config does not produce x-y scatter plot, rather two separate traces with time on x-axle

type: custom:plotly-graph
title: Scatter Graph
entities:
  - sensor.esp32_2_inside_humidity
  - sensor.esp32_2_inside_temperature
layout:
  xaxis:
    title: X-Axis
  yaxis:
    title: Y-Axis
  hovermode: closest
data:
  - type: scatter
    mode: markers
    x:
      sensor.esp32_2_inside_temperature
    y:
      sensor.esp32_2_inside_humidity

Can someone spot the mistake?

Was answered here:
https://github.com/dbuezas/lovelace-plotly-graph-card/discussions/298

1 Like

So it sounds like true scatter plots are only supported in the scatter3d mode?

For a 2D plot, what’s the best course of action - flatten a 3D plot?

not only 3d plot but 2d is also possible
Here you are a very simple example:

type: custom:plotly-graph
title: eGolf Charging Curve
entities:
  - entity: >-
      sensor.p30x_total_charging_current_calc
    internal: true
    fn: $fn ({ ys, vars }) => vars.curr = ys
  - entity: >-
      sensor.egolf_battery_level
    internal: true
    fn: $fn ({ ys, vars }) => vars.soc = ys
  - entity: ''
    x: $fn ({ vars }) => vars.curr
    'y': $fn ({ vars }) => vars.soc

raw_plotly_config: true
layout:
  xaxis:
    title: Calculated Current (A)
  yaxis:
    title: SOC (%)