Hi, is it possible to create bar-type widget, maybe apache echarts based? Managed to create humidity widget like that:
uid: widget_gauge
tags: []
props:
parameters:
- context: item
description: Humidity value
label: Item
name: item
required: true
type: TEXT
- context: number
description: The height of widget
label: Height
name: height
required: false
type: TEXT
timestamp: Dec 25, 2022, 3:23:18 PM
component: oh-chart
config:
height: =props.height+"px"
style:
background: transparent
slots:
series:
- component: oh-data-series
config:
radius: 100%
type: gauge
startAngle: 0
endAngle: 360
axisLine:
lineStyle:
width: =props.height/10
color:
- - 1
- white
shadowColor: rgba(0, 0, 0, 0.5)
shadowBlur: 10
axisTick:
show: false
splitLine:
show: false
axisLabel:
show: false
- component: oh-data-series
config:
radius: 84%
splitNumber: 3
type: gauge
min: 0
max: 100
data:
- value: =Number.parseFloat(items[props.item].state)
axisLine:
lineStyle:
width: =props.height/8
color:
- - 0.2
- red
- - 0.35
- yellow
- - 0.6
- "#23C703"
- - 1
- blue
axisTick:
show: false
splitLine:
show: false
axisLabel:
show: false
detail:
show: false
pointer:
offsetCenter:
- 0
- 10%
icon: path://M98.3,111.6l17.1-88.1l17.7,88.5l0,0c2,6.2,0.5,13.4-4.4,18.4c-15.1,14.8-36.7-2.8-30.3-19.2L98.3,111.6z
keepAspect: true
length: 100%
width: =props.height
itemStyle:
color: "#fff"
anchor:
show: true
size: =props.height/2.5
itemStyle:
color: DeepSkyBlue
borderColor: "#000"
borderWidth: 1
keepAspect: true
offsetCenter:
- 0
- 70%
icon: path://M155.9,114c0-18.3-39.1-62.9-39.1-62.9S77.7,95.6,77.7,114C78,157.5,155.7,157.4,155.9,114z
And now I want to draw something like that with a bar inside, dynamically changing it’s height:
Is it possible, @crnjan ?