Guest User

Untitled

a guest
Jun 18th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. __author__ = 'nnaemeka.okeke'
  2.  
  3. import dash
  4. import dash_core_components as dcc
  5. import dash_html_components as html
  6. import plotly.graph_objs as go
  7. import pandas as pd
  8.  
  9. pd.set_option('display.width',1000)
  10.  
  11. data = pd.read_csv('E:\\path\\to\\csv\\or\\txt_file.txt')
  12. #print(data.head()) - this would show a brief layout of the data
  13. #print(data[1:].head()) - this would print the data without the column headers
  14. #print(data.columns) - this would print only the column headers
  15.  
  16. trace1 = go.Scatter(x=data.ColumnZ, y=data.ColumnA, name='any name')
  17. #You can create as many traces as you want to have graphs displayed on the dashboard.
  18. #All you do is create seperate containers or graph objects for them.
  19.  
  20. app = dash.Dash()
  21.  
  22. app.layout = html.Div(children=[
  23. html.H1('Sales Funnel Report'),
  24. html.Div(children='''Name of Report.'''),
  25. dcc.Graph(
  26. id='exmple-graph',
  27. figure={'data': [trace1],
  28. 'layout':go.Layout(title='Desired Title', barmode='stack')
  29. }
  30. )
  31. ]
  32.  
  33. )
  34. if __name__ == '__main__':
  35. app.run_server(debug=True)
Add Comment
Please, Sign In to add comment