Skip to content

Instantly share code, notes, and snippets.

@allatambov

allatambov/dash-2.py

Created Mar 31, 2020
Embed
What would you like to do?
# -*- coding: utf-8 -*-
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
df = pd.read_csv("https://allatambov.github.io/pydj/seminars/wgi-new.csv")
tab = df["fh_type"].value_counts()
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div(children=[
html.H1(children='Hello Dash'),
html.H2(children='My first Dash'),
html.Div(children='''
Dash: A web application framework for Python.
'''),
dcc.Graph(
id='example-graph',
figure={
'data': [
{'x': tab.index, 'y': tab.values, 'type': 'bar',
'name': 'Countries',
'marker' : {'color':['red', 'green', 'blue']}},
],
'layout': {
'title': 'Dash Data Visualization'
}
}
)
])
if __name__ == '__main__':
app.run_server(debug=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment