[comment]: # ({65c03452-e03ef403})
# 15 Scheda item

[comment]: # ({/65c03452-e03ef403})

[comment]: # ({50641221-cb7939c5})
### Descrizione

Questi parametri e i possibili valori delle proprietà per i rispettivi oggetti campo del widget dashboard consentono di configurare
il widget [*Item card*](/manual/web_interface/frontend_sections/dashboards/widgets/item_card) nei metodi `dashboard.create` e `dashboard.update`.

::: noteimportant
Le proprietà `fields` del widget non vengono validate durante la creazione o l'aggiornamento di una dashboard.
Ciò consente agli utenti di modificare i [widget integrati](/manual/web_interface/frontend_sections/dashboards/widgets) e creare [widget personalizzati](/devel/modules/tutorials/widget), ma introduce anche il rischio di creare o aggiornare i widget in modo errato.
Per garantire la corretta creazione o il corretto aggiornamento del widget *Item card*, fare riferimento al comportamento dei parametri descritto nelle tabelle seguenti.
:::

[comment]: # ({/50641221-cb7939c5})

[comment]: # ({8318f93b-b004895d})
### Parametri

I seguenti parametri sono supportati per il widget *Item card*.

|Parametro|<|[type](/manual/api/reference/dashboard/object#dashboard-widget-field)|name|value|
|-|--------|--|--------|-------------------------------|
|*Intervallo di aggiornamento*|<|0|rf_rate|0 - Nessun aggiornamento;<br>10 - 10 secondi;<br>30 - 30 secondi;<br>60 - *(predefinito)* 1 minuto;<br>120 - 2 minuti;<br>600 - 10 minuti;<br>900 - 15 minuti.|
|*Item*|<|4|itemid.0|ID [Item](/manual/api/reference/item/get).<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *obbligatorio* se *Item (Widget)* non è impostato|
|<|*Item (Widget)*|1|itemid.\_reference|Invece dell'ID [Item](/manual/api/reference/item/get):<br>`ABCDE._itemid` - imposta un [widget compatibile](/manual/web_interface/frontend_sections/dashboards/widgets#widget-compatibility) (con il parametro *Reference* impostato su "`ABCDE`") come origine dati per l'item.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *obbligatorio* se *Item* non è impostato|
|*Mostra*|<|0|sections.0|0 - Descrizione;<br>1 - Testo di errore;<br>2 - Metriche;<br>3 - Dati più recenti;<br>4 - Tipo di informazione;<br>5 - Trigger;<br>6 - Interfaccia host;<br>7 - Tipo;<br>8 - Inventario host;<br>9 - Tag.<br><br>Nota: Il numero nel nome della proprietà fa riferimento all'ordine della sezione nell'elenco delle sezioni. Per configurare più sezioni, creare un oggetto campo widget dashboard per ciascuna sezione con un numero incrementale nel nome della proprietà.|
|*Sovrascrivi host*|<|1|override_hostid.\_reference|`ABCDE._hostid` - imposta un [widget compatibile](/manual/web_interface/frontend_sections/dashboards/widgets#widget-compatibility) (con il parametro *Reference* impostato su "`ABCDE`") come origine dati per gli host;<br>`DASHBOARD._hostid` - imposta il [selettore host](/manual/web_interface/frontend_sections/dashboards/widgets#override-host) della dashboard come origine dati per gli host.<br><br>Predefinito: `""` (vuoto)<br><br>Questo parametro non è supportato se si configura il widget in una [dashboard template](/manual/api/reference/templatedashboard/object).|

[comment]: # ({/8318f93b-b004895d})

[comment]: # ({6fb91e67-7444d2e3})
#### Sparkline

I seguenti parametri sono supportati se *Mostra* è impostato su "Ultimi dati".

|Parametro|<|[type](/manual/api/reference/dashboard/object#dashboard-widget-field)|name|value|
|-|--------|--|--------|-------------------------------|
|*Larghezza*|<|0|sparkline.width|I valori possibili vanno da 0 a 10.<br><br>Predefinito: 1.|
|*Riempimento*|<|0|sparkline.fill|I valori possibili vanno da 0 a 10.<br><br>Predefinito: 3.|
|*Colore*|<|1|sparkline.color|Codice colore esadecimale (ad esempio `FF0000`).<br><br>Predefinito: `42A5F5`.|
|*Periodo di tempo*|<|1|sparkline.time_period.\_reference|`DASHBOARD._timeperiod` - imposta il [selettore del periodo di tempo](/manual/web_interface/time_period_selector) della dashboard come origine dati;<br>`ABCDE._timeperiod` - imposta un [widget compatibile](/manual/web_interface/frontend_sections/dashboards/widgets#widget-compatibility) (con il relativo parametro `reference` uguale a `ABCDE`) come origine dati.<br><br>Predefinito: `""` (vuoto)<br><br>In alternativa, è possibile impostare il periodo di tempo solo nei parametri *Da* e *A*.|
|<|*Da*|1|sparkline.time_period.from|Stringa temporale valida in sintassi temporale assoluta (`YYYY-MM-DD hh:mm:ss`) o [relativa](/manual/web_interface/time_period_selector) (`now`, `now/d`, `now/w-1w`, ecc.).<br><br>Predefinito: now-1h.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *supportato* se *Periodo di tempo* non è impostato<br>- *obbligatorio* se `sparkline.time_period.to` è impostato|
|^|*A*|1|sparkline.time_period.from|Stringa temporale valida in sintassi temporale assoluta (`YYYY-MM-DD hh:mm:ss`) o [relativa](/manual/web_interface/time_period_selector) (`now`, `now/d`, `now/w-1w`, ecc.).<br><br>Predefinito: now.<br><br>[Comportamento del parametro](/manual/api/reference_commentary#parameter-behavior):<br>- *supportato* se *Periodo di tempo* non è impostato<br>- *obbligatorio* se `time_period.to` è impostato|
|*Dati storici*|<|0|sparkline.history|0 - *(predefinito)* Auto;<br>1 - Storico;<br>2 - Trend.|

[comment]: # ({/6fb91e67-7444d2e3})

[comment]: # ({7148225f-f146ed91})
### Esempi

Gli esempi seguenti hanno lo scopo di descrivere solo la configurazione degli oggetti campo del widget della dashboard per il widget *Item card*.
Per ulteriori informazioni sulla configurazione di una dashboard, vedere [`dashboard.create`](/manual/api/reference/dashboard/create).

[comment]: # ({/7148225f-f146ed91})

[comment]: # ({a1691adf-3e0437fc})
#### Configurazione di un widget *Item card*

Configurare un widget *Item card* che visualizza queste sezioni: "Description", "Latest data", "Triggers" e "Tags".

[Richiesta](/manual/api#performing-requests):

```json
{
    "jsonrpc": "2.0",
    "method": "dashboard.create",
    "params": {
        "name": "My dashboard",
        "display_period": 30,
        "auto_start": 1,
        "pages": [
            {
                "widgets": [
                    {
                        "type": "itemcard",
                        "name": "Item card",
                        "x": 0,
                        "y": 0,
                        "width": 14,
                        "height": 7,
                        "view_mode": 0,
                        "fields": [
                            {
                                "type": 4,
                                "name": "itemid.0",
                                "value": 42257
                            },
                            {
                                "type": 0,
                                "name": "sections.0",
                                "value": 0
                            },
                            {
                                "type": 0,
                                "name": "sections.1",
                                "value": 3
                            },
                            {
                                "type": 0,
                                "name": "sections.2",
                                "value": 5
                            },
                            {
                                "type": 0,
                                "name": "sections.3",
                                "value": 9
                            }
                        ]
                    }
                ]
            }
        ],
        "userGroups": [
            {
                "usrgrpid": 7,
                "permission": 2
            }
        ],
        "users": [
            {
                "userid": 1,
                "permission": 3
            }
        ]
    },
    "id": 1
}
```

Risposta:

```json
{
    "jsonrpc": "2.0",
    "result": {
        "dashboardids": [
            "3"
        ]
    },
    "id": 1
}
```

[comment]: # ({/a1691adf-3e0437fc})

[comment]: # ({e9d30322-25bd508b})
### Vedi anche

-   [Campo del widget della dashboard](/manual/api/reference/dashboard/object#dashboard-widget-field)
-   [`dashboard.create`](/manual/api/reference/dashboard/create)
-   [`dashboard.update`](/manual/api/reference/dashboard/update)

[comment]: # ({/e9d30322-25bd508b})
