def makeTestingLine(df): template = [{ "title": "Source of Covid-19 infections in Queensland", "subtitle": f"""Showing the daily count of new cases by the source of infection. {last_date}""", "footnote": "", "source": "| Sources: Covidlive.com.au, Queensland Department of Health", "dateFormat": "%Y-%m-%d", "minY": "0", "maxY": "", "xAxisDateFormat": "%b %d", "tooltip": "<strong>{{#formatDate}}{{data.Date}}{{/formatDate}}</strong><br/>{{group}}: {{groupValue}}<br/>Total: {{total}}", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" }] key = [] periods = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] yachtCharter(template=template, labels=labels, data=chartData, chartId=[{ "type": "stackedbar" }], chartName="qld_covid_infection_source")
def makeTestingLine(df): template = [ { "title": "Queensland Covid Hotspots", "subtitle": f"""""", "footnote": "", "source": "| Sources: Queensland Department of Health", "yScaleType":"", "minY": "0", "maxY": "", "x_axis_cross_y":"", "periodDateFormat":"", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" } ] key = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] yachtCharter(template=template, labels=labels, data=chartData, chartId=[{"type":"table"}], options=[{"colorScheme":"guardian","format": "scrolling","enableSearch": "TRUE","enableSort": "TRUE"}], chartName="qld_covid_hotspots")
def makeDropChart(df): template = [{ "title": "Government responses to the Covid pandemic", "subtitle": "From Global Recovery Observatory data, grouped by spending category and measured in billions of US dollars", "footnote": """Global Recovery Observatory dataset was updated through 28/02/2021. Guardian Australia has added recovery measures from the 2021 Australian and United Kingdom budgets, South Korea supplementary budget, and the American Recovery Plan. More about categorisation in the notes.""", "source": "Global Recovery Observatory, Oxford University Economic Recovery Project, Yonhap News Agency, Wall Street Journal, International Monetary Fund, government websites", "dateFormat": "%Y-%m-%d", "minY": "0", "maxY": "", "xAxisDateFormat": "%b %d", # "tooltip":"<strong>{{#formatDate}}{{data.Date}}{{/formatDate}}</strong><br/>{{group}}: {{groupValue}}<br/>Total: {{total}}", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" }] key = [] periods = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] dropdown = [{ "data": "Infrastructure", "display": "Infrastructure" }, { "data": "Liquidity support", "display": "Liquidity support" }, { "data": "Tax measures", "display": "Tax measures" }, { "data": "Transfers and job support", "display": "Transfers and job support" }] options = [{"enableShowMore": 0}] yachtCharter(template=template, dropdown=dropdown, options=options, labels=labels, data=chartData, chartId=[{ "type": "horizontalbar" }], chartName="oz-covid-budget-comparison")
def makeDropChart(df): template = [{ "title": "Government Covid spending as % of GDP", "subtitle": "Comparing the federal government's Covid economic support estimate with the COVID-19 Economic Stimulus Index", "footnote": "", "source": "COVID-19 Economic Stimulus Index - Ceyhun Elgin, Gokce Basbug, Abdullah Yalaman; Australian federal government budget website", "dateFormat": "%Y-%m-%d", "minY": "0", "maxY": "", "xAxisDateFormat": "%b %d", # "tooltip":"<strong>{{#formatDate}}{{data.Date}}{{/formatDate}}</strong><br/>{{group}}: {{groupValue}}<br/>Total: {{total}}", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" }] key = [] periods = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] # dropdown = [{ # "data":"Infrastructure", # "display":"Infrastructure" # },{ # "data":"Liquidity support", # "display":"Liquidity support" # },{ # "data":"Tax measures", # "display":"Tax measures" # },{ # "data":"Transfers and job support", # "display":"Transfers and job support" # }] dropdown = [] options = [{"enableShowMore": 0}] yachtCharter(template=template, dropdown=dropdown, options=options, labels=labels, data=chartData, chartId=[{ "type": "horizontalbar" }], chartName="oz-covid-budget-gdp-comparison")
def makeTable(df): template = [{ "title": "Major global infrastructure programs", "subtitle": f"50 of the largest infrastructure programs announced during the Covid-19 pandemic", "footnote": "", "source": "Global Recovery Observatory, Oxford University Economic Recovery Project, all Street Journal, International Monetary Fund, government websites", "yScaleType": "", "minY": "0", "maxY": "", "x_axis_cross_y": "", "periodDateFormat": "", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" }] key = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] yachtCharter(template=template, dropdown=[], labels=labels, data=chartData, chartId=[{ "type": "table" }], options=[{ "colorScheme": "guardian", "format": "scrolling", "enableSearch": "FALSE", "enableSort": "FALSE", "enableShowMore": 1 }], chartName="big-infrastructure-programs")
def makeSince100Chart(df): template = [{ "title": "Australia's state vaccine rollout", "subtitle": f"Showing the Covid-19 vaccine doses administered per hundred people. Doses administered by GPs and aged care included in Australia's total. Last updated {display_date}.", "footnote": "", "source": "Covidlive.com.au, Australian Bureau of Statistics", "dateFormat": "", "yScaleType": "", "xAxisLabel": "Days since first vaccination", "yAxisLabel": "Doses per hundred people", "minY": "", "maxY": "", "periodDateFormat": "", "margin-left": "50", "margin-top": "15", "margin-bottom": "20", "margin-right": "20", "breaks": "no" }] key = [] periods = [] labels = [] chartId = [{"type": "linechart"}] df.fillna('', inplace=True) df = df.reset_index() chartData = df.to_dict('records') # print(since100.head()) # print(chartData) yachtCharter(template=template, data=chartData, chartId=[{ "type": "linechart" }], options=[{ "colorScheme": colours, "lineLabelling": "FALSE" }], chartName="testo_testo")
def makeTestingLine(df): template = [{ "title": "Trend in local and overseas-related transmission of Covid-19 in QLD, last 60 days", "subtitle": f"""Showing the 7 day rolling average of locally and overseas-acquired cases, with those under investigation added to the local category. Last updated {last_date}""", "footnote": "", "source": "| Sources: Covidlive.com.au, Queensland Department of Health", "dateFormat": "%Y-%m-%d", "yScaleType": "", "minY": "0", "maxY": "", "x_axis_cross_y": "", "periodDateFormat": "", "margin-left": "50", "margin-top": "30", "margin-bottom": "20", "margin-right": "10" }] key = [] periods = [] # labels = [] df.fillna("", inplace=True) chartData = df.to_dict('records') labels = [] yachtCharter(template=template, labels=labels, data=chartData, chartId=[{ "type": "linechart" }], options=[{ "colorScheme": "guardian" }], chartName="qld_covid_locally_acquired_trend")