Now, let’s populate those labels with our headline numerical statistics. We’ll amend each of our build_x_graph functions to populate our headline statistics.

First, add these lines to your build_revenue_graph function:

max_revenue = sorted(db_data, key=lambda x: x['amount'], reverse=True)[0]
self.revenue_label.text = f"{max_revenue['date']:%d %b %Y}, {max_revenue['amount']:,}"

Add these lines to your build_signups_graph function:

max_signups = sorted(signups, key=lambda x: x['signups'], reverse=True)[0]
self.signups_label.text = f"{max_signups['date']:%d %b %Y}, {max_signups['signups']}"

Add these lines to your build_marketing_graph function:

max_hits = sorted(marketing_data, key=lambda x: x['count'], reverse=True)[0]
self.marketing_label.text = f"{max_hits['strategy']}, {max_hits['count']} hits"

And finally, add these lines to your build_weather_graph function:

max_temp = sorted(self.temp_data, key=lambda x: x['temp'], reverse=True)[0]
self.weather_label.text = f"{max_temp['temp']:.1}"

Click run and you’ll see your headline numerical statistics populated along the top of your dashboard!

Final app with the four plots and the headline labels