I have 3 different durations (times between events) that make up 100% of the total time spent in a process. I want a pie chart to show a slice for each duration (3 slices). My documents have 3 fields, one for each duration.
Unfortunately, the Pie Chart visualization seems to allow summation or counts of a single document field, not different ones. Have I read this correctly? And if so, do you have suggestions for how I can use a pie chart in this situation?
Example docs:
{
"id": 1,
"duration1": 42.3,
"duration2": 10.4,
"duration3": 5.3
},
{
"id": 2,
"duration1": 35.2,
"duration2": 8.4,
"duration3": 3.3
},
{
"id": 3,
"duration1": 40.5,
"duration2": 22.3,
"duration3": 15.9
}
I've considered that maybe I can restructure these documents like this:
{
"id": "1a",
"durationType": "FOO",
"duration": 42.3
},
{
"id": "1b",
"durationType": "BAR",
"duration": 10.4
},
{
"id": "1c",
"durationType": "BAZ",
"duration": 5.3
}
And this would allow me to use a single field duration
for the pie chart while aggregating on a durationType
filter. However, the downside of this method is that it separates the 3 durations across 3 separate sub-documents. This prevents me from filtering out all 3 docs when the duration of one is under or above a specific threshold. For example, I might need to filter out the 3 docs from the pie chart if the BAZ duration is under 6 seconds. And in this filtering situation, I'd want docs 1a, 1b, and 1c to not be included in the pie slices.
Any ideas?