Finally, we need to pass each of our four graphs to the
style_plot function to apply our changes. We’ll also add some titles to our graphs at the same time.
For example, to style our revenue graph and add a title, we add two lines to the end of our
build_revenue_graph function so that it looks like this:
def build_revenue_graph(self): db_data = anvil.server.call('get_revenue') self.plot_1.data = go.Bar(x = [x['date'] for x in db_data], y = [x['amount'] for x in db_data], marker=dict(color='#2196f3') ) # Style the plot and add a plot title self.style_plot(self.plot_1) self.plot_1.layout.title = "REVENUE GROWTH"
Do this for all four graphs, run your app, and your dashboard will look something like this: