You can use the Pie Chart widget to visualize results of the groupBy() and top(). It can only show a single result at a time, meaning that if you provide several aggregate functions to the
function argument of groupBy() it will only display the first aggregate result.
If you want to display multiple aggregate results in a single chart, you can use the Bar Chart Widget which supports showing multiple aggregate results.
Assume we have a service producing logs like the ones below
2018-10-10T01:10:11.322Z [ERROR] Invalid User ID. errorID=2, userId=10 2018-10-10T01:10:12.172Z [WARN] Low Disk Space. 2018-10-10T01:10:14.122Z [ERROR] Invalid User ID. errorID=2, userId=11 2018-10-10T01:10:15.312Z [ERROR] Connection Dropped. errorID=112 server=220.127.116.11 2018-10-10T01:10:16.912Z [INFO] User Login. userId=11
We would like to show a pie chart of the relative distribution of events with the respective log levels
We can do this by selecting the Pie Chart Widget in the Widget Type dropdown.
If there is only one item in the pie chart, then the legend will not appear.