You can use the "Elasticsearch SQL" data source to display aggregation results in Canvas. Checkout the Grouping section in An Introduction to Elasticsearch SQL with Practical Examples - Part 2. SELECT AVG(FlightTimeHour) is pulling aggregation results.
With aggregations, you can group your data in elasticsearch and calculate metrics. Then, only those metrics get returned to the browser. This is a scalable solution that will allow the visualization of large data sets.