Coronavirus Tracker Script (Description)


  • administrators

    COVID-19 Dashboard

    Coronavirus Tracker and Coronavirus API with free COVID-19 live updates based on multiple sources.

    Coronavirus Tracker Script

    COVID-19 App Demo HTML/JS Example

    Edit "index.html" that came together with this documentation and follow the instructions to personalize it to your needs

    What is it for?

    The Coronavirus Tracker Script tracks COVID-19 cases and related data from around the world.

    What data is available?

    Data is available for countries that are submitting confirmed cases and related COVID-19 records. See full list of supported countries or list latest data with Coronavirus API.

    Live data:

    Daily data (updated live): Total Cases, Active Cases, Recovered, Deaths, Tested, Critical Condition, Change Ratio %s and Summaries.

    Is historical data available?

    Historical data includes: Day, Week, Month, Year, Changes per Day, Differences and Summaries.

    What regions are covered?

    World, Countries and reported Regions.

    Are U.S. states included?

    Yes, you can track all U.S. States separately.


    Customizing

    Selecting country: the script is delivered with a set of 50 countries, randomly selected to display COVID-19 cases data.

    Find var countryFeedKey and change it to var countryFeedKey = 'usa';. Replace 'usa' with the country of your choice see full list here.

    Showing multiple countries: duplicate index.html and name it e.g. "usa.html". Edit and change var countryFeedKey = 'usa';.

    Adding more data: if you need to display more data like “Tests Made” or “In Severe Condition”, simply add a new section and set the data-country-placeholder according to your needs, example:

    <div class="d-inline qc_data-cases qc_data-cases-all">
       <button class="btn btn-secondary fixwidth">
          <strong data-country-placeholder="tested">0</strong>
       </button>
    </div>
    
    • ask the community for options for details that you are trying to add
    • if you need to display a calculation or present another detail, ask the community, ask technical questions, be specific, to the point
    • another place to ask developers

    Coronavirus Charts: Google Charts was used in the attached covid-19 tracker script however, you may chose any other charting library. We recommend Chart.js, as used on the Coronavirus Dashboard. See examples: Australia, China, Germany, Mexico, Spain, Thailand, USA, etc.

    • Find:
    var chart = new google.visualization.PieChart(document.getElementById(‘drawchart'));
    

    and change to BarChart, ColumnChart or any other chart type you may need.

    • Further editing Charts: ask the community any changes you might need, be specific and to the point: Coronavirus-Dashboard

    Other resources


Log in to reply