@Maliti9Emmanuel/

DroopyCyanLink

Python

No description

fork
loading
Files
  • main.py
  • Dat.csv
  • Dat1.csv
  • Dat2.csv
  • Dat3.csv
  • Dat4.csv
  • one.csv
  • one.py
  • onee.csv
  • Pie Chart.png
  • results.png
  • test.csv
  • theresult.png
  • two.csv
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import dash
import dash_core_components as dcc
import dash_html_components as html
import pandas as pd
import plotly.graph_objs as go


df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/2014_ebola.csv')
df = df.dropna(axis=0)


layout = html.Div([
    html.Div([html.H1("Ebola Cases Reported in Africa - 2014")], style={"textAlign": "center"}),
    dcc.Graph(id="my-graph"),
    html.Div([dcc.Slider(id='month-selected', min=3, max=12, value=8,
                         marks={3: "March", 4: "April", 5: "May", 6: "June", 7: "July", 8: "August", 9: "September",
                                10: "October", 11: "November", 12: "December"})],
             style={'textAlign': "center", "margin": "30px", "padding": "10px", "width": "65%", "margin-left": "auto",
                    "margin-right": "auto"}),
], className="container")



def update_graph(selected):
    return {
        "data": [go.Pie(labels=df["Country"].unique().tolist(), values=df[df["Month"] == selected]["Value"].tolist(),
                        marker={'colors': ['#EF963B', '#C93277', '#349600', '#EF533B', '#57D4F1']}, textinfo='label')],
        "layout": go.Layout(title=f"Cases Reported Monthly", margin={"l": 300, "r": 300, },
legend={"x": 1, "y": 0.7})}