-
Notifications
You must be signed in to change notification settings - Fork 95
Showing a Pie Chart based on device properties
The user selects a device group, which implicitly defines the query to use to fetch the list of devices. See the Config UI API for more information.
GET {IoT Hub manager endpoint}/devices?query={query}
Content-Type: application/json; charset=utf-8
{
Count: ...
Items: [
{ device }
{ device }
{ device }
...
]
"$metadata": {
$type: DevicesList;1
$uri: {IoT Hub manager endpoint}/devices?query={query}
}
}
Note that the content of the response might change over time, for instance when devices are added or removed, and when device properties change. For instance a query like "all devices with firmware 1.2" would return a different list over time. The UI decides whether to cache and reuse the query result, or whether to repeat the query to refresh the response.
The pie chart represents data about a specific property, e.g. "firmware version", which might have multiple values.
The UI application loops through the devices, looking for the "firmware version" property, and counts the distinct values (= number of slices) and the the occurrences of each distinct value (= size of each slice).