top of page
Writer's pictureYash Sakhuja

Tableau: Creating a Manhattan Chart in Cricket

Manhattan Charts are one of the most effective yet simplest ways to visualise a game of cricket. Named after the Manhattan skyline, these charts highlight overs with heaps of runs—a delight for the batting team and a nightmare for bowlers—while the fall of wickets cracks up these “skyscrapers.” In a single chart, you can see runs scored, the game's momentum as it shifts, and the significant role of fall-of-wickets, all with the simplicity of a bar chart. In this blog, we’ll dive in and learn how to create a Manhattan Chart for cricket analysis using Tableau in all but two calculations (I Promise!). Before we dive in, feel free to try it yourself! Here’s a snippet from my workbook if you’d like to test out your Tableau skills!


Manhattan Chart for Cricket in Tableau
Manhattan Chart for Cricket in Tableau

For this exercise, I scraped ball-by-ball data from the ESPN Cricinfo website for the 2nd Quarter Final match between Lancashire Lightning and Surrey Cricket, played on July 7, 2023, at Emirates Old Trafford. The data was then cleaned and aggregated at the over level for simplicity. Here’s what the final dataset looks like after aggregation and cleaning.


Match Data
Match Data

Step 1 : Plotting Manhattan Bars


Let’s start with the basics: as we can see, Overs are on the X-axis and Runs Scored are on the Y-axis. In Tableau terms, this means Overs (as Discrete) go into Columns, and Sum of Runs Scored (as a Measure) goes into Rows and turn the Marks as Bar. Additionally, to display both innings of the match one below the other, Team is added to Rows as a Discrete Dimension. To label each bar with the total runs, we simply drag and drop the Sum(Runs) onto the label on the Marks shelf. It's all fairly simple so far, and here’s how it looks up to this point:


Step 1: Plotting Manhattan Bars
Step 1: Plotting Manhattan Bars

Step 2 : Plotting Wicket Balls


Now we have both the small and tall buildings of Manhattan, representing the runs scored in each over. The next step is to display the cracks or dents from the fall of wickets, which significantly impact the flow of the innings. These "cracks" are vital to understanding the match’s momentum, as they play a major role in shaping the game’s outcome. Plotting wickets, however, isn’t as simple as plotting runs. To do this, we’ll need a Table Calculation in Tableau. It may sound intimidating, but don’t worry—it’s easier than it seems. Let’s break it down and simplify it for you in Tableau.


Let’s start by adding Wickets (as a Continuous Sum Measure) to Rows, right next to the Runs field. Then, change the marks type to "Circle" from the Marks shelf for Sum(Wickets). Remove all other fields from the Marks shelf and set the color to black for all the circles that appear on the screen. Finally, add the "Ball" field (as a Discrete Dimension) to the Details on the Marks shelf. Here's a snippet for how it looks thus far:


Step 2a) Plotting Wickets
Step 2a) Plotting Wickets

Next, we need to apply a Running Sum Table Calculation on the SUM(Wickets) pill. Left-click on the SUM(Wickets) green pill and select the "Add Table Calculation" option from the dropdown menu. This will open the Table Calculation window. In the Table Calculation window, choose "Running Total" and "Sum" as the calculation type, and set it to compute using Specific Dimensions. Check the boxes for Team, Over, and Ball (in that specific order, making sure to drag them into the list in the correct sequence). Finally, select "Restart every Over" to ensure that the running total for wickets resets at the start of each over to calculate only the number of wickets that fell in that specific over. Here's how the calculation window should look like:


Wickets Table Calculation
Wickets Table Calculation

Once this is done, right-click on the SUM(Wickets) green pill again and select "Dual Axis." Then, on the window pane, right-click on the axis to synchronize the two axes. This ensures that both the runs and wickets are plotted on the same scale for accurate comparison. Here’s how it looks so far:


Step 2b) Plotting Wickets
Step 2b) Plotting Wickets

Step 3 : Formatting


If you haven’t already noticed, in our view so far, circles are appearing even in overs where no wickets fell, showing up at zero. To fix this, we’ll need to write a simple calculation to filter out those instances. This will ensure that circles only appear in overs where a wicket was actually taken. Let’s go ahead and resolve this with a quick calculation.

Hide Null Wickets
IF RUNNING_SUM(SUM([Wickets]))=0 THEN "HIDE"
ELSE
"SHOW"
END

Now, drag this calculation into the Color on the Marks shelf. Since this is a table calculation, right-click on the "Hide Null Wickets" pill on the Marks shelf and select "Edit Table Calculation" from the dropdown menu. The Table Calculation window will appear once again. Choose the same options you selected when creating the earlier Table Calculation. It looks like now all the relevant wicket markers are colored with the "SHOW" color, while the non-relevant ones are shown in blue. To clean up the view, right-click on "Hide" from the legend and select "Hide" from the dropdown. This will hide all the irrelevant circles, leaving only the relevant black wicket markers visible.


Step 3: Formatting
Step 3: Formatting

And there you have it—the famous Manhattan Chart for cricket! All that’s left to do now is format it for better readability. Remove any unnecessary axes, add labels for Wickets and Runs, and resize the marks as needed. Here’s how it looks after completing all the necessary formatting.


Formatted Manhattan Chart
Formatted Manhattan Chart

If you've followed along so far, congratulations—you've successfully built your own Manhattan Chart! You can further enhance it by adding annotations for different match phases, such as the powerplay, middle overs, and death overs, just like I have in my final version.


I hope you found this guide helpful! If you have a cricket chart you've been working on and would like me to take on the challenge of building it for you in Tableau, feel free to reach out.


Signing Off,

Yash Sakhuja

58 views1 comment

Recent Posts

See All

1 Comment


Very informative and an important metric to know. Thanks for this insightful blog✌️

Like
bottom of page