Example #1
0
def districtPie():
    df = allDistrictstabel()
    #     fig = px.pie(df, values='Confirmed', names='District', color='District',
    #              color_discrete_map={'Thur':'lightcyan',
    #                                  'Fri':'cyan',
    #                                  'Sat':'royalblue',
    #                                  'Sun':'darkblue'})

    #     df = px.data.gapminder().query("year == 2007").query("continent == 'Americas'")
    fig = px.pie(df,
                 values='Confirmed',
                 names='District',
                 hover_data=['Confirmed'],
                 labels={'Confirmed': 'Confirmed'})
    fig.update_traces(textposition='inside', textinfo='percent+label')

    fig.layout.plot_bgcolor = '#002b36'
    fig.layout.paper_bgcolor = '#002b36'
    fig.update_layout(showlegend=False, font_color="white", font_size=18)
    return fig
Example #2
0
import dash
import dash_bootstrap_components as dbc
import dash_core_components as dcc
import dash_html_components as html
from dash.dependencies import Input, Output
import requests
import json
import pandas as pd
from COVID_Predictior import logoisticGrowthPredictor
from Get_KA_COVID_Data import get_KA_covid_data, getKAADistrictDropDownValue, get_districtWise, allDistrictstabel
from app_figures import values, statepredictorGraph, stateDeseased, stateRecovered, stateActive, statePie, districtPie

PLOTLY_LOGO = "https://www.codrindia.org/assets/images/logo/codr-icon-1.jpg"
import dash_table

df = allDistrictstabel()
from Get_KA_COVID_Data import get_KA_covid_data
import base64
#BS = "https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
#app = dash.Dash(external_stylesheets=[BS])


def generate_table(dataframe, max_rows=15):
    return html.Table(
        # Header
        [html.Tr([html.Th(col) for col in dataframe.columns])] +
        # Body
        [
            html.Tr(
                [html.Td(dataframe.iloc[i][col]) for col in dataframe.columns])
            for i in range(min(len(dataframe), max_rows))