2   California covid cases bar chart with 7-day moving average line @pinotrogu
2   California covid cases bar chart with 7-day moving average line  @pinotrogu
Uploaded February 2021 | Updated September 2026, 2 days ago
The dataset -- us-states.csv -- if from NYT's GitHub repository:
github.com/nytimes/covid-19-data.
The NYT main coronavirus page is:
nytimes.com/interactive/2020/us/coronavirus-us-cases.html

This video shows how to generate the bar chart (one bar for each day) and then overlap the thicker line on top of the bars. The line shows the "7-day moving average" so it's smoother and gives a better trend view of the pandemic. The bars are good to see each individual days but because these can vary by a lot, they are better than a line which would look very jagged.
Note: the NYT file includes "cumulative" data, so each day shows the total since the pandemic started; it adds the current day number to the previous total. This means that the default bar/line will be always going up. Instead, we want to display the "daily" count (how many new cases in that particular day). In Tableau I show how to do this with a "calculation" using subtraction without changing the original file. We duplicate the bars, change them to line; and this time apply two calculations, the subtraction and the 7-day average (although for some reason in the reverse order). These steps are the same for number 2, 3, and 4.
Note that the dataset included all days (about 350) times all the states, so that's almost 2000 rows, so if using current set, create a new files with the days (rows) just for the state you choose. Sort by state in Excel, the dates somehow will stay in order; keep the headers of course. In the video this graph is done only in Tableau.
2   California covid cases bar chart with 7-day moving average lineBookbinding - Part 1Draw cube with cutsCube: internal sections and planes.Cube Cylinder SphereAristotles lantern by Giorgio ScarpaMilk Carton Unfolded Packagingin pulse 2010 opening night. Late show. (2 of 3)Contour drawing, automatic drawing.Clothespin isometric with drafting toolsurchin 2 handObject axonometric: orthographic, axonometric, exploded.
Pino Trogu |

2 -- California covid cases bar chart with 7-day moving average line

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER