-
That 3D scatter graph in the readme is very nice! What is the yaml code of it? My actual need is to create a 2D scatter, but have not succeeded so far |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 8 replies
-
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
@dbuezas This is great, thank you for this. Quick note, I just got this working in Home Assistant with the Plotly Graph Card repository in HACS, but I had to remove the "-dev" from the end of the type: line to get it working. Thanks again! |
Beta Was this translation helpful? Give feedback.
-
I love scatter plots! Thank you for making them available in your cards for HA. |
Beta Was this translation helpful? Give feedback.
-
This is actually not working for the scatter plot since the values from x_axis and y_axis come from different senors and this messes up the indexes, between the two arrays. - entity: sensor.xyz
internal: true
filters:
- resample: 5m
fn: $fn ({ys, vars }) => { vars.y_axis = ys;}
- entity: sensor.abc
internal: true
filters:
- resample: 5m
fn: |-
$fn ({ xs, ys, vars }) => {vars.x_axis = ys;
const val_x_axis = []
const val_y_axis = []
j = 1
for (let i = 1; i < ys.length; i++){
if(vars.y_axis[i] > 0.1)
{val_x_axis[j] = vars.x_axis[i];
val_y_axis[j] = vars.y_axis[i];
j++;}
}
vars.val_x_axis = val_x_axis;
vars.val_y_axis = val_y_axis;
} |
Beta Was this translation helpful? Give feedback.
I thought no one would ever ask! :)
This should also give you an idea on how to make a 2d scatter