How to make the table of the data display after the graph? (Rather than uploading locally)


#1

Rather than uploading a data from csv file. Is there any option of displaying the table of the data which is being plotted. Because I have been doing a project using Dash and quandle wherein I use the API call for the dataset and and analysing the closing stock of each year with respect to the month selected from the dropdown, link to my project.
The program and the live updation of graph is working fine, the only thing where I’m stuck is displaying the data (data of the plot) when selected, the table should also update with respect to graph and dropdown selected. The entire project is working expect displaying the table.
I also looked into the previous questions which are based on dash_table_experiments, but couldn’t figure it out.
I just started learning Visualization with Dash and found it very appealing and beautiful. If anyone who can look into my code (github link provided above) and suggest me what to be done would be more appreciated.

Unable to load table data table here


#2

Fixed the issue. Just needed to add

def generate_table(year, month):
	imp_df = pd.read_csv('data.csv')
	return html.Table(className='reaponsive-table',
					children=[
						html.Thead(
							html.Tr(
								children=[html.Th(col.title()) for col in imp_df.columns.values]
							)
						),
						html.Tbody([
							html.Tr(
								children=[html.Td(data) for data in d]
							)
						for d in imp_df.values.tolist()])
					])

woohoo its working…