Pie chart can be created with API without the color field set, but such a Pie chart returns an error in the frontend. This applies to items with Data set type "Item list".
Steps to reproduce:
- Create a Pie chart widget using the API:
- Data set type = 1 (Item list).
- Set no color for an item.
- Open dashboard with this widget.
Result:
The widget is displayed, but shows an unhandled error:
![]()
Expected:
Either make such an API call invalid or handle this case and show some default color in UI.
More info:
API request used to reproduce:
{
"jsonrpc": "2.0",
"method": "dashboard.update",
"params": {
"dashboardid": 1506,
"pages": [
{
"widgets": [
{
"type": "piechart",
"name" : "",
"width": 12,
"height": 8,
"fields": [
{
"name": "ds.0.dataset_type",
"type": 0,
"value": 0
},
{
"name": "ds.0.itemids.0",
"type": 4,
"value": 42243
},
{
"name": "ds.0.type.0",
"type": 0,
"value": 0
}
]
}
]
}
]
},
"auth": "{{token}}",
"id": 1
}