A new coronavirus called COVID-19 emerged in Wuhan, a central city in China, at the end of 2019. It quickly spread to most parts of China by early 2020. This respiratory illness affected the lives of hundreds of thousands of people. In this example we use Origin to construct a report of the COVID-19 epidemic in China.
You can download this Origin project.
This project imports COVID-19 infection data of 2/23/2020 via CSV Data Connector, assigns colors to the map of China by using the Import ShapeFile App and the Colormap for Map Data App. So please make sure these Apps are installed in your Origin. The summary graphs and tables are presented in an HTML report. When you choose to update/re-import the source data, or chose a new province for the 2nd map, the project will auto-recalculate and the report will update accordingly.
Step 1. Import Data
We attached a sample DAT file of the COVID-19 infection counts (2/23/2020) along with the project.
Start a new project. Book1 active, select the menu Data: Connect to File: Text/CSV and select DXYArea.dat from the downloaded zip file. Accept the default settings to import data into Book1.
For a general discussion on use of Data Connection, please refer to this blog.
Step 2. Create Map
Here we use Import ShapeFile App to plot a province-by-province China map, and Colormap for Map Data App to color the map.
- Click Import ShapeFile App in Apps Gallery. Choose province.shp in the China map zip file. In the dialog, check Output Data Points checkbox. Uncheck Graph checkbox. Click OK. New workbook is created with Shapefile worksheet.
- With Shapefile worksheet active, click Colormap for Map Data App in Apps Gallery to bring up its toolbar. Click the first button. Input is autofilled with Shapefile. Click Hunt icon next to Names forID and select column DS header (second to last column in Shapefile sheet). Click OK. Shapefile Data Reordered worksheet is created with reorganized data.
- Open Set Column Values dialog of column F (Value). Use Variables: Add Range Variable by Selection menu twice to add column C 、 G from Book1 as range variables in Before Formula Script window. You can also type manually range r1 = [Book1]DXYArea!Col(C); range r2 = [Book1]DXYArea!Col(G); Enter loopup(E, r1$, r2) in Col(F)= box. This “Lookup” function is used to locate the row of corresponding province according to the zip code, and return column F with confirmed infection counts in the same row.
- With Shapefile Data Reordered worksheet active, click the second button in Colormap for Map Data toolbar, a map is created with color mapped to column F, the confirmed infection number.
- Note that zip code is use as label by default. We insert col(G) and use “Lookup” function to search for the corresponding province and set it as label.
Step 3. Prepare Data and Graphs, and Set Filter to Select Desired Province
We will now rearrange and analyze “Data” worksheet to extract the desired info that we want to show in the report, and create graphs to intuitively display the difference between areas and changes across time. During analysis, make sure to set Recalculation to “Auto” so all results will be auto-updated when the source is changed.
In order to select and show one province’s data, we add a filter to the “province name” column. All results will update according to the filtered data. In the final HTML report, we use a drop-down list to select the province and apply filter.
Step 4. Create HTML Report
Finally, we can summarize the info and graphs in an HTML report.
Use the following THML code to customize tables in the report: