Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-23622

Pie chart can be created with API without the color field set, but such a Pie chart returns an error in the frontend

XMLWordPrintable

      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:

      1. Create a Pie chart widget using the API:
        1. Data set type = 1 (Item list).
        2. Set no color for an item.
      2. 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
      }
      

            zabbix.dev Zabbix Development Team
            jnulle Janis Nulle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: