I’m trying to create a widget that displays a graph of the predicted rainfall.
e.g.:
The widget should get its data from multiple forecast items. I figured that I could use multiple polygons next to eachother to create a graph. However, I’m struggeling to use the item’s value as a coordinate of a polygon to make the polygons dynamic.
uid: rain_prediction
tags: []
props:
parameters:
- context: item
label: rain_prediction
name: rain_prediction_item
required: false
type: TEXT
parameterGroups: []
timestamp: Sep 23, 2023, 9:04:26 PM
component: oh-repeater
config:
for: coords
sourceType: array
in:
- x1: =items[props.rain_prediction_item]
fragment: true
slots:
default:
- component: f7-card
slots:
default:
- component: svg
config:
height: 100%
viewBox: 0 0 1920 1080
width: 100%
slots:
default:
- component: polygon
config:
points: 0 600, 200 600, 200 1000, 0 1000
fill: green
- component: polygon
config:
points: 200 800, 400 800, 400 1000, 200 1000
fill: red
- component: polygon
config:
points: 400 400, 600 400, 600 1000, 400 1000
fill: blue