Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __author__ = 'nnaemeka.okeke'
- import dash
- import dash_core_components as dcc
- import dash_html_components as html
- import plotly.graph_objs as go
- import pandas as pd
- pd.set_option('display.width',1000)
- data = pd.read_csv('E:\\path\\to\\csv\\or\\txt_file.txt')
- #print(data.head()) - this would show a brief layout of the data
- #print(data[1:].head()) - this would print the data without the column headers
- #print(data.columns) - this would print only the column headers
- trace1 = go.Scatter(x=data.ColumnZ, y=data.ColumnA, name='any name')
- #You can create as many traces as you want to have graphs displayed on the dashboard.
- #All you do is create seperate containers or graph objects for them.
- app = dash.Dash()
- app.layout = html.Div(children=[
- html.H1('Sales Funnel Report'),
- html.Div(children='''Name of Report.'''),
- dcc.Graph(
- id='exmple-graph',
- figure={'data': [trace1],
- 'layout':go.Layout(title='Desired Title', barmode='stack')
- }
- )
- ]
- )
- if __name__ == '__main__':
- app.run_server(debug=True)
Add Comment
Please, Sign In to add comment