What I’m trying to do:
Im trying to display a different graph in each image/card What I’ve tried and what’s not working:
when I load the second graph, the first graph is superimposed on it.
Code Sample: Client side:
def init(self, **properties):
# Set Form properties and Data Bindings.
self.init_components(**properties)
media_obj = anvil.server.call(‘data_counts’)
self.image_1.source = media_obj
self.image_2.source = anvil.server.call(’ other_data’)
server side: @anvil.server.callable
def other_data():
vp_data = pd.read_excel(path)
year = vp_data[‘Year’].value_counts()
year.plot(kind = ‘bar’)
year_plot = anvil.plot_image()
return year_plot
@anvil.server.callable
def data_counts():
data = pd.read_csv(path)
state = data[‘Month’].value_counts()
state.plot(kind = ‘barh’)
return anvil.plot_image()
I tried a few different things. My goal is to have other_data load in image_1 and data_counts in image_2
Thanks for the assist
**Clone link:**
*share a copy of your app*