Hi,
For the community’s information, there is a bug when a chart is created with colors different from the defaults.
I created a chart with 2 temperature sensors, changed the colors associated with those two sensors and when saving, it crashes (the page stays on the loading animation and errors are visible in the browser console).
@pierre-gilles I created the issue:
ouvert 05:22PM - 20 Dec 24 UTC
fermé 02:07PM - 23 Jan 25 UTC
bug
**Describe the bug**
When creating a new chart with two sources, selecting anot… her color than the default generates an error "UNPROCESSABLE_ENTITY".
**To Reproduce**
Steps to reproduce the behavior:
1. Create a new dashboard (or edit one)
2. Add a new chart
3. Add two sources (like two temperature devices)
4. Select colors different than the default selected
5. Click on "save"
6. See error, the page is stuck on "loading"
**Expected behavior**
Choosing any color should work as expected
**Screen Recording**
https://github.com/user-attachments/assets/15f95606-7ce7-4c5a-b3ca-abe0dabccd79
**Your Gladys installation (please complete the following information):**
- Docker
- Official last image v4.50.2
**Web browser error**
```
Uncaught (in promise) TypeError: s is undefined
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:14
value apexcharts.common.js:6
value apexcharts.common.js:14
value apexcharts.common.js:14
c ApexChartComponent.jsx:218
componentDidMount ApexChartComponent.jsx:222
Preact 7
a Chart.jsx:259
componentDidMount Chart.jsx:290
Preact 7
a EditChart.jsx:67
S Preact
```
```
{
"response": {
"status": 422,
"data": {
"status": 422,
"code": "UNPROCESSABLE_ENTITY",
"properties": [
{
"message": "\"[2][0].colors[0]\" must be a string",
"attribute": "boxes",
"value": [
[
{
"type": "temperature-in-room",
"room": "salle-de-bain"
},
{
"type": "humidity-in-room",
"room": "salle-de-bain"
}
],
[
{
"type": "temperature-in-room",
"room": "salle-de-douche"
},
{
"type": "humidity-in-room",
"room": "salle-de-douche"
}
],
[
{
"type": "chart",
"device_feature_names": [
"Salle de bain",
"Douche"
],
"device_features": [
"zigbee2mqtt-sdd-temp-sonoff-temperature-sensor-decimal-temperature",
"zigbee2mqtt-sdb-temp-sonoff-temperature-sensor-decimal-temperature"
],
"title": "Salles d'eau",
"chart_type": "area",
"colors": [
null,
"#00cec9"
],
"display_axes": true,
"display_variation": true,
"interval": "last-day"
}
]
],
"type": "Validation error"
}
]
}
}
}
```
4 Likes
Thanks for the very thorough issue Indeed, it’s a bug!
I’ll look into it as soon as I’ve dealt with all my back-to-work to-dos
1 Like