I have been trying to make a report using the dash package in Python, but there is an issue with the code starting from how I defined the figure. The data file has 2 columns with headers 'Name' and 'marks' where the 'Name' column is filled with string values and 'mark' with integers.
Debug = False as I am running this code on Spyder.
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
Data = pd.read_csv(r'C:\Users\Karthik\Desktop\personal\python\data.csv', encoding = "ISO-8859-1")
app = dash.Dash()
app.layout = html.Div(children=[
html.H1(children='Dash Tutorials'),
dcc.Graph(id='example',
figure={
'data':[{'x': Data['Name'],'y':Data['marks'],'type'='line', 'name'='boats'}
],
'layout': {
'title': 'Basic Dash Example'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=False)