You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am rather new to all this and I have been trying to get this right for the last few days, to no avail. I am trying to get the humidity levels from a sensor and display them in a radialBar with red for low, green for ok, red for high and gradients in between (red between 0-20, yellow between 20-35, green between 35-55, yellow between 55-70, red between 70-100). I have been tampering with the code relentlessly but can't seem to get it right. Would any of you kindly take a look and tell me what I am doing wrong?
This is just the first few lines where i check if the entity is well configured:
already, when adding the data generator (so I suspect that is the problem), I get N/A:
This is my full card config:
`type: 'custom:apexcharts-card'
series:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am rather new to all this and I have been trying to get this right for the last few days, to no avail. I am trying to get the humidity levels from a sensor and display them in a radialBar with red for low, green for ok, red for high and gradients in between (red between 0-20, yellow between 20-35, green between 35-55, yellow between 55-70, red between 70-100). I have been tampering with the code relentlessly but can't seem to get it right. Would any of you kindly take a look and tell me what I am doing wrong?
This is just the first few lines where i check if the entity is well configured:
already, when adding the data generator (so I suspect that is the problem), I get N/A:
This is my full card config:
`type: 'custom:apexcharts-card'
series:
min: 0 # Setting minimum value for radialBar
max: 100 # Setting maximum value for radialBar
data_generator: |
return [{
x: 'Humidity',
y: parseFloat(entity.state),
}];
apex_config:
chart:
type: 'radialBar'
height: 250
plotOptions:
radialBar:
startAngle: -135
endAngle: 135
hollow:
margin: 15
size: '70%'
dataLabels:
name:
show: false
value:
formatter: |
function(val) {
if (!val) return '0%'; // Handle undefined or null values
return parseFloat(val).toFixed(2) + '%';
}
offsetY: 10
color: '#fff'
fontSize: '20px'
show: true
track:
background: '#e0e0e0'
strokeWidth: '97%'
margin: 5
stroke:
lineCap: 'round'
fill:
type: 'gradient'
gradient:
shade: 'dark'
type: 'horizontal'
shadeIntensity: 0.5
gradientToColors: ['#FF0000', '#FFFF00', '#00FF00']
inverseColors: true
opacityFrom: 1
opacityTo: 1
stops: [0, 50, 100]
`
Any help is greatly appreciated. Have a good one.
Beta Was this translation helpful? Give feedback.
All reactions