Creazione di grafici ad anello
Informazioni su questa attività
- Titolo scheda
- Un'etichetta o un'intestazione univoca assegnata alla scheda.
- Legenda
- L'etichetta del gruppo di dati.
- Etichetta
- Il valore percentuale dell'intero per una singola categoria, ad esempio,
24%o76%. - Etichetta numero grande
- Il testo che viene visualizzato dopo il conteggio totale al centro del grafico ad anello, ad esempio
25 Shipments. - Descrizione comandi della scheda
- Un suggerimento che fornisce ulteriori dettagli sui dati visualizzati sulla scheda.
- Link di piè di pagina
- Un campo selezionabile o un collegamento con un'etichetta, ad esempio
View all.
Procedura
Nella scheda Generale , definisci la scheda:
Nella scheda Dati , aggiungere i dati alla scheda:
Nella scheda Stile , definire lo stile della scheda:
Esempio
La seguente query richiama il numero totale di spedizioni in entrata consegnate e il numero totale di spedizioni consegnate in ritardo. La query comprende una variabile tenantId .
query estimatedLateDelivery($tenantId: String!, $customerFilter: BooleanExp = {CONSTANT_VALUE: true}, $supplierFilter: BooleanExp = {CONSTANT_VALUE: true}, $carrierFilter: BooleanExp = {CONSTANT_VALUE: true}, $originFilter: BooleanExp = {CONSTANT_VALUE: true}, $destinationFilter: BooleanExp = {CONSTANT_VALUE: true}) {
late: businessObjects(
simpleFilter: {tenantId: $tenantId, type: Shipment}
advancedFilter: {AND: [{EQUALS: [{SELECT: "shipmentType", type: STRING}, {VALUE: "INBOUND", type: STRING}]}, {GREATER_THAN: [{SELECT: "estimatedDeliveryDelay", type: FLOAT}, {VALUE: "0.0", type: FLOAT}]}, {NOT: {EQUALS: [{SELECT: "statusByDate", type: STRING}, {VALUE: "DELIVERED", type: STRING}]}}, $customerFilter, $supplierFilter, $carrierFilter, $originFilter, $destinationFilter]}
hint: {viewId: "graph"}
cursorParams: {first: 0}
) {
totalCount
}
totalShipments: businessObjects(
simpleFilter: {tenantId: $tenantId, type: Shipment}
advancedFilter: {AND: [{EQUALS: [{SELECT: "shipmentType", type: STRING}, {VALUE: "INBOUND", type: STRING}]}, {NOT: {EQUALS: [{SELECT: "statusByDate", type: STRING}, {VALUE: "DELIVERED", type: STRING}]}}, $customerFilter, $supplierFilter, $carrierFilter, $originFilter, $destinationFilter]}
hint: {viewId: "graph"}
cursorParams: {first: 0}
) {
totalCount
}
}
Il seguente codice è un esempio di come definire le variabili da utilizzare nella query.
{
"tenantId": "{{ tenantId }}"
}
Il seguente codice è un esempio dei dati restituiti dalla query. Nell'esempio, due spedizioni sono in ritardo su un totale di otto spedizioni.
{
"data": {
"late": {
"totalCount": 2,
"__typename": "BusinessObjectsCursor"
},
"totalShipments": {
"totalCount": 8,
"__typename": "BusinessObjectsCursor"
}
},
"loading": false,
"networkStatus": 7
}
Nel seguente codice, COMMON.SHIPMENT_STATUS.ON_TIME viene aggiunto come gruppo. Le spedizioni in tempo vengono calcolate nella trasformazione sottraendo le spedizioni in ritardo dalle spedizioni totali.
{
"legendOrder": [
"COMMON.SHIPMENT_STATUS.ON_TIME",
"COMMON.SHIPMENT_STATUS.LATE"
],
"colorScale": {
"COMMON.SHIPMENT_STATUS.ON_TIME": "#009d9a",
"COMMON.SHIPMENT_STATUS.LATE": "#6929c4"
},
"totalCount": [
"{{this.data.totalShipments.totalCount}}"
],
"errors": "{{#? this.errors}}",
"pageInfo": "{}",
"results": [
{
"group": "COMMON.SHIPMENT_STATUS.LATE",
"value": "{{this.data.late.totalCount}}"
},
{
"group": "COMMON.SHIPMENT_STATUS.ON_TIME",
"value": "{{this.data.totalShipments.totalCount - this.data.late.totalCount}}"
}
]
}
In una trasformazione, i dati visualizzati nel grafico devono corrispondere ai dati restituiti dalla query. È possibile aggiungere qualsiasi calcolo sui dati restituiti dalla query.
Cosa fare successivamente
Aggiungere la scheda a un dashboard utilizzando il builder Dashboard.